This content applies to WaaS 1.0 only. We highly recommend that you upgrade to WaaS 2.0.
- How to initialize RestClients with Cobo SDKs.
- How to create your first deposit address.
- How to retrieve transaction information.
- 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:- You have pulled your preferred SDK for development.
- You have completed key pair generation for API Authentication.
- You have added your API Key to your Custodial Wallet, MPC 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 WalletMPC Wallet
Use the correct Client and Environment
Client is for custodial wallet, MPCClient is for MPC 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 addedGETH in the wallet. To verify, you can use Get Account Details
for Custodial Wallet or Get Wallet Supported Coins for MPC Wallets.
Cusotidal Wallet
View Response
View Response
GETH is already available, you can create your first deposit address:
Cusotidal Wallet
MPC Wallet
View Response
View Response
Check your first deposit transaction
You can make a deposit transaction to your newly createdGETH address from an external address.
After that, you can query the transaction by latest transaction time.
Cusotidal Wallet
MPC Wallet
View Response
View Response
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
View Response - Custodial Wallet
View Response - Custodial Wallet
View Response - MPC Wallets
View Response - MPC Wallets
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. Custodial WalletMPC Wallet
