Module: stayge-wallet/icon-js/jsonrpc

Provides APIs for jsonrpc of ICON

Source:

Methods


<static> call(params, endpoint)

call SCORE's external function

Parameters:
Name Type Description
params Object
endpoint String
Source:
Returns:
Type
Promise.<String>

<static> getBalance(address, endpoint)

Get a balance of the address

Parameters:
Name Type Description
address String
endpoint String
Source:
Returns:

balance

Type
Promise.<String>

<static> getBlockByHash(hash, endpoint)

Get a block information by hash

Parameters:
Name Type Description
hash String
endpoint String
Source:
Returns:
Type
Promise.<Object>

<static> getBlockByHeight(height, endpoint)

Get a block information by height

Parameters:
Name Type Description
height Number
endpoint String
Source:
Returns:
Type
Promise.<Object>

<static> getLastBlock(endpoint)

Get a last block information

Parameters:
Name Type Description
endpoint String
Source:
Returns:
Type
Promise.<Object>

<static> getScoreApi(address, endpoint)

Return score api

Parameters:
Name Type Description
address String
endpoint String
Source:
Returns:
Type
Promise.<Object>

<static> getTotalSupply(endpoint)

Get total supply of ICX

Parameters:
Name Type Description
endpoint String
Source:
Returns:

total supply

Type
Promise.<String>

<static> getTransactionByHash(txHash, endpoint)

Get the transaction information by txHash

Parameters:
Name Type Description
txHash String
endpoint String
Source:
Returns:

transaction information

Type
Promise.<Object>

<static> getTransactionResult(txHash, endpoint)

Get the transaction result requested by transaction hash

Parameters:
Name Type Description
txHash String
endpoint String
Source:
Returns:
Type
Promise.<Object>

<static> sendTransaction(rawTx, endpoint)

Send a transaction

Parameters:
Name Type Description
rawTx Object

[description]

endpoint String

[description]

Source:
Returns:

transaction hash

Type
Promise.<String>

<inner> getCurrentApiPrefix()

Return prefix string of current api version

Source:
Returns:
Type
String

<async, inner> requestJsonRpc(url, payload)

Make a request via json rpc

Parameters:
Name Type Description
url String
payload Object
Source:
Returns:
Type
Promise.<Object>

<inner> toPayload(method, params)

Return payload for json rpc 2.0

Parameters:
Name Type Description
method String
params Object
Source:
Returns:
Type
Object