quicknode_sdk 0.5.0-x86_64-linux → 0.7.0-x86_64-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 +4 -4
- data/README.md +79 -1
- data/lib/quicknode_sdk/clients/rpc.rb +4 -0
- data/lib/quicknode_sdk/quicknode_sdk.so +0 -0
- data/lib/quicknode_sdk/sdk.rb +4 -0
- data/lib/quicknode_sdk.rb +1 -0
- data/sig/quicknode_sdk.rbs +21 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6016bd900bf6ea25d15a8a28c8ce88db001c333c6705e2cd4c4c5709eaa58871
|
|
4
|
+
data.tar.gz: a357ce106ce20c23950a6956e76ac13fd3a2bad9f09ac73ec2827866df825ad9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8936fcbcf8769cd461527d6b2606c2dc3557d0f13683b6778e004428bac5963ecafe1d9babd4fed87413b965b1178e7e9f828965d1853b39e0051b155aec1f4
|
|
7
|
+
data.tar.gz: 7fc3e7e441b0e1aaf633da16d793cef481a3a20653a273436748919a8ec48bb698575cf9239efc2d8ef7e2e78c06a21da9c140cb4cc743b6195e3ecb02a0c586
|
data/README.md
CHANGED
|
@@ -34,6 +34,7 @@ This is one of four language bindings published from the same Rust core. See the
|
|
|
34
34
|
- [Endpoint URLs](#endpoint-urls)
|
|
35
35
|
- [Metrics](#metrics)
|
|
36
36
|
- [Chains](#chains)
|
|
37
|
+
- [Account](#account)
|
|
37
38
|
- [Billing](#billing)
|
|
38
39
|
- [Bulk Operations](#bulk-operations)
|
|
39
40
|
- [Account Tags](#account-tags)
|
|
@@ -928,6 +929,34 @@ Lists the blockchains supported by Quicknode along with their networks.
|
|
|
928
929
|
resp = qn.admin.list_chains
|
|
929
930
|
```
|
|
930
931
|
|
|
932
|
+
#### Account
|
|
933
|
+
|
|
934
|
+
##### `account_info` / `accountInfo`
|
|
935
|
+
|
|
936
|
+
Returns details about the account, including its id, name, creation timestamp, billing version, and current subscription.
|
|
937
|
+
|
|
938
|
+
**Parameters**: none.
|
|
939
|
+
|
|
940
|
+
**Returns**: `AccountInfoResponse` with `data: AccountInfo` (including a nested `subscription: AccountSubscription`).
|
|
941
|
+
|
|
942
|
+
```ruby
|
|
943
|
+
# Ruby
|
|
944
|
+
resp = qn.admin.account_info
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
##### `get_api_credits` / `getApiCredits`
|
|
948
|
+
|
|
949
|
+
Returns the per-method API credit costs for a chain, identified by its slug (the same slugs returned by `list_chains`, e.g. `ethereum`). An unknown chain slug raises `ApiError` (status 404).
|
|
950
|
+
|
|
951
|
+
**Parameters**: `chain` (string, required) — the chain slug.
|
|
952
|
+
|
|
953
|
+
**Returns**: `GetApiCreditsResponse` with `data: [ApiCredit]`, where each `ApiCredit` has `method` and `credits`.
|
|
954
|
+
|
|
955
|
+
```ruby
|
|
956
|
+
# Ruby
|
|
957
|
+
resp = qn.admin.get_api_credits(chain: "ethereum")
|
|
958
|
+
```
|
|
959
|
+
|
|
931
960
|
#### Billing
|
|
932
961
|
|
|
933
962
|
##### `list_invoices` / `listInvoices`
|
|
@@ -1653,6 +1682,54 @@ schema = qn.sql.get_schema(cluster_id: "hyperliquid-core-mainnet")
|
|
|
1653
1682
|
puts schema[:tables].length
|
|
1654
1683
|
```
|
|
1655
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
|
+
|
|
1656
1733
|
## Error Handling
|
|
1657
1734
|
|
|
1658
1735
|
Every binding exposes a typed exception hierarchy derived from the core `SdkError`
|
|
@@ -1668,8 +1745,9 @@ subclass to branch on transport vs. API semantics.
|
|
|
1668
1745
|
| `ConnectionError` | connection refused / DNS / TLS (subclass of `HttpError`) | — |
|
|
1669
1746
|
| `ApiError` | non-2xx HTTP response | `status`, `body` |
|
|
1670
1747
|
| `DecodeError` | 2xx response but JSON parse failed | `body` |
|
|
1748
|
+
| `RpcError` | JSON-RPC call returned an `error` member | `code`, `message` |
|
|
1671
1749
|
|
|
1672
|
-
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`.
|
|
1673
1751
|
|
|
1674
1752
|
```ruby
|
|
1675
1753
|
# Ruby
|
|
Binary file
|
data/lib/quicknode_sdk/sdk.rb
CHANGED
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"
|
data/sig/quicknode_sdk.rbs
CHANGED
|
@@ -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
|
|
@@ -91,6 +97,12 @@ module QuicknodeSdk
|
|
|
91
97
|
def get_endpoint_metrics: (id: String, period: String, metric: String) -> untyped
|
|
92
98
|
def get_account_metrics: (period: String, metric: String, ?percentile: String) -> untyped
|
|
93
99
|
def list_chains: () -> untyped
|
|
100
|
+
def account_info: () -> untyped
|
|
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
|
|
94
106
|
def list_invoices: () -> untyped
|
|
95
107
|
def list_payments: () -> untyped
|
|
96
108
|
def list_teams: () -> untyped
|
|
@@ -166,4 +178,13 @@ module QuicknodeSdk
|
|
|
166
178
|
def query: (query: String, cluster_id: String) -> untyped
|
|
167
179
|
def get_schema: (cluster_id: String) -> untyped
|
|
168
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
|
|
169
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.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Quicknode
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
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
|