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() {
32
32
33
33
const sendConsolidations = await wallet . sendAccountConsolidations ( {
34
34
walletPassphrase,
35
- consolidateAddresses : [ '' ] ,
36
35
nftCollectionId : '' ,
37
36
nftId : '' ,
38
37
} ) ;
Original file line number Diff line number Diff line change @@ -423,7 +423,9 @@ export interface AddressesOptions extends PaginationOptions {
423
423
}
424
424
425
425
export interface AddressesByBalanceOptions extends PaginationOptions {
426
- token : string ;
426
+ token ?: string ;
427
+ nftCollectionId ?: string ;
428
+ nftId ?: string ;
427
429
sort ?: number ;
428
430
}
429
431
Original file line number Diff line number Diff line change @@ -1155,6 +1155,8 @@ export class Wallet implements IWallet {
1155
1155
async addressesByBalance ( params : AddressesByBalanceOptions ) : Promise < any > {
1156
1156
const query : AddressesByBalanceOptions = {
1157
1157
token : params . token ,
1158
+ nftCollectionId : params . nftCollectionId ,
1159
+ nftId : params . nftId ,
1158
1160
} ;
1159
1161
query . sort = params . sort ?? - 1 ;
1160
1162
query . page = params . page ?? 1 ;
@@ -1166,10 +1168,10 @@ export class Wallet implements IWallet {
1166
1168
if ( ! _ . isNumber ( query . page ) ) {
1167
1169
throw new Error ( 'invalid page argument, expecting number' ) ;
1168
1170
}
1169
- if ( ! _ . isNumber ( params . limit ) ) {
1171
+ if ( ! _ . isNumber ( query . limit ) ) {
1170
1172
throw new Error ( 'invalid limit argument, expecting number' ) ;
1171
1173
}
1172
- if ( params . limit < 1 || params . limit > 500 ) {
1174
+ if ( query . limit < 1 || query . limit > 500 ) {
1173
1175
throw new Error ( 'limit argument must be between 1 and 500' ) ;
1174
1176
}
1175
1177
You can’t perform that action at this time.
0 commit comments