@quicknode/sdk 3.0.0-alpha.6 → 3.1.0-alpha.15
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 +96 -3434
- package/errors.js +7 -7
- package/index.d.ts +47 -181
- package/index.darwin-arm64.node +0 -0
- package/index.js +2 -2
- 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 +7 -6
- package/sdk.d.ts +77 -42
- package/sdk.js +20 -34
- package/sdk.mjs +2 -2
package/errors.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
// message is tagged "[<kind>|<status>|<body_len>]<msg>\x1f<body>"; parseAndRethrow
|
|
3
3
|
// decodes that and throws an instance of the matching subclass below.
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class QuicknodeError extends Error {
|
|
6
6
|
constructor(message) {
|
|
7
7
|
super(message);
|
|
8
|
-
this.name = "
|
|
8
|
+
this.name = "QuicknodeError";
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
class ConfigError extends
|
|
12
|
+
class ConfigError extends QuicknodeError {
|
|
13
13
|
constructor(message) {
|
|
14
14
|
super(message);
|
|
15
15
|
this.name = "ConfigError";
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
class HttpError extends
|
|
19
|
+
class HttpError extends QuicknodeError {
|
|
20
20
|
constructor(message) {
|
|
21
21
|
super(message);
|
|
22
22
|
this.name = "HttpError";
|
|
@@ -37,7 +37,7 @@ class ConnectionError extends HttpError {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
class ApiError extends
|
|
40
|
+
class ApiError extends QuicknodeError {
|
|
41
41
|
constructor(message, status, body) {
|
|
42
42
|
super(message);
|
|
43
43
|
this.name = "ApiError";
|
|
@@ -46,7 +46,7 @@ class ApiError extends QuickNodeError {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
class DecodeError extends
|
|
49
|
+
class DecodeError extends QuicknodeError {
|
|
50
50
|
constructor(message, body) {
|
|
51
51
|
super(message);
|
|
52
52
|
this.name = "DecodeError";
|
|
@@ -109,7 +109,7 @@ function wrapClient(client) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
module.exports = {
|
|
112
|
-
|
|
112
|
+
QuicknodeError,
|
|
113
113
|
ConfigError,
|
|
114
114
|
HttpError,
|
|
115
115
|
TimeoutError,
|
package/index.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export interface BulkUpdateEndpointStatusResponse {
|
|
|
108
108
|
export interface BulkAddTagRequest {
|
|
109
109
|
/** Endpoint ids to tag. */
|
|
110
110
|
ids: Array<string>
|
|
111
|
-
/** Label of the tag to apply (created if it doesn't exist). */
|
|
111
|
+
/** Label of the tag to apply (created if it doesn't exist). Maximum 25 characters. */
|
|
112
112
|
label: string
|
|
113
113
|
}
|
|
114
114
|
/** Tag reference returned on bulk tag operations. */
|
|
@@ -172,7 +172,7 @@ export interface ChainNetwork {
|
|
|
172
172
|
/** Numeric chain id, when applicable. */
|
|
173
173
|
chainId?: number
|
|
174
174
|
}
|
|
175
|
-
/** A blockchain supported by
|
|
175
|
+
/** A blockchain supported by Quicknode along with its networks. */
|
|
176
176
|
export interface Chain {
|
|
177
177
|
/** Chain slug (e.g. `ethereum`). */
|
|
178
178
|
slug: string
|
|
@@ -362,7 +362,7 @@ export interface CreateIpRequest {
|
|
|
362
362
|
}
|
|
363
363
|
/** Parameters for `create_domain_mask`. */
|
|
364
364
|
export interface CreateDomainMaskRequest {
|
|
365
|
-
/** Custom domain that will mask the endpoint's
|
|
365
|
+
/** Custom domain that will mask the endpoint's Quicknode URL. */
|
|
366
366
|
domainMask?: string
|
|
367
367
|
}
|
|
368
368
|
/** Parameters for `create_jwt`. */
|
|
@@ -469,7 +469,7 @@ export interface Pagination {
|
|
|
469
469
|
export interface Endpoint {
|
|
470
470
|
/** Unique endpoint identifier. */
|
|
471
471
|
id: string
|
|
472
|
-
/**
|
|
472
|
+
/** Quicknode-assigned subdomain. */
|
|
473
473
|
name: string
|
|
474
474
|
/** Human-readable label. */
|
|
475
475
|
label?: string
|
|
@@ -662,7 +662,7 @@ export interface UpdateEndpointStatusResponse {
|
|
|
662
662
|
}
|
|
663
663
|
/** Parameters for `create_tag` (on a specific endpoint). */
|
|
664
664
|
export interface CreateTagRequest {
|
|
665
|
-
/** Label for the new tag. */
|
|
665
|
+
/** Label for the new tag. Maximum 25 characters. */
|
|
666
666
|
label?: string
|
|
667
667
|
}
|
|
668
668
|
/** Response from `get_endpoint_security`. */
|
|
@@ -1244,12 +1244,7 @@ export const enum StreamDestination {
|
|
|
1244
1244
|
S3 = 'S3',
|
|
1245
1245
|
Azure = 'Azure',
|
|
1246
1246
|
Postgres = 'Postgres',
|
|
1247
|
-
|
|
1248
|
-
Snowflake = 'Snowflake',
|
|
1249
|
-
Mysql = 'Mysql',
|
|
1250
|
-
Mongo = 'Mongo',
|
|
1251
|
-
Kafka = 'Kafka',
|
|
1252
|
-
Redis = 'Redis'
|
|
1247
|
+
Kafka = 'Kafka'
|
|
1253
1248
|
}
|
|
1254
1249
|
/** Language a stream's filter function is written in. */
|
|
1255
1250
|
export const enum FilterLanguage {
|
|
@@ -1280,16 +1275,16 @@ export const enum StreamStatus {
|
|
|
1280
1275
|
export interface WebhookAttributes {
|
|
1281
1276
|
/** Destination URL that receives batched stream payloads. */
|
|
1282
1277
|
url: string
|
|
1283
|
-
/** Maximum number of retry attempts for a failed delivery. */
|
|
1278
|
+
/** Maximum number of retry attempts for a failed delivery. Must be in the range 1–10. */
|
|
1284
1279
|
maxRetry: number
|
|
1285
1280
|
/** Seconds to wait between retry attempts. */
|
|
1286
1281
|
retryIntervalSec: number
|
|
1287
1282
|
/** Timeout in seconds for each POST request. */
|
|
1288
1283
|
postTimeoutSec: number
|
|
1289
|
-
/** Optional token included with each request so the receiver can verify authenticity. */
|
|
1284
|
+
/** Optional token included with each request so the receiver can verify authenticity. When supplied, must be at least 32 bytes (256 bits). */
|
|
1290
1285
|
securityToken?: string
|
|
1291
|
-
/** Compression applied to the payload (e.g. `none`, `gzip`). */
|
|
1292
|
-
compression
|
|
1286
|
+
/** Compression applied to the payload (e.g. `none`, `gzip`). When omitted the server defaults to no compression. */
|
|
1287
|
+
compression?: string
|
|
1293
1288
|
}
|
|
1294
1289
|
/** Configuration for delivering stream batches to an S3-compatible object store. */
|
|
1295
1290
|
export interface S3Attributes {
|
|
@@ -1347,109 +1342,13 @@ export interface PostgresAttributes {
|
|
|
1347
1342
|
password: string
|
|
1348
1343
|
/** Destination table for inserted rows. */
|
|
1349
1344
|
tableName: string
|
|
1350
|
-
/** Postgres SSL mode
|
|
1345
|
+
/** Postgres SSL mode. The Quicknode API accepts only `disable` or `require`. */
|
|
1351
1346
|
sslmode: string
|
|
1352
1347
|
/** Maximum number of retry attempts for a failed write. */
|
|
1353
1348
|
maxRetry: number
|
|
1354
1349
|
/** Seconds to wait between retry attempts. */
|
|
1355
1350
|
retryIntervalSec: number
|
|
1356
1351
|
}
|
|
1357
|
-
/** Configuration for delivering stream batches to a MySQL database. */
|
|
1358
|
-
export interface MysqlAttributes {
|
|
1359
|
-
/** Database host. */
|
|
1360
|
-
host: string
|
|
1361
|
-
/** Database port. */
|
|
1362
|
-
port: number
|
|
1363
|
-
/** Database name. */
|
|
1364
|
-
database: string
|
|
1365
|
-
/** Username used to authenticate. */
|
|
1366
|
-
username: string
|
|
1367
|
-
/** Password used to authenticate. */
|
|
1368
|
-
password: string
|
|
1369
|
-
/** Destination table for inserted rows. */
|
|
1370
|
-
tableName: string
|
|
1371
|
-
/** Maximum number of retry attempts for a failed write. */
|
|
1372
|
-
maxRetry: number
|
|
1373
|
-
/** Seconds to wait between retry attempts. */
|
|
1374
|
-
retryIntervalSec: number
|
|
1375
|
-
}
|
|
1376
|
-
/** Configuration for delivering stream batches to a MongoDB database. */
|
|
1377
|
-
export interface MongoAttributes {
|
|
1378
|
-
/** Database host (connection string or hostname). */
|
|
1379
|
-
host: string
|
|
1380
|
-
/** Database name. */
|
|
1381
|
-
database: string
|
|
1382
|
-
/** Username used to authenticate. */
|
|
1383
|
-
username: string
|
|
1384
|
-
/** Password used to authenticate. */
|
|
1385
|
-
password: string
|
|
1386
|
-
/** Destination collection for inserted documents. */
|
|
1387
|
-
collectionName: string
|
|
1388
|
-
/** Maximum number of retry attempts for a failed write. */
|
|
1389
|
-
maxRetry: number
|
|
1390
|
-
/** Seconds to wait between retry attempts. */
|
|
1391
|
-
retryIntervalSec: number
|
|
1392
|
-
}
|
|
1393
|
-
/** Configuration for delivering stream batches to a ClickHouse cluster. */
|
|
1394
|
-
export interface ClickhouseAttributes {
|
|
1395
|
-
/** Comma-separated list of ClickHouse hosts. */
|
|
1396
|
-
hosts: string
|
|
1397
|
-
/** Database name. */
|
|
1398
|
-
database: string
|
|
1399
|
-
/** Username used to authenticate. */
|
|
1400
|
-
username: string
|
|
1401
|
-
/** Password used to authenticate. */
|
|
1402
|
-
password: string
|
|
1403
|
-
/** Destination table for inserted rows. */
|
|
1404
|
-
tableName: string
|
|
1405
|
-
/** Default table engine options applied when a table is created. */
|
|
1406
|
-
defaultTableEngineOpts: string
|
|
1407
|
-
/** Default index granularity for created tables. */
|
|
1408
|
-
defaultGranularity: number
|
|
1409
|
-
/** Default compression codec for created tables. */
|
|
1410
|
-
defaultCompression: string
|
|
1411
|
-
/** Default secondary index type for created tables. */
|
|
1412
|
-
defaultIndexType: string
|
|
1413
|
-
/** Maximum number of retry attempts for a failed write. */
|
|
1414
|
-
maxRetry: number
|
|
1415
|
-
/** Seconds to wait between retry attempts. */
|
|
1416
|
-
retryIntervalSec: number
|
|
1417
|
-
/** Disable datetime precision for older ClickHouse versions that don't support it. */
|
|
1418
|
-
disableDatetimePrecision?: boolean
|
|
1419
|
-
/** Enable when the target ClickHouse server does not support `RENAME COLUMN`. */
|
|
1420
|
-
dontSupportRenameColumn?: boolean
|
|
1421
|
-
/** Enable when the target ClickHouse server does not support empty default values. */
|
|
1422
|
-
dontSupportEmptyDefaultValue?: boolean
|
|
1423
|
-
/** Skip writing version metadata during initialization. */
|
|
1424
|
-
skipInitializeWithVersion?: boolean
|
|
1425
|
-
}
|
|
1426
|
-
/** Configuration for delivering stream batches to a Snowflake data warehouse. */
|
|
1427
|
-
export interface SnowflakeAttributes {
|
|
1428
|
-
/** Snowflake account identifier. */
|
|
1429
|
-
account: string
|
|
1430
|
-
/** Snowflake host. */
|
|
1431
|
-
host: string
|
|
1432
|
-
/** Snowflake port. */
|
|
1433
|
-
port: number
|
|
1434
|
-
/** Connection protocol (e.g. `https`). */
|
|
1435
|
-
protocol: string
|
|
1436
|
-
/** Database name. */
|
|
1437
|
-
database: string
|
|
1438
|
-
/** Schema within the database. */
|
|
1439
|
-
schema: string
|
|
1440
|
-
/** Warehouse used to run inserts. */
|
|
1441
|
-
warehouse: string
|
|
1442
|
-
/** Username used to authenticate. */
|
|
1443
|
-
username: string
|
|
1444
|
-
/** Password used to authenticate. */
|
|
1445
|
-
password: string
|
|
1446
|
-
/** Maximum number of retry attempts for a failed write. */
|
|
1447
|
-
maxRetry: number
|
|
1448
|
-
/** Seconds to wait between retry attempts. */
|
|
1449
|
-
retryIntervalSec: number
|
|
1450
|
-
/** Optional destination table for inserted rows. */
|
|
1451
|
-
tableName?: string
|
|
1452
|
-
}
|
|
1453
1352
|
/** Configuration for delivering stream batches to a Kafka topic. */
|
|
1454
1353
|
export interface KafkaAttributes {
|
|
1455
1354
|
/** Comma-separated list of Kafka broker addresses (host:port). */
|
|
@@ -1462,8 +1361,8 @@ export interface KafkaAttributes {
|
|
|
1462
1361
|
batchSize: number
|
|
1463
1362
|
/** Milliseconds the producer waits to batch additional messages. */
|
|
1464
1363
|
lingerMs: number
|
|
1465
|
-
/** Maximum
|
|
1466
|
-
|
|
1364
|
+
/** Maximum size in bytes of a single Kafka message (`max_message_bytes`). */
|
|
1365
|
+
maxMessageBytes: number
|
|
1467
1366
|
/** Request timeout in seconds. */
|
|
1468
1367
|
timeoutSec: number
|
|
1469
1368
|
/** Maximum number of retry attempts for a failed produce. */
|
|
@@ -1479,27 +1378,6 @@ export interface KafkaAttributes {
|
|
|
1479
1378
|
/** Optional SASL mechanism (e.g. `PLAIN`, `SCRAM-SHA-256`). */
|
|
1480
1379
|
mechanisms?: string
|
|
1481
1380
|
}
|
|
1482
|
-
/** Configuration for delivering stream batches to a Redis instance. */
|
|
1483
|
-
export interface RedisAttributes {
|
|
1484
|
-
/** Redis host. */
|
|
1485
|
-
host: string
|
|
1486
|
-
/** Redis port. */
|
|
1487
|
-
port: number
|
|
1488
|
-
/** Redis logical database index. */
|
|
1489
|
-
database: number
|
|
1490
|
-
/** Username used to authenticate. */
|
|
1491
|
-
username: string
|
|
1492
|
-
/** Password used to authenticate. */
|
|
1493
|
-
password: string
|
|
1494
|
-
/** Redis key that receives written payloads. */
|
|
1495
|
-
keyName: string
|
|
1496
|
-
/** Maximum number of retry attempts for a failed write. */
|
|
1497
|
-
maxRetry: number
|
|
1498
|
-
/** Seconds to wait between retry attempts. */
|
|
1499
|
-
retryIntervalSec: number
|
|
1500
|
-
/** Whether to connect over TLS. */
|
|
1501
|
-
tls?: boolean
|
|
1502
|
-
}
|
|
1503
1381
|
/**
|
|
1504
1382
|
* Links a stream's filter to an address book so JSON paths resolve against its
|
|
1505
1383
|
* managed address set.
|
|
@@ -1638,18 +1516,6 @@ export interface StellarWalletTransactionsFilterTemplate {
|
|
|
1638
1516
|
/** Stellar wallet addresses to match against. */
|
|
1639
1517
|
wallets: Array<string>
|
|
1640
1518
|
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Template identifier paired with its arguments, consumed by
|
|
1643
|
-
* `create_webhook_from_template` and `update_webhook_template`. Construct via
|
|
1644
|
-
* the typed static factory methods (one per template); do not set fields
|
|
1645
|
-
* directly.
|
|
1646
|
-
*/
|
|
1647
|
-
export interface TemplateArgs {
|
|
1648
|
-
/** Which filter template these arguments correspond to. */
|
|
1649
|
-
templateId: WebhookTemplateId
|
|
1650
|
-
/** Template arguments, pre-serialized as a JSON string. */
|
|
1651
|
-
value: string
|
|
1652
|
-
}
|
|
1653
1519
|
/** Destination configuration for a webhook. */
|
|
1654
1520
|
export interface WebhookDestinationAttributes {
|
|
1655
1521
|
/** Target URL that receives webhook payloads. */
|
|
@@ -1683,30 +1549,6 @@ export interface ActivateWebhookParams {
|
|
|
1683
1549
|
/** Position to begin (or resume) delivery from. */
|
|
1684
1550
|
startFrom: WebhookStartFrom
|
|
1685
1551
|
}
|
|
1686
|
-
/** Parameters for `create_webhook_from_template`. */
|
|
1687
|
-
export interface CreateWebhookFromTemplateParams {
|
|
1688
|
-
/** Human-readable label for the webhook. */
|
|
1689
|
-
name: string
|
|
1690
|
-
/** Blockchain network to watch (e.g. `ethereum-mainnet`). */
|
|
1691
|
-
network: string
|
|
1692
|
-
/** Optional email that receives alerts if the webhook terminates. */
|
|
1693
|
-
notificationEmail?: string
|
|
1694
|
-
/** Destination configuration for delivered payloads. */
|
|
1695
|
-
destinationAttributes: WebhookDestinationAttributes
|
|
1696
|
-
/** Filter template identifier and its arguments. */
|
|
1697
|
-
templateArgs: TemplateArgs
|
|
1698
|
-
}
|
|
1699
|
-
/** Parameters for `update_webhook_template`. */
|
|
1700
|
-
export interface UpdateWebhookTemplateParams {
|
|
1701
|
-
/** New human-readable name. */
|
|
1702
|
-
name?: string
|
|
1703
|
-
/** New notification email. */
|
|
1704
|
-
notificationEmail?: string
|
|
1705
|
-
/** New destination configuration. */
|
|
1706
|
-
destinationAttributes?: WebhookDestinationAttributes
|
|
1707
|
-
/** New template identifier and arguments. */
|
|
1708
|
-
templateArgs: TemplateArgs
|
|
1709
|
-
}
|
|
1710
1552
|
/** A webhook's full configuration and current state. */
|
|
1711
1553
|
export interface Webhook {
|
|
1712
1554
|
/** Unique webhook identifier. */
|
|
@@ -1728,10 +1570,21 @@ export interface Webhook {
|
|
|
1728
1570
|
/** Destination-specific configuration as a JSON string. */
|
|
1729
1571
|
destinationAttributes?: string
|
|
1730
1572
|
}
|
|
1573
|
+
/** Pagination metadata returned alongside a paginated webhooks list. */
|
|
1574
|
+
export interface WebhookPageInfo {
|
|
1575
|
+
/** Page size used for this response. */
|
|
1576
|
+
limit: number
|
|
1577
|
+
/** Starting index of this page within the full result set. */
|
|
1578
|
+
offset: number
|
|
1579
|
+
/** Total number of webhooks matching the query across all pages. */
|
|
1580
|
+
total: number
|
|
1581
|
+
}
|
|
1731
1582
|
/** Response from `list_webhooks`. */
|
|
1732
1583
|
export interface ListWebhooksResponse {
|
|
1733
1584
|
/** Webhooks on the current page. */
|
|
1734
1585
|
data: Array<Webhook>
|
|
1586
|
+
/** Pagination metadata for the response. */
|
|
1587
|
+
pageInfo: WebhookPageInfo
|
|
1735
1588
|
}
|
|
1736
1589
|
/** Response from `get_enabled_count` for webhooks. */
|
|
1737
1590
|
export interface WebhookEnabledCountResponse {
|
|
@@ -1746,9 +1599,9 @@ export interface CreateStreamParamsNode {
|
|
|
1746
1599
|
startRange: number
|
|
1747
1600
|
endRange: number
|
|
1748
1601
|
destinationAttributes: any
|
|
1749
|
-
plan
|
|
1750
|
-
thresholdFetchBuffer
|
|
1751
|
-
datasetBatchSize
|
|
1602
|
+
plan?: string
|
|
1603
|
+
thresholdFetchBuffer?: number
|
|
1604
|
+
datasetBatchSize: number
|
|
1752
1605
|
maxBatchSize?: number
|
|
1753
1606
|
maxBufferRangeSize?: number
|
|
1754
1607
|
maxBufferProcessingWorkers?: number
|
|
@@ -1762,7 +1615,7 @@ export interface CreateStreamParamsNode {
|
|
|
1762
1615
|
notificationEmail?: string
|
|
1763
1616
|
chargeMinCap?: number
|
|
1764
1617
|
fixBlockReorgs?: number
|
|
1765
|
-
elasticBatchEnabled
|
|
1618
|
+
elasticBatchEnabled: boolean
|
|
1766
1619
|
extraDestinations?: Array<any>
|
|
1767
1620
|
}
|
|
1768
1621
|
export interface UpdateStreamParamsNode {
|
|
@@ -1830,7 +1683,20 @@ export interface ListStreamsResponseNode {
|
|
|
1830
1683
|
data: Array<StreamNode>
|
|
1831
1684
|
pageInfo: PageInfo
|
|
1832
1685
|
}
|
|
1833
|
-
export
|
|
1686
|
+
export interface CreateWebhookFromTemplateParamsNode {
|
|
1687
|
+
name: string
|
|
1688
|
+
network: string
|
|
1689
|
+
notificationEmail?: string
|
|
1690
|
+
destinationAttributes: WebhookDestinationAttributes
|
|
1691
|
+
templateArgs: any
|
|
1692
|
+
}
|
|
1693
|
+
export interface UpdateWebhookTemplateParamsNode {
|
|
1694
|
+
name?: string
|
|
1695
|
+
notificationEmail?: string
|
|
1696
|
+
destinationAttributes?: WebhookDestinationAttributes
|
|
1697
|
+
templateArgs: any
|
|
1698
|
+
}
|
|
1699
|
+
export declare class QuicknodeSdk {
|
|
1834
1700
|
/** Creates a new SDK instance from an explicit configuration. */
|
|
1835
1701
|
constructor(config: SdkFullConfig)
|
|
1836
1702
|
/** Returns the admin sub-client. */
|
|
@@ -1842,7 +1708,7 @@ export declare class QuickNodeSdk {
|
|
|
1842
1708
|
/** Returns the kvstore sub-client. */
|
|
1843
1709
|
get kvstore(): KvStoreApiClient
|
|
1844
1710
|
/** Creates a new SDK instance using configuration from environment variables. */
|
|
1845
|
-
static fromEnv():
|
|
1711
|
+
static fromEnv(): QuicknodeSdk
|
|
1846
1712
|
}
|
|
1847
1713
|
export declare class AdminApiClient {
|
|
1848
1714
|
/**
|
|
@@ -1949,7 +1815,7 @@ export declare class AdminApiClient {
|
|
|
1949
1815
|
deleteIp(id: string, ipId: string): Promise<DeleteBoolResponse>
|
|
1950
1816
|
/**
|
|
1951
1817
|
* Adds a domain mask to an endpoint — a custom domain used to hide the
|
|
1952
|
-
* endpoint's
|
|
1818
|
+
* endpoint's Quicknode URL so requests can be routed through your own
|
|
1953
1819
|
* domain.
|
|
1954
1820
|
*/
|
|
1955
1821
|
createDomainMask(id: string, params?: CreateDomainMaskRequest | undefined | null): Promise<void>
|
|
@@ -2034,7 +1900,7 @@ export declare class AdminApiClient {
|
|
|
2034
1900
|
*/
|
|
2035
1901
|
getAccountMetrics(params: GetAccountMetricsRequest): Promise<GetAccountMetricsResponse>
|
|
2036
1902
|
/**
|
|
2037
|
-
* Returns all chains supported by
|
|
1903
|
+
* Returns all chains supported by Quicknode along with their networks.
|
|
2038
1904
|
* Each entry includes the chain slug and its network slugs and names.
|
|
2039
1905
|
*/
|
|
2040
1906
|
listChains(): Promise<ListChainsResponse>
|
|
@@ -2250,7 +2116,7 @@ export declare class WebhooksApiClient {
|
|
|
2250
2116
|
* filters. An optional `notification_email` receives alerts if the
|
|
2251
2117
|
* webhook terminates.
|
|
2252
2118
|
*/
|
|
2253
|
-
createWebhookFromTemplate(params:
|
|
2119
|
+
createWebhookFromTemplate(params: CreateWebhookFromTemplateParamsNode): Promise<Webhook>
|
|
2254
2120
|
/**
|
|
2255
2121
|
* Updates an existing template-backed webhook, modifying its template
|
|
2256
2122
|
* arguments and optionally its name, notification email, and destination
|
|
@@ -2259,7 +2125,7 @@ export declare class WebhooksApiClient {
|
|
|
2259
2125
|
* generated automatically if not provided. Templates cover EVM chains,
|
|
2260
2126
|
* Solana, Bitcoin, XRPL, Hyperliquid, and Stellar.
|
|
2261
2127
|
*/
|
|
2262
|
-
updateWebhookTemplate(webhookId: string, params:
|
|
2128
|
+
updateWebhookTemplate(webhookId: string, params: UpdateWebhookTemplateParamsNode): Promise<Webhook>
|
|
2263
2129
|
}
|
|
2264
2130
|
export declare class KvStoreApiClient {
|
|
2265
2131
|
/** Creates a new set, storing a single string value under the given key. */
|
package/index.darwin-arm64.node
CHANGED
|
Binary file
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { StreamRegion, StreamDataset, StreamDestination, FilterLanguage, StreamMetadataLocation, ProductType, StreamStatus, WebhookTemplateId, WebhookStartFrom,
|
|
313
|
+
const { StreamRegion, StreamDataset, StreamDestination, FilterLanguage, StreamMetadataLocation, ProductType, StreamStatus, WebhookTemplateId, WebhookStartFrom, QuicknodeSdk, AdminApiClient, StreamsApiClient, WebhooksApiClient, KvStoreApiClient } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.StreamRegion = StreamRegion
|
|
316
316
|
module.exports.StreamDataset = StreamDataset
|
|
@@ -321,7 +321,7 @@ module.exports.ProductType = ProductType
|
|
|
321
321
|
module.exports.StreamStatus = StreamStatus
|
|
322
322
|
module.exports.WebhookTemplateId = WebhookTemplateId
|
|
323
323
|
module.exports.WebhookStartFrom = WebhookStartFrom
|
|
324
|
-
module.exports.
|
|
324
|
+
module.exports.QuicknodeSdk = QuicknodeSdk
|
|
325
325
|
module.exports.AdminApiClient = AdminApiClient
|
|
326
326
|
module.exports.StreamsApiClient = StreamsApiClient
|
|
327
327
|
module.exports.WebhooksApiClient = WebhooksApiClient
|
|
Binary file
|
|
Binary file
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quicknode/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0-alpha.15",
|
|
4
4
|
"description": "Quicknode SDK",
|
|
5
5
|
"main": "sdk.js",
|
|
6
6
|
"types": "sdk.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"sdk.mjs",
|
|
21
21
|
"errors.js",
|
|
22
22
|
"browser.js",
|
|
23
|
+
"README.md",
|
|
23
24
|
"*.node"
|
|
24
25
|
],
|
|
25
26
|
"napi": {
|
|
@@ -45,10 +46,10 @@
|
|
|
45
46
|
},
|
|
46
47
|
"license": "MIT",
|
|
47
48
|
"optionalDependencies": {
|
|
48
|
-
"@quicknode/sdk-linux-x64-gnu": "3.
|
|
49
|
-
"@quicknode/sdk-linux-arm64-gnu": "3.
|
|
50
|
-
"@quicknode/sdk-linux-x64-musl": "3.
|
|
51
|
-
"@quicknode/sdk-linux-arm64-musl": "3.
|
|
52
|
-
"@quicknode/sdk-darwin-arm64": "3.
|
|
49
|
+
"@quicknode/sdk-linux-x64-gnu": "3.1.0-alpha.15",
|
|
50
|
+
"@quicknode/sdk-linux-arm64-gnu": "3.1.0-alpha.15",
|
|
51
|
+
"@quicknode/sdk-linux-x64-musl": "3.1.0-alpha.15",
|
|
52
|
+
"@quicknode/sdk-linux-arm64-musl": "3.1.0-alpha.15",
|
|
53
|
+
"@quicknode/sdk-darwin-arm64": "3.1.0-alpha.15"
|
|
53
54
|
}
|
|
54
55
|
}
|
package/sdk.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
// sdk.d.ts
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
QuicknodeSdk as _QuicknodeSdk,
|
|
4
4
|
SdkFullConfig,
|
|
5
5
|
WebhookAttributes,
|
|
6
6
|
S3Attributes,
|
|
7
7
|
AzureAttributes,
|
|
8
8
|
PostgresAttributes,
|
|
9
|
-
MysqlAttributes,
|
|
10
|
-
MongoAttributes,
|
|
11
|
-
ClickhouseAttributes,
|
|
12
|
-
SnowflakeAttributes,
|
|
13
9
|
KafkaAttributes,
|
|
14
|
-
RedisAttributes,
|
|
15
10
|
WebhookTemplateId,
|
|
16
11
|
EvmWalletFilterTemplate,
|
|
17
12
|
EvmContractEventsTemplate,
|
|
@@ -32,12 +27,7 @@ export type StreamDestinationAttributesInput =
|
|
|
32
27
|
| { destination: "s3"; attributes: S3Attributes }
|
|
33
28
|
| { destination: "azure"; attributes: AzureAttributes }
|
|
34
29
|
| { destination: "postgres"; attributes: PostgresAttributes }
|
|
35
|
-
| { destination: "
|
|
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 };
|
|
30
|
+
| { destination: "kafka"; attributes: KafkaAttributes };
|
|
41
31
|
|
|
42
32
|
// Stream destination attributes (response). Mirrors the input shape so a
|
|
43
33
|
// response can be round-tripped back into an update call without renaming.
|
|
@@ -72,6 +62,36 @@ export type ListStreamsResponse = Omit<_ListStreamsResponseNode, "data"> & {
|
|
|
72
62
|
data: Stream[];
|
|
73
63
|
};
|
|
74
64
|
|
|
65
|
+
// Webhook template args (input). The inner key is `args` rather than the
|
|
66
|
+
// wire's `templateArgs` to avoid `templateArgs.templateArgs.wallets`; the
|
|
67
|
+
// Node binding renames it back before the request.
|
|
68
|
+
export type TemplateArgsInput =
|
|
69
|
+
| { templateId: "evmWalletFilter"; args: EvmWalletFilterTemplate }
|
|
70
|
+
| { templateId: "evmContractEvents"; args: EvmContractEventsTemplate }
|
|
71
|
+
| { templateId: "evmAbiFilter"; args: EvmAbiFilterTemplate }
|
|
72
|
+
| { templateId: "solanaWalletFilter"; args: SolanaWalletFilterTemplate }
|
|
73
|
+
| { templateId: "bitcoinWalletFilter"; args: BitcoinWalletFilterTemplate }
|
|
74
|
+
| { templateId: "xrplWalletFilter"; args: XrplWalletFilterTemplate }
|
|
75
|
+
| { templateId: "hyperliquidWalletEventsFilter"; args: HyperliquidWalletEventsFilterTemplate }
|
|
76
|
+
| {
|
|
77
|
+
templateId: "stellarWalletTransactionsSourceAccountFilter";
|
|
78
|
+
args: StellarWalletTransactionsFilterTemplate;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Replace the napi-generated JSON-blob templateArgs with typed unions.
|
|
82
|
+
type _CreateWebhookFromTemplateParamsNode = import("./index").CreateWebhookFromTemplateParamsNode;
|
|
83
|
+
type _UpdateWebhookTemplateParamsNode = import("./index").UpdateWebhookTemplateParamsNode;
|
|
84
|
+
|
|
85
|
+
export type CreateWebhookFromTemplateParams =
|
|
86
|
+
Omit<_CreateWebhookFromTemplateParamsNode, "templateArgs"> & {
|
|
87
|
+
templateArgs: TemplateArgsInput;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type UpdateWebhookTemplateParams =
|
|
91
|
+
Omit<_UpdateWebhookTemplateParamsNode, "templateArgs"> & {
|
|
92
|
+
templateArgs: TemplateArgsInput;
|
|
93
|
+
};
|
|
94
|
+
|
|
75
95
|
export type {
|
|
76
96
|
SdkFullConfig,
|
|
77
97
|
HttpConfig,
|
|
@@ -87,12 +107,7 @@ export type {
|
|
|
87
107
|
S3Attributes,
|
|
88
108
|
AzureAttributes,
|
|
89
109
|
PostgresAttributes,
|
|
90
|
-
MysqlAttributes,
|
|
91
|
-
MongoAttributes,
|
|
92
|
-
ClickhouseAttributes,
|
|
93
|
-
SnowflakeAttributes,
|
|
94
110
|
KafkaAttributes,
|
|
95
|
-
RedisAttributes,
|
|
96
111
|
AddressBookConfig,
|
|
97
112
|
StreamsApiClient,
|
|
98
113
|
// billing
|
|
@@ -236,11 +251,10 @@ export type {
|
|
|
236
251
|
UpdateWebhookParams,
|
|
237
252
|
Webhook,
|
|
238
253
|
ListWebhooksResponse,
|
|
254
|
+
WebhookPageInfo,
|
|
239
255
|
WebhookEnabledCountResponse,
|
|
240
256
|
WebhookDestinationAttributes,
|
|
241
257
|
ActivateWebhookParams,
|
|
242
|
-
CreateWebhookFromTemplateParams,
|
|
243
|
-
UpdateWebhookTemplateParams,
|
|
244
258
|
EvmWalletFilterTemplate,
|
|
245
259
|
EvmContractEventsTemplate,
|
|
246
260
|
EvmAbiFilterTemplate,
|
|
@@ -301,39 +315,60 @@ export interface StreamsApiClientTyped {
|
|
|
301
315
|
getEnabledCount(streamType?: string | undefined | null): Promise<import("./index").EnabledCountResponse>;
|
|
302
316
|
}
|
|
303
317
|
|
|
304
|
-
|
|
318
|
+
// Retypes napi's `any` templateArgs to the discriminated union. Keep method
|
|
319
|
+
// signatures in sync with the napi-generated WebhooksApiClient in ./index.d.ts.
|
|
320
|
+
export interface WebhooksApiClientTyped {
|
|
321
|
+
listWebhooks(params?: import("./index").GetWebhooksParams | undefined | null): Promise<import("./index").ListWebhooksResponse>;
|
|
322
|
+
deleteAllWebhooks(): Promise<void>;
|
|
323
|
+
getWebhook(id: string): Promise<import("./index").Webhook>;
|
|
324
|
+
updateWebhook(
|
|
325
|
+
id: string,
|
|
326
|
+
params: import("./index").UpdateWebhookParams
|
|
327
|
+
): Promise<import("./index").Webhook>;
|
|
328
|
+
deleteWebhook(id: string): Promise<void>;
|
|
329
|
+
pauseWebhook(id: string): Promise<void>;
|
|
330
|
+
activateWebhook(id: string, params: import("./index").ActivateWebhookParams): Promise<void>;
|
|
331
|
+
getEnabledCount(): Promise<import("./index").WebhookEnabledCountResponse>;
|
|
332
|
+
createWebhookFromTemplate(params: CreateWebhookFromTemplateParams): Promise<import("./index").Webhook>;
|
|
333
|
+
updateWebhookTemplate(
|
|
334
|
+
webhookId: string,
|
|
335
|
+
params: UpdateWebhookTemplateParams
|
|
336
|
+
): Promise<import("./index").Webhook>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export class QuicknodeSdk {
|
|
305
340
|
constructor(config: SdkFullConfig);
|
|
306
|
-
static fromEnv():
|
|
307
|
-
admin:
|
|
341
|
+
static fromEnv(): QuicknodeSdk;
|
|
342
|
+
admin: _QuicknodeSdk["admin"];
|
|
308
343
|
streams: StreamsApiClientTyped;
|
|
309
|
-
webhooks:
|
|
310
|
-
kvstore:
|
|
344
|
+
webhooks: WebhooksApiClientTyped;
|
|
345
|
+
kvstore: _QuicknodeSdk["kvstore"];
|
|
311
346
|
}
|
|
312
347
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
348
|
+
// Typed static factory methods producing each discriminated variant of
|
|
349
|
+
// TemplateArgsInput. Consumers can also construct the object literal directly.
|
|
350
|
+
export const TemplateArgs: {
|
|
351
|
+
evmWalletFilter(attrs: EvmWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "evmWalletFilter" }>;
|
|
352
|
+
evmContractEvents(attrs: EvmContractEventsTemplate): Extract<TemplateArgsInput, { templateId: "evmContractEvents" }>;
|
|
353
|
+
evmAbiFilter(attrs: EvmAbiFilterTemplate): Extract<TemplateArgsInput, { templateId: "evmAbiFilter" }>;
|
|
354
|
+
solanaWalletFilter(attrs: SolanaWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "solanaWalletFilter" }>;
|
|
355
|
+
bitcoinWalletFilter(attrs: BitcoinWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "bitcoinWalletFilter" }>;
|
|
356
|
+
xrplWalletFilter(attrs: XrplWalletFilterTemplate): Extract<TemplateArgsInput, { templateId: "xrplWalletFilter" }>;
|
|
357
|
+
hyperliquidWalletEventsFilter(attrs: HyperliquidWalletEventsFilterTemplate): Extract<TemplateArgsInput, { templateId: "hyperliquidWalletEventsFilter" }>;
|
|
358
|
+
stellarWalletTransactionsFilter(attrs: StellarWalletTransactionsFilterTemplate): Extract<TemplateArgsInput, { templateId: "stellarWalletTransactionsSourceAccountFilter" }>;
|
|
359
|
+
};
|
|
325
360
|
|
|
326
361
|
// Typed error hierarchy. Any SDK call can throw one of these; catch
|
|
327
|
-
//
|
|
328
|
-
export class
|
|
329
|
-
export class ConfigError extends
|
|
330
|
-
export class HttpError extends
|
|
362
|
+
// QuicknodeError to handle them all, or a specific subclass for finer control.
|
|
363
|
+
export class QuicknodeError extends Error {}
|
|
364
|
+
export class ConfigError extends QuicknodeError {}
|
|
365
|
+
export class HttpError extends QuicknodeError {}
|
|
331
366
|
export class TimeoutError extends HttpError {}
|
|
332
367
|
export class ConnectionError extends HttpError {}
|
|
333
|
-
export class ApiError extends
|
|
368
|
+
export class ApiError extends QuicknodeError {
|
|
334
369
|
status: number;
|
|
335
370
|
body: string;
|
|
336
371
|
}
|
|
337
|
-
export class DecodeError extends
|
|
372
|
+
export class DecodeError extends QuicknodeError {
|
|
338
373
|
body: string;
|
|
339
374
|
}
|