@symbiome-forge/cow-sdk-wasm 0.1.0-alpha.1

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 (119) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +278 -0
  3. package/dist/cloudflare/callbacks.cjs +2 -0
  4. package/dist/cloudflare/callbacks.d.ts +55 -0
  5. package/dist/cloudflare/callbacks.js +1 -0
  6. package/dist/cloudflare/envelope.cjs +2 -0
  7. package/dist/cloudflare/envelope.d.ts +5 -0
  8. package/dist/cloudflare/envelope.js +1 -0
  9. package/dist/cloudflare/errors.cjs +150 -0
  10. package/dist/cloudflare/errors.d.ts +82 -0
  11. package/dist/cloudflare/errors.js +145 -0
  12. package/dist/cloudflare/index.cjs +286 -0
  13. package/dist/cloudflare/index.d.ts +78 -0
  14. package/dist/cloudflare/index.js +1 -0
  15. package/dist/cloudflare/index.mjs +223 -0
  16. package/dist/cloudflare/internal.cjs +127 -0
  17. package/dist/cloudflare/internal.d.ts +40 -0
  18. package/dist/cloudflare/internal.js +115 -0
  19. package/dist/cloudflare/options.cjs +2 -0
  20. package/dist/cloudflare/options.d.ts +70 -0
  21. package/dist/cloudflare/options.js +1 -0
  22. package/dist/cloudflare/raw/cloudflare.cjs +65 -0
  23. package/dist/cloudflare/raw/cloudflare.d.ts +30 -0
  24. package/dist/cloudflare/raw/cloudflare.js +29 -0
  25. package/dist/default/callbacks.cjs +2 -0
  26. package/dist/default/callbacks.d.ts +55 -0
  27. package/dist/default/callbacks.js +1 -0
  28. package/dist/default/envelope.cjs +2 -0
  29. package/dist/default/envelope.d.ts +5 -0
  30. package/dist/default/envelope.js +1 -0
  31. package/dist/default/errors.cjs +150 -0
  32. package/dist/default/errors.d.ts +82 -0
  33. package/dist/default/errors.js +145 -0
  34. package/dist/default/index.cjs +359 -0
  35. package/dist/default/index.d.ts +94 -0
  36. package/dist/default/index.js +1 -0
  37. package/dist/default/index.mjs +295 -0
  38. package/dist/default/internal.cjs +127 -0
  39. package/dist/default/internal.d.ts +40 -0
  40. package/dist/default/internal.js +115 -0
  41. package/dist/default/options.cjs +2 -0
  42. package/dist/default/options.d.ts +70 -0
  43. package/dist/default/options.js +1 -0
  44. package/dist/default/raw/default.cjs +66 -0
  45. package/dist/default/raw/default.d.ts +31 -0
  46. package/dist/default/raw/default.js +30 -0
  47. package/dist/orderbook/callbacks.cjs +2 -0
  48. package/dist/orderbook/callbacks.d.ts +55 -0
  49. package/dist/orderbook/callbacks.js +1 -0
  50. package/dist/orderbook/envelope.cjs +2 -0
  51. package/dist/orderbook/envelope.d.ts +5 -0
  52. package/dist/orderbook/envelope.js +1 -0
  53. package/dist/orderbook/errors.cjs +150 -0
  54. package/dist/orderbook/errors.d.ts +82 -0
  55. package/dist/orderbook/errors.js +145 -0
  56. package/dist/orderbook/index.cjs +195 -0
  57. package/dist/orderbook/index.d.ts +57 -0
  58. package/dist/orderbook/index.js +1 -0
  59. package/dist/orderbook/index.mjs +139 -0
  60. package/dist/orderbook/internal.cjs +127 -0
  61. package/dist/orderbook/internal.d.ts +40 -0
  62. package/dist/orderbook/internal.js +115 -0
  63. package/dist/orderbook/options.cjs +2 -0
  64. package/dist/orderbook/options.d.ts +70 -0
  65. package/dist/orderbook/options.js +1 -0
  66. package/dist/orderbook/raw/orderbook.cjs +58 -0
  67. package/dist/orderbook/raw/orderbook.d.ts +23 -0
  68. package/dist/orderbook/raw/orderbook.js +22 -0
  69. package/dist/raw/cloudflare-web/cow_sdk_wasm.d.ts +2870 -0
  70. package/dist/raw/cloudflare-web/cow_sdk_wasm.js +2183 -0
  71. package/dist/raw/cloudflare-web/cow_sdk_wasm_bg.wasm +0 -0
  72. package/dist/raw/cloudflare-web/cow_sdk_wasm_bg.wasm.d.ts +65 -0
  73. package/dist/raw/default-bundler/cow_sdk_wasm.d.ts +2916 -0
  74. package/dist/raw/default-bundler/cow_sdk_wasm.js +9 -0
  75. package/dist/raw/default-bundler/cow_sdk_wasm_bg.js +2297 -0
  76. package/dist/raw/default-bundler/cow_sdk_wasm_bg.wasm +0 -0
  77. package/dist/raw/default-bundler/cow_sdk_wasm_bg.wasm.d.ts +75 -0
  78. package/dist/raw/default-nodejs/cow_sdk_wasm.cjs +2330 -0
  79. package/dist/raw/default-nodejs/cow_sdk_wasm.d.ts +2916 -0
  80. package/dist/raw/default-nodejs/cow_sdk_wasm_bg.wasm.d.ts +75 -0
  81. package/dist/raw/orderbook-bundler/cow_sdk_wasm.d.ts +1876 -0
  82. package/dist/raw/orderbook-bundler/cow_sdk_wasm.js +9 -0
  83. package/dist/raw/orderbook-bundler/cow_sdk_wasm_bg.js +1636 -0
  84. package/dist/raw/orderbook-bundler/cow_sdk_wasm_bg.wasm +0 -0
  85. package/dist/raw/orderbook-bundler/cow_sdk_wasm_bg.wasm.d.ts +50 -0
  86. package/dist/raw/orderbook-nodejs/cow_sdk_wasm.cjs +1661 -0
  87. package/dist/raw/orderbook-nodejs/cow_sdk_wasm.d.ts +1876 -0
  88. package/dist/raw/orderbook-nodejs/cow_sdk_wasm_bg.wasm.d.ts +50 -0
  89. package/dist/raw/signing-bundler/cow_sdk_wasm.d.ts +774 -0
  90. package/dist/raw/signing-bundler/cow_sdk_wasm.js +9 -0
  91. package/dist/raw/signing-bundler/cow_sdk_wasm_bg.js +1059 -0
  92. package/dist/raw/signing-bundler/cow_sdk_wasm_bg.wasm +0 -0
  93. package/dist/raw/signing-bundler/cow_sdk_wasm_bg.wasm.d.ts +27 -0
  94. package/dist/raw/signing-nodejs/cow_sdk_wasm.cjs +1078 -0
  95. package/dist/raw/signing-nodejs/cow_sdk_wasm.d.ts +774 -0
  96. package/dist/raw/signing-nodejs/cow_sdk_wasm_bg.wasm.d.ts +27 -0
  97. package/dist/signing/callbacks.cjs +2 -0
  98. package/dist/signing/callbacks.d.ts +55 -0
  99. package/dist/signing/callbacks.js +1 -0
  100. package/dist/signing/envelope.cjs +2 -0
  101. package/dist/signing/envelope.d.ts +5 -0
  102. package/dist/signing/envelope.js +1 -0
  103. package/dist/signing/errors.cjs +150 -0
  104. package/dist/signing/errors.d.ts +82 -0
  105. package/dist/signing/errors.js +145 -0
  106. package/dist/signing/index.cjs +93 -0
  107. package/dist/signing/index.d.ts +23 -0
  108. package/dist/signing/index.js +1 -0
  109. package/dist/signing/index.mjs +44 -0
  110. package/dist/signing/internal.cjs +127 -0
  111. package/dist/signing/internal.d.ts +40 -0
  112. package/dist/signing/internal.js +115 -0
  113. package/dist/signing/options.cjs +2 -0
  114. package/dist/signing/options.d.ts +70 -0
  115. package/dist/signing/options.js +1 -0
  116. package/dist/signing/raw/signing.cjs +52 -0
  117. package/dist/signing/raw/signing.d.ts +17 -0
  118. package/dist/signing/raw/signing.js +16 -0
  119. package/package.json +112 -0
@@ -0,0 +1,1876 @@
1
+ /// <reference lib="esnext.disposable" />
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ export interface OrderBookClientConfig {
6
+ chainId: number;
7
+ env?: string | null;
8
+ apiKey?: string | null;
9
+ transport?: HttpTransportConfig;
10
+ transportPolicy?: TransportPolicyConfig | null;
11
+ timeoutMs?: number | null;
12
+ }
13
+
14
+
15
+
16
+ export interface WalletConfig {
17
+ timeoutMs?: number;
18
+ }
19
+
20
+ export interface SigningOptions extends SdkClientOptions {
21
+ walletConfig?: WalletConfig;
22
+ }
23
+
24
+ export type TypedDataSignerCallback = (
25
+ envelope: TypedDataEnvelopeDto,
26
+ ) => Promise<string> | string;
27
+
28
+ export type Eip1193RequestCallback = (
29
+ request: { method: string; params?: unknown[] },
30
+ ) => Promise<unknown> | unknown;
31
+
32
+ export type DigestSignerCallback = (
33
+ digest: string,
34
+ ) => Promise<string> | string;
35
+
36
+ export type CowEip1271SignCallback = (
37
+ request: CowEip1271SignRequest,
38
+ ) => Promise<string> | string;
39
+
40
+ export type CustomEip1271Callback = CowEip1271SignCallback;
41
+
42
+
43
+
44
+ export type CowFetchMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
45
+
46
+ export interface CowFetchRequest {
47
+ method: CowFetchMethod;
48
+ url: string;
49
+ headers: Record<string, string>;
50
+ body?: string;
51
+ timeoutMs?: number;
52
+ signal?: AbortSignal;
53
+ }
54
+
55
+ export interface CowFetchResponse {
56
+ status: number;
57
+ statusText?: string;
58
+ headers?: Record<string, string>;
59
+ body?: string;
60
+ }
61
+
62
+ export type CowFetchCallback = (
63
+ request: CowFetchRequest,
64
+ ) => Promise<CowFetchResponse> | CowFetchResponse;
65
+
66
+ export type HttpTransportConfig =
67
+ | { kind: "callback"; callback: CowFetchCallback };
68
+
69
+
70
+
71
+ export type Value = unknown;
72
+ export type CowError = WasmError;
73
+
74
+ export interface SdkClientOptions {
75
+ timeoutMs?: number;
76
+ signal?: AbortSignal;
77
+ }
78
+
79
+
80
+ /**
81
+ * A decoded `GPv2Settlement` (or inherited `GPv2Signing`) event.
82
+ *
83
+ * Mirrors `cow_sdk_contracts::SettlementEvent`. Addresses and the order UID
84
+ * are lowercase `0x`-prefixed hex; amounts are base-10 atom strings; the
85
+ * interaction `selector` is a `0x`-prefixed 4-byte hex string. The `kind`
86
+ * discriminator distinguishes the variants.
87
+ */
88
+ export type SettlementEventDto = { kind: "trade"; owner: string; sellToken: string; buyToken: string; sellAmount: string; buyAmount: string; feeAmount: string; orderUid: string } | { kind: "interaction"; target: string; value: string; selector: string } | { kind: "settlement"; solver: string } | { kind: "orderInvalidated"; owner: string; orderUid: string } | { kind: "preSignature"; owner: string; orderUid: string; signed: boolean };
89
+
90
+ /**
91
+ * A decoded eth-flow on-chain order lifecycle event.
92
+ *
93
+ * Mirrors `cow_sdk_contracts::EthFlowEvent`. The placement `order` reuses the
94
+ * canonical [`OrderInput`] shape (its `validTo` is the on-chain clamped value;
95
+ * the trader\'s real expiry travels in the opaque `data` trailer). `signature`
96
+ * and `data` are `0x`-prefixed hex strings carrying the raw on-chain signature
97
+ * payload and the opaque trailing data field; addresses and the order UID are
98
+ * lowercase `0x`-prefixed hex. The `kind` discriminator distinguishes the
99
+ * variants.
100
+ */
101
+ export type EthFlowEventDto = { kind: "orderPlacement"; sender: string; order: OrderInput; signingScheme: string; signature: string; data: string } | { kind: "orderInvalidation"; orderUid: string } | { kind: "orderRefund"; orderUid: string; refunder: string };
102
+
103
+ /**
104
+ * A single pre/post interaction attached to an order, mirroring
105
+ * `cow_sdk_orderbook::InteractionData`.
106
+ */
107
+ export interface InteractionDataDto {
108
+ /**
109
+ * Contract address targeted by the interaction.
110
+ */
111
+ target: string;
112
+ /**
113
+ * Native token value sent with the interaction.
114
+ */
115
+ value: string;
116
+ /**
117
+ * Hex-encoded calldata forwarded to `target`.
118
+ */
119
+ callData: string;
120
+ }
121
+
122
+ /**
123
+ * Coarse, switchable classification of an orderbook rejection, mirrored for
124
+ * the JS error surface.
125
+ *
126
+ * A consumer can branch on the action a rejection calls for — fix the
127
+ * request, fund the wallet, re-quote, wait, or escalate — without matching
128
+ * every wire tag. The category carries no message or code, so it never
129
+ * re-exposes redacted rejection text.
130
+ */
131
+ export type OrderBookRejectionCategoryDto = "authorization" | "insufficientFunds" | "invalidOrder" | "notFound" | "conflict" | "unfulfillable" | "server" | "__unknown";
132
+
133
+ /**
134
+ * Competition status for an order, mirroring
135
+ * `cow_sdk_orderbook::CompetitionOrderStatus`.
136
+ */
137
+ export interface CompetitionOrderStatusDto {
138
+ /**
139
+ * High-level competition status kind (the wire `type` field).
140
+ */
141
+ type: CompetitionOrderStatusKindDto;
142
+ /**
143
+ * Optional solver execution payload.
144
+ */
145
+ value?: SolverExecutionDto[];
146
+ }
147
+
148
+ /**
149
+ * Competition-status kind for an order, mirroring
150
+ * `cow_sdk_orderbook::CompetitionOrderStatusKind`, whose wire form is the
151
+ * camelCased variant name.
152
+ */
153
+ export type CompetitionOrderStatusKindDto = "open" | "scheduled" | "active" | "solved" | "executing" | "traded" | "cancelled";
154
+
155
+ /**
156
+ * Custom EIP-1271 callback request.
157
+ */
158
+ export interface CowEip1271SignRequest {
159
+ /**
160
+ * Original order input.
161
+ */
162
+ order: OrderInput;
163
+ /**
164
+ * Typed-data envelope.
165
+ */
166
+ typedData: TypedDataEnvelopeDto;
167
+ /**
168
+ * Owner or smart-account address.
169
+ */
170
+ owner: string;
171
+ /**
172
+ * Numeric chain id.
173
+ */
174
+ chainId: number;
175
+ }
176
+
177
+ /**
178
+ * Deployment address output.
179
+ */
180
+ export interface DeploymentAddressesDto {
181
+ /**
182
+ * Settlement contract.
183
+ */
184
+ settlement: string;
185
+ /**
186
+ * Vault relayer contract.
187
+ */
188
+ vaultRelayer: string;
189
+ /**
190
+ * EthFlow contract.
191
+ */
192
+ ethFlow: string;
193
+ }
194
+
195
+ /**
196
+ * EIP-1193 request DTO.
197
+ */
198
+ export interface Eip1193Request {
199
+ /**
200
+ * Provider method.
201
+ */
202
+ method: string;
203
+ /**
204
+ * Provider params.
205
+ */
206
+ params?: Value[];
207
+ }
208
+
209
+ /**
210
+ * Executed protocol-fee component of a trade, mirroring
211
+ * `cow_sdk_orderbook::ExecutedProtocolFee`.
212
+ */
213
+ export interface ExecutedProtocolFeeDto {
214
+ /**
215
+ * Fee policy that produced this fee, when services returns it (arbitrary
216
+ * JSON mirroring the upstream policy shape).
217
+ */
218
+ policy?: Value;
219
+ /**
220
+ * Fee amount taken.
221
+ */
222
+ amount?: string;
223
+ /**
224
+ * Token in which the fee was taken.
225
+ */
226
+ token?: string;
227
+ }
228
+
229
+ /**
230
+ * Executed sell and buy amounts for a solver path, mirroring
231
+ * `cow_sdk_orderbook::ExecutedAmounts`.
232
+ */
233
+ export interface ExecutedAmountsDto {
234
+ /**
235
+ * Executed sell amount in the upstream decimal-string wire shape.
236
+ */
237
+ sell: string;
238
+ /**
239
+ * Executed buy amount in the upstream decimal-string wire shape.
240
+ */
241
+ buy: string;
242
+ }
243
+
244
+ /**
245
+ * Explicit raw GraphQL query input.
246
+ */
247
+ export interface SubgraphQueryInput {
248
+ /**
249
+ * Raw GraphQL document.
250
+ */
251
+ query: string;
252
+ /**
253
+ * Optional GraphQL variables.
254
+ */
255
+ variables?: Value;
256
+ /**
257
+ * Optional operation name.
258
+ */
259
+ operationName?: string;
260
+ }
261
+
262
+ /**
263
+ * Full app-data document returned by the orderbook app-data endpoint.
264
+ */
265
+ export interface AppDataObjectDto {
266
+ /**
267
+ * Full serialized app-data payload.
268
+ */
269
+ fullAppData: string;
270
+ }
271
+
272
+ /**
273
+ * Generated order UID output.
274
+ */
275
+ export interface GeneratedOrderUidDto {
276
+ /**
277
+ * Compact order UID.
278
+ */
279
+ orderUid: string;
280
+ /**
281
+ * Underlying order digest.
282
+ */
283
+ orderDigest: string;
284
+ }
285
+
286
+ /**
287
+ * Generic validated 32-byte hash wrapper for user-domain and contract surfaces.
288
+ *
289
+ * The wire form is the protocol-canonical `0x`-prefixed 66-character
290
+ * lowercase hexadecimal string. The newtype is `#[repr(transparent)]` over
291
+ * [`alloy_primitives::B256`] and forwards `Display`/`Serialize`/
292
+ * `Deserialize` to the inner alloy type, whose canonical defaults already
293
+ * emit the cow lowercase wire form.
294
+ */
295
+ export type Hash32 = string;
296
+
297
+ /**
298
+ * JS-visible typed error envelope for every wasm export.
299
+ */
300
+ export type WasmError = { kind: "invalidInput"; schemaVersion: SchemaVersion; message: string; field?: string } | { kind: "unknownEnumValue"; schemaVersion: SchemaVersion; message: string; field: string; value: string } | { kind: "unsupportedChain"; schemaVersion: SchemaVersion; message: string; chainId: number } | { kind: "walletRequest"; schemaVersion: SchemaVersion; method: string; code?: number; message: string } | { kind: "walletTimeout"; schemaVersion: SchemaVersion; message: string; timeoutMs: number } | { kind: "transport"; schemaVersion: SchemaVersion; class: string; message: string; status?: number; headers?: [string, string][]; body?: string } | { kind: "orderbook"; schemaVersion: SchemaVersion; code?: string; category?: OrderBookRejectionCategoryDto; message: string; retryable?: boolean; retryAfterMs?: number } | { kind: "subgraph"; schemaVersion: SchemaVersion; message: string } | { kind: "signing"; schemaVersion: SchemaVersion; message: string } | { kind: "appData"; schemaVersion: SchemaVersion; class?: string; message: string } | { kind: "cancelled"; schemaVersion: SchemaVersion; message: string } | { kind: "internal"; schemaVersion: SchemaVersion; message: string } | { kind: "__unknown"; schemaVersion: SchemaVersion; message: string; raw: Value };
301
+
302
+ /**
303
+ * Jitter strategy accepted by JS client constructors.
304
+ */
305
+ export type JitterStrategyConfig = "none" | "full" | "equal" | "decorrelated";
306
+
307
+ /**
308
+ * Native-price response from the orderbook native-price endpoint, mirroring
309
+ * `cow_sdk_orderbook::NativePriceResponse`.
310
+ */
311
+ export interface NativePriceResponseDto {
312
+ /**
313
+ * Token price quoted in the chain\'s native asset.
314
+ */
315
+ price: number;
316
+ }
317
+
318
+ /**
319
+ * On-chain placement metadata, mirroring
320
+ * `cow_sdk_orderbook::OnchainOrderData`.
321
+ */
322
+ export interface OnchainOrderDataDto {
323
+ /**
324
+ * Sender address associated with the on-chain placement.
325
+ */
326
+ sender: string;
327
+ /**
328
+ * Placement error emitted by services, when on-chain placement failed.
329
+ */
330
+ placementError?: string;
331
+ }
332
+
333
+ /**
334
+ * Order class surfaced by the orderbook API, mirroring
335
+ * `cow_sdk_orderbook::OrderClass`.
336
+ */
337
+ export type OrderClassDto = "market" | "limit" | "liquidity";
338
+
339
+ /**
340
+ * Order input shared by signing and UID exports.
341
+ */
342
+ export interface OrderInput {
343
+ /**
344
+ * Sell token address.
345
+ */
346
+ sellToken: string;
347
+ /**
348
+ * Buy token address.
349
+ */
350
+ buyToken: string;
351
+ /**
352
+ * Optional receiver.
353
+ */
354
+ receiver?: string;
355
+ /**
356
+ * Sell amount.
357
+ */
358
+ sellAmount: string;
359
+ /**
360
+ * Buy amount.
361
+ */
362
+ buyAmount: string;
363
+ /**
364
+ * Valid-to timestamp.
365
+ */
366
+ validTo: number;
367
+ /**
368
+ * App-data hash.
369
+ */
370
+ appData: string;
371
+ /**
372
+ * Fee amount.
373
+ */
374
+ feeAmount: string;
375
+ /**
376
+ * Order side.
377
+ */
378
+ kind: OrderKindDto;
379
+ /**
380
+ * Partial fill flag.
381
+ */
382
+ partiallyFillable: boolean;
383
+ /**
384
+ * Sell balance source.
385
+ */
386
+ sellTokenBalance: TokenBalanceDto;
387
+ /**
388
+ * Buy balance destination.
389
+ */
390
+ buyTokenBalance: TokenBalanceDto;
391
+ }
392
+
393
+ /**
394
+ * Order lifecycle status returned by the orderbook API, mirroring
395
+ * `cow_sdk_orderbook::OrderStatus`.
396
+ */
397
+ export type OrderStatusDto = "presignaturePending" | "open" | "fulfilled" | "cancelled" | "expired";
398
+
399
+ /**
400
+ * Order returned by the orderbook order endpoints, mirroring
401
+ * `cow_sdk_orderbook::Order` (the enriched order shape, with the normalized
402
+ * `totalFee` folded in).
403
+ */
404
+ export interface OrderDto {
405
+ /**
406
+ * Sell-token address.
407
+ */
408
+ sellToken: string;
409
+ /**
410
+ * Buy-token address.
411
+ */
412
+ buyToken: string;
413
+ /**
414
+ * Optional receiver override.
415
+ */
416
+ receiver?: string;
417
+ /**
418
+ * Sell amount in the upstream decimal-string wire shape.
419
+ */
420
+ sellAmount: string;
421
+ /**
422
+ * Buy amount in the upstream decimal-string wire shape.
423
+ */
424
+ buyAmount: string;
425
+ /**
426
+ * Absolute UNIX expiry timestamp.
427
+ */
428
+ validTo: number;
429
+ /**
430
+ * App-data hash attached to the order.
431
+ */
432
+ appData: string;
433
+ /**
434
+ * Optional app-data hash echoed for debugging by the orderbook.
435
+ */
436
+ appDataHash?: string;
437
+ /**
438
+ * Order-level fee echoed on the orderbook response; always `\"0\"` in
439
+ * practice because services rejects non-zero order-level fees.
440
+ */
441
+ feeAmount: string;
442
+ /**
443
+ * Strict balance-check flag, present only when the order was created with
444
+ * it set.
445
+ */
446
+ fullBalanceCheck?: boolean;
447
+ /**
448
+ * Order kind.
449
+ */
450
+ kind: OrderKindDto;
451
+ /**
452
+ * Whether partial fills are allowed.
453
+ */
454
+ partiallyFillable: boolean;
455
+ /**
456
+ * Sell-token balance source.
457
+ */
458
+ sellTokenBalance: TokenBalanceDto;
459
+ /**
460
+ * Buy-token balance destination.
461
+ */
462
+ buyTokenBalance: TokenBalanceDto;
463
+ /**
464
+ * Signature scheme used for `signature`.
465
+ */
466
+ signingScheme: SigningSchemeDto;
467
+ /**
468
+ * Raw signature string.
469
+ */
470
+ signature: string;
471
+ /**
472
+ * Effective owner field returned by the API, when present.
473
+ */
474
+ from?: string;
475
+ /**
476
+ * Quote id used when the order originated from a quote.
477
+ */
478
+ quoteId?: number;
479
+ /**
480
+ * Order class.
481
+ */
482
+ class: OrderClassDto;
483
+ /**
484
+ * Canonical owner surfaced by the orderbook response.
485
+ */
486
+ owner: string;
487
+ /**
488
+ * Order UID.
489
+ */
490
+ uid: string;
491
+ /**
492
+ * Creation timestamp string returned by the API.
493
+ */
494
+ creationDate?: string;
495
+ /**
496
+ * Executed sell amount.
497
+ */
498
+ executedSellAmount?: string;
499
+ /**
500
+ * Executed sell amount before fees.
501
+ */
502
+ executedSellAmountBeforeFees?: string;
503
+ /**
504
+ * Executed buy amount.
505
+ */
506
+ executedBuyAmount?: string;
507
+ /**
508
+ * Executed fee component, when provided.
509
+ */
510
+ executedFee?: string;
511
+ /**
512
+ * Deprecated legacy executed-fee value, present on older order payloads.
513
+ */
514
+ executedFeeAmount?: string;
515
+ /**
516
+ * Token in which the executed fee was captured, when returned.
517
+ */
518
+ executedFeeToken?: string;
519
+ /**
520
+ * Whether the order was invalidated by the protocol.
521
+ */
522
+ invalidated?: boolean;
523
+ /**
524
+ * Order lifecycle status.
525
+ */
526
+ status: OrderStatusDto;
527
+ /**
528
+ * Whether services classified the order as a liquidity order.
529
+ */
530
+ isLiquidityOrder?: boolean;
531
+ /**
532
+ * On-chain user for `EthFlow`-style orders.
533
+ */
534
+ onchainUser?: string;
535
+ /**
536
+ * `EthFlow`-specific metadata.
537
+ */
538
+ ethflowData?: EthflowDataDto;
539
+ /**
540
+ * On-chain placement metadata, when services returns it.
541
+ */
542
+ onchainOrderData?: OnchainOrderDataDto;
543
+ /**
544
+ * Full app-data payload, when services returns it.
545
+ */
546
+ fullAppData?: string;
547
+ /**
548
+ * Settlement contract address against which the order was signed.
549
+ */
550
+ settlementContract: string;
551
+ /**
552
+ * Stored quote metadata for quote-linked orders.
553
+ */
554
+ quote?: StoredOrderQuoteDto;
555
+ /**
556
+ * Optional pre and post interactions associated with the order.
557
+ */
558
+ interactions?: OrderInteractionsDto;
559
+ /**
560
+ * Total fee normalized by the SDK transform layer.
561
+ */
562
+ totalFee?: string;
563
+ }
564
+
565
+ /**
566
+ * Order side accepted by wasm order inputs.
567
+ */
568
+ export type OrderKindDto = "sell" | "buy";
569
+
570
+ /**
571
+ * Order transaction helper parameters.
572
+ */
573
+ export interface OrderTraderParametersInput {
574
+ /**
575
+ * Target order UID.
576
+ */
577
+ orderUid: string;
578
+ /**
579
+ * Optional chain-id override.
580
+ */
581
+ chainId?: number;
582
+ /**
583
+ * Optional environment override.
584
+ */
585
+ env?: string;
586
+ /**
587
+ * Optional settlement-contract overrides keyed by chain id.
588
+ *
589
+ * Typed as `Record` rather than `Map` because the runtime
590
+ * serializer emits a plain JavaScript object for `BTreeMap`
591
+ * fields; the override aligns the declaration with the runtime.
592
+ */
593
+ settlementContractOverride?: Record<string, string>;
594
+ /**
595
+ * Optional `EthFlow` contract overrides keyed by chain id.
596
+ *
597
+ * Typed as `Record` rather than `Map` for the same runtime
598
+ * alignment reason as `settlement_contract_override`.
599
+ */
600
+ ethFlowContractOverride?: Record<string, string>;
601
+ }
602
+
603
+ /**
604
+ * Orderbook order-creation input.
605
+ */
606
+ export interface OrderCreationInput {
607
+ /**
608
+ * Sell-token address.
609
+ */
610
+ sellToken: string;
611
+ /**
612
+ * Buy-token address.
613
+ */
614
+ buyToken: string;
615
+ /**
616
+ * Optional receiver.
617
+ */
618
+ receiver?: string;
619
+ /**
620
+ * Sell amount.
621
+ */
622
+ sellAmount: string;
623
+ /**
624
+ * Buy amount.
625
+ */
626
+ buyAmount: string;
627
+ /**
628
+ * Absolute UNIX expiry timestamp.
629
+ */
630
+ validTo: number;
631
+ /**
632
+ * Inline app-data payload.
633
+ */
634
+ appData?: string;
635
+ /**
636
+ * App-data hash.
637
+ */
638
+ appDataHash?: string;
639
+ /**
640
+ * Order-level fee amount. The orderbook accepts only zero.
641
+ */
642
+ feeAmount?: string;
643
+ /**
644
+ * Strict balance-check flag.
645
+ */
646
+ fullBalanceCheck?: boolean;
647
+ /**
648
+ * Order side.
649
+ */
650
+ kind: OrderKindDto;
651
+ /**
652
+ * Whether partial fills are allowed.
653
+ */
654
+ partiallyFillable?: boolean;
655
+ /**
656
+ * Sell-token balance source.
657
+ */
658
+ sellTokenBalance?: TokenBalanceDto;
659
+ /**
660
+ * Buy-token balance destination.
661
+ */
662
+ buyTokenBalance?: TokenBalanceDto;
663
+ /**
664
+ * Signature scheme.
665
+ */
666
+ signingScheme: string;
667
+ /**
668
+ * Raw signature.
669
+ */
670
+ signature: string;
671
+ /**
672
+ * Effective owner.
673
+ */
674
+ from: string;
675
+ /**
676
+ * Optional quote id.
677
+ */
678
+ quoteId?: number;
679
+ }
680
+
681
+ /**
682
+ * Orderbook quote request input.
683
+ */
684
+ export interface OrderQuoteRequestInput {
685
+ /**
686
+ * Sell-token address.
687
+ */
688
+ sellToken: string;
689
+ /**
690
+ * Buy-token address.
691
+ */
692
+ buyToken: string;
693
+ /**
694
+ * Optional explicit receiver.
695
+ */
696
+ receiver?: string;
697
+ /**
698
+ * Quote owner.
699
+ */
700
+ from: string;
701
+ /**
702
+ * Quote side.
703
+ */
704
+ kind: OrderKindDto;
705
+ /**
706
+ * Sell amount before fee for sell quotes.
707
+ */
708
+ sellAmountBeforeFee?: string;
709
+ /**
710
+ * Buy amount after fee for buy quotes.
711
+ */
712
+ buyAmountAfterFee?: string;
713
+ /**
714
+ * Relative validity duration in seconds.
715
+ */
716
+ validFor?: number;
717
+ /**
718
+ * Absolute UNIX expiry timestamp.
719
+ */
720
+ validTo?: number;
721
+ /**
722
+ * Inline app-data payload.
723
+ */
724
+ appData?: string;
725
+ /**
726
+ * App-data hash.
727
+ */
728
+ appDataHash?: string;
729
+ /**
730
+ * Sell-token balance source.
731
+ */
732
+ sellTokenBalance?: TokenBalanceDto;
733
+ /**
734
+ * Buy-token balance destination.
735
+ */
736
+ buyTokenBalance?: TokenBalanceDto;
737
+ /**
738
+ * Quote-quality mode.
739
+ */
740
+ priceQuality?: string;
741
+ /**
742
+ * Expected signing scheme.
743
+ */
744
+ signingScheme?: string;
745
+ /**
746
+ * Whether the eventual order is expected to be on-chain.
747
+ */
748
+ onchainOrder?: boolean;
749
+ /**
750
+ * Optional verification gas limit.
751
+ */
752
+ verificationGasLimit?: number;
753
+ /**
754
+ * Optional request timeout in milliseconds.
755
+ */
756
+ timeout?: number;
757
+ }
758
+
759
+ /**
760
+ * Pagination options shared by orderbook list helpers.
761
+ */
762
+ export interface PaginationOptions {
763
+ /**
764
+ * Pagination offset.
765
+ */
766
+ offset?: number;
767
+ /**
768
+ * Pagination limit.
769
+ */
770
+ limit?: number;
771
+ }
772
+
773
+ /**
774
+ * Pre/post interactions associated with an order, mirroring
775
+ * `cow_sdk_orderbook::OrderInteractions`.
776
+ */
777
+ export interface OrderInteractionsDto {
778
+ /**
779
+ * Interactions executed before the order\'s trade.
780
+ */
781
+ pre?: InteractionDataDto[];
782
+ /**
783
+ * Interactions executed after the order\'s trade.
784
+ */
785
+ post?: InteractionDataDto[];
786
+ }
787
+
788
+ /**
789
+ * Rate-limiter bucket scope accepted by JS client constructors.
790
+ */
791
+ export type LimiterScopeConfig = "global" | "perHost";
792
+
793
+ /**
794
+ * Raw EVM event log accepted by the on-chain event decoders.
795
+ *
796
+ * `topics` carries the indexed log topics as `0x`-prefixed 32-byte hex
797
+ * strings with topic-0 (the event signature hash) first; `data` is the
798
+ * ABI-encoded non-indexed payload as a `0x`-prefixed hex string (`\"0x\"` for an
799
+ * empty payload).
800
+ */
801
+ export interface EventLogInput {
802
+ /**
803
+ * Indexed log topics as 0x-prefixed 32-byte hex strings (topic-0 first).
804
+ */
805
+ topics: string[];
806
+ /**
807
+ * ABI-encoded non-indexed log data as a 0x-prefixed hex string.
808
+ */
809
+ data: string;
810
+ }
811
+
812
+ /**
813
+ * Raw orderbook quote response, mirroring
814
+ * `cow_sdk_orderbook::OrderQuoteResponse`.
815
+ */
816
+ export interface OrderQuoteResponseDto {
817
+ /**
818
+ * Resolved quote payload.
819
+ */
820
+ quote: QuoteDataDto;
821
+ /**
822
+ * Effective owner used for the quote, when returned by the API.
823
+ */
824
+ from?: string;
825
+ /**
826
+ * Quote price/fee expiry as an ISO-8601 UTC string.
827
+ */
828
+ expiration: string;
829
+ /**
830
+ * Quote identifier used when submitting the corresponding order.
831
+ */
832
+ id?: number;
833
+ /**
834
+ * Whether the quote was verified by the orderbook.
835
+ */
836
+ verified: boolean;
837
+ /**
838
+ * Optional protocol fee basis points for the quote.
839
+ */
840
+ protocolFeeBps?: string;
841
+ }
842
+
843
+ /**
844
+ * Request-rate limiter override accepted by JS client constructors.
845
+ */
846
+ export interface RequestRateLimiterConfig {
847
+ /**
848
+ * Request tokens granted per interval. Zero disables limiting.
849
+ */
850
+ tokensPerInterval?: number;
851
+ /**
852
+ * Limiter interval in milliseconds.
853
+ */
854
+ intervalMs?: number;
855
+ /**
856
+ * Bucket scope.
857
+ */
858
+ scope?: LimiterScopeConfig;
859
+ }
860
+
861
+ /**
862
+ * Resolved quote payload echoed by the orderbook `/quote` response, mirroring
863
+ * `cow_sdk_orderbook::QuoteData`.
864
+ */
865
+ export interface QuoteDataDto {
866
+ /**
867
+ * Sell-token address.
868
+ */
869
+ sellToken: string;
870
+ /**
871
+ * Buy-token address.
872
+ */
873
+ buyToken: string;
874
+ /**
875
+ * Optional receiver override.
876
+ */
877
+ receiver?: string;
878
+ /**
879
+ * Sell amount in the upstream decimal-string wire shape.
880
+ */
881
+ sellAmount: string;
882
+ /**
883
+ * Buy amount in the upstream decimal-string wire shape.
884
+ */
885
+ buyAmount: string;
886
+ /**
887
+ * Absolute UNIX expiry timestamp.
888
+ */
889
+ validTo: number;
890
+ /**
891
+ * Effective app-data hash derived from the orderbook response.
892
+ */
893
+ appData: string;
894
+ /**
895
+ * Explicit app-data hash echoed alongside full app data, when present.
896
+ */
897
+ appDataHash?: string;
898
+ /**
899
+ * Network-cost amount echoed by the orderbook `/quote` response.
900
+ */
901
+ feeAmount: string;
902
+ /**
903
+ * Order kind.
904
+ */
905
+ kind: OrderKindDto;
906
+ /**
907
+ * Whether partial fills are allowed.
908
+ */
909
+ partiallyFillable: boolean;
910
+ /**
911
+ * Sell-token balance source.
912
+ */
913
+ sellTokenBalance: TokenBalanceDto;
914
+ /**
915
+ * Buy-token balance destination.
916
+ */
917
+ buyTokenBalance: TokenBalanceDto;
918
+ /**
919
+ * Estimated gas units for the quoted trade; empty for a locally
920
+ * constructed quote.
921
+ */
922
+ gasAmount?: string;
923
+ /**
924
+ * Estimated gas price at quote time (wei per gas unit).
925
+ */
926
+ gasPrice?: string;
927
+ /**
928
+ * Sell-token price in native-token atoms per sell-token atom.
929
+ */
930
+ sellTokenPrice?: string;
931
+ /**
932
+ * Signing scheme for the quoted order.
933
+ */
934
+ signingScheme: SigningSchemeDto;
935
+ }
936
+
937
+ /**
938
+ * Retry-policy override accepted by JS client constructors.
939
+ */
940
+ export interface RetryPolicyConfig {
941
+ /**
942
+ * Maximum attempts, including the initial request.
943
+ */
944
+ maxAttempts?: number;
945
+ /**
946
+ * Base exponential-backoff delay in milliseconds.
947
+ */
948
+ baseDelayMs?: number;
949
+ /**
950
+ * Maximum exponential-backoff delay in milliseconds.
951
+ */
952
+ maxDelayMs?: number;
953
+ }
954
+
955
+ /**
956
+ * Signature scheme carried on posted and returned orders, mirroring
957
+ * `cow_sdk_orderbook::SigningScheme`, whose wire form is the lowercased
958
+ * variant name.
959
+ */
960
+ export type SigningSchemeDto = "eip712" | "ethsign" | "eip1271" | "presign";
961
+
962
+ /**
963
+ * Signed order DTO returned by wallet callback exports.
964
+ */
965
+ export interface SignedOrderDto {
966
+ /**
967
+ * Compact order UID.
968
+ */
969
+ orderUid: string;
970
+ /**
971
+ * Signature payload submitted to the orderbook.
972
+ */
973
+ signature: string;
974
+ /**
975
+ * Signing scheme.
976
+ */
977
+ signingScheme: string;
978
+ /**
979
+ * Effective owner submitted as `from`.
980
+ */
981
+ from: string;
982
+ /**
983
+ * Underlying order digest.
984
+ */
985
+ orderDigest: string;
986
+ /**
987
+ * Typed-data envelope used for signing.
988
+ */
989
+ typedData: TypedDataEnvelopeDto;
990
+ /**
991
+ * Optional quote id.
992
+ */
993
+ quoteId?: number;
994
+ }
995
+
996
+ /**
997
+ * Signed order-cancellation DTO.
998
+ */
999
+ export interface SignedCancellationsInput {
1000
+ /**
1001
+ * Order UIDs to cancel.
1002
+ */
1003
+ orderUids: string[];
1004
+ /**
1005
+ * Cancellation signature.
1006
+ */
1007
+ signature: string;
1008
+ /**
1009
+ * ECDSA signing scheme.
1010
+ */
1011
+ signingScheme: string;
1012
+ }
1013
+
1014
+ /**
1015
+ * Solver execution entry nested in competition-status responses, mirroring
1016
+ * `cow_sdk_orderbook::SolverExecution`.
1017
+ */
1018
+ export interface SolverExecutionDto {
1019
+ /**
1020
+ * Solver identifier or address rendered by the API.
1021
+ */
1022
+ solver: string;
1023
+ /**
1024
+ * Executed amounts for this solver path, when present.
1025
+ */
1026
+ executedAmounts?: ExecutedAmountsDto;
1027
+ }
1028
+
1029
+ /**
1030
+ * Stored quote metadata for quote-linked orders, mirroring
1031
+ * `cow_sdk_orderbook::StoredOrderQuote`.
1032
+ */
1033
+ export interface StoredOrderQuoteDto {
1034
+ /**
1035
+ * Estimated gas units required to execute the quoted trade.
1036
+ */
1037
+ gasAmount: string;
1038
+ /**
1039
+ * Estimated gas price at quote time, in wei per gas unit.
1040
+ */
1041
+ gasPrice: string;
1042
+ /**
1043
+ * Sell-token price in native-token atoms per sell-token atom.
1044
+ */
1045
+ sellTokenPrice: string;
1046
+ /**
1047
+ * Quoted sell amount.
1048
+ */
1049
+ sellAmount: string;
1050
+ /**
1051
+ * Quoted buy amount.
1052
+ */
1053
+ buyAmount: string;
1054
+ /**
1055
+ * Estimated network fee in sell-token atoms.
1056
+ */
1057
+ feeAmount: string;
1058
+ /**
1059
+ * Solver address that provided the quote.
1060
+ */
1061
+ solver: string;
1062
+ /**
1063
+ * Whether the quote was verified through simulation.
1064
+ */
1065
+ verified: boolean;
1066
+ /**
1067
+ * Additional services-provided quote metadata, when present.
1068
+ */
1069
+ metadata?: Value;
1070
+ }
1071
+
1072
+ /**
1073
+ * Token-balance mode accepted by wasm order inputs.
1074
+ */
1075
+ export type TokenBalanceDto = "erc20" | "external" | "internal";
1076
+
1077
+ /**
1078
+ * Total accumulated surplus for an account, mirroring
1079
+ * `cow_sdk_orderbook::TotalSurplus`.
1080
+ */
1081
+ export interface TotalSurplusDto {
1082
+ /**
1083
+ * Total surplus in the upstream decimal-string wire shape, when present.
1084
+ */
1085
+ totalSurplus?: string;
1086
+ }
1087
+
1088
+ /**
1089
+ * Trade returned by the orderbook trades endpoint, mirroring
1090
+ * `cow_sdk_orderbook::Trade`.
1091
+ */
1092
+ export interface TradeDto {
1093
+ /**
1094
+ * Block number containing the trade event.
1095
+ */
1096
+ blockNumber: number;
1097
+ /**
1098
+ * Log index within the block.
1099
+ */
1100
+ logIndex: number;
1101
+ /**
1102
+ * Order UID associated with the trade.
1103
+ */
1104
+ orderUid: string;
1105
+ /**
1106
+ * Owner address.
1107
+ */
1108
+ owner: string;
1109
+ /**
1110
+ * Sell-token address.
1111
+ */
1112
+ sellToken: string;
1113
+ /**
1114
+ * Buy-token address.
1115
+ */
1116
+ buyToken: string;
1117
+ /**
1118
+ * Executed sell amount in the upstream decimal-string wire shape.
1119
+ */
1120
+ sellAmount: string;
1121
+ /**
1122
+ * Executed sell amount before fees.
1123
+ */
1124
+ sellAmountBeforeFees?: string;
1125
+ /**
1126
+ * Executed buy amount in the upstream decimal-string wire shape.
1127
+ */
1128
+ buyAmount: string;
1129
+ /**
1130
+ * Protocol fees executed as part of the trade, when services returns them.
1131
+ */
1132
+ executedProtocolFees?: ExecutedProtocolFeeDto[];
1133
+ /**
1134
+ * Settlement transaction hash.
1135
+ */
1136
+ txHash: string | undefined;
1137
+ }
1138
+
1139
+ /**
1140
+ * Trades query accepted by `OrderBookClient.getTrades`.
1141
+ */
1142
+ export interface TradesQueryInput {
1143
+ /**
1144
+ * Owner filter. Set exactly one of `owner` or `orderUid`.
1145
+ */
1146
+ owner?: string;
1147
+ /**
1148
+ * Order UID filter. Set exactly one of `owner` or `orderUid`.
1149
+ */
1150
+ orderUid?: string;
1151
+ /**
1152
+ * Pagination offset.
1153
+ */
1154
+ offset?: number;
1155
+ /**
1156
+ * Pagination limit.
1157
+ */
1158
+ limit?: number;
1159
+ }
1160
+
1161
+ /**
1162
+ * Transaction request DTO returned by transaction builders.
1163
+ */
1164
+ export interface TransactionRequestDto {
1165
+ /**
1166
+ * Destination address.
1167
+ */
1168
+ to?: string;
1169
+ /**
1170
+ * Hex-encoded calldata.
1171
+ */
1172
+ data?: string;
1173
+ /**
1174
+ * Native value.
1175
+ */
1176
+ value?: string;
1177
+ /**
1178
+ * Gas limit.
1179
+ */
1180
+ gasLimit?: string;
1181
+ }
1182
+
1183
+ /**
1184
+ * Transport-policy override accepted by JS client constructors.
1185
+ */
1186
+ export interface TransportPolicyConfig {
1187
+ /**
1188
+ * Retry-policy override.
1189
+ */
1190
+ retryPolicy?: RetryPolicyConfig;
1191
+ /**
1192
+ * Rate-limiter override.
1193
+ */
1194
+ requestRateLimiter?: RequestRateLimiterConfig;
1195
+ /**
1196
+ * Retry jitter override.
1197
+ */
1198
+ jitterStrategy?: JitterStrategyConfig;
1199
+ /**
1200
+ * Optional transport user-agent value.
1201
+ */
1202
+ userAgent?: string;
1203
+ }
1204
+
1205
+ /**
1206
+ * Typed-data domain DTO.
1207
+ */
1208
+ export interface TypedDataDomainDto {
1209
+ /**
1210
+ * Domain name.
1211
+ */
1212
+ name: string;
1213
+ /**
1214
+ * Domain version.
1215
+ */
1216
+ version: string;
1217
+ /**
1218
+ * Chain id.
1219
+ */
1220
+ chainId: number;
1221
+ /**
1222
+ * Verifying contract.
1223
+ */
1224
+ verifyingContract: string;
1225
+ }
1226
+
1227
+ /**
1228
+ * Typed-data envelope DTO.
1229
+ */
1230
+ export interface TypedDataEnvelopeDto {
1231
+ /**
1232
+ * Domain metadata.
1233
+ */
1234
+ domain: TypedDataDomainDto;
1235
+ /**
1236
+ * Primary type.
1237
+ */
1238
+ primaryType: string;
1239
+ /**
1240
+ * Type map.
1241
+ *
1242
+ * Typed as `Record` because the runtime serializer
1243
+ * (`serde_wasm_bindgen::Serializer::json_compatible`) emits a
1244
+ * plain JavaScript object for `BTreeMap` fields. The override
1245
+ * aligns the generated TypeScript declaration with the runtime
1246
+ * shape so the declared type matches the value the wasm boundary
1247
+ * emits byte-for-byte.
1248
+ */
1249
+ types: Record<string, TypedDataFieldDto[]>;
1250
+ /**
1251
+ * Parsed message body.
1252
+ */
1253
+ message: Value;
1254
+ }
1255
+
1256
+ /**
1257
+ * Typed-data field DTO.
1258
+ */
1259
+ export interface TypedDataFieldDto {
1260
+ /**
1261
+ * Field name.
1262
+ */
1263
+ name: string;
1264
+ /**
1265
+ * Solidity field type.
1266
+ */
1267
+ type: string;
1268
+ }
1269
+
1270
+ /**
1271
+ * Validated 32-byte app-data hash.
1272
+ *
1273
+ * The wire form is the protocol-canonical `0x`-prefixed 66-character
1274
+ * lowercase hexadecimal string. The newtype is `#[repr(transparent)]`
1275
+ * over [`alloy_primitives::B256`], so the in-memory layout is
1276
+ * bit-for-bit identical to the alloy primitive and conversion at the
1277
+ * alloy seam is free at runtime through [`AppDataHash::as_alloy`]
1278
+ * (borrowed), [`AppDataHash::into_alloy`] (owned), or [`From`] /
1279
+ * [`Into`].
1280
+ *
1281
+ * `AppDataHash` forwards [`Serialize`] / [`Deserialize`] to the inner
1282
+ * [`alloy_primitives::B256`] via `#[serde(transparent)]` because the
1283
+ * alloy lowercase 0x-prefixed default already matches the cow wire
1284
+ * form. [`fmt::Display`] is a one-line delegate to the inner primitive
1285
+ * for the same reason.
1286
+ *
1287
+ * Equality, hash, and ordering derive from the packed 32-byte
1288
+ * representation, which is equivalent to the documented
1289
+ * case-insensitive comparison contract because every valid value parses
1290
+ * to the same bytes regardless of input casing.
1291
+ *
1292
+ *
1293
+ */
1294
+ export type AppDataHash = string;
1295
+
1296
+ /**
1297
+ * Validated EVM address.
1298
+ *
1299
+ * The wire form is the protocol-canonical `0x`-prefixed 42-character
1300
+ * lowercase hexadecimal string. The newtype is `#[repr(transparent)]` over
1301
+ * [`alloy_primitives::Address`], so the in-memory layout is bit-for-bit
1302
+ * identical to the alloy primitive and conversion at the alloy seam is free
1303
+ * at runtime through [`Address::as_alloy`] (borrowed), [`Address::into_alloy`]
1304
+ * (owned), or [`From`] / [`Into`].
1305
+ *
1306
+ * `Address` carries cow-owned [`fmt::Display`], [`Serialize`], and
1307
+ * [`Deserialize`] impls because alloy\'s default `Display` for
1308
+ * [`alloy_primitives::Address`] emits the EIP-55 mixed-case checksum form,
1309
+ * while the cow protocol wire form is lowercase. The cow `Display` impl
1310
+ * writes `format!(\"{:#x}\", self.0)` which routes through alloy\'s
1311
+ * [`fmt::LowerHex`] impl and emits lowercase 0x-prefixed hex.
1312
+ *
1313
+ * [`PartialEq`], [`Eq`], [`Hash`](std::hash::Hash), [`PartialOrd`], and
1314
+ * [`Ord`] derive from the inner alloy primitive, which compares addresses on
1315
+ * the packed 20-byte representation.
1316
+ */
1317
+ export type Address = string;
1318
+
1319
+ /**
1320
+ * Validated `CoW` order UID.
1321
+ *
1322
+ * The wire form is the protocol-canonical `0x`-prefixed 114-character
1323
+ * lowercase hexadecimal string. The newtype is `#[repr(transparent)]` over
1324
+ * [`alloy_primitives::FixedBytes<56>`] and forwards `Display`/`Serialize`/
1325
+ * `Deserialize` to the inner alloy type, whose canonical defaults already
1326
+ * emit the cow lowercase wire form.
1327
+ *
1328
+ *
1329
+ *
1330
+ */
1331
+ export type OrderUid = string;
1332
+
1333
+ /**
1334
+ * Validated hex payload used for calldata and byte blobs.
1335
+ *
1336
+ * The wire form is the protocol-canonical `0x`-prefixed lowercase
1337
+ * hexadecimal string. The newtype is `#[repr(transparent)]` over
1338
+ * [`alloy_primitives::Bytes`] and forwards `Display`/`Serialize`/
1339
+ * `Deserialize` to the inner alloy type, whose canonical defaults already
1340
+ * emit the cow lowercase wire form. Odd-length inputs are left-padded with
1341
+ * one zero nibble during construction so the stored value remains
1342
+ * byte-aligned hex.
1343
+ */
1344
+ export type HexData = string;
1345
+
1346
+ /**
1347
+ * Version tag carried by wasm output and error envelopes.
1348
+ */
1349
+ export type SchemaVersion = "v1" | "__unknown";
1350
+
1351
+ /**
1352
+ * Versioned output envelope.
1353
+ */
1354
+ export interface WasmEnvelope<T> {
1355
+ /**
1356
+ * Schema version.
1357
+ */
1358
+ schemaVersion: SchemaVersion;
1359
+ /**
1360
+ * Envelope payload.
1361
+ */
1362
+ value: T;
1363
+ }
1364
+
1365
+ /**
1366
+ * `EthFlow`-specific order metadata, mirroring
1367
+ * `cow_sdk_orderbook::EthflowData`.
1368
+ */
1369
+ export interface EthflowDataDto {
1370
+ /**
1371
+ * Transaction in which the order was refunded, when present.
1372
+ */
1373
+ refundTxHash?: string;
1374
+ /**
1375
+ * User-facing validity timestamp for the `EthFlow` order.
1376
+ */
1377
+ userValidTo: number;
1378
+ }
1379
+
1380
+
1381
+ /**
1382
+ * Orderbook client backed by an explicitly configured HTTP transport.
1383
+ *
1384
+ * Construct this client when JavaScript needs direct access to quote,
1385
+ * submission, lookup, trade, native-price, app-data, and cancellation orderbook
1386
+ * endpoints. The client owns one callback registration and releases raw wasm
1387
+ * resources through the facade `dispose()` method.
1388
+ */
1389
+ export class OrderBookClient {
1390
+ free(): void;
1391
+ [Symbol.dispose](): void;
1392
+ /**
1393
+ * Submits signed off-chain order cancellations.
1394
+ *
1395
+ * Build the signed cancellation payload with one of the cancellation
1396
+ * signing helpers, then submit it through the same orderbook runtime
1397
+ * configuration used for order operations.
1398
+ *
1399
+ * @param signed Signed cancellation payload.
1400
+ * @param options Optional per-call cancellation and timeout settings.
1401
+ * @returns A versioned envelope containing `{ cancelled: true }` on success.
1402
+ * @throws CowError for invalid UID, signature, transport failure, or timeout.
1403
+ */
1404
+ cancelOrders(signed: SignedCancellationsInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<{ cancelled: true }>>;
1405
+ /**
1406
+ * Fetches the full app-data document registered for an app-data hash.
1407
+ *
1408
+ * Use this to retrieve the canonical app-data payload the orderbook holds
1409
+ * for a given hash, for example to display or re-verify a document
1410
+ * referenced by an order.
1411
+ *
1412
+ * @param appDataHash App-data hash as a `0x`-prefixed 32-byte hex string.
1413
+ * @param options Optional per-call cancellation and timeout settings.
1414
+ * @returns A versioned envelope containing the app-data document.
1415
+ * @throws CowError for an invalid hash, transport failure, or timeout.
1416
+ */
1417
+ getAppData(appDataHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<AppDataObjectDto>>;
1418
+ /**
1419
+ * Fetches a token's native price from the orderbook API.
1420
+ *
1421
+ * The token must be an EVM address. The returned value follows the
1422
+ * orderbook native-price response shape.
1423
+ *
1424
+ * @param token Token address to price.
1425
+ * @param options Optional per-call cancellation and timeout settings.
1426
+ * @returns A versioned envelope containing native price data.
1427
+ * @throws CowError for invalid token address, transport failure, or timeout.
1428
+ */
1429
+ getNativePrice(token: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<NativePriceResponseDto>>;
1430
+ /**
1431
+ * Fetches one order by its canonical order UID.
1432
+ *
1433
+ * The UID must be the full 56-byte CoW order UID encoded as a `0x`-prefixed
1434
+ * string. The response is returned in the orderbook wire DTO shape.
1435
+ *
1436
+ * @param orderUid Full order UID to look up.
1437
+ * @param options Optional per-call cancellation and timeout settings.
1438
+ * @returns A versioned envelope containing the order response.
1439
+ * @throws CowError for invalid UID, not-found responses, transport failure, or timeout.
1440
+ */
1441
+ getOrder(orderUid: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<OrderDto>>;
1442
+ /**
1443
+ * Fetches the live competition status for one order.
1444
+ *
1445
+ * Returns the order's status in the current or most recent solver
1446
+ * competition, including any per-solver executed amounts the service
1447
+ * reports. The UID must be the full 56-byte CoW order UID.
1448
+ *
1449
+ * @param orderUid Full order UID to look up.
1450
+ * @param options Optional per-call cancellation and timeout settings.
1451
+ * @returns A versioned envelope containing the competition status.
1452
+ * @throws CowError for invalid UID, not-found responses, transport failure, or timeout.
1453
+ */
1454
+ getOrderCompetitionStatus(orderUid: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<CompetitionOrderStatusDto>>;
1455
+ /**
1456
+ * Builds the public order-details URL for a UID without any network call.
1457
+ *
1458
+ * @param orderUid Full order UID to link to.
1459
+ * @returns A versioned envelope containing the order-details URL.
1460
+ * @throws CowError for an invalid UID or an unresolved base URL.
1461
+ */
1462
+ getOrderLink(orderUid: string): WasmEnvelope<string>;
1463
+ /**
1464
+ * Fetches an order by UID, falling back across environments on a 404.
1465
+ *
1466
+ * @param orderUid Full order UID to look up.
1467
+ * @param options Optional per-call cancellation and timeout settings.
1468
+ * @returns A versioned envelope containing the order response.
1469
+ * @throws CowError for invalid UID, not-found responses, transport failure, or timeout.
1470
+ */
1471
+ getOrderMultiEnv(orderUid: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<OrderDto>>;
1472
+ /**
1473
+ * Fetches orders owned by an address with optional pagination.
1474
+ *
1475
+ * The owner address is validated before the request is dispatched. The
1476
+ * response preserves the typed orderbook order shape.
1477
+ *
1478
+ * @param owner Owner address to query.
1479
+ * @param pagination Optional offset and limit.
1480
+ * @param options Optional per-call cancellation and timeout settings.
1481
+ * @returns A versioned envelope containing matching orders.
1482
+ * @throws CowError for invalid owner, transport failure, timeout, or cancellation.
1483
+ */
1484
+ getOrders(owner: string, pagination?: PaginationOptions | null, options?: SdkClientOptions | null): Promise<WasmEnvelope<OrderDto[]>>;
1485
+ /**
1486
+ * Fetches a price quote from the orderbook API.
1487
+ *
1488
+ * The request is converted to the typed orderbook quote request and sent
1489
+ * through the configured transport. Per-call options can override the
1490
+ * constructor timeout or attach an `AbortSignal`.
1491
+ *
1492
+ * @param request Quote request DTO.
1493
+ * @param options Optional per-call cancellation and timeout settings.
1494
+ * @returns A versioned envelope containing the quote response.
1495
+ * @throws CowError for invalid input, transport failure, timeout, or cancellation.
1496
+ */
1497
+ getQuote(request: OrderQuoteRequestInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<OrderQuoteResponseDto>>;
1498
+ /**
1499
+ * Fetches the total accumulated surplus for an account.
1500
+ *
1501
+ * Returns the lifetime surplus the protocol has captured for the owner
1502
+ * across its settled orders, in the upstream decimal-string wire shape.
1503
+ *
1504
+ * @param owner Owner address to query.
1505
+ * @param options Optional per-call cancellation and timeout settings.
1506
+ * @returns A versioned envelope containing the total-surplus response.
1507
+ * @throws CowError for invalid owner, transport failure, or timeout.
1508
+ */
1509
+ getTotalSurplus(owner: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<TotalSurplusDto>>;
1510
+ /**
1511
+ * Fetches trades for exactly one owner address or order UID.
1512
+ *
1513
+ * The query must set one of `owner` or `orderUid`, not both. Optional
1514
+ * pagination fields are forwarded to the orderbook request.
1515
+ *
1516
+ * @param query Trade query DTO.
1517
+ * @param options Optional per-call cancellation and timeout settings.
1518
+ * @returns A versioned envelope containing matching trades.
1519
+ * @throws CowError when the query is ambiguous or transport fails.
1520
+ */
1521
+ getTrades(query: TradesQueryInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<TradeDto[]>>;
1522
+ /**
1523
+ * Fetches the orders contained in a settlement transaction.
1524
+ *
1525
+ * @param txHash Settlement transaction hash.
1526
+ * @param options Optional per-call cancellation and timeout settings.
1527
+ * @returns A versioned envelope containing the settled orders.
1528
+ * @throws CowError for an invalid hash, transport failure, timeout, or cancellation.
1529
+ */
1530
+ getTxOrders(txHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<OrderDto[]>>;
1531
+ /**
1532
+ * Fetches the orderbook service version string.
1533
+ *
1534
+ * @param options Optional per-call cancellation and timeout settings.
1535
+ * @returns A versioned envelope containing the service version string.
1536
+ * @throws CowError for transport failure, timeout, or cancellation.
1537
+ */
1538
+ getVersion(options?: SdkClientOptions | null): Promise<WasmEnvelope<string>>;
1539
+ /**
1540
+ * Creates an orderbook client from a single config object.
1541
+ *
1542
+ * The config must include `chainId` and `transport`. The optional
1543
+ * `timeoutMs`, `signal`, and `transportPolicy` fields become defaults for
1544
+ * calls made through this client unless a method call overrides them.
1545
+ *
1546
+ * @param config Orderbook client configuration.
1547
+ * @throws CowError when the chain, environment, transport, or policy is invalid.
1548
+ */
1549
+ constructor(config: OrderBookClientConfig);
1550
+ /**
1551
+ * Submits a signed order to the orderbook.
1552
+ *
1553
+ * The signed DTO normally comes from a signing helper in the same package.
1554
+ * The SDK reconstructs the typed order creation payload and returns the
1555
+ * order UID assigned by the orderbook service.
1556
+ *
1557
+ * @param signed Signed order DTO including typed data, signature, owner, and scheme.
1558
+ * @param options Optional per-call cancellation and timeout settings.
1559
+ * @returns A versioned envelope containing the submitted order UID.
1560
+ * @throws CowError for invalid signatures, transport failure, timeout, or rejection.
1561
+ */
1562
+ sendOrder(signed: SignedOrderDto, options?: SdkClientOptions | null): Promise<WasmEnvelope<string>>;
1563
+ /**
1564
+ * Submits a raw order-creation payload to the orderbook.
1565
+ *
1566
+ * Use this method when the host already has a complete orderbook
1567
+ * `OrderCreation` shape and does not need the facade to reconstruct it
1568
+ * from a signed-order DTO.
1569
+ *
1570
+ * @param input Raw order-creation DTO.
1571
+ * @param options Optional per-call cancellation and timeout settings.
1572
+ * @returns A versioned envelope containing the submitted order UID.
1573
+ * @throws CowError for malformed input, transport failure, timeout, or rejection.
1574
+ */
1575
+ sendOrderCreation(input: OrderCreationInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<string>>;
1576
+ /**
1577
+ * Uploads the full app-data JSON for a content-addressed app-data hash.
1578
+ *
1579
+ * The SDK enforces the content-addressed-write invariant: the keccak-256
1580
+ * digest of `fullAppData` must equal `appDataHash`, or the call rejects
1581
+ * before any network request. Serialize `fullAppData` with the canonical
1582
+ * app-data writer so the digest matches.
1583
+ *
1584
+ * @param appDataHash App-data hash as a `0x`-prefixed 32-byte hex string.
1585
+ * @param fullAppData Canonically serialized app-data JSON payload.
1586
+ * @param options Optional per-call cancellation and timeout settings.
1587
+ * @returns A versioned envelope containing `{ uploaded: true }` on success.
1588
+ * @throws CowError for a hash mismatch, invalid hash, transport failure, or timeout.
1589
+ */
1590
+ uploadAppData(appDataHash: string, fullAppData: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<{ uploaded: true }>>;
1591
+ }
1592
+
1593
+ /**
1594
+ * Initializes the wasm crate's panic hook once.
1595
+ */
1596
+ export function __cow_sdk_wasm_init(): void;
1597
+
1598
+ /**
1599
+ * Builds a settlement cancellation transaction for an order UID.
1600
+ *
1601
+ * The returned transaction request targets the Settlement contract and encodes
1602
+ * `invalidateOrder(bytes)`. The host wallet remains responsible for submitting
1603
+ * and observing the transaction.
1604
+ *
1605
+ * @param params Order UID, chain, environment, and optional deployment override.
1606
+ * @returns A versioned envelope containing the transaction request DTO.
1607
+ * @throws CowError when the chain, deployment, or order UID is invalid.
1608
+ */
1609
+ export function buildCancelOrderTx(params: OrderTraderParametersInput): WasmEnvelope<TransactionRequestDto>;
1610
+
1611
+ /**
1612
+ * Builds a settlement pre-sign transaction for an order UID.
1613
+ *
1614
+ * The returned transaction request targets the Settlement contract and encodes
1615
+ * `setPreSignature(bytes,bool)` with the order UID and `true` flag. The host
1616
+ * wallet remains responsible for transaction submission.
1617
+ *
1618
+ * @param params Order UID, chain, environment, and optional deployment override.
1619
+ * @returns A versioned envelope containing the transaction request DTO.
1620
+ * @throws CowError when the chain, deployment, or order UID is invalid.
1621
+ */
1622
+ export function buildPresignTx(params: OrderTraderParametersInput): WasmEnvelope<TransactionRequestDto>;
1623
+
1624
+ /**
1625
+ * Computes the canonical order UID and order digest for an unsigned order.
1626
+ *
1627
+ * The UID combines the EIP-712 order digest, owner address, and validity
1628
+ * timestamp using the same packing rules as the native Rust SDK.
1629
+ *
1630
+ * @param input Unsigned order fields to hash and pack.
1631
+ * @param chainId EVM chain id used for the EIP-712 domain.
1632
+ * @param owner Order owner address included in the UID suffix.
1633
+ * @returns A versioned envelope with `orderUid` and `orderDigest`.
1634
+ * @throws CowError when the order, owner, or chain id is invalid.
1635
+ */
1636
+ export function computeOrderUid(input: OrderInput, chainId: number, owner: string): WasmEnvelope<GeneratedOrderUidDto>;
1637
+
1638
+ /**
1639
+ * Decodes an eth-flow on-chain order lifecycle event log into a typed event.
1640
+ *
1641
+ * Dispatches on the log's topic-0 across the `CoWSwapOnchainOrders`
1642
+ * `OrderPlacement` / `OrderInvalidation` events and the `CoWSwapEthFlow`
1643
+ * `OrderRefund` event. The decode is fail-closed: the topic set and on-chain
1644
+ * signing scheme are validated and every order UID is length-checked, so a
1645
+ * malformed or hostile log returns a typed error rather than panicking.
1646
+ *
1647
+ * @param log Raw log with `topics` (0x-prefixed 32-byte hex, topic-0 first)
1648
+ * and `data` (0x-prefixed hex, `"0x"` when empty).
1649
+ * @returns A versioned envelope containing the decoded eth-flow event.
1650
+ * @throws CowError when the log is malformed or its topic set matches no known
1651
+ * eth-flow lifecycle event.
1652
+ */
1653
+ export function decodeEthFlowLog(log: EventLogInput): WasmEnvelope<EthFlowEventDto>;
1654
+
1655
+ /**
1656
+ * Decodes a `GPv2Settlement` event log into a typed settlement event.
1657
+ *
1658
+ * Dispatches on the log's topic-0 across `Trade`, `Interaction`, `Settlement`,
1659
+ * `OrderInvalidated`, and `PreSignature`. The decode is fail-closed: the topic
1660
+ * set is validated before ABI decoding and every order UID is length-checked,
1661
+ * so a malformed or hostile log returns a typed error rather than panicking.
1662
+ *
1663
+ * @param log Raw log with `topics` (0x-prefixed 32-byte hex, topic-0 first)
1664
+ * and `data` (0x-prefixed hex, `"0x"` when empty).
1665
+ * @returns A versioned envelope containing the decoded settlement event.
1666
+ * @throws CowError when the log is malformed or its topic set matches no known
1667
+ * settlement event.
1668
+ */
1669
+ export function decodeSettlementLog(log: EventLogInput): WasmEnvelope<SettlementEventDto>;
1670
+
1671
+ /**
1672
+ * Returns canonical CoW Protocol deployment addresses for a chain.
1673
+ *
1674
+ * The optional environment selects production or staging deployment data. When
1675
+ * omitted, the helper uses the SDK default environment.
1676
+ *
1677
+ * @param chainId EVM chain id to resolve.
1678
+ * @param env Optional CoW environment name, such as `prod` or `staging`.
1679
+ * @returns Settlement, VaultRelayer, EthFlow, and AllowListAuth addresses.
1680
+ * @throws CowError when the chain or environment is unsupported.
1681
+ */
1682
+ export function deploymentAddresses(chainId: number, env?: string | null): WasmEnvelope<DeploymentAddressesDto>;
1683
+
1684
+ /**
1685
+ * Computes the CoW Protocol EIP-712 domain separator for a supported chain.
1686
+ *
1687
+ * Use this helper when a JavaScript host needs to compare the domain hash used
1688
+ * by the Rust SDK with another signing stack. The input is an EVM chain id,
1689
+ * not a CoW environment selector.
1690
+ *
1691
+ * @param chainId EVM chain id supported by the deployment registry.
1692
+ * @returns The `0x`-prefixed 32-byte domain separator.
1693
+ * @throws CowError when the chain is not supported.
1694
+ */
1695
+ export function domainSeparator(chainId: number): string;
1696
+
1697
+ /**
1698
+ * Encodes a CoW EIP-1271 payload from an ECDSA order signature.
1699
+ *
1700
+ * Use this pure helper when a smart-account flow already has the wrapped ECDSA
1701
+ * signature and needs the contract-signature payload bytes expected by CoW
1702
+ * Protocol order submission.
1703
+ *
1704
+ * @param input Unsigned order used to derive the EIP-1271 payload.
1705
+ * @param ecdsaSignature Wrapped ECDSA signature as a `0x`-prefixed string.
1706
+ * @returns A versioned envelope containing the encoded EIP-1271 payload.
1707
+ * @throws CowError when the order or signature is invalid.
1708
+ */
1709
+ export function eip1271SignaturePayload(input: OrderInput, ecdsaSignature: string): WasmEnvelope<string>;
1710
+
1711
+ /**
1712
+ * Builds signer-facing EIP-712 typed data for an unsigned order.
1713
+ *
1714
+ * The returned envelope contains the domain, type map, primary type, and
1715
+ * order message that wallet libraries expect for EIP-712 signing. It is
1716
+ * deterministic for the provided order and chain id.
1717
+ *
1718
+ * @param input Unsigned order fields using the facade order DTO shape.
1719
+ * @param chainId EVM chain id used for the EIP-712 domain.
1720
+ * @returns A versioned envelope containing typed-data DTO fields.
1721
+ * @throws CowError when order parsing or chain validation fails.
1722
+ */
1723
+ export function orderTypedData(input: OrderInput, chainId: number): WasmEnvelope<TypedDataEnvelopeDto>;
1724
+
1725
+ /**
1726
+ * Signs a cancellation digest through an explicit `eth_sign` callback.
1727
+ *
1728
+ * The SDK computes the canonical cancellation digest for the provided UIDs and
1729
+ * passes it to the digest signer callback as a `0x`-prefixed string.
1730
+ *
1731
+ * @param orderUids One or more full order UIDs to cancel.
1732
+ * @param chainId EVM chain id used for the cancellation digest.
1733
+ * @param digestSigner Callback that signs the digest string.
1734
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1735
+ * @returns A versioned envelope containing signed cancellations.
1736
+ * @throws CowError for empty input, invalid UID, callback failure, or timeout.
1737
+ */
1738
+ export function signCancellationEthSignDigest(orderUids: string[], chainId: number, digestSigner: DigestSignerCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedCancellationsInput>>;
1739
+
1740
+ /**
1741
+ * Signs cancellation typed data through an EIP-1193 callback.
1742
+ *
1743
+ * The callback receives an `eth_signTypedData_v4` request object. Use this
1744
+ * helper when an injected wallet or wallet client owns typed-data signing.
1745
+ *
1746
+ * @param orderUids One or more full order UIDs to cancel.
1747
+ * @param chainId EVM chain id used for the cancellation domain.
1748
+ * @param owner Owner address included in the EIP-1193 request parameters.
1749
+ * @param requestCallback Callback that executes the EIP-1193 request.
1750
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1751
+ * @returns A versioned envelope containing signed cancellations.
1752
+ * @throws CowError for invalid input, wallet failure, timeout, or cancellation.
1753
+ */
1754
+ export function signCancellationWithEip1193(orderUids: string[], chainId: number, owner: string, requestCallback: Eip1193RequestCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedCancellationsInput>>;
1755
+
1756
+ /**
1757
+ * Signs cancellation typed data through a typed-data callback.
1758
+ *
1759
+ * The SDK builds the batch cancellation EIP-712 payload for the provided order
1760
+ * UIDs and asks the callback to sign it. The response can be submitted through
1761
+ * `OrderBookClient.cancelOrders`.
1762
+ *
1763
+ * @param orderUids One or more full order UIDs to cancel.
1764
+ * @param chainId EVM chain id used for the cancellation domain.
1765
+ * @param typedDataSigner Callback that signs the typed-data envelope.
1766
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1767
+ * @returns A versioned envelope containing signed cancellations.
1768
+ * @throws CowError for empty input, invalid UID, callback failure, or timeout.
1769
+ */
1770
+ export function signCancellationWithTypedDataSigner(orderUids: string[], chainId: number, typedDataSigner: TypedDataSignerCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedCancellationsInput>>;
1771
+
1772
+ /**
1773
+ * Signs an order digest through an explicit `eth_sign` callback.
1774
+ *
1775
+ * The SDK computes the canonical order digest, passes the digest as a
1776
+ * `0x`-prefixed string to the callback, normalizes the signature, and returns
1777
+ * an `ethsign` signed-order DTO.
1778
+ *
1779
+ * @param input Unsigned order fields to sign.
1780
+ * @param chainId EVM chain id used for the digest.
1781
+ * @param owner Owner address used in the generated order UID.
1782
+ * @param digestSigner Callback that signs the digest string.
1783
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1784
+ * @returns A versioned envelope containing the signed order.
1785
+ * @throws CowError for invalid input, callback failure, timeout, or cancellation.
1786
+ */
1787
+ export function signOrderEthSignDigest(input: OrderInput, chainId: number, owner: string, digestSigner: DigestSignerCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedOrderDto>>;
1788
+
1789
+ /**
1790
+ * Signs an order through a custom EIP-1271 callback.
1791
+ *
1792
+ * Use this method when the JavaScript host owns the smart-account or
1793
+ * account-abstraction client and can return the final contract signature
1794
+ * directly. The SDK still builds typed data and the deterministic order UID.
1795
+ *
1796
+ * @param input Unsigned order to sign.
1797
+ * @param chainId EVM chain id for the EIP-712 domain.
1798
+ * @param owner Smart-account owner address used in the generated order UID.
1799
+ * @param customCallback Callback that returns the final EIP-1271 signature.
1800
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1801
+ * @returns A versioned envelope containing the signed-order DTO.
1802
+ * @throws CowError for invalid input, callback failure, timeout, or cancellation.
1803
+ */
1804
+ export function signOrderWithCustomEip1271(input: OrderInput, chainId: number, owner: string, customCallback: CustomEip1271Callback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedOrderDto>>;
1805
+
1806
+ /**
1807
+ * Signs an order through an EIP-1193 request callback.
1808
+ *
1809
+ * The callback receives an `eth_signTypedData_v4` request object with owner
1810
+ * address and serialized typed data. This is the bridge for injected wallets
1811
+ * and wallet-client libraries that expose an EIP-1193-style request function.
1812
+ *
1813
+ * @param input Unsigned order fields to sign.
1814
+ * @param chainId EVM chain id used for the EIP-712 domain.
1815
+ * @param owner Owner address used in the wallet request and order UID.
1816
+ * @param requestCallback Callback that executes the EIP-1193 request.
1817
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1818
+ * @returns A versioned envelope containing the signed order.
1819
+ * @throws CowError for invalid input, wallet failure, timeout, or cancellation.
1820
+ */
1821
+ export function signOrderWithEip1193(input: OrderInput, chainId: number, owner: string, requestCallback: Eip1193RequestCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedOrderDto>>;
1822
+
1823
+ /**
1824
+ * Signs an order through typed-data ECDSA and wraps it as EIP-1271.
1825
+ *
1826
+ * The SDK sends the EIP-712 envelope to the provided typed-data callback,
1827
+ * then converts the returned ECDSA signature into the CoW EIP-1271 payload.
1828
+ * Per-call options may attach cancellation and wallet timeout settings.
1829
+ *
1830
+ * @param input Unsigned order to sign.
1831
+ * @param chainId EVM chain id for the EIP-712 domain.
1832
+ * @param owner Smart-account owner address used in the generated order UID.
1833
+ * @param typedDataSigner Callback that signs the typed-data envelope.
1834
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1835
+ * @returns A versioned envelope containing the signed-order DTO.
1836
+ * @throws CowError for invalid input, callback failure, timeout, or cancellation.
1837
+ */
1838
+ export function signOrderWithEip1271(input: OrderInput, chainId: number, owner: string, typedDataSigner: TypedDataSignerCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedOrderDto>>;
1839
+
1840
+ /**
1841
+ * Signs an order through a typed-data callback.
1842
+ *
1843
+ * The SDK builds the EIP-712 typed-data envelope, passes it to the callback,
1844
+ * normalizes the returned ECDSA signature, and returns the signed-order DTO
1845
+ * with the canonical order UID and digest.
1846
+ *
1847
+ * @param input Unsigned order fields to sign.
1848
+ * @param chainId EVM chain id used for the EIP-712 domain.
1849
+ * @param owner Owner address used in the generated order UID.
1850
+ * @param typedDataSigner Callback that signs the typed-data envelope.
1851
+ * @param options Optional cancellation, timeout, and wallet timeout settings.
1852
+ * @returns A versioned envelope containing the signed order.
1853
+ * @throws CowError for invalid input, callback failure, timeout, or cancellation.
1854
+ */
1855
+ export function signOrderWithTypedDataSigner(input: OrderInput, chainId: number, owner: string, typedDataSigner: TypedDataSignerCallback, options?: SigningOptions | null): Promise<WasmEnvelope<SignedOrderDto>>;
1856
+
1857
+ /**
1858
+ * Returns the EVM chain ids supported by the SDK deployment registry.
1859
+ *
1860
+ * This is a pure helper and does not perform network I/O. The returned list is
1861
+ * suitable for runtime validation, UI selection, or capability checks before a
1862
+ * client is constructed.
1863
+ *
1864
+ * @returns A typed array of supported EVM chain ids.
1865
+ */
1866
+ export function supportedChainIds(): Uint32Array;
1867
+
1868
+ /**
1869
+ * Returns the version of the wasm package runtime.
1870
+ *
1871
+ * The value comes from the Rust package metadata used to build the wasm
1872
+ * artifact and can be included in diagnostics or compatibility checks.
1873
+ *
1874
+ * @returns The semantic version string for this wasm build.
1875
+ */
1876
+ export function wasmVersion(): string;