Skip to content

Commit 973a035

Browse files
authored
Merge pull request #6720 from BitGo/coin-5259-list-wallets-example
feat: add list wallets by IDs example script
2 parents d36c496 + 76209d5 commit 973a035

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

examples/ts/list-wallets-by-ids.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* List wallets by wallet IDs at BitGo.
3+
* Doc: https://developers.bitgo.com/api/v2.wallet.list
4+
*
5+
* This tool will help you see how to use the BitGo API to easily list your
6+
* BitGo wallets.
7+
*
8+
* Copyright 2025, BitGo, Inc. All Rights Reserved.
9+
*/
10+
import { BitGoAPI } from '@bitgo/sdk-api';
11+
require('dotenv').config({ path: '../../.env' });
12+
13+
const bitgo = new BitGoAPI({
14+
accessToken: process.env.TESTNET_ACCESS_TOKEN,
15+
env: 'test',
16+
});
17+
18+
async function main() {
19+
const body = await bitgo.get(bitgo.url('/wallets', 2)).query({
20+
id: [], // Replace with your wallet IDs
21+
}).result();
22+
23+
console.log(`${JSON.stringify(body.wallets, null, 2)}`);
24+
}
25+
26+
main().catch((e) => console.error(e));

0 commit comments

Comments
 (0)