Xoken Nexa - Developer API
The API request & response messages are shown in Json-RPC format. The API also supports CBOR - an efficient binary encoding format.

Get Block by block height


Request JSON structure:
{
   "id":0,
   "jsonrpc":"2.0",
   "method":"HEIGHT->BLOCK",
   "params":{
      "gbHeight":100
   }
}
Response JSON structure:
{
   "result":{
      "block":{
         "rbHeight":100,
         "rbHash":"000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a",
         "rbHeader":{
            "blockBits":486604799,
            "prevBlock":"00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995",
            "blockVersion":1,
            "merkleRoot":"660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d",
            "blockTimestamp":1231660825,
            "bhNonce":1573057331
         }
      }
   },
   "jsonrpc":"2.0",
   "id":0
}

Get Blocks by block heights


Request JSON structure:
{
   "id":1,
   "jsonrpc":"2.0",
   "method":"[HEIGHT]->[BLOCK]",
   "params":{
      "gbHeights":[
         100,
         101,
         102
      ]
   }
}
Response JSON structure:
{
   "result":{
      "blocks":[
         {
            "rbHeight":100,
            "rbHash":"000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a",
            "rbHeader":{
               "blockBits":486604799,
               "prevBlock":"00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995",
               "blockVersion":1,
               "merkleRoot":"660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d",
               "blockTimestamp":1231660825,
               "bhNonce":1573057331
            }
         },
         {
            "rbHeight":101,
            "rbHash":"00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984",
            "rbHeader":{
               "blockBits":486604799,
               "prevBlock":"000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a",
               "blockVersion":1,
               "merkleRoot":"f7a5d0816883ec2f4d237082b47b4d3a6a26549d65ac50d8527b67ab4cb7e6cf",
               "blockTimestamp":1231661741,
               "bhNonce":4136106517
            }
         },
         {
            "rbHeight":102,
            "rbHash":"000000001604181f13f19fd3cc89366ec95ce1dd64b776784ef8855210622f19",
            "rbHeader":{
               "blockBits":486604799,
               "prevBlock":"00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984",
               "blockVersion":1,
               "merkleRoot":"ceefaf23adb1009753545c230a374c48851676ccb7d6f004b66dd302ceb5443b",
               "blockTimestamp":1231662670,
               "bhNonce":1906126361
            }
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":1
}

Get Block by block hash


Request JSON structure:
{
   "id":2,
   "jsonrpc":"2.0",
   "method":"HASH->BLOCK",
   "params":{
      "gbBlockHash":"00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee"
   }
}
Response JSON structure:
{
   "result":{
      "block":{
         "rbHeight":170,
         "rbHash":"00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee",
         "rbHeader":{
            "blockBits":486604799,
            "prevBlock":"000000002a22cfee1f2c846adbd12b3e183d4f97683f85dad08a79780a84bd55",
            "blockVersion":1,
            "merkleRoot":"ff104ccb05421ab93e63f8c3ce5c2c2e9dbb37de2764b3a3175c8166562cac7d",
            "blockTimestamp":1231731025,
            "bhNonce":1889418792
         }
      }
   },
   "jsonrpc":"2.0",
   "id":2
}

Get Blocks by block hashes


Request JSON structure:
{
   "id":3,
   "jsonrpc":"2.0",
   "method":"[HASH]->[BLOCK]",
   "params":{
      "gbBlockHashes":[
         "000000000000000002af2a6de04d4a1a73973827eae348fe4d3f4d05610ff968",
         "000000000000000007fc734cbf1fc04c59cf7ecb6af0707fd5cf5b8d46dc4c75"
      ]
   }
}
Response JSON structure:
{
   "result":{
      "blocks":[
         {
            "rbHeight":505012,
            "rbHash":"000000000000000002af2a6de04d4a1a73973827eae348fe4d3f4d05610ff968",
            "rbHeader":{
               "blockBits":403108785,
               "prevBlock":"0000000000000000059938946425a9582aaa0d8fe5f3fdd0d320c8e10be3dfe2",
               "blockVersion":536870912,
               "merkleRoot":"580432aab122171ab858444fc38e4a38f2344ab6a719248bc9ff3f21657fd495",
               "blockTimestamp":1511205051,
               "bhNonce":2863327913
            }
         },
         {
            "rbHeight":356303,
            "rbHash":"000000000000000007fc734cbf1fc04c59cf7ecb6af0707fd5cf5b8d46dc4c75",
            "rbHeader":{
               "blockBits":404165597,
               "prevBlock":"000000000000000001bbbcc2d3c4f0b7708790f421b77513a5bf836a0e0a8136",
               "blockVersion":2,
               "merkleRoot":"369bec4d7c42285839880aa59bdc9c02e33ab3f1e3901c52d4e850fd95ba5b58",
               "blockTimestamp":1431553391,
               "bhNonce":1952425675
            }
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":3
}

Get Transaction by TxID


Request JSON structure:
{
   "id":4,
   "jsonrpc":"2.0",
   "method":"TXID->TX",
   "params":{
      "gtTxHash":"3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac"
   }
}
Response JSON structure:
{
   "result":{
      "tx":{
         "tx":{
            "txOut":[
               {
                  "outValue":5000000000,
                  "scriptOutput":"4104475ec18308df851394a128d712cdd9373f2aa9792a90f8e12f4ae346ad759b986575dbff3ecc62c101f17740d78ca20a1a955736fdbc7eb29214a51e28ba7423ac"
               }
            ],
            "txVersion":1,
            "txLockTime":0,
            "txIn":[
               {
                  "txInSequence":4294967295,
                  "scriptInput":"04ffff001d02de08",
                  "prevOutput":{
                     "outPointIndex":4294967295,
                     "outPointHash":"0000000000000000000000000000000000000000000000000000000000000000"
                  }
               }
            ]
         },
         "txBlockInfo":{
            "binfBlockHeight":9128,
            "binfBlockHash":"00000000329ba70d8c8351b852cd67f5ff2c5479f13ce0b2502fa36bd16778d7",
            "binfTxIndex":1
         },
         "txId":"3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac"
      }
   },
   "jsonrpc":"2.0",
   "id":4
}

Get Transactions by TxIDs


Request JSON structure:
{
   "id":6,
   "jsonrpc":"2.0",
   "method":"[TXID]->[TX]",
   "params":{
      "gtTxHashes":[
         "3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac",
         "54c693db802d83596e3a0cdec1f99dc01af246ca51b82adaad2f41e0a8fb2131"
      ]
   }
}
Response JSON structure:
{
   "result":{
      "txs":[
         {
            "tx":{
               "txOut":[
                  {
                     "outValue":5000000000,
                     "scriptOutput":"4104475ec18308df851394a128d712cdd9373f2aa9792a90f8e12f4ae346ad759b986575dbff3ecc62c101f17740d78ca20a1a955736fdbc7eb29214a51e28ba7423ac"
                  }
               ],
               "txVersion":1,
               "txLockTime":0,
               "txIn":[
                  {
                     "txInSequence":4294967295,
                     "scriptInput":"04ffff001d02de08",
                     "prevOutput":{
                        "outPointIndex":4294967295,
                        "outPointHash":"0000000000000000000000000000000000000000000000000000000000000000"
                     }
                  }
               ]
            },
            "txBlockInfo":{
               "binfBlockHeight":9128,
               "binfBlockHash":"00000000329ba70d8c8351b852cd67f5ff2c5479f13ce0b2502fa36bd16778d7",
               "binfTxIndex":1
            },
            "txId":"3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac"
         },
         {
            "tx":{
               "txOut":[
                  {
                     "outValue":232499850000,
                     "scriptOutput":"76a91449c4e300e59e2be3e40d0e0764328b0add9c33d588ac"
                  },
                  {
                     "outValue":7500000000,
                     "scriptOutput":"76a914614fe56f49d064a9e6eaa33bf0796c871a7888b488ac"
                  }
               ],
               "txVersion":1,
               "txLockTime":0,
               "txIn":[
                  {
                     "txInSequence":4294967295,
                     "scriptInput":"483045022100aacffab517ffa70ff177df2a752e20541ff4d823acd9aeef84098d9305c3aa0e02202b1849f523f89aa3078290f139f9d429bcecf2e2e5e100f9931c61c4fec21960014104054d44c43929bb0365cb6d4dd842bb750907489de164b65fd5a8874120d4ca83290dc611d03c5e81a76668f9f752ee31d055a5b31c284aaa2e7e98a5ba45c1a8",
                     "prevOutput":{
                        "outPointIndex":0,
                        "outPointHash":"8caf44a492d8cabb725aedb3f81f07fc6285955e6f5ea1d13b6be28bd50e2028"
                     }
                  }
               ]
            },
            "txBlockInfo":{
               "binfBlockHeight":200100,
               "binfBlockHash":"000000000000045d7f10aa3eca5beccc17aceb505592fcd8298e46bc8211052a",
               "binfTxIndex":2
            },
            "txId":"54c693db802d83596e3a0cdec1f99dc01af246ca51b82adaad2f41e0a8fb2131"
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":6
}

Get Raw Transaction by TxID


Request JSON structure:
{
   "id":5,
   "jsonrpc":"2.0",
   "method":"TXID->RAWTX",
   "params":{
      "gtRTxHash":"3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac"
   }
}
Response JSON structure
{
   "result":{
      "rawTx":{
         "txBlockInfo":{
            "binfBlockHeight":9128,
            "binfBlockHash":"00000000329ba70d8c8351b852cd67f5ff2c5479f13ce0b2502fa36bd16778d7",
            "binfTxIndex":1
         },
         "txSerialized":"H4sIAAAAAAAAA2NkYGBgZCAA/gMBB8v//wyyTPc4QBxGhk+sWiBtzo4s7nEHmznutwpPWahxXejsTXN7rZWVWhN+PNT3euy2tnT2jNTS2//tziQdZPxY7nC9ZxGX1NRws7976jZNElkqp7GrRHkNyAYAcVUWP4cAAAA=",
         "txId":"3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac"
      }
   },
   "jsonrpc":"2.0",
   "id":5
}

Get Raw Transactions by TxIDs


Request JSON structure:
{
   "id":7,
   "jsonrpc":"2.0",
   "method":"[TXID]->[RAWTX]",
   "params":{
      "gtRTxHashes":[
         "3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac",
         "54c693db802d83596e3a0cdec1f99dc01af246ca51b82adaad2f41e0a8fb2131"
      ]
   }
}
Response JSON structure:
{
   "result":{
      "rawTxs":[
         {
            "txBlockInfo":{
               "binfBlockHeight":9128,
               "binfBlockHash":"00000000329ba70d8c8351b852cd67f5ff2c5479f13ce0b2502fa36bd16778d7",
               "binfTxIndex":1
            },
            "txSerialized":"H4sIAAAAAAAAA2NkYGBgZCAA/gMBB8v//wyyTPc4QBxGhk+sWiBtzo4s7nEHmznutwpPWahxXejsTXN7rZWVWhN+PNT3euy2tnT2jNTS2//tziQdZPxY7nC9ZxGX1NRws7976jZNElkqp7GrRHkNyAYAcVUWP4cAAAA=",
            "txId":"3e7861a8f18df990bf3b074718018cf7a1e7f32447bbf13ffc93327b7bf608ac"
         },
         {
            "txBlockInfo":{
               "binfBlockHeight":200100,
               "binfBlockHash":"000000000000045d7f10aa3eca5beccc17aceb505592fcd8298e46bc8211052a",
               "binfTxIndex":2
            },
            "txSerialized":"H4sIAAAAAAAAA2NkYGBg1FDgu9r9KNv64sK4/LiprUl/2OV/bH4bVbT71I1JS1zW9wDVMHR7GLgyKTKsOv9rq/j/5fwfy+9rleophMh/uaG85ua69y2cvZNZD6/iY1LQlvD8qvxj1mL2pgkfLX9e0dzz5tOjpw8Zfk6WSTzy75BkAqMjC6uvyxFLzd3MqadzfW847S7lZPeY+zBlW/zVFe2OCldONWvyHhO8YBPXuDwt4+f3oHeGF0KXbpbR8FqlVzdj6S7Xgyv+AwGTgLaQkhnQYZJlK0U8jzxmeDpP+/ETXj72FKNurrtzjK92rGF4zbGfEaoi0f9pvueFlJXPXi22/lCZ0y5V0bEFqAIIADjSzQcCAQAA",
            "txId":"54c693db802d83596e3a0cdec1f99dc01af246ca51b82adaad2f41e0a8fb2131"
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":7
}

Broadcast Raw Transaction


Request JSON structure:
{
   "id":11,
   "jsonrpc":"2.0",
   "method":"RELAY_TX",
   "params":{
      "rTx":"H4sIAAAAAAACA2NkYGBg+nv/4u8f7LrTHcL8FtlyKK34HBt0KyKh/FiCTMntjulT/7IAFXW5G7gwKSSc+rhg4hpBqQOWZ/XXR1XcC+Uyb0z70HbcwP7pfR6pq2pMCnkanHW7eY99b9zxh3WhSEs9O5OtwpOzIUe+bo4/83zVrGuMjiwLUyz1j8wP+W/Btk2j1qMqXO/1Lv0qL/603sMXJ3088qSil6f/nuPaQ75OPlO3aPNp7ew43P/sWfuELZKdWnuf7F4v+B8ILFbJf8mMnVy7Jb2g9ebf6/8MZmqzbs1zTDf4u+Qhy4xzgQxwJ8vNyJPdecjL0LDUp7I6vbN5ifNPY5d87fWRSizh/0OynjApuFbdDazZXNj9/+CxCVbFWfODXRSNhTtu7+xfbbZ9yvN7flRyMhsDFExkyOJ3zMlJTc8vqtQHMgISK31qWxgYGyWiWxmaGBiagQRjYzNDRkR+dmpegFFARnF+bmppUaZhI0iKCZuUUVMzWB8zNkljifRmRpAsCzZZE4kMByd+sMvEV4qsnO7IsO7ddC+FsysXfXUt8OLa6n+n3YGXGSZfKxxS6vLm4Ke+Wzzsae/9NoncE3CluTxIDgBSJZnLqgIAAA=="
   }
}
Response JSON structure:
{
   "result":{
      "rrTx":true
   },
   "jsonrpc":"2.0",
   "id":11
}

Get Outputs by Address


Request JSON structure:
{
   "id":8,
   "jsonrpc":"2.0",
   "method":"ADDR->[OUTPUT]",
   "params":{
      "gaAddrOutputs":"13n561iVozTtMXJzAJNA5TQsnTboRvpxae"
   }
}
Response JSON structure:
{
   "result":{
      "saddressOutputs":[
         {
            "aoIsTypeReceive":false,
            "aoValue":300000000000,
            "aoPrevOutpoint":{
               "opTxHash":"486f67c9f2c1599a208a7bcbea195b482a273cba64d4422666374703d5c9ecfe",
               "opIndex":0
            },
            "aoIsBlockConfirmed":false,
            "aoBlockInfo":{
               "binfBlockHeight":2,
               "binfBlockHash":"00000000201016a83272835468d457d15965d57f57c0da5944dc94ea9389f360",
               "binfTxIndex":15968
            },
            "aoOtherAddress":"12higDjoCCNXSA95xZMWUdPvXNmkAduhWv",
            "aoIsOutputSpent":false,
            "aoAddress":"13n561iVozTtMXJzAJNA5TQsnTboRvpxae",
            "aoOutput":{
               "opTxHash":"06032a172f88ba823785f87341eab26ee7a2eb2de9d2f105220d6580e3affc16",
               "opIndex":59
            }
         },
         {
            "aoIsTypeReceive":true,
            "aoValue":5000000000,
            "aoPrevOutpoint":{
               "opTxHash":"0000000000000000000000000000000000000000000000000000000000000000",
               "opIndex":-1
            },
            "aoIsBlockConfirmed":false,
            "aoBlockInfo":{
               "binfBlockHeight":1,
               "binfBlockHash":"00000000787bb5153d76225b438596b3fc01cf8a27beec9c9fb48c20b911edfc",
               "binfTxIndex":15241
            },
            "aoOtherAddress":"",
            "aoIsOutputSpent":false,
            "aoAddress":"13n561iVozTtMXJzAJNA5TQsnTboRvpxae",
            "aoOutput":{
               "opTxHash":"486f67c9f2c1599a208a7bcbea195b482a273cba64d4422666374703d5c9ecfe",
               "opIndex":0
            }
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":8
}

Get Outputs by Addresses


Request JSON structure:
{
   "id":9,
   "jsonrpc":"2.0",
   "method":"[ADDR]->[OUTPUT]",
   "params":{
      "gasAddrOutputs":[
         "1P8Jd8qQM7y45iXLM1eiXCCmGRhCPjykZB",
         "16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R"
      ]
   }
}
Response JSON structure:
{
   "result":{
      "maddressOutputs":[
         {
            "aoIsTypeReceive":false,
            "aoValue":1409000000,
            "aoPrevOutpoint":{
               "opTxHash":"b5d50046994f7e8bc4a77cc9762d274d724af08ea09e7433652b6fef2b058057",
               "opIndex":0
            },
            "aoIsBlockConfirmed":false,
            "aoBlockInfo":{
               "binfBlockHeight":4,
               "binfBlockHash":"00000000002a02ca13cf12115a8e1454831222ca0960e868ef5bbd34b10f7eff",
               "binfTxIndex":82659
            },
            "aoOtherAddress":"1GDcVTrZNhVFt7pEnwvHfepoth6mqHVVvq",
            "aoIsOutputSpent":false,
            "aoAddress":"16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R",
            "aoOutput":{
               "opTxHash":"aaaa2ef07c4aa47a15375ba6a920a0e93b82a4307d5d45ccaf2672d1e60d29e4",
               "opIndex":391
            }
         },
         {
            "aoIsTypeReceive":true,
            "aoValue":5000000000,
            "aoPrevOutpoint":{
               "opTxHash":"0000000000000000000000000000000000000000000000000000000000000000",
               "opIndex":-1
            },
            "aoIsBlockConfirmed":false,
            "aoBlockInfo":{
               "binfBlockHeight":1,
               "binfBlockHash":"000000005aa54c73c253c5a5dd8ca1dff3d092f8bbecc965f0eb3e72a83e2386",
               "binfTxIndex":16772
            },
            "aoOtherAddress":"",
            "aoIsOutputSpent":false,
            "aoAddress":"16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R",
            "aoOutput":{
               "opTxHash":"b5d50046994f7e8bc4a77cc9762d274d724af08ea09e7433652b6fef2b058057",
               "opIndex":0
            }
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":9
}

Get MerkleBranch by TxID


Request JSON structure:
{
   "id":10,
   "jsonrpc":"2.0",
   "method":"TXID->[MNODE]",
   "params":{
      "gmbMerkleBranch":"54c693db802d83596e3a0cdec1f99dc01af246ca51b82adaad2f41e0a8fb2131"
   }
}
Response JSON structure:
{
   "result":{
      "merkleBranch":[
         {
            "nodeValue":"fa9413f13fddeabef277a8f654f27a86673cffe87ab1c90930d51fa23b94f926",
            "isLeftNode":true
         },
         {
            "nodeValue":"97b57176888398ccfde6ea672ba1fe4f41c186d3cb6a8833bee0df4674d0e46b",
            "isLeftNode":false
         },
         {
            "nodeValue":"6b45c0a03f27fe58a946deed22274d93ea90bc49ef0ce0508bf9eecccbe9ad6c",
            "isLeftNode":false
         },
         {
            "nodeValue":"f36b8f725f266657db454d8996ebd633c35c01c896cf8f6da91f5443295fa0d8",
            "isLeftNode":false
         },
         {
            "nodeValue":"d772606e6716c55ddab4740aa867efc43140d9eb2b8c6419f4b385e91df33de7",
            "isLeftNode":false
         },
         {
            "nodeValue":"119599c2724b2d62176bc74582618d4a362199c692863ae30a0940b47180019d",
            "isLeftNode":false
         },
         {
            "nodeValue":"d592a7459cf743e9184d28267a8e433d0c980a91ac9c95869c2e1382d8408be0",
            "isLeftNode":false
         },
         {
            "nodeValue":"7db7beaf03b2557e4e9289e33bf96444a7670b72998df646a02d902f9a2c31c0",
            "isLeftNode":false
         },
         {
            "nodeValue":"f0caff9e93bc0ffe943538e242acdcbcdfb1759f59b0ef06da2ca834187cbb18",
            "isLeftNode":true
         }
      ]
   },
   "jsonrpc":"2.0",
   "id":10
}