Skip to content

Commit bbaa896

Browse files
authored
Merge pull request #6082 from BitGo/coin-3994-get-address-script
chore: sample script to fetch a wallet's address
2 parents 3e344b8 + cc4bdb0 commit bbaa896

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

examples/ts/get-address.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Get address of a wallet.
3+
*
4+
* Copyright 2025, BitGo, Inc. All Rights Reserved.
5+
*/
6+
import { BitGoAPI } from '@bitgo/sdk-api';
7+
import { Tapt } from "@bitgo/sdk-coin-apt";
8+
require('dotenv').config({ path: '../../.env' });
9+
10+
const bitgo = new BitGoAPI({
11+
accessToken: process.env.TESTNET_ACCESS_TOKEN,
12+
env: 'test',
13+
});
14+
15+
const coin = 'tapt';
16+
bitgo.register(coin, Tapt.createInstance);
17+
18+
const walletId = '';
19+
20+
async function main() {
21+
const wallet = await bitgo.coin(coin).wallets().get({ id: walletId });
22+
const address = await wallet.getAddress({
23+
address: '',
24+
})
25+
console.log(JSON.stringify(address));
26+
}
27+
28+
main().catch((e) => console.error(e));

0 commit comments

Comments
 (0)