Staking
This document details the Balance Custody Staking API, enabling secure staking transactions and validator management for supported assets.
API URL
You will receive your warm wallet integration URL from your point of contact at Balance, and will look like:
Authentication
Due to the nature of the information exposed, every endpoint in this API requires authentication.
For more information on authentication go to Authentication doc.
API Endpoints
For brevity, the curl
examples below do not include headers. See the Authentication Docs for required headers.
Response data is for example purposes only and does not represent real accounts.
POST /api/v2/staking/transactions
POST /api/v2/staking/transactions
Creates a staking transaction for a given asset.
Note that this API is only supported if your account is configured for staking to a provider with established API credentials and configuration such as Attestant.
Accepted parameters:
Accepts the following parameters as JSON-encoded POST request body. Must specify the Content-Type: application/json
header with the request.
asset
Required. String. Lowercase asset to be transferred.
Currently only the following assets are supported for this API call:
eth
- Ethereum
amount
Required. String. Specifies the amount to be staked, in base unit (e.g. wei
). Currently only supports the following value: "32000000000000000000"
(i.e. equal to 32 ETH
).
source_wallet_id
Required. Integer. ID of the wallet from which the funds are to be withdrawn.
destination_id
Required. Integer. This must be the ID of the Ethereum (ETH) staking contract external account that is configured for your instance by Balance. Note that the default beneficiary entity needs to be set on this external account.
withdrawal_wallet_id
Required. Integer. ID of the wallet where staking rewards are to be sent. Can be a warm or offline wallet ID or an external account ID.
fee
Optional. String or integer. Specifies the fee rate or preset. Valid values are:
slow
- we recommend specifying this if you're ok with waiting for hours / days for your transaction to be included in a block, or potentially be dropped out of the mempool during periods of high congestion.medium
- recommended preset, your transaction should be included in the next block in most casesfast
- we recommend using this if you want to ensure your transaction is included in the next block during periods of high congestion.
You can also specify a fee rate, in the fee rate unit. In the case of Ethereum (ETH) that unit is gwei
. Our backend will perform additional validation on this value to ensure it is within reasonable bounds.
group_id
Optional. String (max 256 characters). Specifies the Group ID with which an Attestant validator is to be configured.
notes
Optional. String. Any notes for your own records. These have no effect on the on-chain transactions.
beneficiary_entities
Required if travel rule is applicable. An object of type Originator Entity.
Response Format:
The response format is the standard Transaction struct, which can be found in GET /api/v1/transactions/:id
.
Once the transaction has been generated and broadcast (after all applicable approvals and checks are done), you will receive the following fields from the GET /api/v1/transactions/:id
API call, that are specific to the staking transactions:
withdrawal_wallet
A wallet struct (definition can be found in the GET /api/v1/wallets/:id
API call) specifying the wallet where ETH staking rewards will be deposited.
validator_pubkey
The public key of the validator once it has been allocated. Note that this field will not be immediately available until the transaction has been approved, validator has been allocated and transaction has been generated. We suggest polling the GET /api/v1/transactions/:id
API call to look for this field.
Examples:
Example request body:
Example request body with group ID:
Example request body with custom fee preset:
Example request body with custom fee rate of 15 Gwei and notes:
Example response body:
Example curl
command:
POST /api/v2/staking/eth/validators/:validator_pubkey/exits
POST /api/v2/staking/eth/validators/:validator_pubkey/exits
Exits the validator with the given pubkey.
Note that this API is only supported if your account is configured for staking to a provider with established API credentials and configuration such as Attestant.
Accepted parameters:
None
Response Format:
Upon success you will receive a 200 response code, with no body.
Examples:
Example curl
command:
Last updated