You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sdk/indexer.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ All indexer endpoints are available under the `/v1/` prefix. The legacy unprefix
8
8
9
9
Responses use a standard envelope: `{ data: [...], meta: { total, limit, offset } }`. The SDK handles this transparently — callers receive plain `Vec<Market>`, `Vec<IndexerOrder>`, etc. with no change to existing code.
10
10
11
+
For wallet position endpoints, the SDK also normalizes known schema drift across legacy and v1 payloads. Filled and redeemable entries preserve the raw JSON but expose stable accessors like `factory_market_id()`, `orderbook_market_id()`, `redeemable()`, `resolved()`, and `lots_hint()`.
12
+
11
13
## Canonical OpenAPI Reference
12
14
13
15
The generated OpenAPI spec is the source of truth for the public indexer API:
@@ -143,6 +145,60 @@ The v1 response from `/v1/positions/:address` is paginated:
143
145
144
146
The SDK handles both the v1 paginated and legacy flat-array formats automatically — `get_open_orders` always returns `Vec<IndexerOrder>`.
145
147
148
+
## Get Wallet Positions
149
+
150
+
Fetch the full wallet snapshot from `/positions/:address`:
This is the right discovery path before calling on-chain redemption. The SDK normalizes both paginated and legacy redeemable payloads, including nested and casing-drifted field names.
Copy file name to clipboardExpand all lines: docs/sdk/overview.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The Strike SDK is a Rust crate for programmatic trading on Strike prediction mar
4
4
5
5
## Design Philosophy
6
6
7
-
The SDK is **on-chain first**. All trading operations go directly to BNB Chain via RPC. Live data (events, balances, market state) comes from a WSS subscription or RPC reads. The [indexer](indexer.md) is available for startup snapshots (fetching all markets, orderbook state), but is never in the critical trading path.
7
+
The SDK is **on-chain first**. All trading operations go directly to BNB Chain via RPC. Live data (events, balances, market state) comes from a WSS subscription or RPC reads. The [indexer](indexer.md) is available for startup snapshots (fetching all markets, orderbook state, wallet positions, redeem backlog), but is never in the critical trading path.
8
8
9
9
## Features
10
10
@@ -13,9 +13,12 @@ The SDK is **on-chain first**. All trading operations go directly to BNB Chain v
13
13
| Order management | Place, cancel, and replace orders in batch transactions |
14
14
| Event streaming | Real-time WSS subscriptions with auto-reconnect |
| Indexer client | REST client for market snapshots and orderbook state |
16
+
| On-chain market reads | Market counts/IDs plus `market_meta(factory_market_id)` for factory-to-orderbook metadata |
17
+
| Indexer client | REST client for market snapshots, wallet positions, redeem backlog, and orderbook state |
17
18
| Nonce manager | Optional `nonce-manager` feature flag for bots sending rapid transactions |
18
19
20
+
Wallet position helpers normalize known schema drift in filled-position and redeemable payloads, so integrations can use stable accessors instead of decoding multiple indexer variants themselves.
21
+
19
22
## Preset Configs
20
23
21
24
Use `StrikeConfig::bsc_mainnet()` for BSC mainnet with default RPC, WSS, and indexer endpoints. See [Client Configuration](client.md) for custom setups.
The SDK normalizes evolving `/positions/:address` and `/positions/:address/redeemable` payloads into accessor-based position types, so callers do not need to chase field-name drift across indexer versions.
227
+
190
228
## AI Markets
191
229
192
230
Markets with `is_ai_market: true` are resolved by the Flap AI Oracle instead of Pyth price feeds. The `Market` struct includes:
0 commit comments