Methods for managing assets
On this page:
GET[host]/back-api/backoffice/api/assets-info |
|
POST[host]/back-api/backoffice/asset/ |
|
PUT[host]/back-api/backoffice/asset/{asset_id} |
|
PUT[host]/back-api/backoffice/asset/{asset_id}/scale/{scale} |
Get a list of assets
Use this method to get information about assets traded on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
GET[host]/back-api/backoffice/api/assets-info
GET /back-api/backoffice/api/assets-info HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
Response
The response includes the following data about each asset:
- id
string
The asset identifier. Typically, this is an alphabetic currency code (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).- can_deposit
boolean
If
true
, users are allowed to deposit an asset.- can_withdrawal
boolean
If
true
, users are allowed to withdraw an asset.- asset_name
string
The full asset name, such as defined by a token proprietor undertaking an ICO (initial coin offering).
- withdrawal_fee
number
The fee charged for withdrawing an asset.
- scale
integer
The maximum number of decimal places allowed for representing asset amounts.
The asset scale also determines the
amount_scale
andprice_scale
limits set for related markets.
[
{
"id": "btc",
"can_deposit": true,
"can_withdrawal": true,
"asset_name": "Bitcoin",
"withdrawal_fee": 0.002,
"scale": 8
},
{
"id": "rub",
"can_deposit": true,
"can_withdrawal": true,
"asset_name": "Russian ruble.",
"withdrawal_fee": 0.02,
"scale": 8
}
]
Add a new asset
Use this method to add a new asset to the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- id
string
required The asset identifier. Typically, this is an alphabetic currency code (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).Must include only alphanumeric characters with a maximum length of 15 symbols.
- asset_name
string
required The full asset name, such as defined by a token proprietor undertaking an ICO (initial coin offering). The maximum length is 50 characters.
- can_deposit
boolean
If
true
, users are allowed to deposit an asset.- can_withdraw
boolean
If
true
, users are allowed to withdraw an asset.- withdrawal_fee
number
required The fee charged for withdrawing an asset.
- scale
number
required The maximum number of decimal places allowed for representing asset amounts.
The asset scale also determines the
amount_scale
andprice_scale
limits set for related markets.This value must be within 2—18 range.
- image_url
string
A URL of an icon assigned to an asset in the exchange UI.
POST[host]/back-api/backoffice/asset/
POST /back-api/backoffice/asset/btc HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
{
"id": "btc",
"asset_name": "bitcoin",
"withdrawal_fee": 0.001,
"scale": "8"
}
Response
In case of success, HTTP code 200
is returned.
Update an asset
Use this method to configure an asset.
Use a separate method to update the asset scale.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- asset_id required
The asset identifier. Typically, this is an alphabetic currency code (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).Must include only alphanumeric characters with a maximum length of 15 symbols.
Body:
- asset_name
string
required The full asset name, such as defined by a token proprietor undertaking an ICO (initial coin offering). The maximum length is 50 characters.
- can_deposit
boolean
If
true
, users are allowed to deposit an asset.- can_withdraw
boolean
If
true
, users are allowed to withdraw an asset.- withdrawal_fee
number
The fee charged for withdrawing an asset.
PUT[host]/back-api/backoffice/asset/{asset_id}
PUT /back-api/backoffice/asset/btc HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
{
"asset_name": "bitcoin",
"withdrawal_fee": 0.001
}
Response
In case of success, HTTP code 200
is returned.
Update the asset scale
Use this method to update the asset scale that determines the maximum number of decimal places allowed for representing asset amounts.
The asset scale also determines the amount_scale
and price_scale
limits set for related markets.
If a new asset scale is less than the previous one defined for a market, the amount_scale
and price_scale
limits set for these markets are updated.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- asset_id required
The asset identifier. Typically, this is an alphabetic currency code (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).- scale
number
The maximum number of decimal places allowed for representing asset amounts.
The asset scale also determines the
amount_scale
andprice_scale
limits set for related markets.This value must be within 2—18 range.
PUT[host]/back-api/backoffice/asset/{asset_id}/scale/{scale}
PUT /back-api/backoffice/asset/btc/scale/8 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
Response
In case of success, HTTP code 200
is returned.