Function X Docs
Search…
f(x)Core JSON RPC ABCI Query

Requesting the details of the address

  • JSON RPC method: abci_query
  • JSON RPC params path: custom/auth/account
  • JSON RPC params data: input json {"address":"fx1zgpzdf2uqla7hkx85wnn4p2r3duwqzd8xst6v2"} hex code
  • request body:
1
{
2
"jsonrpc":"2.0",
3
"id":"client-12345678",
4
"method":"abci_query",
5
"params":{
6
"path":"custom/auth/account",
7
"data":"7b2261646472657373223a226678317a67707a64663275716c6137686b783835776e6e3470327233647577717a6438787374367632227d",
8
"height":"0",
9
"prove":false
10
}
11
}
Copied!
  • response body:
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": {
5
"response": {
6
"code": 0,
7
"log": "",
8
"info": "",
9
"index": "0",
10
"key": null,
11
"value": "ewogICJ0eXBlIjogImNvc21vcy1zZGsvQmFzZUFjY291bnQiLAogICJ2YWx1ZSI6IHsKICAgICJhZGRyZXNzIjogImZ4MXpncHpkZjJ1cWxhN2hreDg1d25uNHAycjNkdXdxemQ4eHN0NnYyIiwKICAgICJwdWJsaWNfa2V5IjogewogICAgICAidHlwZSI6ICJ0ZW5kZXJtaW50L1B1YktleVNlY3AyNTZrMSIsCiAgICAgICJ2YWx1ZSI6ICJBOU8vYXJiM1dDS3lsQ2hoVnhmQTFJRlhCbmZpOE50QU1kbm9SOUg1VmxBcyIKICAgIH0sCiAgICAic2VxdWVuY2UiOiAiMSIKICB9Cn0=",
12
"proofOps": null,
13
"height": "2185",
14
"codespace": ""
15
}
16
}
17
}
Copied!
  • decrypt the data in "value" by using base 64 decryption code to get the data as follows:
1
{
2
"type": "cosmos-sdk/BaseAccount",
3
"value": {
4
"address": "fx1zgpzdf2uqla7hkx85wnn4p2r3duwqzd8xst6v2",
5
"public_key": {
6
"type": "tendermint/PubKeySecp256k1",
7
"value": "A9O/arb3WCKylChhVxfA1IFXBnfi8NtAMdnoR9H5VlAs"
8
},
9
"sequence": "1",
10
"account_number": "0"
11
}
12
}
Copied!

Requesting the balance of the address

  • JSON RPC method: abci_query
  • JSON RPC params path: custom/bank/all_balances
  • JSON RPC params data: input json{"address":"fx1zgpzdf2uqla7hkx85wnn4p2r3duwqzd8xst6v2"} hex code
  • request body:
1
{
2
"jsonrpc":"2.0",
3
"id":"client-12345678",
4
"method":"abci_query",
5
"params":{
6
"path":"custom/auth/account",
7
"data":"7b2261646472657373223a226678317a67707a64663275716c6137686b783835776e6e3470327233647577717a6438787374367632227d",
8
"height":"0",
9
"prove":false
10
}
11
}
Copied!
  • response body:
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": {
5
"response": {
6
"code": 0,
7
"log": "",
8
"info": "",
9
"index": "0",
10
"key": null,
11
"value": "WwogIHsKICAgICJkZW5vbSI6ICJGWCIsCiAgICAiYW1vdW50IjogIjI5OTk5MDAwMDAwMDAwMDAwMDAwMDAwMDAiCiAgfQpd",
12
"proofOps": null,
13
"height": "2185",
14
"codespace": ""
15
}
16
}
17
}
Copied!
  • decrypt the data in "value" by using base 64 decryption code to get the data as follows:
1
[
2
{
3
"denom": "FX",
4
"amount": "2999900000000000000000000"
5
}
6
]
Copied!

Requesting the total supply of $FX token

  • JSON RPC method: abci_query
  • JSON RPC params path: custom/bank/supply_of
  • JSON RPC params data: input json {"Denom":"FX"} hex code
  • request body:
1
{
2
"jsonrpc":"2.0",
3
"id":0,
4
"method":"abci_query",
5
"params":{
6
"data":"7b2244656e6f6d223a224658227d",
7
"height":"0",
8
"path":"custom/bank/supply_of",
9
"prove":true
10
}
11
}
Copied!
  • response body:
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": {
5
"response": {
6
"code": 0,
7
"log": "",
8
"info": "",
9
"index": "0",
10
"key": null,
11
"value": "ewogICJkZW5vbSI6ICJGWCIsCiAgImFtb3VudCI6ICI0Mzg2NTgxMzM1MjgyODQ4NDMxMDQzMDMxODEiCn0",
12
"proofOps": null,
13
"height": "2185",
14
"codespace": ""
15
}
16
}
17
}
Copied!
  • decrypt the data in "value" by using base 64 decryption code to get the data as follows:
1
{
2
"denom": "FX",
3
"amount": "438658133528284843104303181"
4
}
Copied!