Assets
This document details the Balance Custody v1 Assets API, offering endpoints to manage wallet assets, including balance retrieval, asset updates, Filecoin storage provider info, and withdrawals.
Supported Currencies
Currently only the following currencies support sub-addresses:
Bitcoin (
btc
)Bitcoin Cash (
bch
)Litecoin (
ltc
)Dash (
dash
)
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 the Authentication doc.
API Endpoints
For brevity, the curl
examples below do not include headers. See the Authentication
section for required headers.
Response data is for example purposes only and does not represent real crypto addresses.
GET /api/v1/wallets/:wallet_id/assets/:currency
GET /api/v1/wallets/:wallet_id/assets/:currency
List all active funding addresses for given currency and wallet.
Request
Example:
Response
Returns an array of transaction JSON structs.
Status: 200
Example of api response:
POST /api/v1/wallets/:wallet_id/assets/:currency
POST /api/v1/wallets/:wallet_id/assets/:currency
Will create a new funding address for the given currency and return a list of all active funding addresses for the specified wallet and currency pair.
Accepted parameters
name
- string, sets thename
field of the newly created addressnotes
- string, sets thenotes
field of the newly created addressis_watched
- boolean, sets theis_watched
field of the newly created address. The current user that made the api call will be added as a watcher.
Parameters must be serialized into a JSON object with the above fields set as top-level keys in the object. This JSON string must be passed in as part of request body.
Request
Successful Response
Returns a transaction JSON struct.
Status: 200
Data:
Failed Response - Not supported currency
Returns a transaction JSON struct.
Status: 400
Data:
PUT /api/v1/wallets/:wallet_id/assets/:currency/:address
PUT /api/v1/wallets/:wallet_id/assets/:currency/:address
Will update an existing funding address for the given currency and return the updated address.
Accepted parameters
name
- string, sets thename
field of the newly created addressnotes
- string, sets thenotes
field of the newly created addressis_watched
- boolean, sets theis_watched
field of the newly created address. The current user that made the api call will be added as a watcher.
Parameters must be serialized into a JSON object with the above fields set as top-level keys in the object. This JSON string must be passed in as part of request body.
No extra parameters are accepted.
Request
Successful Response
Returns a transaction JSON struct.
Status: 200
Data:
Failed Response - Not supported currency
Returns a transaction JSON struct.
Status: 400
Data:
GET /api/v1/wallets/:wallet_id/assets/fil/storage_providers
GET /api/v1/wallets/:wallet_id/assets/fil/storage_providers
List all Filecoin storage providers for a wallet. No parameters accepted.
Request
Response
Returns an array of JSON structs.
Data:
GET /api/v1/wallets/:wallet_id/assets/fil/storage_providers/:storage_provider_id
GET /api/v1/wallets/:wallet_id/assets/fil/storage_providers/:storage_provider_id
Get a single Filecoin storage provider.
Accepted parameters
show_sector_summary
- boolean, returns various sector related information when "true" is included
Request
Response
Returns a single JSON struct.
Data:
Request with show_sector_summary=true
Response
Returns a single JSON struct.
Data:
POST /api/v1/wallets/:wallet_id/assets/fil/storage_providers/:storage_provider_id/withdrawals
POST /api/v1/wallets/:wallet_id/assets/fil/storage_providers/:storage_provider_id/withdrawals
Create a reward withdrawal transaction.
Accepted parameters
amount_afil
- number, must be an integer amount of attoFIL to withdraw.fee
- string or float, sets the fee rate or sets a preset fee rate, see description below. Optional, default is "medium".notes
- string, signifies your internal notes for this transaction. Optional, default is no custom note.
Parameters must be serialized into a JSON object with the above fields set as top-level keys in the object. This JSON string must be passed in as part of request body.
No extra parameters are accepted.
See Fee API docs for units of measurement in which fees are specified.
Fee rates can be specified as numbers (integer or float), as well as the following preset values: "slow"
, "medium"
, "fast"
. When preset values are specified they are automatically replaced with corresponding values from the Fee API.
Request
Response
Returns a single JSON struct.
Data:
GET /api/v2/assets/:currency
GET /api/v2/assets/:currency
List wallets having positive balances of the specified currency.
Accepted parameters
Accepts the following GET parameters as part of the query string:
order_by
Optional. Specifies how to sort the wallets. If not specified will sort by wallet ID descending.
Possible values are:
id
- Wallet ID descending.balance
- Balance descending..
page
Optional. If specified returns results from the specified page. Page numbers begin at 1. If not specified returns the first page.
Request
Example with defaults:
Example with options:
Response
Returns an array of wallet JSON structs.
Status: 200
Data:
Errors
Errors in this API are the same as the ones specified in the wallet API docs.
Last updated