Test Ethereum - TERC20 Tokens
Test Ethereum - TERC20 Tokens
TERC20 tokens can be accessed on different Testnets with the following identifiers.
Wallet functionality
Unlike Ether, ERC20 tokens do not have the full functionality of a wallet. You cannot create wallets, create/list/get receive addresses, or share wallets for ERC20 tokens.
To retrieve token details associated with an Ethereum wallet, such as balance, pending approvals, policies, and
webhooks, set the allTokens
parameter to true with the following calls:
- Get Wallet
- List Wallets
- List Pending Approvals
- List Wallet Webhooks
- List Transfers
- Add Wallet Webhook
Keychains
ERC20 tokens do not have a direct association with keys or keychains. Instead, all tokens share the same keys/keychains that belong to the Ethereum wallet.
Balances
Each token has a different divisibility factor which is specified in the token contract. This value is usually
1,000,000,000,000,000,000 (1018
) units, but can vary from token to token. Check the
client constants to see the number of decimal places the token supports.
Balances are supported in string format: balanceString
, confirmedBalanceString
, and spendableBalanceString
.
Transactions
BitGo's Ethereum multisig contract currently only supports one sender and one recipient. That means that the sendMany
call only accepts one recipient for tokens.
ERC20 Tokens Webhooks
By setting the allTokens
parameter to true, a generic webhook is created which triggers on all ERC20 token and ETH
transactions. It sends an HTTP request to your webhook URL and specifies whether it is Ethereum or a token using the
field "coin".
Here's an example response for a test token called "terc".
{
"hash":"0x3e00ae17961d3d42ae722085904ba84e63a32b005ff46afff28b7c9c76f63291",
"transfer":"5b612d25c9067f2a1db11a15f165989e",
"coin":"terc",
"type":"transfer",
"state":"confirmed",
"wallet":"5a13adcab70f2c284fdd9682db5e6d64"
}
To get additional details about this transfer, you need to get the transfer details using the token name and transfer
id. For the above transfer you'd need to call the Get Transfer route to check the
amount transferred and other details (e.g.
/api/v2/terc/wallet/5a13adcab70f2c284fdd9682db5e6d64/transfer/5b612d25c9067f2a1db11a15f165989e
).
Note: Transactions that send both Ethereum and ERC20 tokens (or multiple token types) supported by BitGo generate one webhook notification for each.