/** * Get the balance of a multi-sig wallet at BitGo. * This makes use of the convenience function wallets().get() * * This tool will help you see how to use the BitGo API to easily get * information about a wallet. * * Copyright 2022, BitGo, Inc. All Rights Reserved. */ import { BitGoAPI } from '@bitgo/sdk-api'; import { Tbtc } from '@bitgo/sdk-coin-btc'; require('dotenv').config({ path: '../../.env' }); const bitgo = new BitGoAPI({ accessToken: '', env: 'test', }); const coin = 'tbtc'; bitgo.register(coin, Tbtc.createInstance); const walletId = ''; async function main() { const wallet = await bitgo.coin(coin).wallets().get({ id: walletId }); console.log('Wallet ID:', wallet.id()); console.log('Current Receive Address:', wallet.receiveAddress()); console.log('Balance:', wallet.balanceString()); console.log('Confirmed Balance:', wallet.confirmedBalanceString()); console.log('Spendable Balance:', wallet.spendableBalanceString()); } main().catch((e) => console.error(e));