File tree 5 files changed +32
-12
lines changed
5 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,12 @@ export interface DasApiInterface {
83
83
84
84
/**
85
85
* Return the transaction signatures for a compressed asset
86
- *
86
+ *
87
87
* @param assetId the id of the asset to fetch the signatures for
88
88
*/
89
- getAssetSignatures ( assetId : PublicKey ) : Promise < GetAssetSignaturesRpcResponse > ;
89
+ getAssetSignatures (
90
+ assetId : PublicKey
91
+ ) : Promise < GetAssetSignaturesRpcResponse > ;
90
92
}
91
93
92
94
export const createDasApiDecorator = (
@@ -99,7 +101,9 @@ export const createDasApiDecorator = (
99
101
return asset ;
100
102
} ,
101
103
getAssets : async ( assetIds : PublicKey [ ] ) => {
102
- const assets = await rpc . call < DasApiAsset [ ] | null > ( 'getAssets' , [ assetIds ] ) ;
104
+ const assets = await rpc . call < DasApiAsset [ ] | null > ( 'getAssets' , [
105
+ assetIds ,
106
+ ] ) ;
103
107
if ( ! assets ) throw new DasApiError ( `No assets found: ${ assetIds } ` ) ;
104
108
return assets ;
105
109
} ,
@@ -116,7 +120,8 @@ export const createDasApiDecorator = (
116
120
'getAssetProofs' ,
117
121
[ assetIds ]
118
122
) ;
119
- if ( ! proofs ) throw new DasApiError ( `No proofs found for assets: ${ assetIds } ` ) ;
123
+ if ( ! proofs )
124
+ throw new DasApiError ( `No proofs found for assets: ${ assetIds } ` ) ;
120
125
return proofs ;
121
126
} ,
122
127
getAssetsByAuthority : async ( input : GetAssetsByAuthorityRpcInput ) => {
@@ -256,7 +261,8 @@ export const createDasApiDecorator = (
256
261
'getAssetSignaturesV2' ,
257
262
[ assetId ]
258
263
) ;
259
- if ( ! signatures ) throw new DasApiError ( `No signatures found for asset: ${ assetId } ` ) ;
264
+ if ( ! signatures )
265
+ throw new DasApiError ( `No signatures found for asset: ${ assetId } ` ) ;
260
266
return signatures ;
261
267
} ,
262
268
} ) ;
Original file line number Diff line number Diff line change 1
- import { Nullable , PublicKey , TransactionSignature } from '@metaplex-foundation/umi' ;
1
+ import {
2
+ Nullable ,
3
+ PublicKey ,
4
+ TransactionSignature ,
5
+ } from '@metaplex-foundation/umi' ;
2
6
3
7
// ---------------------------------------- //
4
8
// RPC input. //
@@ -442,7 +446,10 @@ export type GetAssetProofRpcResponse = {
442
446
tree_id : PublicKey ;
443
447
} ;
444
448
445
- export type GetAssetProofsRpcResponse = Record < PublicKey , GetAssetProofRpcResponse > ;
449
+ export type GetAssetProofsRpcResponse = Record <
450
+ PublicKey ,
451
+ GetAssetProofRpcResponse
452
+ > ;
446
453
447
454
export type GetAssetSignaturesRpcResponse = {
448
455
/**
Original file line number Diff line number Diff line change 1
1
import { publicKey } from '@metaplex-foundation/umi' ;
2
2
import test from 'ava' ;
3
- import { DasApiAsset , DasApiAssetCompression , DasApiAssetContent } from '../src' ;
3
+ import {
4
+ DasApiAsset ,
5
+ DasApiAssetCompression ,
6
+ DasApiAssetContent ,
7
+ } from '../src' ;
4
8
import { DAS_API_ENDPOINTS , createUmi } from './_setup' ;
5
9
6
10
DAS_API_ENDPOINTS . forEach ( ( endpoint ) => {
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ DAS_API_ENDPOINTS.forEach((endpoint) => {
15
15
console . log ( signatures ) ;
16
16
17
17
// Then we expect the following data.
18
- t . like ( signatures , < GetAssetSignaturesRpcResponse > {
19
- } ) ;
18
+ t . like ( signatures , < GetAssetSignaturesRpcResponse > { } ) ;
20
19
} ) ;
21
20
} ) ;
Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ DAS_API_ENDPOINTS.forEach((endpoint) => {
7
7
test ( `it can fetch multiple assets by ID (${ endpoint . name } )` , async ( t ) => {
8
8
// Given a minted NFT.
9
9
const umi = createUmi ( endpoint . url ) ;
10
- const compressedAssetId = publicKey ( '8TrvJBRa6Pzb9BDadqroHhWTHxaxK8Ws8r91oZ2jxaVV' ) ;
11
- const regularAssetId = publicKey ( '5ja3EvVuEu5rXgtYE3LXKG84s7Pmy5siFfYbcopMc2Dx' ) ;
10
+ const compressedAssetId = publicKey (
11
+ '8TrvJBRa6Pzb9BDadqroHhWTHxaxK8Ws8r91oZ2jxaVV'
12
+ ) ;
13
+ const regularAssetId = publicKey (
14
+ '5ja3EvVuEu5rXgtYE3LXKG84s7Pmy5siFfYbcopMc2Dx'
15
+ ) ;
12
16
13
17
// When we fetch the asset using its ID.
14
18
const assets = await umi . rpc . getAssets ( [ compressedAssetId , regularAssetId ] ) ;
You can’t perform that action at this time.
0 commit comments