Skip to content

Commit 7f7de4e

Browse files
committed
Fix formatting.
1 parent 5b7ed3a commit 7f7de4e

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

clients/js/src/decorator.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ export interface DasApiInterface {
8383

8484
/**
8585
* Return the transaction signatures for a compressed asset
86-
*
86+
*
8787
* @param assetId the id of the asset to fetch the signatures for
8888
*/
89-
getAssetSignatures(assetId: PublicKey): Promise<GetAssetSignaturesRpcResponse>;
89+
getAssetSignatures(
90+
assetId: PublicKey
91+
): Promise<GetAssetSignaturesRpcResponse>;
9092
}
9193

9294
export const createDasApiDecorator = (
@@ -99,7 +101,9 @@ export const createDasApiDecorator = (
99101
return asset;
100102
},
101103
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+
]);
103107
if (!assets) throw new DasApiError(`No assets found: ${assetIds}`);
104108
return assets;
105109
},
@@ -116,7 +120,8 @@ export const createDasApiDecorator = (
116120
'getAssetProofs',
117121
[assetIds]
118122
);
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}`);
120125
return proofs;
121126
},
122127
getAssetsByAuthority: async (input: GetAssetsByAuthorityRpcInput) => {
@@ -256,7 +261,8 @@ export const createDasApiDecorator = (
256261
'getAssetSignaturesV2',
257262
[assetId]
258263
);
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}`);
260266
return signatures;
261267
},
262268
});

clients/js/src/types.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { Nullable, PublicKey, TransactionSignature } from '@metaplex-foundation/umi';
1+
import {
2+
Nullable,
3+
PublicKey,
4+
TransactionSignature,
5+
} from '@metaplex-foundation/umi';
26

37
// ---------------------------------------- //
48
// RPC input. //
@@ -442,7 +446,10 @@ export type GetAssetProofRpcResponse = {
442446
tree_id: PublicKey;
443447
};
444448

445-
export type GetAssetProofsRpcResponse = Record<PublicKey, GetAssetProofRpcResponse>;
449+
export type GetAssetProofsRpcResponse = Record<
450+
PublicKey,
451+
GetAssetProofRpcResponse
452+
>;
446453

447454
export type GetAssetSignaturesRpcResponse = {
448455
/**

clients/js/test/getAsset.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { publicKey } from '@metaplex-foundation/umi';
22
import test from 'ava';
3-
import { DasApiAsset, DasApiAssetCompression, DasApiAssetContent } from '../src';
3+
import {
4+
DasApiAsset,
5+
DasApiAssetCompression,
6+
DasApiAssetContent,
7+
} from '../src';
48
import { DAS_API_ENDPOINTS, createUmi } from './_setup';
59

610
DAS_API_ENDPOINTS.forEach((endpoint) => {

clients/js/test/getAssetSignatures.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ DAS_API_ENDPOINTS.forEach((endpoint) => {
1515
console.log(signatures);
1616

1717
// Then we expect the following data.
18-
t.like(signatures, <GetAssetSignaturesRpcResponse>{
19-
});
18+
t.like(signatures, <GetAssetSignaturesRpcResponse>{});
2019
});
2120
});

clients/js/test/getAssets.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ DAS_API_ENDPOINTS.forEach((endpoint) => {
77
test(`it can fetch multiple assets by ID (${endpoint.name})`, async (t) => {
88
// Given a minted NFT.
99
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+
);
1216

1317
// When we fetch the asset using its ID.
1418
const assets = await umi.rpc.getAssets([compressedAssetId, regularAssetId]);

0 commit comments

Comments
 (0)