๐ Get ETH balance for address
Code samples
GET /api/v1/eth/account/{address}/balance
curl 'https://settla.net/api/v1/eth/account/0x315d2ee4fccda0def532ef4108ff57204f8d9eba/balance?block=latest' \
-H 'X-API-Key: $SETTLA_API_KEY' \
-H 'Accept: application/json'
Returns the balance of an account at a given address using eth_getBalance.
๐ ๏ธ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| address | path | string | true | Ethereum address (0x-prefixed). Case-insensitive here, but note that webhook subscriptions match addresses in lowercase only. |
| block | query | string | false | Block number as hex QUANTITY, or tag (latest, earliest, pending). |
Example responses
200 Response
{
"address": "0x315d2ee4fccda0def532ef4108ff57204f8d9eba",
"block": "latest",
"balance": "0x16252b7d687d280c3"
}
500 Response
{
"error": "Could not connect to ETH node."
}
๐ Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ETH balance information. balance is wei as a hex QUANTITY โ divide by 10^18 for ETH. Parse it with a big-integer type: wei balances overflow IEEE-754 doubles. | Inline |
| 500 | Internal Server Error | Could not connect to ETH node | Inline |
๐ Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ยป address | string | false | none | none |
| ยป block | string | false | none | none |
| ยป balance | string | false | none | Balance in wei as hex QUANTITY from eth_getBalance. |
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ยป error | string | false | none | none |