Skip to content

JSON Answer formats

adamant-al edited this page Nov 23, 2018 · 21 revisions

Here are explanations and examples of Adamant-console answers. All are in JSON format.

Answer consists of required field success that states the result of operation, and could be either true or false. Other fields depends on command used.

If there is an error, explanation will be available in error field:

{
    "success": false,
    "nodeTimestamp": 37489382,
    "error": "Account is already a delegate"
}

Account commands

new

Result of account new command.

It returns account field with address/publicKey/privateKey/passPhrase parameters.

Important: Do not share passPhrase and privateKey with anyone. Also, you are resposible for saving and backup of this data. Is is necessary to have them to access account.

{
    "success": true,
    "account": {
        "address": "U17503614588421099901",
        "passPhrase": "shift credit run sea order flower tribe invest march govern blanket absorb",
        "publicKey": "d4934ceb46d7325c29df3723d3d7191387d417f43ecd3d235e7cda002161e98b",
        "privateKey": "414006a9af3cc4d97c3cb329c0abaabc70a6c234f6c1145b92f924987d2dbd17d4934ceb46d7325c29df3723d3d7191387d417f43ecd3d235e7cda002161e98b"
    }
}

Get commands

address

Result of get address command.

{
    "success": true,
    "nodeTimestamp": 37656647,
    "account": {
        "address": "U15531909278942872097",
        "unconfirmedBalance": "29869323848614",
        "balance": "29869323848614",
        "publicKey": "fb736e72b4df38d973f0f8dfccbece763ab0d9603897dfa8f1167fa50018a8e0",
        "unconfirmedSignature": 0,
        "secondSignature": 0,
        "secondPublicKey": null,
        "multisignatures": [],
        "u_multisignatures": []
    }
}

block

Result of get block command.

{
    "success": true,
    "nodeTimestamp": 37657689,
    "block": {
        "id": "7917597195203393333",
        "version": 0,
        "timestamp": 37656350,
        "height": 6091604,
        "previousBlock": "10984697155127900754",
        "numberOfTransactions": 1,
        "totalAmount": 10000000,
        "totalFee": 50000000,
        "reward": 50000000,
        "payloadLength": 117,
        "payloadHash": "9d83644fb374c7b1b4b9ae9f8a6ad59ed9b86241052698719a7aea6438783acc",
        "generatorPublicKey": "d01cd1fe3e013fe669120ec0b00cac07e4c4b2fdb6153dbd56b38732b2e427fc",
        "generatorId": "U5142625607650218363",
        "blockSignature": "c227a41097d5d224e762299e26b88ca387d98dff73ebc3d0ef416958ef7edadccb472319d430fc1184d3a1b8c11a879763d07274ae3bedae9f8fd8beab6de008",
        "confirmations": 268,
        "totalForged": "100000000"
    }
}

delegate

Result of get delegate command.

{
    "success": true,
    "nodeTimestamp": 37657752,
    "delegate": {
        "username": "bash",
        "address": "U5142625607650218363",
        "publicKey": "d01cd1fe3e013fe669120ec0b00cac07e4c4b2fdb6153dbd56b38732b2e427fc",
        "vote": "20552540707898",
        "votesWeight": "2565213987104",
        "producedblocks": 10154,
        "missedblocks": 15,
        "rate": 68,
        "rank": 68,
        "approval": 0.03,
        "productivity": 99.85
    }
}

transaction

Result of get transaction command.

{
    "success": true,
    "nodeTimestamp": 37658456,
    "transaction": {
        "id": "12810335978558620573",
        "height": 6091604,
        "blockId": "7917597195203393333",
        "type": 0,
        "timestamp": 37656340,
        "senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
        "senderId": "U15423595369615486571",
        "recipientId": "U18322695495053155871",
        "recipientPublicKey": "51a0ade2c0184d0049130c06911bbf30dc79de715ba29b7496ab443cf49ea5d7",
        "amount": 10000000,
        "fee": 50000000,
        "signature": "1f615528f133cfaeb865b50954b5dcaaaf66d6a2746c0945d506dedb4e9b7de01317c205f832002efe5b50a7e6d5503c5b83b0eb5279caa90aea4c0cd499a00f",
        "signatures": [],
        "confirmations": 422,
        "asset": {}
    }
}

transactions

Result of get transactions command.

{
    "success": true,
    "nodeTimestamp": 37658691,
    "transactions": [
        {
            "id": "12211195993237103215",
            "height": 119100,
            "blockId": "9881997101713554805",
            "type": 0,
            "timestamp": 7418761,
            "senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
            "senderId": "U15423595369615486571",
            "recipientId": "U3496974446819433410",
            "recipientPublicKey": "7927b50d730eceba0b3d9cd2e19497bd738ac4db7f93e1a154362750cb47bf86",
            "amount": 49000000,
            "fee": 50000000,
            "signature": "9744ba01933d068d5a6f6ff37694ee9a67a0d9ef8e047fa856c02e49ab5a4c69405138dfde0a86eb2f01d82f79c36aba2f89663af0cdccdc721494abf397dc02",
            "signatures": [],
            "confirmations": 5972972,
            "asset": {}
        }
    ],
    "count": "1"
}

Send commands

tokens

Result of send tokens command.

Then, with transactionId you can get transaction's details.

{
    "success": true,
    "nodeTimestamp": 37486967,
    "transactionId": "18412470054836757895"
}

Delegate commands

new

Result of delegate new command.

It returns #transaction object. Delegate's data is available in asset field.

{
    "success": true,
    "nodeTimestamp": 37489091,
    "transaction": {
        "type": 2,
        "amount": 0,
        "timestamp": 37489091,
        "asset": {
            "delegate": {
                "username": "tkf",
                "publicKey": "ae1cf99ade40ba4b94c8408ad440754e037b1837da256549d9b878629af23150"
            }
        },
        "senderPublicKey": "ae1cf99ade40ba4b94c8408ad440754e037b1837da256549d9b878629af23150",
        "senderId": "U2509016256839651561",
        "signature": "fe0b4747c698f9c01abd1680bb5087b8247719c20ec48522b16bc88ab54bf1f7871f2dc21cc5d8060fb10cc0ce520f43fa9e92bfc356449dbe9a9c7ca69ca604",
        "id": "6132068325824063462",
        "fee": 300000000000,
        "relays": 1,
        "receivedAt": "2018-11-10T14:38:11.224Z"
    }
}
Clone this wiki locally