@cancore/contracts 0.1.0 → 0.2.0-rc.6

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 (50) hide show
  1. package/README.md +266 -10
  2. package/dist/abi.d.ts +6086 -1675
  3. package/dist/abi.js +1 -1
  4. package/dist/{chunk-CIBYXHSX.js → chunk-IAPV7XWJ.js} +2 -2
  5. package/dist/chunk-IAPV7XWJ.js.map +1 -0
  6. package/dist/chunk-NV5IUURP.js +9252 -0
  7. package/dist/chunk-NV5IUURP.js.map +1 -0
  8. package/dist/index.d.ts +1180 -29
  9. package/dist/index.js +2600 -17
  10. package/dist/index.js.map +1 -1
  11. package/dist/networks.d.ts +2 -2
  12. package/dist/networks.js +1 -1
  13. package/package.json +10 -8
  14. package/spec/abi/AttestorSet.json +476 -0
  15. package/spec/abi/CNRX.json +1294 -0
  16. package/spec/abi/CNRXStaking.json +510 -0
  17. package/spec/abi/CancoreRouter.json +2564 -0
  18. package/spec/abi/FeeVault.json +604 -0
  19. package/spec/abi/HTLC.json +717 -0
  20. package/spec/abi/IBurnMintERC20.json +252 -0
  21. package/spec/abi/ICancoreRouter.json +1226 -0
  22. package/spec/abi/IHTLC.json +382 -0
  23. package/spec/abi/IPermit2.json +150 -0
  24. package/spec/abi/MultiBalanceChecker.json +34 -0
  25. package/spec/abi/PointsClaim.json +791 -0
  26. package/spec/protocol/asyncapi.json +1288 -0
  27. package/spec/protocol/messages.schema.json +525 -0
  28. package/spec/protocol/records.schema.json +94 -0
  29. package/spec/protocol/rest.schema.json +118 -0
  30. package/spec/protocol/typed-data/FillerAuth.json +58 -0
  31. package/spec/protocol/typed-data/FillerKeyRegistration.json +69 -0
  32. package/spec/protocol/typed-data/FillerMessage.json +115 -0
  33. package/spec/protocol/typed-data/FillerQuote.json +75 -0
  34. package/spec/protocol/typed-data/GatewayMessage.json +93 -0
  35. package/spec/protocol/typed-data/StakeBinding.json +75 -0
  36. package/spec/protocol/typed-data/TicketIntent.json +113 -0
  37. package/spec/protocol/typed-data/TicketReceipt.json +51 -0
  38. package/spec/protocol/vectors/draw.json +61 -0
  39. package/spec/protocol/vectors/jcs.json +59 -0
  40. package/spec/protocol/vectors/messages.json +523 -0
  41. package/spec/protocol/vectors/records.json +81 -0
  42. package/spec/protocol/vectors/settle-attestations.json +542 -0
  43. package/spec/typed-data/FillProof.json +227 -0
  44. package/spec/typed-data/FillTicket.json +115 -0
  45. package/spec/typed-data/Order.json +141 -0
  46. package/spec/typed-data/Quote.json +69 -0
  47. package/spec/vectors/canton-order.json +67 -0
  48. package/dist/chunk-CIBYXHSX.js.map +0 -1
  49. package/dist/chunk-ZSX67S72.js +0 -3423
  50. package/dist/chunk-ZSX67S72.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { CNRX_ABI, CNRX_ERRORS, FEE_VAULT_ABI, FEE_VAULT_ERRORS, HTLC_ABI, HTLC_ERRORS, IBURN_MINT_ERC20_ABI, IHTLC_ABI, IPERMIT2_ABI, MULTI_BALANCE_CHECKER_ABI } from './abi.js';
1
+ export { ATTESTOR_SET_ABI, ATTESTOR_SET_ERRORS, CANCORE_ROUTER_ABI, CANCORE_ROUTER_ERRORS, CNRX_ABI, CNRX_ERRORS, CNRX_STAKING_ABI, CNRX_STAKING_ERRORS, FEE_VAULT_ABI, FEE_VAULT_ERRORS, HTLC_ABI, HTLC_ERRORS, IBURN_MINT_ERC20_ABI, ICANCORE_ROUTER_ABI, ICANCORE_ROUTER_ERRORS, IHTLC_ABI, IPERMIT2_ABI, MULTI_BALANCE_CHECKER_ABI, POINTS_CLAIM_ABI, POINTS_CLAIM_ERRORS } from './abi.js';
2
2
  export { NETWORKS, NETWORK_ALIASES, Network, NetworkKind, networkByChainId, networkKindOf, networkOf } from './networks.js';
3
3
 
4
4
  /**
@@ -10,9 +10,10 @@ export { NETWORKS, NETWORK_ALIASES, Network, NetworkKind, networkByChainId, netw
10
10
  * the backend of that period talks to; `htlcBlock` is where to start an event
11
11
  * scan, not before.
12
12
  *
13
- * `BYTECODE_HASHES` is the check: the runtime code at any `htlc` address below
14
- * hashes to `BYTECODE_HASHES.HTLC.deployedBytecodeHash` for the release it was
15
- * deployed from. An address alone is a claim; the hash is the proof.
13
+ * `BUILD_HASHES` pins the build of each release: sha256 of the UTF-8 text of
14
+ * the artifact's 0x-prefixed hex, not keccak256 and not over `eth_getCode`, so it
15
+ * identifies what was built rather than proving what an address runs
16
+ * (immutables alone change runtime code).
16
17
  */
17
18
  type DeploymentEnv = 'mainnet' | 'testnet' | 'devnet';
18
19
  interface EvmDeployment {
@@ -29,13 +30,53 @@ declare const DEPLOYMENTS: Readonly<Record<DeploymentEnv, readonly EvmDeployment
29
30
  declare const PERMIT2_ADDRESS: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
30
31
  declare function deploymentOf(env: DeploymentEnv, network: string): EvmDeployment | undefined;
31
32
 
32
- /**
33
- * The EIP-712 voucher `FeeVault.redeem` accepts: a signer the vault trusts
34
- * signs `FeeClaim` over this domain, and whoever holds the signature redeems it
35
- * on-chain. The struct and the domain are the contract's — this file has to
36
- * stay in lock-step with `FeeVault.sol` and with the backend's signer, which is
37
- * why both are written here once rather than re-typed by each consumer.
38
- */
33
+ /** `FillProof(uint8 kind,bytes32 orderHash,bytes32 destination,bytes32 fillRef,bytes32 recipient,bytes32 outputAsset,uint256 amountDelivered,uint64 filledAt,bytes32 fillerId,bytes32 repayTo,uint32 attempt,uint32 setId)` — from evm-contracts/abi/typed-data/FillProof.json. */
34
+ declare const FILL_PROOF_TYPES: {
35
+ readonly FillProof: readonly [{
36
+ readonly name: "kind";
37
+ readonly type: "uint8";
38
+ }, {
39
+ readonly name: "orderHash";
40
+ readonly type: "bytes32";
41
+ }, {
42
+ readonly name: "destination";
43
+ readonly type: "bytes32";
44
+ }, {
45
+ readonly name: "fillRef";
46
+ readonly type: "bytes32";
47
+ }, {
48
+ readonly name: "recipient";
49
+ readonly type: "bytes32";
50
+ }, {
51
+ readonly name: "outputAsset";
52
+ readonly type: "bytes32";
53
+ }, {
54
+ readonly name: "amountDelivered";
55
+ readonly type: "uint256";
56
+ }, {
57
+ readonly name: "filledAt";
58
+ readonly type: "uint64";
59
+ }, {
60
+ readonly name: "fillerId";
61
+ readonly type: "bytes32";
62
+ }, {
63
+ readonly name: "repayTo";
64
+ readonly type: "bytes32";
65
+ }, {
66
+ readonly name: "attempt";
67
+ readonly type: "uint32";
68
+ }, {
69
+ readonly name: "setId";
70
+ readonly type: "uint32";
71
+ }];
72
+ };
73
+ declare const FILL_PROOF_TYPE_STRING = "FillProof(uint8 kind,bytes32 orderHash,bytes32 destination,bytes32 fillRef,bytes32 recipient,bytes32 outputAsset,uint256 amountDelivered,uint64 filledAt,bytes32 fillerId,bytes32 repayTo,uint32 attempt,uint32 setId)";
74
+ /** Name and version of the domain; chain id and verifying contract are the deployment's. */
75
+ declare const FILL_PROOF_DOMAIN: {
76
+ readonly name: "CancoreRouter";
77
+ readonly version: "1";
78
+ };
79
+
39
80
  declare const FEE_CLAIM_DOMAIN_NAME = "CancoreFeeVault";
40
81
  declare const FEE_CLAIM_DOMAIN_VERSION = "1";
41
82
  /** `FeeClaim(address token,address to,uint256 amount,uint256 nonce,uint256 deadline)` */
@@ -72,28 +113,1119 @@ declare function feeClaimDomain(chainId: number, verifyingContract: `0x${string}
72
113
  readonly verifyingContract: `0x${string}`;
73
114
  };
74
115
 
75
- /** The evm-contracts release these ABIs were taken from. */
116
+ /** `FillProof.kind` of v1: k-of-n attestor signatures — the only kind `settle` accepts. */
117
+ declare const PROOF_KIND_ATTESTATION = 1;
118
+ /**
119
+ * What the attestors sign and `CancoreRouter.settle` verifies: the fact of a
120
+ * delivery on the destination chain, for one order. Written by hand from the
121
+ * contract's schema (`FILL_PROOF_TYPES`, which is generated); fillProof.test.ts
122
+ * fails to compile if the two stop naming the same fields.
123
+ */
124
+ interface FillProof {
125
+ kind: number;
126
+ orderHash: `0x${string}`;
127
+ /** bytes32: EVM — the destination chain id, left-padded; Canton — `keccak256(utf8("canton:<network>"))`. */
128
+ destination: `0x${string}`;
129
+ /** EVM: the delivery transaction hash; Canton: keccak256 of the update id. */
130
+ fillRef: `0x${string}`;
131
+ recipient: `0x${string}`;
132
+ outputAsset: `0x${string}`;
133
+ /** What arrived, not what was sent. */
134
+ amountDelivered: bigint;
135
+ filledAt: bigint;
136
+ /** `fillerIdHash(fillerId)`: `Filled.fillerId` (EVM destination) or the hashed `DeliveryReceipt.fillerId` (Canton destination). */
137
+ fillerId: `0x${string}`;
138
+ /** The payee of `settle`, encoded for the source chain: `Filled.repayTo` or `DeliveryReceipt.repayTo`. */
139
+ repayTo: `0x${string}`;
140
+ attempt: number;
141
+ /** The attestor set live when the order opened — `attestationSetFor(orderHash)`, never `currentSetId`. */
142
+ setId: number;
143
+ }
144
+ /**
145
+ * The typed-data domain of a proof: the order's SOURCE router. `settle`
146
+ * recomputes the digest in its own domain, so a proof never verifies on
147
+ * another chain or another router. A Canton source (Daml settles) is
148
+ * CANTON_ORIGIN_ID = 2^63 + n, above Number.MAX_SAFE_INTEGER: pass a bigint.
149
+ */
150
+ declare function fillProofDomain(chainId: number | bigint, verifyingContract: `0x${string}`): {
151
+ readonly chainId: number | bigint;
152
+ readonly verifyingContract: `0x${string}`;
153
+ readonly name: "CancoreRouter";
154
+ readonly version: "1";
155
+ };
156
+ /**
157
+ * The router's `hashFillProof`: the digest attestors sign and `settle` (or Daml
158
+ * `SwapIntent_SettleWithProof` on a Canton source) verifies, in the domain of
159
+ * the order's source router.
160
+ */
161
+ declare function hashFillProof(proof: FillProof, chainId: number | bigint, verifyingContract: `0x${string}`): `0x${string}`;
162
+
163
+ /**
164
+ * The EIP-712 types and domains of the Cancore intent rail, filler protocol v1.
165
+ *
166
+ * Two families. The CODE types (`Order`, `Quote`, `FillTicket`; `FillProof`
167
+ * lives in `../eip712`) are the router's own structs — here they are
168
+ * provisional hand copies of `CancoreRouter.sol` until evm-contracts publishes
169
+ * them under `abi/typed-data` (follow-up F-1); `Order` is pinned by the synced
170
+ * `spec/vectors/canton-order.json`. `FillTicket` and `FillProof` carry the
171
+ * variant A fields (`fillerId`, `deliveryKey`, `repayTo`) the router takes
172
+ * before its first deployment (CAN-2140). The PROTOCOL types are off-chain,
173
+ * signed in the `CancoreFillerProtocol` domain by the filler's one message key
174
+ * (or the gateway key), and fixed by this package: a field reordered here
175
+ * changes every digest, and the golden vectors under `spec/protocol/typed-data`
176
+ * fail the moment it happens.
177
+ */
178
+ type Hex = `0x${string}`;
179
+ /** A wide unsigned integer as the wire carries it (decimal string) or as code holds it. */
180
+ type UintLike = bigint | number | string;
181
+ /** Name and version of the domain every off-chain protocol struct is signed in — no chain id, no verifying contract. */
182
+ declare const FILLER_PROTOCOL_DOMAIN: {
183
+ readonly name: "CancoreFillerProtocol";
184
+ readonly version: "1";
185
+ };
186
+ /** The ticket domain (`CancoreRouter.sol:124-131`): the same ticket verifies on every router and off-chain. */
187
+ declare const FILL_TICKET_DOMAIN: {
188
+ readonly name: "CancoreFillTicket";
189
+ readonly version: "1";
190
+ };
191
+ /** The source-router domain `Order` and `Quote` are hashed in. Canton source: `CANTON_ORIGIN_ID` and the anchor. */
192
+ declare function routerDomain(chainId: UintLike, verifyingContract: Hex): {
193
+ readonly name: "CancoreRouter";
194
+ readonly version: "1";
195
+ readonly chainId: UintLike;
196
+ readonly verifyingContract: `0x${string}`;
197
+ };
198
+ /** `Order(address user,uint64 originChainId,address inputToken,uint256 inputAmount,bytes32 destination,bytes32 outputAsset,uint256 minReceived,bytes32 recipient,uint64 createdAt,uint64 fillDeadline,uint16 feeBps)` */
199
+ declare const ORDER_TYPES: {
200
+ readonly Order: readonly [{
201
+ readonly name: "user";
202
+ readonly type: "address";
203
+ }, {
204
+ readonly name: "originChainId";
205
+ readonly type: "uint64";
206
+ }, {
207
+ readonly name: "inputToken";
208
+ readonly type: "address";
209
+ }, {
210
+ readonly name: "inputAmount";
211
+ readonly type: "uint256";
212
+ }, {
213
+ readonly name: "destination";
214
+ readonly type: "bytes32";
215
+ }, {
216
+ readonly name: "outputAsset";
217
+ readonly type: "bytes32";
218
+ }, {
219
+ readonly name: "minReceived";
220
+ readonly type: "uint256";
221
+ }, {
222
+ readonly name: "recipient";
223
+ readonly type: "bytes32";
224
+ }, {
225
+ readonly name: "createdAt";
226
+ readonly type: "uint64";
227
+ }, {
228
+ readonly name: "fillDeadline";
229
+ readonly type: "uint64";
230
+ }, {
231
+ readonly name: "feeBps";
232
+ readonly type: "uint16";
233
+ }];
234
+ };
235
+ /** `Quote(bytes32 orderHash,uint64 quoteDeadline)` — Cancore's quote signer, source-router domain. */
236
+ declare const QUOTE_TYPES: {
237
+ readonly Quote: readonly [{
238
+ readonly name: "orderHash";
239
+ readonly type: "bytes32";
240
+ }, {
241
+ readonly name: "quoteDeadline";
242
+ readonly type: "uint64";
243
+ }];
244
+ };
245
+ /**
246
+ * `FillTicket(bytes32 orderHash,bytes32 fillerId,address deliveryKey,bytes32 repayTo,uint32 attempt,uint64 validFrom,uint64 validUntil)`
247
+ * — signed by a Cancore ticket signer, ticket domain. `fill` requires `msg.sender == deliveryKey`.
248
+ */
249
+ declare const FILL_TICKET_TYPES: {
250
+ readonly FillTicket: readonly [{
251
+ readonly name: "orderHash";
252
+ readonly type: "bytes32";
253
+ }, {
254
+ readonly name: "fillerId";
255
+ readonly type: "bytes32";
256
+ }, {
257
+ readonly name: "deliveryKey";
258
+ readonly type: "address";
259
+ }, {
260
+ readonly name: "repayTo";
261
+ readonly type: "bytes32";
262
+ }, {
263
+ readonly name: "attempt";
264
+ readonly type: "uint32";
265
+ }, {
266
+ readonly name: "validFrom";
267
+ readonly type: "uint64";
268
+ }, {
269
+ readonly name: "validUntil";
270
+ readonly type: "uint64";
271
+ }];
272
+ };
273
+ /** `FillerQuote(bytes32 requestId,string fillerId,uint256 amountOut,uint64 validUntil,uint64 nonce)` — signed by the message key. */
274
+ declare const FILLER_QUOTE_TYPES: {
275
+ readonly FillerQuote: readonly [{
276
+ readonly name: "requestId";
277
+ readonly type: "bytes32";
278
+ }, {
279
+ readonly name: "fillerId";
280
+ readonly type: "string";
281
+ }, {
282
+ readonly name: "amountOut";
283
+ readonly type: "uint256";
284
+ }, {
285
+ readonly name: "validUntil";
286
+ readonly type: "uint64";
287
+ }, {
288
+ readonly name: "nonce";
289
+ readonly type: "uint64";
290
+ }];
291
+ };
292
+ /**
293
+ * `TicketIntent(bytes32 orderHash,uint32 attempt,uint64 validFrom,uint64 validUntil,string fillerId,address deliveryKey,bytes32 repayTo)`
294
+ * — the filler's consent to an offered ticket, signed by its message key; `deliveryKey` and `repayTo` go into the `FillTicket` as they are.
295
+ */
296
+ declare const TICKET_INTENT_TYPES: {
297
+ readonly TicketIntent: readonly [{
298
+ readonly name: "orderHash";
299
+ readonly type: "bytes32";
300
+ }, {
301
+ readonly name: "attempt";
302
+ readonly type: "uint32";
303
+ }, {
304
+ readonly name: "validFrom";
305
+ readonly type: "uint64";
306
+ }, {
307
+ readonly name: "validUntil";
308
+ readonly type: "uint64";
309
+ }, {
310
+ readonly name: "fillerId";
311
+ readonly type: "string";
312
+ }, {
313
+ readonly name: "deliveryKey";
314
+ readonly type: "address";
315
+ }, {
316
+ readonly name: "repayTo";
317
+ readonly type: "bytes32";
318
+ }];
319
+ };
320
+ /** `TicketReceipt(bytes32 ticketHash,bytes32 ticketSigHash)` — signed by the message key. */
321
+ declare const TICKET_RECEIPT_TYPES: {
322
+ readonly TicketReceipt: readonly [{
323
+ readonly name: "ticketHash";
324
+ readonly type: "bytes32";
325
+ }, {
326
+ readonly name: "ticketSigHash";
327
+ readonly type: "bytes32";
328
+ }];
329
+ };
330
+ /** `StakeBinding(string partnerId,address stakingAddress,uint256 chainId,uint64 nonce)` — signed by the staking address. */
331
+ declare const STAKE_BINDING_TYPES: {
332
+ readonly StakeBinding: readonly [{
333
+ readonly name: "partnerId";
334
+ readonly type: "string";
335
+ }, {
336
+ readonly name: "stakingAddress";
337
+ readonly type: "address";
338
+ }, {
339
+ readonly name: "chainId";
340
+ readonly type: "uint256";
341
+ }, {
342
+ readonly name: "nonce";
343
+ readonly type: "uint64";
344
+ }];
345
+ };
346
+ /** `FillerAuth(string fillerId,bytes32 nonce,uint64 expiresAt)` — signed by the message key. */
347
+ declare const FILLER_AUTH_TYPES: {
348
+ readonly FillerAuth: readonly [{
349
+ readonly name: "fillerId";
350
+ readonly type: "string";
351
+ }, {
352
+ readonly name: "nonce";
353
+ readonly type: "bytes32";
354
+ }, {
355
+ readonly name: "expiresAt";
356
+ readonly type: "uint64";
357
+ }];
358
+ };
359
+ /** `GatewayMessage(bytes32 bodyHash)` — signed by the gateway key; `bodyHash = gatewayBodyHash(message)`. */
360
+ declare const GATEWAY_MESSAGE_TYPES: {
361
+ readonly GatewayMessage: readonly [{
362
+ readonly name: "bodyHash";
363
+ readonly type: "bytes32";
364
+ }];
365
+ };
366
+ /** `FillerMessage(bytes32 bodyHash)` — the envelope `msgSig` of every filler message, by the message key; `bodyHash = fillerMessageBodyHash(message)`. */
367
+ declare const FILLER_MESSAGE_TYPES: {
368
+ readonly FillerMessage: readonly [{
369
+ readonly name: "bodyHash";
370
+ readonly type: "bytes32";
371
+ }];
372
+ };
373
+ /**
374
+ * `FillerKeyRegistration(string fillerId,address messageKey,uint64 issuedAt)` — proof of possession of a message key,
375
+ * signed by that key: at onboarding, and with the NEW key at a manual key change by Cancore staff. There is no rotation type.
376
+ */
377
+ declare const FILLER_KEY_REGISTRATION_TYPES: {
378
+ readonly FillerKeyRegistration: readonly [{
379
+ readonly name: "fillerId";
380
+ readonly type: "string";
381
+ }, {
382
+ readonly name: "messageKey";
383
+ readonly type: "address";
384
+ }, {
385
+ readonly name: "issuedAt";
386
+ readonly type: "uint64";
387
+ }];
388
+ };
389
+ interface Order {
390
+ user: Hex;
391
+ originChainId: UintLike;
392
+ inputToken: Hex;
393
+ inputAmount: UintLike;
394
+ destination: Hex;
395
+ outputAsset: Hex;
396
+ minReceived: UintLike;
397
+ recipient: Hex;
398
+ createdAt: UintLike;
399
+ fillDeadline: UintLike;
400
+ feeBps: number | string;
401
+ }
402
+ interface Quote {
403
+ orderHash: Hex;
404
+ quoteDeadline: UintLike;
405
+ }
406
+ interface FillTicket {
407
+ orderHash: Hex;
408
+ /** `fillerIdHash(fillerId)`: the on-chain form of the filler's id. */
409
+ fillerId: Hex;
410
+ /** The only address `fill` accepts this ticket from; the zero address never reaches a router (Canton destinations have no `FillTicket`). */
411
+ deliveryKey: Hex;
412
+ /** Where `settle` pays, encoded for the source chain (`repayToFromEvm`, `repayToFromParty`). */
413
+ repayTo: Hex;
414
+ attempt: number;
415
+ validFrom: UintLike;
416
+ validUntil: UintLike;
417
+ }
418
+ interface FillerQuote {
419
+ /** `requestIdHash(requestId)`, not the string. */
420
+ requestId: Hex;
421
+ fillerId: string;
422
+ amountOut: UintLike;
423
+ validUntil: UintLike;
424
+ nonce: UintLike;
425
+ }
426
+ interface TicketIntent {
427
+ orderHash: Hex;
428
+ attempt: number;
429
+ validFrom: UintLike;
430
+ validUntil: UintLike;
431
+ /** The signer's own id, the string form. */
432
+ fillerId: string;
433
+ /** The address that will send `fill` on the destination; the zero address for a Canton destination. */
434
+ deliveryKey: Hex;
435
+ /** Where `settle` pays, encoded for the source chain. */
436
+ repayTo: Hex;
437
+ }
438
+ interface TicketReceipt {
439
+ /** `hashTypedData` of the `FillTicket` in `FILL_TICKET_DOMAIN`. */
440
+ ticketHash: Hex;
441
+ /** keccak256 of the 65 raw signature bytes. */
442
+ ticketSigHash: Hex;
443
+ }
444
+ interface StakeBinding {
445
+ partnerId: string;
446
+ stakingAddress: Hex;
447
+ chainId: UintLike;
448
+ nonce: UintLike;
449
+ }
450
+ interface FillerAuth {
451
+ fillerId: string;
452
+ nonce: Hex;
453
+ expiresAt: UintLike;
454
+ }
455
+ interface GatewayMessage {
456
+ bodyHash: Hex;
457
+ }
458
+ interface FillerMessage {
459
+ bodyHash: Hex;
460
+ }
461
+ interface FillerKeyRegistration {
462
+ fillerId: string;
463
+ /** The address derived from the key being registered. */
464
+ messageKey: Hex;
465
+ /** Unix seconds. */
466
+ issuedAt: UintLike;
467
+ }
468
+
469
+ interface TypedField {
470
+ readonly name: string;
471
+ readonly type: string;
472
+ }
473
+ type TypedDataTypes = Readonly<Record<string, readonly TypedField[]>>;
474
+ type TypedValue = string | number | bigint | boolean;
475
+ interface TypedDataDomain {
476
+ name?: string;
477
+ version?: string;
478
+ chainId?: UintLike;
479
+ verifyingContract?: Hex | string;
480
+ salt?: Hex | string;
481
+ }
482
+ interface TypedDataInput {
483
+ domain: TypedDataDomain;
484
+ types: TypedDataTypes;
485
+ primaryType: string;
486
+ message: Readonly<Record<string, unknown>>;
487
+ }
488
+ /** A JSON value JCS can canonicalise: numbers are safe integers only. */
489
+ type JsonValue = string | number | boolean | null | readonly JsonValue[] | {
490
+ readonly [key: string]: JsonValue;
491
+ };
492
+ /** `Name(type1 name1,…)` of a flat struct. */
493
+ declare function encodeType(types: TypedDataTypes, primaryType: string): string;
494
+ declare function typeHash(types: TypedDataTypes, primaryType: string): Hex;
495
+ declare function hashStruct(types: TypedDataTypes, primaryType: string, message: Readonly<Record<string, unknown>>): Hex;
496
+ /** The domain separator; `EIP712Domain` lists exactly the members present, in the standard order. */
497
+ declare function hashDomain(domain: TypedDataDomain): Hex;
498
+ /** The EIP-712 digest `keccak256(0x1901 ‖ domainSeparator ‖ hashStruct(message))` — what a signature is over. */
499
+ declare function hashTypedData({ domain, types, primaryType, message }: TypedDataInput): Hex;
500
+ /**
501
+ * RFC 8785 canonical JSON. Keys sorted by UTF-16 code units (`Array#sort`),
502
+ * strings as `JSON.stringify` writes them. Numbers are safe integers only —
503
+ * the wire carries every wider value as a decimal string — so the ECMAScript
504
+ * number serialisation JCS borrows is never exercised beyond integers.
505
+ */
506
+ declare function jcs(value: unknown): string;
507
+ /** `GatewayMessage.bodyHash`: keccak256 of the JCS text of an S→F message without its `sig`. */
508
+ declare function gatewayBodyHash(message: Readonly<Record<string, unknown>>): Hex;
509
+ /** `FillerMessage.bodyHash`: keccak256 of the JCS text of a filler message without its `msgSig`; `id`, `fillerId`, `sentAt` and any inner `sig` stay in. */
510
+ declare function fillerMessageBodyHash(message: object): Hex;
511
+ /** `FillerQuote.requestId`: keccak256(utf8(requestId)); the id is 1..64 printable ASCII (`Canonical.daml:90-93`). */
512
+ declare function requestIdHash(requestId: string): Hex;
513
+
514
+ /** `fillerId`: issued by Cancore at onboarding, ASCII so the draw's UTF-8 byte order is plain byte order (D-H). */
515
+ declare const FILLER_ID_PATTERN: RegExp;
516
+ /** The on-chain form of a filler id, `keccak256(utf8(fillerId))` — `FillTicket`, `Filled`, `FillProof`, `Settled`. */
517
+ declare function fillerIdHash(fillerId: string): Hex;
518
+ /**
519
+ * `repayTo` for an EVM source: the address left-padded with zeros to 32 bytes.
520
+ * Refuses the zero address, which `settle` refuses too (`ZeroAddress`).
521
+ */
522
+ declare function repayToFromEvm(address: string): Hex;
523
+ /** `repayTo` for a Canton source: `keccak256(utf8(partyId))` of the filler's party registered under its `fillerId`. */
524
+ declare function repayToFromParty(partyId: string): Hex;
525
+ /** Whether `repayTo` is payable on an EVM source: zero top 12 bytes (`InvalidBytes32Address`) and not the zero address (`ZeroAddress`). */
526
+ declare function isEvmRepayTo(repayTo: string): boolean;
527
+ /** The address `settle` pays on an EVM source, `address(uint160(uint256(repayTo)))`; throws where the router reverts. */
528
+ declare function evmAddressFromRepayTo(repayTo: string): Hex;
529
+ /**
530
+ * Whether `sig` has the shape a message key (an EOA) produces and the protocol
531
+ * accepts: 65 bytes `r ‖ s ‖ v`, `v ∈ {27, 28}`, `0 < r < n`, low-s
532
+ * `0 < s ≤ n/2`. Anything else is refused before recovery — an EIP-1271
533
+ * smart-wallet signature among them: the message key is an EOA, verified by
534
+ * ecrecover only. Passing this check says nothing about WHO signed: recover
535
+ * the address and compare it with the registered key.
536
+ */
537
+ declare function isEoaSignature(sig: unknown): sig is Hex;
538
+
539
+ /** `hashTicket` of the router: the `FillTicket` digest in the ticket domain, the same on every chain. */
540
+ declare const hashFillTicket: (ticket: FillTicket) => Hex;
541
+ /** The `FillerQuote` digest; `quote.requestId` is already `requestIdHash(requestId)`. */
542
+ declare const hashFillerQuote: (quote: FillerQuote) => Hex;
543
+ /** The `TicketIntent` digest — the inner `sig` of `ticket.intent`. */
544
+ declare const hashTicketIntent: (intent: TicketIntent) => Hex;
545
+ /** What `msgSig` of a filler → filler-gateway message is over: `FillerMessage{bodyHash}` of the message without `msgSig`. */
546
+ declare const hashFillerMessage: (message: object) => Hex;
547
+ /** The `FillerKeyRegistration` digest; the registered key signs it, and it must recover to `messageKey`. */
548
+ declare const hashFillerKeyRegistration: (registration: FillerKeyRegistration) => Hex;
549
+
550
+ /**
551
+ * `FillProof` on the wire (§3.1), field for field the struct the source router
552
+ * hashes (`FILL_PROOF_TYPES`, the twelve variant A fields of protocol §3.3).
553
+ */
554
+ interface FillProofJson {
555
+ kind: number;
556
+ orderHash: Hex;
557
+ destination: Hex;
558
+ fillRef: Hex;
559
+ recipient: Hex;
560
+ outputAsset: Hex;
561
+ amountDelivered: DecString;
562
+ filledAt: DecString;
563
+ /** `fillerIdHash(fillerId)` of the filler that delivered. */
564
+ fillerId: Hex;
565
+ /** The payee of `settle`, encoded for the source chain: the `repayTo` of the filler's ticket. */
566
+ repayTo: Hex;
567
+ attempt: number;
568
+ setId: number;
569
+ }
570
+ /** EVM source: 65-byte `r ‖ s ‖ v`; in payload order the `signature` values are the `sigs` of `settle`. */
571
+ interface AttestationEvm {
572
+ signer: Hex;
573
+ signature: Hex;
574
+ }
575
+ /**
576
+ * Canton source: a `SigEntry` of `SwapIntent_SettleWithProof` with `0x`
577
+ * (strip it for Daml) — the 88-byte DER SubjectPublicKeyInfo of the signer's
578
+ * uncompressed key and a minimal DER signature — plus the address Daml derives
579
+ * from the key.
580
+ */
581
+ interface AttestationCanton {
582
+ signer: Hex;
583
+ pubKey: Hex;
584
+ signature: Hex;
585
+ }
586
+ interface SettleAttestations extends S2FBase {
587
+ type: 'settle.attestations';
588
+ fillerId: string;
589
+ orderHash: Hex;
590
+ /** Equals `proof.attempt`. */
591
+ attempt: number;
592
+ /** CAIP-2 of the chain `settle` is submitted on: `eip155:<id>` or `canton:<network>`. */
593
+ sourceChainId: string;
594
+ proof: FillProofJson;
595
+ /** At least `threshold`, strictly ascending by `signer`. */
596
+ signatures: AttestationEvm[] | AttestationCanton[];
597
+ /** Equals `proof.setId`; EVM: `attestationSetFor(orderHash)`. */
598
+ setId: number;
599
+ threshold: number;
600
+ /** Unix seconds: `settle` must be included before it. */
601
+ refundAfter: DecString;
602
+ }
603
+ /** What `settle.attestations` carries apart from its envelope: identical on WebSocket and REST. */
604
+ type SettleAttestationsPayload = Omit<SettleAttestations, 'type' | 'id' | 'fillerId' | 'sentAt' | 'sig' | 're'>;
605
+ /** The payload of a `settle.attestations` frame or REST body: everything but `type`, `id`, `fillerId`, `sentAt`, `sig`, `re`. */
606
+ declare function settleAttestationsPayload(frame: object): SettleAttestationsPayload;
607
+ /**
608
+ * `keccak256(utf8(JCS(payload)))`: equal for the pushed frame and the pulled
609
+ * body of the same delivery, whatever their `id`, `sentAt` and `sig`.
610
+ */
611
+ declare function settleAttestationsPayloadHash(frame: object): Hex;
612
+ /** Whether `settle` for this payload goes to Daml (`SwapIntent_SettleWithProof`) rather than an EVM router. */
613
+ declare const isCantonSource: (sourceChainId: string) => boolean;
614
+ /**
615
+ * The rules of a schema-valid `settle.attestations` that JSON Schema cannot
616
+ * state: `attempt`, `setId` and `orderHash` equal the proof's, at least
617
+ * `threshold` signatures, signers strictly ascending (no duplicates).
618
+ * Returns one message per broken rule, empty when none is.
619
+ */
620
+ declare function settleAttestationsErrors(payload: SettleAttestationsPayload): string[];
621
+ /** EVM source: the `sigs` argument of `CancoreRouter.settle(order, proof, sigs)`, in payload order. */
622
+ declare function settleSigs(payload: SettleAttestationsPayload): Hex[];
623
+ /** Canton source: the `bundle : [SigEntry]` of `SwapIntent_SettleWithProof` — lowercase hex without `0x`, in payload order. */
624
+ declare function cantonSigEntries(payload: SettleAttestationsPayload): {
625
+ pubKey: string;
626
+ sig: string;
627
+ }[];
628
+
629
+ /**
630
+ * The wire shapes of filler protocol v1 — WebSocket frames on `/v1`, REST
631
+ * bodies and the public draw/epoch records — as TypeScript. The JSON Schemas
632
+ * under `spec/protocol/` are normative; schemas.test.ts holds the enums below
633
+ * to them. Encoding (protocol §3.1): uint64 and wider as decimal strings,
634
+ * uint8/16/32 as JSON integers, on-chain times in seconds (decimal string),
635
+ * gateway times in milliseconds (JSON integer), hex lowercase.
636
+ *
637
+ * Every frame in both directions is signed by its sender (protocol §3.4):
638
+ * `sig` (gateway key, `GatewayMessage`) on S→F, `msgSig` (the filler's message
639
+ * key, `FillerMessage`) on F→S, and carries `id`, `fillerId` and `sentAt`.
640
+ *
641
+ * Receivers ignore unknown fields and unknown S→F types (V-2), so none of
642
+ * these types is closed. The enum types list the known values; the schemas
643
+ * accept any UPPER_SNAKE value besides them, and a receiver treats an unknown
644
+ * one as OTHER/generic (V-2).
645
+ */
646
+
647
+ /** Unsigned decimal string: uint64 and wider. */
648
+ type DecString = string;
649
+ /** Unix milliseconds, gateway clock. */
650
+ type TimeMs = number;
651
+ /** EVM token address, or a Canton instrument. */
652
+ type WireAsset = Hex | {
653
+ admin: string;
654
+ id: string;
655
+ };
656
+ declare const DECLINE_REASONS: readonly ["NO_INVENTORY", "RISK_LIMIT", "PRICE_MOVED", "PAUSED", "OTHER", "TICKET_SIGNER_UNKNOWN", "TICKET_MISMATCH", "TICKET_TTL_TOO_SHORT", "TICKET_ISSUED_LATE", "TICKET_BEYOND_DEADLINE", "ESCROW_NOT_OPEN", "ESCROW_MISMATCH", "PROOF_WINDOW_TOO_SHORT", "SKEW_MARGIN_TOO_SHORT", "DRAW_MISMATCH"];
657
+ declare const ERROR_CODES: readonly ["BAD_REQUEST", "UNAUTHENTICATED", "UNSUPPORTED_VERSION", "UNSUPPORTED_TYPE", "BAD_SIGNATURE", "STALE_MESSAGE", "REPLAYED_MESSAGE", "TICKET_REFUSED", "UNKNOWN_REQUEST", "UNKNOWN_TICKET", "TICKET_CLOSED", "NOT_ELIGIBLE", "RATE_LIMITED", "INTERNAL", "ATTESTATIONS_NOT_READY"];
658
+ /** HTTP status of each error code on the REST fallback. */
659
+ declare const ERROR_HTTP_STATUS: Readonly<Record<ErrorCode, number>>;
660
+ /** `error.reason` with `TICKET_REFUSED`: the pre-ticket check that failed (S-21). */
661
+ declare const TICKET_REFUSED_REASONS: readonly ["REPAY_TO_INVALID", "REPAY_TO_BLOCKLISTED", "DELIVERY_KEY_INVALID", "PAYOUT_NOT_READY", "RECIPIENT_NOT_READY", "OPEN_TICKET_LIMIT", "PROOF_WINDOW_TOO_SHORT", "ATTESTOR_REVOCATION_PENDING", "SERVICE_DEGRADED", "OTHER"];
662
+ declare const EXPIRED_RESULTS: readonly ["FILLED", "NO_SHOW", "NO_SHOW_UNCONFIRMED", "EXEMPT"];
663
+ declare const EXEMPT_REASONS: readonly ["DESTINATION_HALTED", "GATEWAY_FAULT", "REORGED_AFTER_INCLUSION", "RECIPIENT_NOT_READY", "OTHER"];
664
+ /** Verdict at receipt time, on the `quote.ack`. */
665
+ declare const QUOTE_ACK_STATUSES: readonly ["COUNTED", "LATE", "SHORT_TTL"];
666
+ /** Final status of a quote, `GET /v1/filler/quotes`. */
667
+ declare const QUOTE_FINAL_STATUSES: readonly ["COUNTED", "LATE", "SHORT_TTL", "REPLACED", "BAD_SIG", "OUTLIER", "IN_BAND", "OUT_OF_BAND", "WON", "LOST"];
668
+ declare const PENALTY_STEPS: readonly ["L1", "L2", "L3", "L4"];
669
+ declare const DRAW_CLOSED_BY: readonly ["OFFER_TIMEOUT", "OFFER_DECLINE", "TICKET_DECLINE", "TICKET_EXPIRED", "FILLED"];
670
+ declare const TICKET_LIST_STATUSES: readonly ["OFFERED", "ISSUED"];
671
+ type DeclineReason = (typeof DECLINE_REASONS)[number];
672
+ type ErrorCode = (typeof ERROR_CODES)[number];
673
+ type TicketRefusedReason = (typeof TICKET_REFUSED_REASONS)[number];
674
+ type ExpiredResult = (typeof EXPIRED_RESULTS)[number];
675
+ type ExemptReason = (typeof EXEMPT_REASONS)[number];
676
+ type QuoteAckStatus = (typeof QUOTE_ACK_STATUSES)[number];
677
+ type QuoteFinalStatus = (typeof QUOTE_FINAL_STATUSES)[number];
678
+ type PenaltyStep = (typeof PENALTY_STEPS)[number];
679
+ type DrawClosedBy = (typeof DRAW_CLOSED_BY)[number];
680
+ /** `ICancoreRouter.Order` on the wire: every numeric field a decimal string, as `canton-order.json`. */
681
+ interface OrderJson {
682
+ user: Hex;
683
+ originChainId: DecString;
684
+ inputToken: Hex;
685
+ inputAmount: DecString;
686
+ destination: Hex;
687
+ outputAsset: Hex;
688
+ minReceived: DecString;
689
+ recipient: Hex;
690
+ createdAt: DecString;
691
+ fillDeadline: DecString;
692
+ feeBps: DecString;
693
+ }
694
+ /** Every S→F frame: signed by the gateway (`GatewayMessage`), addressed (`fillerId`) and timed (`sentAt`). */
695
+ interface S2FBase {
696
+ type: string;
697
+ id: string;
698
+ /** The addressee. Absent only on `auth.challenge` and on pre-auth `error`. */
699
+ fillerId?: string;
700
+ sentAt: TimeMs;
701
+ sig: Hex;
702
+ /** The F→S `id` this frame answers. */
703
+ re?: string;
704
+ }
705
+ /**
706
+ * What every filler → filler-gateway message and REST request body carries (S-19, T-13): `id` unique per
707
+ * `fillerId` and direction, ≤ 64 characters; the sender's `fillerId`; `sentAt`; `msgSig` by the message key over
708
+ * `FillerMessage{bodyHash: fillerMessageBodyHash(message)}`.
709
+ */
710
+ interface F2SEnvelope {
711
+ id: string;
712
+ fillerId: string;
713
+ sentAt: TimeMs;
714
+ msgSig: Hex;
715
+ /** The S→F `id` this message answers. */
716
+ re?: string;
717
+ }
718
+ interface F2SBase extends F2SEnvelope {
719
+ type: string;
720
+ }
721
+ interface AuthChallenge extends S2FBase {
722
+ type: 'auth.challenge';
723
+ nonce: Hex;
724
+ expiresAt: DecString;
725
+ }
726
+ interface AuthResponse extends F2SBase {
727
+ type: 'auth.response';
728
+ fillerId: string;
729
+ keyAddress: Hex;
730
+ protocolVersion: '1';
731
+ /** Optional: the `auth.challenge` nonce this answers, so the REST login finds its challenge directly. */
732
+ nonce?: Hex;
733
+ sig: Hex;
734
+ }
735
+ interface AuthOk extends S2FBase {
736
+ type: 'auth.ok';
737
+ fillerId: string;
738
+ heartbeatIntervalMs: number;
739
+ }
740
+ /** Heartbeat from the filler: signed with `msgSig`, like every F→S frame. */
741
+ interface PingF2S extends F2SBase {
742
+ type: 'ping';
743
+ }
744
+ interface PongF2S extends F2SBase {
745
+ type: 'pong';
746
+ re: string;
747
+ }
748
+ /** Heartbeat from the gateway: signed, addressed and timed, like every S→F frame (D-C). */
749
+ interface PingS2F extends S2FBase {
750
+ type: 'ping';
751
+ fillerId: string;
752
+ }
753
+ interface PongS2F extends S2FBase {
754
+ type: 'pong';
755
+ fillerId: string;
756
+ re: string;
757
+ }
758
+ type Ping = PingF2S | PingS2F;
759
+ type Pong = PongF2S | PongS2F;
760
+ interface ErrorMessage extends S2FBase {
761
+ type: 'error';
762
+ code: ErrorCode;
763
+ message: string;
764
+ reason?: TicketRefusedReason;
765
+ }
766
+ /** The filler's reply to a gateway frame it cannot handle; informational. */
767
+ interface ErrorF2S extends F2SBase {
768
+ type: 'error';
769
+ re: string;
770
+ code: ErrorCode;
771
+ message: string;
772
+ }
773
+ interface EpochWeights extends S2FBase {
774
+ type: 'epoch.weights';
775
+ epochId: DecString;
776
+ startsAt: DecString;
777
+ endsAt: DecString;
778
+ weightsRoot: Hex;
779
+ }
780
+ interface QuoteRequest extends S2FBase {
781
+ type: 'quote.request';
782
+ requestId: string;
783
+ route: {
784
+ src: string;
785
+ dst: string;
786
+ };
787
+ inputToken: WireAsset;
788
+ /** The total T the maker deposits, input base units. */
789
+ inputAmount: DecString;
790
+ outputAsset: WireAsset;
791
+ feeBps: number;
792
+ fillDeadlineHint: DecString;
793
+ windowCloseAt: TimeMs;
794
+ quoteTtlMs: number;
795
+ imbalanceHint?: {
796
+ dstAsset: WireAsset;
797
+ netFlow24hUsd: string;
798
+ };
799
+ }
800
+ /** `sig` = `FillerQuote{requestIdHash(requestId), fillerId, amountOut, validUntil, nonce}` by the message key. */
801
+ interface QuoteMessage extends F2SBase {
802
+ type: 'quote';
803
+ requestId: string;
804
+ amountOut: DecString;
805
+ validUntil: DecString;
806
+ nonce: DecString;
807
+ sig: Hex;
808
+ }
809
+ interface QuoteAck extends S2FBase {
810
+ type: 'quote.ack';
811
+ requestId: string;
812
+ quoteHash: Hex;
813
+ receivedAt: TimeMs;
814
+ status: QuoteAckStatus;
815
+ }
816
+ interface QuoteReconfirm extends S2FBase {
817
+ type: 'quote.reconfirm';
818
+ orderHash: Hex;
819
+ requestId: string;
820
+ order: OrderJson;
821
+ amountOut: DecString;
822
+ ticketTtl: number;
823
+ replyBy: TimeMs;
824
+ }
825
+ interface QuoteReconfirmReply extends F2SBase {
826
+ type: 'quote.reconfirm.reply';
827
+ orderHash: Hex;
828
+ accept: boolean;
829
+ validUntil?: DecString;
830
+ nonce?: DecString;
831
+ sig?: Hex;
832
+ }
833
+ interface TicketOffer extends S2FBase {
834
+ type: 'ticket.offer';
835
+ orderHash: Hex;
836
+ attempt: number;
837
+ order: OrderJson;
838
+ amountOut: DecString;
839
+ validFrom: DecString;
840
+ validUntil: DecString;
841
+ acceptBy: TimeMs;
842
+ }
843
+ /** `sig` = `TicketIntent{orderHash, attempt, validFrom, validUntil, fillerId, deliveryKey, repayTo}` by the message key. */
844
+ interface TicketIntentMessage extends F2SBase {
845
+ type: 'ticket.intent';
846
+ orderHash: Hex;
847
+ attempt: number;
848
+ validFrom: DecString;
849
+ validUntil: DecString;
850
+ /** The address that will send `fill`; the zero address for a Canton destination. */
851
+ deliveryKey: Hex;
852
+ /** Where `settle` pays, encoded for the source chain. */
853
+ repayTo: Hex;
854
+ sig: Hex;
855
+ }
856
+ interface TicketDecline extends F2SBase {
857
+ type: 'ticket.decline';
858
+ orderHash: Hex;
859
+ attempt: number;
860
+ reason: DeclineReason;
861
+ detail?: string;
862
+ }
863
+ interface TicketIntentAck extends S2FBase {
864
+ type: 'ticket.intent.ack';
865
+ orderHash: Hex;
866
+ attempt: number;
867
+ intentHash: Hex;
868
+ receivedAt: TimeMs;
869
+ }
870
+ /** `FillTicket` on the wire; `fillerId` is the on-chain form, `fillerIdHash(fillerId)`. */
871
+ interface TicketJson {
872
+ orderHash: Hex;
873
+ fillerId: Hex;
874
+ deliveryKey: Hex;
875
+ repayTo: Hex;
876
+ attempt: number;
877
+ validFrom: DecString;
878
+ validUntil: DecString;
879
+ }
880
+ interface TicketIssuedEvm extends S2FBase {
881
+ type: 'ticket.issued';
882
+ form: 'evm';
883
+ orderHash: Hex;
884
+ attempt: number;
885
+ ticket: TicketJson;
886
+ ticketSig: Hex;
887
+ }
888
+ interface TicketIssuedCanton extends S2FBase {
889
+ type: 'ticket.issued';
890
+ form: 'canton';
891
+ orderHash: Hex;
892
+ attempt: number;
893
+ deliveryOrderCid: string;
894
+ validUntil: DecString;
895
+ repayTo: Hex;
896
+ }
897
+ type TicketIssued = TicketIssuedEvm | TicketIssuedCanton;
898
+ interface TicketReceiptMessage extends F2SBase {
899
+ type: 'ticket.receipt';
900
+ orderHash: Hex;
901
+ attempt: number;
902
+ ticketHash: Hex;
903
+ ticketSigHash: Hex;
904
+ sig: Hex;
905
+ }
906
+ interface FillReported extends F2SBase {
907
+ type: 'fill.reported';
908
+ orderHash: Hex;
909
+ attempt: number;
910
+ txRef: string;
911
+ }
912
+ interface TicketExpired extends S2FBase {
913
+ type: 'ticket.expired';
914
+ orderHash: Hex;
915
+ attempt: number;
916
+ result: ExpiredResult;
917
+ exemptReason?: ExemptReason;
918
+ }
919
+ interface OrderSettled extends S2FBase {
920
+ type: 'order.settled';
921
+ orderHash: Hex;
922
+ payout: DecString;
923
+ fee: DecString;
924
+ penaltyWithheld: DecString;
925
+ txRef: string;
926
+ }
927
+ interface PenaltyApplied extends S2FBase {
928
+ type: 'penalty.applied';
929
+ violationId: string;
930
+ code: string;
931
+ step: PenaltyStep;
932
+ details: Record<string, unknown>;
933
+ }
934
+ type S2FMessage = AuthChallenge | AuthOk | PingS2F | PongS2F | ErrorMessage | EpochWeights | QuoteRequest | QuoteAck | QuoteReconfirm | TicketOffer | TicketIntentAck | TicketIssued | TicketExpired | OrderSettled | PenaltyApplied | SettleAttestations;
935
+ type F2SMessage = AuthResponse | PingF2S | PongF2S | ErrorF2S | QuoteMessage | QuoteReconfirmReply | TicketIntentMessage | TicketDecline | TicketReceiptMessage | FillReported;
936
+ interface AuthToken {
937
+ token: string;
938
+ expiresAt: TimeMs;
939
+ }
940
+ interface Page<T> {
941
+ items: T[];
942
+ nextCursor: string | null;
943
+ }
944
+ type TicketList = Page<TicketOffer | TicketIssued>;
945
+ interface QuoteRecord {
946
+ quote: QuoteMessage;
947
+ ack: QuoteAck;
948
+ status: QuoteFinalStatus;
949
+ }
950
+ type QuoteList = Page<QuoteRecord>;
951
+ /** `GET /v1/filler/attestations/{orderHash}`: the `settle.attestations` frame itself, freshly signed. */
952
+ type AttestationsResponse = SettleAttestations;
953
+ interface StakeBindingRequest extends F2SEnvelope {
954
+ partnerId: string;
955
+ stakingAddress: Hex;
956
+ chainId: DecString;
957
+ nonce: DecString;
958
+ sig: Hex;
959
+ }
960
+ interface FillerStats {
961
+ won: number;
962
+ delivered: number;
963
+ noShow: number;
964
+ reliability: number;
965
+ capacityUsd: string;
966
+ inFlightUsd: string;
967
+ }
968
+ interface PenaltyRecord {
969
+ violationId: string;
970
+ code: string;
971
+ step: PenaltyStep;
972
+ orderHash?: Hex;
973
+ attempt?: number;
974
+ at: TimeMs;
975
+ details: Record<string, unknown>;
976
+ }
977
+ type PenaltyList = Page<PenaltyRecord>;
978
+ interface DrawAttempt {
979
+ attempt: number;
980
+ tBase: DecString;
981
+ closedBy: DrawClosedBy | null;
982
+ drandRound: DecString;
983
+ drandRandomness: Hex;
984
+ drandSignature: Hex;
985
+ candidates: {
986
+ fillerId: string;
987
+ weight: DecString;
988
+ }[];
989
+ r: DecString;
990
+ winnerFillerId: string;
991
+ fallbackReason: 'DRAW_FALLBACK' | null;
992
+ }
993
+ interface DrawRecord {
994
+ orderHash: Hex;
995
+ source: string;
996
+ openRef: string;
997
+ t0: DecString;
998
+ epochId: DecString;
999
+ deltaDrand: number;
1000
+ attempts: DrawAttempt[];
1001
+ sig: Hex;
1002
+ }
1003
+ interface EpochLeaf {
1004
+ fillerId: string;
1005
+ base: DecString;
1006
+ tier: number;
1007
+ reliabilityBps: number;
1008
+ }
1009
+ interface EpochRecord {
1010
+ epochId: DecString;
1011
+ startsAt: DecString;
1012
+ endsAt: DecString;
1013
+ weightsRoot: Hex;
1014
+ leaves: EpochLeaf[];
1015
+ stakeSteps: {
1016
+ tier: number;
1017
+ minStake: DecString;
1018
+ step: DecString;
1019
+ }[];
1020
+ rMinBps: number;
1021
+ snapshotBlocks: Record<string, DecString>;
1022
+ sig: Hex;
1023
+ }
1024
+ /** `GET /v1/gateway`: the mirror of `FILLER_GATEWAYS` for one environment. */
1025
+ interface GatewayInfo {
1026
+ env: string;
1027
+ gateway: Hex;
1028
+ ticketSigners: Hex[];
1029
+ protocolVersion: '1';
1030
+ maxMessageAgeMs: number;
1031
+ }
1032
+ /**
1033
+ * `FillerKeyRegistration` with its signature by the key being registered (§3.16): handed to Cancore at
1034
+ * onboarding and, signed by the NEW key, at a manual key change by staff. Not a frame — no message changes a key.
1035
+ */
1036
+ interface SignedFillerKeyRegistration {
1037
+ fillerId: string;
1038
+ messageKey: Hex;
1039
+ issuedAt: DecString;
1040
+ sig: Hex;
1041
+ }
1042
+
1043
+ interface FillerEnvelopeContext {
1044
+ /** The `fillerId` the session (or bearer token) is authenticated for. */
1045
+ fillerId: string;
1046
+ /** Arrival time, unix ms, the receiver's clock. */
1047
+ receivedAt: number;
1048
+ /** `GET /v1/gateway` `maxMessageAgeMs`. */
1049
+ maxMessageAgeMs: number;
1050
+ }
1051
+ /**
1052
+ * The error code the gateway answers for the first envelope check `message`
1053
+ * fails, in the order of §3.4, or `null` when every key-free check passes:
1054
+ * `BAD_SIGNATURE` — `msgSig` missing or not a 65-byte low-s EOA signature;
1055
+ * `UNAUTHENTICATED` — `fillerId` is not the session's; `BAD_REQUEST` — `sentAt`
1056
+ * not unix milliseconds, or no valid `id`; `STALE_MESSAGE` — `sentAt` further
1057
+ * than `maxMessageAgeMs` from `receivedAt`.
1058
+ */
1059
+ declare function fillerEnvelopeError(message: object, ctx: FillerEnvelopeContext): ErrorCode | null;
1060
+ /**
1061
+ * Until when (unix ms, receiver clock) the receiver must remember an accepted
1062
+ * message `id` to refuse its replay: `max(receivedAt, sentAt) + maxMessageAgeMs`.
1063
+ * Freshness is symmetric (`|receivedAt − sentAt| ≤ maxMessageAgeMs`), so a
1064
+ * message whose `sentAt` runs ahead of the receiver's clock stays fresh until
1065
+ * `sentAt + maxMessageAgeMs` — later than `receivedAt + maxMessageAgeMs`.
1066
+ * Forgetting the id earlier would let the byte-identical message in again;
1067
+ * after this time a replay fails the freshness check by itself.
1068
+ */
1069
+ declare function messageIdRetainUntil(sentAt: number, receivedAt: number, maxMessageAgeMs: number): number;
1070
+
1071
+ interface DrawCandidate {
1072
+ fillerId: string;
1073
+ /** Decimal string on the wire; the integer weight of auction-and-draw A-11. */
1074
+ weight: string | bigint;
1075
+ }
1076
+ interface DrawOutcome {
1077
+ r: bigint;
1078
+ winnerFillerId: string;
1079
+ }
1080
+ /** drand quicknet, the randomness beacon of the draw (auction-and-draw §4). */
1081
+ declare const DRAND_QUICKNET: {
1082
+ readonly chainHash: "52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971";
1083
+ readonly publicKey: "83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a";
1084
+ readonly scheme: "bls-unchained-g1-rfc9380";
1085
+ readonly genesisTime: 1692803367;
1086
+ readonly period: 3;
1087
+ };
1088
+ /** The first quicknet round whose time is at or after `unixSeconds` (A-20: `round_k` for `t_k + δ_drand`). */
1089
+ declare function firstRoundAtOrAfter(unixSeconds: bigint | number): bigint;
1090
+ /** `h = uint256(keccak256(randomness ‖ orderHash ‖ uint32be(attempt)))` — the 68-byte preimage of A-21. */
1091
+ declare function drawValue(randomness: Hex | string, orderHash: Hex, attempt: number): bigint;
1092
+ /**
1093
+ * `r = h mod Σw`; the winner is the first candidate, in ascending UTF-8 byte
1094
+ * order of `fillerId` (A-22), whose cumulative weight exceeds `r`. Sorts a copy
1095
+ * itself, so a verifier compares the outcome, not the order it was served in.
1096
+ */
1097
+ declare function drawWinner(h: bigint, candidates: readonly DrawCandidate[]): DrawOutcome;
1098
+
1099
+ /** The protocol major this package describes: the `/v1` path and `auth.response.protocolVersion`. */
1100
+ declare const PROTOCOL_VERSION = "1";
1101
+ interface FillerGateway {
1102
+ /** The key every S→F message is signed with (`GatewayMessage`); null until the environment has one. */
1103
+ gateway: Hex | null;
1104
+ /** Keys that sign `FillTicket`; the same set is registered on every router of the environment. */
1105
+ ticketSigners: readonly Hex[];
1106
+ }
1107
+ /**
1108
+ * The published gateway key and ticket signers per environment — the release
1109
+ * data a taker checks every S→F signature and every ticket against, and never
1110
+ * takes from a gateway message. Empty in the RC: the keys do not exist yet
1111
+ * (O-6); the gateway release fills them in. Test keys never appear here.
1112
+ */
1113
+ declare const FILLER_GATEWAYS: Readonly<Record<DeploymentEnv, FillerGateway>>;
1114
+
1115
+ type JsonSchema = Readonly<Record<string, unknown>>;
1116
+ type MessageDirection = 'S2F' | 'F2S' | 'both';
1117
+ interface RestEndpoint {
1118
+ method: 'GET' | 'POST';
1119
+ path: string;
1120
+ auth: 'none' | 'bearer';
1121
+ /** A `$ref` into rest.schema.json (`#/…`) or a sibling schema (`messages.schema.json#/…`). */
1122
+ request?: string;
1123
+ query?: string;
1124
+ response: string;
1125
+ }
1126
+ declare const PROTOCOL_SCHEMAS: {
1127
+ readonly messages: JsonSchema;
1128
+ readonly rest: JsonSchema;
1129
+ readonly records: JsonSchema;
1130
+ };
1131
+ declare const ASYNCAPI: JsonSchema;
1132
+ /** The annotation keywords the schemas use; a strict validator must be told they exist. */
1133
+ declare const SCHEMA_VOCABULARY: readonly string[];
1134
+ /** Frame type → who sends it: S2F gateway to taker, F2S taker to gateway, both. */
1135
+ declare const MESSAGE_DIRECTIONS: Readonly<Record<string, MessageDirection>>;
1136
+ declare const REST_ENDPOINTS: readonly RestEndpoint[];
1137
+ /**
1138
+ * The absolute `$ref` of a frame type's schema (or any other `$def` of messages.schema.json).
1139
+ * `direction` picks the copy of a type that goes both ways: `ping`/`pong` from the gateway are
1140
+ * signed (`pingS2F`), from a taker they are not (`pingF2S`); without it, either copy passes.
1141
+ */
1142
+ declare function messageSchemaRef(type: string, direction?: 'S2F' | 'F2S'): string;
1143
+
1144
+ /** The evm-contracts release these ABIs were taken from, and the commit of the checkout they were read at. */
76
1145
  declare const CONTRACTS_RELEASE: {
77
1146
  readonly version: "1.4.0-dev";
78
1147
  readonly releaseChannel: "dev";
79
1148
  readonly updatedAt: "2026-07-24T19:55:00Z";
1149
+ readonly commit: "8c7d36f6a4f1cb76e6d5098c4f4b18367d46e350";
1150
+ };
1151
+ /**
1152
+ * Per contract, the build of the release, as evm-contracts
1153
+ * scripts/tools/check-bytecode-match.mjs records it. `creationHexSha256` and
1154
+ * `runtimeHexSha256` are sha256 of the UTF-8 text of the artifact's 0x-prefixed hex of the
1155
+ * creation and runtime bytecode (not keccak256, not of the bytes); `creationHexLength` and
1156
+ * `runtimeHexLength` are the length of that text including the 0x. It pins the build a
1157
+ * release was made from. It is not a hash of `eth_getCode` — a contract with immutables
1158
+ * (CancoreRouter, FeeVault) never matches one — so checking a live deployment against it
1159
+ * needs a rebuild, not a lookup.
1160
+ */
1161
+ declare const BUILD_HASHES: {
1162
+ readonly HTLC: {
1163
+ readonly creationHexSha256: "93a991d3a6451f7c3f02dfb70b365a48d29bebccc7f16d8dbe3d56d3dfee0af1";
1164
+ readonly runtimeHexSha256: "40ab52456c3b5a04365fc1fad837eb79bbe4b85c8dbd990f549468ae48f97e3a";
1165
+ readonly creationHexLength: 14976;
1166
+ readonly runtimeHexLength: 14686;
1167
+ };
1168
+ readonly FeeVault: {
1169
+ readonly creationHexSha256: "1c97d27c8d3e584f879bb57549d75ef10394a56a298eaf4a772516b9316e2248";
1170
+ readonly runtimeHexSha256: "0631177a64cde0829c2cec8426c08a507564f7d8b084e0237d724ed63faea0e9";
1171
+ readonly creationHexLength: 13176;
1172
+ readonly runtimeHexLength: 10968;
1173
+ };
1174
+ readonly MultiBalanceChecker: {
1175
+ readonly creationHexSha256: "c0a0326694f2a1594e332ba06120692cc98bc06c57d6d8981cb3768e01fad423";
1176
+ readonly runtimeHexSha256: "93a1f0aa251715cc6a1b6a472f10762463b5c24668886630cbc6da5632e5739b";
1177
+ readonly creationHexLength: 2456;
1178
+ readonly runtimeHexLength: 2394;
1179
+ };
1180
+ readonly CancoreRouter: {
1181
+ readonly creationHexSha256: "615b6fb47a4255df9f7fdec963811cdfbefb53166645cd19466fa268df7fb39d";
1182
+ readonly runtimeHexSha256: "dec1f5d541c6b383b95b6c53e278123cc3844bdeff3f977a166fb6e9cbf86343";
1183
+ readonly creationHexLength: 43102;
1184
+ readonly runtimeHexLength: 36984;
1185
+ };
1186
+ readonly CNRXStaking: {
1187
+ readonly creationHexSha256: "dfda056ee22b593e2f2e1fc4e679fbb9dc34b04964f389b46914402c422b40fb";
1188
+ readonly runtimeHexSha256: "d11534242f166e52f4ad063b5b6b59146e31634d3932f7ad63db05d83a1485f6";
1189
+ readonly creationHexLength: 7412;
1190
+ readonly runtimeHexLength: 6240;
1191
+ };
1192
+ readonly PointsClaim: {
1193
+ readonly creationHexSha256: "0f29890b609f7e15ef4dbcda17a7f2cd7482d016a0057a5f6c4270d7780ff38d";
1194
+ readonly runtimeHexSha256: "f2b10c4ec8458c0d6ab0f465481e645524f618f7a3327822e8ae5d3fd42fa46c";
1195
+ readonly creationHexLength: 14300;
1196
+ readonly runtimeHexLength: 11504;
1197
+ };
1198
+ readonly BurnMintTokenPool: {
1199
+ readonly creationHexSha256: "b5b19721149d9dd63e0650d0a1f95ac82affa4b9c650fdffd375db6ea361e416";
1200
+ readonly runtimeHexSha256: "c9aaa6a40ef4f0caadeb66f0a9adc68b1191949e9e0bdb420f331132bf651c3a";
1201
+ readonly creationHexLength: 41756;
1202
+ readonly runtimeHexLength: 39936;
1203
+ };
1204
+ readonly CNRX: {
1205
+ readonly creationHexSha256: "61b4e114722e99f93aac4bd4ef3cfb7973dd050b66e6ffb326efad29d4cc8c95";
1206
+ readonly runtimeHexSha256: "2b23774e41fb25f820227a50de4f48d7ad79b0bd131c1956aab07c100e0c3948";
1207
+ readonly creationHexLength: 21266;
1208
+ readonly runtimeHexLength: 17374;
1209
+ };
80
1210
  };
81
1211
  /**
82
- * keccak256 of the compiled creation and runtime bytecode per contract — what a
83
- * deployment can be checked against, independent of any address list.
1212
+ * @deprecated Use `BUILD_HASHES`: the same values under names that say what they are
1213
+ * (bytecodeHash → creationHexSha256, deployedBytecodeHash → runtimeHexSha256,
1214
+ * bytecodeLength → creationHexLength, deployedBytecodeLength → runtimeHexLength).
1215
+ * Kept for one release candidate; removed before 0.2.0.
84
1216
  */
85
1217
  declare const BYTECODE_HASHES: {
86
1218
  readonly HTLC: {
87
- readonly bytecodeHash: "17e8b4dfbb8cb7095ce9f0c0334a8f506233e70c3baa1c15784ccb594c5ba07f";
88
- readonly deployedBytecodeHash: "86cff816f5875c8c5afefe9feb223c62ec5c0e2754606db2cecc96883c50c6a2";
89
- readonly bytecodeLength: 14204;
90
- readonly deployedBytecodeLength: 13914;
1219
+ readonly bytecodeHash: "93a991d3a6451f7c3f02dfb70b365a48d29bebccc7f16d8dbe3d56d3dfee0af1";
1220
+ readonly deployedBytecodeHash: "40ab52456c3b5a04365fc1fad837eb79bbe4b85c8dbd990f549468ae48f97e3a";
1221
+ readonly bytecodeLength: 14976;
1222
+ readonly deployedBytecodeLength: 14686;
91
1223
  };
92
1224
  readonly FeeVault: {
93
- readonly bytecodeHash: "83785435a8a603143b3bbf0a68587a0df1f966bfdbb66b364ca4f39b9c276da4";
94
- readonly deployedBytecodeHash: "e2458a305d0b8c4489cdf5cde2f1fa3411157292ffb7b2cfc95169550f093bec";
95
- readonly bytecodeLength: 13680;
96
- readonly deployedBytecodeLength: 11472;
1225
+ readonly bytecodeHash: "1c97d27c8d3e584f879bb57549d75ef10394a56a298eaf4a772516b9316e2248";
1226
+ readonly deployedBytecodeHash: "0631177a64cde0829c2cec8426c08a507564f7d8b084e0237d724ed63faea0e9";
1227
+ readonly bytecodeLength: 13176;
1228
+ readonly deployedBytecodeLength: 10968;
97
1229
  };
98
1230
  readonly MultiBalanceChecker: {
99
1231
  readonly bytecodeHash: "c0a0326694f2a1594e332ba06120692cc98bc06c57d6d8981cb3768e01fad423";
@@ -101,11 +1233,23 @@ declare const BYTECODE_HASHES: {
101
1233
  readonly bytecodeLength: 2456;
102
1234
  readonly deployedBytecodeLength: 2394;
103
1235
  };
104
- readonly CNRX: {
105
- readonly bytecodeHash: "61b4e114722e99f93aac4bd4ef3cfb7973dd050b66e6ffb326efad29d4cc8c95";
106
- readonly deployedBytecodeHash: "2b23774e41fb25f820227a50de4f48d7ad79b0bd131c1956aab07c100e0c3948";
107
- readonly bytecodeLength: 21266;
108
- readonly deployedBytecodeLength: 17374;
1236
+ readonly CancoreRouter: {
1237
+ readonly bytecodeHash: "615b6fb47a4255df9f7fdec963811cdfbefb53166645cd19466fa268df7fb39d";
1238
+ readonly deployedBytecodeHash: "dec1f5d541c6b383b95b6c53e278123cc3844bdeff3f977a166fb6e9cbf86343";
1239
+ readonly bytecodeLength: 43102;
1240
+ readonly deployedBytecodeLength: 36984;
1241
+ };
1242
+ readonly CNRXStaking: {
1243
+ readonly bytecodeHash: "dfda056ee22b593e2f2e1fc4e679fbb9dc34b04964f389b46914402c422b40fb";
1244
+ readonly deployedBytecodeHash: "d11534242f166e52f4ad063b5b6b59146e31634d3932f7ad63db05d83a1485f6";
1245
+ readonly bytecodeLength: 7412;
1246
+ readonly deployedBytecodeLength: 6240;
1247
+ };
1248
+ readonly PointsClaim: {
1249
+ readonly bytecodeHash: "0f29890b609f7e15ef4dbcda17a7f2cd7482d016a0057a5f6c4270d7780ff38d";
1250
+ readonly deployedBytecodeHash: "f2b10c4ec8458c0d6ab0f465481e645524f618f7a3327822e8ae5d3fd42fa46c";
1251
+ readonly bytecodeLength: 14300;
1252
+ readonly deployedBytecodeLength: 11504;
109
1253
  };
110
1254
  readonly BurnMintTokenPool: {
111
1255
  readonly bytecodeHash: "b5b19721149d9dd63e0650d0a1f95ac82affa4b9c650fdffd375db6ea361e416";
@@ -113,13 +1257,20 @@ declare const BYTECODE_HASHES: {
113
1257
  readonly bytecodeLength: 41756;
114
1258
  readonly deployedBytecodeLength: 39936;
115
1259
  };
1260
+ readonly CNRX: {
1261
+ readonly bytecodeHash: "61b4e114722e99f93aac4bd4ef3cfb7973dd050b66e6ffb326efad29d4cc8c95";
1262
+ readonly deployedBytecodeHash: "2b23774e41fb25f820227a50de4f48d7ad79b0bd131c1956aab07c100e0c3948";
1263
+ readonly bytecodeLength: 21266;
1264
+ readonly deployedBytecodeLength: 17374;
1265
+ };
116
1266
  };
117
1267
 
118
1268
  /**
119
1269
  * `@cancore/contracts` — the Cancore EVM contracts as data.
120
1270
  *
121
1271
  * ABIs (`./abi`), the network registry (`./networks`), the EIP-712 voucher and
122
- * the release identity — no runtime code, no dependencies. What an integrator
1272
+ * the release identity; and the filler protocol v1 (`./protocol`): its EIP-712
1273
+ * types, hashing helpers and wire shapes. What an integrator
123
1274
  * needs to talk to the contracts without copying files out of our repositories,
124
1275
  * and what our own frontend, backend and MCP server can stop carrying four
125
1276
  * separate copies of.
@@ -128,4 +1279,4 @@ declare const BYTECODE_HASHES: {
128
1279
  /** Decode a revert's 4-byte selector into the custom error it names, if it is one of ours. */
129
1280
  declare function describeRevert(selectorOrData: string, tables: ReadonlyArray<Readonly<Record<string, string>>>): string | undefined;
130
1281
 
131
- export { BYTECODE_HASHES, CONTRACTS_RELEASE, DEPLOYMENTS, type DeploymentEnv, type EvmDeployment, FEE_CLAIM_DOMAIN_NAME, FEE_CLAIM_DOMAIN_VERSION, FEE_CLAIM_TYPES, type FeeClaim, PERMIT2_ADDRESS, deploymentOf, describeRevert, feeClaimDomain };
1282
+ export { ASYNCAPI, type AttestationCanton, type AttestationEvm, type AttestationsResponse, type AuthChallenge, type AuthOk, type AuthResponse, type AuthToken, BUILD_HASHES, BYTECODE_HASHES, CONTRACTS_RELEASE, DECLINE_REASONS, DEPLOYMENTS, DRAND_QUICKNET, DRAW_CLOSED_BY, type DecString, type DeclineReason, type DeploymentEnv, type DrawAttempt, type DrawCandidate, type DrawClosedBy, type DrawOutcome, type DrawRecord, ERROR_CODES, ERROR_HTTP_STATUS, EXEMPT_REASONS, EXPIRED_RESULTS, type EpochLeaf, type EpochRecord, type EpochWeights, type ErrorCode, type ErrorF2S, type ErrorMessage, type EvmDeployment, type ExemptReason, type ExpiredResult, type F2SBase, type F2SEnvelope, type F2SMessage, FEE_CLAIM_DOMAIN_NAME, FEE_CLAIM_DOMAIN_VERSION, FEE_CLAIM_TYPES, FILLER_AUTH_TYPES, FILLER_GATEWAYS, FILLER_ID_PATTERN, FILLER_KEY_REGISTRATION_TYPES, FILLER_MESSAGE_TYPES, FILLER_PROTOCOL_DOMAIN, FILLER_QUOTE_TYPES, FILL_PROOF_DOMAIN, FILL_PROOF_TYPES, FILL_PROOF_TYPE_STRING, FILL_TICKET_DOMAIN, FILL_TICKET_TYPES, type FeeClaim, type FillProof, type FillProofJson, type FillReported, type FillTicket, type FillerAuth, type FillerEnvelopeContext, type FillerGateway, type FillerKeyRegistration, type FillerMessage, type FillerQuote, type FillerStats, GATEWAY_MESSAGE_TYPES, type GatewayInfo, type GatewayMessage, type Hex, type JsonSchema, type JsonValue, MESSAGE_DIRECTIONS, type MessageDirection, ORDER_TYPES, type Order, type OrderJson, type OrderSettled, PENALTY_STEPS, PERMIT2_ADDRESS, PROOF_KIND_ATTESTATION, PROTOCOL_SCHEMAS, PROTOCOL_VERSION, type Page, type PenaltyApplied, type PenaltyList, type PenaltyRecord, type PenaltyStep, type Ping, type PingF2S, type PingS2F, type Pong, type PongF2S, type PongS2F, QUOTE_ACK_STATUSES, QUOTE_FINAL_STATUSES, QUOTE_TYPES, type Quote, type QuoteAck, type QuoteAckStatus, type QuoteFinalStatus, type QuoteList, type QuoteMessage, type QuoteReconfirm, type QuoteReconfirmReply, type QuoteRecord, type QuoteRequest, REST_ENDPOINTS, type RestEndpoint, type S2FBase, type S2FMessage, SCHEMA_VOCABULARY, STAKE_BINDING_TYPES, type SettleAttestations, type SettleAttestationsPayload, type SignedFillerKeyRegistration, type StakeBinding, type StakeBindingRequest, TICKET_INTENT_TYPES, TICKET_LIST_STATUSES, TICKET_RECEIPT_TYPES, TICKET_REFUSED_REASONS, type TicketDecline, type TicketExpired, type TicketIntent, type TicketIntentAck, type TicketIntentMessage, type TicketIssued, type TicketIssuedCanton, type TicketIssuedEvm, type TicketJson, type TicketList, type TicketOffer, type TicketReceipt, type TicketReceiptMessage, type TicketRefusedReason, type TimeMs, type TypedDataDomain, type TypedDataInput, type TypedDataTypes, type TypedField, type TypedValue, type UintLike, type WireAsset, cantonSigEntries, deploymentOf, describeRevert, drawValue, drawWinner, encodeType, evmAddressFromRepayTo, feeClaimDomain, fillProofDomain, fillerEnvelopeError, fillerIdHash, fillerMessageBodyHash, firstRoundAtOrAfter, gatewayBodyHash, hashDomain, hashFillProof, hashFillTicket, hashFillerKeyRegistration, hashFillerMessage, hashFillerQuote, hashStruct, hashTicketIntent, hashTypedData, isCantonSource, isEoaSignature, isEvmRepayTo, jcs, messageIdRetainUntil, messageSchemaRef, repayToFromEvm, repayToFromParty, requestIdHash, routerDomain, settleAttestationsErrors, settleAttestationsPayload, settleAttestationsPayloadHash, settleSigs, typeHash };