@pod-network/trade-sdk 0.1.0-rc.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.
Files changed (102) hide show
  1. package/README.md +113 -0
  2. package/dist/client.d.ts +93 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +168 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/codec/decode.d.ts +22 -0
  7. package/dist/codec/decode.d.ts.map +1 -0
  8. package/dist/codec/decode.js +251 -0
  9. package/dist/codec/decode.js.map +1 -0
  10. package/dist/codec/fixed.d.ts +11 -0
  11. package/dist/codec/fixed.d.ts.map +1 -0
  12. package/dist/codec/fixed.js +37 -0
  13. package/dist/codec/fixed.js.map +1 -0
  14. package/dist/codec/resolution.d.ts +14 -0
  15. package/dist/codec/resolution.d.ts.map +1 -0
  16. package/dist/codec/resolution.js +35 -0
  17. package/dist/codec/resolution.js.map +1 -0
  18. package/dist/codec/units.d.ts +35 -0
  19. package/dist/codec/units.d.ts.map +1 -0
  20. package/dist/codec/units.js +86 -0
  21. package/dist/codec/units.js.map +1 -0
  22. package/dist/datafeed.d.ts +4 -0
  23. package/dist/datafeed.d.ts.map +1 -0
  24. package/dist/datafeed.js +73 -0
  25. package/dist/datafeed.js.map +1 -0
  26. package/dist/index.d.ts +20 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +19 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/stores/resource.d.ts +50 -0
  31. package/dist/stores/resource.d.ts.map +1 -0
  32. package/dist/stores/resource.js +154 -0
  33. package/dist/stores/resource.js.map +1 -0
  34. package/dist/sync/account-metrics.d.ts +26 -0
  35. package/dist/sync/account-metrics.d.ts.map +1 -0
  36. package/dist/sync/account-metrics.js +41 -0
  37. package/dist/sync/account-metrics.js.map +1 -0
  38. package/dist/sync/candles.d.ts +68 -0
  39. package/dist/sync/candles.d.ts.map +1 -0
  40. package/dist/sync/candles.js +318 -0
  41. package/dist/sync/candles.js.map +1 -0
  42. package/dist/sync/order-preview.d.ts +74 -0
  43. package/dist/sync/order-preview.d.ts.map +1 -0
  44. package/dist/sync/order-preview.js +86 -0
  45. package/dist/sync/order-preview.js.map +1 -0
  46. package/dist/sync/orders.d.ts +49 -0
  47. package/dist/sync/orders.d.ts.map +1 -0
  48. package/dist/sync/orders.js +210 -0
  49. package/dist/sync/orders.js.map +1 -0
  50. package/dist/sync/positions-live.d.ts +3 -0
  51. package/dist/sync/positions-live.d.ts.map +1 -0
  52. package/dist/sync/positions-live.js +86 -0
  53. package/dist/sync/positions-live.js.map +1 -0
  54. package/dist/sync/sources.d.ts +40 -0
  55. package/dist/sync/sources.d.ts.map +1 -0
  56. package/dist/sync/sources.js +197 -0
  57. package/dist/sync/sources.js.map +1 -0
  58. package/dist/transport/rest.d.ts +83 -0
  59. package/dist/transport/rest.d.ts.map +1 -0
  60. package/dist/transport/rest.js +146 -0
  61. package/dist/transport/rest.js.map +1 -0
  62. package/dist/transport/ws.d.ts +60 -0
  63. package/dist/transport/ws.d.ts.map +1 -0
  64. package/dist/transport/ws.js +235 -0
  65. package/dist/transport/ws.js.map +1 -0
  66. package/dist/types/public.d.ts +292 -0
  67. package/dist/types/public.d.ts.map +1 -0
  68. package/dist/types/public.js +4 -0
  69. package/dist/types/public.js.map +1 -0
  70. package/dist/types/wire.d.ts +283 -0
  71. package/dist/types/wire.d.ts.map +1 -0
  72. package/dist/types/wire.js +6 -0
  73. package/dist/types/wire.js.map +1 -0
  74. package/dist/write/delegation.d.ts +54 -0
  75. package/dist/write/delegation.d.ts.map +1 -0
  76. package/dist/write/delegation.js +81 -0
  77. package/dist/write/delegation.js.map +1 -0
  78. package/dist/write/index.d.ts +261 -0
  79. package/dist/write/index.d.ts.map +1 -0
  80. package/dist/write/index.js +428 -0
  81. package/dist/write/index.js.map +1 -0
  82. package/package.json +43 -0
  83. package/src/client.ts +229 -0
  84. package/src/codec/decode.ts +277 -0
  85. package/src/codec/fixed.ts +41 -0
  86. package/src/codec/resolution.ts +39 -0
  87. package/src/codec/units.ts +100 -0
  88. package/src/datafeed.ts +94 -0
  89. package/src/index.ts +49 -0
  90. package/src/stores/resource.ts +172 -0
  91. package/src/sync/account-metrics.ts +71 -0
  92. package/src/sync/candles.ts +326 -0
  93. package/src/sync/order-preview.ts +152 -0
  94. package/src/sync/orders.ts +205 -0
  95. package/src/sync/positions-live.ts +102 -0
  96. package/src/sync/sources.ts +239 -0
  97. package/src/transport/rest.ts +213 -0
  98. package/src/transport/ws.ts +255 -0
  99. package/src/types/public.ts +335 -0
  100. package/src/types/wire.ts +301 -0
  101. package/src/write/delegation.ts +113 -0
  102. package/src/write/index.ts +642 -0
@@ -0,0 +1,261 @@
1
+ import type { Address, Hash, Hex, MarketId } from "../types/public.js";
2
+ /** The CLOB precompile (chain id 1293 / 0x50d). */
3
+ export declare const CLOB_ADDRESS: Address;
4
+ export interface SubmitOrderParams {
5
+ orderbookId: MarketId;
6
+ side: "buy" | "sell";
7
+ orderType: "limit" | "market";
8
+ price: bigint;
9
+ size: bigint;
10
+ /**
11
+ * Market `tick_precision`. When given, `price` is floored to a multiple of it
12
+ * — the CLOB rejects prices that aren't tick-aligned (e.g. a raw oracle mark
13
+ * like 49999.99999999999). Pass `market.tickPrecision`.
14
+ */
15
+ tickPrecision?: bigint;
16
+ /**
17
+ * Market auction interval in microseconds (`market.auctionIntervalMs * 1000`).
18
+ * The CLOB requires `deadline` to be a multiple of it ("Deadline is not aligned
19
+ * to auction interval"); when given, deadline & ttl are floored to it.
20
+ */
21
+ auctionIntervalUs?: number;
22
+ reduceOnly?: boolean;
23
+ /**
24
+ * Immediate-or-cancel. Defaults to `true` for a market order and `false` for
25
+ * a limit order: a market order carries no resting price of its own, so the
26
+ * CLOB rejects one that could outlive its batch ("market orders must be
27
+ * immediate-or-cancel"). Only set this explicitly to make a *limit* order IOC.
28
+ */
29
+ ioc?: boolean;
30
+ deadline?: number;
31
+ ttl?: number;
32
+ }
33
+ /** Floor a price to a multiple of the tick. */
34
+ export declare function alignPrice(price: bigint, tick: bigint): bigint;
35
+ /** Floor a microsecond timestamp to a multiple of the auction interval. */
36
+ export declare function alignDeadline(us: bigint, intervalUs: bigint): bigint;
37
+ /** An unsigned transaction request — hand to `walletClient.sendTransaction`. */
38
+ export interface PodTxRequest {
39
+ to: Address;
40
+ data: Hex;
41
+ value: bigint;
42
+ type: "eip1559";
43
+ maxPriorityFeePerGas: bigint;
44
+ gas: bigint;
45
+ }
46
+ export declare function buildSubmitOrder(p: SubmitOrderParams): PodTxRequest;
47
+ export declare function buildCancelOrder(orderbookId: MarketId, orderId: Hash, opts?: {
48
+ deadline?: number;
49
+ auctionIntervalUs?: number;
50
+ }): PodTxRequest;
51
+ /** A reverted pod transaction, carrying the decoded CLOB reason. */
52
+ export declare class PodTxRevertError extends Error {
53
+ reason: string;
54
+ data?: string | undefined;
55
+ constructor(reason: string, data?: string | undefined);
56
+ }
57
+ /**
58
+ * Decode a Solidity `Error(string)` revert payload into its message (e.g.
59
+ * "Deadline is not aligned to auction interval"). Returns undefined when `data`
60
+ * isn't an `Error(string)` payload — use this directly if you broadcast through
61
+ * your own provider and just want to translate the revert data.
62
+ */
63
+ export declare function decodeRevertReason(data: string | null | undefined): string | undefined;
64
+ /**
65
+ * Broadcast a SIGNED, serialized transaction via raw `eth_sendRawTransaction`
66
+ * and return its hash, throwing a {@link PodTxRevertError} with the decoded CLOB
67
+ * reason on revert. Transport-only — the consumer signs with its own wallet
68
+ * (`walletClient.signTransaction(...)`), then hands the serialized tx here.
69
+ */
70
+ export declare function sendRawTransaction(rpcUrl: string, signedTx: Hex, opts?: {
71
+ fetch?: typeof fetch;
72
+ }): Promise<Hash>;
73
+ export interface UpdateOrderParams {
74
+ orderbookId: MarketId;
75
+ /** The resting order's id (`Order.id`) — modified in place, keeps the same id. */
76
+ orderId: Hash;
77
+ /** New price, 1e18-scaled. Floored to `tickPrecision` when given. */
78
+ price: bigint;
79
+ /**
80
+ * New size MAGNITUDE, 1e18-scaled. The side is unchanged — the engine reuses
81
+ * the resting order's side — so the sign is ignored. Must be non-zero.
82
+ */
83
+ size: bigint;
84
+ /**
85
+ * Collateral/quote token. The engine derives the real side & token from the
86
+ * resting order, so this is effectively informational; pass `market.quote.address`
87
+ * (the native USD address for perps).
88
+ */
89
+ token: Address;
90
+ tickPrecision?: bigint;
91
+ auctionIntervalUs?: number;
92
+ deadline?: number;
93
+ }
94
+ /**
95
+ * Amend a resting order's price and/or size in place via the CLOB's native
96
+ * `update` (no cancel+resubmit, so the order keeps its id and queue identity).
97
+ * Aligns price to the tick and deadline to the auction interval, like
98
+ * {@link buildSubmitOrder}.
99
+ */
100
+ export declare function buildUpdateOrder(p: UpdateOrderParams): PodTxRequest;
101
+ export interface SubmitTriggerParams {
102
+ orderbookId: MarketId;
103
+ /** Side of the order that fires: buy → +size, sell → −size. */
104
+ side: "buy" | "sell";
105
+ size: bigint;
106
+ triggerType: "take_profit" | "stop_loss";
107
+ /** Mark-price level that arms the fire, 1e18-scaled. Floored to the tick. */
108
+ triggerPrice: bigint;
109
+ /** Limit price of the fired order; defaults to `triggerPrice`. Floored to the tick. */
110
+ limitPrice?: bigint;
111
+ /** "position" (default) auto-cancels with the position; "none" is standalone. */
112
+ grouping?: "none" | "position";
113
+ reduceOnly?: boolean;
114
+ ioc?: boolean;
115
+ tickPrecision?: bigint;
116
+ auctionIntervalUs?: number;
117
+ deadline?: number;
118
+ /** Armed lifetime as a duration in ms (capped at ~30d by the CLOB); default 29d. */
119
+ ttlMs?: number;
120
+ }
121
+ export declare function buildSubmitTrigger(p: SubmitTriggerParams): PodTxRequest;
122
+ export declare function buildCancelTrigger(orderbookId: MarketId, triggerOrderId: Hash, opts?: {
123
+ deadline?: number;
124
+ auctionIntervalUs?: number;
125
+ }): PodTxRequest;
126
+ export interface UpdateTriggerParams {
127
+ orderbookId: MarketId;
128
+ triggerOrderId: Hash;
129
+ side: "buy" | "sell";
130
+ size: bigint;
131
+ triggerPrice: bigint;
132
+ limitPrice?: bigint;
133
+ tickPrecision?: bigint;
134
+ auctionIntervalUs?: number;
135
+ deadline?: number;
136
+ }
137
+ export declare function buildUpdateTrigger(p: UpdateTriggerParams): PodTxRequest;
138
+ /** Wrap already-built legs into one `submitBatch` tx. Pass leg requests (their
139
+ * `data` is used) or raw calldata. Legs must share a deadline (the CLOB enforces
140
+ * it). Gas scales with the leg count. */
141
+ export declare function buildSubmitBatch(legs: Array<PodTxRequest | Hex>, opts?: {
142
+ gas?: bigint;
143
+ }): PodTxRequest;
144
+ export interface OrderTrigger {
145
+ /** Mark-price level that arms the fire (1e18). Floored to the tick. */
146
+ triggerPrice: bigint;
147
+ /** Fired limit price; defaults to `triggerPrice`. Floored to the tick. */
148
+ limitPrice?: bigint;
149
+ /** Fraction of the entry size to close, 0..1 (default 1 = whole position). */
150
+ sizeFraction?: number;
151
+ }
152
+ export interface OrderWithTriggersParams {
153
+ orderbookId: MarketId;
154
+ /** Entry side: buy → long, sell → short. */
155
+ side: "buy" | "sell";
156
+ orderType: "limit" | "market";
157
+ price: bigint;
158
+ size: bigint;
159
+ takeProfit?: OrderTrigger;
160
+ stopLoss?: OrderTrigger;
161
+ tickPrecision?: bigint;
162
+ auctionIntervalUs?: number;
163
+ reduceOnly?: boolean;
164
+ ioc?: boolean;
165
+ deadline?: number;
166
+ orderTtl?: number;
167
+ triggerTtlMs?: number;
168
+ }
169
+ /**
170
+ * Build ONE transaction that places an entry order and arms its TP/SL together.
171
+ * With either trigger present it batches `submitOrder` + `submitTrigger`(s) via
172
+ * `submitBatch` under a shared deadline; with neither it's a plain `submitOrder`.
173
+ *
174
+ * Triggers close the entry position: opposite side, `reduceOnly`,
175
+ * `grouping: "position"` (so a partial fill — and the eventual close — keep the
176
+ * triggers consistent), size = entry size × `sizeFraction`.
177
+ */
178
+ export declare function buildOrderWithTriggers(p: OrderWithTriggersParams): PodTxRequest;
179
+ /**
180
+ * Protective bound for a market order: the worst price it may fill at. A CLOB
181
+ * market order's `price` IS its slippage bound, so submit at the reference
182
+ * price padded by `slippageBps` (buy pays up to +bps, sell accepts down to
183
+ * −bps) — tight enough to protect, loose enough to actually cross.
184
+ */
185
+ export declare function protectivePrice(price: bigint, side: "buy" | "sell", slippageBps: number): bigint;
186
+ export interface ClosePositionParams {
187
+ orderbookId: MarketId;
188
+ /** The position's current side (long → close with a sell; short → buy). */
189
+ side: "long" | "short";
190
+ /** Position size magnitude to close (1e18). */
191
+ size: bigint;
192
+ /** Current mark price (1e18) — the protective price is derived from it. */
193
+ price: bigint;
194
+ /** Slippage bound in basis points for the market close. Default 500 (5%). */
195
+ slippageBps?: number;
196
+ tickPrecision?: bigint;
197
+ auctionIntervalUs?: number;
198
+ deadline?: number;
199
+ }
200
+ /**
201
+ * Close (flatten) a perp position: a reduce-only **market** order on the
202
+ * opposite side for the full size. A market order's `price` is a slippage
203
+ * bound, so it's set to mark ∓ `slippageBps` (sell accepts lower, buy pays
204
+ * higher) to guarantee it crosses and fills. `reduceOnly` guarantees it only
205
+ * shrinks the position, never flips it. Batch several with
206
+ * {@link buildSubmitBatch} (shared `deadline`) to close everything in one tx.
207
+ */
208
+ export declare function buildClosePosition(p: ClosePositionParams): PodTxRequest;
209
+ /** A mined transaction receipt (the fields a consumer typically needs). */
210
+ export interface TxReceipt {
211
+ /** `success` when the tx executed (status `0x1`); `reverted` on `0x0`. */
212
+ status: "success" | "reverted";
213
+ transactionHash: Hash;
214
+ blockNumber: bigint;
215
+ gasUsed: bigint;
216
+ }
217
+ /**
218
+ * Poll `eth_getTransactionReceipt` until the tx is mined, then report whether it
219
+ * executed or reverted. A hash from {@link sendRawTransaction} only means the
220
+ * node accepted the tx into its pool — it is NOT yet confirmed. Await this to
221
+ * know the on-chain outcome. Throws on timeout. Like the rest of this module
222
+ * it's transport-only (raw JSON-RPC), so it needs no viem client.
223
+ */
224
+ export declare function waitForReceipt(rpcUrl: string, hash: Hash, opts?: {
225
+ fetch?: typeof fetch;
226
+ timeoutMs?: number;
227
+ pollMs?: number;
228
+ }): Promise<TxReceipt>;
229
+ /** The Mint contract (`node/src/mint.rs`). */
230
+ export declare const MINT_ADDRESS: Address;
231
+ /** The native USD (cash) token — `trading/src/constants.rs` NATIVE_ADDRESS. */
232
+ export declare const NATIVE_USD_ADDRESS: Address;
233
+ export interface MintParams {
234
+ rpcUrl: string;
235
+ /** Chain id for the tx; fetched via `eth_chainId` when omitted. */
236
+ chainId?: number;
237
+ to: Address;
238
+ /** 1e18-scaled amounts; `token` defaults to the native USD (cash) token. */
239
+ tokens: Array<{
240
+ token?: Address;
241
+ amount: bigint;
242
+ }>;
243
+ /** Deposit into the CLOB balance (default) instead of crediting the EOA. */
244
+ depositToClob?: boolean;
245
+ /** Called with the tx hash once the node accepts it (before confirmation). */
246
+ onSubmitted?: (hash: Hash) => void;
247
+ fetch?: typeof fetch;
248
+ }
249
+ /** Mint tokens to `to` and wait for the receipt. Throws {@link PodTxRevertError}
250
+ * on rejection (e.g. "Minting is disabled") and Error on on-chain revert. */
251
+ export declare function mint(p: MintParams): Promise<TxReceipt>;
252
+ /**
253
+ * Deterministic order id: `keccak256(abi.encode(signer, nonce, sequence))`,
254
+ * matching the engine (`trading/src/lib.rs`). `sequence` is the 0-based index
255
+ * of the intent within a `submitBatch` (0 for a single-intent tx). Needs the
256
+ * nonce, so it's only known up-front in managed mode; in advisory mode reconcile
257
+ * by `tx_hash` from the `pod_orders` stream instead.
258
+ */
259
+ export declare function deriveOrderId(signer: Address, nonce: number, sequence?: number): Hash;
260
+ export { createDelegatedWallet, delegationTypedData, type CreateDelegatedWalletParams, type DelegatedWallet, type DelegationTypedData, } from "./delegation.js";
261
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/write/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEvE,mDAAmD;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