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

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 (74) hide show
  1. package/README.md +28 -19
  2. package/dist/default/index.cjs +6 -0
  3. package/dist/default/index.d.ts +3 -1
  4. package/dist/default/index.mjs +6 -0
  5. package/dist/{cloudflare/raw/cloudflare.cjs → default/raw/trading-web.cjs} +1 -1
  6. package/dist/{cloudflare/raw/cloudflare.d.ts → default/raw/trading-web.d.ts} +2 -2
  7. package/dist/{cloudflare/raw/cloudflare.js → default/raw/trading-web.js} +1 -1
  8. package/dist/orderbook/index.cjs +6 -0
  9. package/dist/orderbook/index.d.ts +3 -1
  10. package/dist/orderbook/index.mjs +6 -0
  11. package/dist/orderbook/raw/trading-web.cjs +65 -0
  12. package/dist/orderbook/raw/trading-web.d.ts +30 -0
  13. package/dist/orderbook/raw/trading-web.js +29 -0
  14. package/dist/raw/default-bundler/cow_sdk_wasm.d.ts +149 -0
  15. package/dist/raw/default-bundler/cow_sdk_wasm_bg.js +64 -23
  16. package/dist/raw/default-bundler/cow_sdk_wasm_bg.wasm +0 -0
  17. package/dist/raw/default-bundler/cow_sdk_wasm_bg.wasm.d.ts +5 -3
  18. package/dist/raw/default-nodejs/cow_sdk_wasm.cjs +64 -23
  19. package/dist/raw/default-nodejs/cow_sdk_wasm.d.ts +149 -0
  20. package/dist/raw/default-nodejs/cow_sdk_wasm_bg.wasm.d.ts +5 -3
  21. package/dist/raw/orderbook-bundler/cow_sdk_wasm.d.ts +149 -0
  22. package/dist/raw/orderbook-bundler/cow_sdk_wasm_bg.js +63 -22
  23. package/dist/raw/orderbook-bundler/cow_sdk_wasm_bg.wasm +0 -0
  24. package/dist/raw/orderbook-bundler/cow_sdk_wasm_bg.wasm.d.ts +5 -3
  25. package/dist/raw/orderbook-nodejs/cow_sdk_wasm.cjs +63 -22
  26. package/dist/raw/orderbook-nodejs/cow_sdk_wasm.d.ts +149 -0
  27. package/dist/raw/orderbook-nodejs/cow_sdk_wasm_bg.wasm.d.ts +5 -3
  28. package/dist/raw/signing-bundler/cow_sdk_wasm_bg.js +10 -10
  29. package/dist/raw/signing-bundler/cow_sdk_wasm_bg.wasm +0 -0
  30. package/dist/raw/signing-bundler/cow_sdk_wasm_bg.wasm.d.ts +3 -3
  31. package/dist/raw/signing-nodejs/cow_sdk_wasm.cjs +10 -10
  32. package/dist/raw/signing-nodejs/cow_sdk_wasm_bg.wasm.d.ts +3 -3
  33. package/dist/raw/trading-bundler/cow_sdk_wasm.d.ts +2929 -0
  34. package/dist/raw/trading-bundler/cow_sdk_wasm.js +9 -0
  35. package/dist/raw/trading-bundler/cow_sdk_wasm_bg.js +2124 -0
  36. package/dist/raw/trading-bundler/cow_sdk_wasm_bg.wasm +0 -0
  37. package/dist/raw/{cloudflare-web → trading-bundler}/cow_sdk_wasm_bg.wasm.d.ts +5 -3
  38. package/dist/raw/trading-nodejs/cow_sdk_wasm.cjs +2155 -0
  39. package/dist/raw/trading-nodejs/cow_sdk_wasm.d.ts +2929 -0
  40. package/dist/raw/trading-nodejs/cow_sdk_wasm_bg.wasm.d.ts +67 -0
  41. package/dist/raw/{cloudflare-web → trading-web}/cow_sdk_wasm.d.ts +154 -3
  42. package/dist/raw/{cloudflare-web → trading-web}/cow_sdk_wasm.js +64 -23
  43. package/dist/raw/trading-web/cow_sdk_wasm_bg.wasm.d.ts +67 -0
  44. package/dist/signing/raw/trading-web.cjs +65 -0
  45. package/dist/signing/raw/trading-web.d.ts +30 -0
  46. package/dist/signing/raw/trading-web.js +29 -0
  47. package/dist/trading/edge.d.ts +91 -0
  48. package/dist/trading/edge.mjs +240 -0
  49. package/dist/{cloudflare → trading}/index.cjs +18 -1
  50. package/dist/{cloudflare → trading}/index.d.ts +16 -3
  51. package/dist/{cloudflare → trading}/index.mjs +18 -1
  52. package/dist/trading/raw/trading-web.d.ts +30 -0
  53. package/dist/trading/raw/trading-web.js +29 -0
  54. package/dist/trading/raw/trading.cjs +72 -0
  55. package/dist/trading/raw/trading.d.ts +33 -0
  56. package/dist/trading/raw/trading.js +35 -0
  57. package/package.json +39 -10
  58. package/dist/raw/cloudflare-web/cow_sdk_wasm_bg.wasm +0 -0
  59. /package/dist/{cloudflare → trading}/callbacks.cjs +0 -0
  60. /package/dist/{cloudflare → trading}/callbacks.d.ts +0 -0
  61. /package/dist/{cloudflare → trading}/callbacks.js +0 -0
  62. /package/dist/{cloudflare → trading}/envelope.cjs +0 -0
  63. /package/dist/{cloudflare → trading}/envelope.d.ts +0 -0
  64. /package/dist/{cloudflare → trading}/envelope.js +0 -0
  65. /package/dist/{cloudflare → trading}/errors.cjs +0 -0
  66. /package/dist/{cloudflare → trading}/errors.d.ts +0 -0
  67. /package/dist/{cloudflare → trading}/errors.js +0 -0
  68. /package/dist/{cloudflare → trading}/index.js +0 -0
  69. /package/dist/{cloudflare → trading}/internal.cjs +0 -0
  70. /package/dist/{cloudflare → trading}/internal.d.ts +0 -0
  71. /package/dist/{cloudflare → trading}/internal.js +0 -0
  72. /package/dist/{cloudflare → trading}/options.cjs +0 -0
  73. /package/dist/{cloudflare → trading}/options.d.ts +0 -0
  74. /package/dist/{cloudflare → trading}/options.js +0 -0
package/README.md CHANGED
@@ -15,13 +15,19 @@ without depending on a specific wallet library.
15
15
 
16
16
  | You are building... | Choose | Why |
17
17
  | --- | --- | --- |
18
- | Browser dapp with viem, ethers, wagmi, or an EIP-1193 wallet | `@symbiome-forge/cow-sdk-wasm` | Wallet stack stays outside the package behind typed callbacks |
19
- | Browser dapp with a smaller orderbook bundle target | `@symbiome-forge/cow-sdk-wasm/orderbook` | Orderbook and signing subset with a smaller raw wasm budget |
20
- | Node.js 22 or 24 LTS backend | `@symbiome-forge/cow-sdk-wasm` | Node target works without browser polyfills when transport is configured |
21
- | Cloudflare Worker proxying CoW orderbook calls | `@symbiome-forge/cow-sdk-wasm/cloudflare` | Worker-compatible web target and explicit wasm module initialization |
18
+ | Browser dApp — quote, sign, post, cancel (full order lifecycle) with viem, ethers, wagmi, or an EIP-1193 wallet | `@symbiome-forge/cow-sdk-wasm/trading` | Order lifecycle plus app-data, built for a browser bundler (Vite, webpack); wallet stack stays outside the package behind typed callbacks |
19
+ | Browser dApp orderbook reads and cancellation only | `@symbiome-forge/cow-sdk-wasm/orderbook` | Smaller read-focused subset, no trading or app-data |
20
+ | Node.js 22 or 24 LTS backend running order flow | `@symbiome-forge/cow-sdk-wasm/trading` | Same order-lifecycle surface on the Node target, no browser polyfills |
21
+ | Edge runtime — Cloudflare Workers, Deno, or Vercel Edge | `@symbiome-forge/cow-sdk-wasm/trading/edge` | The `trading` flavour's web-target build with explicit wasm module initialization |
22
22
  | Signer service or HSM proxy | `@symbiome-forge/cow-sdk-wasm/signing` | Signing primitives without orderbook, trading, subgraph, or IPFS clients |
23
+ | Everything, including subgraph analytics and IPFS app-data | `@symbiome-forge/cow-sdk-wasm` | The full default surface |
23
24
  | Native Rust service, bot, solver, or treasury automation | `cow-sdk` | Avoids wasm-bindgen and npm packaging entirely |
24
- | Rust app compiled to browser WASM | `cow-sdk-browser-wallet` plus `cow-sdk-core` (browser `FetchTransport`) | Rust-on-wasm path; this package is for JavaScript hosts |
25
+ | Rust app compiled to browser WASM | `cow-sdk` with `cow-sdk-core`'s browser `FetchTransport` (the `wasm32-unknown-unknown` `transport::fetch` module) | Rust-on-wasm path; this package is for JavaScript hosts |
26
+
27
+ The same `trading` flavour serves a browser dApp (bundler target), a Node backend
28
+ (nodejs target), and an edge runtime (web target) from one feature set — pick the
29
+ import by runtime; the package resolves the target through standard conditional
30
+ exports, with `./trading/edge` as the explicit entry for Cloudflare Workers.
25
31
 
26
32
  ## Not in this crate
27
33
 
@@ -141,8 +147,8 @@ const signed = await signOrderWithTypedDataSigner(order, 1, owner, async (envelo
141
147
  ```ts
142
148
  import initialize, {
143
149
  OrderBookClient
144
- } from "@symbiome-forge/cow-sdk-wasm/cloudflare";
145
- import wasmModule from "@symbiome-forge/cow-sdk-wasm/cloudflare/wasm";
150
+ } from "@symbiome-forge/cow-sdk-wasm/trading/edge";
151
+ import wasmModule from "@symbiome-forge/cow-sdk-wasm/trading/edge/wasm";
146
152
 
147
153
  export default {
148
154
  async fetch(request: Request, env: Env): Promise<Response> {
@@ -170,11 +176,12 @@ export default {
170
176
 
171
177
  | Import | Surface | Use when |
172
178
  | --- | --- | --- |
173
- | `@symbiome-forge/cow-sdk-wasm` | Default facade with orderbook, signing, app-data, IPFS, trading, and subgraph | General TypeScript or Node use |
174
- | `@symbiome-forge/cow-sdk-wasm/orderbook` | Orderbook client, cancellation helpers, and signing helpers | Browser dapps that do not need trading or subgraph clients |
179
+ | `@symbiome-forge/cow-sdk-wasm` | Default facade with orderbook, signing, app-data, IPFS, trading, and subgraph | General TypeScript or Node use that needs subgraph or IPFS |
180
+ | `@symbiome-forge/cow-sdk-wasm/trading` | Orderbook, trading, signing, app-data, and cancellation the full order lifecycle | Browser dApps, Node backends, and edge runtimes running order flow |
181
+ | `@symbiome-forge/cow-sdk-wasm/orderbook` | Orderbook client, cancellation helpers, and signing helpers | Read-focused dApps that do not post orders |
175
182
  | `@symbiome-forge/cow-sdk-wasm/signing` | Signing, UID, EIP-1271, deployment, and version helpers | Signer services and HSM-facing adapters |
176
- | `@symbiome-forge/cow-sdk-wasm/cloudflare` | Worker-compatible orderbook and trading facade | Cloudflare Workers |
177
- | `@symbiome-forge/cow-sdk-wasm/cloudflare/wasm` | Raw Worker wasm module asset | Pass to the Cloudflare `initialize` helper |
183
+ | `@symbiome-forge/cow-sdk-wasm/trading/edge` | The `trading` flavour's web-target facade | Edge runtimes (Cloudflare Workers, Deno, Vercel Edge) |
184
+ | `@symbiome-forge/cow-sdk-wasm/trading/edge/wasm` | Raw Worker wasm module asset | Pass to the `initialize` helper |
178
185
 
179
186
  Do not import from `dist/raw` or generated wasm-pack target directories. Raw
180
187
  wasm-bindgen output is package-internal; public imports go through the facade
@@ -183,16 +190,17 @@ subpaths above.
183
190
  ## Performance and bundle size
184
191
 
185
192
  The package is built with release-size settings and a `wasm-opt -Oz` post-pass.
186
- Measured on the `0.1.0-alpha.1` build:
193
+ Measured on the current alpha build:
187
194
 
188
195
  | Flavor | Raw wasm | Brotli | Gzip | Gate |
189
196
  | --- | ---: | ---: | ---: | --- |
190
- | default | 1.59 MiB | 501 KiB | 675 KiB | 3.3 MiB raw / 900 KiB brotli |
191
- | orderbook | 0.99 MiB | 330 KiB | 432 KiB | 1.5 MiB raw / 500 KiB brotli |
192
- | signing | 0.31 MiB | 119 KiB | 142 KiB | 0.9 MiB raw / 300 KiB brotli |
193
- | cloudflare | 1.50 MiB | 478 KiB | 642 KiB | 3.2 MiB raw / 850 KiB brotli / 3,000,000 B gzip (warn at 2,700,000 B) |
197
+ | default | 1.63 MiB | 511 KiB | 689 KiB | 3.3 MiB raw / 900 KiB brotli |
198
+ | orderbook | 1.03 MiB | 341 KiB | 447 KiB | 1.5 MiB raw / 500 KiB brotli |
199
+ | signing | 0.31 MiB | 120 KiB | 142 KiB | 0.9 MiB raw / 300 KiB brotli |
200
+ | trading | 1.54 MiB | 489 KiB | 657 KiB | 3.2 MiB raw / 850 KiB brotli / 3,000,000 B gzip (warn at 2,700,000 B) |
194
201
 
195
- The cloudflare flavor's gzip-compressed artifact is below the current
202
+ The `trading` flavour emits one wasm binary shared across its bundler, nodejs, and
203
+ web targets. Its web-target gzip-compressed artifact is below the current
196
204
  Cloudflare Workers Free compressed-size limit at the time of measurement.
197
205
  Full Workers support still requires release-bundle verification and Worker
198
206
  startup measurement; the release pipeline enforces the gzip byte budget on
@@ -269,8 +277,9 @@ subsets. This package is appropriate for specialized cases:
269
277
  - Single-source-of-truth Rust + TypeScript embedding (one implementation
270
278
  across both runtimes).
271
279
  - Cloudflare Workers (size-compatible with the current Workers Free
272
- compressed-size limit at the time of measurement; full Workers support
273
- pending release-bundle and startup validation).
280
+ compressed-size limit at the time of measurement; the `trading` flavour's
281
+ edge build is built and tested end-to-end in CI (Workers Vitest), within the
282
+ Workers compressed-size budget).
274
283
  - Embeddable signing helpers (the `./signing` flavor is the smallest).
275
284
 
276
285
  The "When to use this SDK" table at the top of this README routes consumers
@@ -150,6 +150,12 @@ class OrderBookClient {
150
150
  async getTotalSurplus(owner, options) {
151
151
  return this.#call((client, merged) => client.getTotalSurplus(owner, merged), options);
152
152
  }
153
+ async getSolverCompetition(auctionId, options) {
154
+ return this.#call((client, merged) => client.getSolverCompetition(auctionId, merged), options);
155
+ }
156
+ async getSolverCompetitionByTxHash(txHash, options) {
157
+ return this.#call((client, merged) => client.getSolverCompetitionByTxHash(txHash, merged), options);
158
+ }
153
159
  async getAppData(appDataHash, options) {
154
160
  return this.#call((client, merged) => client.getAppData(appDataHash, merged), options);
155
161
  }
@@ -30,6 +30,8 @@ export declare class OrderBookClient {
30
30
  getTrades(query: raw.TradesQueryInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.TradeDto[]>>;
31
31
  getOrderCompetitionStatus(orderUid: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.CompetitionOrderStatusDto>>;
32
32
  getTotalSurplus(owner: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.TotalSurplusDto>>;
33
+ getSolverCompetition(auctionId: number, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.SolverCompetitionResponseDto>>;
34
+ getSolverCompetitionByTxHash(txHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.SolverCompetitionResponseDto>>;
33
35
  getAppData(appDataHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.AppDataObjectDto>>;
34
36
  uploadAppData(appDataHash: string, fullAppData: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<{
35
37
  uploaded: true;
@@ -87,7 +89,7 @@ export declare function signOrderWithTypedDataSigner(input: raw.OrderInput, chai
87
89
  export declare function supportedChainIds(): Uint32Array;
88
90
  export declare function validateAppDataDoc(doc: raw.AppDataDocInput): WasmEnvelope<raw.ValidationResultDto>;
89
91
  export declare function wasmVersion(): string;
90
- export type { AllowanceParametersInput, AmountsDto, AppDataDocDto, AppDataDocInput, AppDataInfoDto, AppDataObjectDto, ApprovalParametersInput, BuiltSellNativeCurrencyTxDto, CompetitionOrderStatusDto, CompetitionOrderStatusKindDto, ContractCallDto, CostsDto, CowEip1271SignRequest, CowEnvDto, DeploymentAddressesDto, Eip1193Request, EthFlowEventDto, EthflowDataDto, EventLogInput, ExecutedAmountsDto, ExecutedProtocolFeeDto, FeeComponentDto, GeneratedOrderUidDto, InteractionDataDto, LimitTradeParametersInput, NativePriceResponseDto, NetworkFeeDto, OnchainOrderDataDto, OrderClassDto, OrderCreationInput, OrderDataDto, OrderDto, OrderInput, OrderInteractionsDto, OrderKindDto, OrderPostingResultDto, OrderQuoteRequestInput, OrderQuoteResponseDto, OrderStatusDto, OrderTraderParametersInput, OrderBookRuntimeBindingDto, PaginationOptions, PartnerFeeDto, PartnerFeeInput, PartnerFeePolicyDto, PartnerFeePolicyInput, QuoteAmountsAndCostsDto, QuoteDataDto, QuoteResultsDto, SettlementEventDto, SignedCancellationsInput, SignedOrderDto, SigningSchemeDto, SolverExecutionDto, StoredOrderQuoteDto, SubgraphQueryInput, SwapParametersInput, TokenBalanceDto, TotalSurplusDto, TradeDto, TradeParametersDto, TradesQueryInput, TradingAppDataInfoDto, TransactionRequestDto, TypedDataDomainDto, TypedDataEnvelopeDto, TypedDataFieldDto, ValidationResultDto } from "./raw/default.js";
92
+ export type { AllowanceParametersInput, AmountsDto, AppDataDocDto, AppDataDocInput, AppDataInfoDto, AppDataObjectDto, ApprovalParametersInput, BuiltSellNativeCurrencyTxDto, CompetitionAuctionDto, CompetitionOrderStatusDto, CompetitionOrderStatusKindDto, ContractCallDto, CostsDto, CowEip1271SignRequest, CowEnvDto, DeploymentAddressesDto, Eip1193Request, EthFlowEventDto, EthflowDataDto, EventLogInput, ExecutedAmountsDto, ExecutedProtocolFeeDto, FeeComponentDto, GeneratedOrderUidDto, InteractionDataDto, LimitTradeParametersInput, NativePriceResponseDto, NetworkFeeDto, OnchainOrderDataDto, OrderClassDto, OrderCreationInput, OrderDataDto, OrderDto, OrderInput, OrderInteractionsDto, OrderKindDto, OrderPostingResultDto, OrderQuoteRequestInput, OrderQuoteResponseDto, OrderStatusDto, OrderTraderParametersInput, OrderBookRuntimeBindingDto, PaginationOptions, PartnerFeeDto, PartnerFeeInput, PartnerFeePolicyDto, PartnerFeePolicyInput, QuoteAmountsAndCostsDto, QuoteDataDto, QuoteResultsDto, SettlementEventDto, SignedCancellationsInput, SignedOrderDto, SigningSchemeDto, SolverCompetitionOrderDto, SolverCompetitionResponseDto, SolverExecutionDto, SolverSettlementDto, StoredOrderQuoteDto, SubgraphQueryInput, SwapParametersInput, TokenBalanceDto, TotalSurplusDto, TradeDto, TradeParametersDto, TradesQueryInput, TradingAppDataInfoDto, TransactionRequestDto, TypedDataDomainDto, TypedDataEnvelopeDto, TypedDataFieldDto, ValidationResultDto } from "./raw/default.js";
91
93
  export type { ContractReadCallback, CowEip1271SignCallback, CowEnv, CustomEip1271Callback, DigestSignerCallback, Eip1193RequestCallback, TypedDataSignerCallback } from "./callbacks.js";
92
94
  export type { OrderBookRejectionCategory, CowError } from "./errors.js";
93
95
  export type { SchemaVersion, WasmEnvelope } from "./envelope.js";
@@ -89,6 +89,12 @@ export class OrderBookClient {
89
89
  async getTotalSurplus(owner, options) {
90
90
  return this.#call((client, merged) => client.getTotalSurplus(owner, merged), options);
91
91
  }
92
+ async getSolverCompetition(auctionId, options) {
93
+ return this.#call((client, merged) => client.getSolverCompetition(auctionId, merged), options);
94
+ }
95
+ async getSolverCompetitionByTxHash(txHash, options) {
96
+ return this.#call((client, merged) => client.getSolverCompetitionByTxHash(txHash, merged), options);
97
+ }
92
98
  async getAppData(appDataHash, options) {
93
99
  return this.#call((client, merged) => client.getAppData(appDataHash, merged), options);
94
100
  }
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.wasmVersion = exports.validateAppDataDoc = exports.supportedChainIds = exports.signOrderWithTypedDataSigner = exports.signOrderWithEip1271 = exports.signOrderWithEip1193 = exports.signOrderWithCustomEip1271 = exports.signOrderEthSignDigest = exports.signCancellationWithTypedDataSigner = exports.signCancellationWithEip1193 = exports.signCancellationEthSignDigest = exports.orderTypedData = exports.eip1271SignaturePayload = exports.domainSeparator = exports.deploymentAddresses = exports.decodeSettlementLog = exports.decodeEthFlowLog = exports.computeOrderUid = exports.cidToAppDataHex = exports.buildPresignTx = exports.buildCancelOrderTx = exports.appDataInfo = exports.appDataHexToCid = exports.appDataDoc = exports.__cow_sdk_wasm_init = exports.RawTradingClient = exports.RawOrderBookClient = exports.initializeRaw = void 0;
37
- const cow_sdk_wasm_js_1 = __importStar(require("../../raw/cloudflare-web/cow_sdk_wasm.cjs")), wasm = cow_sdk_wasm_js_1;
37
+ const cow_sdk_wasm_js_1 = __importStar(require("../../raw/trading-web/cow_sdk_wasm.cjs")), wasm = cow_sdk_wasm_js_1;
38
38
  exports.initializeRaw = cow_sdk_wasm_js_1.default;
39
39
  exports.RawOrderBookClient = wasm.OrderBookClient;
40
40
  exports.RawTradingClient = wasm.TradingClient;
@@ -1,5 +1,5 @@
1
- import init, * as wasm from "../../raw/cloudflare-web/cow_sdk_wasm.js";
2
- export type * from "../../raw/cloudflare-web/cow_sdk_wasm.js";
1
+ import init, * as wasm from "../../raw/trading-web/cow_sdk_wasm.js";
2
+ export type * from "../../raw/trading-web/cow_sdk_wasm.js";
3
3
  export declare const initializeRaw: typeof init;
4
4
  export declare const RawOrderBookClient: typeof wasm.OrderBookClient;
5
5
  export declare const RawTradingClient: typeof wasm.TradingClient;
@@ -1,4 +1,4 @@
1
- import init, * as wasm from "../../raw/cloudflare-web/cow_sdk_wasm.js";
1
+ import init, * as wasm from "../../raw/trading-web/cow_sdk_wasm.js";
2
2
  export const initializeRaw = init;
3
3
  export const RawOrderBookClient = wasm.OrderBookClient;
4
4
  export const RawTradingClient = wasm.TradingClient;
@@ -107,6 +107,12 @@ class OrderBookClient {
107
107
  async getTotalSurplus(owner, options) {
108
108
  return this.#call((client, merged) => client.getTotalSurplus(owner, merged), options);
109
109
  }
110
+ async getSolverCompetition(auctionId, options) {
111
+ return this.#call((client, merged) => client.getSolverCompetition(auctionId, merged), options);
112
+ }
113
+ async getSolverCompetitionByTxHash(txHash, options) {
114
+ return this.#call((client, merged) => client.getSolverCompetitionByTxHash(txHash, merged), options);
115
+ }
110
116
  async getAppData(appDataHash, options) {
111
117
  return this.#call((client, merged) => client.getAppData(appDataHash, merged), options);
112
118
  }
@@ -22,6 +22,8 @@ export declare class OrderBookClient {
22
22
  getTrades(query: raw.TradesQueryInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.TradeDto[]>>;
23
23
  getOrderCompetitionStatus(orderUid: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.CompetitionOrderStatusDto>>;
24
24
  getTotalSurplus(owner: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.TotalSurplusDto>>;
25
+ getSolverCompetition(auctionId: number, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.SolverCompetitionResponseDto>>;
26
+ getSolverCompetitionByTxHash(txHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.SolverCompetitionResponseDto>>;
25
27
  getAppData(appDataHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<raw.AppDataObjectDto>>;
26
28
  uploadAppData(appDataHash: string, fullAppData: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<{
27
29
  uploaded: true;
@@ -50,7 +52,7 @@ export declare function signOrderWithEip1271(input: raw.OrderInput, chainId: num
50
52
  export declare function signOrderWithTypedDataSigner(input: raw.OrderInput, chainId: number, owner: string, typedDataSigner: TypedDataSignerCallback, options?: SigningOptions | null): Promise<WasmEnvelope<raw.SignedOrderDto>>;
51
53
  export declare function supportedChainIds(): Uint32Array;
52
54
  export declare function wasmVersion(): string;
53
- export type { AppDataObjectDto, CompetitionOrderStatusDto, CompetitionOrderStatusKindDto, CowEip1271SignRequest, DeploymentAddressesDto, Eip1193Request, EthFlowEventDto, EthflowDataDto, EventLogInput, ExecutedAmountsDto, ExecutedProtocolFeeDto, GeneratedOrderUidDto, InteractionDataDto, NativePriceResponseDto, OnchainOrderDataDto, OrderClassDto, OrderCreationInput, OrderDto, OrderInput, OrderInteractionsDto, OrderKindDto, OrderQuoteRequestInput, OrderQuoteResponseDto, OrderStatusDto, OrderTraderParametersInput, PaginationOptions, QuoteDataDto, SettlementEventDto, SignedCancellationsInput, SignedOrderDto, SigningSchemeDto, SolverExecutionDto, StoredOrderQuoteDto, TokenBalanceDto, TotalSurplusDto, TradeDto, TradesQueryInput, TransactionRequestDto, TypedDataDomainDto, TypedDataEnvelopeDto, TypedDataFieldDto } from "./raw/orderbook.js";
55
+ export type { AppDataObjectDto, CompetitionAuctionDto, CompetitionOrderStatusDto, CompetitionOrderStatusKindDto, CowEip1271SignRequest, DeploymentAddressesDto, Eip1193Request, EthFlowEventDto, EthflowDataDto, EventLogInput, ExecutedAmountsDto, ExecutedProtocolFeeDto, GeneratedOrderUidDto, InteractionDataDto, NativePriceResponseDto, OnchainOrderDataDto, OrderClassDto, OrderCreationInput, OrderDto, OrderInput, OrderInteractionsDto, OrderKindDto, OrderQuoteRequestInput, OrderQuoteResponseDto, OrderStatusDto, OrderTraderParametersInput, PaginationOptions, QuoteDataDto, SettlementEventDto, SignedCancellationsInput, SignedOrderDto, SigningSchemeDto, SolverCompetitionOrderDto, SolverCompetitionResponseDto, SolverExecutionDto, SolverSettlementDto, StoredOrderQuoteDto, TokenBalanceDto, TotalSurplusDto, TradeDto, TradesQueryInput, TransactionRequestDto, TypedDataDomainDto, TypedDataEnvelopeDto, TypedDataFieldDto } from "./raw/orderbook.js";
54
56
  export type { CowEip1271SignCallback, CowEnv, CustomEip1271Callback, DigestSignerCallback, Eip1193RequestCallback, TypedDataSignerCallback } from "./callbacks.js";
55
57
  export type { OrderBookRejectionCategory, CowError } from "./errors.js";
56
58
  export type { SchemaVersion, WasmEnvelope } from "./envelope.js";
@@ -52,6 +52,12 @@ export class OrderBookClient {
52
52
  async getTotalSurplus(owner, options) {
53
53
  return this.#call((client, merged) => client.getTotalSurplus(owner, merged), options);
54
54
  }
55
+ async getSolverCompetition(auctionId, options) {
56
+ return this.#call((client, merged) => client.getSolverCompetition(auctionId, merged), options);
57
+ }
58
+ async getSolverCompetitionByTxHash(txHash, options) {
59
+ return this.#call((client, merged) => client.getSolverCompetitionByTxHash(txHash, merged), options);
60
+ }
55
61
  async getAppData(appDataHash, options) {
56
62
  return this.#call((client, merged) => client.getAppData(appDataHash, merged), options);
57
63
  }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.wasmVersion = exports.validateAppDataDoc = exports.supportedChainIds = exports.signOrderWithTypedDataSigner = exports.signOrderWithEip1271 = exports.signOrderWithEip1193 = exports.signOrderWithCustomEip1271 = exports.signOrderEthSignDigest = exports.signCancellationWithTypedDataSigner = exports.signCancellationWithEip1193 = exports.signCancellationEthSignDigest = exports.orderTypedData = exports.eip1271SignaturePayload = exports.domainSeparator = exports.deploymentAddresses = exports.decodeSettlementLog = exports.decodeEthFlowLog = exports.computeOrderUid = exports.cidToAppDataHex = exports.buildPresignTx = exports.buildCancelOrderTx = exports.appDataInfo = exports.appDataHexToCid = exports.appDataDoc = exports.__cow_sdk_wasm_init = exports.RawTradingClient = exports.RawOrderBookClient = exports.initializeRaw = void 0;
37
+ const cow_sdk_wasm_js_1 = __importStar(require("../../raw/trading-web/cow_sdk_wasm.cjs")), wasm = cow_sdk_wasm_js_1;
38
+ exports.initializeRaw = cow_sdk_wasm_js_1.default;
39
+ exports.RawOrderBookClient = wasm.OrderBookClient;
40
+ exports.RawTradingClient = wasm.TradingClient;
41
+ exports.__cow_sdk_wasm_init = wasm.__cow_sdk_wasm_init;
42
+ exports.appDataDoc = wasm.appDataDoc;
43
+ exports.appDataHexToCid = wasm.appDataHexToCid;
44
+ exports.appDataInfo = wasm.appDataInfo;
45
+ exports.buildCancelOrderTx = wasm.buildCancelOrderTx;
46
+ exports.buildPresignTx = wasm.buildPresignTx;
47
+ exports.cidToAppDataHex = wasm.cidToAppDataHex;
48
+ exports.computeOrderUid = wasm.computeOrderUid;
49
+ exports.decodeEthFlowLog = wasm.decodeEthFlowLog;
50
+ exports.decodeSettlementLog = wasm.decodeSettlementLog;
51
+ exports.deploymentAddresses = wasm.deploymentAddresses;
52
+ exports.domainSeparator = wasm.domainSeparator;
53
+ exports.eip1271SignaturePayload = wasm.eip1271SignaturePayload;
54
+ exports.orderTypedData = wasm.orderTypedData;
55
+ exports.signCancellationEthSignDigest = wasm.signCancellationEthSignDigest;
56
+ exports.signCancellationWithEip1193 = wasm.signCancellationWithEip1193;
57
+ exports.signCancellationWithTypedDataSigner = wasm.signCancellationWithTypedDataSigner;
58
+ exports.signOrderEthSignDigest = wasm.signOrderEthSignDigest;
59
+ exports.signOrderWithCustomEip1271 = wasm.signOrderWithCustomEip1271;
60
+ exports.signOrderWithEip1193 = wasm.signOrderWithEip1193;
61
+ exports.signOrderWithEip1271 = wasm.signOrderWithEip1271;
62
+ exports.signOrderWithTypedDataSigner = wasm.signOrderWithTypedDataSigner;
63
+ exports.supportedChainIds = wasm.supportedChainIds;
64
+ exports.validateAppDataDoc = wasm.validateAppDataDoc;
65
+ exports.wasmVersion = wasm.wasmVersion;
@@ -0,0 +1,30 @@
1
+ import init, * as wasm from "../../raw/trading-web/cow_sdk_wasm.js";
2
+ export type * from "../../raw/trading-web/cow_sdk_wasm.js";
3
+ export declare const initializeRaw: typeof init;
4
+ export declare const RawOrderBookClient: typeof wasm.OrderBookClient;
5
+ export declare const RawTradingClient: typeof wasm.TradingClient;
6
+ export declare const __cow_sdk_wasm_init: typeof wasm.__cow_sdk_wasm_init;
7
+ export declare const appDataDoc: typeof wasm.appDataDoc;
8
+ export declare const appDataHexToCid: typeof wasm.appDataHexToCid;
9
+ export declare const appDataInfo: typeof wasm.appDataInfo;
10
+ export declare const buildCancelOrderTx: typeof wasm.buildCancelOrderTx;
11
+ export declare const buildPresignTx: typeof wasm.buildPresignTx;
12
+ export declare const cidToAppDataHex: typeof wasm.cidToAppDataHex;
13
+ export declare const computeOrderUid: typeof wasm.computeOrderUid;
14
+ export declare const decodeEthFlowLog: typeof wasm.decodeEthFlowLog;
15
+ export declare const decodeSettlementLog: typeof wasm.decodeSettlementLog;
16
+ export declare const deploymentAddresses: typeof wasm.deploymentAddresses;
17
+ export declare const domainSeparator: typeof wasm.domainSeparator;
18
+ export declare const eip1271SignaturePayload: typeof wasm.eip1271SignaturePayload;
19
+ export declare const orderTypedData: typeof wasm.orderTypedData;
20
+ export declare const signCancellationEthSignDigest: typeof wasm.signCancellationEthSignDigest;
21
+ export declare const signCancellationWithEip1193: typeof wasm.signCancellationWithEip1193;
22
+ export declare const signCancellationWithTypedDataSigner: typeof wasm.signCancellationWithTypedDataSigner;
23
+ export declare const signOrderEthSignDigest: typeof wasm.signOrderEthSignDigest;
24
+ export declare const signOrderWithCustomEip1271: typeof wasm.signOrderWithCustomEip1271;
25
+ export declare const signOrderWithEip1193: typeof wasm.signOrderWithEip1193;
26
+ export declare const signOrderWithEip1271: typeof wasm.signOrderWithEip1271;
27
+ export declare const signOrderWithTypedDataSigner: typeof wasm.signOrderWithTypedDataSigner;
28
+ export declare const supportedChainIds: typeof wasm.supportedChainIds;
29
+ export declare const validateAppDataDoc: typeof wasm.validateAppDataDoc;
30
+ export declare const wasmVersion: typeof wasm.wasmVersion;
@@ -0,0 +1,29 @@
1
+ import init, * as wasm from "../../raw/trading-web/cow_sdk_wasm.js";
2
+ export const initializeRaw = init;
3
+ export const RawOrderBookClient = wasm.OrderBookClient;
4
+ export const RawTradingClient = wasm.TradingClient;
5
+ export const __cow_sdk_wasm_init = wasm.__cow_sdk_wasm_init;
6
+ export const appDataDoc = wasm.appDataDoc;
7
+ export const appDataHexToCid = wasm.appDataHexToCid;
8
+ export const appDataInfo = wasm.appDataInfo;
9
+ export const buildCancelOrderTx = wasm.buildCancelOrderTx;
10
+ export const buildPresignTx = wasm.buildPresignTx;
11
+ export const cidToAppDataHex = wasm.cidToAppDataHex;
12
+ export const computeOrderUid = wasm.computeOrderUid;
13
+ export const decodeEthFlowLog = wasm.decodeEthFlowLog;
14
+ export const decodeSettlementLog = wasm.decodeSettlementLog;
15
+ export const deploymentAddresses = wasm.deploymentAddresses;
16
+ export const domainSeparator = wasm.domainSeparator;
17
+ export const eip1271SignaturePayload = wasm.eip1271SignaturePayload;
18
+ export const orderTypedData = wasm.orderTypedData;
19
+ export const signCancellationEthSignDigest = wasm.signCancellationEthSignDigest;
20
+ export const signCancellationWithEip1193 = wasm.signCancellationWithEip1193;
21
+ export const signCancellationWithTypedDataSigner = wasm.signCancellationWithTypedDataSigner;
22
+ export const signOrderEthSignDigest = wasm.signOrderEthSignDigest;
23
+ export const signOrderWithCustomEip1271 = wasm.signOrderWithCustomEip1271;
24
+ export const signOrderWithEip1193 = wasm.signOrderWithEip1193;
25
+ export const signOrderWithEip1271 = wasm.signOrderWithEip1271;
26
+ export const signOrderWithTypedDataSigner = wasm.signOrderWithTypedDataSigner;
27
+ export const supportedChainIds = wasm.supportedChainIds;
28
+ export const validateAppDataDoc = wasm.validateAppDataDoc;
29
+ export const wasmVersion = wasm.wasmVersion;
@@ -287,6 +287,21 @@ export interface ApprovalParametersInput {
287
287
  vaultRelayerOverride?: string;
288
288
  }
289
289
 
290
+ /**
291
+ * Auction snapshot nested in a solver-competition response, mirroring
292
+ * `cow_sdk_orderbook::CompetitionAuction`.
293
+ */
294
+ export interface CompetitionAuctionDto {
295
+ /**
296
+ * Order UIDs included in the auction.
297
+ */
298
+ orders?: string[];
299
+ /**
300
+ * Reference prices keyed by token address.
301
+ */
302
+ prices?: Record<string, string>;
303
+ }
304
+
290
305
  /**
291
306
  * Coarse, switchable classification of an orderbook rejection, mirrored for
292
307
  * the JS error surface.
@@ -787,6 +802,77 @@ export interface OnchainOrderDataDto {
787
802
  placementError?: string;
788
803
  }
789
804
 
805
+ /**
806
+ * One order touched by a solver settlement, mirroring
807
+ * `cow_sdk_orderbook::SolverCompetitionOrder`.
808
+ */
809
+ export interface SolverCompetitionOrderDto {
810
+ /**
811
+ * Order UID.
812
+ */
813
+ id: string;
814
+ /**
815
+ * Sell amount in the upstream decimal-string wire shape.
816
+ */
817
+ sellAmount: string;
818
+ /**
819
+ * Buy amount in the upstream decimal-string wire shape.
820
+ */
821
+ buyAmount: string;
822
+ /**
823
+ * Buy-token address, when the service returns it.
824
+ */
825
+ buyToken?: string;
826
+ /**
827
+ * Sell-token address, when the service returns it.
828
+ */
829
+ sellToken?: string;
830
+ }
831
+
832
+ /**
833
+ * One solver\'s settlement entry in a competition, mirroring
834
+ * `cow_sdk_orderbook::SolverSettlement`.
835
+ */
836
+ export interface SolverSettlementDto {
837
+ /**
838
+ * On-chain executor address (the zero address for legacy settlements).
839
+ */
840
+ solverAddress: string;
841
+ /**
842
+ * CIP-20 score in the upstream decimal-string wire shape.
843
+ */
844
+ score: string;
845
+ /**
846
+ * Position in the total ranking.
847
+ */
848
+ ranking: number;
849
+ /**
850
+ * Clearing prices keyed by token address (deprecated; empty for recent
851
+ * auctions).
852
+ */
853
+ clearingPrices?: Record<string, string>;
854
+ /**
855
+ * Orders touched by this settlement.
856
+ */
857
+ orders?: SolverCompetitionOrderDto[];
858
+ /**
859
+ * Whether this solver received the right to execute.
860
+ */
861
+ isWinner: boolean;
862
+ /**
863
+ * Whether this solution was filtered out under CIP-67.
864
+ */
865
+ filteredOut: boolean;
866
+ /**
867
+ * CIP-67 reference score, when available.
868
+ */
869
+ referenceScore?: string;
870
+ /**
871
+ * Settlement transaction hash, when available.
872
+ */
873
+ txHash?: string;
874
+ }
875
+
790
876
  /**
791
877
  * One typed partner-fee policy object, mirroring
792
878
  * `cow_sdk_app_data::PartnerFeePolicy`.
@@ -1586,6 +1672,42 @@ export interface SolverExecutionDto {
1586
1672
  executedAmounts?: ExecutedAmountsDto;
1587
1673
  }
1588
1674
 
1675
+ /**
1676
+ * Solver-competition result for an auction, mirroring
1677
+ * `cow_sdk_orderbook::SolverCompetitionResponse` (the CIP-67 contract served at
1678
+ * the `/api/v2/solver_competition/*` routes).
1679
+ */
1680
+ export interface SolverCompetitionResponseDto {
1681
+ /**
1682
+ * Auction identifier.
1683
+ */
1684
+ auctionId: number;
1685
+ /**
1686
+ * Block the auction started on.
1687
+ */
1688
+ auctionStartBlock: number;
1689
+ /**
1690
+ * Block deadline by which the auction must settle.
1691
+ */
1692
+ auctionDeadlineBlock: number;
1693
+ /**
1694
+ * Winning-solution transaction hashes.
1695
+ */
1696
+ transactionHashes?: string[];
1697
+ /**
1698
+ * CIP-67 per-winning-solver reference scores keyed by solver address.
1699
+ */
1700
+ referenceScores?: Record<string, string>;
1701
+ /**
1702
+ * Auction snapshot.
1703
+ */
1704
+ auction: CompetitionAuctionDto;
1705
+ /**
1706
+ * Per-solver settlements.
1707
+ */
1708
+ solutions?: SolverSettlementDto[];
1709
+ }
1710
+
1589
1711
  /**
1590
1712
  * Stepwise quote amounts and cost components across the quote lifecycle.
1591
1713
  */
@@ -2270,6 +2392,33 @@ export class OrderBookClient {
2270
2392
  * @throws CowError for invalid input, transport failure, timeout, or cancellation.
2271
2393
  */
2272
2394
  getQuote(request: OrderQuoteRequestInput, options?: SdkClientOptions | null): Promise<WasmEnvelope<OrderQuoteResponseDto>>;
2395
+ /**
2396
+ * Fetches the solver-competition result for an auction.
2397
+ *
2398
+ * Returns the solver competition the protocol ran for the auction: the
2399
+ * winning solvers, their scores and rankings, the auction snapshot, and the
2400
+ * per-solver settlements, in the upstream wire shape. Targets the v2
2401
+ * `/api/v2/solver_competition/{auctionId}` route.
2402
+ *
2403
+ * @param auctionId Auction id to look up (a non-negative integer).
2404
+ * @param options Optional per-call cancellation and timeout settings.
2405
+ * @returns A versioned envelope containing the solver-competition response.
2406
+ * @throws CowError for an out-of-range id, not-found responses, transport failure, or timeout.
2407
+ */
2408
+ getSolverCompetition(auctionId: number, options?: SdkClientOptions | null): Promise<WasmEnvelope<SolverCompetitionResponseDto>>;
2409
+ /**
2410
+ * Fetches the solver-competition result by settlement transaction hash.
2411
+ *
2412
+ * Like `getSolverCompetition`, keyed by the settlement transaction hash
2413
+ * rather than the auction id. Targets the v2
2414
+ * `/api/v2/solver_competition/by_tx_hash/{txHash}` route.
2415
+ *
2416
+ * @param txHash Settlement transaction hash as a `0x`-prefixed 32-byte hex string.
2417
+ * @param options Optional per-call cancellation and timeout settings.
2418
+ * @returns A versioned envelope containing the solver-competition response.
2419
+ * @throws CowError for an invalid hash, not-found responses, transport failure, or timeout.
2420
+ */
2421
+ getSolverCompetitionByTxHash(txHash: string, options?: SdkClientOptions | null): Promise<WasmEnvelope<SolverCompetitionResponseDto>>;
2273
2422
  /**
2274
2423
  * Fetches the total accumulated surplus for an account.
2275
2424
  *