quicknode_sdk 0.1.0.pre.alpha.26 → 0.1.0.pre.alpha.29

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: '0967efbdaee116172b51da65212c55f6a3f03183e11e79a5ca55122f4d7ede9e'
4
- data.tar.gz: f070ee769525280a210d050e65d3767765edaef8cb6b20d0ab4b43c8791a6781
3
+ metadata.gz: 30f2ad12b7b844cdad9a5702defa7ff2aeb42f994422ed5fedc623107bbfed71
4
+ data.tar.gz: 26958bd53b70e087a5389a1750cf316b36656cf64cbce358771619f22f67be04
5
5
  SHA512:
6
- metadata.gz: 9bfb50ebea710c550844773bc9efd16c12cefe5f115413482ec3625736f107cdd6fc3a4d630fb1e4af4f16c2ebf7bd9131b3a745cda08fd4e9cfeacab9f5b61c
7
- data.tar.gz: 2be501071f49cf7bbb4d02a9b8111731b4e9046a3df98fe0a46ea40417f1d37325c05cdb9cae2dc244f6a5fc657f629b66347f84ecb852f24471a3396ad26c49
6
+ metadata.gz: 14692c35c4278c46626cf9d1f27cf824566c1c77f8fdc7d450cacdf2041fb8c96dbb2c70e86aa9c4fac0bbd6894da2bd799f6766fb200f99075eb5179ade521e
7
+ data.tar.gz: 8e72cef358d0da3cd399d5b2c4c06fe620c77d4898f01a49d5cdec421ea66ebc5b6ac1cf5f6957281972b5a1b1a838911cc97596017a0b6f776e805e2e231d25
data/README.md CHANGED
@@ -9,6 +9,7 @@ This is one of four language bindings published from the same Rust core. See the
9
9
  - [Installation](#installation)
10
10
  - [Quick Start](#quick-start)
11
11
  - [Configuration](#configuration)
12
+ - [Platform Support](#platform-support)
12
13
  - [API Reference](#api-reference)
13
14
  - [Admin Client](#admin-client)
14
15
  - [Endpoints](#endpoints)
@@ -69,6 +70,10 @@ There are two ways to configure the SDK.
69
70
 
70
71
  ### Option A — Pass config directly
71
72
 
73
+ ```ruby
74
+ qn = QuicknodeSdk::SDK.from_config(api_key: "your-key")
75
+ ```
76
+
72
77
  ### Option B — Load from environment (`from_env()`)
73
78
 
74
79
  ```ruby
@@ -87,6 +92,44 @@ Environment variables (prefix `QN_SDK__`, separator `__`):
87
92
  | `QN_SDK__STREAMS__BASE_URL` | no | `https://api.quicknode.com/streams/rest/v1/` | Override streams base URL |
88
93
  | `QN_SDK__WEBHOOKS__BASE_URL` | no | `https://api.quicknode.com/webhooks/rest/v1/` | Override webhooks base URL |
89
94
  | `QN_SDK__KVSTORE__BASE_URL` | no | `https://api.quicknode.com/kv/rest/v1/` | Override KV store base URL |
95
+ | `QN_SDK__HTTP__HEADERS__<NAME>` | no | — | Custom HTTP header sent on every request. Overrides SDK-managed headers (see below). |
96
+
97
+ ### Custom headers and `User-Agent`
98
+
99
+ Every outbound HTTP request includes an auto-generated `User-Agent` of the form:
100
+
101
+ ```
102
+ quicknode-sdk-<language>/<sdk-version> (<os>-<arch>; <language>-<runtime-version>)
103
+ ```
104
+
105
+ You can attach arbitrary headers via `HttpConfig.headers`. **These headers OVERRIDE any SDK-managed header with the same name**, including `User-Agent`, `x-api-key`, `Accept`, and `Content-Type`. Use this to inject correlation IDs, proxy auth, or to replace the default `User-Agent`. Header names are matched case-insensitively.
106
+
107
+ ```ruby
108
+ qn = QuicknodeSdk::SDK.from_config(
109
+ api_key: "your-key",
110
+ http: {
111
+ headers: {
112
+ "X-Correlation-Id" => "abc-123",
113
+ "User-Agent" => "my-app/1.0", # overrides SDK default
114
+ },
115
+ },
116
+ )
117
+ ```
118
+
119
+ You can also set custom headers via env vars (`QN_SDK__HTTP__HEADERS__<NAME>`) when using `from_env`.
120
+
121
+ ## Platform Support
122
+
123
+ Precompiled platform gems are published for:
124
+
125
+ | Platform | Targets |
126
+ |---|---|
127
+ | Linux (glibc) | `x86_64-linux`, `aarch64-linux` — glibc **2.17+** (manylinux2014) |
128
+ | macOS | Apple Silicon (`arm64-darwin`) |
129
+
130
+ Linux gems are built against glibc 2.17 so they load on any distro from 2014 onward — RHEL 7+, Ubuntu 14.04+, Debian 8+, Amazon Linux 2+, SLES 12+, Fedora 19+.
131
+
132
+ **Not supported:** Alpine and other musl-libc distros (the Rust cdylib that backs the gem requires the dynamic linker glibc provides), RHEL/CentOS 6 (glibc 2.12), Debian 7 (glibc 2.13), Ubuntu 12.04 (glibc 2.15), Intel macOS, Windows. The `ruby`-platform fallback gem is present only so Bundler's resolver can complete on those platforms — `require "quicknode_sdk"` raises a `LoadError` listing the supported platforms.
90
133
 
91
134
  ## API Reference
92
135
 
@@ -4,6 +4,17 @@ module QuicknodeSdk
4
4
  new(Native::SDK.from_env)
5
5
  end
6
6
 
7
+ # Build an SDK from an explicit config hash. Supports custom headers,
8
+ # timeouts, and base URLs without relying on env vars.
9
+ #
10
+ # QuicknodeSdk::SDK.from_config(
11
+ # api_key: "...",
12
+ # http: { headers: { "X-Correlation-Id" => "abc" } }
13
+ # )
14
+ def self.from_config(opts)
15
+ new(Native::SDK.from_config(opts))
16
+ end
17
+
7
18
  def initialize(native)
8
19
  @native = native
9
20
  end
@@ -27,6 +27,7 @@ module QuicknodeSdk
27
27
 
28
28
  class SDK
29
29
  def self.from_env: () -> SDK
30
+ def self.from_config: (Hash[Symbol | String, untyped] opts) -> SDK
30
31
  def initialize: (untyped native) -> void
31
32
  def admin: () -> Admin
32
33
  def streams: () -> Streams
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.1.0.pre.alpha.26
4
+ version: 0.1.0.pre.alpha.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quicknode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-22 00:00:00.000000000 Z
11
+ date: 2026-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie