ICX (ICON)

icx_getLastBlock

Returns the last block information.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_getLastBlock"
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "block_hash": "2b3277af6cdfb6388eb05c2bd59f8ee4c754bd7e7817522667acb63e148356cf",
        "confirmed_transaction_list": [
            {
                "data": {
                    "result": {
                        "coveredByFee": "0x0",
                        "coveredByOverIssuedICX": "0x3ccf8c18a92a3000",
                        "issue": "0x0"
                    }
                },
                "dataType": "base",
                "timestamp": "0x6179ee088ddb7",
                "txHash": "0xc19b092ea286f4cfb64a727f554c92941ac77a7d251d34f88da92dfe884ac20f",
                "version": "0x3"
            }
        ],
        "height": 81095103,
        "merkle_tree_root_hash": "084760f36f3403c29a850859a0059f376b3f4c2656d81dfa431ae954c6d0bdfb",
        "peer_id": "hx95248f3757afcb50efa99f529183ba401a82273c",
        "prev_block_hash": "bf138766d3236689e8421317431ae534a717aeb563dcc3ed7c2002ecd4ee3193",
        "signature": "",
        "time_stamp": 1714820999601591,
        "version": "2.0"
    },
    "id": 1001
}

icx_getBlockByHeight

Returns block information by block height.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": "1001",
    "jsonrpc": "2.0",
    "method": "icx_getBlockByHeight",
    "params": {
        "height": "0x100"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "block_hash": "c35d1a1495c19e685111c212cd6cd9290af994f43da04649800e7906f32e0e60",
        "confirmed_transaction_list": [
            {
                "fee": "0x2386f26fc10000",
                "from": "hx2fa0f222a40692fa54ebadb7cfc703f0618f2f1a",
                "method": "icx_sendTransaction",
                "signature": "e2/4ozKQu9Oo3dCMxwvYcUWgcz/LLS2SmVCb/natz5onVvGjFjSBfVIv71AZkMNH8KPWXZz/eK8osW4tnHqmlwE=",
                "timestamp": "1521668857318000",
                "to": "hxd602531cbc85676a5f4cecfdac8ec28c85985112",
                "tx_hash": "18e03233a183eae2ae9830a4994955673fa7567e8bcfd4f538f5e4451f065a70",
                "value": "0x9b41fbf9e0aec00000"
            }
        ],
        "height": 256,
        "merkle_tree_root_hash": "18e03233a183eae2ae9830a4994955673fa7567e8bcfd4f538f5e4451f065a70",
        "peer_id": "hx547c6d5f7e80cd97b95cfefbaad919549a80831c",
        "prev_block_hash": "c23487aaaf7b8cf97f8b1613c978d7d9ac8e968c4c2b922de988e7e65e9cf410",
        "signature": "",
        "time_stamp": 1521668862828233,
        "version": "0.1a"
    },
    "id": "1001"
}

icx_getBlockByHash

Returns block information by block hash.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_getBlockByHash",
    "params": {
        "hash": "0x9d992a7c6da669a9ce7370cc00633f2ec49d58b8e3436e4120dac8250c5772c4"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "block_hash": "9d992a7c6da669a9ce7370cc00633f2ec49d58b8e3436e4120dac8250c5772c4",
        "confirmed_transaction_list": [
            {
                "data": {
                    "result": {
                        "coveredByFee": "0x0",
                        "coveredByOverIssuedICX": "0x3ccf8c18a92a3000",
                        "issue": "0x0"
                    }
                },
                "dataType": "base",
                "timestamp": "0x6179ef50d4537",
                "txHash": "0x8ee6c1c0e1e8a47bfe6bcc90ad6718566321273e32f77bb645ac6ec911a1bd51",
                "version": "0x3"
            }
        ],
        "height": 81095275,
        "merkle_tree_root_hash": "7b1c17b71f8632e6736589c3358251350c027ada681100afed25f9250427f976",
        "peer_id": "hx81719dcfe8f58ca07044b7bede49cecd61f9bd3f",
        "prev_block_hash": "1a50ecb4a396004119be30c2afa0c3a1961c847d717d34c8341e9ad57de6716b",
        "signature": "",
        "time_stamp": 1714821343823159,
        "version": "2.0"
    },
    "id": 1001
}

icx_call

Calls SCORE's external function.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_call",
    "params": {
        "from": "hxbe258ceb872e08851f1f59694dac2558708ece11", // TX sender address
        "to": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32", // SCORE address
        "dataType": "call",
        "data": {
            "method": "get_balance", // SCORE external function
            "params": {
                "address": "hx1f9a3310f60a03934b917509c86442db703cbd52" // input parameter of "get_balance"
            }
        }
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -30002,
        "message": "SCOREError(-30002): E0002:ContractNotFound"
    },
    "id": 1001
}

icx_getBalance

Returns the ICX balance of the given EOA or SCORE.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_getBalance",
    "params": {
        "address": "hxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": "0x0",
    "id": 1001
}

icx_getScoreApi

Returns SCORE's external API list.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_getScoreApi",
    "params": {
        "address": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32" // SCORE address
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -31004,
        "message": "NotFound: E2008:No account for cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32"
    },
    "id": 1001
}

icx_getTotalSupply

Returns total ICX coin supply that has been issued.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_getTotalSupply"
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": "0x33c3115251f2c1eb53262f7",
    "id": 1001
}

icx_getTransactionResult

Returns the transaction result requested by transaction hash.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "jsonrpc": "2.0",
    "id": "1001",
    "method": "icx_getTransactionResult",
    "params": {
        "txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -31004,
        "message": "NotFound: E1005:not found tx=0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f"
    },
    "id": "1001"
}

icx_getTransactionByHash

Returns the transaction information requested by transaction hash.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "jsonrpc": "2.0",
    "id": "1001",
    "method": "icx_getTransactionByHash",
    "params": {
        "txHash": "0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -31004,
        "message": "NotFound: E1005:not found tx=0xd8da71e926052b960def61c64f325412772f8e986f888685bc87c0bc046c2d9f"
    },
    "id": "1001"
}

icx_sendTransaction

You can do one of the followings using this function.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "icx_sendTransaction",
    "id": 1234,
    "params": {
        "version": "0x3",
        "from": "hxbe258ceb872e08851f1f59694dac2558708ece11",
        "to": "hx5bfdb090f43a808005ffc27c25b213145e80b7cd",
        "value": "0xde0b6b3a7640000",
        "stepLimit": "0x12345",
        "timestamp": "0x563a6cf330136",
        "nid": "0x3",
        "nonce": "0x1",
        "signature": "VAia7YZ2Ji6igKWzjR2YsGa2m53nKPrfK7uXYW78QLE+ATehAVZPC40szvAiA6NEU5gCYB4c4qaQzqDh2ugcHgA="
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -31000,
        "message": "SystemError: E1006:ValidateNetwork(nid=0x1) fail"
    },
    "id": 1234
}

icx_getScoreStatus

It returns status information of the smart contract.

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1001,
    "jsonrpc": "2.0",
    "method": "icx_getScoreStatus",
    "params": {
        "address": "cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -31004,
        "message": "NotFound: E1005:NoValidContract(addr=cxb0776ee37f5b45bfaea8cff1d8232fbb6122ec32)"
    },
    "id": 1001
}

icx_getNetworkInfo

It returns basic network information

Method: POST

https://icx.nownodes.io/api/v3

Example body (raw)

{
    "id": 1002,
    "jsonrpc": "2.0",
    "method": "icx_getNetworkInfo"
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "platform": "icon",
        "nid": "0x1",
        "channel": "icon_dex",
        "earliest": "0x0",
        "latest": "0x4d56e35",
        "stepPrice": "0x2e90edd00"
    },
    "id": 1002
}

Last updated