@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/sdk.d.ts
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
// sdk.d.ts
|
|
2
|
+
import {
|
|
3
|
+
QuicknodeSdk as _QuicknodeSdk,
|
|
4
|
+
SdkFullConfig,
|
|
5
|
+
WebhookAttributes,
|
|
6
|
+
S3Attributes,
|
|
7
|
+
AzureAttributes,
|
|
8
|
+
PostgresAttributes,
|
|
9
|
+
MysqlAttributes,
|
|
10
|
+
MongoAttributes,
|
|
11
|
+
ClickhouseAttributes,
|
|
12
|
+
SnowflakeAttributes,
|
|
13
|
+
KafkaAttributes,
|
|
14
|
+
RedisAttributes,
|
|
15
|
+
WebhookTemplateId,
|
|
16
|
+
EvmWalletFilterTemplate,
|
|
17
|
+
EvmContractEventsTemplate,
|
|
18
|
+
EvmAbiFilterTemplate,
|
|
19
|
+
SolanaWalletFilterTemplate,
|
|
20
|
+
BitcoinWalletFilterTemplate,
|
|
21
|
+
XrplWalletFilterTemplate,
|
|
22
|
+
HyperliquidWalletEventsFilterTemplate,
|
|
23
|
+
StellarWalletTransactionsFilterTemplate,
|
|
24
|
+
} from "./index";
|
|
25
|
+
|
|
26
|
+
// Stream destination attributes (input). The inner key is `attributes` rather
|
|
27
|
+
// than the wire's `destination_attributes` to avoid
|
|
28
|
+
// `destinationAttributes.destinationAttributes.url`; the Node binding renames
|
|
29
|
+
// it back before the request.
|
|
30
|
+
export type StreamDestinationAttributesInput =
|
|
31
|
+
| { destination: "webhook"; attributes: WebhookAttributes }
|
|
32
|
+
| { destination: "s3"; attributes: S3Attributes }
|
|
33
|
+
| { destination: "azure"; attributes: AzureAttributes }
|
|
34
|
+
| { destination: "postgres"; attributes: PostgresAttributes }
|
|
35
|
+
| { destination: "mysql"; attributes: MysqlAttributes }
|
|
36
|
+
| { destination: "mongo"; attributes: MongoAttributes }
|
|
37
|
+
| { destination: "clickhouse"; attributes: ClickhouseAttributes }
|
|
38
|
+
| { destination: "snowflake"; attributes: SnowflakeAttributes }
|
|
39
|
+
| { destination: "kafka"; attributes: KafkaAttributes }
|
|
40
|
+
| { destination: "redis"; attributes: RedisAttributes };
|
|
41
|
+
|
|
42
|
+
// Stream destination attributes (response). Mirrors the input shape so a
|
|
43
|
+
// response can be round-tripped back into an update call without renaming.
|
|
44
|
+
// The Node binding renames the wire `destination_attributes` key to
|
|
45
|
+
// `attributes` on the way out.
|
|
46
|
+
export type StreamDestinationAttributesResponse = StreamDestinationAttributesInput;
|
|
47
|
+
|
|
48
|
+
// Replace the napi-generated JSON-blob destinationAttributes with typed unions.
|
|
49
|
+
type _CreateStreamParamsNode = import("./index").CreateStreamParamsNode;
|
|
50
|
+
type _UpdateStreamParamsNode = import("./index").UpdateStreamParamsNode;
|
|
51
|
+
type _StreamNode = import("./index").StreamNode;
|
|
52
|
+
type _ListStreamsResponseNode = import("./index").ListStreamsResponseNode;
|
|
53
|
+
|
|
54
|
+
export type CreateStreamParams =
|
|
55
|
+
Omit<_CreateStreamParamsNode, "destinationAttributes" | "extraDestinations"> & {
|
|
56
|
+
destinationAttributes: StreamDestinationAttributesInput;
|
|
57
|
+
extraDestinations?: StreamDestinationAttributesInput[] | null;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type UpdateStreamParams =
|
|
61
|
+
Omit<_UpdateStreamParamsNode, "destinationAttributes" | "extraDestinations"> & {
|
|
62
|
+
destinationAttributes?: StreamDestinationAttributesInput;
|
|
63
|
+
extraDestinations?: StreamDestinationAttributesInput[] | null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type Stream = Omit<_StreamNode, "destinationAttributes" | "extraDestinations"> & {
|
|
67
|
+
destinationAttributes?: StreamDestinationAttributesResponse;
|
|
68
|
+
extraDestinations?: StreamDestinationAttributesResponse[] | null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type ListStreamsResponse = Omit<_ListStreamsResponseNode, "data"> & {
|
|
72
|
+
data: Stream[];
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Webhook template args (input). The inner key is `args` rather than the
|
|
76
|
+
// wire's `templateArgs` to avoid `templateArgs.templateArgs.wallets`; the
|
|
77
|
+
// Node binding renames it back before the request.
|
|
78
|
+
export type TemplateArgsInput =
|
|
79
|
+
| { templateId: "evmWalletFilter"; args: EvmWalletFilterTemplate }
|
|
80
|
+
| { templateId: "evmContractEvents"; args: EvmContractEventsTemplate }
|
|
81
|
+
| { templateId: "evmAbiFilter"; args: EvmAbiFilterTemplate }
|
|
82
|
+
| { templateId: "solanaWalletFilter"; args: SolanaWalletFilterTemplate }
|
|
83
|
+
| { templateId: "bitcoinWalletFilter"; args: BitcoinWalletFilterTemplate }
|
|
84
|
+
| { templateId: "xrplWalletFilter"; args: XrplWalletFilterTemplate }
|
|
85
|
+
| { templateId: "hyperliquidWalletEventsFilter"; args: HyperliquidWalletEventsFilterTemplate }
|
|
86
|
+
| {
|
|
87
|
+
templateId: "stellarWalletTransactionsSourceAccountFilter";
|
|
88
|
+
args: StellarWalletTransactionsFilterTemplate;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// Replace the napi-generated JSON-blob templateArgs with typed unions.
|
|
92
|
+
type _CreateWebhookFromTemplateParamsNode = import("./index").CreateWebhookFromTemplateParamsNode;
|
|
93
|
+
type _UpdateWebhookTemplateParamsNode = import("./index").UpdateWebhookTemplateParamsNode;
|
|
94
|
+
|
|
95
|
+
export type CreateWebhookFromTemplateParams =
|
|
96
|
+
Omit<_CreateWebhookFromTemplateParamsNode, "templateArgs"> & {
|
|
97
|
+
templateArgs: TemplateArgsInput;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type UpdateWebhookTemplateParams =
|
|
101
|
+
Omit<_UpdateWebhookTemplateParamsNode, "templateArgs"> & {
|
|
102
|
+
templateArgs: TemplateArgsInput;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type {
|
|
106
|
+
SdkFullConfig,
|
|
107
|
+
HttpConfig,
|
|
108
|
+
AdminConfig,
|
|
109
|
+
StreamsConfig,
|
|
110
|
+
// streams
|
|
111
|
+
ListStreamsParams,
|
|
112
|
+
PageInfo,
|
|
113
|
+
TestFilterParams,
|
|
114
|
+
TestFilterResponse,
|
|
115
|
+
EnabledCountResponse,
|
|
116
|
+
WebhookAttributes,
|
|
117
|
+
S3Attributes,
|
|
118
|
+
AzureAttributes,
|
|
119
|
+
PostgresAttributes,
|
|
120
|
+
MysqlAttributes,
|
|
121
|
+
MongoAttributes,
|
|
122
|
+
ClickhouseAttributes,
|
|
123
|
+
SnowflakeAttributes,
|
|
124
|
+
KafkaAttributes,
|
|
125
|
+
RedisAttributes,
|
|
126
|
+
AddressBookConfig,
|
|
127
|
+
StreamsApiClient,
|
|
128
|
+
// billing
|
|
129
|
+
InvoiceLine,
|
|
130
|
+
Invoice,
|
|
131
|
+
ListInvoicesResponse,
|
|
132
|
+
ListInvoicesData,
|
|
133
|
+
Payment,
|
|
134
|
+
ListPaymentsResponse,
|
|
135
|
+
ListPaymentsData,
|
|
136
|
+
// chains
|
|
137
|
+
ChainNetwork,
|
|
138
|
+
Chain,
|
|
139
|
+
ListChainsResponse,
|
|
140
|
+
// metrics
|
|
141
|
+
GetEndpointMetricsRequest,
|
|
142
|
+
GetAccountMetricsRequest,
|
|
143
|
+
EndpointMetric,
|
|
144
|
+
GetEndpointMetricsResponse,
|
|
145
|
+
GetAccountMetricsResponse,
|
|
146
|
+
// rate limits
|
|
147
|
+
MethodRateLimiter,
|
|
148
|
+
GetMethodRateLimitsData,
|
|
149
|
+
GetMethodRateLimitsResponse,
|
|
150
|
+
CreateMethodRateLimitRequest,
|
|
151
|
+
CreateMethodRateLimitResponse,
|
|
152
|
+
UpdateMethodRateLimitRequest,
|
|
153
|
+
UpdateMethodRateLimitResponse,
|
|
154
|
+
RateLimitSettings,
|
|
155
|
+
UpdateRateLimitsRequest,
|
|
156
|
+
// security options
|
|
157
|
+
SecurityOption,
|
|
158
|
+
GetSecurityOptionsResponse,
|
|
159
|
+
SecurityOptionsUpdate,
|
|
160
|
+
UpdateSecurityOptionsRequest,
|
|
161
|
+
UpdateSecurityOptionsResponse,
|
|
162
|
+
CreateReferrerRequest,
|
|
163
|
+
CreateIpRequest,
|
|
164
|
+
CreateDomainMaskRequest,
|
|
165
|
+
CreateJwtRequest,
|
|
166
|
+
CreateRequestFilterRequest,
|
|
167
|
+
CreateRequestFilterResponse,
|
|
168
|
+
CreateRequestFilterData,
|
|
169
|
+
UpdateRequestFilterRequest,
|
|
170
|
+
CreateOrUpdateIpCustomHeaderRequest,
|
|
171
|
+
IpCustomHeaderData,
|
|
172
|
+
CreateOrUpdateIpCustomHeaderResponse,
|
|
173
|
+
DeleteBoolResponse,
|
|
174
|
+
// endpoints
|
|
175
|
+
GetEndpointsRequest,
|
|
176
|
+
GetEndpointsResponse,
|
|
177
|
+
Endpoint,
|
|
178
|
+
EndpointTag,
|
|
179
|
+
CreateEndpointRequest,
|
|
180
|
+
CreateEndpointResponse,
|
|
181
|
+
SingleEndpoint,
|
|
182
|
+
EndpointRateLimits,
|
|
183
|
+
EndpointSecurity,
|
|
184
|
+
EndpointSecurityOptions,
|
|
185
|
+
EndpointIpCustomHeaderOption,
|
|
186
|
+
EndpointToken,
|
|
187
|
+
EndpointJwt,
|
|
188
|
+
EndpointReferrer,
|
|
189
|
+
EndpointDomainMask,
|
|
190
|
+
EndpointIp,
|
|
191
|
+
EndpointRequestFilter,
|
|
192
|
+
ShowEndpointResponse,
|
|
193
|
+
UpdateEndpointRequest,
|
|
194
|
+
UpdateEndpointStatusRequest,
|
|
195
|
+
UpdateEndpointStatusResponse,
|
|
196
|
+
CreateTagRequest,
|
|
197
|
+
Pagination,
|
|
198
|
+
GetEndpointSecurityResponse,
|
|
199
|
+
// bulk
|
|
200
|
+
BulkOperationResult,
|
|
201
|
+
BulkUpdateEndpointStatusRequest,
|
|
202
|
+
BulkUpdateEndpointStatusData,
|
|
203
|
+
BulkUpdateEndpointStatusResponse,
|
|
204
|
+
BulkTag,
|
|
205
|
+
BulkAddTagRequest,
|
|
206
|
+
BulkAddTagData,
|
|
207
|
+
BulkAddTagResponse,
|
|
208
|
+
BulkRemoveTagRequest,
|
|
209
|
+
BulkRemoveTagData,
|
|
210
|
+
BulkRemoveTagResponse,
|
|
211
|
+
// account tags
|
|
212
|
+
AccountTag,
|
|
213
|
+
ListTagsData,
|
|
214
|
+
ListTagsResponse,
|
|
215
|
+
RenameTagRequest,
|
|
216
|
+
RenameTagResponse,
|
|
217
|
+
DeleteAccountTagData,
|
|
218
|
+
DeleteAccountTagResponse,
|
|
219
|
+
// logs
|
|
220
|
+
GetEndpointLogsRequest,
|
|
221
|
+
LogDetails,
|
|
222
|
+
EndpointLog,
|
|
223
|
+
GetEndpointLogsResponse,
|
|
224
|
+
GetLogDetailsResponse,
|
|
225
|
+
// teams
|
|
226
|
+
TeamUser,
|
|
227
|
+
TeamSummary,
|
|
228
|
+
TeamDetail,
|
|
229
|
+
ListTeamsResponse,
|
|
230
|
+
CreateTeamRequest,
|
|
231
|
+
CreateTeamData,
|
|
232
|
+
CreateTeamResponse,
|
|
233
|
+
GetTeamResponse,
|
|
234
|
+
DeleteTeamData,
|
|
235
|
+
DeleteTeamResponse,
|
|
236
|
+
TeamEndpoint,
|
|
237
|
+
ListTeamEndpointsResponse,
|
|
238
|
+
UpdateTeamEndpointsRequest,
|
|
239
|
+
UpdateTeamEndpointsData,
|
|
240
|
+
UpdateTeamEndpointsResponse,
|
|
241
|
+
InviteTeamMemberRequest,
|
|
242
|
+
InviteTeamMemberResponse,
|
|
243
|
+
RemoveTeamMemberRequest,
|
|
244
|
+
TeamMessageData,
|
|
245
|
+
RemoveTeamMemberResponse,
|
|
246
|
+
ResendTeamInviteResponse,
|
|
247
|
+
// usage
|
|
248
|
+
GetUsageRequest,
|
|
249
|
+
UsageData,
|
|
250
|
+
GetUsageResponse,
|
|
251
|
+
EndpointUsage,
|
|
252
|
+
MethodUsage,
|
|
253
|
+
ChainUsage,
|
|
254
|
+
UsageByEndpointData,
|
|
255
|
+
GetUsageByEndpointResponse,
|
|
256
|
+
UsageByMethodData,
|
|
257
|
+
GetUsageByMethodResponse,
|
|
258
|
+
UsageByChainData,
|
|
259
|
+
GetUsageByChainResponse,
|
|
260
|
+
TagUsage,
|
|
261
|
+
UsageByTagData,
|
|
262
|
+
GetUsageByTagResponse,
|
|
263
|
+
// webhooks
|
|
264
|
+
WebhooksConfig,
|
|
265
|
+
GetWebhooksParams,
|
|
266
|
+
UpdateWebhookParams,
|
|
267
|
+
Webhook,
|
|
268
|
+
ListWebhooksResponse,
|
|
269
|
+
WebhookPageInfo,
|
|
270
|
+
WebhookEnabledCountResponse,
|
|
271
|
+
WebhookDestinationAttributes,
|
|
272
|
+
ActivateWebhookParams,
|
|
273
|
+
EvmWalletFilterTemplate,
|
|
274
|
+
EvmContractEventsTemplate,
|
|
275
|
+
EvmAbiFilterTemplate,
|
|
276
|
+
SolanaWalletFilterTemplate,
|
|
277
|
+
BitcoinWalletFilterTemplate,
|
|
278
|
+
XrplWalletFilterTemplate,
|
|
279
|
+
HyperliquidWalletEventsFilterTemplate,
|
|
280
|
+
StellarWalletTransactionsFilterTemplate,
|
|
281
|
+
WebhooksApiClient,
|
|
282
|
+
// kvstore
|
|
283
|
+
KvStoreConfig,
|
|
284
|
+
KvStoreApiClient,
|
|
285
|
+
KvSetEntry,
|
|
286
|
+
CreateSetParams,
|
|
287
|
+
GetSetsParams,
|
|
288
|
+
GetSetsResponse,
|
|
289
|
+
GetSetResponse,
|
|
290
|
+
BulkSetsParams,
|
|
291
|
+
CreateListParams,
|
|
292
|
+
GetListsParams,
|
|
293
|
+
GetListsData,
|
|
294
|
+
GetListsResponse,
|
|
295
|
+
GetListParams,
|
|
296
|
+
GetListData,
|
|
297
|
+
GetListResponse,
|
|
298
|
+
UpdateListParams,
|
|
299
|
+
AddListItemParams,
|
|
300
|
+
ListContainsItemResponse,
|
|
301
|
+
} from "./index";
|
|
302
|
+
|
|
303
|
+
// const enums must use `export` (not `export type`) so they are usable as values
|
|
304
|
+
export {
|
|
305
|
+
StreamRegion,
|
|
306
|
+
StreamDataset,
|
|
307
|
+
StreamDestination,
|
|
308
|
+
FilterLanguage,
|
|
309
|
+
StreamMetadataLocation,
|
|
310
|
+
ProductType,
|
|
311
|
+
StreamStatus,
|
|
312
|
+
WebhookTemplateId,
|
|
313
|
+
WebhookStartFrom,
|
|
314
|
+
} from "./index";
|
|
315
|
+
|
|
316
|
+
// Retypes napi's `any` destination_attributes to the discriminated unions.
|
|
317
|
+
// NOTE: keep these method signatures in sync with the napi-generated
|
|
318
|
+
// StreamsApiClient in ./index.d.ts. Adding a method to crates/node/src/lib.rs
|
|
319
|
+
// requires adding it here too; there is no automated check.
|
|
320
|
+
export interface StreamsApiClientTyped {
|
|
321
|
+
createStream(params: CreateStreamParams): Promise<Stream>;
|
|
322
|
+
listStreams(params?: import("./index").ListStreamsParams | undefined | null): Promise<ListStreamsResponse>;
|
|
323
|
+
deleteAllStreams(): Promise<void>;
|
|
324
|
+
getStream(id: string): Promise<Stream>;
|
|
325
|
+
updateStream(id: string, params: UpdateStreamParams): Promise<Stream>;
|
|
326
|
+
deleteStream(id: string): Promise<void>;
|
|
327
|
+
activateStream(id: string): Promise<void>;
|
|
328
|
+
pauseStream(id: string): Promise<void>;
|
|
329
|
+
testFilter(params: import("./index").TestFilterParams): Promise<import("./index").TestFilterResponse>;
|
|
330
|
+
getEnabledCount(streamType?: string | undefined | null): Promise<import("./index").EnabledCountResponse>;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Retypes napi's `any` templateArgs to the discriminated union. Keep method
|
|
334
|
+
// signatures in sync with the napi-generated WebhooksApiClient in ./index.d.ts.
|
|
335
|
+
export interface WebhooksApiClientTyped {
|
|
336
|
+
listWebhooks(params?: import("./index").GetWebhooksParams | undefined | null): Promise<import("./index").ListWebhooksResponse>;
|
|
337
|
+
deleteAllWebhooks(): Promise<void>;
|
|
338
|
+
getWebhook(id: string): Promise<import("./index").Webhook>;
|
|
339
|
+
updateWebhook(
|
|
340
|
+
id: string,
|
|
341
|
+
params: import("./index").UpdateWebhookParams
|
|
342
|
+
): Promise<import("./index").Webhook>;
|
|
343
|
+
deleteWebhook(id: string): Promise<void>;
|
|
344
|
+
pauseWebhook(id: string): Promise<void>;
|
|
345
|
+
activateWebhook(id: string, params: import("./index").ActivateWebhookParams): Promise<void>;
|
|
346
|
+
getEnabledCount(): Promise<import("./index").WebhookEnabledCountResponse>;
|
|
347
|
+
createWebhookFromTemplate(params: CreateWebhookFromTemplateParams): Promise<import("./index").Webhook>;
|
|
348
|
+
updateWebhookTemplate(
|
|
349
|
+
webhookId: string,
|
|
350
|
+
params: UpdateWebhookTemplateParams
|
|
351
|
+
): Promise<import("./index").Webhook>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export class QuicknodeSdk {
|
|
355
|
+
constructor(config: SdkFullConfig);
|
|
356
|
+
static fromEnv(): QuicknodeSdk;
|
|
357
|
+
admin: _QuicknodeSdk["admin"];
|
|
358
|
+
streams: StreamsApiClientTyped;
|
|
359
|
+
webhooks: WebhooksApiClientTyped;
|
|
360
|
+
kvstore: _QuicknodeSdk["kvstore"];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Typed static factory methods producing each discriminated variant of
|
|
364
|
+
// TemplateArgsInput. Consumers can also construct the object literal directly.
|
|
365
|
+
export const TemplateArgs: {
|
|
366
|
+
evmWalletFilter(attrs: EvmWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "evmWalletFilter" }>;
|
|
367
|
+
evmContractEvents(attrs: EvmContractEventsTemplate): Extract<TemplateArgsInput, { templateId: "evmContractEvents" }>;
|
|
368
|
+
evmAbiFilter(attrs: EvmAbiFilterTemplate): Extract<TemplateArgsInput, { templateId: "evmAbiFilter" }>;
|
|
369
|
+
solanaWalletFilter(attrs: SolanaWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "solanaWalletFilter" }>;
|
|
370
|
+
bitcoinWalletFilter(attrs: BitcoinWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "bitcoinWalletFilter" }>;
|
|
371
|
+
xrplWalletFilter(attrs: XrplWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "xrplWalletFilter" }>;
|
|
372
|
+
hyperliquidWalletEventsFilter(attrs: HyperliquidWalletEventsFilterTemplate): Extract<TemplateArgsInput, { templateId: "hyperliquidWalletEventsFilter" }>;
|
|
373
|
+
stellarWalletTransactionsFilter(attrs: StellarWalletTransactionsFilterTemplate): Extract<TemplateArgsInput, { templateId: "stellarWalletTransactionsSourceAccountFilter" }>;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
// Typed error hierarchy. Any SDK call can throw one of these; catch
|
|
377
|
+
// QuicknodeError to handle them all, or a specific subclass for finer control.
|
|
378
|
+
export class QuicknodeError extends Error {}
|
|
379
|
+
export class ConfigError extends QuicknodeError {}
|
|
380
|
+
export class HttpError extends QuicknodeError {}
|
|
381
|
+
export class TimeoutError extends HttpError {}
|
|
382
|
+
export class ConnectionError extends HttpError {}
|
|
383
|
+
export class ApiError extends QuicknodeError {
|
|
384
|
+
status: number;
|
|
385
|
+
body: string;
|
|
386
|
+
}
|
|
387
|
+
export class DecodeError extends QuicknodeError {
|
|
388
|
+
body: string;
|
|
389
|
+
}
|
package/sdk.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Exported main sdk file that imports from autogenerated napi-rs file
|
|
2
|
+
//
|
|
3
|
+
const _index = require("./index.js");
|
|
4
|
+
const { QuicknodeSdk: _QuicknodeSdk } = _index;
|
|
5
|
+
const errors = require("./errors.js");
|
|
6
|
+
|
|
7
|
+
class QuicknodeSdk {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
try {
|
|
10
|
+
this._inner = new _QuicknodeSdk(config);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw errors.fromNapiError(e);
|
|
13
|
+
}
|
|
14
|
+
this.admin = errors.wrapClient(this._inner.admin);
|
|
15
|
+
this.streams = errors.wrapClient(this._inner.streams);
|
|
16
|
+
this.webhooks = errors.wrapClient(this._inner.webhooks);
|
|
17
|
+
this.kvstore = errors.wrapClient(this._inner.kvstore);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static fromEnv() {
|
|
21
|
+
const instance = Object.create(QuicknodeSdk.prototype);
|
|
22
|
+
try {
|
|
23
|
+
instance._inner = _QuicknodeSdk.fromEnv();
|
|
24
|
+
} catch (e) {
|
|
25
|
+
throw errors.fromNapiError(e);
|
|
26
|
+
}
|
|
27
|
+
instance.admin = errors.wrapClient(instance._inner.admin);
|
|
28
|
+
instance.streams = errors.wrapClient(instance._inner.streams);
|
|
29
|
+
instance.webhooks = errors.wrapClient(instance._inner.webhooks);
|
|
30
|
+
instance.kvstore = errors.wrapClient(instance._inner.kvstore);
|
|
31
|
+
return instance;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// TemplateArgs wraps the webhook template input with typed static factory
|
|
36
|
+
// methods. The underlying object is `{ templateId, args }` — callers should
|
|
37
|
+
// use the factory methods rather than constructing the object directly.
|
|
38
|
+
class TemplateArgs {
|
|
39
|
+
constructor(templateId, args) {
|
|
40
|
+
this.templateId = templateId;
|
|
41
|
+
this.args = args;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static evmWalletFilter(attrs) {
|
|
45
|
+
return new TemplateArgs("evmWalletFilter", attrs);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static evmContractEvents(attrs) {
|
|
49
|
+
return new TemplateArgs("evmContractEvents", attrs);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static evmAbiFilter(attrs) {
|
|
53
|
+
return new TemplateArgs("evmAbiFilter", attrs);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static solanaWalletFilter(attrs) {
|
|
57
|
+
return new TemplateArgs("solanaWalletFilter", attrs);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static bitcoinWalletFilter(attrs) {
|
|
61
|
+
return new TemplateArgs("bitcoinWalletFilter", attrs);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static xrplWalletFilter(attrs) {
|
|
65
|
+
return new TemplateArgs("xrplWalletFilter", attrs);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static hyperliquidWalletEventsFilter(attrs) {
|
|
69
|
+
return new TemplateArgs("hyperliquidWalletEventsFilter", attrs);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static stellarWalletTransactionsFilter(attrs) {
|
|
73
|
+
return new TemplateArgs("stellarWalletTransactionsSourceAccountFilter", attrs);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = {
|
|
78
|
+
..._index,
|
|
79
|
+
QuicknodeSdk,
|
|
80
|
+
TemplateArgs,
|
|
81
|
+
QuicknodeError: errors.QuicknodeError,
|
|
82
|
+
ConfigError: errors.ConfigError,
|
|
83
|
+
HttpError: errors.HttpError,
|
|
84
|
+
TimeoutError: errors.TimeoutError,
|
|
85
|
+
ConnectionError: errors.ConnectionError,
|
|
86
|
+
ApiError: errors.ApiError,
|
|
87
|
+
DecodeError: errors.DecodeError,
|
|
88
|
+
};
|
package/sdk.mjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// ESM wrapper: re-exports the CJS entry via dynamic import.
|
|
2
|
+
// The native .node binary loader (index.js) uses require() for platform
|
|
3
|
+
// detection and cannot be expressed as static ESM — this wrapper bridges
|
|
4
|
+
// the gap for ESM consumers while keeping the loader intact.
|
|
5
|
+
//
|
|
6
|
+
// We re-export everything from the default export so that new types added
|
|
7
|
+
// to sdk.js are automatically available here without manual updates.
|
|
8
|
+
import cjs from './sdk.js';
|
|
9
|
+
|
|
10
|
+
export default cjs;
|
|
11
|
+
export const {
|
|
12
|
+
QuicknodeSdk,
|
|
13
|
+
TemplateArgs,
|
|
14
|
+
StreamRegion,
|
|
15
|
+
StreamDataset,
|
|
16
|
+
StreamDestination,
|
|
17
|
+
FilterLanguage,
|
|
18
|
+
StreamMetadataLocation,
|
|
19
|
+
ProductType,
|
|
20
|
+
StreamStatus,
|
|
21
|
+
WebhookTemplateId,
|
|
22
|
+
WebhookStartFrom,
|
|
23
|
+
AdminApiClient,
|
|
24
|
+
StreamsApiClient,
|
|
25
|
+
WebhooksApiClient,
|
|
26
|
+
KvStoreApiClient,
|
|
27
|
+
QuicknodeError,
|
|
28
|
+
ConfigError,
|
|
29
|
+
HttpError,
|
|
30
|
+
TimeoutError,
|
|
31
|
+
ConnectionError,
|
|
32
|
+
ApiError,
|
|
33
|
+
DecodeError,
|
|
34
|
+
} = cjs;
|