@quicknode/sdk 3.8.2 → 3.10.0
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 +231 -32
- package/index.d.ts +1085 -28
- package/index.darwin-arm64.node +0 -0
- package/index.js +52 -52
- 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 +6 -6
- package/sdk.d.ts +92 -0
package/README.md
CHANGED
|
@@ -42,6 +42,12 @@ This is one of four language bindings published from the same Rust core. See the
|
|
|
42
42
|
- [Billing](#billing)
|
|
43
43
|
- [Bulk Operations](#bulk-operations)
|
|
44
44
|
- [Account Tags](#account-tags)
|
|
45
|
+
- [Additional security operations](#additional-security-operations)
|
|
46
|
+
- [Mutation responses](#mutation-responses)
|
|
47
|
+
- [Usage and metrics summaries](#usage-and-metrics-summaries)
|
|
48
|
+
- [Activity logs](#activity-logs)
|
|
49
|
+
- [Transactions](#transactions)
|
|
50
|
+
- [Admin compatibility notes](#admin-compatibility-notes)
|
|
45
51
|
- [Streams Client](#streams-client)
|
|
46
52
|
- [Datasets, Regions, and Destinations](#datasets-regions-and-destinations)
|
|
47
53
|
- [Streams methods](#streams-methods)
|
|
@@ -171,9 +177,9 @@ Accessed as `qn.admin`. Manages endpoints, tags, teams, billing, usage, metrics,
|
|
|
171
177
|
|
|
172
178
|
##### `get_endpoints` / `getEndpoints`
|
|
173
179
|
|
|
174
|
-
Returns a paginated list of endpoints on the account with optional search, filters (networks, statuses, labels, tags, dedicated, flat-rate), sorting, and pagination.
|
|
180
|
+
Returns a paginated list of endpoints on the account with optional search, filters (networks, statuses, labels, tags, dedicated, flat-rate), sorting, and pagination. The API caps `limit` at 100. Nonempty `tagIds` and `tagLabels` filters are mutually exclusive.
|
|
175
181
|
|
|
176
|
-
**Parameters** (all optional): `limit` (i32), `offset` (i32), `search` (string), `sort_by` (string), `sort_direction` (`"asc"` | `"desc"`), `networks` (string[]), `statuses` (string[]), `labels` (string[]), `dedicated` (bool), `is_flat_rate` (bool), `
|
|
182
|
+
**Parameters** (all optional): `limit` (i32), `offset` (i32), `search` (string), `sort_by` (string), `sort_direction` (`"asc"` | `"desc"`), `networks` (string[]), `statuses` (string[]), `labels` (string[]), `dedicated` (bool), `is_flat_rate` (bool), `tagIds` (i32[]), `tagLabels` (string[]).
|
|
177
183
|
|
|
178
184
|
**Returns**: `GetEndpointsResponse` — `{ data: Endpoint[], pagination?: Pagination }`.
|
|
179
185
|
|
|
@@ -190,7 +196,7 @@ const resp = await qn.admin.getEndpoints({
|
|
|
190
196
|
|
|
191
197
|
Creates a new endpoint for the given blockchain and network.
|
|
192
198
|
|
|
193
|
-
**Parameters**: `chain`
|
|
199
|
+
**Parameters**: `chain` and `network` are strings required by the API. The SDK retains its existing optional arguments for compatibility; supply both for a valid request.
|
|
194
200
|
|
|
195
201
|
**Returns**: `CreateEndpointResponse` with `data: SingleEndpoint`.
|
|
196
202
|
|
|
@@ -216,7 +222,7 @@ const resp = await qn.admin.showEndpoint("ep-123");
|
|
|
216
222
|
|
|
217
223
|
Updates editable fields on an endpoint. Currently supports `label`.
|
|
218
224
|
|
|
219
|
-
**Parameters**: `id` (string, required);
|
|
225
|
+
**Parameters**: `id` (string, required); `label` (string, required by the API). The SDK retains the optional label argument; omitting it produces an API error.
|
|
220
226
|
|
|
221
227
|
**Returns**: nothing.
|
|
222
228
|
|
|
@@ -259,7 +265,7 @@ Per-endpoint tag add/remove. For account-wide tag management see [Account Tags](
|
|
|
259
265
|
|
|
260
266
|
Tags an endpoint with the given label. Creates the tag on the account if it does not exist.
|
|
261
267
|
|
|
262
|
-
**Parameters**: `id` (string, required);
|
|
268
|
+
**Parameters**: `id` (string, required); `label` (string, required by the API). Labels must be nonblank and contain 3 through 25 characters after trimming. The SDK retains its optional argument and does not trim values.
|
|
263
269
|
|
|
264
270
|
**Returns**: nothing.
|
|
265
271
|
|
|
@@ -298,7 +304,7 @@ const resp = await qn.admin.listTeams();
|
|
|
298
304
|
|
|
299
305
|
##### `create_team` / `createTeam`
|
|
300
306
|
|
|
301
|
-
Creates a new team.
|
|
307
|
+
Creates a new team. The name must contain at least four characters.
|
|
302
308
|
|
|
303
309
|
**Parameters**: `name` (string, required).
|
|
304
310
|
|
|
@@ -365,7 +371,7 @@ await qn.admin.updateTeamEndpoints(42, { endpointIds: ["ep-123", "ep-456"] });
|
|
|
365
371
|
|
|
366
372
|
Invites a user to a team. Existing users only need `email`; new users require `full_name` and `role`.
|
|
367
373
|
|
|
368
|
-
**Parameters**: `id` (i64, required); body: `email` (string, required), `full_name` (string, optional), `role` (string, optional
|
|
374
|
+
**Parameters**: `id` (i64, required); body: `email` (string, required), `full_name` (string, optional), `role` (string, optional). Standard roles and account custom-role keys are accepted.
|
|
369
375
|
|
|
370
376
|
**Returns**: `InviteTeamMemberResponse`.
|
|
371
377
|
|
|
@@ -402,7 +408,9 @@ await qn.admin.resendTeamInvite(42, 7);
|
|
|
402
408
|
|
|
403
409
|
#### Usage
|
|
404
410
|
|
|
405
|
-
|
|
411
|
+
Endpoint, chain, and tag usage rows include integer `rpcCredits`, `dataCredits`, and `bytes`. Shared method rows, including methods nested under endpoints, include integer `bytes`. Existing nullable method metadata and null tag IDs for untagged usage remain nullable.
|
|
412
|
+
|
|
413
|
+
All usage methods accept optional `start_time` and `end_time` Unix timestamps. Omit both to use the current billing-period default.
|
|
406
414
|
|
|
407
415
|
##### `get_usage` / `getUsage`
|
|
408
416
|
|
|
@@ -463,9 +471,9 @@ const resp = await qn.admin.getUsageByTag();
|
|
|
463
471
|
|
|
464
472
|
##### `get_endpoint_logs` / `getEndpointLogs`
|
|
465
473
|
|
|
466
|
-
Fetches a page of request logs for an endpoint. Set `include_details=true` for full request/response payloads (truncated at 2 KB each).
|
|
474
|
+
Fetches a page of request logs for an endpoint. Use ISO 8601 timestamps for explicit bounds. The limit is 1 through 100 and defaults to 20. Set `include_details=true` for full request/response payloads (truncated at 2 KB each).
|
|
467
475
|
|
|
468
|
-
**Parameters**: `id` (endpoint id, required);
|
|
476
|
+
**Parameters**: `id` (endpoint id, required); query: `from` (string timestamp, required), `to` (string timestamp, required), `include_details` (bool, optional), `limit` (i32, optional), `next_at` (string cursor, optional).
|
|
469
477
|
|
|
470
478
|
**Returns**: `GetEndpointLogsResponse` — `{ data: EndpointLog[], next_at?: string }`.
|
|
471
479
|
|
|
@@ -495,7 +503,7 @@ const resp = await qn.admin.getLogDetails("ep-123", "req-abc");
|
|
|
495
503
|
|
|
496
504
|
##### `get_endpoint_security` / `getEndpointSecurity`
|
|
497
505
|
|
|
498
|
-
Returns the full security configuration for an endpoint: tokens, JWTs, referrers, domain masks, IPs, request filters, and their per-feature toggles.
|
|
506
|
+
Returns the full security configuration for an endpoint: tokens, JWTs, referrers, domain masks, IPs, blocked IPs (`blockedIps`), request filters, and their per-feature toggles. Snapshot options include `hsts`, `cors`, and `responseLogging` (wire key `responseLogging`). Structured filter matchers and `params` are preserved.
|
|
499
507
|
|
|
500
508
|
**Parameters**: `id` (string, required).
|
|
501
509
|
|
|
@@ -525,14 +533,14 @@ const resp = await qn.admin.getSecurityOptions("ep-123");
|
|
|
525
533
|
|
|
526
534
|
Enables or disables individual security features. Each field accepts `"enabled"` or `"disabled"`.
|
|
527
535
|
|
|
528
|
-
**Parameters**: `id` (string, required); `options`: `SecurityOptionsUpdate` (`tokens`, `referrers`, `jwts`, `ips`, `domain_masks`, `hsts`, `cors`, `request_filters`, `ip_custom_header`).
|
|
536
|
+
**Parameters**: `id` (string, required); `options`: `SecurityOptionsUpdate` (`tokens`, `referrers`, `jwts`, `ips`, `domain_masks`, `hsts`, `cors`, `request_filters`, `ip_custom_header`, `responseLogging`). The `responseLogging` option is sent as `responseLogging` and accepts `"enabled"` or `"disabled"`.
|
|
529
537
|
|
|
530
538
|
**Returns**: `UpdateSecurityOptionsResponse` with updated `SecurityOption[]`.
|
|
531
539
|
|
|
532
540
|
```typescript
|
|
533
541
|
// Node.js
|
|
534
542
|
await qn.admin.updateSecurityOptions("ep-123", {
|
|
535
|
-
options: { tokens: "enabled", jwts: "disabled" },
|
|
543
|
+
options: { tokens: "enabled", jwts: "disabled", responseLogging: "enabled" },
|
|
536
544
|
});
|
|
537
545
|
```
|
|
538
546
|
|
|
@@ -626,7 +634,7 @@ await qn.admin.deleteIp("ep-123", "ip-1");
|
|
|
626
634
|
|
|
627
635
|
Adds a custom domain mask to an endpoint.
|
|
628
636
|
|
|
629
|
-
**Parameters**: `id` (endpoint id, required); body: `domain_mask` (string,
|
|
637
|
+
**Parameters**: `id` (endpoint id, required); body: `domain_mask` (string, required by the API). The SDK retains its optional argument, but supplies no default value.
|
|
630
638
|
|
|
631
639
|
**Returns**: nothing.
|
|
632
640
|
|
|
@@ -641,7 +649,7 @@ Removes a domain mask.
|
|
|
641
649
|
|
|
642
650
|
**Parameters**: `id` (endpoint id, required), `domain_mask_id` (string, required).
|
|
643
651
|
|
|
644
|
-
**Returns**:
|
|
652
|
+
**Returns**: `DeleteBoolResponse`.
|
|
645
653
|
|
|
646
654
|
```typescript
|
|
647
655
|
// Node.js
|
|
@@ -701,7 +709,7 @@ const resp = await qn.admin.createRequestFilter("ep-123", {
|
|
|
701
709
|
|
|
702
710
|
**Parameters**: `id` (endpoint id, required), `request_filter_id` (string, required); body: `method` (string[], optional). Ruby's Hash keys are `request_filter_id` and `methods` (plural).
|
|
703
711
|
|
|
704
|
-
**Returns**: nothing.
|
|
712
|
+
**Returns**: nothing. Supply a method list for an update; an empty request produces an API error.
|
|
705
713
|
|
|
706
714
|
```typescript
|
|
707
715
|
// Node.js
|
|
@@ -719,6 +727,23 @@ await qn.admin.updateRequestFilter("ep-123", "f-1", { method: ["eth_call"] });
|
|
|
719
727
|
await qn.admin.deleteRequestFilter("ep-123", "f-1");
|
|
720
728
|
```
|
|
721
729
|
|
|
730
|
+
##### Structured patterns and filter listing
|
|
731
|
+
|
|
732
|
+
`getRequestFilters` returns list records with `id`, `pattern`, and `methodWhitelist`. This differs from endpoint/security snapshots, where each filter has `id`, a `method` matcher array, and `params`. Snapshot `params` holds every top-level pattern key except `method`, not only a nested `params` matcher.
|
|
733
|
+
|
|
734
|
+
Use `createRequestFilterPattern` and `updateRequestFilterPattern` for a custom JSON object. The existing whitelist methods keep their current inputs, including Ruby's `methods:` keyword. Do not combine a whitelist and a custom pattern in one request or use an update to switch filter kinds. One whitelist and multiple custom filters can coexist. Updates and deletions continue to accept successful empty HTTP 204 responses.
|
|
735
|
+
|
|
736
|
+
Nested objects, arrays, nulls, and keys such as `anything-but` remain intact. Pass a native object rather than a JSON string. Creation returns `data.id` and, when supplied by the API, `data.pattern`.
|
|
737
|
+
|
|
738
|
+
```typescript
|
|
739
|
+
const pattern = { method: [{ prefix: "eth_" }], jsonrpc: ["2.0"] };
|
|
740
|
+
const created = await qn.admin.createRequestFilterPattern("123", { pattern });
|
|
741
|
+
if (created.data) {
|
|
742
|
+
await qn.admin.updateRequestFilterPattern("123", created.data.id, { pattern });
|
|
743
|
+
}
|
|
744
|
+
const filters = await qn.admin.getRequestFilters("123");
|
|
745
|
+
```
|
|
746
|
+
|
|
722
747
|
#### Multichain
|
|
723
748
|
|
|
724
749
|
##### `enable_multichain` / `enableMultichain`
|
|
@@ -792,9 +817,9 @@ const resp = await qn.admin.getMethodRateLimits("ep-123");
|
|
|
792
817
|
|
|
793
818
|
##### `create_method_rate_limit` / `createMethodRateLimit`
|
|
794
819
|
|
|
795
|
-
Creates a new method-level rate limiter.
|
|
820
|
+
Creates a new method-level rate limiter. `rate` must be positive; zero produces an API error. Optional `limitByIp` applies the limit per client IP and is returned on `MethodRateLimiter`.
|
|
796
821
|
|
|
797
|
-
**Parameters**: `id` (endpoint id, required); body: `interval` (string, e.g. `"second"`), `methods` (string[]), `rate` (i32).
|
|
822
|
+
**Parameters**: `id` (endpoint id, required); body: `interval` (string, e.g. `"second"`), `methods` (string[]), `rate` (i32), `limitByIp` (bool, optional).
|
|
798
823
|
|
|
799
824
|
**Returns**: `CreateMethodRateLimitResponse` with `data: MethodRateLimiter`.
|
|
800
825
|
|
|
@@ -804,20 +829,21 @@ const resp = await qn.admin.createMethodRateLimit("ep-123", {
|
|
|
804
829
|
interval: "second",
|
|
805
830
|
methods: ["eth_call"],
|
|
806
831
|
rate: 10,
|
|
832
|
+
limitByIp: true,
|
|
807
833
|
});
|
|
808
834
|
```
|
|
809
835
|
|
|
810
836
|
##### `update_method_rate_limit` / `updateMethodRateLimit`
|
|
811
837
|
|
|
812
|
-
Updates an existing rate limiter. Only provided fields change.
|
|
838
|
+
Updates an existing rate limiter. Only provided fields change. Supply at least one supported field; an empty PATCH produces an API error. `limitByIp=false` is an explicit update, not an omitted value.
|
|
813
839
|
|
|
814
|
-
**Parameters**: `id` (endpoint id, required), `method_rate_limit_id` (string, required); body: `methods` (string[], optional), `status` (`"enabled"` | `"disabled"`, optional), `rate` (i32, optional).
|
|
840
|
+
**Parameters**: `id` (endpoint id, required), `method_rate_limit_id` (string, required); body: `methods` (string[], optional), `status` (`"enabled"` | `"disabled"`, optional), `rate` (i32, optional), `limitByIp` (bool, optional).
|
|
815
841
|
|
|
816
842
|
**Returns**: `UpdateMethodRateLimitResponse`.
|
|
817
843
|
|
|
818
844
|
```typescript
|
|
819
845
|
// Node.js
|
|
820
|
-
await qn.admin.updateMethodRateLimit("ep-123", "rl-1", { rate: 50 });
|
|
846
|
+
await qn.admin.updateMethodRateLimit("ep-123", "rl-1", { rate: 50, limitByIp: false });
|
|
821
847
|
```
|
|
822
848
|
|
|
823
849
|
##### `delete_method_rate_limit` / `deleteMethodRateLimit`
|
|
@@ -837,15 +863,16 @@ await qn.admin.deleteMethodRateLimit("ep-123", "rl-1");
|
|
|
837
863
|
|
|
838
864
|
##### `update_rate_limits` / `updateRateLimits`
|
|
839
865
|
|
|
840
|
-
Partial update of the endpoint-level RPS / RPM / RPD caps. Only
|
|
866
|
+
Partial update of the endpoint-level RPS / RPM / RPD caps. Only supplied fields change. Values are capped by the account's plan tier. Sends `PATCH`. Set `limit_by_ip` (`limitByIp` in Node) to `true` to apply the caps per client IP or `false` to apply them to the whole endpoint. You can update this flag without sending caps. Supply at least one cap or the flag; an empty update returns an API error. Both update methods accept these options.
|
|
841
867
|
|
|
842
|
-
**Parameters**: `id` (endpoint id, required); `
|
|
868
|
+
**Parameters**: `id` (endpoint id, required); `rateLimits`: optional `RateLimitSettings` (`rps`, `rpm`, `rpd`, all optional); `limitByIp`: optional boolean.
|
|
843
869
|
|
|
844
870
|
**Returns**: nothing.
|
|
845
871
|
|
|
846
872
|
```typescript
|
|
847
873
|
// Node.js
|
|
848
|
-
await qn.admin.updateRateLimits("ep-123", { rateLimits: { rps: 100, rpm: 5000 } });
|
|
874
|
+
await qn.admin.updateRateLimits("ep-123", { rateLimits: { rps: 100, rpm: 5000 }, limitByIp: true });
|
|
875
|
+
await qn.admin.updateRateLimits("ep-123", { limitByIp: false });
|
|
849
876
|
```
|
|
850
877
|
|
|
851
878
|
##### `get_rate_limits` / `getRateLimits`
|
|
@@ -902,9 +929,9 @@ if (resp.data.multichainUrls) {
|
|
|
902
929
|
|
|
903
930
|
##### `get_endpoint_metrics` / `getEndpointMetrics`
|
|
904
931
|
|
|
905
|
-
Returns metric series for an endpoint over a time period.
|
|
932
|
+
Returns metric series for an endpoint over a time period. Optional integer `percentile` ranges from 1 through 100 and is required for `response_time_over_time` and `method_response_time_max`. For example, use `95`. Metric and period strings remain open.
|
|
906
933
|
|
|
907
|
-
**Parameters**: `id` (endpoint id, required);
|
|
934
|
+
**Parameters**: `id` (endpoint id, required); query: `period` (`"hour"` | `"day"` | `"week"` | `"month"`), `metric` (e.g. `"method_calls_over_time"`, `"response_status_breakdown"`), `percentile` (integer, optional).
|
|
908
935
|
|
|
909
936
|
**Returns**: `GetEndpointMetricsResponse` with `data: EndpointMetric[]`. Each `EndpointMetric` has a `tag: string[]` and a `data: [timestamp, value][]`. Single-axis series (e.g. `response_time_over_time` with a percentile) come back as a one-element tag like `["p95"]`; multi-axis series come back as `["network", "arbitrum-mainnet"]`.
|
|
910
937
|
|
|
@@ -912,13 +939,14 @@ Returns metric series for an endpoint over a time period.
|
|
|
912
939
|
// Node.js
|
|
913
940
|
const resp = await qn.admin.getEndpointMetrics("ep-123", {
|
|
914
941
|
period: "day",
|
|
915
|
-
metric: "
|
|
942
|
+
metric: "response_time_over_time",
|
|
943
|
+
percentile: 95,
|
|
916
944
|
});
|
|
917
945
|
```
|
|
918
946
|
|
|
919
947
|
##### `get_account_metrics` / `getAccountMetrics`
|
|
920
948
|
|
|
921
|
-
Returns account-level metric series.
|
|
949
|
+
Returns account-level metric series. The existing optional `percentile` argument remains for compatibility; the API currently ignores it. Endpoint latency percentile support belongs to `get_endpoint_metrics`.
|
|
922
950
|
|
|
923
951
|
**Parameters**: `period` (required), `metric` (required), `percentile` (string, optional).
|
|
924
952
|
|
|
@@ -1005,6 +1033,8 @@ const resp = await qn.admin.listPayments();
|
|
|
1005
1033
|
|
|
1006
1034
|
#### Bulk Operations
|
|
1007
1035
|
|
|
1036
|
+
Each result can include an `error` string. Check individual results: HTTP 200 can contain both successes and failures. Successful rows can omit `error`.
|
|
1037
|
+
|
|
1008
1038
|
##### `bulk_update_endpoint_status` / `bulkUpdateEndpointStatus`
|
|
1009
1039
|
|
|
1010
1040
|
Activates or pauses many endpoints at once.
|
|
@@ -1064,7 +1094,7 @@ const resp = await qn.admin.listTags();
|
|
|
1064
1094
|
|
|
1065
1095
|
##### `rename_tag` / `renameTag`
|
|
1066
1096
|
|
|
1067
|
-
Renames an account-level tag.
|
|
1097
|
+
Renames an account-level tag. Labels must be nonblank and contain 3 through 25 characters after trimming. The SDK does not trim values.
|
|
1068
1098
|
|
|
1069
1099
|
**Parameters**: `tag_id` (i32, required); body: `label` (string, required).
|
|
1070
1100
|
|
|
@@ -1088,6 +1118,160 @@ Deletes a tag from the account. The tag must first be removed from any endpoints
|
|
|
1088
1118
|
await qn.admin.deleteAccountTag(42);
|
|
1089
1119
|
```
|
|
1090
1120
|
|
|
1121
|
+
#### Additional security operations
|
|
1122
|
+
|
|
1123
|
+
All methods below take the numeric endpoint `id` as a string. Reads do not enable a security feature.
|
|
1124
|
+
|
|
1125
|
+
| Method | Additional input | Returned `data` |
|
|
1126
|
+
| --- | --- | --- |
|
|
1127
|
+
| `getClientCerts` | None | `enabled`, `certs` |
|
|
1128
|
+
| `createClientCert` | `certificate`, a PEM string | Full certificate state |
|
|
1129
|
+
| `updateClientCerts` | `enabled`, a boolean | Full certificate state |
|
|
1130
|
+
| `deleteClientCert` | `fingerprint` | Full state after deletion |
|
|
1131
|
+
| `getMethodBlacklist` | None | `methods` |
|
|
1132
|
+
| `updateMethodBlacklist` | `methods`, a string array | Replaced method list |
|
|
1133
|
+
| `getRangeLimits` | None | `limits`, `supportedMethods` |
|
|
1134
|
+
| `updateRangeLimits` | `limits`, a method-to-integer map | Replaced limits and supported methods |
|
|
1135
|
+
| `getBlockedIps` | None | Array of string `id` and `ip` records |
|
|
1136
|
+
| `createBlockedIp` | `ip`, an address or CIDR string | Created string `id` and `ip` |
|
|
1137
|
+
| `deleteBlockedIp` | `ipId` | Boolean confirmation |
|
|
1138
|
+
|
|
1139
|
+
Certificate records contain `fingerprint`, `subject`, `issuer`, and `expiresAt`. Deleting the last certificate returns disabled state with an empty list; DELETE still has a response body. Invalid, expired, duplicate, or unknown certificates can return HTTP 422.
|
|
1140
|
+
|
|
1141
|
+
Blacklist and range-limit updates replace the complete configuration. An empty array clears the blacklist; an empty object clears range limits. Range limits must be positive integers. Read `supportedMethods` for the endpoint's supported methods instead of assuming one global list. Blocked-IP calls do not toggle IP security; visibility can depend on the endpoint's IP security setting.
|
|
1142
|
+
|
|
1143
|
+
```typescript
|
|
1144
|
+
const certificates = await qn.admin.getClientCerts("123");
|
|
1145
|
+
const ranges = await qn.admin.getRangeLimits("123");
|
|
1146
|
+
const blocked = await qn.admin.getBlockedIps("123");
|
|
1147
|
+
const blacklist = await qn.admin.updateMethodBlacklist("123", { methods: ["eth_sendRawTransaction"] });
|
|
1148
|
+
```
|
|
1149
|
+
|
|
1150
|
+
#### Mutation responses
|
|
1151
|
+
|
|
1152
|
+
Existing mutation methods keep their original return values. Use these response-returning variants when you need the created record or effective limits. Each takes the same arguments as its existing counterpart.
|
|
1153
|
+
|
|
1154
|
+
| Method | Returned `data` |
|
|
1155
|
+
| --- | --- |
|
|
1156
|
+
| `createTokenWithResponse` | Token `id` and `token` |
|
|
1157
|
+
| `createReferrerWithResponse` | Referrer `id` and `url` |
|
|
1158
|
+
| `createIpWithResponse` | IP record `id` and `ip` |
|
|
1159
|
+
| `createDomainMaskWithResponse` | Record `id` and `domainMask` |
|
|
1160
|
+
| `createJwtWithResponse` | JWT `id`, `publicKey`, `kid`, and `name` |
|
|
1161
|
+
| `createTagWithResponse` | `tags` containing association `id`, `tagId`, `accountId`, `endpointId`, label, and timestamps |
|
|
1162
|
+
| `updateRateLimitsWithResponse` | `limits` with nullable `rps`, `rpm`, and `rpd` |
|
|
1163
|
+
|
|
1164
|
+
Creation and snapshot fields differ: a created referrer uses `url`, while endpoint snapshots use `referrer`; a created domain mask uses `domainMask`, while snapshots use `domain`. Tag association `id` differs from `tagId`; these IDs are numeric. Rust Debug output redacts token and JWT credential values. Store returned credentials securely and do not log them.
|
|
1165
|
+
|
|
1166
|
+
```typescript
|
|
1167
|
+
const created = await qn.admin.createReferrerWithResponse("123", { referrer: "https://example.com" });
|
|
1168
|
+
console.log(created.data.id);
|
|
1169
|
+
```
|
|
1170
|
+
|
|
1171
|
+
#### Usage and metrics summaries
|
|
1172
|
+
|
|
1173
|
+
These methods return a resolved time window, typed totals, optional grouped rows, and an optional continuation cursor.
|
|
1174
|
+
|
|
1175
|
+
| Method | Grouping | Additional filters |
|
|
1176
|
+
| --- | --- | --- |
|
|
1177
|
+
| `getUsageCreditsSummary` | None | None |
|
|
1178
|
+
| `getUsageRpcSummary` | `method`, `endpoint`, `chain`, `network` | `endpointNames`, `chains`, `networks`, `methods`, `tagIds`, `addonIds` |
|
|
1179
|
+
| `getUsageStreamsSummary` | `stream` | `streamId` |
|
|
1180
|
+
| `getUsageWebhooksSummary` | `webhook` | `webhookId` |
|
|
1181
|
+
| `getTrafficSummary` | `method`, `endpoint` | Same filters as the RPC summary |
|
|
1182
|
+
| `getErrorsSummary` | `code`, `endpoint`, `network`, `method` | `endpoints`, `networks`, `methods`, `codes`, `statusCodes`, `kind` |
|
|
1183
|
+
| `getEndpointErrorsSummary` | `code`, `network`, `method` | Required endpoint `id`; error-summary filters except `endpoints` |
|
|
1184
|
+
|
|
1185
|
+
| Summary | Totals fields |
|
|
1186
|
+
| --- | --- |
|
|
1187
|
+
| Credits | `credits` |
|
|
1188
|
+
| RPC | `requests`, `bytes`, `rpcCredits`, `dataCredits`, `credits` |
|
|
1189
|
+
| Streams | `blocks`, `bytes`, `blockCredits` |
|
|
1190
|
+
| Webhooks | `deliveries`, `credits` |
|
|
1191
|
+
| Traffic | `successfulRequests`, `bytes`, `requestCredits`, `bytesCredits`, `credits`, `activeMethods` |
|
|
1192
|
+
| Account and endpoint errors | `rpcErrors`, `httpErrors` |
|
|
1193
|
+
|
|
1194
|
+
Error breakdown rows contain `kind` and `count`, plus the selected grouping dimensions. Other breakdown rows carry their summary metrics and selected dimensions.
|
|
1195
|
+
|
|
1196
|
+
For the first page, supply `last` as a positive integer duration ending now (`s`, `m`, `h`, or `d`), or both `from` and `to` as ISO 8601 timestamps with timezones. Bare dates are not summary timestamps. Use `groupBy` for grouping. Credits summaries have no grouping parameter. The limit is 1 through 1000 and defaults to 100.
|
|
1197
|
+
|
|
1198
|
+
Pass native arrays for groups and array filters. The SDK encodes repeated bracketed query keys such as `group_by[]=method&group_by[]=endpoint`. Error codes and HTTP status-code filters remain strings. `endpointNames` contains endpoint subdomains; RPC, traffic, and account-error result `endpoint` values are integer endpoint IDs. Account-error `endpoints` filters accept integer arrays, such as `[123, 456]`. `tagIds` and `addonIds` contain numeric IDs represented as strings. Endpoint error-summary `id` uses the numeric endpoint ID represented as a string.
|
|
1199
|
+
|
|
1200
|
+
For error summaries, `kind` is `rpc` or `http`. Method filtering/grouping requires `rpc`; RPC kind rejects `statusCodes`, and HTTP kind rejects `codes`. Feature access and retention can produce API errors, including HTTP 403.
|
|
1201
|
+
|
|
1202
|
+
Continue with `cursor` alone. A cursor belongs to the original route, account, and query; any repeated parameters, including `limit`, must match. Keep the returned window values: the server can align summary windows to billing boundaries. Totals cover the full window on every page, not only the current rows. The SDK does not round windows or paginate automatically.
|
|
1203
|
+
|
|
1204
|
+
Summary metrics use floating-point numbers, including count-like fields, and can contain fractions such as `7.5`. They do not promise arbitrary decimal precision. Legacy usage fields remain integers. RPC breakdown `requests` and traffic breakdown `successfulRequests` can be null even though totals are non-null. A missing `breakdown` is not an empty grouped result.
|
|
1205
|
+
|
|
1206
|
+
Endpoint grouping values are `number` or `null`. An omitted grouping dimension is absent from the object; an explicit null remains `null`. Use `Object.hasOwn` or the `in` operator when presence matters. An omitted breakdown remains absent.
|
|
1207
|
+
|
|
1208
|
+
```typescript
|
|
1209
|
+
const page = await qn.admin.getUsageRpcSummary({
|
|
1210
|
+
last: "1h", groupBy: ["method", "endpoint"], limit: 20,
|
|
1211
|
+
});
|
|
1212
|
+
console.log(page.data.totals.credits);
|
|
1213
|
+
if (page.data.nextCursor) {
|
|
1214
|
+
const nextPage = await qn.admin.getUsageRpcSummary({ cursor: page.data.nextCursor });
|
|
1215
|
+
}
|
|
1216
|
+
```
|
|
1217
|
+
|
|
1218
|
+
#### Activity logs
|
|
1219
|
+
|
|
1220
|
+
Lists account changes, newest first. `listActivityLogFilters` returns the actor IDs and target types accepted by `listActivityLogs`; `getActivityLog` returns one entry by UUID.
|
|
1221
|
+
|
|
1222
|
+
List filters are `q`, `actor`, `endpointId`, `targetType`, `from`, `to`, `limit`, and `offset`. `endpointId` is a numeric endpoint ID represented as a string. `targetType` is sent as `type`. The limit is 0 through 100 and defaults to 20. Offset pagination returns `total`, `limit`, and `offset`; pin `to` when exporting because new entries shift offsets. Bare dates are accepted: `from` starts at midnight UTC, and `to` includes the entire day.
|
|
1223
|
+
|
|
1224
|
+
Responses keep actor and target metadata typed. Actor IDs, names, and emails can be null, including for deleted users. Feature access can return HTTP 403; a missing detail entry returns HTTP 404.
|
|
1225
|
+
|
|
1226
|
+
```typescript
|
|
1227
|
+
const filters = await qn.admin.listActivityLogFilters();
|
|
1228
|
+
const activity = await qn.admin.listActivityLogs({ limit: 20 });
|
|
1229
|
+
if (activity.data.length > 0) {
|
|
1230
|
+
const detail = await qn.admin.getActivityLog(activity.data[0].id);
|
|
1231
|
+
}
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
#### Transactions
|
|
1235
|
+
|
|
1236
|
+
`listTransactions` returns retained transactions and an optional continuation cursor. A first page needs `last` (for example, `1h`), or both `from` and `to` as ISO 8601 timestamps with timezones. A cursor alone continues the same resolved window.
|
|
1237
|
+
|
|
1238
|
+
Optional filters are `network`, `method`, `state`, `transactionHash`, and `endpoints`. States are `submitted`, `succeeded`, and `failed`. Endpoint filters accept integer endpoint IDs, such as `[123, 456]`, and use repeated `endpoints[]` query keys. The limit is 1 through 1000 and defaults to 100.
|
|
1239
|
+
|
|
1240
|
+
`getTransaction` takes a network, a transaction hash, and optional `includePayloads`. It returns an outer `data` containing `exists` and a second `data` value. An absent or expired transaction can return `exists: false`; Node exposes the optional detail as `undefined` when the API returns null or omits it. Payloads default to excluded; set `includePayloads` to true to request retained request and response text. The SDK preserves that text without parsing it. Feature access can return HTTP 403.
|
|
1241
|
+
|
|
1242
|
+
Transaction `endpointIds` arrays contain integer endpoint IDs or null elements. Node exposes an absent or null detail array as `undefined`; null entries inside a returned array remain null. Each attempt has a required integer `endpointId`. Block heights remain decimal strings, including values such as `9007199254740993`. Other detail metadata can be absent or null. Attempts retain the order returned by the API.
|
|
1243
|
+
|
|
1244
|
+
```typescript
|
|
1245
|
+
const page = await qn.admin.listTransactions({ last: "1h", endpoints: [123, 456], limit: 20 });
|
|
1246
|
+
const transaction = page.data.transactions[0];
|
|
1247
|
+
if (transaction) {
|
|
1248
|
+
const result = await qn.admin.getTransaction(
|
|
1249
|
+
transaction.network, transaction.transactionHash, { includePayloads: false },
|
|
1250
|
+
);
|
|
1251
|
+
if (result.data.exists && result.data.data) {
|
|
1252
|
+
console.log(result.data.data.height); // string, never a rounded Number
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
if (page.data.nextCursor) {
|
|
1256
|
+
const nextPage = await qn.admin.listTransactions({ cursor: page.data.nextCursor });
|
|
1257
|
+
}
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
#### Admin compatibility notes
|
|
1261
|
+
|
|
1262
|
+
Summary endpoint dimensions and transaction endpoint IDs use `number` values. Account-error and transaction `endpoints` filters accept `number[]`. Transaction `endpointIds` arrays can contain `null`; attempt `endpointId` is required. Update callers that used UUID strings.
|
|
1263
|
+
|
|
1264
|
+
Existing methods retain their return values and optional argument requiredness. Required API inputs are documented above; omitted or invalid values still produce API errors. Use the response-returning methods when you need created records.
|
|
1265
|
+
|
|
1266
|
+
Rust callers must update affected full struct literals for the added fields, even when those fields are optional. This includes security snapshots/options, filter responses, usage rows, bulk results, method-rate-limit requests/responses, and endpoint metric requests. Request structs with `Default` can use `..Default::default()` for omitted fields; builders avoid full-literal updates where available.
|
|
1267
|
+
|
|
1268
|
+
`EndpointRequestFilter.method` changed from `Vec<String>` to `Vec<serde_json::Value>` so it can preserve structured matchers. Convert strings with `.into()` or `serde_json::json!`, and use `as_str()` when reading a string matcher. Match object values as JSON rather than assuming every matcher is a string. Snapshot `params` and custom `pattern` are object maps containing JSON values.
|
|
1269
|
+
|
|
1270
|
+
Python endpoint/security response wrappers keep their public class names, getters, and setters. Filter values are native lists and dictionaries; assign through the setter after editing a returned value. Node uses `unknown[]` for matcher arrays and `Record<string, unknown>` for open pattern objects. Narrow a matcher with `typeof matcher === "string"` before using string methods. Ruby continues to return `IndifferentHash` values. JSON object keys are preserved without recursive case conversion.
|
|
1271
|
+
|
|
1272
|
+
New summary, activity, and transaction window fields use `from_time` and `to_time` in Rust/Python. Node fields and serialized response keys remain `from` and `to`; Python/Ruby client arguments use `from_time` and `to_time`. Existing endpoint-log arguments do not change.
|
|
1273
|
+
|
|
1274
|
+
|
|
1091
1275
|
---
|
|
1092
1276
|
|
|
1093
1277
|
### Streams Client
|
|
@@ -1655,7 +1839,21 @@ await qn.kvstore.deleteList("my-list");
|
|
|
1655
1839
|
|
|
1656
1840
|
### SQL Client
|
|
1657
1841
|
|
|
1658
|
-
Accessed as `qn.sql`.
|
|
1842
|
+
Accessed as `qn.sql`. Lists the available clusters, runs SQL queries against indexed blockchain data, and fetches the database schema. Backed by `https://api.quicknode.com/sql/rest/v1/`.
|
|
1843
|
+
|
|
1844
|
+
##### `list_clusters` / `listClusters`
|
|
1845
|
+
|
|
1846
|
+
Lists the clusters available to query. Pass a cluster's `id` as the `cluster_id` / `clusterId` for `query` and `getSchema`.
|
|
1847
|
+
|
|
1848
|
+
**Parameters**: none.
|
|
1849
|
+
|
|
1850
|
+
**Returns**: an array of `SqlCluster`, each with `id` and `display_name` / `displayName`.
|
|
1851
|
+
|
|
1852
|
+
```typescript
|
|
1853
|
+
// Node.js
|
|
1854
|
+
const clusters = await qn.sql.listClusters();
|
|
1855
|
+
console.log(clusters.map((c) => c.id));
|
|
1856
|
+
```
|
|
1659
1857
|
|
|
1660
1858
|
##### `query`
|
|
1661
1859
|
|
|
@@ -1697,8 +1895,9 @@ mints short-lived session JWTs. `qn.rpc` makes JSON-RPC calls directly against t
|
|
|
1697
1895
|
endpoint, minting and refreshing the JWT automatically — no endpoint URL or token to
|
|
1698
1896
|
manage.
|
|
1699
1897
|
|
|
1700
|
-
Tooling Access must be enabled once (admin role + eligible plan).
|
|
1701
|
-
|
|
1898
|
+
Tooling Access must be enabled once (admin role + eligible plan). Status reads can
|
|
1899
|
+
return HTTP 403 when feature access is unavailable; successful authentication alone
|
|
1900
|
+
does not guarantee access. The control-plane methods live on `qn.admin`:
|
|
1702
1901
|
|
|
1703
1902
|
```typescript
|
|
1704
1903
|
// Node.js
|