Overview

BitGo enables you to retrieve wallet details, including addresses and balances. Every BitGo wallet has a wallet ID that identifies it on its respective blockchain. Even though wallets may have multiple receive addresses, each wallet can only have 1 wallet ID. Using the wallet ID and or the ticker symbol of the asset, you can retrieve various combinations of wallet details, such as:

  • Addresses
  • Balances
    • All addresses in a wallet
    • All your cryptocurrencies from all your wallets
    • Specific assets
    • Specific wallets
  • Keys
  • Users
  • Staking data
  • Wallet types

Most of the endpoints that return wallet-balance data include NFT data. However, some of the endpoints don't return NFT data. Review the following:

Balances (Including NFTs) Balances (Excluding NFTs)
List Addresses List Total Balances
List Wallet by Coin Get Wallet by Address
List Wallets
Get Wallet by Coin and ID

Prerequisites

Cookbooks

Need just the steps? Expand a cookbook below to get started:

View WalletOpen Cookbook View Total BalancesOpen Cookbook View Wallet AddressesOpen Cookbook

Steps

import * as dotenv from "dotenv";
import {EnvironmentName} from "bitgo";
import {BitGoAPI} from "@bitgo/sdk-api";
import {Tbtc4} from "@bitgo/sdk-coin-btc";

dotenv.config();

const bitgo = new BitGoAPI({
    env: process.env.ENV as EnvironmentName,
    accessToken: process.env.TESTNET_ACCESS_TOKEN
});

const coin = 'tbtc4';
bitgo.register(coin, Tbtc4.createInstance);

const walletId = process.env.WALLET_ID;

async function main() {
    const wallet = await bitgo.coin(coin).wallets().get({id: walletId});
    console.dir(wallet._wallet);
}

main().catch((err) => console.error(err));

Step Result

{
    "id": "63bc8506e014900008265c65363245f4",
    "users": [
        {
            "user": "62ab90e06dfda30007974f0a52a12995",
            "permissions": [
                "admin",
                "view",
                "spend"
            ]
        }
    ],
    "coin": "tbtc4",
    "label": "My Wallet",
    "m": 2,
    "n": 3,
    "keys": [
        "63bc8505f4df3c000793bfd753bcef4f",
        "63bc85058426ee00073e74fdf5418927",
        "62c5ae7f74ac860007aff0cb9bcf93a6"
    ],
    "keySignatures": {
        "backupPub": "abc123",
        "bitgoPub": "abc123"
    },
    "enterprise": "62c5ae8174ac860007aff138a2d74df7",
    "organization": "62c5ae8174ac860007aff1555ffb960d",
    "bitgoOrg": "BitGo Trust",
    "tags": [
        "63bc8506e014900008265c65363245f4",
        "62c5ae8174ac860007aff138a2d74df7"
    ],
    "disableTransactionNotifications": false,
    "freeze": {},
    "deleted": false,
    "approvalsRequired": 1,
    "isCold": false,
    "coinSpecific": {},
    "admin": {
        "policy": {
            "date": "2023-01-09T21:20:07.453Z",
            "id": "63bc8507e014900008265d017902c133",
            "label": "default",
            "rules": [],
            "version": 0,
            "latest": true
        }
    },
    "clientFlags": [],
    "walletFlags": [],
    "allowBackupKeySigning": false,
    "recoverable": false,
    "startDate": "2023-01-09T21:20:06.000Z",
    "type": "hot",
    "buildDefaults": {},
    "customChangeKeySignatures": {},
    "hasLargeNumberOfAddresses": false,
    "multisigType": "onchain",
    "hasReceiveTransferPolicy": false,
    "creator": "62ab90e06dfda30007974f0a52a12995",
    "walletFullyCreated": true,
    "config": {},
    "balance": 0,
    "balanceString": "0",
    "rbfBalance": 0,
    "rbfBalanceString": "0",
    "confirmedBalance": 0,
    "confirmedBalanceString": "0",
    "spendableBalance": 0,
    "spendableBalanceString": "0",
    "unspentCount": 0,
    "receiveAddress": {
        "id": "63bc8507e014900008265d292c356e72",
        "address": "abc123",
        "chain": 0,
        "index": 0,
        "coin": "tbtc4",
        "wallet": "63bc8506e014900008265c65363245f4",
        "label": "abc123",
        "coinSpecific": {
            "witnessScript": "abc123"
        }
    },
    "pendingApprovals": []
}

See Also