quicknode_sdk 0.4.0 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b85847f1d533f89fbc37e749f0830aad04ac633f1a80aad5d9cd488e452f67aa
4
- data.tar.gz: 7adc3bba6eec5e903e35f772d26cf8810e6cf2b0bb88b0921d8fdca9f67f4070
3
+ metadata.gz: 6854af9a50a833f341a2f5c5a4e57f5bdbf586414de74b1107e89bba71a8b3ff
4
+ data.tar.gz: 62b51fca74bcb9f937cc63faf7bc823b2d4028571ef7d1368739d34b005b32ba
5
5
  SHA512:
6
- metadata.gz: 756f968b07df41efe62122822895063111299766f6500ee61a25a55df6bd34a4b8a86c171b67bb550fce4fc2fe478e37a890e1dccd181ee7995cc56c5a4b8b95
7
- data.tar.gz: 15db415f082c81a1a677916981596d9659f77b2ab80962efb05f85d47cfd7d4fd0fc2fc3e53d80c31ee4dc2c701a9952d770596af8c2db83dd69fabf61c7210c
6
+ metadata.gz: 162e7b181523fc76b03609dc1e57e8fd49162d623367118f1a2119ddf173b304d2c257477ba0bf21c66a630c680d2a66c2e12aa7161140019a702c28bb762420
7
+ data.tar.gz: bbaafd016f844ef53e6f82901af7d32022a4946091b5189b7ded26b8a11d1f63c0e1fe1e857a9f1fc8a3fc98660d66934d55951eeba1bce7affc77efa992916a
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)
@@ -46,6 +47,7 @@ This is one of four language bindings published from the same Rust core. See the
46
47
  - [KV Store Client](#kv-store-client)
47
48
  - [Sets](#sets)
48
49
  - [Lists](#lists)
50
+ - [SQL Client](#sql-client)
49
51
  - [Error Handling](#error-handling)
50
52
  - [License](#license)
51
53
 
@@ -55,7 +57,7 @@ This is one of four language bindings published from the same Rust core. See the
55
57
 
56
58
  ## Quick Start
57
59
 
58
- Construct the SDK once, then reach into the four sub-clients (`admin`, `streams`, `webhooks`, `kvstore`). Subsequent API Reference snippets assume you have a `qn` handle from one of these blocks.
60
+ Construct the SDK once, then reach into the five sub-clients (`admin`, `streams`, `webhooks`, `kvstore`, `sql`). Subsequent API Reference snippets assume you have a `qn` handle from one of these blocks.
59
61
 
60
62
  ```ruby
61
63
  # Ruby
@@ -94,6 +96,7 @@ Environment variables (prefix `QN_SDK__`, separator `__`):
94
96
  | `QN_SDK__STREAMS__BASE_URL` | no | `https://api.quicknode.com/streams/rest/v1/` | Override streams base URL |
95
97
  | `QN_SDK__WEBHOOKS__BASE_URL` | no | `https://api.quicknode.com/webhooks/rest/v1/` | Override webhooks base URL |
96
98
  | `QN_SDK__KVSTORE__BASE_URL` | no | `https://api.quicknode.com/kv/rest/v1/` | Override KV store base URL |
99
+ | `QN_SDK__SQL__BASE_URL` | no | `https://api.quicknode.com/sql/rest/v1/` | Override SQL Explorer base URL |
97
100
  | `QN_SDK__HTTP__HEADERS__<NAME>` | no | — | Custom HTTP header sent on every request. Overrides SDK-managed headers (see below). |
98
101
 
99
102
  ### Custom headers and `User-Agent`
@@ -926,6 +929,34 @@ Lists the blockchains supported by Quicknode along with their networks.
926
929
  resp = qn.admin.list_chains
927
930
  ```
928
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
+
929
960
  #### Billing
930
961
 
931
962
  ##### `list_invoices` / `listInvoices`
@@ -1613,6 +1644,44 @@ Deletes a list and all of its items.
1613
1644
  qn.kvstore.delete_list(key: "my-list")
1614
1645
  ```
1615
1646
 
1647
+ ---
1648
+
1649
+ ### SQL Client
1650
+
1651
+ Accessed as `qn.sql`. Runs SQL queries against indexed blockchain data and fetches the database schema. Backed by `https://api.quicknode.com/sql/rest/v1/`.
1652
+
1653
+ ##### `query`
1654
+
1655
+ Executes a SQL query against a cluster and returns the result set. Paginate by writing `LIMIT`/`OFFSET` into the SQL.
1656
+
1657
+ **Parameters** (Hash): `query:` (String, required), `cluster_id:` (String, required).
1658
+
1659
+ **Returns** a Hash with `meta` (column metadata, each with `name` and `type`), `data` (rows as Hashes keyed by column name), `rows`, `rows_before_limit_at_least`, `statistics` (`elapsed`, `rows_read`, `bytes_read`), and `credits`. Access with `[]` or `dig`.
1660
+
1661
+ ```ruby
1662
+ # Ruby
1663
+ resp = qn.sql.query(
1664
+ query: "SELECT action_type, user FROM hyperliquid_system_actions ORDER BY block_time DESC LIMIT 100",
1665
+ cluster_id: "hyperliquid-core-mainnet"
1666
+ )
1667
+ puts resp[:rows]
1668
+ puts resp[:data].first
1669
+ ```
1670
+
1671
+ ##### `get_schema`
1672
+
1673
+ Fetches the database schema for a cluster: table names, columns, types, sort keys, and partition strategies.
1674
+
1675
+ **Parameters** (Hash): `cluster_id:` (String, required).
1676
+
1677
+ **Returns** a Hash with `chain`, `cluster_id`, and `tables` (each with `name`, `engine`, `total_rows`, `partition_key`, `sorting_key`, and `columns` of `{ name, type }`).
1678
+
1679
+ ```ruby
1680
+ # Ruby
1681
+ schema = qn.sql.get_schema(cluster_id: "hyperliquid-core-mainnet")
1682
+ puts schema[:tables].length
1683
+ ```
1684
+
1616
1685
  ## Error Handling
1617
1686
 
1618
1687
  Every binding exposes a typed exception hierarchy derived from the core `SdkError`
@@ -0,0 +1,4 @@
1
+ module QuicknodeSdk
2
+ class Sql < NativeDelegator
3
+ end
4
+ end
@@ -34,5 +34,9 @@ module QuicknodeSdk
34
34
  def kvstore
35
35
  KvStore.new(@native.kvstore)
36
36
  end
37
+
38
+ def sql
39
+ Sql.new(@native.sql)
40
+ end
37
41
  end
38
42
  end
data/lib/quicknode_sdk.rb CHANGED
@@ -13,4 +13,5 @@ require_relative "quicknode_sdk/clients/admin"
13
13
  require_relative "quicknode_sdk/clients/streams"
14
14
  require_relative "quicknode_sdk/clients/webhooks"
15
15
  require_relative "quicknode_sdk/clients/kvstore"
16
+ require_relative "quicknode_sdk/clients/sql"
16
17
  require_relative "quicknode_sdk/sdk"
@@ -33,6 +33,7 @@ module QuicknodeSdk
33
33
  def streams: () -> Streams
34
34
  def webhooks: () -> Webhooks
35
35
  def kvstore: () -> KvStore
36
+ def sql: () -> Sql
36
37
  end
37
38
 
38
39
  class DestinationAttributes
@@ -90,6 +91,8 @@ module QuicknodeSdk
90
91
  def get_endpoint_metrics: (id: String, period: String, metric: String) -> untyped
91
92
  def get_account_metrics: (period: String, metric: String, ?percentile: String) -> untyped
92
93
  def list_chains: () -> untyped
94
+ def account_info: () -> untyped
95
+ def get_api_credits: (chain: String) -> untyped
93
96
  def list_invoices: () -> untyped
94
97
  def list_payments: () -> untyped
95
98
  def list_teams: () -> untyped
@@ -158,4 +161,11 @@ module QuicknodeSdk
158
161
  def delete_list_item: (key: String, item: String) -> void
159
162
  def delete_list: (key: String) -> void
160
163
  end
164
+
165
+ class Sql
166
+ def initialize: (untyped native) -> void
167
+
168
+ def query: (query: String, cluster_id: String) -> untyped
169
+ def get_schema: (cluster_id: String) -> untyped
170
+ end
161
171
  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.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quicknode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-24 00:00:00.000000000 Z
11
+ date: 2026-07-07 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/sql.rb
37
38
  - lib/quicknode_sdk/clients/streams.rb
38
39
  - lib/quicknode_sdk/clients/webhooks.rb
39
40
  - lib/quicknode_sdk/native_delegator.rb