quicknode-sdk 0.1.0a26__tar.gz → 0.1.0a30__tar.gz
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.
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/Cargo.lock +37 -37
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/Cargo.toml +1 -1
- quicknode_sdk-0.1.0a26/python/README.md → quicknode_sdk-0.1.0a30/PKG-INFO +66 -1
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/Cargo.toml +2 -2
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/README.md +35 -1
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/examples/admin_e2e.rs +29 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/mod.rs +1 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/config.rs +48 -2
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/kvstore/mod.rs +6 -4
- quicknode_sdk-0.1.0a30/crates/core/src/lib.rs +346 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/webhooks/mod.rs +39 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/webhooks/webhook.rs +4 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/python/src/lib.rs +34 -4
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/pyproject.toml +4 -4
- quicknode_sdk-0.1.0a26/PKG-INFO → quicknode_sdk-0.1.0a30/python/README.md +41 -26
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/python/sdk/__init__.py +5 -25
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/python/sdk/_core/__init__.pyi +21 -1
- quicknode_sdk-0.1.0a26/crates/core/src/lib.rs +0 -152
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/LICENSE +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/LICENSE +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/examples/admin.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/examples/kvstore_e2e.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/examples/streams.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/examples/streams_e2e.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/examples/webhooks_e2e.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/billing.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/bulk.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/chains.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/endpoint_metrics.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/endpoint_rate_limits.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/endpoint_security.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/endpoint_urls.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/endpoints.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/logs.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/tags.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/teams.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/admin/usage.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/errors.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/streams/mod.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/core/src/streams/stream.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/python/Cargo.toml +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/python/src/errors.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/python/src/streams_destination.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/crates/python/src/webhooks_template.rs +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/python/sdk/__init__.pyi +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/python/sdk/init_manual_override.pyi +0 -0
- {quicknode_sdk-0.1.0a26 → quicknode_sdk-0.1.0a30}/python/sdk/py.typed +0 -0
|
@@ -156,9 +156,9 @@ dependencies = [
|
|
|
156
156
|
|
|
157
157
|
[[package]]
|
|
158
158
|
name = "bumpalo"
|
|
159
|
-
version = "3.20.
|
|
159
|
+
version = "3.20.3"
|
|
160
160
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
161
|
-
checksum = "
|
|
161
|
+
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
|
|
162
162
|
|
|
163
163
|
[[package]]
|
|
164
164
|
name = "bytes"
|
|
@@ -420,9 +420,9 @@ dependencies = [
|
|
|
420
420
|
|
|
421
421
|
[[package]]
|
|
422
422
|
name = "displaydoc"
|
|
423
|
-
version = "0.2.
|
|
423
|
+
version = "0.2.6"
|
|
424
424
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
425
|
-
checksum = "
|
|
425
|
+
checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
|
|
426
426
|
dependencies = [
|
|
427
427
|
"proc-macro2",
|
|
428
428
|
"quote",
|
|
@@ -712,9 +712,9 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
|
|
|
712
712
|
|
|
713
713
|
[[package]]
|
|
714
714
|
name = "http"
|
|
715
|
-
version = "1.4.
|
|
715
|
+
version = "1.4.1"
|
|
716
716
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
717
|
-
checksum = "
|
|
717
|
+
checksum = "8be7462df143984c4598a256ef469b251d7d7f9e271135073e78fc535414f3d0"
|
|
718
718
|
dependencies = [
|
|
719
719
|
"bytes",
|
|
720
720
|
"itoa",
|
|
@@ -757,9 +757,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
|
|
757
757
|
|
|
758
758
|
[[package]]
|
|
759
759
|
name = "hyper"
|
|
760
|
-
version = "1.
|
|
760
|
+
version = "1.10.0"
|
|
761
761
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
762
|
-
checksum = "
|
|
762
|
+
checksum = "eb92f162bf56536459fc83c79b974bb12837acfed43d6bc370a7916d0ae15ecc"
|
|
763
763
|
dependencies = [
|
|
764
764
|
"atomic-waker",
|
|
765
765
|
"bytes",
|
|
@@ -1088,9 +1088,9 @@ dependencies = [
|
|
|
1088
1088
|
|
|
1089
1089
|
[[package]]
|
|
1090
1090
|
name = "js-sys"
|
|
1091
|
-
version = "0.3.
|
|
1091
|
+
version = "0.3.99"
|
|
1092
1092
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1093
|
-
checksum = "
|
|
1093
|
+
checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11"
|
|
1094
1094
|
dependencies = [
|
|
1095
1095
|
"cfg-if",
|
|
1096
1096
|
"futures-util",
|
|
@@ -1155,9 +1155,9 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
|
|
|
1155
1155
|
|
|
1156
1156
|
[[package]]
|
|
1157
1157
|
name = "log"
|
|
1158
|
-
version = "0.4.
|
|
1158
|
+
version = "0.4.30"
|
|
1159
1159
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1160
|
-
checksum = "
|
|
1160
|
+
checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5"
|
|
1161
1161
|
|
|
1162
1162
|
[[package]]
|
|
1163
1163
|
name = "lru-slab"
|
|
@@ -1206,9 +1206,9 @@ dependencies = [
|
|
|
1206
1206
|
|
|
1207
1207
|
[[package]]
|
|
1208
1208
|
name = "memchr"
|
|
1209
|
-
version = "2.8.
|
|
1209
|
+
version = "2.8.1"
|
|
1210
1210
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1211
|
-
checksum = "
|
|
1211
|
+
checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
|
|
1212
1212
|
|
|
1213
1213
|
[[package]]
|
|
1214
1214
|
name = "memoffset"
|
|
@@ -1700,7 +1700,7 @@ dependencies = [
|
|
|
1700
1700
|
|
|
1701
1701
|
[[package]]
|
|
1702
1702
|
name = "quicknode-sdk"
|
|
1703
|
-
version = "0.1.0-alpha.
|
|
1703
|
+
version = "0.1.0-alpha.30"
|
|
1704
1704
|
dependencies = [
|
|
1705
1705
|
"bon",
|
|
1706
1706
|
"config",
|
|
@@ -1917,9 +1917,9 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
|
1917
1917
|
|
|
1918
1918
|
[[package]]
|
|
1919
1919
|
name = "reqwest"
|
|
1920
|
-
version = "0.13.
|
|
1920
|
+
version = "0.13.4"
|
|
1921
1921
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1922
|
-
checksum = "
|
|
1922
|
+
checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3"
|
|
1923
1923
|
dependencies = [
|
|
1924
1924
|
"base64",
|
|
1925
1925
|
"bytes",
|
|
@@ -2177,7 +2177,7 @@ dependencies = [
|
|
|
2177
2177
|
|
|
2178
2178
|
[[package]]
|
|
2179
2179
|
name = "sdk-node"
|
|
2180
|
-
version = "0.1.0-alpha.
|
|
2180
|
+
version = "0.1.0-alpha.30"
|
|
2181
2181
|
dependencies = [
|
|
2182
2182
|
"napi",
|
|
2183
2183
|
"napi-build",
|
|
@@ -2189,7 +2189,7 @@ dependencies = [
|
|
|
2189
2189
|
|
|
2190
2190
|
[[package]]
|
|
2191
2191
|
name = "sdk-python"
|
|
2192
|
-
version = "0.1.0-alpha.
|
|
2192
|
+
version = "0.1.0-alpha.30"
|
|
2193
2193
|
dependencies = [
|
|
2194
2194
|
"pyo3",
|
|
2195
2195
|
"pyo3-async-runtimes",
|
|
@@ -2200,7 +2200,7 @@ dependencies = [
|
|
|
2200
2200
|
|
|
2201
2201
|
[[package]]
|
|
2202
2202
|
name = "sdk-python-stubs"
|
|
2203
|
-
version = "0.1.0-alpha.
|
|
2203
|
+
version = "0.1.0-alpha.30"
|
|
2204
2204
|
dependencies = [
|
|
2205
2205
|
"pyo3-stub-gen",
|
|
2206
2206
|
"sdk-python",
|
|
@@ -2208,7 +2208,7 @@ dependencies = [
|
|
|
2208
2208
|
|
|
2209
2209
|
[[package]]
|
|
2210
2210
|
name = "sdk-ruby"
|
|
2211
|
-
version = "0.1.0-alpha.
|
|
2211
|
+
version = "0.1.0-alpha.30"
|
|
2212
2212
|
dependencies = [
|
|
2213
2213
|
"magnus",
|
|
2214
2214
|
"quicknode-sdk",
|
|
@@ -2917,9 +2917,9 @@ dependencies = [
|
|
|
2917
2917
|
|
|
2918
2918
|
[[package]]
|
|
2919
2919
|
name = "wasm-bindgen"
|
|
2920
|
-
version = "0.2.
|
|
2920
|
+
version = "0.2.122"
|
|
2921
2921
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2922
|
-
checksum = "
|
|
2922
|
+
checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409"
|
|
2923
2923
|
dependencies = [
|
|
2924
2924
|
"cfg-if",
|
|
2925
2925
|
"once_cell",
|
|
@@ -2930,9 +2930,9 @@ dependencies = [
|
|
|
2930
2930
|
|
|
2931
2931
|
[[package]]
|
|
2932
2932
|
name = "wasm-bindgen-futures"
|
|
2933
|
-
version = "0.4.
|
|
2933
|
+
version = "0.4.72"
|
|
2934
2934
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2935
|
-
checksum = "
|
|
2935
|
+
checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f"
|
|
2936
2936
|
dependencies = [
|
|
2937
2937
|
"js-sys",
|
|
2938
2938
|
"wasm-bindgen",
|
|
@@ -2940,9 +2940,9 @@ dependencies = [
|
|
|
2940
2940
|
|
|
2941
2941
|
[[package]]
|
|
2942
2942
|
name = "wasm-bindgen-macro"
|
|
2943
|
-
version = "0.2.
|
|
2943
|
+
version = "0.2.122"
|
|
2944
2944
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2945
|
-
checksum = "
|
|
2945
|
+
checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6"
|
|
2946
2946
|
dependencies = [
|
|
2947
2947
|
"quote",
|
|
2948
2948
|
"wasm-bindgen-macro-support",
|
|
@@ -2950,9 +2950,9 @@ dependencies = [
|
|
|
2950
2950
|
|
|
2951
2951
|
[[package]]
|
|
2952
2952
|
name = "wasm-bindgen-macro-support"
|
|
2953
|
-
version = "0.2.
|
|
2953
|
+
version = "0.2.122"
|
|
2954
2954
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2955
|
-
checksum = "
|
|
2955
|
+
checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e"
|
|
2956
2956
|
dependencies = [
|
|
2957
2957
|
"bumpalo",
|
|
2958
2958
|
"proc-macro2",
|
|
@@ -2963,18 +2963,18 @@ dependencies = [
|
|
|
2963
2963
|
|
|
2964
2964
|
[[package]]
|
|
2965
2965
|
name = "wasm-bindgen-shared"
|
|
2966
|
-
version = "0.2.
|
|
2966
|
+
version = "0.2.122"
|
|
2967
2967
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2968
|
-
checksum = "
|
|
2968
|
+
checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437"
|
|
2969
2969
|
dependencies = [
|
|
2970
2970
|
"unicode-ident",
|
|
2971
2971
|
]
|
|
2972
2972
|
|
|
2973
2973
|
[[package]]
|
|
2974
2974
|
name = "web-sys"
|
|
2975
|
-
version = "0.3.
|
|
2975
|
+
version = "0.3.99"
|
|
2976
2976
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2977
|
-
checksum = "
|
|
2977
|
+
checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436"
|
|
2978
2978
|
dependencies = [
|
|
2979
2979
|
"js-sys",
|
|
2980
2980
|
"wasm-bindgen",
|
|
@@ -3303,18 +3303,18 @@ dependencies = [
|
|
|
3303
3303
|
|
|
3304
3304
|
[[package]]
|
|
3305
3305
|
name = "zerocopy"
|
|
3306
|
-
version = "0.8.
|
|
3306
|
+
version = "0.8.49"
|
|
3307
3307
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3308
|
-
checksum = "
|
|
3308
|
+
checksum = "bce33a6288fa3f072a8c2c7d0f2fdbb90e28298f0135c1f99b96c3db2efcc60b"
|
|
3309
3309
|
dependencies = [
|
|
3310
3310
|
"zerocopy-derive",
|
|
3311
3311
|
]
|
|
3312
3312
|
|
|
3313
3313
|
[[package]]
|
|
3314
3314
|
name = "zerocopy-derive"
|
|
3315
|
-
version = "0.8.
|
|
3315
|
+
version = "0.8.49"
|
|
3316
3316
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3317
|
-
checksum = "
|
|
3317
|
+
checksum = "8fd425244944f4ab65ccff928e7323354c5a018c75838362fdce749dfad2ee1e"
|
|
3318
3318
|
dependencies = [
|
|
3319
3319
|
"proc-macro2",
|
|
3320
3320
|
"quote",
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quicknode-sdk
|
|
3
|
+
Version: 0.1.0a30
|
|
4
|
+
Classifier: Intended Audience :: Developers
|
|
5
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
6
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Classifier: Programming Language :: Rust
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Summary: Quicknode SDK
|
|
16
|
+
Keywords: quicknode,blockchain,sdk,web3,ethereum,solana
|
|
17
|
+
Author-email: John Mitsch <john@quicknode.com>
|
|
18
|
+
License: MIT
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
21
|
+
Project-URL: Homepage, https://github.com/quicknode/sdk
|
|
22
|
+
Project-URL: Issues, https://github.com/quicknode/sdk/issues
|
|
23
|
+
Project-URL: Repository, https://github.com/quicknode/sdk
|
|
24
|
+
|
|
1
25
|
# quicknode-sdk (Python)
|
|
2
26
|
|
|
3
27
|
Python bindings for the Quicknode SDK.
|
|
4
28
|
|
|
5
|
-
This is one of four language bindings published from the same Rust core. See the [project README](https://github.com/
|
|
29
|
+
This is one of four language bindings published from the same Rust core. See the [project README](https://github.com/quicknode/sdk/blob/main/README.md) for the polyglot overview, development setup, and release process.
|
|
6
30
|
|
|
7
31
|
## Table of Contents
|
|
8
32
|
|
|
9
33
|
- [Installation](#installation)
|
|
10
34
|
- [Quick Start](#quick-start)
|
|
11
35
|
- [Configuration](#configuration)
|
|
36
|
+
- [Platform Support](#platform-support)
|
|
12
37
|
- [API Reference](#api-reference)
|
|
13
38
|
- [Admin Client](#admin-client)
|
|
14
39
|
- [Endpoints](#endpoints)
|
|
@@ -97,6 +122,45 @@ Environment variables (prefix `QN_SDK__`, separator `__`):
|
|
|
97
122
|
| `QN_SDK__STREAMS__BASE_URL` | no | `https://api.quicknode.com/streams/rest/v1/` | Override streams base URL |
|
|
98
123
|
| `QN_SDK__WEBHOOKS__BASE_URL` | no | `https://api.quicknode.com/webhooks/rest/v1/` | Override webhooks base URL |
|
|
99
124
|
| `QN_SDK__KVSTORE__BASE_URL` | no | `https://api.quicknode.com/kv/rest/v1/` | Override KV store base URL |
|
|
125
|
+
| `QN_SDK__HTTP__HEADERS__<NAME>` | no | — | Custom HTTP header sent on every request. Overrides SDK-managed headers (see below). |
|
|
126
|
+
|
|
127
|
+
### Custom headers and `User-Agent`
|
|
128
|
+
|
|
129
|
+
Every outbound HTTP request includes an auto-generated `User-Agent` of the form:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
quicknode-sdk-<language>/<sdk-version> (<os>-<arch>; <language>-<runtime-version>)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
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.
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from sdk import QuicknodeSdk, SdkFullConfig, HttpConfig
|
|
139
|
+
|
|
140
|
+
qn = QuicknodeSdk(
|
|
141
|
+
SdkFullConfig(
|
|
142
|
+
api_key="your-key",
|
|
143
|
+
http=HttpConfig(headers={
|
|
144
|
+
"X-Correlation-Id": "abc-123",
|
|
145
|
+
"User-Agent": "my-app/1.0", # overrides SDK default
|
|
146
|
+
}),
|
|
147
|
+
)
|
|
148
|
+
)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Platform Support
|
|
152
|
+
|
|
153
|
+
Precompiled wheels are published for:
|
|
154
|
+
|
|
155
|
+
| Platform | Targets |
|
|
156
|
+
|---|---|
|
|
157
|
+
| Linux (glibc) | `x86_64`, `aarch64` — glibc **2.17+** (manylinux2014) |
|
|
158
|
+
| Linux (musl) | `x86_64`, `aarch64` — Alpine and other musl distros |
|
|
159
|
+
| macOS | Apple Silicon (`arm64`) |
|
|
160
|
+
|
|
161
|
+
Linux glibc wheels 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+. If `pip install quicknode-sdk` resolves to a source distribution on your platform, you're on something we don't have a prebuilt wheel for — see the matrix above.
|
|
162
|
+
|
|
163
|
+
**Not supported:** RHEL/CentOS 6 (glibc 2.12), Debian 7 (glibc 2.13), Ubuntu 12.04 (glibc 2.15), SLES 11 (glibc 2.11), Intel macOS, Windows.
|
|
100
164
|
|
|
101
165
|
## API Reference
|
|
102
166
|
|
|
@@ -1601,3 +1665,4 @@ except TimeoutError:
|
|
|
1601
1665
|
## License
|
|
1602
1666
|
|
|
1603
1667
|
MIT
|
|
1668
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "quicknode-sdk"
|
|
3
|
-
version = "0.1.0-alpha.
|
|
3
|
+
version = "0.1.0-alpha.30"
|
|
4
4
|
edition.workspace = true
|
|
5
5
|
license.workspace = true
|
|
6
6
|
description = "Core library for quicknode sdk"
|
|
7
|
-
repository = "https://github.com/
|
|
7
|
+
repository = "https://github.com/quicknode/sdk"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
keywords = ["quicknode", "blockchain", "web3", "sdk"]
|
|
10
10
|
categories = ["api-bindings", "web-programming"]
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
The core Rust crate for the Quicknode SDK.
|
|
4
4
|
|
|
5
|
-
This is one of four language bindings published from the same Rust core. See the [project README](https://github.com/
|
|
5
|
+
This is one of four language bindings published from the same Rust core. See the [project README](https://github.com/quicknode/sdk/blob/main/README.md) for the polyglot overview, development setup, and release process.
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
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)
|
|
@@ -96,6 +97,39 @@ Environment variables (prefix `QN_SDK__`, separator `__`):
|
|
|
96
97
|
| `QN_SDK__STREAMS__BASE_URL` | no | `https://api.quicknode.com/streams/rest/v1/` | Override streams base URL |
|
|
97
98
|
| `QN_SDK__WEBHOOKS__BASE_URL` | no | `https://api.quicknode.com/webhooks/rest/v1/` | Override webhooks base URL |
|
|
98
99
|
| `QN_SDK__KVSTORE__BASE_URL` | no | `https://api.quicknode.com/kv/rest/v1/` | Override KV store base URL |
|
|
100
|
+
| `QN_SDK__HTTP__HEADERS__<NAME>` | no | — | Custom HTTP header sent on every request. Overrides SDK-managed headers (see below). |
|
|
101
|
+
|
|
102
|
+
### Custom headers and `User-Agent`
|
|
103
|
+
|
|
104
|
+
Every outbound HTTP request includes an auto-generated `User-Agent` of the form:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
quicknode-sdk-<language>/<sdk-version> (<os>-<arch>; <language>-<runtime-version>)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
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.
|
|
111
|
+
|
|
112
|
+
```rust
|
|
113
|
+
use std::collections::HashMap;
|
|
114
|
+
use quicknode_sdk::{HttpConfig, QuicknodeSdk, SdkFullConfig};
|
|
115
|
+
|
|
116
|
+
let mut headers = HashMap::new();
|
|
117
|
+
headers.insert("X-Correlation-Id".to_string(), "abc-123".to_string());
|
|
118
|
+
headers.insert("User-Agent".to_string(), "my-app/1.0".to_string()); // overrides SDK default
|
|
119
|
+
|
|
120
|
+
let qn = QuicknodeSdk::new(
|
|
121
|
+
&SdkFullConfig::builder()
|
|
122
|
+
.api_key("your-key")
|
|
123
|
+
.http(HttpConfig { headers: Some(headers), ..Default::default() })
|
|
124
|
+
.build(),
|
|
125
|
+
)?;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Platform Support
|
|
129
|
+
|
|
130
|
+
`quicknode-sdk` is a pure-Rust source crate — it builds wherever `rustc` and `reqwest` are supported. It is regularly tested on Linux (glibc) and macOS (Apple Silicon). Windows is not tested.
|
|
131
|
+
|
|
132
|
+
If you are using one of the language bindings (`quicknode-sdk` on PyPI, `@quicknode/sdk` on npm, `quicknode_sdk` on RubyGems), see that package's README for the precompiled-binary platform matrix.
|
|
99
133
|
|
|
100
134
|
## API Reference
|
|
101
135
|
|
|
@@ -857,6 +857,34 @@ async fn main() {
|
|
|
857
857
|
other => eprintln!("expected Api 404 from delete_rate_limit_override, got {other:?}"),
|
|
858
858
|
}
|
|
859
859
|
|
|
860
|
+
// Custom headers smoke test — construct an SDK that overrides User-Agent
|
|
861
|
+
// and adds a correlation header. We don't verify what reaches the wire
|
|
862
|
+
// here; we just confirm the config is accepted and an API call succeeds.
|
|
863
|
+
let mut custom_headers = std::collections::HashMap::new();
|
|
864
|
+
custom_headers.insert("User-Agent".to_string(), "qn-e2e-rust/1.0".to_string());
|
|
865
|
+
custom_headers.insert("X-E2E-Correlation".to_string(), "rust-smoke".to_string());
|
|
866
|
+
let with_headers = SdkFullConfig {
|
|
867
|
+
api_key: config.api_key.clone(),
|
|
868
|
+
http: Some(HttpConfig {
|
|
869
|
+
timeout_secs: None,
|
|
870
|
+
pool_max_idle_per_host: None,
|
|
871
|
+
headers: Some(custom_headers),
|
|
872
|
+
}),
|
|
873
|
+
admin: config.admin.clone(),
|
|
874
|
+
streams: None,
|
|
875
|
+
webhooks: None,
|
|
876
|
+
kvstore: None,
|
|
877
|
+
};
|
|
878
|
+
let headered = QuicknodeSdk::new(&with_headers).expect("build sdk with custom headers");
|
|
879
|
+
match headered
|
|
880
|
+
.admin
|
|
881
|
+
.get_endpoints(&GetEndpointsRequest::builder().limit(1).build())
|
|
882
|
+
.await
|
|
883
|
+
{
|
|
884
|
+
Ok(_) => println!("custom-headers smoke: ok"),
|
|
885
|
+
Err(e) => eprintln!("custom-headers smoke error: {e}"),
|
|
886
|
+
}
|
|
887
|
+
|
|
860
888
|
// 2) Timeout path — unreachable base URL + 1s timeout forces a timeout
|
|
861
889
|
// from reqwest, which maps to SdkError::Http with http_kind() == Timeout.
|
|
862
890
|
let blackhole = SdkFullConfig {
|
|
@@ -864,6 +892,7 @@ async fn main() {
|
|
|
864
892
|
http: Some(HttpConfig {
|
|
865
893
|
timeout_secs: Some(1),
|
|
866
894
|
pool_max_idle_per_host: None,
|
|
895
|
+
headers: None,
|
|
867
896
|
}),
|
|
868
897
|
admin: Some(AdminConfig {
|
|
869
898
|
base_url: Some("http://10.255.255.1/".to_string()),
|
|
@@ -17,6 +17,13 @@ use crate::errors::SdkError;
|
|
|
17
17
|
pub struct HttpConfig {
|
|
18
18
|
pub timeout_secs: Option<i64>,
|
|
19
19
|
pub pool_max_idle_per_host: Option<i32>,
|
|
20
|
+
/// Custom HTTP headers added to every outbound request.
|
|
21
|
+
///
|
|
22
|
+
/// **These headers OVERRIDE any SDK-managed header with the same name**,
|
|
23
|
+
/// including `User-Agent`, `x-api-key`, `Accept`, and `Content-Type`.
|
|
24
|
+
/// Header names are matched case-insensitively. Use this to override the
|
|
25
|
+
/// auto-generated User-Agent or inject correlation IDs, proxy auth, etc.
|
|
26
|
+
pub headers: Option<std::collections::HashMap<String, String>>,
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
#[cfg(feature = "python")]
|
|
@@ -24,15 +31,35 @@ pub struct HttpConfig {
|
|
|
24
31
|
#[pymethods]
|
|
25
32
|
impl HttpConfig {
|
|
26
33
|
#[new]
|
|
27
|
-
#[pyo3(signature = (timeout_secs=None, pool_max_idle_per_host=None))]
|
|
28
|
-
pub fn new(
|
|
34
|
+
#[pyo3(signature = (timeout_secs=None, pool_max_idle_per_host=None, headers=None))]
|
|
35
|
+
pub fn new(
|
|
36
|
+
timeout_secs: Option<i64>,
|
|
37
|
+
pool_max_idle_per_host: Option<i32>,
|
|
38
|
+
headers: Option<std::collections::HashMap<String, String>>,
|
|
39
|
+
) -> Self {
|
|
29
40
|
HttpConfig {
|
|
30
41
|
timeout_secs,
|
|
31
42
|
pool_max_idle_per_host,
|
|
43
|
+
headers,
|
|
32
44
|
}
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
|
|
48
|
+
/// Identifies the language and runtime making SDK calls. Each binding crate
|
|
49
|
+
/// (Python, Node, Ruby) constructs this and passes it through
|
|
50
|
+
/// [`SdkConfig::new_with_client_info`] so the SDK's auto-generated
|
|
51
|
+
/// `User-Agent` reflects the actual caller, not the underlying Rust core.
|
|
52
|
+
#[derive(Debug, Clone)]
|
|
53
|
+
pub struct ClientInfo {
|
|
54
|
+
/// Short language identifier, e.g. `"python"`, `"node"`, `"ruby"`, `"rust"`.
|
|
55
|
+
pub language: String,
|
|
56
|
+
/// Runtime version of the language, e.g. `"3.12.4"`, `"20.10.0"`, `"3.3.0"`.
|
|
57
|
+
pub language_version: String,
|
|
58
|
+
/// Version string of the language-specific SDK package — read from the
|
|
59
|
+
/// language's own manifest (PyPI version, npm version, gem version).
|
|
60
|
+
pub sdk_version: String,
|
|
61
|
+
}
|
|
62
|
+
|
|
36
63
|
#[cfg_attr(feature = "python", gen_stub_pyclass)]
|
|
37
64
|
#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
|
|
38
65
|
#[cfg_attr(feature = "node", napi(object))]
|
|
@@ -238,4 +265,23 @@ mod tests {
|
|
|
238
265
|
Err(SdkError::Config(_))
|
|
239
266
|
));
|
|
240
267
|
}
|
|
268
|
+
|
|
269
|
+
#[test]
|
|
270
|
+
fn from_env_headers_round_trip() {
|
|
271
|
+
let cfg = build_config(&[
|
|
272
|
+
("api_key", "k"),
|
|
273
|
+
("http.headers.x-correlation-id", "abc"),
|
|
274
|
+
("http.headers.user-agent", "custom-ua/1.0"),
|
|
275
|
+
]);
|
|
276
|
+
let config = SdkFullConfig::from_config(cfg).unwrap();
|
|
277
|
+
let headers = config.http.unwrap().headers.unwrap();
|
|
278
|
+
assert_eq!(
|
|
279
|
+
headers.get("x-correlation-id").map(String::as_str),
|
|
280
|
+
Some("abc")
|
|
281
|
+
);
|
|
282
|
+
assert_eq!(
|
|
283
|
+
headers.get("user-agent").map(String::as_str),
|
|
284
|
+
Some("custom-ua/1.0")
|
|
285
|
+
);
|
|
286
|
+
}
|
|
241
287
|
}
|
|
@@ -77,6 +77,7 @@ pub struct GetSetsParams {
|
|
|
77
77
|
#[cfg_attr(feature = "node", napi(object))]
|
|
78
78
|
#[cfg_attr(not(feature = "node"), derive(Clone))]
|
|
79
79
|
#[derive(Debug, Serialize, Deserialize)]
|
|
80
|
+
#[serde(rename_all = "camelCase")]
|
|
80
81
|
pub struct BulkSetsParams {
|
|
81
82
|
/// Key/value pairs to add.
|
|
82
83
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
@@ -131,6 +132,7 @@ pub struct GetListParams {
|
|
|
131
132
|
#[cfg_attr(feature = "node", napi(object))]
|
|
132
133
|
#[cfg_attr(not(feature = "node"), derive(Clone))]
|
|
133
134
|
#[derive(Debug, Default, Serialize, Deserialize)]
|
|
135
|
+
#[serde(rename_all = "camelCase")]
|
|
134
136
|
pub struct UpdateListParams {
|
|
135
137
|
/// Items to add to the list.
|
|
136
138
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
@@ -947,7 +949,7 @@ mod tests {
|
|
|
947
949
|
Mock::given(method("POST"))
|
|
948
950
|
.and(path("/sets/bulk"))
|
|
949
951
|
.and(body_json(serde_json::json!({
|
|
950
|
-
"
|
|
952
|
+
"addSets": {"k1": "v1"}
|
|
951
953
|
})))
|
|
952
954
|
.respond_with(
|
|
953
955
|
ResponseTemplate::new(201)
|
|
@@ -973,7 +975,7 @@ mod tests {
|
|
|
973
975
|
Mock::given(method("POST"))
|
|
974
976
|
.and(path("/sets/bulk"))
|
|
975
977
|
.and(body_json(serde_json::json!({
|
|
976
|
-
"
|
|
978
|
+
"deleteSets": ["k1", "k2"]
|
|
977
979
|
})))
|
|
978
980
|
.respond_with(
|
|
979
981
|
ResponseTemplate::new(201)
|
|
@@ -1254,8 +1256,8 @@ mod tests {
|
|
|
1254
1256
|
Mock::given(method("PATCH"))
|
|
1255
1257
|
.and(path("/lists/my-list"))
|
|
1256
1258
|
.and(body_json(serde_json::json!({
|
|
1257
|
-
"
|
|
1258
|
-
"
|
|
1259
|
+
"addItems": ["c"],
|
|
1260
|
+
"removeItems": ["a"]
|
|
1259
1261
|
})))
|
|
1260
1262
|
.respond_with(
|
|
1261
1263
|
ResponseTemplate::new(200)
|