NAV Navbar
python javascript go

Get Started with Cobo Custody WaaS API

Overview

Cobo Custody offers a RESTful API to integrate WaaS (Wallet as a service) for over 56 main chains and 1000+ tokens with your application through a simple and unified interface. Our goal is to make it easy for all types of developers to build on our platform, including cryptocurrency exchanges, token funds, payment platforms, asset-backed lending platforms, DApps, mining pools, clould mining platforms and other projects.

Third-party developers may also store their digital assets with Cobo Custody, leveraging Cobo's world-class hot warm and cold wallet architecture utilizing HSM bank-grade encryption and global private key distributed storage.

Cobo Custody’s APIs enables a variety of capabilities, as the following:

Besides REST API, Cobo Custody also provides a web-based interface (https://home.custody.cobo.com/) that supports a variety of customized risk control features:

The following is a screenshot of the web management interface: WebHomeEN

How to Open a Custody Account

Please visit https://cobo.com/custody/ to apply for a Custody account. Our team will be in touch!

Sandbox Environment (free trial available)

We provide a sandbox environment to facilitate third-party testing. Please contact us at https://cobo.com/custody/ or send us an email at custody@cobo.com to get access.

Here's the link to web interface with sandbox environment: https://home.sandbox.cobo.com/

Client SDK

Cobo Custody provides client libraries in three programming languages (Python, JavaScript, Golang) for third-party developers to use,Here are the URLs for different languages.

Python:https://github.com/CoboCustody/cobo-python-api/

JavaScript:https://github.com/CoboCustody/cobo-js-api/

Golang:https://github.com/CoboCustody/cobo-go-api/

JAVA:https://github.com/CoboCustody/cobo-java-api/

PHP:https://github.com/CoboCustody/cobo-php-api/

API Authentication

To securely store and access to crypto assets under your own account, Cobo suggests you to use ECDSA signature for authentication. After setting up a Cobo Custody account, you can generate and activate a pair of public and private API keys. Refer to the routine provided by Cobo in this URL: https://github.com/CoboCustody/. Please feel free to contact us for any question.

By inputting and saving your Public API Key (Types: Query Only, Query&Withdraw) on web-based Cobo Custody managing platform, you can sign each request securely and functionally.

You should take a great care to store your credentials and API Secret. Always keep remember that you should never give API Secret to any untrusted person or application.

For enhanced API Key security, you can whitelist IP address while generating a new API Key.

WebApiEN

Cobo API Key authentication requires each request to be signed except public API interfaces.

The data needs to be signed as the following: HTTP_METHOD + | + HTTP_REQUEST_PATH + | + TIMESTAMP + | + PARAMS

The API signature should sign data with ECDSA signature after connection and sign the bytes with hex encoding.

HTTP HOST

HTTP_METHOD

Capitalized GET or POST. Please note: Cobo doesn’t accept JSON payloads in HTTP POST. Please use form-data.

HTTP_REQUEST_PATH

The PATH part of the URL request. For example: /v1/test/ in https://api.sandbox.cobo.com/v1/test/.

NONCE

The UNIX EPOCH timestamp when calling the API is in milliseconds.

PARAMS

If the parameters are: {  "username": "username",  "password": "password" }

After sorting the key with alphabet:
password=password
username=username

Because "p" is sorted before "u" in the alphabet, "password" should be placed before "username" and then connected as follows:
password=password&username=username

API parameters are key-value string pairs. Parameters need to be normalized before signing. The rule is as follows:

  1. Sort parameters by keys alphabetically.
  2. Transform each parameter to a string in the format of “key=value”.
  3. Connect the strings with &.

Example

For the following requests:

Method URL Nonce
POST https://api.sandbox.cobo.com/v1/custody/test/ 1537498830736

Paremeters

Parameter Value
type limit
side buy
amount 100.0
price 100.0
symbol btcusdt

Data to be prepared before signing are as follows: POST|/v1/custody/test/|1537498830736|amount=100.0&price=100.0&side=buy&symbol=btcusdt&type=limit

Apply your locally generated API Secret to sign the data with ECDSA signature, and hex encode binary results to create the final signature for API server verification. (See Cobo examples: https://github.com/CoboCustody/ )

HEADER FIELDS

Fill the Header with API Key, Nonce and signature on the right field to pass signature verification.

If you want to check Cobo pubkey to verify Cobo signature, please go to: Web management platform - Wallet - API Callback. (NOTICE they're different in Sandbox&Prod environment)

Account

Check Account Details

HTTP Request

GET /v1/custody/org_info/

request(
    "GET",
    "/v1/custody/org_info/",
    {},
    api_key, api_secret, host
)

coboFetch('GET', '/v1/custody/org_info/', {}, api_key, api_secret, host)
    .then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/org_info/", map[string]string{})

Parameters

Parameter Name Type Required Description

Response

{
    "success": true,
    "result": {
        "name": "test",
        "assets": [
            {
                "coin": "ETH",
                "display_code": "ETH",
                "description": "Ethereum",
                "decimal": 18,
                "can_deposit": true,
                "can_withdraw": true,
                "balance": "0",
                "abs_balance": "0",
                "fee_coin": "ETH",
                "abs_estimate_fee": "0.0003648",
                "confirming_threshold": 12,
                "dust_threshold": 1,
                "token_address": "",
                "require_memo": false
            },
            {
                "coin": "BTC_USDT",
                "display_code": "USDT",
                "description": "Tether",
                "decimal": 8,
                "can_deposit": true,
                "can_withdraw": true,
                "balance": "740145525",
                "abs_balance": "7.40145525",
                "fee_coin": "BTC",
                "abs_estimate_fee": "0.00015044",
                "confirming_threshold": 3,
                "dust_threshold": 1,
                "token_address": "31",
                "require_memo": false
            },
            {
                "coin": "BTC",
                "display_code": "BTC",
                "description": "Bitcoin",
                "decimal": 8,
                "can_deposit": true,
                "can_withdraw": true,
                "balance": "102730",
                "abs_balance": "0.0010273",
                "fee_coin": "BTC",
                "abs_estimate_fee": "0.00013513",
                "confirming_threshold": 3,
                "dust_threshold": 546,
                "token_address": "",
                "require_memo": false
            }
        ]
    }
}
Attribute Type Description
coin String Coin code
display_code String Coin ticker symbol (not unique, changeable, for reference only )
description String Full name of coin (not unique, changeable, for reference only )
decimal Integer Coin balance decimal places
can_deposit Boolean Deposit accessibility
can_withdraw Boolean Withdrawal accessibility
Balance String Current balance
abs_balance String Absolute value of balance
fee_coin String Coin used for fee
abs_estimate_fee String Estimated fee
confirming_threshold Int Confirmation threshold required for the coin
dust_threshold Int Min. amount limit for transaction
token_address String Smart contract address for token (null for main-chain token)
require_memo String Memo for specified coins(EOS,XLM,XRP,IOST)

Get Coin Details

HTTP Request

GET /v1/custody/coin_info/

request(
    "GET",
    "/v1/custody/coin_info/",
    {
        "coin": "ETH"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/coin_info/', {
    "coin": "ETH"
}, api_key, api_secret, host)
    .then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/coin_info/", map[string]string{
    "coin": "ETH",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code

Response

{
    "success": true,
    "result": {
        "coin": "ETH",
        "display_code": "ETH",
        "description": "Ethereum",
        "decimal": 18,
        "can_deposit": true,
        "can_withdraw": true,
        "balance": 0,
        "abs_balance": "0",
        "fee_coin": "ETH",
        "abs_estimate_fee": "0.0003648"
    }
}
Attribute Type Description
coin String Coin code
display_code String Coin ticker symbol (not unique, changeable, for reference only )
description String Full name of coin (not unique, changeable, for reference only )
decimal Int Coin balance decimal places
can_deposit bool Deposit accessibility
can_withdraw bool Withdrawal accessibility
balance String Current balance
abs_balance String Absolute value of balance
fee_coin String Coin used for fee
abs_estimate_fee String Estimated fee
confirming_threshold Int Confirmation threshold required for the coin
dust_threshold Int Min. amount limit for transaction
token_address String Smart contract address for token (null for main-chain token)
require_memo String Memo for specified coins(EOS,XLM,XRP,IOST)

Get New Deposit Address

For BTC address, it supports generating segwit (3 address) and native_ Segwit (bc1 address), see below for details. (* Cobo supports withdrawal to any BTC address type)

HTTP Request

POST /v1/custody/new_address/

request(
    "POST",
    "/v1/custody/new_address/",
    {
        "coin": "BTC"
        "native_segwit": 1
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/new_address/',
        {
            "coin": "BTC"
            "native_segwit": 1
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/new_address/", map[string]string{
    "coin": "BTC",
    "native_segwit": 1,

})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
native_segwit bool No It is only valid for BTC. If it is empty, it will return the Cobo default address format (segwit 3 address). If it is not empty, it will be native_ Segwit (bc1 address)

Response

{
    "success": true,
    "result": {
        "coin": "BTC",
        "address": "bc1qzet2qmpxa3scehtf6y9eye7qexhx4pzph8vlms"
    }
}
Attribute Type Description
coin String Coin code
address String Deposit address(Seperate Memo by vertical bar)

Batch Get New Deposit Address

A single request for this interface can generate up to 200 addresses(For BTC address, it supports generating segwit (3 address) and native_ Segwit (bc1 address), see below for details. (* Cobo supports withdrawal to any BTC address type)

HTTP Request)

HTTP Request

POST /v1/custody/new_addresses/

request(
    "POST",
    "/v1/custody/new_addresses/",
    {
        "coin": "ETH"
        "count": 4

    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/new_addresses/',
        {
            "coin": "ETH"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/new_addresses/", map[string]string{
    "coin": "ETH",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
count Int Yes Number of addresses (the number of specified addresses can be transmitted, up to 200)
native_segwit bool No It is only valid for BTC. If it is empty, it will return the Cobo default address format (segwit 3 address). If it is not empty, it will be native_ Segwit (BC1 address)

Response

{
    "success": true,
    "result": {
        "coin": "ETH",
        "addresses":[
            "0x544094588811118b7701cf4a9dea056e775b4b4e",
            "0x580f33154fddf59ede21b95cd6c615df138ef160",
            "0xcec381336e22643bd0b4d779bc26a6c7a1fee23d",
            "0xa4a98b46507bb768b75c23ea3dc1a34fb150e3bd"
        ]
    }
}
Attribute Type Description
coin String Coin code
addresses String Deposit address(Seperate Memo by vertical bar)

Verify Deposit Address

HTTP Request

GET /v1/custody/address_info/

request(
    "GET",
    "/v1/custody/address_info/",
    {
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/address_info/',
        {
            "coin": "ETH",
            "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/address_info/", map[string]string{
    "coin": "ETH",
    "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
address String Yes Deposit address(Address

Response

{
    "success": true,
    "result": {
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e"
    }
}
----
{
    "success": false,
    "error_code": 12015,
    "error_description": "0x544094588811118b7701cf4a9dea056e775b4b4e is not Cobo Address of Coin ETH"
}
Attribute Type Description
coin String Coin code
address String Deposit address(Seperate memo by vertical bar)

Verify Valid Address

HTTP Request

GET /v1/custody/is_valid_address/

request(
    "GET",
    "/v1/custody/is_valid_address/",
    {
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/is_valid_address/',
        {
            "coin": "ETH",
            "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/is_valid_address/", map[string]string{
    "coin": "ETH",
    "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
address String Yes Deposit address(Seperate memo by vertical bar)

Response

{
    "success": true,
    "result": true
}
----
{
    "success": true,
    "result": false
}

Get Address History List

HTTP Request

GET /v1/custody/address_history/

request(
    "GET",
    "/v1/custody/address_history/",
    {
        "coin": "ETH",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/address_history/',
        {
            "coin": "ETH",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/address_history/", map[string]string{
    "coin": "ETH",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code

Response

{
    "success": true,
    "result": [{
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e"
    }, {
        "coin": "ETH",
        "address": "0x644094588811118b7701cf4a9dea056e775b4b4e"
    }, {
        "coin": "ETH",
        "address": "0x574094588811118b7701cf4a9dea056e775b4b4e"
    }]
}
Attribute Type Description
coin String Coin code
address String Deposit address(Seperate memo by vertical bar)

Test

Get Test Coins

To facilitate testing, Cobo support TETH(ETH Testnet), XTN(BTC Testnet), you may get some test coins from 3rd parties' website, here're some websites for your reference:

TETH (ETH Testnet)-Ropsten

Explorer: https://ropsten.etherscan.io/

Apply for test coins:https://faucet.ropsten.be/

XTN (BTC Testnet)-Testnet

Explorer: https://live.blockcypher.com/btc-testnet/

Apply for test coins:

https://tbtc.bitaps.com/

https://testnet-faucet.mempool.co/

https://bitcoinfaucet.uo1.net/send.php

Loop Alliance

Check Loop Address Details

To check if the address available for Loop transaction.

More info about Loop : https://loop.top/

HTTP Request

GET /v1/custody/internal_address_info/

request(
    "GET",
    "/v1/custody/internal_address_info/",
    {
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/internal_address_info/',
        {
            "coin": "ETH",
            "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/internal_address_info/", map[string]string{
    "coin": "ETH",
    "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
address String Yes Deposit address
memo String No Memo for specified coins(EOS,XLM,XRP,IOST)

Response

{
    "success": true,
    "result": {
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
        "is_internal_address": true,
        "internal_org": "CoboWalletProduction",
        "internal_wallet": "CoboWalletProduction",
    }
}
Parameter Name Type Description
coin String Coin code
address String Deposit address
is_internal_address Bool If it's Loop address
internal_org String Organization of the address
internal_wallet String Wallet of the address

Verify Loop Address List

HTTP Request

GET /v1/custody/internal_address_info_batch/

request(
    "GET",
    "/v1/custody/internal_address_info_batch/",
    {
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e,0x777094588811118b7701cf4a9dea056e775b4b4e",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/internal_address_info_batch/',
        {
            "coin": "ETH",
            "address": "0x544094588811118b7701cf4a9dea056e775b4b4e,0x777094588811118b7701cf4a9dea056e775b4b4e",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/internal_address_info_batch/", map[string]string{
    "coin": "ETH",
    "address": "0x544094588811118b7701cf4a9dea056e775b4b4e,0x777094588811118b7701cf4a9dea056e775b4b4e",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
address String Yes Deposit address(Seperate memo by vertical bar)

Response

{
    "success": true,
    "result": [{
        "coin": "ETH",
        "address": "0x544094588811118b7701cf4a9dea056e775b4b4e",
        "is_internal_address": true,
    }, {
        "coin": "ETH",
        "address": "0x777094588811118b7701cf4a9dea056e775b4b4e",
        "is_internal_address": false,
    }]
}
Parameter Name Type Description
coin String Coin code
address String Deposit address
is_internal_address Bool If it's Loop address

Loop Transaction Explorer

To help your user to check the Loop transaction, we offer you an explorer, you may insert the following URL in your platform:https://loop.top/tx/[Loop_ID] e.g. https://loop.top/tx/L456e5cb652dcfe557a43fd9d8e48627

Transactions

Get Transaction Details

Only successful deposit/withdraw requests will be considered as 'Transaction' here

HTTP Request

GET /v1/custody/transaction/

Parameters

Parameter Name Type Required Description
id String Yes Cobo Unique Transaction ID

Response

{
    "success": true,
    "result": {
        "id": "20210112173820000166329000003582",
        "coin": "BTC",
        "display_code": "BTC",
        "description": "Bitcoin",
        "decimal": 8,
        "address": "19AR6YWEGbSoY8UT9Ksy9WrmrZPD5sL4Ku",
        "source_address": "bc1q0qfzuge7vr5s2xkczrjkccmxemlyyn8mhx298v",
        "side": "withdraw",
        "amount": "80000",
        "abs_amount": "0.0008",
        "txid": "239861be9a4afe080c359b7fe4a1d035945ec46256b1a0f44d1267c71de8ec28",
        "vout_n": 0,
        "request_id": "web_send_by_user_327_1610444045047",
        "status": "success",
        "abs_cobo_fee": "0",
        "created_time": 1610444045158,
        "last_time": 1610445878970,
        "confirmed_num": 3,
        "tx_detail": {
            "txid": "239861be9a4afe080c359b7fe4a1d035945ec46256b1a0f44d1267c71de8ec28",
            "blocknum": 665711,
            "blockhash": "00000000000000000007137dde44472364eb80126b7d98c12ffb8d37ba11ad33",
            "fee": 0,
            "actualgas": 17812,
            "gasprice": 1,
            "hexstr": ""
        },
        "source_address_detail": "bc1q0qfzuge7vr5s2xkczrjkccmxemlyyn8mhx298v",
        "memo": "",
        "confirming_threshold": 3,
        "fee_coin": "BTC",
        "fee_amount": 50000,
        "fee_decimal": 8,
        "type": "external"
    }
}
Attribute Type Description
id String Cobo Unique Transaction ID
coin String Coin code (Cobo has internal symbols for each coin to ensure they are all unique)
display_code String Coin ticker symbol (not unique, changeable, for reference only )
description String Full name of coin (not unique, changeable, for reference only )
address String Deposit address
memo String Memo for specified coins(EOS,XLM,XRP,IOST)
source_address String Source address
source_address_detail String Separate by comma if more than one source address
side enum(deposit / withdraw) Transaction type
amount String Transaction value (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)
abs_amount String Transaction value (Note that this is an absolute value. If you trade 1.5 BTC, then the value is 1.5)
abs_cobo_fee String Absolute fee value. For examle, abs_cobo_fee 0.00005 means exactly 0.00005BTC
txid String Transaction ID, which can be found on the corresponding public chain
vout_n String For transactions on public blockchains that allow for multiple deposit addresses in a single transaction, this value indicates the transaction index on the corresponding public blockchain
request_id String Request ID
status enum(success / failed / pending) Transaction status
created_time Long Transaction creation time
last_time Long Transaction success/failure time
confirming_threshold Int Confirmed numbers required for a successful transaction
confirmed_num Int Confirmed numbers
fee_coin String Fee coin name
fee_amount Int Fee amount (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)
fee_decimal Int Fee decimal
type String external, internal shows if it's a Loop tx or external(on-chain)

Obtain the list of confirmed transactions through ID query(deposit&withdraw)

Only successful deposit/withdraw requests will be considered as 'Transaction' here

HTTP Request

GET /v1/custody/transactions_by_id/

request(
    'GET',
    '/v1/custody/transactions_by_id/',
    {
        "coin": "BTC_USDT",
        "side": "deposit",
        "max_id": 20181114183534062065000000483656
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/transactions_by_id/',
        {
            "coin": "BTC_USDT",
            "side": "deposit",
            "max_id": 20181114183534062065000000483656

        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/transactions_by_id/", map[string]string{
    "coin": "BTC_USDT",
    "side": "deposit",
    "max_id": 20181114183534062065000000483656
})

Parameters

Parameter Name Type Required Description
coin String No Coin code (Does not return all currencies)
side enum(deposit / withdraw) No Deposit/withdrawal
address String No Deposit/withdrawal address is optional. If not included, all address history will be returned.
max_id String No The transaction history ID limit is optional. If not included, will by default return the most recent records.
min_id String No Optional. If included, the sequence will be changed to time ASC. If not included, will by default return the most recent records, time DESC.
limit Integer No Page size is optional. If not included, the default size will be 50, and the maximum size will also be 50.
include_financial String No Request all transactions. If it is passed in, return all transactions(Including stacking, trading)

Response

{
    "success": true,
    "result": [{
        "id": "20181114183534062065000000483656",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "17gErTGis85ZXTJ1CvYBB7PB3PiXozvwpP",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "600000000",
        "abs_amount": "6",
        "txid": "ec33520be2079ffbc8eb7963e69db28a1d4d7a343296ee7270e2a82af3194a52",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542191734958,
        "last_time": 1542191734958,
        "confirmed_num": 3
    }, {
        "id": "20181114112147059335000000359061",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "18bpqEgCJ17TwxDwT26YjQnSBFVgcLBimE",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "100000000",
        "abs_amount": "1",
        "txid": "73ea2bcb20b36115bc50588a8bcdbfbaaeb3d75656c2b104ef4a1234e5dbe550",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542165707058,
        "last_time": 1542165707058,
        "confirmed_num": 3
    }]
}

Obtain the list of confirmed transactions through time query(deposit&withdraw)

Only successful deposit/withdraw requests will be considered as 'Transaction' here

HTTP Request

GET /v1/custody/transactions_by_time/

request(
    'GET',
    '/v1/custody/transactions_by_time/',
    {
        "coin": "BTC_USDT",
        "side": "deposit",
        "begin_time": 1542191734958
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/transactions_by_time/',
        {
            "coin": "BTC_USDT",
            "side": "deposit",
            "begin_time": 1542191734958
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/transactions_by_time/", map[string]string{
    "coin": "BTC_USDT",
    "side": "deposit",
    "begin_time": 1542191734958
})

Parameters

Parameter Name Type Required Description
coin String No Coin code (Does not return all currencies)
side enum(deposit / withdraw) No Deposit/withdrawal
address String No Deposit/withdrawal address is optional. If not included, all address history will be returned.
begin_time Long No Begin timestamp(milliseconds). If set, transactions whose transaction confirmation time is less than or equal to this will not be returned.
end_time Long No End time stamp (milliseconds). If it is passed in, the transactions whose transaction confirmation time is greater than or equal to this will not be returned.
limit Integer No Page size is optional. If not included, the default size will be 50, and the maximum size will also be 50.
include_financial String No Request all transactions. If it is passed in, return all transactions(Including stacking, trading)

Response

{
    "success": true,
    "result": [{
        "id": "20181114183534062065000000483656",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "17gErTGis85ZXTJ1CvYBB7PB3PiXozvwpP",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "600000000",
        "abs_amount": "6",
        "txid": "ec33520be2079ffbc8eb7963e69db28a1d4d7a343296ee7270e2a82af3194a52",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542191734958,
        "last_time": 1542191734958,
        "confirmed_num": 3
    }, {
        "id": "20181114112147059335000000359061",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "18bpqEgCJ17TwxDwT26YjQnSBFVgcLBimE",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "100000000",
        "abs_amount": "1",
        "txid": "73ea2bcb20b36115bc50588a8bcdbfbaaeb3d75656c2b104ef4a1234e5dbe550",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542165707058,
        "last_time": 1542165707058,
        "confirmed_num": 3
    }]
}

Get Pending Transactions

Get pending transaction list (before confirming_threshold reached)

HTTP Request

GET /v1/custody/pending_transactions/

request(
    'GET',
    '/v1/custody/pending_transactions/',
    {
        "coin": "ETH",
        "side": "deposit"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/pending_transactions/',
        {
            "coin": "ETH",
            "side": "deposit"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/pending_transactions/", map[string]string{
    "coin": "ETH",
    "side": "deposit",
})

Parameters

Parameter Name Type Required Description
coin String No Coin code (Does not return all currencies)
side enum(deposit / withdraw) No Deposit/withdrawal
max_id String No The transaction history ID limit is optional. If not included, will by default return the most recent records.
min_id String No Optional. If included, the sequence will be changed to time ASC. If not included, will by default return the most recent records, time DESC.
limit Integer No Page size is optional. If not included, the default size will be 50, and the maximum size will also be 50.

Response

{
    "success": true,
    "result": [{
        "id": "20181114183534062065000000483656",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "17gErTGis85ZXTJ1CvYBB7PB3PiXozvwpP",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "600000000",
        "abs_amount": "6",
        "txid": "ec33520be2079ffbc8eb7963e69db28a1d4d7a343296ee7270e2a82af3194a52",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542191734958,
        "last_time": 1542191734958,
        "confirming_threshold": 3,        
        "confirmed_num": 1
    }, {
        "id": "20181114112147059335000000359061",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "18bpqEgCJ17TwxDwT26YjQnSBFVgcLBimE",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "100000000",
        "abs_amount": "1",
        "txid": "73ea2bcb20b36115bc50588a8bcdbfbaaeb3d75656c2b104ef4a1234e5dbe550",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542165707058,
        "last_time": 1542165707058,
        "confirming_threshold": 3,        
        "confirmed_num": 1
    }]
}

Get Pending Deposit Details

If block confirmation status is chosen in web platform, the transaction details(block confirmation status) can be got by id in transaction notifications. Notice: if the confirmation is less than confirming_threshold, it can not be got by any Transaction reuqest (This interface is implemented in the same way as the original '/v1/custody/deposit_info/',Original deposit_ info Interface usage is not affected. It is recommended that you use this new interface)

HTTP Request

GET /v1/custody/pending_transaction/

request(
    "GET",
    "/v1/custody/pending_transaction/",
    {
        "id": "20181114112147059335000000359061"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/pending_transaction/',
        {
            "id": "20181114112147059335000000359061"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/pending_transaction/", map[string]string{
    "id": "20181114112147059335000000359061"
})

Parameters

Parameter Name Type Required Description
id String Yes Transaction ID

Response

{
    "success": true,
    "result": {
    "id": "20181114112147059335000000359061",
    "coin": "BTC_USDT",
    "display_code": "USDT",
    "description": "Tether",
    "decimal": 8,
    "address": "18bpqEgCJ17TwxDwT26YjQnSBFVgcLBimE",
    "memo": "",
    "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
    "source_address_detail": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
    "side": "deposit",
    "amount": "100000000",
    "abs_amount": "1",
    "txid": "73ea2bcb20b36115bc50588a8bcdbfbaaeb3d75656c2b104ef4a1234e5dbe550",
    "vout_n": 0,
    "request_id": null,
    "status": "pending",
    "created_time": 1542165707058,
    "last_time": 1542165707058,
    "confirming_threshold": 3,
    "confirmed_num": 3,
    "type": "external",
    }
}

Get Transaction History

Only successful deposit/withdraw requests will be considered as 'Transaction' here.((Note: the interface is ready to be abandoned, it is recommended to use /v1/custody/transactions_by_id/ and /v1/custody/transactions_by_time/)

HTTP Request

GET /v1/custody/transaction_history/

request(
    'GET',
    '/v1/custody/transaction_history/',
    {
        "coin": "BTC_USDT",
        "side": "deposit"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/transaction_history/',
        {
            "coin": "BTC_USDT",
            "side": "deposit"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/transaction_history/", map[string]string{
    "coin": "BTC_USDT",
    "side": "deposit",
})

Parameters

Parameter Name Type Required Description
coin String No Coin code (Does not return all currencies)
side enum(deposit / withdraw) No Deposit/withdrawal
address String No Deposit/withdrawal address is optional. If not included, all address history will be returned.
max_id String No The transaction history ID limit is optional. If not included, will by default return the most recent records.
min_id String No Optional. If included, the sequence will be changed to time ASC. If not included, will by default return the most recent records, time DESC.
limit Integer No Page size is optional. If not included, the default size will be 50, and the maximum size will also be 50.
begin_time Long No Begin timestamp(milliseconds). If set, transactions whose confirmation times are shorter than this value will not be returned.

Response

{
    "success": true,
    "result": [{
        "id": "20181114183534062065000000483656",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "17gErTGis85ZXTJ1CvYBB7PB3PiXozvwpP",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "600000000",
        "abs_amount": "6",
        "txid": "ec33520be2079ffbc8eb7963e69db28a1d4d7a343296ee7270e2a82af3194a52",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542191734958,
        "last_time": 1542191734958,
        "confirmed_num": 3
    }, {
        "id": "20181114112147059335000000359061",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "18bpqEgCJ17TwxDwT26YjQnSBFVgcLBimE",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "deposit",
        "amount": "100000000",
        "abs_amount": "1",
        "txid": "73ea2bcb20b36115bc50588a8bcdbfbaaeb3d75656c2b104ef4a1234e5dbe550",
        "vout_n": 0,
        "request_id": null,
        "status": "success",
        "created_time": 1542165707058,
        "last_time": 1542165707058,
        "confirmed_num": 3
    }]
}

Withdrawal

Submit Withdrawal Request

HTTP Request

POST /v1/custody/new_withdraw_request/

request(
    "POST",
    "/v1/custody/new_withdraw_request/",
    {
        "coin": "ETH",
        "address": "0x8e2782aabdf80fbb69399ce3d9bd5ae69a60462c",
        "amount": "100000000000000",
        "request_id": "unique_123456",
        "memo": "hello test"
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/new_withdraw_request/',
        {
            "coin": "ETH",
            "address": "0x8e2782aabdf80fbb69399ce3d9bd5ae69a60462c",
            "amount": "100000000000000",
            "request_id": "unique_123456",
            "memo": "hello test"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/new_withdraw_request/", map[string]string{
    "coin": "ETH",
    "address": "0x8e2782aabdf80fbb69399ce3d9bd5ae69a60462c",
    "amount": "100000000000000",
    "request_id": "unique_123456",
    "memo": "hello test",
})

Parameters

Parameter Name Type Required Description
coin String Yes Coin code
request_id String Yes Withdrawal request ID (Universally unique ID for each user's withdraw request and less than or equal to 120 characters)
address String Yes Withdrawal address
amount String Yes Please note that the withdrawal amount should be expressed in terms of the respective coin's smallest unit. For example, if 1 BTC is to be withdrawn, the amount should be multiplied by 100,000,000 (Satoshis)
memo String No Needed when you withdraw EOS, XRP, IOST
force_external String No Non-empty means: force the transaction on-chain even if it's a Loop Tx
force_internal String No Non-empty means: force the transaction off-chain even if it's not a Loop Tx, if it cannot be handled as a Loop tx, it will be rejected

Response

{
  "success": true,
  "result": ""
}

Get Withdrawal Information

HTTP Request

GET /v1/custody/withdraw_info_by_request_id/

request(
    "GET",
    "/v1/custody/withdraw_info_by_request_id/",
    {
        "request_id": "unique_123456"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/withdraw_info_by_request_id/',
        {
            "request_id": "unique_123456"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/withdraw_info_by_request_id/", map[string]string{
    "request_id": "unique_123456",
})

Parameters

Parameter Name Type Required Description
request_id String Yes Withdrawal Request ID

Response

{
    "success": true,
    "result": {
        "id": "",
        "coin": "BTC_USDT",
        "display_code": "USDT",
        "description": "Tether",
        "decimal": 8,
        "address": "18bpqEgCJ17TwxDwT26YjQnSBFVgcLBimE",
        "memo": "",
        "source_address": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "source_address_detail": "1F5i9mdCAsU2EfQtXYpwZgW2UFzS8A2EMn",
        "side": "withdraw",
        "amount": "100000000",
        "abs_amount": "1",
        "txid": "73ea2bcb20b36115bc50588a8bcdbfbaaeb3d75656c2b104ef4a1234e5dbe550",
        "vout_n": 0,
        "request_id": "test_request_id",
        "status": "pending",
        "created_time": 1542165707058,
        "last_time": 1542165707058,
        "confirming_threshold": 3,
        "confirmed_num": 3,
        "type": "external",
    }
}

Staking

Get a Staking Product Details

HTTP Request

request(
    "GET",
    "/v1/custody/staking_product/",
    {
        "product_id": 2751,
        "language": "zh",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/staking_product/',
        {
            "product_id": 2751,
            "language": "zh",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/staking_product/", map[string]string{
    "product_id": 2751,
    "language": "zh",
})

Parameters

Parameter Name Type Required Description
product_id String Yes Unique ID for staking product
language String No Language of product description(zh,en(default))

Response

{
    "success": true,
    "result": {
        "product_id": 2751,
        "name": "ZEL PPS",
        "description": "30 ZEL\u8d77\u6295\uff0c\u9636\u68af\u6536\u76ca\u7387\uff0c\u8d28\u62bc\u8d8a\u591a\uff0c\u6536\u76ca\u7387\u8d8a\u9ad8\n\u8d28\u62bc\u540e\u7b2c\u4e8c\u5929\u5f00\u59cb\u4ea7\u751f\u6536\u76ca\uff0c\u6bcf\u5929\u6839\u636e\u5168\u7f51\u6536\u76ca\u60c5\u51b5\u53d1\u653e\u6536\u76ca\uff0c\u9009\u62e9\u3010\u5230\u671f\u540e\u81ea\u52a8\u7eed\u671f\u3011\uff0c\u65e0\u7f1d\u8854\u63a5\u4e0b\u4e00\u671f\u6536\u76ca\n\u968f\u65f6\u53ef\u5212\u51fa\uff0cT+1\u5230\u8d26\uff0c\u6536\u76ca\u5468\u671f\u5185\u53d6\u51fa\u635f\u5931\u5f53\u671f\u6536\u76ca\n\u6bcf\u6b21\u53d6\u51fa\u8d4e\u56de\u8d39: 10 ZEL",
        "doc_src": "https://support.cobo.com/hc/zh-cn/articles/360025623074",
        "coin": "ZEL",
        "coin_decimal": 8,
        "reward_coin": "ZEL",
        "reward_coin_decimal": 8,
        "unstake_fee": "1000000000",
        "min_amount": "3000000000",
        "rate": "0.1351459495",
        "rate_type": 2,
        "days": 20,
        "stake_type": "masternode",
        "lockup": false,
        "start_stake_time": 1573455600000,
        "stop_stake_time": 1573542000000,
        "start_staking_time": 1573574400000,
        "stop_staking_time": 1575302400000,
        "liquidate_time": 1575388800000,
        "reward_liquidate_time": 1575388800000
    }
}
Attribute Type Description
product_id Int Product id(unique)
name String Product name
description String Product description
doc_src String Product detailed description doc
coin String Coin code
coin_decimal Int Coin decimal
reward_coin String Reward coin
reward_coin_decimal Int Reward coin decimal
unstake_fee String Unstake fee
min_amount String Min. amount to stake
rate String Yearly ROI
rate_type Int 1:fixed rate 2:estimated rate
days Int Reward period
stake_type String Staking type(Masternode, DPoS, etc)
lockup Bool If there's a lockup period
start_stake_time Int Start stake time(mileseconds timestamp)
stop_stake_time Int Stop stake time(mileseconds timestamp)
start_staking_time Int Start staking time(mileseconds timestamp)
stop_staking_time Int Stop staking time(mileseconds timestamp)
liquidate_time Int Liquidate time(mileseconds timestamp)
reward_liquidate_time Int Reward liquidate time(mileseconds timestamp)

Get All Staking Product List

HTTP Request

request(
    "GET",
    "/v1/custody/staking_products/",
    {
        "coin": "ZEL",
        "language": "zh",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/staking_products/',
        {
            "coin": "ZEL",
            "language": "zh",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/staking_products/", map[string]string{
    "coin": "ZEL",
    "language": "zh",
})

Parameters

Parameter Name Type Required Description
coin String No Coin code
language String No Language of product description(zh,en(default))

Response

{   "success": true,   "result": [{ "product_id": 2751, "name": "ZEL PPS", "description": "30 ZEL\u8d77\u6295\uff0c\u9636\u68af\u6536\u76ca\u7387\uff0c\u8d28\u62bc\u8d8a\u591a\uff0c\u6536\u76ca\u7387\u8d8a\u9ad8\n\u8d28\u62bc\u540e\u7b2c\u4e8c\u5929\u5f00\u59cb\u4ea7\u751f\u6536\u76ca\uff0c\u6bcf\u5929\u6839\u636e\u5168\u7f51\u6536\u76ca\u60c5\u51b5\u53d1\u653e\u6536\u76ca\uff0c\u9009\u62e9\u3010\u5230\u671f\u540e\u81ea\u52a8\u7eed\u671f\u3011\uff0c\u65e0\u7f1d\u8854\u63a5\u4e0b\u4e00\u671f\u6536\u76ca\n\u968f\u65f6\u53ef\u5212\u51fa\uff0cT+1\u5230\u8d26\uff0c\u6536\u76ca\u5468\u671f\u5185\u53d6\u51fa\u635f\u5931\u5f53\u671f\u6536\u76ca\n\u6bcf\u6b21\u53d6\u51fa\u8d4e\u56de\u8d39: 10 ZEL", "doc_src": "https://support.cobo.com/hc/zh-cn/articles/360025623074", "coin": "ZEL", "coin_decimal": 8, "reward_coin": "ZEL", "reward_coin_decimal": 8, "unstake_fee": "1000000000", "min_amount": "3000000000", "rate": "0.1351459495", "rate_type": 2, "days": 20, "stake_type": "masternode", "lockup": false, "start_stake_time": 1573455600000, "stop_stake_time": 1573542000000, "start_staking_time": 1573574400000, "stop_staking_time": 1575302400000, "liquidate_time": 1575388800000, "reward_liquidate_time": 1575388800000   },{}] }

Parameters

Refer to details in staking_product

Stake

Start staking by the request

HTTP Request

POST /v1/custody/staking_stake/

request(
    "POST",
    "/v1/custody/staking_stake/",
    {
        "product_id": 2751
        "amount": 4000000000
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/staking_stake/',
        {
            "product_id": 2751
            "amount": 4000000000
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/staking_stake/", map[string]string{
    "product_id": 2751
    "amount": 4000000000
})

Parameters

Parameter Name Type Required Description
product_id Int Yes Product ID
amount Int Yes Stake amount

Response

{
    "success": true,
    "result": null
}

Unstake

Unstake from a staking product by the request

HTTP Request

POST /v1/custody/staking_unstake/

request(
    "POST",
    "/v1/custody/staking_unstake/",
    {
        "product_id": 2751
        "amount": 4000000000
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/staking_unstake/',
        {
            "product_id": 2751
            "amount": 4000000000
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/staking_unstake/", map[string]string{
    "product_id": 2751
    "amount": 4000000000
})

Parameters

Parameter Name Type Required Description
product_id Int Yes Product ID
amount Int Yes Unstake amount

Response

{
    "success": true,
    "result": null
}

Get Staking Data

Get all staking data from the request

HTTP Request

GET /v1/custody/stakings/

request(
    "GET",
    "/v1/custody/stakings/",
    {
        "coin": "ZEL",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/stakings/',
        {
            "coin": "ZEL",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/stakings/", map[string]string{
    "coin": "ZEL",
})

Parameters

Parameter Name Type Required Description
coin String No Coin code
language String No Language of product description(zh,en(default))

Response

{
    "success": true,
    "result": [{
        "staking_id": 444,
        "coin": "ZEL",
        "coin_decimal": 8,
        "amount": 4000000000,
        "reward_coin": "ZEL",
        "reward_coin_decimal": 8,
        "reward_amount": 500,
        "product": {
        }
    }, {}, {}]
}
Attribute Type Description
staking_id Int Staking ID(unique)
coin String Coin code
coin_decimal Int Coin decimal
amount Int Staking Amount
reward_coin String Reward coin
reward_coin_decimal Int Reward coin decimal
reward_amount String Estimated rewarding
product Dict More in: staking_product

Get Unstaking Data

Get all unstaking data from the request

HTTP Request

GET /v1/custody/unstakings/

request(
    "GET",
    "/v1/custody/unstakings/",
    {
        "coin": "ZEL",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/unstakings/',
        {
            "coin": "ZEL",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/unstakings/", map[string]string{
    "coin": "ZEL",
})

Parameters

Parameter Name Type Required Description
coin String No Coin code

Response

{
    "success": true,
    "result": [{
        "coin": "ZEL",
        "coin_decimal": 8,
        "amount": 4000000000,
        "unstake_time": 1575388800000,
        "liquidate_time": 1575388800000,
    }, {}, {}]
}
Attribute Type Description
coin String Coin code
coin_decimal Int Coin decimal
amount Int Unstake amount
unstake_time Int Unstake time(mileseconds timestamp)
liquidate_time Int Liquidate time(mileseconds timestamp)

Get All Staking History

Get all staking history(stake, unstake, reward) from the request

HTTP Request

GET /v1/custody/staking_history/

request(
    "GET",
    "/v1/custody/staking_history/",
    {
        "coin": "ZEL",
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/staking_history/',
        {
            "coin": "ZEL",
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/staking_history/", map[string]string{
    "coin": "ZEL",
})

Parameters

Parameter Name Type Required Description
coin String No Coin code
type String No stake, unstake,reward
max_id String No Max. id
limit String No Limit of the list, Max.50
product_id Int No Product ID

Response

{
    "success": true,
    "result": [
    {
        "activity_id": "20191112000112159193000000094747",
        "coin": "ZEL",
        "amount": "1424658",
        "type": "unstake",
        "time": 1573488072058,
        "product": {

        }
    }, {}, {}]
}
Attribute Type Description
id String Action ID
coin String Coin code
amount String Action amount
type String Action type(stake unstake reward fee)
time Int Time(mileseconds timestamp)
product Dict More in: staking_product

Trading

Trading is a exchange asset custodian service aiming at GP & LP, market makers, trading teams, asset managers. User can share the top-level fee as Cobo in exchanges like Binance, OKEx, Huobi, BitMex. All assets in Cobo custodian, multi-level permission can be set for different roles like investors and traders. We also offer you better liquidity with instant delivery among the exchanges and your custodian wallets.

See more: Trading Service

Withdraw to Investor's Wallet

HTTP Request

POST /v1/custody/trading_withdraw/

request(
    "POST",
    "/v1/custody/trading_withdraw/",
    {
        "exchange_account_token": "token",
        "coin": "BTC",
        "amount": "100000000",
        "request_id": "UNIQUE_ID_FOR_WITHDRAW"
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/trading_withdraw/',
        {
            "exchange_account_token": "token",
            "coin": "BTC",
            "amount": "100000000",
            "request_id": "UNIQUE_ID_FOR_WITHDRAW"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/trading_withdraw/", map[string]string{
    "exchange_account_token": "token",
    "coin": "BTC",
    "amount": "100000000",
    "request_id": "UNIQUE_ID_FOR_WITHDRAW"
})

Parameters

Parameter Name Type Required Description
exchange_account_token String Yes from exchange account token (aquire from Web)
coin String Yes Coin code
amount Int Yes Int amount (e.g. if 1 BTC is to be withdrawn, the amount should be multiplied by 100,000,000 (Satoshis))
request_id String Yes Request ID (Universally unique ID for each request)

Response

{
    "success": true,
    "result": {
        "request_id": "UNIQUE_ID_FOR_WITHDRAW",
        "coin": "BTC",
        "amount": 100000000,
        "abs_amount": "1",
        "status": "ok",
        "fee": 500000,
        "abs_fee": "0.0005",
        "estimated_amount_received": "99950000"
    }
}
Attribute Type Description
request_id String Request ID (Universally unique ID for each request)
coin String Coin code
amount Int Int amount contains decimals (e.g. if 1 BTC is to be withdrawn, the amount should be multiplied by 100,000,000 (Satoshis))
abs_amount String Absolute amount. If you trade 1.5 BTC, then the abs_amount is 1.5
status String Status: ok, pending, failed, human_check
fee Int Fee amount (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)
abs_fee String Absolute fee value. For examle, abs_cobo_fee 0.00005 means exactly 0.00005BTC
estimated_amount_received Int Estimated amount received (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)

Get Trading Withdrawal Information

HTTP Request

GET /v1/custody/trading_withdraw_info/

request(
    "GET",
    "/v1/custody/trading_withdraw_info/",
    {
        "request_id": "UNIQUE_ID_FOR_WITHDRAW"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/trading_withdraw_info/',
        {
            "request_id": "UNIQUE_ID_FOR_WITHDRAW"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/trading_withdraw_info/", map[string]string{
    "request_id": "UNIQUE_ID_FOR_WITHDRAW"
})

Parameters

Parameter Name Type Required Description
request_id String Yes Request ID (Universally unique ID for each request)

Response

Same as trading_withdraw

Deposit to Exchange Account (Investor Only)

HTTP Request

POST /v1/custody/trading_deposit/

request(
    "POST",
    "/v1/custody/trading_deposit/",
    {
        "exchange_account_token": "token",
        "coin": "BTC",
        "amount": "100000000",
        "request_id": "UNIQUE_ID_FOR_DEPOSIT"
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/trading_deposit/',
        {
            "exchange_account_token": "token",
            "coin": "BTC",
            "amount": "100000000",
            "request_id": "UNIQUE_ID_FOR_DEPOSIT"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/trading_deposit/", map[string]string{
    "exchange_account_token": "token",
    "coin": "BTC",
    "amount": "100000000",
    "request_id": "UNIQUE_ID_FOR_DEPOSIT"
})

Parameters

Parameter Name Type Required Description
exchange_account_token String Yes to exchange account token (aquire from Web)
coin String Yes Coin code
amount Int Yes Int amount (e.g. if 1 BTC is to be withdrawn, the amount should be multiplied by 100,000,000 (Satoshis))
request_id String Yes Request ID (Universally unique ID for each request)

Response

{
    "success": true,
    "result": {
        "request_id": "UNIQUE_ID_FOR_DEPOSIT",
        "coin": "BTC",
        "amount": 100000000,
        "abs_amount": "1",
        "status": "ok",
        "fee": 500000,
        "abs_fee": "0.0005",
        "estimated_amount_received": "99950000"
    }
}
Attribute Type Description
request_id String Request ID (Universally unique ID for each request)
coin String Coin code
amount Int Int amount contains decimals (e.g. if 1 BTC is to be deposited, the amount should be multiplied by 100,000,000 (Satoshis))
abs_amount String Absolute amount. If you trade 1.5 BTC, then the abs_amount is 1.5
status String Status: ok, pending, failed, human_check
fee Int Fee amount (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)
abs_fee String Absolute fee value. For examle, abs_cobo_fee 0.00005 means exactly 0.00005BTC
estimated_amount_received Int Estimated amount received (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)

Get Trading Deposit Information (Investor Only)

HTTP Request

GET /v1/custody/trading_deposit_info/

request(
    "GET",
    "/v1/custody/trading_deposit_info/",
    {
        "request_id": "UNIQUE_ID_FOR_DEPOSIT"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/trading_deposit_info/',
        {
            "request_id": "UNIQUE_ID_FOR_DEPOSIT"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/trading_deposit_info/", map[string]string{
    "request_id": "UNIQUE_ID_FOR_DEPOSIT"
})

Parameters

Parameter Name Type Required Description
request_id String Yes Request ID (Universally unique ID for each request)

Response

Same as trading_deposit

Transfer Among Exchange Account

HTTP Request

POST /v1/custody/trading_transfer/

request(
    "POST",
    "/v1/custody/trading_transfer/",
    {
        "from_exchange_account_token": "from_token",
        "to_exchange_account_token": "to_token",
        "coin": "BTC",
        "amount": "100000000",
        "request_id": "UNIQUE_ID_FOR_TRANSFER"
    },
    api_key, api_secret, host
)
coboFetch('POST', '/v1/custody/trading_transfer/',
        {
            "from_exchange_account_token": "from_token",
            "to_exchange_account_token": "to_token",
            "coin": "BTC",
            "amount": "100000000",
            "request_id": "UNIQUE_ID_FOR_TRANSFER"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("POST", "/v1/custody/trading_transfer/", map[string]string{
    "from_exchange_account_token": "from_token",
    "to_exchange_account_token": "to_token",
    "coin": "BTC",
    "amount": "100000000",
    "request_id": "UNIQUE_ID_FOR_TRANSFER"
})

Parameters

Parameter Name Type Required Description
from_exchange_account_token String Yes from exchange account token (aquire from Web)
to_exchange_account_token String Yes to exchange account token (aquire from Web)
coin String Yes Coin code
amount Int Yes Int amount (e.g. if 1 BTC is to be withdrawn, the amount should be multiplied by 100,000,000 (Satoshis))
request_id String Yes Request ID (Universally unique ID for each request)

Response

{
    "success": true,
    "result": {
        "request_id": "UNIQUE_ID_FOR_TRANSFER",
        "coin": "BTC",
        "amount": 100000000,
        "abs_amount": "1",
        "status": "ok",
        "fee": 500000,
        "abs_fee": "0.0005",
        "estimated_amount_received": "99950000"
    }
}
Attribute Type Description
request_id String Request ID (Universally unique ID for each request)
coin String Coin code
amount Int Int amount contains decimals (e.g. if 1 BTC is to be deposited, the amount should be multiplied by 100,000,000 (Satoshis))
abs_amount String Absolute amount. If you trade 1.5 BTC, then the abs_amount is 1.5
status String Status: ok, pending, failed, human_check
fee Int Fee amount (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)
abs_fee String Absolute fee value. For examle, abs_cobo_fee 0.00005 means exactly 0.00005BTC
estimated_amount_received Int Estimated amount received (Note that the value here contains decimals. For example, a BTC value of 100,000,000 here is actually 1 BTC)

Get Trading Transfer Information

HTTP Request

GET /v1/custody/trading_transfer_info/

request(
    "GET",
    "/v1/custody/trading_transfer_info/",
    {
        "request_id": "UNIQUE_ID_FOR_TRANSFER"
    },
    api_key, api_secret, host
)
coboFetch('GET', '/v1/custody/trading_transfer_info/',
        {
            "request_id": "UNIQUE_ID_FOR_TRANSFER"
        },
        api_key, api_secret, host
    ).then(res => {
        res.json().then((data)=>{
            console.log(JSON.stringify(data, null, 4));
        })
    }).catch(err => {
        console.log(err)
    });
Request("GET", "/v1/custody/trading_transfer_info/", map[string]string{
    "request_id": "UNIQUE_ID_FOR_TRANSFER"
})

Parameters

Parameter Name Type Required Description
request_id String Yes Request ID (Universally unique ID for each request)

Response

Same as trading_transfer

Error Codes

Cobo servers will return the following error data when encountering an error:

{
    "success": false,
    "error_code": 1000,
    "error_description": "Unknown internal error"
}
HTTP Error Code Description
400 Bad request
401 Unauthorized – API key, signature, or timestamp is incorrect
403 Forbidden – No access allowed
404 Not Found – Requested resources not found
405 Method Not Allowed – HTTP methods used not applicable to the requested resources
406 Not Acceptable – Requested content format is not JSON
429 Too Many Requests – Requests are limited, please reduce the request frequency
500 Internal Server Error – Internal server error, please try again later
503 Service Unavailable – Service unavailable, please try again later
Cobo Error Code Description
1000 Unknown internal error – Please contact Cobo
1003 API params is missing or null
12000 Signature headers missing – API signature header is missing
12001 Signature verification failed – API signature verification fail
12002 Coin not supported
12003 Permission denied
12004 Transaction does not exist
12005 Signature permission denied -- API key does not have access
12006 Permission denied
12007 Insufficient balance
12008 Coin is suspended temporarily
12009 Duplicate withdraw request id
12010 Account has been frozen
12011 Amount below coin dust
12012 Invalid address
12013 Address not in whitelist
12014 Transaction fee invalid
12015 Address does not exist
12200 staking product not exist
12201 invalid staking amount
12202 invalid staking status

Transaction Notification

Upon receiving a successful deposit/withdrawal transaction, Cobo will notify a client-designated URL via HTTP(S). The message includes the transaction data in the HTTP message body in JSON format. After the client receives and finishes processing the message, they must send an HTTP response with status code =200 and http body = 'ok' to Cobo. Otherwise, we will continue to push the same message to the designated URL (up to 14 times, if you want to re-send the push later, you could click on 'Resend' Button on Web: Wallet - API Callback - API Push History)

If block confirmation status is chosen in web platform, there will be a notification whenever the block confirmation number changes for one transaction, the status is marked as 'pending', the confirmation number and 'confirming_threshold' will be included. Each notification (for each number change) will be sent only once.

PendingPushEN

If you want to check Cobo pubkey to verify Cobo signature, please go to: Web management platform - Wallet - API Callback. (NOTICE they're different in Sandbox & Prod environment)

Example

{
    "id": "20201207150724000192033000003701",
    "coin": "TRON",
    "display_code": "TRX",
    "description": "TRON",
    "decimal": 6,
    "address": "TZAt997umXasPUfxUZYKQKcGwjmYpJzX6V",
    "source_address": "TWDchZBmYvTQBeXD4w8rRUowDv5ka8kiFU",
    "side": "deposit",
    "amount": "1",
    "abs_amount": "0.000001",
    "txid": "6c2df6f6cf7fe8fe1e8559c11679a5a5b90768d1c128ffb3dd66d6f3cb910775",
    "vout_n": 0,
    "request_id": null,
    "status": "success",
    "abs_cobo_fee": "0",
    "created_time": 1607324928585,
    "last_time": 1607324928585,
    "confirmed_num": 27,
    "tx_detail": {
        "txid": "6c2df6f6cf7fe8fe1e8559c11679a5a5b90768d1c128ffb3dd66d6f3cb910775",
        "blocknum": 25660684,
        "blockhash": "0000000001878d0c83fb9640712d3354a0a1912dfd5884959d3c1a16b6f62e1c",
        "hexstr": ""
    },
    "source_address_detail": "TWDchZBmYvTQBeXD4w8rRUowDv5ka8kiFU",
    "confirming_threshold": 27,
    "type": "external"
}

Cobo receives a deposit of 0.000001 TRX to address TZAt997umXasPUfxUZYKQKcGwjmYpJzX6V. The transaction hash is 6c2df6f6cf7fe8fe1e8559c11679a5a5b90768d1c128ffb3dd66d6f3cb910775. If the address belongs to a Cobo client, Cobo will send an HTTP post request to the client-designated URL with the body ->

NOTICE

  1. After clients receive a notification from Cobo, they need to call the Cobo transaction query interface with the ID from the notification to confirm the transaction's validity. Clients should not rely on push message to confirm deposits or withdrawals.

  2. For 'successful transaction' notifications, Cobo use a 'succeed at least once' strategy. If the client does not respond with a 'body data ok' or HTTP request timeout message, Cobo will consider the push as failed. After a while, we will push again. However, there is a limit for push attempts. It the limit is exceeded, it will be marked as a failed push.

  3. For 'pending transaction' notifications, Cobo will only send once when the confirmation number changes. No response required from client.  

  4. For 'success transaction' notifications, Cobo will not push the confirmation number changes any more.

  5. Use ID as unique key for each transaction, and lock your DB, in case of duplicate accounting for one transaction.

  6. We recommend you to use https and Cobo pubkey for signature verification. (please refer to our SDK)

Withdrawal Confirmation

Upon receiving a withdrawal request, Cobo will check it by notifing a client-designated URL via HTTP(S). The message includes the withdrawal request data in the HTTP message body in JSON format. After the client receives and finishes checking the message, they must send an HTTP response with status=200 and http body = ok(or deny) to Cobo. Otherwise, we will continue to push the same message to the designated URL.

NOTICE

  1. An isolated server (e.g. risk monitor) should be used for the withdrawal confirmation in case of SPOF.

  2. Please check the request_id、to_addr、amount for each withdraw request to verify if it's a normal request.

  3. We recommend you to use https and Cobo pubkey for signature verification. (please refer to our SDK)

{
    "id": "",
    "coin": "LONT_ONT",
    "display_code": "LONT",
    "description": "ONT Local net",
    "address": "AJ6SScHEiXt8stDXjaUvTPKJwVGkJL4F3J",
    "side": "withdraw",
    "amount": "5",
    "abs_amount": "5",
    "decimal": 0,
    "txid": "d9fb6178ce2ddab6ab55894947640e469021473757e42f66652c06b58daf1419",
    "vout_n": 0,
    "request_id": "test_request_id",
    "status": "pending",
    "created_time": 1537843965164,
    "last_time": 1537843965164
}

Cobo Callback Signature

Cobo signs each response(HTTP response & Callback push)with ECDSA signature, the signed message is in Http Header: BIZ_TIMESTAMP, BIZ_RESP_SIGNATURE, you may verify the signature to ensure it's from Cobo, refer to the samples in Client demo: https://github.com/cobowallet/custody-clients/

If you want to check Cobo pubkey to verify Cobo signature, please go to: Web management platform - Wallet - API Callback. (NOTICE they're different in Sandbox&Prod environment)

Appendix

coin is Cobo’s internal coin code, which uniquely identifies each coin, while display_code is the ticker symbol of a coin (not unique, changeable, for reference only ). description indicates the full name of a coin (not unique, changeable, for reference only ).For example: Tron was an ERC-20 token before launching its own mainnet and token. The ERC-20 and Tron mainnet tokens would share the same display_code and description, but have different coin values.

In the cryptocurrency world, each coin has a smallest unit. For example, Bitcoin’s smallest unit is Satoshi; 1 BTC = 100,000,000 Satoshi. Cobo expresses amounts in terms of the smallest unit of the coin. This is to avoid problems caused by the misuse of floating numbers. Therefore, when transferring 1 BTC, the amount in the transaction is 100,000,000. In other words, abs_amount is used to indicate the same thing in real numbers. Clients may configure according to their own preferences. The conversion relation between them is: abs_amount = amount / pow(10, decimal)