File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
modules/sdk-core/src/bitgo/wallet Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * List address of an NFT on 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 addresses = await wallet . addressesByBalance ( {
23+ nftCollectionId : '' ,
24+ nftId : '' ,
25+ } ) ;
26+ console . log ( JSON . stringify ( addresses . addresses ) ) ;
27+ }
28+
29+ main ( ) . catch ( ( e ) => console . error ( e ) ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ async function main() {
3232
3333 const sendConsolidations = await wallet . sendAccountConsolidations ( {
3434 walletPassphrase,
35- consolidateAddresses : [ '' ] ,
3635 nftCollectionId : '' ,
3736 nftId : '' ,
3837 } ) ;
Original file line number Diff line number Diff line change @@ -423,7 +423,9 @@ export interface AddressesOptions extends PaginationOptions {
423423}
424424
425425export interface AddressesByBalanceOptions extends PaginationOptions {
426- token : string ;
426+ token ?: string ;
427+ nftCollectionId ?: string ;
428+ nftId ?: string ;
427429 sort ?: number ;
428430}
429431
Original file line number Diff line number Diff line change @@ -1155,6 +1155,8 @@ export class Wallet implements IWallet {
11551155 async addressesByBalance ( params : AddressesByBalanceOptions ) : Promise < any > {
11561156 const query : AddressesByBalanceOptions = {
11571157 token : params . token ,
1158+ nftCollectionId : params . nftCollectionId ,
1159+ nftId : params . nftId ,
11581160 } ;
11591161 query . sort = params . sort ?? - 1 ;
11601162 query . page = params . page ?? 1 ;
@@ -1166,10 +1168,10 @@ export class Wallet implements IWallet {
11661168 if ( ! _ . isNumber ( query . page ) ) {
11671169 throw new Error ( 'invalid page argument, expecting number' ) ;
11681170 }
1169- if ( ! _ . isNumber ( params . limit ) ) {
1171+ if ( ! _ . isNumber ( query . limit ) ) {
11701172 throw new Error ( 'invalid limit argument, expecting number' ) ;
11711173 }
1172- if ( params . limit < 1 || params . limit > 500 ) {
1174+ if ( query . limit < 1 || query . limit > 500 ) {
11731175 throw new Error ( 'limit argument must be between 1 and 500' ) ;
11741176 }
11751177
You can’t perform that action at this time.
0 commit comments