multiversx / mx-chain-proxy-go

🐙 MultiversX Proxy: The official implementation of the web proxy for the MultiversX blockchain. An intermediary that abstracts away the complexity of sharding, through a friendly HTTP API.
https://docs.multiversx.com/sdk-and-tools/proxy/
54 stars 18 forks source link

SERVICES-1983: bulk accounts requests support #414

Closed bogdan-rosianu closed 9 months ago

bogdan-rosianu commented 9 months ago

Added the bulk accounts request endpoint to proxy.

Testing procedure can be tested by updating the following request example:

curl --request POST \
  --url http://localhost:8080/address/bulk \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/8.4.5' \
  --data '[
    "erd1an4xpn58j7ymd58m2jznr32t0vmas75egrdfa8mta6fzvqn9tkxq4jvghn",
    "erd1kyle4p6chlvj0u6fyds7wj47jqwq6kh9h083kw8j76254l8u49dqepfz86"
]'

example response:

{
    "data": {
        "accounts": {
            "erd1an4xpn58j7ymd58m2jznr32t0vmas75egrdfa8mta6fzvqn9tkxq4jvghn": {
                "address": "erd1an4xpn58j7ymd58m2jznr32t0vmas75egrdfa8mta6fzvqn9tkxq4jvghn",
                "nonce": 1,
                "balance": "553065720436396676742917",
                "username": "",
                "code": "",
                "codeHash": null,
                "rootHash": null,
                "codeMetadata": null,
                "developerReward": "0",
                "ownerAddress": ""
            },
            "erd1kyle4p6chlvj0u6fyds7wj47jqwq6kh9h083kw8j76254l8u49dqepfz86": {
                "address": "erd1kyle4p6chlvj0u6fyds7wj47jqwq6kh9h083kw8j76254l8u49dqepfz86",
                "nonce": 1,
                "balance": "553067987080726925771625",
                "username": "",
                "code": "",
                "codeHash": null,
                "rootHash": null,
                "codeMetadata": null,
                "developerReward": "0",
                "ownerAddress": ""
            }
        }
    },
    "error": "",
    "code": "successful"
}