@proof-labs/trading-sdk 12.0.0 → 13.0.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.
- package/README.md +159 -21
- package/dist/authorized-agents.d.ts +21 -0
- package/dist/authorized-agents.d.ts.map +1 -0
- package/dist/authorized-agents.js +39 -0
- package/dist/authorized-agents.js.map +1 -0
- package/dist/client.d.ts +15 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +49 -28
- package/dist/client.js.map +1 -1
- package/dist/codec-adapter.d.ts +10 -6
- package/dist/codec-adapter.d.ts.map +1 -1
- package/dist/codec-adapter.js +15 -3
- package/dist/codec-adapter.js.map +1 -1
- package/dist/codec.d.ts +13 -4
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +50 -6
- package/dist/codec.js.map +1 -1
- package/dist/errors.d.ts +4 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -14
- package/dist/errors.js.map +1 -1
- package/dist/gateway-reads.d.ts +6 -2
- package/dist/gateway-reads.d.ts.map +1 -1
- package/dist/gateway-reads.js +5 -0
- package/dist/gateway-reads.js.map +1 -1
- package/dist/governance-query.d.ts +3 -3
- package/dist/governance-query.d.ts.map +1 -1
- package/dist/governance-query.js +1 -0
- package/dist/governance-query.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/insurance-fund-history.d.ts +46 -0
- package/dist/insurance-fund-history.d.ts.map +1 -0
- package/dist/insurance-fund-history.js +169 -0
- package/dist/insurance-fund-history.js.map +1 -0
- package/dist/insurance-funds.d.ts +58 -0
- package/dist/insurance-funds.d.ts.map +1 -0
- package/dist/insurance-funds.js +151 -0
- package/dist/insurance-funds.js.map +1 -0
- package/dist/liquidation-events.d.ts +5 -3
- package/dist/liquidation-events.d.ts.map +1 -1
- package/dist/liquidation-events.js +10 -3
- package/dist/liquidation-events.js.map +1 -1
- package/dist/resolution-balance-events.d.ts +28 -0
- package/dist/resolution-balance-events.d.ts.map +1 -0
- package/dist/resolution-balance-events.js +25 -0
- package/dist/resolution-balance-events.js.map +1 -0
- package/dist/triggers.d.ts +12 -6
- package/dist/triggers.d.ts.map +1 -1
- package/dist/triggers.js +12 -55
- package/dist/triggers.js.map +1 -1
- package/dist/typed-gateway-reads.d.ts +5 -0
- package/dist/typed-gateway-reads.d.ts.map +1 -1
- package/dist/typed-gateway-reads.js +11 -0
- package/dist/typed-gateway-reads.js.map +1 -1
- package/dist/types.d.ts +112 -35
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wasm/proof_trading_sdk_wasm.d.ts +32 -1
- package/dist/wasm/proof_trading_sdk_wasm.js +51 -2
- package/dist/wasm/proof_trading_sdk_wasm_bg.wasm +0 -0
- package/dist/wasm/proof_trading_sdk_wasm_bg.wasm.d.ts +2 -0
- package/dist/wasm-loader.d.ts +7 -0
- package/dist/wasm-loader.d.ts.map +1 -1
- package/dist/wasm-loader.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,17 +90,15 @@ Each address receives ~10,000 USDC (10,000,000,000 µUSDC) with a 24 h cooldown.
|
|
|
90
90
|
|
|
91
91
|
## Quick Start
|
|
92
92
|
|
|
93
|
+
Use the key you funded above, or as a competition participant the key from
|
|
94
|
+
[PAPER-TRADING.md](PAPER-TRADING.md): a fresh key has no balance, and every
|
|
95
|
+
order from it is refused with `InsufficientBalance` (11).
|
|
96
|
+
|
|
93
97
|
```typescript
|
|
94
|
-
import {
|
|
95
|
-
ExchangeClient,
|
|
96
|
-
Side,
|
|
97
|
-
generateKeypair,
|
|
98
|
-
pubkeyToOwner,
|
|
99
|
-
ownerToHex,
|
|
100
|
-
} from "@proof-labs/trading-sdk";
|
|
98
|
+
import { ExchangeClient, Side } from "@proof-labs/trading-sdk";
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
// Continues "Connect to the devnet": `address` and `privateKey` are the
|
|
101
|
+
// funded key's.
|
|
104
102
|
const addressHex = ownerToHex(address);
|
|
105
103
|
|
|
106
104
|
const client = new ExchangeClient({
|
|
@@ -124,9 +122,44 @@ const result = await client.submitTx({
|
|
|
124
122
|
},
|
|
125
123
|
});
|
|
126
124
|
|
|
127
|
-
|
|
125
|
+
if (result.ok) {
|
|
126
|
+
console.log(`placed in ${result.hash}`);
|
|
127
|
+
} else {
|
|
128
|
+
// outcome: "engine" (refused, `code`/`error` say why), "transport", ...
|
|
129
|
+
console.log(result.outcome, result.code, result.error?.name ?? result.log);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Withdraw
|
|
134
|
+
|
|
135
|
+
A withdrawal is requested on chain, then paid out on Solana by the bridge.
|
|
136
|
+
The request's `withdraw_requested` event carries the id to follow:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const req = await client.submitTxCommit({
|
|
140
|
+
type: "WithdrawRequest",
|
|
141
|
+
data: {
|
|
142
|
+
owner: address,
|
|
143
|
+
amount: 100_000_000n, // $100
|
|
144
|
+
solanaDestination, // 32-byte Solana wallet public key
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
const idText = req.events
|
|
148
|
+
?.find((e) => e.type === "withdraw_requested")
|
|
149
|
+
?.attributes.find((a) => a.key === "withdrawal_id")?.value;
|
|
150
|
+
if (!req.ok || idText === undefined)
|
|
151
|
+
throw new Error(`not requested: ${req.log}`);
|
|
152
|
+
const id = BigInt(idText);
|
|
153
|
+
|
|
154
|
+
// "Pending" until the payout lands, then "Completed" (or "Failed", refunded).
|
|
155
|
+
const record = await client.queryWithdrawal(id);
|
|
156
|
+
console.log(record?.status);
|
|
128
157
|
```
|
|
129
158
|
|
|
159
|
+
Only an account's own key withdraws. A master trades for its sub-accounts but
|
|
160
|
+
cannot withdraw from them (refused with code 20): move the funds to the master
|
|
161
|
+
with `SubAccountTransfer`, then withdraw from the master.
|
|
162
|
+
|
|
130
163
|
> Reads decode MessagePack through the same WASM core as signing (a strict,
|
|
131
164
|
> type-preserving preflight runs before the value decode), so even a read-only
|
|
132
165
|
> client loads the WASM module on its first read. `await client.ready()`
|
|
@@ -185,14 +218,14 @@ class ExchangeClient {
|
|
|
185
218
|
queryOpenOrders(addressHex?: string): Promise<OpenOrder[]>;
|
|
186
219
|
queryOrderStatus(orderId: bigint): Promise<OpenOrder | null>;
|
|
187
220
|
queryMarkets(): Promise<MarketConfig[]>;
|
|
188
|
-
queryMarketListing(): Promise<MarketListing>; // markets
|
|
221
|
+
queryMarketListing(): Promise<MarketListing>; // markets row by row: field counts and refused rows
|
|
222
|
+
queryEventListing(): Promise<EventListing>; // events row by row, with refused rows
|
|
189
223
|
queryMarketsSnapshot(): Promise<MarketsSnapshot>;
|
|
190
224
|
queryAccount(addressHex?: string): Promise<AccountInfo | null>;
|
|
191
225
|
queryHealth(): Promise<{ status: string; height: number }>;
|
|
192
226
|
queryOraclePermissions(market: number): Promise<OraclePermissions>;
|
|
193
227
|
queryWithdrawal(id: bigint): Promise<WithdrawalRecord | null>;
|
|
194
228
|
queryPositionTriggers(addressHex?: string): Promise<PositionTriggerInfo[]>;
|
|
195
|
-
queryTriggerMarketConfigs(): Promise<TriggerMarketConfigInfo[]>;
|
|
196
229
|
// Deprecated: GET /v1/triggers/status is deleted upstream; see below.
|
|
197
230
|
queryTriggerStatus(): Promise<TriggerStatus>;
|
|
198
231
|
queryPositionTriggerHistory(addressHex?: string, filters?: PositionTriggerHistoryFilters): Promise<PositionTriggerHistoryPage>;
|
|
@@ -328,6 +361,32 @@ mirror and throws `BinaryPriceError` before anything is sent. `yesOrder`,
|
|
|
328
361
|
reads a short Yes position as No at `$1 − entry`. All of it is pinned against
|
|
329
362
|
the Rust core by `conformance/binary.ndjson`.
|
|
330
363
|
|
|
364
|
+
### How event positions are valued and booked
|
|
365
|
+
|
|
366
|
+
Read this before setting risk limits or reconciling cash on an account that
|
|
367
|
+
holds event positions.
|
|
368
|
+
|
|
369
|
+
- **Equity is per outcome.** Each event the account holds is a Yes/No branch,
|
|
370
|
+
and margin must hold in every combination. `equity`, `totalMm` and `totalIm`
|
|
371
|
+
come from the binding outcome (lowest equity to maintenance), named in
|
|
372
|
+
`bindingScenario`. When the binding outcome changes, equity can step with no
|
|
373
|
+
trade.
|
|
374
|
+
- **Conditional marks** are the book's impact mid, the median of the last
|
|
375
|
+
three end-of-block samples. A book too thin or too wide to sample holds its
|
|
376
|
+
mark and only lets takers reduce until three samples stand again.
|
|
377
|
+
- **Binary positions count in equity, not cash.** A buy moves `balance` by the
|
|
378
|
+
fee only; the payoff or maximum loss sits in each outcome's equity. At
|
|
379
|
+
resolution the payoff is booked to cash (`prediction_settled`).
|
|
380
|
+
- **Closing a conditional pays no cash.** The realized P&L is issued as a
|
|
381
|
+
position on the event's binary book, which you hold to resolution or sell. A
|
|
382
|
+
close can leave a small binary position.
|
|
383
|
+
- **At resolution** the branch that fires converts into the underlying perp at
|
|
384
|
+
the settlement price (`condition_met`) and the other is removed
|
|
385
|
+
(`condition_not_met`). Both name each position's branch, not the outcome.
|
|
386
|
+
|
|
387
|
+
Fills alone don't reconcile an event account: read its positions and balance
|
|
388
|
+
from the account, not by summing fills.
|
|
389
|
+
|
|
331
390
|
### Oracle freshness for trading UIs
|
|
332
391
|
|
|
333
392
|
```typescript
|
|
@@ -351,6 +410,28 @@ not trading authorization. Like every other gateway interaction, admin calls
|
|
|
351
410
|
included, it goes through the SDK
|
|
352
411
|
([ADR 0003](docs/adr/0003-every-gateway-interaction-through-the-sdk.md)).
|
|
353
412
|
|
|
413
|
+
### Insurance fund observations
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
const page = await client
|
|
417
|
+
.reads()
|
|
418
|
+
.insuranceFundHistory(
|
|
419
|
+
{ poolId: 2, stream: "balances", limit: 50 },
|
|
420
|
+
{ timeoutMs: 5000 },
|
|
421
|
+
);
|
|
422
|
+
// Pass page.nextCursor unchanged to fetch an older page. "" means no next page.
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Use `stream: "activity"` for funding, withdrawal and takeover event attributes.
|
|
426
|
+
Every request goes through the configured gateway transport, with a bounded
|
|
427
|
+
body and deadline. Values are exact `bigint`s. Balance history is **net cash
|
|
428
|
+
(cash minus debt), not equity or profit**. The coverage bounds name the first
|
|
429
|
+
and last retained observations; they do not prove continuous ingestion, a
|
|
430
|
+
complete lifetime history, or a finalized same-state view. Missing history
|
|
431
|
+
remains an error, and an empty observed page must not be presented as zero
|
|
432
|
+
lifetime activity. This requires the indexer insurance-history projection and
|
|
433
|
+
the gateway history proxy.
|
|
434
|
+
|
|
354
435
|
### Indexed Explorer history
|
|
355
436
|
|
|
356
437
|
```typescript
|
|
@@ -501,15 +582,35 @@ bracket, `queryPositionTriggers()` returns its epoch; first attach must use the
|
|
|
501
582
|
epoch on the canonical account position read and must never guess `1`. Submit
|
|
502
583
|
action `0x25` (`SetPositionTriggers`) or `0x26`
|
|
503
584
|
(`CancelPositionTriggers`). A set replaces the whole bracket atomically,
|
|
504
|
-
requires at least one limb, and each limb carries an explicit
|
|
505
|
-
|
|
585
|
+
requires at least one limb, and each limb carries an explicit IOC collar of
|
|
586
|
+
`1..=ENGINE_TRIGGER_SLIPPAGE_CEILING_BPS` (currently 1000) basis points under
|
|
587
|
+
the engine admission rule; clamp to that constant. The SDK wire validators
|
|
588
|
+
retain the wider `1..=9999` range for compatibility; encoding does not guarantee
|
|
589
|
+
engine admission. Owner defaults to the loaded signer; a version-active trading agent
|
|
506
590
|
passes the delegated owner explicitly and the engine verifies the grant.
|
|
507
591
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
and
|
|
512
|
-
|
|
592
|
+
The legacy `queryTriggerMarketConfigs()` read and `SetTriggerMarketConfig`
|
|
593
|
+
submission API have been removed. Delete policy lookups and enabled checks before
|
|
594
|
+
placing TP/SL; no replacement availability lookup is needed. Use the current
|
|
595
|
+
position epoch and an explicit per-limb IOC collar. The engine validates the
|
|
596
|
+
request; successful placement does not guarantee a fill.
|
|
597
|
+
|
|
598
|
+
Historical retired-action (`SetTriggerMarketConfig`) proposal decoding and
|
|
599
|
+
content hashes remain available; the policy-registry decoders for
|
|
600
|
+
`/v1/triggers/markets` are removed. `DecodedAdminAction`
|
|
601
|
+
and `DecodedAction` include retired actions for inspection. Use the exported
|
|
602
|
+
`isSubmittableAction(decoded.action)` guard before passing a decoded transaction
|
|
603
|
+
to a typed submission API. The guard excludes retired governance actions; it
|
|
604
|
+
does not assert engine admission or signing authority. Low-level encoding and
|
|
605
|
+
signing retain the wire contract; the engine rejects retired proposals and approvals.
|
|
606
|
+
Proposal content hashes remain available for historical verification.
|
|
607
|
+
|
|
608
|
+
Before upgrading, remove retired trigger-policy methods from capability probes
|
|
609
|
+
and read tests. Governance consumers must handle historical
|
|
610
|
+
`SetTriggerMarketConfig` proposals as read-only: retain their detail rendering,
|
|
611
|
+
remove creation and approval paths, and narrow `proposal.action` before assigning
|
|
612
|
+
it to `AdminAction`. The Python removals also require a Python major release;
|
|
613
|
+
update callers of `trigger_market_configs()` and the retired builder together.
|
|
513
614
|
|
|
514
615
|
`queryTriggerStatus()` is deprecated: `GET /v1/triggers/status` is deleted
|
|
515
616
|
upstream (the node dropped it with its activation gates, exchange#619,
|
|
@@ -562,6 +663,9 @@ Ordinary-account support remains deferred in [#360](https://github.com/Proof-lab
|
|
|
562
663
|
integration never needs these.** Each is gated by a dedicated engine allowlist
|
|
563
664
|
or the market's oracle policy, so codec availability grants nothing without an
|
|
564
665
|
operator-provisioned key. See [AGENTS.md](AGENTS.md) → "Operator actions".
|
|
666
|
+
Porting a harness off the retired `OracleUpdate`, `OracleUpdateComposite`,
|
|
667
|
+
`RunFundingTick` or `/testing` surfaces: see the
|
|
668
|
+
[operator harness migration guide](docs/operator-harness-migration.md).
|
|
565
669
|
|
|
566
670
|
#### Governance actions (admin multisig)
|
|
567
671
|
|
|
@@ -657,6 +761,37 @@ long-standing `"<code>: <message>"` format in `error` (so older clients that par
|
|
|
657
761
|
code back out of it keep working), and `log` carries the chain's message verbatim. New
|
|
658
762
|
code should read the structured `code` field: it is authoritative and needs no parsing.
|
|
659
763
|
|
|
764
|
+
### Order of actions within a block
|
|
765
|
+
|
|
766
|
+
Every cancel (`CancelOrder`, `CancelClientOrder`, `CancelAllOrders`) in a
|
|
767
|
+
block runs before every order-placing action (`PlaceOrder`, `MarketOrder`,
|
|
768
|
+
`AmendOrder`, `CancelReplaceOrder`, `AtomicBasketOrder`, `ClosePosition`),
|
|
769
|
+
whatever their `seq`. A cancel sent in the same block as the order it targets
|
|
770
|
+
finds nothing to cancel; send it after the order lands.
|
|
771
|
+
|
|
772
|
+
### Basket slippage
|
|
773
|
+
|
|
774
|
+
`AtomicBasketOrder`'s `maxSlippageBps` bounds the basket's **net** slippage:
|
|
775
|
+
each leg is measured from its own mark just before it fills, adverse slippage
|
|
776
|
+
counts against the budget and price improvement counts for it, weighted by
|
|
777
|
+
notional. A leg that fills better than its mark can't trip the budget, so use
|
|
778
|
+
each leg's limit price to cap how far that leg sweeps.
|
|
779
|
+
|
|
780
|
+
## Rate limits
|
|
781
|
+
|
|
782
|
+
A request must pass two token buckets. Over either, the gateway answers 429
|
|
783
|
+
with `Retry-After` (and `retryAfterMs` in the body); wait that long.
|
|
784
|
+
|
|
785
|
+
| Limit | Applies to | Devnet |
|
|
786
|
+
| ----------- | ---------------------------------------------- | ---------------- |
|
|
787
|
+
| Per IP | every request from one IP, all routes together | 150/s, burst 100 |
|
|
788
|
+
| Per account | signed submissions, keyed on the signing key | 100/s, burst 200 |
|
|
789
|
+
|
|
790
|
+
Orders and cancels draw on separate per-account buckets, so a burst of
|
|
791
|
+
cancels is not slowed by order traffic. An agent key has its own budget,
|
|
792
|
+
separate from its owner's. On a WebSocket, subscribe and unsubscribe messages
|
|
793
|
+
have a per-connection budget of 64/s, burst 256; pushed data is never limited.
|
|
794
|
+
|
|
660
795
|
## WebSocket streams
|
|
661
796
|
|
|
662
797
|
The SDK exposes the gateway's native multiplexed feed on `/ws`. Account
|
|
@@ -665,6 +800,9 @@ events, trades and the orderbook are channels on that one shared connection
|
|
|
665
800
|
auto-reconnects and re-subscribes; every subscription returns an unsubscribe
|
|
666
801
|
function, and `disconnect()` closes the feed.
|
|
667
802
|
|
|
803
|
+
The gateway pings every 30 s and closes a socket that hasn't answered within
|
|
804
|
+
60 s. The SDK clients answer pings automatically.
|
|
805
|
+
|
|
668
806
|
The WS base URL defaults to `gatewayUrl` with its scheme swapped to `ws`/`wss`.
|
|
669
807
|
If your local stack serves WebSockets on a separate port, set `wsUrl`
|
|
670
808
|
explicitly (e.g. `ws://localhost:9091`).
|
|
@@ -724,8 +862,8 @@ the SDK uses the gateway's signed subscription auth: with a private key or
|
|
|
724
862
|
external signer connected it signs the stream-auth message and adds
|
|
725
863
|
`public_key` / `signature` / `timestamp_ms` to the `accountEvents` subscribe
|
|
726
864
|
message automatically, re-signing on every reconnect. Pass `auth: false` for an
|
|
727
|
-
unsigned watch-only subscription
|
|
728
|
-
|
|
865
|
+
unsigned watch-only subscription; devnet refuses an unsigned `accountEvents`
|
|
866
|
+
subscribe with 401.
|
|
729
867
|
|
|
730
868
|
## Wire Format
|
|
731
869
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type BoundedReadOptions, type FinalizedReadWitness } from "./bounded-read.js";
|
|
2
|
+
import { type HexAddress } from "./read-values.js";
|
|
3
|
+
import type { ExchangeHttpTransport } from "./http-transport.js";
|
|
4
|
+
/** Current explicit grants, not owner-key or inherited master authority. */
|
|
5
|
+
export interface FinalizedAuthorizedAgents {
|
|
6
|
+
owner: HexAddress;
|
|
7
|
+
agents: HexAddress[];
|
|
8
|
+
/** False when more than 100 grants exist; never treat that result as exhaustive. */
|
|
9
|
+
complete: boolean;
|
|
10
|
+
witness: FinalizedReadWitness;
|
|
11
|
+
}
|
|
12
|
+
/** Representation returned by the canonical wire decoder's naming adapter. */
|
|
13
|
+
export interface AuthorizedAgentsView {
|
|
14
|
+
owner: string;
|
|
15
|
+
finalizedHeight: bigint;
|
|
16
|
+
agents: string[];
|
|
17
|
+
complete: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function decodeFinalizedAuthorizedAgents(value: unknown, owner: string): FinalizedAuthorizedAgents;
|
|
20
|
+
export declare function readFinalizedAuthorizedAgents(gateway: string, owner: string, options: BoundedReadOptions, transport: ExchangeHttpTransport): Promise<FinalizedAuthorizedAgents>;
|
|
21
|
+
//# sourceMappingURL=authorized-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorized-agents.d.ts","sourceRoot":"","sources":["../src/authorized-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAKjE,4EAA4E;AAC5E,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GACZ,yBAAyB,CAoC3B;AAED,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,qBAAqB,GAC/B,OAAO,CAAC,yBAAyB,CAAC,CAapC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { asReadError, boundedGatewayJson, decodeFinalizedReadWitness, } from "./bounded-read.js";
|
|
2
|
+
import { canonicalBase64, hexAddress, invalidRead, readObject, } from "./read-values.js";
|
|
3
|
+
import { authorizedAgentsFromWasm } from "./codec-adapter.js";
|
|
4
|
+
import { getWasm, ready } from "./wasm-loader.js";
|
|
5
|
+
/** `AUTHORIZED_AGENTS_LIMIT` in proof-wire's `query_v2`. */
|
|
6
|
+
const AUTHORIZED_AGENTS_LIMIT = 100;
|
|
7
|
+
export function decodeFinalizedAuthorizedAgents(value, owner) {
|
|
8
|
+
const boundOwner = hexAddress(owner);
|
|
9
|
+
const envelope = readObject(value, "authorized agents envelope");
|
|
10
|
+
if (Object.keys(envelope).length !== 2 ||
|
|
11
|
+
!("data" in envelope) ||
|
|
12
|
+
!("witness" in envelope))
|
|
13
|
+
invalidRead("authorized agents envelope");
|
|
14
|
+
const witness = decodeFinalizedReadWitness(envelope.witness);
|
|
15
|
+
const bytes = canonicalBase64(envelope.data, "authorized agents data", 16 * 1024);
|
|
16
|
+
const wasm = getWasm();
|
|
17
|
+
const view = asReadError("authorized agents", () => authorizedAgentsFromWasm(wasm.decode_read(wasm.ReadKind.AuthorizedAgents, bytes)));
|
|
18
|
+
if (view.owner !== boundOwner || view.finalizedHeight !== witness.height)
|
|
19
|
+
invalidRead("authorized agents owner or height mismatch", "binding");
|
|
20
|
+
if (view.agents.length > AUTHORIZED_AGENTS_LIMIT ||
|
|
21
|
+
(!view.complete && view.agents.length !== AUTHORIZED_AGENTS_LIMIT))
|
|
22
|
+
invalidRead("authorized agents completeness");
|
|
23
|
+
let previous = "";
|
|
24
|
+
const agents = view.agents.map((raw) => {
|
|
25
|
+
const agent = hexAddress(raw);
|
|
26
|
+
if (agent <= previous)
|
|
27
|
+
invalidRead("authorized agents ordering");
|
|
28
|
+
previous = agent;
|
|
29
|
+
return agent;
|
|
30
|
+
});
|
|
31
|
+
return { owner: boundOwner, agents, complete: view.complete, witness };
|
|
32
|
+
}
|
|
33
|
+
export async function readFinalizedAuthorizedAgents(gateway, owner, options, transport) {
|
|
34
|
+
const boundOwner = hexAddress(owner);
|
|
35
|
+
const captured = { ...options };
|
|
36
|
+
captured.signal?.throwIfAborted();
|
|
37
|
+
return decodeFinalizedAuthorizedAgents(await boundedGatewayJson(`${gateway.replace(/\/+$/, "")}/v2/account/${boundOwner}/agents?witness=1`, transport, captured, { purpose: "account", prepare: ready, maxBytes: 32 * 1024 }), boundOwner);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=authorized-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorized-agents.js","sourceRoot":"","sources":["../src/authorized-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAG3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,UAAU,GAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGlD,4DAA4D;AAC5D,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAmBpC,MAAM,UAAU,+BAA+B,CAC7C,KAAc,EACd,KAAa;IAEb,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;IACjE,IACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC;QAClC,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC;QACrB,CAAC,CAAC,SAAS,IAAI,QAAQ,CAAC;QAExB,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAC5C,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,EAC3B,SAAgC;IAEhC,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAClC,OAAO,+BAA+B,CACpC,MAAM,kBAAkB,CACtB,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,UAAU,mBAAmB,EAC1E,SAAS,EACT,QAAQ,EACR,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,CAC5D,EACD,UAAU,CACX,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { type LiquidationHistoryFilters, type LiquidationHistoryPage } from "./l
|
|
|
11
11
|
import { type AccountState } from "./account-state.js";
|
|
12
12
|
import { type FundingInfo } from "./funding.js";
|
|
13
13
|
import { type FinancialState, type FinancialStateSelection } from "./financial-state.js";
|
|
14
|
-
import type { Action, TxResult, PlaceOrder, MarketOrder, AccountInfo, HistoryCashFlow, HistoryFillsPage, HistoryPositionSnapshot, HistoryPositionsPage, HistoryResolution, MarketConfig, MarketListing, OpenOrder, AdlQueueEntry, Orderbook, Ticker, WithdrawalRecord, AdminSignerRegistry, AuthoritiesSnapshot, ProposalPage, EventInfo, SetPositionTriggers, PositionTriggerInfo, TriggerStatus, PositionTriggerHistoryFilters, PositionTriggerHistoryPage, TriggerMarketHistoryFilters, TriggerMarketHistoryPage,
|
|
14
|
+
import type { Action, TxResult, PlaceOrder, MarketOrder, AccountInfo, HistoryCashFlow, HistoryFillsPage, HistoryPositionSnapshot, HistoryPositionsPage, HistoryResolution, MarketConfig, MarketListing, OpenOrder, AdlQueueEntry, Orderbook, Ticker, WithdrawalRecord, AdminSignerRegistry, AuthoritiesSnapshot, ProposalPage, EventInfo, EventListing, SetPositionTriggers, PositionTriggerInfo, TriggerStatus, PositionTriggerHistoryFilters, PositionTriggerHistoryPage, TriggerMarketHistoryFilters, TriggerMarketHistoryPage, NodeVersion, UpgradesInfo, LiquidationConfigInfo, AuthorizeWithdrawal, ConfirmWithdrawalReceipt, FailWithdrawalReceipt } from "./types.js";
|
|
15
15
|
import { type ExchangeHttpTransport } from "./http-transport.js";
|
|
16
16
|
import { type NoOrder } from "./binary.js";
|
|
17
17
|
import type { MarketsSnapshot } from "./types.js";
|
|
@@ -593,11 +593,21 @@ export declare class ExchangeClient {
|
|
|
593
593
|
queryMarketsSnapshot(): Promise<MarketsSnapshot>;
|
|
594
594
|
/** List all registered market configs. */
|
|
595
595
|
queryMarkets(): Promise<MarketConfig[]>;
|
|
596
|
-
/** The market listing
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
*
|
|
596
|
+
/** The market listing decoded row by row (`MarketListing`): the rows that
|
|
597
|
+
* decode as `queryMarkets` decodes them, each one's field count (so a
|
|
598
|
+
* caller can refuse a layout the pinned wire does not have), and the rows
|
|
599
|
+
* that do not decode, each named by its market, reported instead of
|
|
600
|
+
* refusing the whole listing. A row that cannot be tied to a market of its
|
|
601
|
+
* own, a missing envelope, or a payload that is not a list or fails the
|
|
602
|
+
* strict preflight is a refusal. */
|
|
600
603
|
queryMarketListing(): Promise<MarketListing>;
|
|
604
|
+
/** The events listing decoded row by row (`EventListing`): the events that
|
|
605
|
+
* decode as `queryEvents` decodes them (rows must be arrays, as the engine
|
|
606
|
+
* writes them), and the rows that do not, reported
|
|
607
|
+
* instead of refusing every event. A missing envelope, a payload that is
|
|
608
|
+
* not a list, or one that fails the strict MessagePack preflight is a
|
|
609
|
+
* refusal. */
|
|
610
|
+
queryEventListing(): Promise<EventListing>;
|
|
601
611
|
/** All events: each is its binary book under one `EventInfo`, plus every
|
|
602
612
|
* conditional attached to it. Fail-closed: a missing envelope or
|
|
603
613
|
* malformed row is a refusal. */
|
|
@@ -610,9 +620,6 @@ export declare class ExchangeClient {
|
|
|
610
620
|
/** Current whole-position trigger brackets for one owner. Immutable
|
|
611
621
|
* lifecycle history is a separate gateway/indexer query below. */
|
|
612
622
|
queryPositionTriggers(addressHex?: string): Promise<PositionTriggerInfo[]>;
|
|
613
|
-
/** Read the complete governed trigger-market policy registry. Missing
|
|
614
|
-
* markets are disabled; callers must never synthesize a default policy. */
|
|
615
|
-
queryTriggerMarketConfigs(): Promise<TriggerMarketConfigInfo[]>;
|
|
616
623
|
/** Read the fail-closed next-height trigger admission predicate. Heights
|
|
617
624
|
* are parsed from raw JSON into bigint without a lossy Number round-trip.
|
|
618
625
|
*
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,YAAY,EAEZ,cAAc,EACd,sBAAsB,EACtB,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EA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MAAM,EAAE,MAAM,EACd,SAAS,SAAS,GACjB,OAAO,CAAC,sBAAsB,CAAC;IAkClC,uEAAuE;IACvE,OAAO,CAAC,UAAU;IAalB;;OAEG;IACH,IAAI,CAAC,IAAI,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,WAAW;IAKzD;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CACd,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,EACtC,IAAI,GAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,KAAK,CAAC;QACb,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;KACjD,GACL,MAAM,IAAI;IAgCb,uEAAuE;YACzD,kBAAkB;IAuChC;2DACuD;YACzC,oBAAoB;IAalC,kBAAkB,CAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,MAAM,IAAI;IAIb,eAAe,CACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GACnC,MAAM,IAAI;IAIb;wEACoE;IACpE,UAAU;CAOX"}
|
package/dist/client.js
CHANGED
|
@@ -24,7 +24,7 @@ import { defaultExchangeHttpTransport, exchangeHttpPriorityForAction, readContex
|
|
|
24
24
|
import { yesOrder } from "./binary.js";
|
|
25
25
|
import { Side } from "./types.js";
|
|
26
26
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
27
|
-
import { decodePositionTriggerInfos,
|
|
27
|
+
import { decodePositionTriggerInfos, decodeTriggerStatusJson, validateCancelPositionTriggers, validateOrderTriggers, validateSetPositionTriggers, } from "./triggers.js";
|
|
28
28
|
import { decodePositionTriggerHistoryPage, decodeTriggerMarketHistoryPage, positionTriggerHistorySearchParams, triggerMarketHistorySearchParams, validateTriggerHistoryMarket, } from "./trigger-history.js";
|
|
29
29
|
const msgpackDecoder = new Decoder({ useBigInt64: true });
|
|
30
30
|
const U64_MAX = 0xffffffffffffffffn;
|
|
@@ -1091,22 +1091,57 @@ export class ExchangeClient {
|
|
|
1091
1091
|
const raw = (await this.decodeRead("Markets", bytes));
|
|
1092
1092
|
return raw.map(marketConfigFromWasm);
|
|
1093
1093
|
}
|
|
1094
|
-
/** The market listing
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
*
|
|
1094
|
+
/** The market listing decoded row by row (`MarketListing`): the rows that
|
|
1095
|
+
* decode as `queryMarkets` decodes them, each one's field count (so a
|
|
1096
|
+
* caller can refuse a layout the pinned wire does not have), and the rows
|
|
1097
|
+
* that do not decode, each named by its market, reported instead of
|
|
1098
|
+
* refusing the whole listing. A row that cannot be tied to a market of its
|
|
1099
|
+
* own, a missing envelope, or a payload that is not a list or fails the
|
|
1100
|
+
* strict preflight is a refusal. */
|
|
1098
1101
|
async queryMarketListing() {
|
|
1099
1102
|
const json = await this.apiJson(`${this.readBaseUrl}/v1/markets`);
|
|
1100
1103
|
const bytes = fromBase64(requireEncodedData(json, "/v1/markets"));
|
|
1101
|
-
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
|
|
1104
|
+
await initWasm();
|
|
1105
|
+
const wasm = getWasm();
|
|
1106
|
+
let decoded;
|
|
1107
|
+
try {
|
|
1108
|
+
decoded = wasm.decode_market_listing(bytes);
|
|
1109
|
+
}
|
|
1110
|
+
catch (e) {
|
|
1111
|
+
throw new Error(`Markets decode: ${e instanceof Error ? e.message : String(e)}`);
|
|
1105
1112
|
}
|
|
1106
1113
|
return {
|
|
1107
|
-
markets:
|
|
1108
|
-
rowFieldCounts:
|
|
1109
|
-
pinnedFieldCount:
|
|
1114
|
+
markets: decoded.markets.map(marketConfigFromWasm),
|
|
1115
|
+
rowFieldCounts: decoded.rowFieldCounts,
|
|
1116
|
+
pinnedFieldCount: wasm.market_config_fields(),
|
|
1117
|
+
refusedRows: decoded.refusedRows.map((row) => ({
|
|
1118
|
+
index: row.index,
|
|
1119
|
+
market: row.market,
|
|
1120
|
+
fieldCount: row.fieldCount,
|
|
1121
|
+
error: row.error,
|
|
1122
|
+
})),
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
/** The events listing decoded row by row (`EventListing`): the events that
|
|
1126
|
+
* decode as `queryEvents` decodes them (rows must be arrays, as the engine
|
|
1127
|
+
* writes them), and the rows that do not, reported
|
|
1128
|
+
* instead of refusing every event. A missing envelope, a payload that is
|
|
1129
|
+
* not a list, or one that fails the strict MessagePack preflight is a
|
|
1130
|
+
* refusal. */
|
|
1131
|
+
async queryEventListing() {
|
|
1132
|
+
const json = await this.apiJson(`${this.readBaseUrl}/v1/events`);
|
|
1133
|
+
const bytes = fromBase64(requireEncodedData(json, "/v1/events"));
|
|
1134
|
+
await initWasm();
|
|
1135
|
+
let decoded;
|
|
1136
|
+
try {
|
|
1137
|
+
decoded = getWasm().decode_event_listing(bytes);
|
|
1138
|
+
}
|
|
1139
|
+
catch (e) {
|
|
1140
|
+
throw new Error(`Events decode: ${e instanceof Error ? e.message : String(e)}`);
|
|
1141
|
+
}
|
|
1142
|
+
return {
|
|
1143
|
+
events: decoded.events.map(eventInfoFromWasm),
|
|
1144
|
+
refusedRows: decoded.refusedRows,
|
|
1110
1145
|
};
|
|
1111
1146
|
}
|
|
1112
1147
|
/** All events: each is its binary book under one `EventInfo`, plus every
|
|
@@ -1114,10 +1149,7 @@ export class ExchangeClient {
|
|
|
1114
1149
|
* malformed row is a refusal. */
|
|
1115
1150
|
async queryEvents() {
|
|
1116
1151
|
const json = await this.apiJson(`${this.readBaseUrl}/v1/events`);
|
|
1117
|
-
|
|
1118
|
-
throw new Error("governance decode: events response has no encoded-data envelope");
|
|
1119
|
-
}
|
|
1120
|
-
const raw = await this.decodeRead("Events", fromBase64(json.data));
|
|
1152
|
+
const raw = await this.decodeRead("Events", fromBase64(requireEncodedData(json, "/v1/events")));
|
|
1121
1153
|
return raw.map(eventInfoFromWasm);
|
|
1122
1154
|
}
|
|
1123
1155
|
/** A single event by id, or `null` if it does not exist. The node returns
|
|
@@ -1134,10 +1166,7 @@ export class ExchangeClient {
|
|
|
1134
1166
|
const msg = json.error ?? `HTTP ${res.status}`;
|
|
1135
1167
|
throw new Error(`API error: ${msg}`);
|
|
1136
1168
|
}
|
|
1137
|
-
|
|
1138
|
-
throw new Error("governance decode: event response has no encoded-data envelope");
|
|
1139
|
-
}
|
|
1140
|
-
const raw = await this.decodeRead("Event", fromBase64(json.data));
|
|
1169
|
+
const raw = await this.decodeRead("Event", fromBase64(requireEncodedData(json, `/v1/event/${eventId}`)));
|
|
1141
1170
|
return raw == null ? null : eventInfoFromWasm(raw);
|
|
1142
1171
|
}
|
|
1143
1172
|
/** Current whole-position trigger brackets for one owner. Immutable
|
|
@@ -1154,14 +1183,6 @@ export class ExchangeClient {
|
|
|
1154
1183
|
const bytes = fromBase64(requireEncodedData(json, path));
|
|
1155
1184
|
return decodePositionTriggerInfos(await this.strictDecode(bytes));
|
|
1156
1185
|
}
|
|
1157
|
-
/** Read the complete governed trigger-market policy registry. Missing
|
|
1158
|
-
* markets are disabled; callers must never synthesize a default policy. */
|
|
1159
|
-
async queryTriggerMarketConfigs() {
|
|
1160
|
-
const path = "/v1/triggers/markets";
|
|
1161
|
-
const json = await this.apiJson(`${this.readBaseUrl}${path}`);
|
|
1162
|
-
const bytes = fromBase64(requireEncodedData(json, path));
|
|
1163
|
-
return decodeTriggerMarketConfigInfos(await this.strictDecode(bytes));
|
|
1164
|
-
}
|
|
1165
1186
|
/** Read the fail-closed next-height trigger admission predicate. Heights
|
|
1166
1187
|
* are parsed from raw JSON into bigint without a lossy Number round-trip.
|
|
1167
1188
|
*
|