Search…
Goloop JSON-RPC API v3

Introduction

This document explains JSON-RPC APIs (version 3) available to interact with Goloop nodes.

Value Types

Basically, every VALUE in JSON-RPC message is string. Below table shows the most common "VALUE types".
VALUE type
Description
Example
"hx" + 40 digit HEX string
hxbe258ceb872e08851f1f59694dac2558708ece11
"cx" + 40 digit HEX string
cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32
T_HASH
"0x" + 64 digit HEX string
0xc71303ef8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238
T_INT
"0x" + lowercase HEX string. No zero padding.
0xa
"0x" + lowercase HEX string. Length must be even.
0x34b2
T_SIG
base64 encoded string
VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA=
Type of data
call, deploy or message
T_STRING
normal string
test, hello, ...

Failure Code

Following is a list of failure codes.
Name
Value
Description
UNKNOWN_FAILURE
1
An uncategorized internal system error occurred.
CONTRACT_NOT_FOUND
2
There is no valid contract on the target address.
METHOD_NOT_FOUND
3
The specified method does not exist or is not usable.
METHOD_NOT_PAYABLE
4
The specified method is not payable.
ILLEGAL_FORMAT
5
An Illegal method parameter or decorator has been declared.
INVALID_PARAMETER
6
An invalid parameter has been passed to a method.
INVALID_INSTANCE
7
An object has not been derived from the appropriate base class.
INVALID_CONTAINER_ACCESS
8
Invalid container access occurred.
ACCESS_DENIED
9
Access operation is denied, typically due to a database permission check.
OUT_OF_STEP
10
Out of step
OUT_OF_BALANCE
11
Out of balance
TIMEOUT_ERROR
12
Timeout error
STACK_OVERFLOW
13
Too deep inter-call
SKIP_TRANSACTION
14
The transaction is not executed.
REVERTED
32 ~ 999
End with revert request.(by Revision5, it was limited to 99)

JSON-RPC Failure

Failure object example
1
{
2
"code" : -32700,
3
"message": "Parse error"
4
}
Copied!
Timeout object example
1
{
2
"code" : -31006,
3
"message": "Timeout",
4
"data": "0x402b630c5ed80d1b8f0d89ca14a091084bcc0f6a98bc52329bccc045415bc0bd"
5
}
Copied!
icx_sendTransactionAndWait and icx_waitTransactionResult may return one of timeout errors. In those cases, it would have transaction hash in data field.

Error Codes

Below table shows the default error messages for the error code. Actual message may vary depending on the implementation.
Category
Error code
Message
Description
Json Parsing
-32700
Parse error
Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
RPC Parsing
-32600
Invalid Request
The JSON sent is not a valid Request object.
-32601
Method not found
The method does not exist / is not available.
-32602
Invalid params
Invalid method parameter(s).
-32603
Internal error
Internal JSON-RPC error.
Server Error
-32000 ~ -32099
Server error.
System Error
-31000
System Error
Unknown system error.
-31001
Pool Overflow
Transaction pool overflow.
-31002
Pending
Transaction is in the pool, but not included in the block.
-31003
Executing
Transaction is included in the block, but it doesn’t have confirmed result.
-31004
Not found
Requested data is not found.
-31005
Lack of resource
Resource is not available.
-31006
Timeout
Fail to get result of transaction in specified timeout
-31007
System timeout
Fail to get result of transaction in system timeout (short time than specified)
SCORE Error
-30000 ~ -30999
Mapped errors from Failure code ( = -30000 - value )

JSON-RPC HTTP Header

You may set HTTP header for extension data of the request.
HTTP Header name : Icon-Options
Option
Description
Allowed APIs
timeout
Timeout for waiting in millisecond
icx_sendTransactionAndWait icx_waitTransactionResult

JSON-RPC Methods

icx_getLastBlock

Returns the last block information.
Request
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"method": "icx_getLastBlock",
5
}
Copied!

Parameters

None
Example responses
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"block_hash": "8e25acc5b5c74375079d51828760821fc6f54283656620b1d5a715edcc0770c6",
5
"confirmed_transaction_list": [
6
{
7
"from": "hx84f6c686fba03bc7ca65d15ae844ee56ff24a32b",
8
"nid": "0x1",
9
"signature": "tCUwOb6vsaUKy+NYvmzdJYC0jm3Erd5cR6wKnVuAjzMOECC+t/oK7fG/Tz2Y3C25o0AfCmbneXpias6xco+43wE=",
10
"stepLimit": "0x3e8",
11
"timestamp": "0x58a14bfe9b904",
12
"to": "hx244deea00413d85c6637e7fdd53afa697f29d08f",
13
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f",
14
"value": "0xa",
15
"version": "0x3"
16
}
17
],
18
"height": 512,
19
"merkle_tree_root_hash": "5c8d4e59ded657c6acbb67030929dfcaf114a268d6d58df53e7174e40db74158",
20
"peer_id": "hx4208599c8f58fed475db747504a80a311a3af63b",
21
"prev_block_hash": "0fdf04d13229482e3533948d4582344a3d44c399e71ab12c653ae57bcbee5d90",
22
"signature": "",
23
"time_stamp": 1559204699330360,
24
"version": "2.0"
25
},
26
"id": "1001"
27
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success
Block

icx_getBlockByHeight

Returns block information by block height.
Request
1
{
2
"id": "1001",
3
"jsonrpc": "2.0",
4
"method": "icx_getBlockByHeight",
5
"params": {
6
"height": "0x100"
7
}
8
}
Copied!

Parameters

KEY
VALUE type
Description
height
T_INT
Integer of a block height
Example responses
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"block_hash": "8e25acc5b5c74375079d51828760821fc6f54283656620b1d5a715edcc0770c6",
5
"confirmed_transaction_list": [
6
{
7
"from": "hx84f6c686fba03bc7ca65d15ae844ee56ff24a32b",
8
"nid": "0x1",
9
"signature": "tCUwOb6vsaUKy+NYvmzdJYC0jm3Erd5cR6wKnVuAjzMOECC+t/oK7fG/Tz2Y3C25o0AfCmbneXpias6xco+43wE=",
10
"stepLimit": "0x3e8",
11
"timestamp": "0x58a14bfe9b904",
12
"to": "hx244deea00413d85c6637e7fdd53afa697f29d08f",
13
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f",
14
"value": "0xa",
15
"version": "0x3"
16
}
17
],
18
"height": 512,
19
"merkle_tree_root_hash": "5c8d4e59ded657c6acbb67030929dfcaf114a268d6d58df53e7174e40db74158",
20
"peer_id": "hx4208599c8f58fed475db747504a80a311a3af63b",
21
"prev_block_hash": "0fdf04d13229482e3533948d4582344a3d44c399e71ab12c653ae57bcbee5d90",
22
"signature": "",
23
"time_stamp": 1559204699330360,
24
"version": "2.0"
25
},
26
"id": "1001"
27
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success
Block

icx_getBlockByHash

Returns block information by block hash.
Request
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"method": "icx_getBlockByHeight",
5
"params": {
6
"hash": "8e25acc5b5c74375079d51828760821fc6f54283656620b1d5a715edcc0770c6"
7
}
8
}
Copied!

Parameters

KEY
VALUE type
Description
hash
T_HASH
Hash of a block
Example responses
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"block_hash": "8e25acc5b5c74375079d51828760821fc6f54283656620b1d5a715edcc0770c6",
5
"confirmed_transaction_list": [
6
{
7
"from": "hx84f6c686fba03bc7ca65d15ae844ee56ff24a32b",
8
"nid": "0x1",
9
"signature": "tCUwOb6vsaUKy+NYvmzdJYC0jm3Erd5cR6wKnVuAjzMOECC+t/oK7fG/Tz2Y3C25o0AfCmbneXpias6xco+43wE=",
10
"stepLimit": "0x3e8",
11
"timestamp": "0x58a14bfe9b904",
12
"to": "hx244deea00413d85c6637e7fdd53afa697f29d08f",
13
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f",
14
"value": "0xa",
15
"version": "0x3"
16
}
17
],
18
"height": 512,
19
"merkle_tree_root_hash": "5c8d4e59ded657c6acbb67030929dfcaf114a268d6d58df53e7174e40db74158",
20
"peer_id": "hx4208599c8f58fed475db747504a80a311a3af63b",
21
"prev_block_hash": "0fdf04d13229482e3533948d4582344a3d44c399e71ab12c653ae57bcbee5d90",
22
"signature": "",
23
"time_stamp": 1559204699330360,
24
"version": "2.0"
25
},
26
"id": "1001"
27
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success
Block

icx_call

Calls SCORE's external function.
Does not make state transition (i.e., read-only).
Request
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"method": "icx_call",
5
"params": {
6
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11", // TX sender address
7
"to": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32", // SCORE address
8
"dataType": "call",
9
"data": {
10
"method": "get_balance", // SCORE external function
11
"params": {
12
"address": "hx1f9a3310f60a03934b917509c86442db703cbd52" // input parameter of "get_balance"
13
}
14
}
15
}
16
}
Copied!

Parameters

KEY
VALUE type
Description
from
Message sender's address.
to
SCORE address that will handle the message.
dataType
call is the only possible data type.
data
JSON object
data.method
JSON string
Name of the function.
data.params
JSON object
Parameters to be passed to the function.
Example responses
1
{
2
"jsonrpc": "2.0",
3
"result": "0x2961fff8ca4a62327800000",
4
"id": 1001
5
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success

icx_getBalance

Returns the ICX balance of the given EOA or SCORE.
Request
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"method": "icx_getBalance",
5
"params": {
6
"address": "hxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32"
7
}
8
}
Copied!

Parameters

KEY
VALUE type
Description
address
Address of EOA or SCORE
Example responses
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"result": "0xde0b6b3a7640000"
5
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success

icx_getScoreApi

Returns SCORE's external API list.
Request
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"method": "icx_getScoreApi",
5
"params": {
6
"address": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32" // SCORE address
7
}
8
}
Copied!

Parameters

KEY
VALUE type
Description
address
SCORE address to be examined.
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": [
5
{
6
"type": "function",
7
"name": "balanceOf",
8
"inputs": [
9
{
10
"name": "_owner",
11
"type": "Address"
12
}
13
],
14
"outputs": [
15
{
16
"type": "int"
17
}
18
],
19
"readonly": "0x1"
20
},
21
{
22
"type": "eventlog",
23
"name": "FundTransfer",
24
"inputs": [
25
{
26
"name": "backer",
27
"type": "Address",
28
"indexed": "0x1"
29
},
30
{
31
"name": "amount",
32
"type": "int",
33
"indexed": "0x1"
34
},
35
{
36
"name": "is_contribution",
37
"type": "bool",
38
"indexed": "0x1"
39
}
40
]
41
},
42
{...}
43
]
44
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success
  • Fields containing information about the function
    • type : function, fallback, or eventlog
    • name : function name
    • inputs : parameters in array
      • name : parameter name
      • type : parameter type (int, str, bytes, bool, Address)
      • indexed : 0x1 if the parameter is indexed (when this is eventlog)
    • outputs : return value
      • type : return value type (int, str, bytes, bool, Address, dict, list)
    • readonly : 0x1 if this is declared as external(readonly=True)
    • payable : 0x1 if this has payable decorator

icx_getTotalSupply

Returns total ICX coin supply that has been issued.
Request
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"method": "icx_getTotalSupply",
5
}
Copied!

Parameters

None
Example responses
1
{
2
"id": 1001,
3
"jsonrpc": "2.0",
4
"result": "0x2961fff8ca4a62327800000"
5
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success

icx_getTransactionResult

Returns the transaction result requested by transaction hash.
Request
1
{
2
"jsonrpc": "2.0",
3
"id": "1001",
4
"method": "icx_getTransactionResult",
5
"params": {
6
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f"
7
}
8
}
Copied!

Parameters

KEY
VALUE type
Description
txHash
T_HASH
Hash of the transaction
Example responses
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"blockHash": "0x8ef3b2a67262b9b1fe4b598059774472e9ccef401734335d87a4ba998cfd40fb",
5
"blockHeight": "0x200",
6
"cumulativeStepUsed": "0x0",
7
"eventLogs": [],
8
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
9
"status": "0x1",
10
"stepPrice": "0x0",
11
"stepUsed": "0x0",
12
"to": "hx244deea00413d85c6637e7fdd53afa697f29d08f",
13
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f",
14
"txIndex": "0x0"
15
},
16
"id": "1001"
17
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success
Block
KEY
VALUE type
Description
status
T_INT
1 on success, 0 on failure.
to
Recipient address of the transaction
failure
JSON object
This field exists when status is 0. Please refer failure object
txHash
T_HASH
Transaction hash
txIndex
T_INT
Transaction index in the block
blockHeight
T_INT
Height of the block that includes the transaction.
blockHash
T_HASH
Hash of the block that includes the transaction.
cumulativeStepUsed
T_INT
Sum of stepUsed by this transaction and all preceding transactions in the same block.
stepUsed
T_INT
The amount of step used by this transaction.
stepPrice
T_INT
The step price used by this transaction.
scoreAddress
SCORE address if the transaction created a new SCORE. (optional)
eventLogs
T_ARRAY
Array of eventlogs, which this transaction generated.
logsBloom
Bloom filter to quickly retrieve related eventlogs.
KEY
VALUE type
Description
code
T_INT
message
T_STRING
Message for the failure.

icx_getTransactionByHash

Returns the transaction information requested by transaction hash.
Request
1
{
2
"jsonrpc": "2.0",
3
"id": "1001",
4
"method": "icx_getTransactionByHash",
5
"params": {
6
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f"
7
}
8
}
Copied!

Parameters

KEY
VALUE type
Description
txHash
T_HASH
Hash of the transaction
Example responses
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"blockHash": "0x8ef3b2a67262b9b1fe4b598059774472e9ccef401734335d87a4ba998cfd40fb",
5
"blockHeight": "0x200",
6
"from": "hx84f6c686fba03bc7ca65d15ae844ee56ff24a32b",
7
"nid": "0x1",
8
"signature": "tCUwOb6vsaUKy+NYvmzdJYC0jm3Erd5cR6wKnVuAjzMOECC+t/oK7fG/Tz2Y3C25o0AfCmbneXpias6xco+43wE=",
9
"stepLimit": "0x3e8",
10
"timestamp": "0x58a14bfe9b904",
11
"to": "hx244deea00413d85c6637e7fdd53afa697f29d08f",
12
"txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f",
13
"txIndex": "0x0",
14
"value": "0xa",
15
"version": "0x3"
16
},
17
"id": "1001"
18
}
Copied!

Responses

Status
Meaning
Description
Schema
200
OK
Success
Block
KEY
VALUE type
Description
version
T_INT
Protocol version ("0x3" for V3)
from
EOA address that created the transaction
to
EOA address to receive coins, or SCORE address to execute the transaction.
value
T_INT
Amount of ICX coins in loop to transfer. When omitted, assumes 0. (1 icx = 1 ^ 18 loop)
stepLimit
T_INT
Maximum step allowance that can be used by the transaction.
timestamp
T_INT
Transaction creation time. Timestamp is in microsecond.
nid
T_INT
Network ID
nonce
T_INT
An arbitrary number used to prevent transaction hash collision.
txHash
T_HASH
Transaction hash
txIndex
T_INT
Transaction index in a block. Null when it is pending.
blockHeight
T_INT
Block height where this transaction was in. Null when it is pending.
blockHash
T_HASH
Hash of the block where this transaction was in. Null when it is pending.
signature
T_SIG
Signature of the transaction.
dataType
Type of data. (call, deploy, message or deposit)
data
JSON object
Contains various type of data depending on the dataType. See Parameters - data.

icx_sendTransaction

You can do one of the followings using this function.
  • Transfer designated amount of ICX coins from 'from' address to 'to' address.
  • Install a new SCORE.
  • Update the SCORE in the 'to' address.
  • Invoke a function of the SCORE in the 'to' address.
  • Transfer a message.
  • Change deposit of the SCORE.
This function causes state transition.
Coin transfer
1
{
2
"jsonrpc": "2.0",
3
"method": "icx_sendTransaction",
4
"id": 1234,
5
"params": {
6
"version": "0x3",
7
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
8
"to": "hx5bfdb090f43a808005ffc27c25b213145e80b7cd",
9
"value": "0xde0b6b3a7640000",
10
"stepLimit": "0x12345",
11
"timestamp": "0x563a6cf330136",
12
"nid": "0x3",
13
"nonce": "0x1",
14
"signature": "VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA="
15
}
16
}
Copied!
SCORE function call
1
{
2
"jsonrpc": "2.0",
3
"method": "icx_sendTransaction",
4
"id": 1234,
5
"params": {
6
"version": "0x3",
7
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
8
"to": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32",
9
"stepLimit": "0x12345",
10
"timestamp": "0x563a6cf330136",
11
"nid": "0x3",
12
"nonce": "0x1",
13
"signature": "VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA=",
14
"dataType": "call",
15
"data": {
16
"method": "transfer",
17
"params": {
18
"to": "hxab2d8215eab14bc6bdd8bfb2c8151257032ecd8b",
19
"value": "0x1"
20
}
21
}
22
}
23
}
Copied!
SCORE install
1
{
2
"jsonrpc": "2.0",
3
"method": "icx_sendTransaction",
4
"id": 1234,
5
"params": {
6
"version": "0x3",
7
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
8
"to": "cx0000000000000000000000000000000000000000", // address 0 means SCORE install
9
"stepLimit": "0x12345",
10
"timestamp": "0x563a6cf330136",
11
"nid": "0x3",
12
"nonce": "0x1",
13
"signature": "VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA=",
14
"dataType": "deploy",
15
"data": {
16
"contentType": "application/zip",
17
"content": "0x1867291283973610982301923812873419826abcdef91827319263187263a7326e...", // compressed SCORE data
18
"params": { // parameters to be passed to on_install()
19
"name": "ABCToken",
20
"symbol": "abc",
21
"decimals": "0x12"
22
}
23
}
24
}
25
}
Copied!
SCORE update
1
{
2
"jsonrpc": "2.0",
3
"method": "icx_sendTransaction",
4
"id": 1234,
5
"params": {
6
"version": "0x3",
7
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
8
"to": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32", // SCORE address to be updated
9
"stepLimit": "0x12345",
10
"timestamp": "0x563a6cf330136",
11
"nid": "0x3",
12
"nonce": "0x1",
13
"signature": "VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA=",
14
"dataType": "deploy",
15
"data": {
16
"contentType": "application/zip",
17
"content": "0x1867291283973610982301923812873419826abcdef91827319263187263a7326e...", // compressed SCORE data
18
"params": { // parameters to be passed to on_update()
19
"amount": "0x1234"
20
}
21
}
22
}
23
}
Copied!
Message transfer
1
{
2
"jsonrpc": "2.0",
3
"method": "icx_sendTransaction",
4
"id": 1234,
5
"params": {
6
"version": "0x3",
7
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
8
"to": "hxbe258ceb872e08851f1f59694dac2558708ece11",
9
"stepLimit": "0x12345",
10
"timestamp": "0x563a6cf330136",
11
"nid": "0x3",
12
"nonce": "0x1",
13
"signature": "VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA=",
14
"dataType": "message",
15
"data": "0x4c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e"
16
}
17
}
Copied!
Deposit add
1
{
2
"jsonrpc": "2.0",
3
"method": "icx_sendTransaction",
4
"id": 1234,
5
"params": {
6
"version": "0x3",
7
"from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
8
"timestamp": "0x563a6cf330136",
9
"to": "cx2f501ff91ad48732673adf55a04f36d466cf269c",
10
"stepLimit": "0x50000000",
11
"nid": "0x3",
12
"nonce": "0x1",
13
"value": "0x10f0cf064dd59200000",
14
"dataType": "deposit",
15
"data": {
16
"action": "add",
17
}
18
}
19
}
Copied!

Parameters

KEY
VALUE type
Required
Description
version
T_INT
required
Protocol version ("0x3" for V3)
from
required
EOA address that created the transaction
to
required
EOA address to receive coins, or SCORE address to execute the transaction.
value
T_INT
optional
Amount of ICX coins in loop to transfer. When omitted, assumes 0. (1 icx = 1 ^ 18 loop)
stepLimit
T_INT
required
Maximum step allowance that can be used by the transaction.
timestamp
T_INT
required
Transaction creation time. Timestamp is in microsecond.
nid
T_INT
required
Network ID ("0x1" for Mainnet, "0x2" for Testnet, etc)
nonce
T_INT
optional
An arbitrary number used to prevent transaction hash collision.
signature
T_SIG
required
Signature of the transaction.
dataType
optional
Type of data. (call, deploy, message or deposit)
data
JSON object
optional
The content of data varies depending on the dataType. See Parameters - data.
data contains the following data in various formats depending on the dataType.
dataType == call
It is used when calling a function in SCORE, and data has dictionary value as follows.
KEY
VALUE type
Required
Description
method
String
required
Name of the function to invoke in SCORE
params
JSON object
optional
Function parameters
dataType == deploy
It is used when installing or updating a SCORE, and data has dictionary value as follows.
KEY
VALUE type
Required
Description
contentType
String
required
Mime-type of the content
content
required
Compressed SCORE data
params
JSON object
optional
Function parameters will be delivered to on_install() or on_update()