quicknode_sdk 0.6.0-aarch64-linux → 0.7.0-aarch64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2616f4fa4188dd16880a9320b248220ad593cc20ec969fee94c597d6419d808
4
- data.tar.gz: fdd2ecf9b82a870515feab735c2ad27e242c2adc42800ad9d584151efae02b8a
3
+ metadata.gz: 06e3a0f527e826702bfc52209cac02cefb8608f330b9ca4a5ecd3a27dbf8ca62
4
+ data.tar.gz: 0a658eb08f59aa60dbe0f9369fc46cd58b33404d760f0edd41f52a190a45d3ec
5
5
  SHA512:
6
- metadata.gz: db149fe5acb0957676f301abf8beef8d5f78f3f01c0a2bd321621710783fa96c8ff8b374b5894f95bc9aa13dd1b3a8e9e0258130682bfdddb2a68f23574c6541
7
- data.tar.gz: 64d34507518bb16dfc21930036080ae63afaf6d8bdcdfcd6b183a9f8a3bcfa3efe05262549a47530de41bc6d0ea7a3af41c470ce937c57e54517d501db0fd76d
6
+ metadata.gz: 81f32c2ec74049ed4da7d7355272f40d26f3b884ecb9b723abfa16808230afce375d4e850572c6607474ca9578d41fe1df05a968660defd9354b6341e7724707
7
+ data.tar.gz: ac1bc5eafc7bae1e5316b9a6deaf26960044af59c4a2ac9247c7a968ec669ff5c91f08259d82ed55229361f3f0eb68a2da49ddf7d5762fe1976dbbe7e39511ad
data/README.md CHANGED
@@ -1682,6 +1682,54 @@ schema = qn.sql.get_schema(cluster_id: "hyperliquid-core-mainnet")
1682
1682
  puts schema[:tables].length
1683
1683
  ```
1684
1684
 
1685
+ ---
1686
+
1687
+ ### RPC & Tooling Access
1688
+
1689
+ Tooling Access provisions a single multichain, read-only endpoint per account and
1690
+ mints short-lived session JWTs. `qn.rpc` makes JSON-RPC calls directly against that
1691
+ endpoint, minting and refreshing the JWT automatically — no endpoint URL or token to
1692
+ manage.
1693
+
1694
+ Tooling Access must be enabled once (admin role + eligible plan). The control-plane
1695
+ methods live on `qn.admin`:
1696
+
1697
+ ```ruby
1698
+ # Ruby
1699
+ status = qn.admin.tooling_access_status
1700
+ qn.admin.enable_tooling_access unless status["enabled"] # idempotent; admin role required
1701
+
1702
+ # Make on-chain calls. params defaults to []; pass an Array (positional) or Hash.
1703
+ block_number = qn.rpc.call(method: "eth_blockNumber")
1704
+ balance = qn.rpc.call(method: "eth_getBalance", params: ["0xabc...", "latest"])
1705
+
1706
+ # Multichain: select a network by its multichain_urls key. Seed the map first
1707
+ # (from admin.get_endpoint_urls), then pass network:.
1708
+ urls = qn.admin.get_endpoint_urls(id: endpoint_id)
1709
+ map = (urls.dig("data", "multichain_urls") || {}).transform_values { |v| v["http_url"] }
1710
+ qn.rpc.set_networks(networks: map)
1711
+ slot = qn.rpc.call(method: "getSlot", network: "solana-mainnet")
1712
+
1713
+ # Custom endpoint URL: send to a fully-formed HTTP URL, bypassing Tooling Access
1714
+ # and the JWT (no Authorization header). Per-call via endpoint_url:, or client-wide
1715
+ # via the rpc: { endpoint_url: ... } config key. endpoint_url and network are
1716
+ # mutually exclusive (a custom URL is not multichain-routed).
1717
+ block = qn.rpc.call(method: "eth_blockNumber", endpoint_url: "https://my-endpoint.example/rpc")
1718
+
1719
+ # A JSON-RPC error member is raised as QuicknodeSdk::RpcError (with #code, #message).
1720
+ begin
1721
+ qn.rpc.call(method: "eth_getBalance", params: ["bad"])
1722
+ rescue QuicknodeSdk::RpcError => e
1723
+ warn "#{e.code}: #{e.message}"
1724
+ end
1725
+ ```
1726
+
1727
+ Responses are wrapped in `QuicknodeSdk::IndifferentHash` — access with `[]`. A host that
1728
+ persists across processes can snapshot the cached token with `qn.rpc.current_token` and
1729
+ re-seed it via the `rpc: { seed: ... }` config key; `refresh_margin_secs` (default 60)
1730
+ tunes how early the token is refreshed. Set `rpc: { endpoint_url: ... }` to route every
1731
+ call to a custom HTTP URL by default (no JWT minted); a per-call `endpoint_url` overrides it.
1732
+
1685
1733
  ## Error Handling
1686
1734
 
1687
1735
  Every binding exposes a typed exception hierarchy derived from the core `SdkError`
@@ -1697,8 +1745,9 @@ subclass to branch on transport vs. API semantics.
1697
1745
  | `ConnectionError` | connection refused / DNS / TLS (subclass of `HttpError`) | — |
1698
1746
  | `ApiError` | non-2xx HTTP response | `status`, `body` |
1699
1747
  | `DecodeError` | 2xx response but JSON parse failed | `body` |
1748
+ | `RpcError` | JSON-RPC call returned an `error` member | `code`, `message` |
1700
1749
 
1701
- Class names: `QuicknodeSdk::Error`, `QuicknodeSdk::ConfigError`, `QuicknodeSdk::HttpError`, `QuicknodeSdk::TimeoutError`, `QuicknodeSdk::ConnectionError`, `QuicknodeSdk::ApiError`, `QuicknodeSdk::DecodeError`. All extend `StandardError`. Hash-key validation still raises `ArgumentError`.
1750
+ Class names: `QuicknodeSdk::Error`, `QuicknodeSdk::ConfigError`, `QuicknodeSdk::HttpError`, `QuicknodeSdk::TimeoutError`, `QuicknodeSdk::ConnectionError`, `QuicknodeSdk::ApiError`, `QuicknodeSdk::DecodeError`, `QuicknodeSdk::RpcError`. All extend `StandardError`. Hash-key validation still raises `ArgumentError`.
1702
1751
 
1703
1752
  ```ruby
1704
1753
  # Ruby
@@ -0,0 +1,4 @@
1
+ module QuicknodeSdk
2
+ class Rpc < NativeDelegator
3
+ end
4
+ end
Binary file
@@ -38,5 +38,9 @@ module QuicknodeSdk
38
38
  def sql
39
39
  Sql.new(@native.sql)
40
40
  end
41
+
42
+ def rpc
43
+ Rpc.new(@native.rpc)
44
+ end
41
45
  end
42
46
  end
data/lib/quicknode_sdk.rb CHANGED
@@ -14,4 +14,5 @@ require_relative "quicknode_sdk/clients/streams"
14
14
  require_relative "quicknode_sdk/clients/webhooks"
15
15
  require_relative "quicknode_sdk/clients/kvstore"
16
16
  require_relative "quicknode_sdk/clients/sql"
17
+ require_relative "quicknode_sdk/clients/rpc"
17
18
  require_relative "quicknode_sdk/sdk"
@@ -25,6 +25,11 @@ module QuicknodeSdk
25
25
  attr_reader body: String
26
26
  end
27
27
 
28
+ class RpcError < Error
29
+ attr_reader code: Integer
30
+ attr_reader message: String
31
+ end
32
+
28
33
  class SDK
29
34
  def self.from_env: () -> SDK
30
35
  def self.from_config: (Hash[Symbol | String, untyped] opts) -> SDK
@@ -34,6 +39,7 @@ module QuicknodeSdk
34
39
  def webhooks: () -> Webhooks
35
40
  def kvstore: () -> KvStore
36
41
  def sql: () -> Sql
42
+ def rpc: () -> Rpc
37
43
  end
38
44
 
39
45
  class DestinationAttributes
@@ -93,6 +99,10 @@ module QuicknodeSdk
93
99
  def list_chains: () -> untyped
94
100
  def account_info: () -> untyped
95
101
  def get_api_credits: (chain: String) -> untyped
102
+ def tooling_access_status: () -> untyped
103
+ def enable_tooling_access: () -> untyped
104
+ def disable_tooling_access: () -> untyped
105
+ def mint_tooling_token: () -> untyped
96
106
  def list_invoices: () -> untyped
97
107
  def list_payments: () -> untyped
98
108
  def list_teams: () -> untyped
@@ -168,4 +178,13 @@ module QuicknodeSdk
168
178
  def query: (query: String, cluster_id: String) -> untyped
169
179
  def get_schema: (cluster_id: String) -> untyped
170
180
  end
181
+
182
+ class Rpc
183
+ def initialize: (untyped native) -> void
184
+
185
+ def call: (method: String, ?params: untyped, ?network: String, ?endpoint_url: String) -> untyped
186
+ def set_networks: (networks: Hash[String, String]) -> void
187
+ def clear_cached_token: () -> void
188
+ def current_token: () -> untyped
189
+ end
171
190
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quicknode_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Quicknode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-07 00:00:00.000000000 Z
11
+ date: 2026-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -34,6 +34,7 @@ files:
34
34
  - lib/quicknode_sdk.rb
35
35
  - lib/quicknode_sdk/clients/admin.rb
36
36
  - lib/quicknode_sdk/clients/kvstore.rb
37
+ - lib/quicknode_sdk/clients/rpc.rb
37
38
  - lib/quicknode_sdk/clients/sql.rb
38
39
  - lib/quicknode_sdk/clients/streams.rb
39
40
  - lib/quicknode_sdk/clients/webhooks.rb