@quicknode/sdk 3.6.0 → 3.7.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 CHANGED
@@ -1674,6 +1674,59 @@ const schema = await qn.sql.getSchema("hyperliquid-core-mainnet");
1674
1674
  console.log(schema.tables.length);
1675
1675
  ```
1676
1676
 
1677
+ ---
1678
+
1679
+ ### RPC & Tooling Access
1680
+
1681
+ Tooling Access provisions a single multichain, read-only endpoint per account and
1682
+ mints short-lived session JWTs. `qn.rpc` makes JSON-RPC calls directly against that
1683
+ endpoint, minting and refreshing the JWT automatically — no endpoint URL or token to
1684
+ manage.
1685
+
1686
+ Tooling Access must be enabled once (admin role + eligible plan). The control-plane
1687
+ methods live on `qn.admin`:
1688
+
1689
+ ```typescript
1690
+ // Node.js
1691
+ const status = await qn.admin.toolingAccessStatus();
1692
+ if (!status.enabled) {
1693
+ await qn.admin.enableToolingAccess(); // idempotent; admin role required
1694
+ }
1695
+
1696
+ // Make on-chain calls. params defaults to []; pass an array (positional) or object.
1697
+ const blockNumber = await qn.rpc.call("eth_blockNumber");
1698
+ const balance = await qn.rpc.call("eth_getBalance", ["0xabc...", "latest"]);
1699
+
1700
+ // Multichain: select a network by its multichain_urls key. Seed the map first
1701
+ // (from admin.getEndpointUrls), then pass the network as the 3rd arg.
1702
+ const urls = await qn.admin.getEndpointUrls(endpointId);
1703
+ const map = Object.fromEntries(
1704
+ Object.entries(urls.multichainUrls ?? {}).map(([k, v]) => [k, v.httpUrl]),
1705
+ );
1706
+ qn.rpc.setNetworks(map);
1707
+ const slot = await qn.rpc.call("getSlot", [], "solana-mainnet");
1708
+
1709
+ // Custom endpoint URL: send to a fully-formed HTTP URL, bypassing Tooling Access
1710
+ // and the JWT (no Authorization header). Per-call via the 4th arg, or client-wide
1711
+ // via `new RpcConfig({ endpointUrl })`. endpointUrl and network are mutually
1712
+ // exclusive (a custom URL is not multichain-routed).
1713
+ const block = await qn.rpc.call("eth_blockNumber", [], undefined, "https://my-endpoint.example/rpc");
1714
+
1715
+ // A JSON-RPC error member is thrown as RpcError (with .code and .message).
1716
+ import { RpcError } from "@quicknode/sdk";
1717
+ try {
1718
+ await qn.rpc.call("eth_getBalance", ["bad"]);
1719
+ } catch (e) {
1720
+ if (e instanceof RpcError) console.error(e.code, e.message);
1721
+ }
1722
+ ```
1723
+
1724
+ A host that persists across processes can snapshot the cached token with
1725
+ `qn.rpc.currentToken()` and re-seed it via `RpcConfig.seed` on the next construction;
1726
+ `refreshMarginSecs` (default 60) tunes how early the token is refreshed. Set
1727
+ `RpcConfig.endpointUrl` to route every call to a custom HTTP URL by default (no
1728
+ JWT minted); a per-call `endpointUrl` overrides it.
1729
+
1677
1730
  ## Error Handling
1678
1731
 
1679
1732
  Every binding exposes a typed exception hierarchy derived from the core `SdkError`
@@ -1689,8 +1742,9 @@ subclass to branch on transport vs. API semantics.
1689
1742
  | `ConnectionError` | connection refused / DNS / TLS (subclass of `HttpError`) | — |
1690
1743
  | `ApiError` | non-2xx HTTP response | `status`, `body` |
1691
1744
  | `DecodeError` | 2xx response but JSON parse failed | `body` |
1745
+ | `RpcError` | JSON-RPC call returned an `error` member | `code`, `message` |
1692
1746
 
1693
- Class names: Importable from `@quicknode/sdk`: `QuicknodeError`, `ConfigError`, `HttpError`, `TimeoutError`, `ConnectionError`, `ApiError`, `DecodeError`. All extend `Error`.
1747
+ Class names: Importable from `@quicknode/sdk`: `QuicknodeError`, `ConfigError`, `HttpError`, `TimeoutError`, `ConnectionError`, `ApiError`, `DecodeError`, `RpcError`. All extend `Error`.
1694
1748
 
1695
1749
  ```typescript
1696
1750
  // Node.js
package/errors.js CHANGED
@@ -54,7 +54,15 @@ class DecodeError extends QuicknodeError {
54
54
  }
55
55
  }
56
56
 
57
- const TAG_RE = /^\[(Config|Http|Timeout|Connect|Api|Decode)\|([^|]+)\|([^\]]+)\](.*)$/s;
57
+ class RpcError extends QuicknodeError {
58
+ constructor(message, code) {
59
+ super(message);
60
+ this.name = "RpcError";
61
+ this.code = code;
62
+ }
63
+ }
64
+
65
+ const TAG_RE = /^\[(Config|Http|Timeout|Connect|Api|Decode|Rpc)\|([^|]+)\|([^\]]+)\](.*)$/s;
58
66
 
59
67
  function fromNapiError(err) {
60
68
  if (!(err instanceof Error)) return err;
@@ -82,6 +90,8 @@ function fromNapiError(err) {
82
90
  case "Http": return new HttpError(msg);
83
91
  case "Api": return new ApiError(msg, Number(statusStr), body);
84
92
  case "Decode": return new DecodeError(msg, body);
93
+ // For Rpc, statusStr is the JSON-RPC code and body is its message.
94
+ case "Rpc": return new RpcError(body || msg, Number(statusStr));
85
95
  default: return err;
86
96
  }
87
97
  }
@@ -116,6 +126,7 @@ module.exports = {
116
126
  ConnectionError,
117
127
  ApiError,
118
128
  DecodeError,
129
+ RpcError,
119
130
  fromNapiError,
120
131
  wrapClient,
121
132
  };
package/index.d.ts CHANGED
@@ -221,6 +221,23 @@ export interface BulkUpdateEndpointStatusResponse {
221
221
  error?: string
222
222
  }
223
223
 
224
+ /**
225
+ * A minted session JWT plus the endpoint it authenticates against and its
226
+ * wall-clock expiry. This is the unit cached by the RPC client and the unit a
227
+ * host persists between processes (e.g. the CLI's on-disk token cache).
228
+ *
229
+ * `exp_unix` is the JWT `exp` claim (unix seconds), used directly so it
230
+ * survives a process restart (unlike a monotonic `Instant`).
231
+ */
232
+ export interface CachedToken {
233
+ /** The provisioned tooling-access endpoint URL the JWT authenticates against. */
234
+ endpointUrl: string
235
+ /** The minted ES256 session JWT, presented as a Bearer token. */
236
+ token: string
237
+ /** JWT `exp` claim in unix seconds. */
238
+ expUnix: number
239
+ }
240
+
224
241
  /** A blockchain supported by Quicknode along with its networks. */
225
242
  export interface Chain {
226
243
  /** Chain slug (e.g. `ethereum`). */
@@ -1465,6 +1482,38 @@ export interface ResendTeamInviteResponse {
1465
1482
  error?: string
1466
1483
  }
1467
1484
 
1485
+ export interface RpcConfig {
1486
+ /**
1487
+ * Custom HTTP URL to send JSON-RPC calls to, bypassing the Tooling Access
1488
+ * endpoint. When set, every `rpc.call` on this client goes straight to this
1489
+ * URL with NO session token minted or attached — the URL is treated as a
1490
+ * self-authenticating endpoint (e.g. a provisioned `.quiknode.pro` URL that
1491
+ * already embeds its token, or a self-hosted node). A per-call
1492
+ * `endpoint_url` overrides this default. Unset means tooling-JWT mode.
1493
+ */
1494
+ endpointUrl?: string
1495
+ /**
1496
+ * Optional pre-existing token to seed the in-memory cache (e.g. loaded
1497
+ * from a host's on-disk cache). Advisory: a malformed or expired seed is
1498
+ * treated as a cache miss and a fresh token is minted.
1499
+ */
1500
+ seed?: CachedToken
1501
+ /**
1502
+ * Seconds before `exp` at which the client proactively refreshes. The
1503
+ * margin also absorbs clock skew between client and endpoint. Defaults to
1504
+ * 60 when unset.
1505
+ */
1506
+ refreshMarginSecs?: number
1507
+ /**
1508
+ * Per-network URL map for multichain routing: network key (e.g.
1509
+ * `"solana-mainnet"`, `"polygon"`) -> full http_url. Built from
1510
+ * `admin.get_endpoint_urls(...).multichain_urls`. When set, `rpc.call` with
1511
+ * a `network` resolves the target URL here. Optional; the default-network
1512
+ * call path needs no map.
1513
+ */
1514
+ networks?: Record<string, string>
1515
+ }
1516
+
1468
1517
  /** Configuration for delivering stream batches to an S3-compatible object store. */
1469
1518
  export interface S3Attributes {
1470
1519
  /** S3 service endpoint (e.g. `s3.amazonaws.com`). */
@@ -1497,6 +1546,7 @@ export interface SdkFullConfig {
1497
1546
  webhooks?: WebhooksConfig
1498
1547
  kvstore?: KvStoreConfig
1499
1548
  sql?: SqlConfig
1549
+ rpc?: RpcConfig
1500
1550
  }
1501
1551
 
1502
1552
  /** A single security feature's name, status, and optional value. */
@@ -1778,6 +1828,23 @@ export interface TestFilterResponse {
1778
1828
  logs: Array<string>
1779
1829
  }
1780
1830
 
1831
+ /**
1832
+ * Current Tooling Access status for the account. `enabled` is the source of
1833
+ * truth — a previously-provisioned-but-disabled account may still report a
1834
+ * non-null `endpoint_url`.
1835
+ */
1836
+ export interface ToolingAccessStatus {
1837
+ enabled: boolean
1838
+ endpointUrl?: string
1839
+ enabledAt?: string
1840
+ /**
1841
+ * The provisioned endpoint's id. Used to fetch the per-network URL map
1842
+ * (`get_endpoint_urls`) for multichain routing. `None` on control planes
1843
+ * that don't yet return it.
1844
+ */
1845
+ endpointId?: string
1846
+ }
1847
+
1781
1848
  /** Parameters for `update_endpoint`. */
1782
1849
  export interface UpdateEndpointRequest {
1783
1850
  /** New human-readable label. */
@@ -2265,6 +2332,24 @@ export declare class AdminApiClient {
2265
2332
  * chain slug rejects with `ApiError` (status 404).
2266
2333
  */
2267
2334
  getApiCredits(chain: string): Promise<GetApiCreditsResponse>
2335
+ /**
2336
+ * Returns the current Tooling Access status for the account. Inspect
2337
+ * `enabled` to decide whether to enable provisioning.
2338
+ */
2339
+ toolingAccessStatus(): Promise<ToolingAccessStatus>
2340
+ /**
2341
+ * Enables (provisions) Tooling Access. Idempotent. Requires an admin role
2342
+ * and an eligible plan.
2343
+ */
2344
+ enableToolingAccess(): Promise<ToolingAccessStatus>
2345
+ /** Disables Tooling Access, pausing the endpoint. Idempotent. */
2346
+ disableToolingAccess(): Promise<ToolingAccessStatus>
2347
+ /**
2348
+ * Mints a short-lived session JWT for the provisioned Tooling Access
2349
+ * endpoint. Returns the endpoint URL, the JWT, and its expiry. Requires
2350
+ * Tooling Access to be enabled first.
2351
+ */
2352
+ mintToolingToken(): Promise<CachedToken>
2268
2353
  /**
2269
2354
  * Returns the account's invoices, including id, status, billing reason,
2270
2355
  * amounts due and paid, line items with descriptions and billing periods,
@@ -2424,10 +2509,48 @@ export declare class QuicknodeSdk {
2424
2509
  get kvstore(): KvStoreApiClient
2425
2510
  /** Returns the sql sub-client. */
2426
2511
  get sql(): SqlApiClient
2512
+ /** Returns the JSON-RPC sub-client. */
2513
+ get rpc(): RpcApiClient
2427
2514
  /** Creates a new SDK instance using configuration from environment variables. */
2428
2515
  static fromEnv(): QuicknodeSdk
2429
2516
  }
2430
2517
 
2518
+ export declare class RpcApiClient {
2519
+ /**
2520
+ * Makes a JSON-RPC call against the account's Tooling Access endpoint,
2521
+ * authenticated with a short-lived session JWT (minted and refreshed
2522
+ * automatically). `params` accepts an array (positional) or object
2523
+ * (by-name) and defaults to `[]`. `network` selects a chain on the
2524
+ * multichain endpoint (a key in the seeded network map, e.g.
2525
+ * `"solana-mainnet"`); omit for the endpoint's default network.
2526
+ *
2527
+ * `endpointUrl` sends this call to a custom HTTP URL instead, bypassing the
2528
+ * Tooling Access endpoint and the session JWT (no Authorization header is
2529
+ * attached). It overrides the client-wide `RpcConfig.endpointUrl` default.
2530
+ * Passing both `endpointUrl` and `network` throws (they are mutually
2531
+ * exclusive). Returns the JSON-RPC `result`; a JSON-RPC error is thrown as
2532
+ * `RpcError`.
2533
+ */
2534
+ call(method: string, params?: any | undefined | null, network?: string | undefined | null, endpointUrl?: string | undefined | null): Promise<any>
2535
+ /**
2536
+ * Seeds the per-network URL map for multichain routing (network key ->
2537
+ * full http_url), typically built from
2538
+ * `admin.getEndpointUrls(...).multichainUrls`.
2539
+ */
2540
+ setNetworks(networks: Record<string, string>): void
2541
+ /**
2542
+ * Discards the in-memory cached token, forcing the next call to mint a
2543
+ * fresh one. Use when the cached token is known stale beyond expiry.
2544
+ */
2545
+ clearCachedToken(): void
2546
+ /**
2547
+ * Returns a snapshot of the currently cached session token, or `null` if
2548
+ * no token has been minted or seeded yet. Hosts use this to persist the
2549
+ * token between processes.
2550
+ */
2551
+ currentToken(): CachedToken | null
2552
+ }
2553
+
2431
2554
  export declare class SqlApiClient {
2432
2555
  /** Executes a SQL query against the given cluster and returns the result set. */
2433
2556
  query(query: string, clusterId: string): Promise<QueryResponseNode>
Binary file
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@quicknode/sdk-android-arm64')
79
79
  const bindingPackageVersion = require('@quicknode/sdk-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@quicknode/sdk-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@quicknode/sdk-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@quicknode/sdk-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@quicknode/sdk-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@quicknode/sdk-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@quicknode/sdk-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@quicknode/sdk-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@quicknode/sdk-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@quicknode/sdk-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@quicknode/sdk-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@quicknode/sdk-darwin-universal')
184
184
  const bindingPackageVersion = require('@quicknode/sdk-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@quicknode/sdk-darwin-x64')
200
200
  const bindingPackageVersion = require('@quicknode/sdk-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@quicknode/sdk-darwin-arm64')
216
216
  const bindingPackageVersion = require('@quicknode/sdk-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@quicknode/sdk-freebsd-x64')
236
236
  const bindingPackageVersion = require('@quicknode/sdk-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@quicknode/sdk-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@quicknode/sdk-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@quicknode/sdk-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@quicknode/sdk-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@quicknode/sdk-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@quicknode/sdk-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@quicknode/sdk-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@quicknode/sdk-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@quicknode/sdk-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@quicknode/sdk-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@quicknode/sdk-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@quicknode/sdk-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@quicknode/sdk-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@quicknode/sdk-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@quicknode/sdk-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@quicknode/sdk-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@quicknode/sdk-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@quicknode/sdk-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@quicknode/sdk-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@quicknode/sdk-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@quicknode/sdk-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@quicknode/sdk-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@quicknode/sdk-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@quicknode/sdk-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@quicknode/sdk-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@quicknode/sdk-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@quicknode/sdk-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@quicknode/sdk-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@quicknode/sdk-openharmony-x64')
494
494
  const bindingPackageVersion = require('@quicknode/sdk-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@quicknode/sdk-openharmony-arm')
510
510
  const bindingPackageVersion = require('@quicknode/sdk-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '3.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 3.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '3.7.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 3.7.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -588,6 +588,7 @@ module.exports.WebhookTemplateId = nativeBinding.WebhookTemplateId
588
588
  module.exports.AdminApiClient = nativeBinding.AdminApiClient
589
589
  module.exports.KvStoreApiClient = nativeBinding.KvStoreApiClient
590
590
  module.exports.QuicknodeSdk = nativeBinding.QuicknodeSdk
591
+ module.exports.RpcApiClient = nativeBinding.RpcApiClient
591
592
  module.exports.SqlApiClient = nativeBinding.SqlApiClient
592
593
  module.exports.StreamsApiClient = nativeBinding.StreamsApiClient
593
594
  module.exports.WebhooksApiClient = nativeBinding.WebhooksApiClient
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicknode/sdk",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Quicknode SDK",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "license": "MIT",
56
56
  "optionalDependencies": {
57
- "@quicknode/sdk-linux-x64-gnu": "3.6.0",
58
- "@quicknode/sdk-linux-arm64-gnu": "3.6.0",
59
- "@quicknode/sdk-linux-x64-musl": "3.6.0",
60
- "@quicknode/sdk-linux-arm64-musl": "3.6.0",
61
- "@quicknode/sdk-darwin-arm64": "3.6.0"
57
+ "@quicknode/sdk-linux-x64-gnu": "3.7.0",
58
+ "@quicknode/sdk-linux-arm64-gnu": "3.7.0",
59
+ "@quicknode/sdk-linux-x64-musl": "3.7.0",
60
+ "@quicknode/sdk-linux-arm64-musl": "3.7.0",
61
+ "@quicknode/sdk-darwin-arm64": "3.7.0"
62
62
  }
63
63
  }
package/sdk.d.ts CHANGED
@@ -326,6 +326,11 @@ export type {
326
326
  ChainSchemaNode,
327
327
  TableSchemaNode,
328
328
  ColumnSchemaNode,
329
+ // rpc / tooling access
330
+ RpcConfig,
331
+ CachedToken,
332
+ ToolingAccessStatus,
333
+ RpcApiClient,
329
334
  } from "./index";
330
335
 
331
336
  // const enums must use `export` (not `export type`) so they are usable as values
@@ -400,6 +405,7 @@ export class QuicknodeSdk {
400
405
  webhooks: WebhooksApiClientTyped;
401
406
  kvstore: _QuicknodeSdk["kvstore"];
402
407
  sql: SqlApiClientTyped;
408
+ rpc: _QuicknodeSdk["rpc"];
403
409
  }
404
410
 
405
411
  // Typed static factory methods producing each discriminated variant of
@@ -450,3 +456,6 @@ export class ApiError extends QuicknodeError {
450
456
  export class DecodeError extends QuicknodeError {
451
457
  body: string;
452
458
  }
459
+ export class RpcError extends QuicknodeError {
460
+ code: number;
461
+ }
package/sdk.js CHANGED
@@ -16,6 +16,7 @@ class QuicknodeSdk {
16
16
  this.webhooks = errors.wrapClient(this._inner.webhooks);
17
17
  this.kvstore = errors.wrapClient(this._inner.kvstore);
18
18
  this.sql = errors.wrapClient(this._inner.sql);
19
+ this.rpc = errors.wrapClient(this._inner.rpc);
19
20
  }
20
21
 
21
22
  static fromEnv() {
@@ -30,6 +31,7 @@ class QuicknodeSdk {
30
31
  instance.webhooks = errors.wrapClient(instance._inner.webhooks);
31
32
  instance.kvstore = errors.wrapClient(instance._inner.kvstore);
32
33
  instance.sql = errors.wrapClient(instance._inner.sql);
34
+ instance.rpc = errors.wrapClient(instance._inner.rpc);
33
35
  return instance;
34
36
  }
35
37
  }
@@ -87,4 +89,5 @@ module.exports = {
87
89
  ConnectionError: errors.ConnectionError,
88
90
  ApiError: errors.ApiError,
89
91
  DecodeError: errors.DecodeError,
92
+ RpcError: errors.RpcError,
90
93
  };
package/sdk.mjs CHANGED
@@ -25,6 +25,7 @@ export const {
25
25
  WebhooksApiClient,
26
26
  KvStoreApiClient,
27
27
  SqlApiClient,
28
+ RpcApiClient,
28
29
  QuicknodeError,
29
30
  ConfigError,
30
31
  HttpError,
@@ -32,4 +33,5 @@ export const {
32
33
  ConnectionError,
33
34
  ApiError,
34
35
  DecodeError,
36
+ RpcError,
35
37
  } = cjs;