Enable Tokens

Overview

To enable token functionality on certain blockchains, you must create a token enablement transaction. Once enabled, you can use your wallet to engage in token functionality, such as governance or decentralized apps (dApps). BitGo currently supports token enablement for ALGO, HBAR, and SOL.

Token-enablement transactions follow the normal transaction flow, requiring signatures, approvals, and sending, as outlined in Wallets Overview.

Prerequisites

Steps

  • SDK (ALGO)
  • SDK (HBAR)
  • SDK (SOL)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 const BitGoJS = require('bitgo'); const Promise = require('bluebird'); const bitgo = new BitGoJS.BitGo({ env: 'test' }); const coin = 'talgo:KAL-16026733'; // Set your wallet id const walletId = 'your wallet id'; // Set your wallet passphrase const walletPassphrase = 'set your wallet passphrase here'; // Set your OTP const otp = '000000'; // Set your access token const accessToken = 'insert access token string here'; const address = 'your root address or address of same wallet'; Promise.coroutine(function* () { bitgo.authenticateWithAccessToken({ accessToken }); const wallet = yield bitgo.coin(coin).wallets().get({ id: walletId }); console.log('Wallet ID:', wallet.id()); console.log('Root Address:', wallet.coinSpecific().rootAddress); console.log('Balance:', wallet.balanceString()); console.log('Confirmed Balance:', wallet.confirmedBalanceString()); console.log('Spendable Balance:', wallet.spendableBalanceString()); const unlock = yield bitgo.unlock({ otp, duration: 3600 }); if (!unlock) { throw new Error('We did not unlock.'); } try { const txEnableToken = yield wallet.sendMany({ type: 'enabletoken', recipients: [ { amount: '0', address: address, }, ], feeRate: 1, walletPassphrase, }); console.dir(txEnableToken, { depth: 6 }); } catch (e) { console.error(e); } })().catch((e) => console.error(e));

Step Result

Once the transaction confirms on chain, you can use your tokens.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "transfer": { "id": "64b6e6ae54dbbf0007004719b943a64f", "coin": "tsol", "wallet": "64b586faf9070d00079036fd748c0f3e", "walletType": "hot", "txid": "LH6XRYgheXWgBKM169Txi2eWhUtsmumo324wipz7iNwoaFCHjh33pTJo1fF7GE9G9uq5iwWaCuoMvsZNUuNT4GK", "type": "send", "value": -4083560, "valueString": "-4083560", "feeString": "4083560", "usd": -0.1050699988, "usdRate": 25.73, "state": "signed" } }

Next

Sign the transaction.