dfinity / rosetta-node

A passive node of the IC that can be interacted with using the Rosetta protocol
Other
8 stars 4 forks source link

account/balance call to return nonce in the response #2

Open qiwu7 opened 3 years ago

qiwu7 commented 3 years ago

Ideally we will need the account/balance call to return nonce in the metadata field of the response.

sample request

curl --location --request POST '{{rosetta-node-url}}/account/balance' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network_identifier": {
        "blockchain": "Internet Computer",
        "network": "00000000001000000101"
    },
     "account_identifier": {
        "address": "291d2024be4032a6e5bc42dcfed657370c78e2b178d51001b61dab8602",
        "metadata": {}
    }
}'

response

{
    "block_identifier": {
        "index": 110,
        "hash": "7073d2a6a9aa67b31d2e1c42e2f04b35db1fd2441f0e0024bb0e3fea131326e6"
    },
    "balances": [
        {
            "value": "18446743973707956585",
            "currency": {
                "symbol": "ICP",
                "decimals": 8
            }
        }
    ]
}
qiwu7 commented 3 years ago

expected response with nonce returned as part of metadata

{
    "block_identifier": {
        "index": 110,
        "hash": "7073d2a6a9aa67b31d2e1c42e2f04b35db1fd2441f0e0024bb0e3fea131326e6"
    },
    "balances": [
        {
            "value": "18446743973707956585",
            "currency": {
                "symbol": "ICP",
                "decimals": 8
            }
        }
    ],
    "metadata": {
        "nonce": "1"
    }
}