quicknode-sdk 0.2.0__tar.gz → 0.2.1__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.2.0 → quicknode_sdk-0.2.1}/Cargo.lock +13 -13
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/Cargo.toml +1 -1
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/PKG-INFO +16 -13
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/Cargo.toml +1 -1
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/README.md +12 -12
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/examples/webhooks_e2e.rs +40 -4
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/webhooks/mod.rs +41 -28
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/webhooks/webhook.rs +463 -54
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/python/src/lib.rs +20 -4
- quicknode_sdk-0.2.1/crates/python/src/webhooks_template.rs +229 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/pyproject.toml +1 -1
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/python/README.md +15 -12
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/python/quicknode_sdk/__init__.pyi +32 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/python/quicknode_sdk/_core/__init__.pyi +246 -16
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/python/quicknode_sdk/init_manual_override.pyi +32 -0
- quicknode_sdk-0.2.0/crates/python/src/webhooks_template.rs +0 -116
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/LICENSE +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/LICENSE +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/examples/admin.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/examples/admin_e2e.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/examples/kvstore_e2e.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/examples/streams.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/examples/streams_e2e.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/billing.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/bulk.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/chains.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/endpoint_metrics.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/endpoint_rate_limits.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/endpoint_security.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/endpoint_urls.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/endpoints.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/logs.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/mod.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/tags.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/teams.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/admin/usage.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/config.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/errors.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/kvstore/mod.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/lib.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/streams/mod.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/core/src/streams/stream.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/python/Cargo.toml +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/python/src/errors.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/crates/python/src/streams_destination.rs +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/python/quicknode_sdk/__init__.py +0 -0
- {quicknode_sdk-0.2.0 → quicknode_sdk-0.2.1}/python/quicknode_sdk/py.typed +0 -0
|
@@ -113,9 +113,9 @@ dependencies = [
|
|
|
113
113
|
|
|
114
114
|
[[package]]
|
|
115
115
|
name = "bitflags"
|
|
116
|
-
version = "2.
|
|
116
|
+
version = "2.12.1"
|
|
117
117
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
-
checksum = "
|
|
118
|
+
checksum = "84d7ced0ae9557296835c32bf1b1e02b44c746701f898460fb000d7eaa84f00a"
|
|
119
119
|
dependencies = [
|
|
120
120
|
"serde_core",
|
|
121
121
|
]
|
|
@@ -1155,9 +1155,9 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
|
|
|
1155
1155
|
|
|
1156
1156
|
[[package]]
|
|
1157
1157
|
name = "log"
|
|
1158
|
-
version = "0.4.
|
|
1158
|
+
version = "0.4.31"
|
|
1159
1159
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1160
|
-
checksum = "
|
|
1160
|
+
checksum = "113b30b4cd05f7c06868fdb2854f66a7b9fece9a48425351cd532e810d74024f"
|
|
1161
1161
|
|
|
1162
1162
|
[[package]]
|
|
1163
1163
|
name = "lru-slab"
|
|
@@ -1700,7 +1700,7 @@ dependencies = [
|
|
|
1700
1700
|
|
|
1701
1701
|
[[package]]
|
|
1702
1702
|
name = "quicknode-sdk"
|
|
1703
|
-
version = "0.2.
|
|
1703
|
+
version = "0.2.1"
|
|
1704
1704
|
dependencies = [
|
|
1705
1705
|
"bon",
|
|
1706
1706
|
"config",
|
|
@@ -2029,9 +2029,9 @@ dependencies = [
|
|
|
2029
2029
|
|
|
2030
2030
|
[[package]]
|
|
2031
2031
|
name = "rustls-native-certs"
|
|
2032
|
-
version = "0.8.
|
|
2032
|
+
version = "0.8.4"
|
|
2033
2033
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2034
|
-
checksum = "
|
|
2034
|
+
checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d"
|
|
2035
2035
|
dependencies = [
|
|
2036
2036
|
"openssl-probe",
|
|
2037
2037
|
"rustls-pki-types",
|
|
@@ -2177,7 +2177,7 @@ dependencies = [
|
|
|
2177
2177
|
|
|
2178
2178
|
[[package]]
|
|
2179
2179
|
name = "sdk-node"
|
|
2180
|
-
version = "0.2.
|
|
2180
|
+
version = "0.2.1"
|
|
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.2.
|
|
2192
|
+
version = "0.2.1"
|
|
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.2.
|
|
2203
|
+
version = "0.2.1"
|
|
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.2.
|
|
2211
|
+
version = "0.2.1"
|
|
2212
2212
|
dependencies = [
|
|
2213
2213
|
"magnus",
|
|
2214
2214
|
"quicknode-sdk",
|
|
@@ -2819,9 +2819,9 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
|
2819
2819
|
|
|
2820
2820
|
[[package]]
|
|
2821
2821
|
name = "unicode-segmentation"
|
|
2822
|
-
version = "1.13.
|
|
2822
|
+
version = "1.13.3"
|
|
2823
2823
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2824
|
-
checksum = "
|
|
2824
|
+
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
|
|
2825
2825
|
|
|
2826
2826
|
[[package]]
|
|
2827
2827
|
name = "unicode-width"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quicknode-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Classifier: Intended Audience :: Developers
|
|
5
5
|
Classifier: License :: OSI Approved :: MIT License
|
|
6
6
|
Classifier: Operating System :: POSIX :: Linux
|
|
@@ -1276,20 +1276,20 @@ Accessed as `qn.webhooks`. Creates webhooks from filter templates and manages th
|
|
|
1276
1276
|
| `HyperliquidWalletEventsFilter` | `hyperliquidWalletEventsFilter` |
|
|
1277
1277
|
| `StellarWalletTransactionsSourceAccountFilter` | `stellarWalletTransactionsSourceAccountFilter` |
|
|
1278
1278
|
|
|
1279
|
-
`TemplateArgs` carries the arguments
|
|
1279
|
+
`TemplateArgs` carries the arguments. Each template supports two input forms — inline values (`*Args(*Template(...))`) or a reference to a pre-created list by name (`*ByListArgs(*ByListTemplate(...))`):
|
|
1280
1280
|
|
|
1281
|
-
|
|
|
1281
|
+
| Template | Inline class (fields) | ByList class (fields) |
|
|
1282
1282
|
|---|---|---|
|
|
1283
|
-
|
|
|
1284
|
-
|
|
|
1285
|
-
|
|
|
1286
|
-
|
|
|
1287
|
-
|
|
|
1288
|
-
|
|
|
1289
|
-
|
|
|
1290
|
-
|
|
|
1283
|
+
| EVM wallet filter | `EvmWalletFilterArgs(EvmWalletFilterTemplate(wallets=[...]))` | `EvmWalletFilterByListArgs(EvmWalletFilterByListTemplate(wallets_list_name=...))` |
|
|
1284
|
+
| EVM contract events | `EvmContractEventsArgs(EvmContractEventsTemplate(contracts=[...], event_hashes=[...]))` | `EvmContractEventsByListArgs(EvmContractEventsByListTemplate(contracts_list_name=..., event_hashes_list_name=...))` |
|
|
1285
|
+
| EVM ABI filter | `EvmAbiFilterArgs(EvmAbiFilterTemplate(abi="...", contracts=[...]))` | `EvmAbiFilterByListArgs(EvmAbiFilterByListTemplate(abi_json="...", contracts_list_name=...))` |
|
|
1286
|
+
| Solana wallet filter | `SolanaWalletFilterArgs(SolanaWalletFilterTemplate(accounts=[...]))` | `SolanaWalletFilterByListArgs(SolanaWalletFilterByListTemplate(accounts_list_name=...))` |
|
|
1287
|
+
| Bitcoin wallet filter | `BitcoinWalletFilterArgs(BitcoinWalletFilterTemplate(wallets=[...]))` | `BitcoinWalletFilterByListArgs(BitcoinWalletFilterByListTemplate(wallets_list_name=...))` |
|
|
1288
|
+
| XRPL wallet filter | `XrplWalletFilterArgs(XrplWalletFilterTemplate(wallets=[...]))` | `XrplWalletFilterByListArgs(XrplWalletFilterByListTemplate(wallets_list_name=...))` |
|
|
1289
|
+
| Hyperliquid wallet events | `HyperliquidWalletEventsFilterArgs(HyperliquidWalletEventsFilterTemplate(wallets=[...]))` | `HyperliquidWalletEventsFilterByListArgs(HyperliquidWalletEventsFilterByListTemplate(wallets_list_name=...))` |
|
|
1290
|
+
| Stellar wallet transactions | `StellarWalletTransactionsFilterArgs(StellarWalletTransactionsFilterTemplate(wallets=[...]))` | `StellarWalletTransactionsFilterByListArgs(StellarWalletTransactionsFilterByListTemplate(wallets_list_name=...))` |
|
|
1291
1291
|
|
|
1292
|
-
`WebhookDestinationAttributes`: `url` (required), `
|
|
1292
|
+
`WebhookDestinationAttributes`: `url` (required), `compression` (required — `"none"` | `"gzip"`), `security_token` (optional — auto-generated if omitted).
|
|
1293
1293
|
|
|
1294
1294
|
`WebhookStartFrom`: `Last` (resume from last delivered block) or `Latest` (start from newest).
|
|
1295
1295
|
|
|
@@ -1338,7 +1338,10 @@ from quicknode_sdk import EvmWalletFilterArgs, EvmWalletFilterTemplate, WebhookD
|
|
|
1338
1338
|
webhook = await qn.webhooks.create_webhook_from_template(
|
|
1339
1339
|
name="Wallet Webhook",
|
|
1340
1340
|
network="ethereum-mainnet",
|
|
1341
|
-
destination_attributes=WebhookDestinationAttributes(
|
|
1341
|
+
destination_attributes=WebhookDestinationAttributes(
|
|
1342
|
+
url="https://webhook.site/...",
|
|
1343
|
+
compression="none",
|
|
1344
|
+
),
|
|
1342
1345
|
template_args=EvmWalletFilterArgs(
|
|
1343
1346
|
EvmWalletFilterTemplate(wallets=["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"])
|
|
1344
1347
|
),
|
|
@@ -1309,20 +1309,20 @@ Accessed as `qn.webhooks`. Creates webhooks from filter templates and manages th
|
|
|
1309
1309
|
| `HyperliquidWalletEventsFilter` | `hyperliquidWalletEventsFilter` |
|
|
1310
1310
|
| `StellarWalletTransactionsSourceAccountFilter` | `stellarWalletTransactionsSourceAccountFilter` |
|
|
1311
1311
|
|
|
1312
|
-
`TemplateArgs` carries the arguments
|
|
1312
|
+
`TemplateArgs` carries the arguments. Each template supports two input forms — inline values or a reference to a pre-created list by name. Construct one per template via the variant + the appropriate input enum (`<Template>Input::Inline | ByList`):
|
|
1313
1313
|
|
|
1314
|
-
|
|
|
1314
|
+
| Variant | Inline struct (fields) | ByList struct (fields) |
|
|
1315
1315
|
|---|---|---|
|
|
1316
|
-
| `
|
|
1317
|
-
| `
|
|
1318
|
-
| `
|
|
1319
|
-
| `
|
|
1320
|
-
| `
|
|
1321
|
-
| `
|
|
1322
|
-
| `
|
|
1323
|
-
| `
|
|
1316
|
+
| `EvmWalletFilter` | `EvmWalletFilterTemplate { wallets: string[] }` | `EvmWalletFilterByListTemplate { wallets_list_name: string }` |
|
|
1317
|
+
| `EvmContractEvents` | `EvmContractEventsTemplate { contracts: string[], event_hashes: string[] }` | `EvmContractEventsByListTemplate { contracts_list_name: string, event_hashes_list_name?: string }` |
|
|
1318
|
+
| `EvmAbiFilter` | `EvmAbiFilterTemplate { abi: string, contracts: string[] }` | `EvmAbiFilterByListTemplate { abi_json: string, contracts_list_name?: string }` |
|
|
1319
|
+
| `SolanaWalletFilter` | `SolanaWalletFilterTemplate { accounts: string[] }` | `SolanaWalletFilterByListTemplate { accounts_list_name: string }` |
|
|
1320
|
+
| `BitcoinWalletFilter` | `BitcoinWalletFilterTemplate { wallets: string[] }` | `BitcoinWalletFilterByListTemplate { wallets_list_name: string }` |
|
|
1321
|
+
| `XrplWalletFilter` | `XrplWalletFilterTemplate { wallets: string[] }` | `XrplWalletFilterByListTemplate { wallets_list_name: string }` |
|
|
1322
|
+
| `HyperliquidWalletEventsFilter` | `HyperliquidWalletEventsFilterTemplate { wallets: string[] }` | `HyperliquidWalletEventsFilterByListTemplate { wallets_list_name: string }` |
|
|
1323
|
+
| `StellarWalletTransactionsSourceAccountFilter` | `StellarWalletTransactionsFilterTemplate { wallets: string[] }` | `StellarWalletTransactionsFilterByListTemplate { wallets_list_name: string }` |
|
|
1324
1324
|
|
|
1325
|
-
`WebhookDestinationAttributes`: `url` (required), `
|
|
1325
|
+
`WebhookDestinationAttributes`: `url` (required), `compression` (required — `"none"` | `"gzip"`), `security_token` (optional — auto-generated if omitted).
|
|
1326
1326
|
|
|
1327
1327
|
`WebhookStartFrom`: `Last` (resume from last delivered block) or `Latest` (start from newest).
|
|
1328
1328
|
|
|
@@ -1376,7 +1376,7 @@ let params = CreateWebhookFromTemplateParams {
|
|
|
1376
1376
|
destination_attributes: WebhookDestinationAttributes {
|
|
1377
1377
|
url: "https://webhook.site/...".to_string(),
|
|
1378
1378
|
security_token: None,
|
|
1379
|
-
compression:
|
|
1379
|
+
compression: "none".to_string(),
|
|
1380
1380
|
},
|
|
1381
1381
|
template_args,
|
|
1382
1382
|
};
|
|
@@ -2,9 +2,9 @@ use std::{thread, time::Duration};
|
|
|
2
2
|
|
|
3
3
|
use quicknode_sdk::{
|
|
4
4
|
webhooks::{
|
|
5
|
-
ActivateWebhookParams, CreateWebhookFromTemplateParams,
|
|
6
|
-
GetWebhooksParams, TemplateArgs, UpdateWebhookParams,
|
|
7
|
-
WebhookStartFrom,
|
|
5
|
+
ActivateWebhookParams, CreateWebhookFromTemplateParams, EvmContractEventsTemplate,
|
|
6
|
+
EvmWalletFilterTemplate, GetWebhooksParams, TemplateArgs, UpdateWebhookParams,
|
|
7
|
+
WebhookDestinationAttributes, WebhookStartFrom,
|
|
8
8
|
},
|
|
9
9
|
QuicknodeSdk, SdkFullConfig,
|
|
10
10
|
};
|
|
@@ -44,7 +44,7 @@ async fn main() {
|
|
|
44
44
|
destination_attributes: WebhookDestinationAttributes {
|
|
45
45
|
url: "https://webhook.site/ae19071a-2dcc-4035-9cdf-406dcb4719ef".to_string(),
|
|
46
46
|
security_token: None,
|
|
47
|
-
compression:
|
|
47
|
+
compression: "none".to_string(),
|
|
48
48
|
},
|
|
49
49
|
template_args,
|
|
50
50
|
};
|
|
@@ -98,6 +98,42 @@ async fn main() {
|
|
|
98
98
|
println!("deleted: {id}");
|
|
99
99
|
thread::sleep(Duration::from_secs(1));
|
|
100
100
|
|
|
101
|
+
// Exercise the evm-contract-events template, which carries the multi-word
|
|
102
|
+
// `event_hashes` field. The API expects `eventHashes` on the wire.
|
|
103
|
+
let contract_events_args = TemplateArgs::EvmContractEvents(EvmContractEventsTemplate {
|
|
104
|
+
contracts: vec!["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48".to_string()],
|
|
105
|
+
event_hashes: vec![
|
|
106
|
+
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef".to_string(),
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
let contract_events_params = CreateWebhookFromTemplateParams {
|
|
110
|
+
name: "E2E Test Webhook (evmContractEvents)".to_string(),
|
|
111
|
+
network: "ethereum-mainnet".to_string(),
|
|
112
|
+
notification_email: None,
|
|
113
|
+
destination_attributes: WebhookDestinationAttributes {
|
|
114
|
+
url: "https://webhook.site/ae19071a-2dcc-4035-9cdf-406dcb4719ef".to_string(),
|
|
115
|
+
security_token: None,
|
|
116
|
+
compression: "none".to_string(),
|
|
117
|
+
},
|
|
118
|
+
template_args: contract_events_args,
|
|
119
|
+
};
|
|
120
|
+
let ce_webhook = qn
|
|
121
|
+
.webhooks
|
|
122
|
+
.create_webhook_from_template(&contract_events_params)
|
|
123
|
+
.await
|
|
124
|
+
.expect("create_webhook_from_template (evmContractEvents) failed");
|
|
125
|
+
println!(
|
|
126
|
+
"created (evmContractEvents): {} | {}",
|
|
127
|
+
ce_webhook.id, ce_webhook.status
|
|
128
|
+
);
|
|
129
|
+
thread::sleep(Duration::from_secs(1));
|
|
130
|
+
qn.webhooks
|
|
131
|
+
.delete_webhook(&ce_webhook.id)
|
|
132
|
+
.await
|
|
133
|
+
.expect("delete_webhook (evmContractEvents) failed");
|
|
134
|
+
println!("deleted (evmContractEvents): {}", ce_webhook.id);
|
|
135
|
+
thread::sleep(Duration::from_secs(1));
|
|
136
|
+
|
|
101
137
|
let after = qn
|
|
102
138
|
.webhooks
|
|
103
139
|
.list_webhooks(&GetWebhooksParams::default())
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
pub mod webhook;
|
|
2
2
|
|
|
3
3
|
pub use webhook::{
|
|
4
|
-
ActivateWebhookParams,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
ActivateWebhookParams, BitcoinWalletFilterByListTemplate, BitcoinWalletFilterInput,
|
|
5
|
+
BitcoinWalletFilterTemplate, CreateWebhookFromTemplateParams, EvmAbiFilterByListTemplate,
|
|
6
|
+
EvmAbiFilterInput, EvmAbiFilterTemplate, EvmContractEventsByListTemplate,
|
|
7
|
+
EvmContractEventsInput, EvmContractEventsTemplate, EvmWalletFilterByListTemplate,
|
|
8
|
+
EvmWalletFilterInput, EvmWalletFilterTemplate, GetWebhooksParams,
|
|
9
|
+
HyperliquidWalletEventsFilterByListTemplate, HyperliquidWalletEventsFilterInput,
|
|
10
|
+
HyperliquidWalletEventsFilterTemplate, ListWebhooksResponse, SolanaWalletFilterByListTemplate,
|
|
11
|
+
SolanaWalletFilterInput, SolanaWalletFilterTemplate,
|
|
12
|
+
StellarWalletTransactionsFilterByListTemplate, StellarWalletTransactionsFilterInput,
|
|
7
13
|
StellarWalletTransactionsFilterTemplate, TemplateArgs, UpdateWebhookParams,
|
|
8
14
|
UpdateWebhookTemplateParams, Webhook, WebhookDestinationAttributes,
|
|
9
15
|
WebhookEnabledCountResponse, WebhookPageInfo, WebhookStartFrom, WebhookTemplateId,
|
|
10
|
-
XrplWalletFilterTemplate,
|
|
16
|
+
XrplWalletFilterByListTemplate, XrplWalletFilterInput, XrplWalletFilterTemplate,
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
use crate::{config::WebhooksConfig, errors::SdkError, SdkConfig};
|
|
@@ -255,8 +261,8 @@ impl WebhooksApiClient {
|
|
|
255
261
|
|
|
256
262
|
/// Creates a new webhook from a predefined filter template. Requires a
|
|
257
263
|
/// descriptive name, a target blockchain network, and destination
|
|
258
|
-
/// attributes (URL,
|
|
259
|
-
///
|
|
264
|
+
/// attributes (URL, compression — `gzip` or `none`, and an optional
|
|
265
|
+
/// security token — auto-generated when omitted). `template_args` carries
|
|
260
266
|
/// template-specific configuration such as wallet addresses or contract
|
|
261
267
|
/// filters. An optional `notification_email` receives alerts if the
|
|
262
268
|
/// webhook terminates.
|
|
@@ -633,9 +639,10 @@ mod tests {
|
|
|
633
639
|
.mount(&server)
|
|
634
640
|
.await;
|
|
635
641
|
let sdk = make_sdk(format!("{}/", server.uri()));
|
|
636
|
-
let template_args =
|
|
637
|
-
|
|
638
|
-
|
|
642
|
+
let template_args =
|
|
643
|
+
TemplateArgs::EvmWalletFilter(EvmWalletFilterInput::Inline(EvmWalletFilterTemplate {
|
|
644
|
+
wallets: vec!["0xabc".to_string()],
|
|
645
|
+
}));
|
|
639
646
|
let params = CreateWebhookFromTemplateParams {
|
|
640
647
|
name: "test-webhook".to_string(),
|
|
641
648
|
network: "ethereum-mainnet".to_string(),
|
|
@@ -643,7 +650,7 @@ mod tests {
|
|
|
643
650
|
destination_attributes: WebhookDestinationAttributes {
|
|
644
651
|
url: "https://example.com/hook".to_string(),
|
|
645
652
|
security_token: None,
|
|
646
|
-
compression:
|
|
653
|
+
compression: "none".to_string(),
|
|
647
654
|
},
|
|
648
655
|
template_args,
|
|
649
656
|
};
|
|
@@ -664,9 +671,10 @@ mod tests {
|
|
|
664
671
|
.mount(&server)
|
|
665
672
|
.await;
|
|
666
673
|
let sdk = make_sdk(format!("{}/", server.uri()));
|
|
667
|
-
let template_args =
|
|
668
|
-
|
|
669
|
-
|
|
674
|
+
let template_args =
|
|
675
|
+
TemplateArgs::EvmWalletFilter(EvmWalletFilterInput::Inline(EvmWalletFilterTemplate {
|
|
676
|
+
wallets: vec!["0xabc".to_string()],
|
|
677
|
+
}));
|
|
670
678
|
let params = CreateWebhookFromTemplateParams {
|
|
671
679
|
name: "test-webhook".to_string(),
|
|
672
680
|
network: "ethereum-mainnet".to_string(),
|
|
@@ -674,7 +682,7 @@ mod tests {
|
|
|
674
682
|
destination_attributes: WebhookDestinationAttributes {
|
|
675
683
|
url: "https://example.com/hook".to_string(),
|
|
676
684
|
security_token: None,
|
|
677
|
-
compression:
|
|
685
|
+
compression: "none".to_string(),
|
|
678
686
|
},
|
|
679
687
|
template_args,
|
|
680
688
|
};
|
|
@@ -695,9 +703,10 @@ mod tests {
|
|
|
695
703
|
.mount(&server)
|
|
696
704
|
.await;
|
|
697
705
|
let sdk = make_sdk(format!("{}/", server.uri()));
|
|
698
|
-
let template_args =
|
|
699
|
-
|
|
700
|
-
|
|
706
|
+
let template_args =
|
|
707
|
+
TemplateArgs::EvmWalletFilter(EvmWalletFilterInput::Inline(EvmWalletFilterTemplate {
|
|
708
|
+
wallets: vec!["0xabc".to_string()],
|
|
709
|
+
}));
|
|
701
710
|
let params = UpdateWebhookTemplateParams {
|
|
702
711
|
name: None,
|
|
703
712
|
notification_email: None,
|
|
@@ -725,9 +734,10 @@ mod tests {
|
|
|
725
734
|
.mount(&server)
|
|
726
735
|
.await;
|
|
727
736
|
let sdk = make_sdk(format!("{}/", server.uri()));
|
|
728
|
-
let template_args =
|
|
729
|
-
|
|
730
|
-
|
|
737
|
+
let template_args =
|
|
738
|
+
TemplateArgs::EvmWalletFilter(EvmWalletFilterInput::Inline(EvmWalletFilterTemplate {
|
|
739
|
+
wallets: vec!["0xabc".to_string()],
|
|
740
|
+
}));
|
|
731
741
|
let params = UpdateWebhookTemplateParams {
|
|
732
742
|
name: Some("new-name".to_string()),
|
|
733
743
|
notification_email: None,
|
|
@@ -758,10 +768,12 @@ mod tests {
|
|
|
758
768
|
.mount(&server)
|
|
759
769
|
.await;
|
|
760
770
|
let sdk = make_sdk(format!("{}/", server.uri()));
|
|
761
|
-
let template_args = TemplateArgs::EvmContractEvents(
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
771
|
+
let template_args = TemplateArgs::EvmContractEvents(EvmContractEventsInput::Inline(
|
|
772
|
+
EvmContractEventsTemplate {
|
|
773
|
+
contracts: vec!["0xa0b8".to_string()],
|
|
774
|
+
event_hashes: vec!["0xabcd".to_string()],
|
|
775
|
+
},
|
|
776
|
+
));
|
|
765
777
|
let params = CreateWebhookFromTemplateParams {
|
|
766
778
|
name: "test-webhook".to_string(),
|
|
767
779
|
network: "ethereum-mainnet".to_string(),
|
|
@@ -769,7 +781,7 @@ mod tests {
|
|
|
769
781
|
destination_attributes: WebhookDestinationAttributes {
|
|
770
782
|
url: "https://example.com/hook".to_string(),
|
|
771
783
|
security_token: None,
|
|
772
|
-
compression:
|
|
784
|
+
compression: "none".to_string(),
|
|
773
785
|
},
|
|
774
786
|
template_args,
|
|
775
787
|
};
|
|
@@ -788,9 +800,10 @@ mod tests {
|
|
|
788
800
|
.mount(&server)
|
|
789
801
|
.await;
|
|
790
802
|
let sdk = make_sdk(format!("{}/", server.uri()));
|
|
791
|
-
let template_args =
|
|
792
|
-
|
|
793
|
-
|
|
803
|
+
let template_args =
|
|
804
|
+
TemplateArgs::EvmWalletFilter(EvmWalletFilterInput::Inline(EvmWalletFilterTemplate {
|
|
805
|
+
wallets: vec!["0xabc".to_string()],
|
|
806
|
+
}));
|
|
794
807
|
let params = UpdateWebhookTemplateParams {
|
|
795
808
|
name: None,
|
|
796
809
|
notification_email: None,
|