@quicknode/sdk 2.5.2 → 3.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -46
- package/browser.js +9 -0
- package/errors.js +121 -0
- package/index.d.ts +2286 -650
- package/index.darwin-arm64.node +0 -0
- package/index.js +328 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-arm64-musl.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.linux-x64-musl.node +0 -0
- package/package.json +48 -54
- package/sdk.d.ts +389 -0
- package/sdk.js +88 -0
- package/sdk.mjs +34 -0
- package/cjs/index.js +0 -541
- package/cjs/package.json +0 -3
- package/esm/client/client.js +0 -9
- package/esm/client/index.js +0 -2
- package/esm/core/addOns/nftTokenV2/actions.js +0 -107
- package/esm/core/addOns/nftTokenV2/types/qn_fetchNFTCollectionDetails.js +0 -10
- package/esm/core/addOns/nftTokenV2/types/qn_fetchNFTs.js +0 -13
- package/esm/core/addOns/nftTokenV2/types/qn_fetchNFTsByCollection.js +0 -13
- package/esm/core/addOns/nftTokenV2/types/qn_getTokenMetadataByContractAddress.js +0 -10
- package/esm/core/addOns/nftTokenV2/types/qn_getTokenMetadataBySymbol.js +0 -11
- package/esm/core/addOns/nftTokenV2/types/qn_getTransactionsByAddress.js +0 -18
- package/esm/core/addOns/nftTokenV2/types/qn_getTransfersByNFT.js +0 -12
- package/esm/core/addOns/nftTokenV2/types/qn_getWalletTokenBalance.js +0 -12
- package/esm/core/addOns/nftTokenV2/types/qn_getWalletTokenTransactions.js +0 -14
- package/esm/core/addOns/nftTokenV2/types/qn_verifyNFTsOwner.js +0 -11
- package/esm/core/addOns/shared/helpers.js +0 -10
- package/esm/core/chains.js +0 -117
- package/esm/core/core.js +0 -30
- package/esm/core/index.d.ts +0 -558
- package/esm/core/index.js +0 -2
- package/esm/index.js +0 -11
- package/esm/lib/constants.js +0 -4
- package/esm/lib/errors/QNChainNotSupported.js +0 -7
- package/esm/lib/errors/QNInputValidationError.js +0 -10
- package/esm/lib/errors/QNInvalidEnpointUrl.js +0 -7
- package/esm/lib/helpers/getClientHeaders.js +0 -11
- package/esm/lib/helpers/globalFetch.js +0 -13
- package/esm/lib/validation/ValidateInput.js +0 -16
- package/esm/lib/validation/validators.js +0 -15
- package/esm/package.json +0 -4
- package/esm/solana/index.d.ts +0 -76
- package/esm/solana/index.js +0 -2
- package/esm/solana/solana.js +0 -111
package/esm/core/index.d.ts
DELETED
|
@@ -1,558 +0,0 @@
|
|
|
1
|
-
import { Chain, PublicClient } from 'viem';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
type SimplifyType<T> = T extends object ? {
|
|
5
|
-
[K in keyof T]: SimplifyType<T[K]>;
|
|
6
|
-
} : T;
|
|
7
|
-
|
|
8
|
-
type NftTrait = {
|
|
9
|
-
trait_type: string;
|
|
10
|
-
value: string;
|
|
11
|
-
};
|
|
12
|
-
type RpcNftAsset = {
|
|
13
|
-
collectionName: string;
|
|
14
|
-
collectionTokenId: string;
|
|
15
|
-
collectionAddress: string;
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
imageUrl: string;
|
|
19
|
-
traits: NftTrait[];
|
|
20
|
-
chain: string;
|
|
21
|
-
network: string;
|
|
22
|
-
};
|
|
23
|
-
type RPCTokenMetadata = {
|
|
24
|
-
name: string | null;
|
|
25
|
-
symbol: string | null;
|
|
26
|
-
contractAddress: string;
|
|
27
|
-
decimals: string | null;
|
|
28
|
-
genesisBlock: string | null;
|
|
29
|
-
genesisTransaction: string | null;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
declare const qnFetchNFTInputSchema: z.ZodObject<{
|
|
33
|
-
wallet: z.ZodString;
|
|
34
|
-
contracts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
35
|
-
omitFields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
36
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
37
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
38
|
-
}, "strict", z.ZodTypeAny, {
|
|
39
|
-
wallet: string;
|
|
40
|
-
contracts?: string[] | null | undefined;
|
|
41
|
-
omitFields?: string[] | null | undefined;
|
|
42
|
-
perPage?: number | null | undefined;
|
|
43
|
-
page?: number | null | undefined;
|
|
44
|
-
}, {
|
|
45
|
-
wallet: string;
|
|
46
|
-
contracts?: string[] | null | undefined;
|
|
47
|
-
omitFields?: string[] | null | undefined;
|
|
48
|
-
perPage?: number | null | undefined;
|
|
49
|
-
page?: number | null | undefined;
|
|
50
|
-
}>;
|
|
51
|
-
type QNFetchNFTInput = z.infer<typeof qnFetchNFTInputSchema>;
|
|
52
|
-
type QNFetchNFTResult = {
|
|
53
|
-
owner: string;
|
|
54
|
-
assets: RpcNftAsset[];
|
|
55
|
-
totalPages: number;
|
|
56
|
-
totalItems: number;
|
|
57
|
-
pageNumber: number;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
declare const qnFetchNFTCollectionDetailsInputSchema: z.ZodObject<{
|
|
61
|
-
contracts: z.ZodArray<z.ZodString, "many">;
|
|
62
|
-
}, "strict", z.ZodTypeAny, {
|
|
63
|
-
contracts: string[];
|
|
64
|
-
}, {
|
|
65
|
-
contracts: string[];
|
|
66
|
-
}>;
|
|
67
|
-
type QNFetchNFTCollectionDetailsInput = z.infer<typeof qnFetchNFTCollectionDetailsInputSchema>;
|
|
68
|
-
type RPCNftCollectionDetails = {
|
|
69
|
-
name: string;
|
|
70
|
-
address: string;
|
|
71
|
-
description: string;
|
|
72
|
-
erc1155: boolean;
|
|
73
|
-
erc721: boolean;
|
|
74
|
-
totalSupply: number;
|
|
75
|
-
circulatingSupply: number;
|
|
76
|
-
genesisBlock: number | null;
|
|
77
|
-
genesisTransaction: string | null;
|
|
78
|
-
};
|
|
79
|
-
type QNFetchNFTCollectionDetailsResult = RPCNftCollectionDetails[];
|
|
80
|
-
|
|
81
|
-
declare const qnFetchNFTsByCollectionInputSchema: z.ZodObject<{
|
|
82
|
-
omitFields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
83
|
-
collection: z.ZodString;
|
|
84
|
-
tokens: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
85
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
86
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
87
|
-
}, "strict", z.ZodTypeAny, {
|
|
88
|
-
collection: string;
|
|
89
|
-
omitFields?: string[] | null | undefined;
|
|
90
|
-
tokens?: string[] | null | undefined;
|
|
91
|
-
perPage?: number | null | undefined;
|
|
92
|
-
page?: number | null | undefined;
|
|
93
|
-
}, {
|
|
94
|
-
collection: string;
|
|
95
|
-
omitFields?: string[] | null | undefined;
|
|
96
|
-
tokens?: string[] | null | undefined;
|
|
97
|
-
perPage?: number | null | undefined;
|
|
98
|
-
page?: number | null | undefined;
|
|
99
|
-
}>;
|
|
100
|
-
type QNFetchNFTsByCollectionInput = z.infer<typeof qnFetchNFTsByCollectionInputSchema>;
|
|
101
|
-
type QNFetchNFTsByCollectionResult = {
|
|
102
|
-
collection: string;
|
|
103
|
-
tokens: RpcNftAsset[];
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
declare const qnGetTransfersByNFTInputSchema: z.ZodObject<{
|
|
107
|
-
collection: z.ZodString;
|
|
108
|
-
collectionTokenId: z.ZodString;
|
|
109
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
110
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
111
|
-
}, "strict", z.ZodTypeAny, {
|
|
112
|
-
collection: string;
|
|
113
|
-
collectionTokenId: string;
|
|
114
|
-
perPage?: number | null | undefined;
|
|
115
|
-
page?: number | null | undefined;
|
|
116
|
-
}, {
|
|
117
|
-
collection: string;
|
|
118
|
-
collectionTokenId: string;
|
|
119
|
-
perPage?: number | null | undefined;
|
|
120
|
-
page?: number | null | undefined;
|
|
121
|
-
}>;
|
|
122
|
-
type QNGetTransfersByNFTInput = z.infer<typeof qnGetTransfersByNFTInputSchema>;
|
|
123
|
-
type TransfersByNFTTransfer = {
|
|
124
|
-
blockNumber: number;
|
|
125
|
-
date: string;
|
|
126
|
-
from: string;
|
|
127
|
-
to: string;
|
|
128
|
-
txHash: string;
|
|
129
|
-
};
|
|
130
|
-
type QNGetTransfersByNFTResult = {
|
|
131
|
-
collection: string;
|
|
132
|
-
transfers: TransfersByNFTTransfer[];
|
|
133
|
-
totalPages: number;
|
|
134
|
-
pageNumber: number;
|
|
135
|
-
totalItems: number;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
declare const qnVerifyNFTsOwnerInputSchema: z.ZodObject<{
|
|
139
|
-
wallet: z.ZodString;
|
|
140
|
-
contracts: z.ZodArray<z.ZodString, "many">;
|
|
141
|
-
}, "strict", z.ZodTypeAny, {
|
|
142
|
-
wallet: string;
|
|
143
|
-
contracts: string[];
|
|
144
|
-
}, {
|
|
145
|
-
wallet: string;
|
|
146
|
-
contracts: string[];
|
|
147
|
-
}>;
|
|
148
|
-
type QNVerifyNFTsOwnerInput = z.infer<typeof qnVerifyNFTsOwnerInputSchema>;
|
|
149
|
-
type QNVerifyNFTsOwnerResult = {
|
|
150
|
-
owner: string;
|
|
151
|
-
assets: string[];
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
declare const qnGetTokenMetadataByCAInputSchema: z.ZodObject<{
|
|
155
|
-
contract: z.ZodString;
|
|
156
|
-
}, "strict", z.ZodTypeAny, {
|
|
157
|
-
contract: string;
|
|
158
|
-
}, {
|
|
159
|
-
contract: string;
|
|
160
|
-
}>;
|
|
161
|
-
type QNGetTokenMetadataByCAInput = z.infer<typeof qnGetTokenMetadataByCAInputSchema>;
|
|
162
|
-
type QNGetTokenMetadataByCAResult = RPCTokenMetadata;
|
|
163
|
-
|
|
164
|
-
declare const qnGetTokenMetadataBySymbolInputSchema: z.ZodObject<{
|
|
165
|
-
symbol: z.ZodString;
|
|
166
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
167
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
168
|
-
}, "strict", z.ZodTypeAny, {
|
|
169
|
-
symbol: string;
|
|
170
|
-
perPage?: number | null | undefined;
|
|
171
|
-
page?: number | null | undefined;
|
|
172
|
-
}, {
|
|
173
|
-
symbol: string;
|
|
174
|
-
perPage?: number | null | undefined;
|
|
175
|
-
page?: number | null | undefined;
|
|
176
|
-
}>;
|
|
177
|
-
type QNGetTokenMetadataBySymbolInput = z.infer<typeof qnGetTokenMetadataBySymbolInputSchema>;
|
|
178
|
-
type QNGetTokenMetadataBySymbolResult = {
|
|
179
|
-
tokens: RPCTokenMetadata[];
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
declare const qnGetTransactionsByAddressInputSchema: z.ZodEffects<z.ZodObject<{
|
|
183
|
-
address: z.ZodString;
|
|
184
|
-
fromBlock: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
185
|
-
toBlock: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
186
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
187
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
188
|
-
}, "strict", z.ZodTypeAny, {
|
|
189
|
-
address: string;
|
|
190
|
-
fromBlock?: number | null | undefined;
|
|
191
|
-
toBlock?: number | null | undefined;
|
|
192
|
-
perPage?: number | null | undefined;
|
|
193
|
-
page?: number | null | undefined;
|
|
194
|
-
}, {
|
|
195
|
-
address: string;
|
|
196
|
-
fromBlock?: number | null | undefined;
|
|
197
|
-
toBlock?: number | null | undefined;
|
|
198
|
-
perPage?: number | null | undefined;
|
|
199
|
-
page?: number | null | undefined;
|
|
200
|
-
}>, {
|
|
201
|
-
address: string;
|
|
202
|
-
fromBlock?: number | null | undefined;
|
|
203
|
-
toBlock?: number | null | undefined;
|
|
204
|
-
perPage?: number | null | undefined;
|
|
205
|
-
page?: number | null | undefined;
|
|
206
|
-
}, {
|
|
207
|
-
address: string;
|
|
208
|
-
fromBlock?: number | null | undefined;
|
|
209
|
-
toBlock?: number | null | undefined;
|
|
210
|
-
perPage?: number | null | undefined;
|
|
211
|
-
page?: number | null | undefined;
|
|
212
|
-
}>;
|
|
213
|
-
type QNGetTransactionsByAddressInput = z.infer<typeof qnGetTransactionsByAddressInputSchema>;
|
|
214
|
-
interface RPCTransactionByAddress {
|
|
215
|
-
blockTimestamp: string;
|
|
216
|
-
transactionHash: string;
|
|
217
|
-
blockNumber: string;
|
|
218
|
-
transactionIndex: number;
|
|
219
|
-
fromAddress: string;
|
|
220
|
-
toAddress: string;
|
|
221
|
-
contractAddress: string | null;
|
|
222
|
-
value: string;
|
|
223
|
-
}
|
|
224
|
-
type QNGetTransactionsByAddressResult = {
|
|
225
|
-
paginatedItems: RPCTransactionByAddress[];
|
|
226
|
-
totalItems: number;
|
|
227
|
-
totalPages: number;
|
|
228
|
-
pageNumber: number;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
declare const qnGetWalletTokenBalanceInputSchema: z.ZodObject<{
|
|
232
|
-
wallet: z.ZodString;
|
|
233
|
-
contracts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
234
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
235
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
236
|
-
}, "strict", z.ZodTypeAny, {
|
|
237
|
-
wallet: string;
|
|
238
|
-
contracts?: string[] | null | undefined;
|
|
239
|
-
perPage?: number | null | undefined;
|
|
240
|
-
page?: number | null | undefined;
|
|
241
|
-
}, {
|
|
242
|
-
wallet: string;
|
|
243
|
-
contracts?: string[] | null | undefined;
|
|
244
|
-
perPage?: number | null | undefined;
|
|
245
|
-
page?: number | null | undefined;
|
|
246
|
-
}>;
|
|
247
|
-
type QNGetWalletTokenBalanceInput = z.infer<typeof qnGetWalletTokenBalanceInputSchema>;
|
|
248
|
-
type RPCWalletTokenBalance = {
|
|
249
|
-
quantityIn: string;
|
|
250
|
-
quantityOut: string;
|
|
251
|
-
name: string | null;
|
|
252
|
-
symbol: string | null;
|
|
253
|
-
decimals: string | null;
|
|
254
|
-
address: string;
|
|
255
|
-
totalBalance: string;
|
|
256
|
-
};
|
|
257
|
-
type QNGetWalletTokenBalanceResult = {
|
|
258
|
-
result: RPCWalletTokenBalance[];
|
|
259
|
-
totalItems: number;
|
|
260
|
-
totalPages: number;
|
|
261
|
-
pageNumber: number;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
declare const qnGetWalletTokenTransactionsInputSchema: z.ZodObject<{
|
|
265
|
-
contract: z.ZodString;
|
|
266
|
-
address: z.ZodString;
|
|
267
|
-
fromBlock: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
268
|
-
toBlock: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
269
|
-
perPage: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
270
|
-
page: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
271
|
-
}, "strict", z.ZodTypeAny, {
|
|
272
|
-
contract: string;
|
|
273
|
-
address: string;
|
|
274
|
-
fromBlock?: number | null | undefined;
|
|
275
|
-
toBlock?: number | null | undefined;
|
|
276
|
-
perPage?: number | null | undefined;
|
|
277
|
-
page?: number | null | undefined;
|
|
278
|
-
}, {
|
|
279
|
-
contract: string;
|
|
280
|
-
address: string;
|
|
281
|
-
fromBlock?: number | null | undefined;
|
|
282
|
-
toBlock?: number | null | undefined;
|
|
283
|
-
perPage?: number | null | undefined;
|
|
284
|
-
page?: number | null | undefined;
|
|
285
|
-
}>;
|
|
286
|
-
type QNGetWalletTokenTransactionsInput = z.infer<typeof qnGetWalletTokenTransactionsInputSchema>;
|
|
287
|
-
type RPCFullTokenMetadata = {
|
|
288
|
-
address: string;
|
|
289
|
-
genesisBlock: string | null;
|
|
290
|
-
genesisTransaction: string | null;
|
|
291
|
-
name: string | null;
|
|
292
|
-
symbol: string | null;
|
|
293
|
-
decimals: string | null;
|
|
294
|
-
contractAddress: string;
|
|
295
|
-
};
|
|
296
|
-
type RPCTokenTransaction = {
|
|
297
|
-
blockNumber: string;
|
|
298
|
-
transactionHash: string;
|
|
299
|
-
toAddress: string;
|
|
300
|
-
fromAddress: string;
|
|
301
|
-
logIndex: number;
|
|
302
|
-
type: string;
|
|
303
|
-
timestamp: string;
|
|
304
|
-
receivedTokenContractAddress: string | null;
|
|
305
|
-
sentTokenContractAddress: string | null;
|
|
306
|
-
sentAmount: string;
|
|
307
|
-
receivedAmount: string;
|
|
308
|
-
decimalSentAmount: string;
|
|
309
|
-
decimalReceivedAmount: string;
|
|
310
|
-
};
|
|
311
|
-
type QNGetWalletTokenTransactionsResult = {
|
|
312
|
-
paginatedItems: RPCTokenTransaction[];
|
|
313
|
-
totalItems: number;
|
|
314
|
-
totalPages: number;
|
|
315
|
-
pageNumber: number;
|
|
316
|
-
token: RPCFullTokenMetadata;
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
type NFTAndTokenActions = {
|
|
320
|
-
/**
|
|
321
|
-
* Returns aggregated data on NFTs for a given wallet.
|
|
322
|
-
*
|
|
323
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_fetchNFTs_v2
|
|
324
|
-
*
|
|
325
|
-
* @param args - {@link QNFetchNFTInput}
|
|
326
|
-
* @returns response - {@link QNFetchNFTsResult}
|
|
327
|
-
*
|
|
328
|
-
* @example
|
|
329
|
-
* import QuickNode from '@quicknode/sdk';
|
|
330
|
-
*
|
|
331
|
-
* const core = new QuickNode.Core({
|
|
332
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
333
|
-
* config: {
|
|
334
|
-
* addOns: { nftTokenV2: true }
|
|
335
|
-
* }
|
|
336
|
-
* }
|
|
337
|
-
*
|
|
338
|
-
* const response = await core.client.qn_fetchNFTs({
|
|
339
|
-
* wallet: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6",
|
|
340
|
-
* contracts: ['0x2106C00Ac7dA0A3430aE667879139E832307AeAa'],
|
|
341
|
-
* });
|
|
342
|
-
*/
|
|
343
|
-
qn_fetchNFTs: (args: SimplifyType<QNFetchNFTInput>) => Promise<SimplifyType<QNFetchNFTResult>>;
|
|
344
|
-
/**
|
|
345
|
-
* Returns aggregated data on NFTs for a given wallet.
|
|
346
|
-
*
|
|
347
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_fetchNFTCollectionDetails_v2
|
|
348
|
-
*
|
|
349
|
-
* @param args - {@link QNFetchNFTCollectionDetailsInput}
|
|
350
|
-
* @returns response - {@link QNFetchNFTCollectionDetailsResult}
|
|
351
|
-
*
|
|
352
|
-
* @example
|
|
353
|
-
* import QuickNode from '@quicknode/sdk';
|
|
354
|
-
*
|
|
355
|
-
* const core = new QuickNode.Core({
|
|
356
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
357
|
-
* config: {
|
|
358
|
-
* addOns: { nftTokenV2: true }
|
|
359
|
-
* }
|
|
360
|
-
* }
|
|
361
|
-
*
|
|
362
|
-
* const response = await core.client.qn_fetchNFTCollectionDetails({
|
|
363
|
-
* contracts: [
|
|
364
|
-
* "0x60E4d786628Fea6478F785A6d7e704777c86a7c6",
|
|
365
|
-
* "0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7",
|
|
366
|
-
* ]
|
|
367
|
-
* });
|
|
368
|
-
*/
|
|
369
|
-
qn_fetchNFTCollectionDetails: (args: SimplifyType<QNFetchNFTCollectionDetailsInput>) => Promise<SimplifyType<QNFetchNFTCollectionDetailsResult>>;
|
|
370
|
-
/**
|
|
371
|
-
* Returns aggregated data on NFTs within a given collection.
|
|
372
|
-
*
|
|
373
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_fetchNFTsByCollection_v2
|
|
374
|
-
*
|
|
375
|
-
* @param args - {@link QNFetchNFTsByCollectionInput}
|
|
376
|
-
* @returns response - {@link QNFetchNFTsByCollectionResult}
|
|
377
|
-
*
|
|
378
|
-
* @example
|
|
379
|
-
* import QuickNode from '@quicknode/sdk';
|
|
380
|
-
*
|
|
381
|
-
* const core = new QuickNode.Core({
|
|
382
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
383
|
-
* config: {
|
|
384
|
-
* addOns: { nftTokenV2: true }
|
|
385
|
-
* }
|
|
386
|
-
* }
|
|
387
|
-
*
|
|
388
|
-
* const response = await core.client.qn_fetchNFTsByCollection({
|
|
389
|
-
* collection: "0x60E4d786628Fea6478F785A6d7e704777c86a7c6",
|
|
390
|
-
* })
|
|
391
|
-
*/
|
|
392
|
-
qn_fetchNFTsByCollection: (args: SimplifyType<QNFetchNFTsByCollectionInput>) => Promise<SimplifyType<QNFetchNFTsByCollectionResult>>;
|
|
393
|
-
/**
|
|
394
|
-
* Returns transfers by given NFT.
|
|
395
|
-
*
|
|
396
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_getTransfersByNFT_v2
|
|
397
|
-
*
|
|
398
|
-
* @param args - {@link QNGetTransfersByNFTInput}
|
|
399
|
-
* @returns response - {@link QNGetTransfersByNFTResult}
|
|
400
|
-
*
|
|
401
|
-
* @example
|
|
402
|
-
* import QuickNode from '@quicknode/sdk';
|
|
403
|
-
*
|
|
404
|
-
* const core = new QuickNode.Core({
|
|
405
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
406
|
-
* config: {
|
|
407
|
-
* addOns: { nftTokenV2: true }
|
|
408
|
-
* }
|
|
409
|
-
* }
|
|
410
|
-
*
|
|
411
|
-
* const response = await core.client.qn_getTransfersByNFT({
|
|
412
|
-
* collection: "0x60E4d786628Fea6478F785A6d7e704777c86a7c6",
|
|
413
|
-
7 * collectionTokenId: "1",
|
|
414
|
-
* })
|
|
415
|
-
*/
|
|
416
|
-
qn_getTransfersByNFT: (args: SimplifyType<QNGetTransfersByNFTInput>) => Promise<SimplifyType<QNGetTransfersByNFTResult>>;
|
|
417
|
-
/**
|
|
418
|
-
* Confirms ownership of specified NFTs for a given wallet.
|
|
419
|
-
*
|
|
420
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_verifyNFTsOwner_v2
|
|
421
|
-
*
|
|
422
|
-
* @param args - {@link QNVerifyNFTsOwnerInput}
|
|
423
|
-
* @returns response - {@link QNVerifyNFTsOwnerResult}
|
|
424
|
-
*
|
|
425
|
-
* @example
|
|
426
|
-
* import QuickNode from '@quicknode/sdk';
|
|
427
|
-
*
|
|
428
|
-
* const core = new QuickNode.Core({
|
|
429
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
430
|
-
* config: {
|
|
431
|
-
* addOns: { nftTokenV2: true }
|
|
432
|
-
* }
|
|
433
|
-
* }
|
|
434
|
-
*
|
|
435
|
-
* const response = await core.client.qn_verifyNFTsOwner({
|
|
436
|
-
* wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
|
|
437
|
-
* contracts: [
|
|
438
|
-
* "0x2106c00ac7da0a3430ae667879139e832307aeaa:3643",
|
|
439
|
-
* "0xd07dc4262bcdbf85190c01c996b4c06a461d2430:133803",
|
|
440
|
-
* ],
|
|
441
|
-
* })
|
|
442
|
-
*
|
|
443
|
-
*/
|
|
444
|
-
qn_verifyNFTsOwner: (args: SimplifyType<QNVerifyNFTsOwnerInput>) => Promise<SimplifyType<QNVerifyNFTsOwnerResult>>;
|
|
445
|
-
/**
|
|
446
|
-
* Returns token details for specified contract.
|
|
447
|
-
*
|
|
448
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_getTokenMetadataByContractAddress_v2
|
|
449
|
-
*
|
|
450
|
-
* @param args - {@link QNGetTokenMetadataByCAInput}
|
|
451
|
-
* @returns response - {@link QNGetTokenMetadataByCAResult}
|
|
452
|
-
*
|
|
453
|
-
* @example
|
|
454
|
-
* import QuickNode from '@quicknode/sdk';
|
|
455
|
-
*
|
|
456
|
-
* const core = new QuickNode.Core({
|
|
457
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
458
|
-
* config: {
|
|
459
|
-
* addOns: { nftTokenV2: true }
|
|
460
|
-
* }
|
|
461
|
-
* }
|
|
462
|
-
*
|
|
463
|
-
* const response = await core.client.qn_getTokenMetadataByContractAddress({
|
|
464
|
-
* contract: "0x2106c00ac7da0a3430ae667879139e832307aeaa",
|
|
465
|
-
* })
|
|
466
|
-
*/
|
|
467
|
-
qn_getTokenMetadataByContractAddress: (args: SimplifyType<QNGetTokenMetadataByCAInput>) => Promise<SimplifyType<QNGetTokenMetadataByCAResult | null>>;
|
|
468
|
-
/**
|
|
469
|
-
* Returns token details for specified token symbol.
|
|
470
|
-
*
|
|
471
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_getTokenMetadataBySymbol_v2
|
|
472
|
-
*
|
|
473
|
-
* @param args - {@link QNGetTokenMetadataBySymbolInput}
|
|
474
|
-
* @returns response - {@link QNGetTokenMetadataBySymbolResult}
|
|
475
|
-
*
|
|
476
|
-
* @example
|
|
477
|
-
* import QuickNode from '@quicknode/sdk';
|
|
478
|
-
*
|
|
479
|
-
* const core = new QuickNode.Core({
|
|
480
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
481
|
-
* config: {
|
|
482
|
-
* addOns: { nftTokenV2: true }
|
|
483
|
-
* }
|
|
484
|
-
* }
|
|
485
|
-
*
|
|
486
|
-
* const response = await core.client.qn_getTokenMetadataBySymbol({
|
|
487
|
-
* symbol: "DAI",
|
|
488
|
-
* })
|
|
489
|
-
*/
|
|
490
|
-
qn_getTokenMetadataBySymbol: (args: SimplifyType<QNGetTokenMetadataBySymbolInput>) => Promise<SimplifyType<QNGetTokenMetadataBySymbolResult>>;
|
|
491
|
-
/**
|
|
492
|
-
* Returns transactions within a specified wallet address.
|
|
493
|
-
*
|
|
494
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_getTransactionsByAddress_v2
|
|
495
|
-
*
|
|
496
|
-
* @param args - {@link QNGetTransactionsByAddressInput}
|
|
497
|
-
* @returns response - {@link QNGetTransactionsByAddressResult}
|
|
498
|
-
*
|
|
499
|
-
* @example
|
|
500
|
-
* import QuickNode from '@quicknode/sdk';
|
|
501
|
-
*
|
|
502
|
-
* const core = new QuickNode.Core({
|
|
503
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
504
|
-
* config: {
|
|
505
|
-
* addOns: { nftTokenV2: true }
|
|
506
|
-
* }
|
|
507
|
-
* }
|
|
508
|
-
*
|
|
509
|
-
* const response = await core.client.qn_getTransactionsByAddress({
|
|
510
|
-
* address: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6"
|
|
511
|
-
* })
|
|
512
|
-
*/
|
|
513
|
-
qn_getTransactionsByAddress: (args: SimplifyType<QNGetTransactionsByAddressInput>) => Promise<SimplifyType<QNGetTransactionsByAddressResult>>;
|
|
514
|
-
/**
|
|
515
|
-
* Returns ERC-20 tokens and token balances within a wallet.
|
|
516
|
-
*
|
|
517
|
-
* - Docs: https://www.quicknode.com/docs/ethereum/qn_getWalletTokenBalance_v2
|
|
518
|
-
*
|
|
519
|
-
* @param args - {@link QNGetWalletTokenBalanceInput}
|
|
520
|
-
* @returns response - {@link QNGetWalletTokenBalanceResult}
|
|
521
|
-
*
|
|
522
|
-
* @example
|
|
523
|
-
* import QuickNode from '@quicknode/sdk';
|
|
524
|
-
*
|
|
525
|
-
* const core = new QuickNode.Core({
|
|
526
|
-
* endpointUrl: "https://some-cool-name.quiknode.pro/abcd1234",
|
|
527
|
-
* config: {
|
|
528
|
-
* addOns: { nftTokenV2: true }
|
|
529
|
-
* }
|
|
530
|
-
* }
|
|
531
|
-
*
|
|
532
|
-
* const response = await core.client.qn_getWalletTokenBalance({
|
|
533
|
-
* address: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6"
|
|
534
|
-
* })
|
|
535
|
-
*/
|
|
536
|
-
qn_getWalletTokenBalance: (args: SimplifyType<QNGetWalletTokenBalanceInput>) => Promise<SimplifyType<QNGetWalletTokenBalanceResult>>;
|
|
537
|
-
qn_getWalletTokenTransactions: (args: SimplifyType<QNGetWalletTokenTransactionsInput>) => Promise<SimplifyType<QNGetWalletTokenTransactionsResult>>;
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
interface CoreArguments {
|
|
541
|
-
endpointUrl: string;
|
|
542
|
-
chain?: Chain;
|
|
543
|
-
config?: QNCoreClientConfig;
|
|
544
|
-
}
|
|
545
|
-
type QNCoreClientConfig = {
|
|
546
|
-
addOns?: {
|
|
547
|
-
nftTokenV2: boolean;
|
|
548
|
-
};
|
|
549
|
-
};
|
|
550
|
-
type QNCoreClient = PublicClient & NFTAndTokenActions;
|
|
551
|
-
|
|
552
|
-
declare class Core {
|
|
553
|
-
readonly endpointUrl: string;
|
|
554
|
-
readonly client: QNCoreClient;
|
|
555
|
-
constructor({ endpointUrl, chain, config }: CoreArguments);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
export { Core as default };
|
package/esm/core/index.js
DELETED
package/esm/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import QuickNode from './client/client.js';
|
|
2
|
-
export { default } from './client/client.js';
|
|
3
|
-
export { Core } from './core/core.js';
|
|
4
|
-
export { Solana } from './solana/solana.js';
|
|
5
|
-
import * as viem from 'viem';
|
|
6
|
-
export { viem };
|
|
7
|
-
import * as web3_js from '@solana/web3.js';
|
|
8
|
-
export { web3_js as solanaWeb3 };
|
|
9
|
-
export { QNInputValidationError } from './lib/errors/QNInputValidationError.js';
|
|
10
|
-
export { QNInvalidEndpointUrl } from './lib/errors/QNInvalidEnpointUrl.js';
|
|
11
|
-
export { QNChainNotSupported } from './lib/errors/QNChainNotSupported.js';
|
package/esm/lib/constants.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
class QNInputValidationError extends Error {
|
|
2
|
-
constructor({ messages, zodError, }) {
|
|
3
|
-
super(`QuickNode SDK Input Validation Error: ${messages.join(', ')}`);
|
|
4
|
-
this.messages = messages;
|
|
5
|
-
this.issues = zodError.issues;
|
|
6
|
-
this.zodError = zodError; // see https://github.com/colinhacks/zod/blob/HEAD/ERROR_HANDLING.md
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { QNInputValidationError };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import fetch, { Headers, Request, Response } from 'cross-fetch';
|
|
2
|
-
|
|
3
|
-
function setupGlobalFetch() {
|
|
4
|
-
// Required for viem to work in node
|
|
5
|
-
if (!globalThis.fetch) {
|
|
6
|
-
globalThis.fetch = fetch;
|
|
7
|
-
globalThis.Headers = Headers;
|
|
8
|
-
globalThis.Request = Request;
|
|
9
|
-
globalThis.Response = Response;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { setupGlobalFetch };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { QNInputValidationError } from '../errors/QNInputValidationError.js';
|
|
2
|
-
|
|
3
|
-
function formatErrors(baseError) {
|
|
4
|
-
const errorMessages = [];
|
|
5
|
-
baseError.errors.forEach((error) => {
|
|
6
|
-
errorMessages.push(`${error.path.length > 0 ? error.path + ': ' : ''}${error.message}`);
|
|
7
|
-
});
|
|
8
|
-
return errorMessages.length > 0
|
|
9
|
-
? new QNInputValidationError({
|
|
10
|
-
messages: errorMessages,
|
|
11
|
-
zodError: baseError,
|
|
12
|
-
})
|
|
13
|
-
: null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { formatErrors };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const isEvmAddress = z
|
|
4
|
-
.string()
|
|
5
|
-
.length(42) // Using built-in function for better error messages
|
|
6
|
-
.startsWith('0x') // Using built-in function for better error messages
|
|
7
|
-
.regex(/^0x[a-fA-F0-9]{40}$/, 'Not a valid address');
|
|
8
|
-
const rpcPaginationParams = z
|
|
9
|
-
.object({
|
|
10
|
-
perPage: z.number().positive().nullish(),
|
|
11
|
-
page: z.number().positive().nullish(),
|
|
12
|
-
})
|
|
13
|
-
.strict();
|
|
14
|
-
|
|
15
|
-
export { isEvmAddress, rpcPaginationParams };
|
package/esm/package.json
DELETED