Module: stayge-wallet/icon-js/utils

Provides utility functions

Source:

Methods


<static> convertToHex(str)

Convert string to hexastring

Parameters:
Name Type Description
str String
Source:
Returns:
Type
String

<static> convertToIcx(a)

Convert to icx unit

Parameters:
Name Type Description
a Number | String | BigNumber

number, string, HEX string or BigNumber

Source:
Returns:
Type
String

<static> convertToLoop(value)

Convert to loop unit

Parameters:
Name Type Description
value Number | String | BigNumber
Source:
Returns:
Type
BigNumber

<static> getEndPoint(name)

Returns endpoint of the specified name

Parameters:
Name Type Description
name String

mainnet | testnet

Source:
Returns:
Type
Object

<static> getEndPointFromEnv()

Get a endpoint for current environment

Source:
Returns:
Type
String

<static> isBigNumber()

Returns true if object is BigNumber, otherwise false

Parameters:
Type Description
Object
Source:
Returns:
Type
Boolean

<static> isString(object)

Returns true if object is string, otherwise false

Parameters:
Name Type Description
object Object
Source:
Returns:
Type
Boolean

<static> sleep(ms)

Sleep for the specified time

Parameters:
Name Type Description
ms Number

milliseconds

Source:
Returns:
Type
Promise

<static> toBigNumber(a)

Transforms into an bignumber

Parameters:
Name Type Description
a Number | String | BigNumber

number, string, HEX string or BigNumber

Source:
Returns:

BigNumber

Type
BigNumber

<static> toHashString(value)

Convert to hash string leading '0x'

Parameters:
Name Type Description
value String
Source:
Returns:
Type
String

<static> toHexString(value)

Convert a number to hexadecimal string

Parameters:
Name Type Description
value Number | String | BigNumber
Source:
Returns:
Type
String