PHP WebShell
Текущая директория: /opt/BitGoJS/examples/js
Просмотр файла: get-wallet-balance.js
/**
* 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.
*/
const BitGoJS = require('bitgo');
const bitgo = new BitGoJS.BitGo({ env: 'test' });
const Promise = require('bluebird');
const coin = 'tltc';
const basecoin = bitgo.coin(coin);
// TODO: set your access token here
const accessToken = null;
const walletId = '5941ce2db42fcbc70717e5a898fd1595';
Promise.coroutine(function* () {
bitgo.authenticateWithAccessToken({ accessToken: accessToken });
const walletInstance = yield basecoin.wallets().get({ id: walletId });
console.log('Wallet ID:', walletInstance.id());
console.log('Current Receive Address:', walletInstance.receiveAddress());
console.log('Balance:', walletInstance.balanceString());
console.log('Confirmed Balance:', walletInstance.confirmedBalanceString());
console.log('Spendable Balance:', walletInstance.spendableBalanceString());
})();
Выполнить команду
Для локальной разработки. Не используйте в интернете!