X-Chain

avm.getTxFee

Get the fees of the network.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.getTxFee"
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "txFee": "1000000",
        "createAssetTxFee": "10000000"
    },
    "id": 1
}

avm.getAddressTxs

Returns all transactions that change the balance of the given address.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
  "jsonrpc":"2.0",
  "id"     : 1,
  "method" :"avm.getAddressTxs",
  "params" :{
      "address":"X-local1kpprmfpzzm5lxyene32f6lr7j0aj7gxsu6hp9y",
      "assetID":"AVAX",
      "pageSize":20
  }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32000,
        "message": "couldn't parse argument 'address' to address: couldn't parse address \"X-local1kpprmfpzzm5lxyene32f6lr7j0aj7gxsu6hp9y\": expected hrp \"avax\" but got \"local\"",
        "data": null
    },
    "id": 1
}

avm.getAllBalances

Get the balances of all assets controlled by a given address.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.getAllBalances",
    "params" :{
        "address":"X-avax1c79e0dd0susp7dc8udq34jgk2yvve7hapvdyht"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "balances": []
    },
    "id": 1
}

avm.getAssetDescription

Get information about an asset.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getAssetDescription",
    "params" :{
        "assetID" :"FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": "9"
    },
    "id": 1
}

avm.getBalance

Get the balance of an asset controlled by a given address.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
  "jsonrpc":"2.0",
  "id"     : 1,
  "method" :"avm.getBalance",
  "params" :{
      "address":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5",
      "assetID": "2pYGetDWyKdHxpFxh2LHeoLNCH6H5vxxCxHQtFnnFaYxLsqtHC"
  }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "balance": "0",
        "utxoIDs": []
    },
    "id": 1
}

avm.getBlock

Returns the block with the given id.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "avm.getBlock",
    "params": {
        "blockID": "tXJ4xwmR8soHE6DzRNMQPtiwQvuYsHn6eLLBzo2moDqBquqy6",
        "encoding": "hex"
    },
    "id": 1
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32000,
        "message": "couldn't get block with id tXJ4xwmR8soHE6DzRNMQPtiwQvuYsHn6eLLBzo2moDqBquqy6: not found",
        "data": null
    },
    "id": 1
}

avm.getBlockByHeight

Returns block at the given height.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "avm.getBlockByHeight",
    "params": {
        "height": "275686313486",
        "encoding": "hex"
    },
    "id": 1
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32000,
        "message": "couldn't get block at height 275686313486: not found",
        "data": null
    },
    "id": 1
}

avm.getHeight

Returns the height of the last accepted block.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc": "2.0",
    "method": "avm.getHeight",
    "params": {},
    "id": 1
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "height": "67418"
    },
    "id": 1
}

avm.getTx

Returns the specified transaction. The encoding parameter sets the format of the returned transaction. Can be either "hex" or "json". Defaults to "hex".

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getTx",
    "params" :{
        "txID":"2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL",
        "encoding": "json"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "tx": {
            "unsignedTx": {
                "networkID": 1,
                "blockchainID": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
                "outputs": [],
                "inputs": [
                    {
                        "txID": "2jbZUvi6nHy3Pgmk8xcMpSg5cW6epkPqdKkHSCweb4eRXtq4k9",
                        "outputIndex": 1,
                        "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
                        "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
                        "input": {
                            "amount": 2570382395,
                            "signatureIndices": [
                                0
                            ]
                        }
                    }
                ],
                "memo": "0x",
                "destinationChain": "11111111111111111111111111111111LpoYY",
                "exportedOutputs": [
                    {
                        "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
                        "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
                        "output": {
                            "addresses": [
                                "X-avax1tnuesf6cqwnjw7fxjyk7lhch0vhf0v95wj5jvy"
                            ],
                            "amount": 2569382395,
                            "locktime": 0,
                            "threshold": 1
                        }
                    }
                ]
            },
            "credentials": [
                {
                    "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
                    "credential": {
                        "signatures": [
                            "0x46ebcbcfbee3ece1fd15015204045cf3cb77f42c48d0201fc150341f91f086f177cfca8894ca9b4a0c55d6950218e4ea8c01d5c4aefb85cd7264b47bd57d224400"
                        ]
                    }
                }
            ],
            "id": "2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL"
        },
        "encoding": "json"
    },
    "id": 1
}

avm.getTxStatus

Get the status of a transaction sent to the network.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getTxStatus",
    "params" :{
        "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "status": "Unknown"
    },
    "id": 1
}

avm.getUTXOs

Gets the UTXOs that reference a given address. If sourceChain is specified, then it will retrieve the atomic UTXOs exported from that chain to the X Chain.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avm.getUTXOs",
    "params" :{
        "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"],
        "limit":5,
        "encoding": "hex"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "numFetched": "0",
        "utxos": [],
        "endIndex": {
            "address": "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6",
            "utxo": "11111111111111111111111111111111LpoYY"
        },
        "encoding": "hex"
    },
    "id": 1
}

avm.issueTx

Send a signed transaction to the network. encoding specifies the format of the signed transaction. Can only be hex when a value is provided.

Method: POST

https://avax.nownodes.io/ext/bc/X

Example body (raw)

{
    "jsonrpc":"2.0",
    "id"     : 1,
    "method" :"avm.issueTx",
    "params" :{
        "tx":"0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
        "encoding": "hex"
    }
}

Example response: 200

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32000,
        "message": "couldn't unmarshal struct: couldn't unmarshal interface: unknown type ID 646705",
        "data": null
    },
    "id": 1
}

Last updated