Skip to main content
This content applies to WaaS 1.0 only. We highly recommend that you upgrade to WaaS 2.0.
This article provides an end-to-end demonstration of creating a crypto wallet application for your platform or exchange. Throughout the article, you will learn::
  1. How to initialize RestClients with Cobo SDKs.
  2. How to create your first deposit address.
  3. How to retrieve transaction information.
  4. How to make withdraw transactions.

Before you start:

Make sure you have finished your wallet setup based on Quickstart. Before writing your first demo, make sure that the following actions have been completed:
  1. You have pulled your preferred SDK for development.
  2. You have completed key pair generation for API Authentication.
  3. You have added your API Key to your Custodial Wallet, MPC Co-managed Wallet, or MPC Lite Wallet.

Initialize

Cobo SDKs have packaged RestClients to interact with Cobo Wallet-as-a-Service APIs. To start, you need to initialize these Clients as well as the ApiSigner for API Authentication. Custodial Wallet

MPC Wallet

Use the correct Client and Environment

Client is for custodial wallet, MPCClient is for MPC Co-managed and MPC Lite wallet.
DEV_ENV is development environment, PROD_ENV is for production environment.

Create your first deposit address

Now you are able to create your first deposit address. Let us take Goerli ETH as an example. Please make sure that you or your admin have added GETH in the wallet. To verify, you can use Get Account Details for Custodial Wallet or Get Wallet Supported Coins for MPC Wallets. Cusotidal Wallet
MPC Wallet

If GETH is already available, you can create your first deposit address: Cusotidal Wallet

MPC Wallet

Check your first deposit transaction

You can make a deposit transaction to your newly created GETH address from an external address. After that, you can query the transaction by latest transaction time. Cusotidal Wallet

MPC Wallet

You may find other different ways of transaction query in API References: Custodial Wallet. MPC Wallet.

Make your first withdraw transaction

BBefore making the withdraw, you may want to find out the transaction fees. In Custodial Wallet, abs_estimate_fee in Get Coin Details indicates the withdraw fees in fee_coin. In MPC Wallets, gas_price in Get Estimate Fee indicates the on-chain real-time transaction fees. Cusotidal Wallet

MPC Wallet

Now you can create your first withdraw transaction, please use UUID for request_id to prevent any confusion in future reconcilation. From address is required in MPC wallets whereas exampted in Custodial wallet. Meanwhile, pay attention to amount value and decimal format of each coin (amount = abs_amount*10^decimal).
Here is an example of withdrawing 0.01 GETH to an external account:
Cusotidal Wallet

MPC Wallet

Then you may use the request_id to query the transaction status. Please note that the transaction will only be confirmed once the on-chain confirmation blocks reach confirming_threshold. Before that, you may use the GET /v1/custody/pending_transactions/ endpoint to query the details of a pending transaction under a Custodial Wallet. For an MPC Wallet, you may refer to the status field with code 501 PENDING_CONFIRMATION in any transactional APIs to retrieve the details of a pending transaction. Prior to using any endpoints, however, you need to first head to Cobo Custody Web and enable the “Transaction Notification - Includes Block Confirmation Number” Status feature. Failure to enable this feature will result in the inability to fetch transaction information. Do note that some transactions cannot be retrieved due to fast on-chain confirmations (e.g., TRON). Cusotidal Wallet

MPC Wallet

Congratulations! You have successfully created your first wallet application with Cobo Wallet-as-a-Service.

Code Samples

The sample codes are for reference only. Please use Cobo SDKs for your development.
Note: The code samples for Custodial Wallet and MPC Wallet are different.
Custodial Wallet

MPC Wallet