Amberdata API

The Amberdata API Developer Hub

Welcome to the Amberdata API developer hub. You'll find comprehensive guides and documentation to help you start working with Amberdata API as quickly as possible, as well as support if you get stuck. Let's jump right in!

API Reference Docs
Ask A Question

Questions

1

API feedback - suggestion to make the to field consistently an array

would it be possible to make the to field always be an array? Currently it is either a string or an array. Which is a bit suboptimal to parse. Ideally usually I create an object and then just map it to the json - this way I cannot do it and have to peek what the content is. Ideally when there is only one address - make it an array of size 1. Sometimes this is even the case - not yet sure what the difference is. see e.g. the first 2 of this response - first to is an array - second to is a string: ``` { "status": 200, "title": "OK", "description": "Successful request", "payload": { "totalRecords": 19, "records": [ { "hash": "5b897f8eb457d7da17c275625a6be7fe499b31d8f021f8bf2e2e49795df15de9", "nonce": "0", "blockHash": "b6a9e205f52b6503e717c42b757aa5f504d5ba3af15916916fd56cd9498aa88a", "blockNumber": "6711671", "transactionIndex": "25", "from": "18f7b6cf6cbac4d423a736efc3525ae96ae69ea7", "to": [ "381e247bef0ebc21b6611786c665dd5514dcc31f" ], "value": "0", "inputSize": 2, "gasPrice": "20000000000", "gas": "21000", "cumulativeGasUsed": "1281986", "gasUsed": "21000", "contractAddress": null, "status": "0x1", "numLogs": "0", "timestamp": 1542322836000, "timestampNanoseconds": 0, "optionalProperties": {}, "blockchainId": null }, { "hash": "764644bbb450978de6487773735db50221d0a62f4b8cb61208bcce280e8ce07a", "nonce": "421", "blockHash": "5f18995d708c7edf1f2b9e61a8dac8c9d93e9630fe72c8d1f5b761d98023f514", "blockNumber": "6484687", "transactionIndex": "60", "from": "345551571c5ef20111c6168b9a498dfb836e7c09", "to": "381e247bef0ebc21b6611786c665dd5514dcc31f", "value": "1000000000000000", "inputSize": 2, "gasPrice": "4000000000", "gas": "21000", "cumulativeGasUsed": "5910129", "gasUsed": "21000", "contractAddress": null, "status": "0x1", "numLogs": "0", "timestamp": 1539116437000, "timestampNanoseconds": 0, "optionalProperties": {}, "blockchainId": null }, { ... }, { ... }, ] } } ``` and one question - why do some gasUsed have .000000 as suffix? ``` "gasUsed": "21000.000000", ``` some are just: ``` "gasUsed": "21000", ```

Posted by Taylor Dawson 5 months ago