@cancore/contracts 0.1.0 → 0.2.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +448 -10
- package/dist/abi.d.ts +6598 -1675
- package/dist/abi.js +1 -1
- package/dist/chunk-2ELHDMZ7.js +9911 -0
- package/dist/chunk-2ELHDMZ7.js.map +1 -0
- package/dist/{chunk-CIBYXHSX.js → chunk-IAPV7XWJ.js} +2 -2
- package/dist/chunk-IAPV7XWJ.js.map +1 -0
- package/dist/index.d.ts +1559 -29
- package/dist/index.js +2925 -17
- package/dist/index.js.map +1 -1
- package/dist/networks.d.ts +2 -2
- package/dist/networks.js +1 -1
- package/package.json +10 -8
- package/spec/abi/AttestorSet.json +476 -0
- package/spec/abi/CNRX.json +1294 -0
- package/spec/abi/CNRXStaking.json +510 -0
- package/spec/abi/CancoreRouter.json +2666 -0
- package/spec/abi/FeeVault.json +604 -0
- package/spec/abi/HTLC.json +717 -0
- package/spec/abi/IAttribute.json +110 -0
- package/spec/abi/IBurnMintERC20.json +252 -0
- package/spec/abi/ICancoreRouter.json +1361 -0
- package/spec/abi/IFormula.json +28 -0
- package/spec/abi/IHTLC.json +382 -0
- package/spec/abi/IPayment.json +40 -0
- package/spec/abi/IPermit2.json +150 -0
- package/spec/abi/IResolver.json +55 -0
- package/spec/abi/IStep.json +30 -0
- package/spec/abi/IVariableRole.json +141 -0
- package/spec/abi/MultiBalanceChecker.json +34 -0
- package/spec/abi/PointsClaim.json +791 -0
- package/spec/constants.json +66 -0
- package/spec/protocol/asyncapi.json +1265 -0
- package/spec/protocol/messages.schema.json +543 -0
- package/spec/protocol/records.schema.json +94 -0
- package/spec/protocol/rest.schema.json +134 -0
- package/spec/protocol/typed-data/CantonTicketReceipt.json +77 -0
- package/spec/protocol/typed-data/FillerAuth.json +58 -0
- package/spec/protocol/typed-data/FillerKeyRegistration.json +69 -0
- package/spec/protocol/typed-data/FillerMessage.json +115 -0
- package/spec/protocol/typed-data/FillerQuote.json +75 -0
- package/spec/protocol/typed-data/GatewayMessage.json +95 -0
- package/spec/protocol/typed-data/StakeBinding.json +75 -0
- package/spec/protocol/typed-data/TicketIntent.json +113 -0
- package/spec/protocol/typed-data/TicketReceipt.json +51 -0
- package/spec/protocol/vectors/draw.json +61 -0
- package/spec/protocol/vectors/jcs.json +59 -0
- package/spec/protocol/vectors/messages.json +550 -0
- package/spec/protocol/vectors/records.json +81 -0
- package/spec/protocol/vectors/settle-attestations.json +542 -0
- package/spec/typed-data/FillProof.json +227 -0
- package/spec/typed-data/FillTicket.json +116 -0
- package/spec/typed-data/Order.json +169 -0
- package/spec/typed-data/Quote.json +79 -0
- package/spec/vectors/canton-destination.json +60 -0
- package/spec/vectors/canton-order.json +70 -0
- package/spec/vectors/evm-order.json +50 -0
- package/spec/vectors/fee-split.json +179 -0
- package/spec/vectors/permit-witness.json +150 -0
- package/dist/chunk-CIBYXHSX.js.map +0 -1
- package/dist/chunk-ZSX67S72.js +0 -3423
- 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, IATTRIBUTE_ABI, IBURN_MINT_ERC20_ABI, ICANCORE_ROUTER_ABI, ICANCORE_ROUTER_ERRORS, IFORMULA_ABI, IHTLC_ABI, IPAYMENT_ABI, IPERMIT2_ABI, IRESOLVER_ABI, ISTEP_ABI, IVARIABLE_ROLE_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
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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,133 @@ 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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
/** `FillTicket(bytes32 orderHash,bytes32 fillerId,address deliveryKey,bytes32 repayTo,uint32 attempt,uint64 validFrom,uint64 validUntil)` — from evm-contracts/abi/typed-data/FillTicket.json. */
|
|
80
|
+
declare const FILL_TICKET_TYPES: {
|
|
81
|
+
readonly FillTicket: readonly [{
|
|
82
|
+
readonly name: "orderHash";
|
|
83
|
+
readonly type: "bytes32";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "fillerId";
|
|
86
|
+
readonly type: "bytes32";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "deliveryKey";
|
|
89
|
+
readonly type: "address";
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "repayTo";
|
|
92
|
+
readonly type: "bytes32";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "attempt";
|
|
95
|
+
readonly type: "uint32";
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "validFrom";
|
|
98
|
+
readonly type: "uint64";
|
|
99
|
+
}, {
|
|
100
|
+
readonly name: "validUntil";
|
|
101
|
+
readonly type: "uint64";
|
|
102
|
+
}];
|
|
103
|
+
};
|
|
104
|
+
/** Name and version of the domain; chain id and verifying contract are the deployment's. */
|
|
105
|
+
declare const FILL_TICKET_DOMAIN: {
|
|
106
|
+
readonly name: "CancoreFillTicket";
|
|
107
|
+
readonly version: "1";
|
|
108
|
+
};
|
|
109
|
+
/** `Order(address user,uint64 originChainId,address inputToken,uint256 inputAmount,bytes32 destination,bytes32 outputAsset,uint256 minReceived,bytes32 recipient,uint64 createdAt,uint64 fillDeadline,uint16 feeBps,bytes32 fillerId)` — from evm-contracts/abi/typed-data/Order.json. */
|
|
110
|
+
declare const ORDER_TYPES: {
|
|
111
|
+
readonly Order: readonly [{
|
|
112
|
+
readonly name: "user";
|
|
113
|
+
readonly type: "address";
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "originChainId";
|
|
116
|
+
readonly type: "uint64";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "inputToken";
|
|
119
|
+
readonly type: "address";
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "inputAmount";
|
|
122
|
+
readonly type: "uint256";
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "destination";
|
|
125
|
+
readonly type: "bytes32";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "outputAsset";
|
|
128
|
+
readonly type: "bytes32";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "minReceived";
|
|
131
|
+
readonly type: "uint256";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "recipient";
|
|
134
|
+
readonly type: "bytes32";
|
|
135
|
+
}, {
|
|
136
|
+
readonly name: "createdAt";
|
|
137
|
+
readonly type: "uint64";
|
|
138
|
+
}, {
|
|
139
|
+
readonly name: "fillDeadline";
|
|
140
|
+
readonly type: "uint64";
|
|
141
|
+
}, {
|
|
142
|
+
readonly name: "feeBps";
|
|
143
|
+
readonly type: "uint16";
|
|
144
|
+
}, {
|
|
145
|
+
readonly name: "fillerId";
|
|
146
|
+
readonly type: "bytes32";
|
|
147
|
+
}];
|
|
148
|
+
};
|
|
149
|
+
/** `Quote(bytes32 orderHash,uint64 quoteDeadline)` — from evm-contracts/abi/typed-data/Quote.json. */
|
|
150
|
+
declare const QUOTE_TYPES: {
|
|
151
|
+
readonly Quote: readonly [{
|
|
152
|
+
readonly name: "orderHash";
|
|
153
|
+
readonly type: "bytes32";
|
|
154
|
+
}, {
|
|
155
|
+
readonly name: "quoteDeadline";
|
|
156
|
+
readonly type: "uint64";
|
|
157
|
+
}];
|
|
158
|
+
};
|
|
159
|
+
|
|
39
160
|
declare const FEE_CLAIM_DOMAIN_NAME = "CancoreFeeVault";
|
|
40
161
|
declare const FEE_CLAIM_DOMAIN_VERSION = "1";
|
|
41
162
|
/** `FeeClaim(address token,address to,uint256 amount,uint256 nonce,uint256 deadline)` */
|
|
@@ -72,28 +193,1418 @@ declare function feeClaimDomain(chainId: number, verifyingContract: `0x${string}
|
|
|
72
193
|
readonly verifyingContract: `0x${string}`;
|
|
73
194
|
};
|
|
74
195
|
|
|
75
|
-
/**
|
|
196
|
+
/** `FillProof.kind` of v1: k-of-n attestor signatures — the only kind `settle` accepts. */
|
|
197
|
+
declare const PROOF_KIND_ATTESTATION = 1;
|
|
198
|
+
/**
|
|
199
|
+
* What the attestors sign and `CancoreRouter.settle` verifies: the fact of a
|
|
200
|
+
* delivery on the destination chain, for one order. Written by hand from the
|
|
201
|
+
* contract's schema (`FILL_PROOF_TYPES`, which is generated); fillProof.test.ts
|
|
202
|
+
* fails to compile if the two stop naming the same fields.
|
|
203
|
+
*/
|
|
204
|
+
interface FillProof {
|
|
205
|
+
kind: number;
|
|
206
|
+
orderHash: `0x${string}`;
|
|
207
|
+
/** bytes32: EVM — the destination chain id, left-padded; Canton — `keccak256(utf8("canton:<network>"))`. */
|
|
208
|
+
destination: `0x${string}`;
|
|
209
|
+
/** EVM: the delivery transaction hash; Canton: keccak256 of the update id. */
|
|
210
|
+
fillRef: `0x${string}`;
|
|
211
|
+
recipient: `0x${string}`;
|
|
212
|
+
outputAsset: `0x${string}`;
|
|
213
|
+
/** What arrived, not what was sent. */
|
|
214
|
+
amountDelivered: bigint;
|
|
215
|
+
filledAt: bigint;
|
|
216
|
+
/** `fillerIdHash(fillerId)`: `Filled.fillerId` (EVM destination) or the hashed `DeliveryReceipt.fillerId` (Canton destination). */
|
|
217
|
+
fillerId: `0x${string}`;
|
|
218
|
+
/** The payee of `settle`, encoded for the source chain: `Filled.repayTo` or `DeliveryReceipt.repayTo`. */
|
|
219
|
+
repayTo: `0x${string}`;
|
|
220
|
+
attempt: number;
|
|
221
|
+
/** The attestor set live when the order opened — `attestationSetFor(orderHash)`, never `currentSetId`. */
|
|
222
|
+
setId: number;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The typed-data domain of a proof: the order's SOURCE router. `settle`
|
|
226
|
+
* recomputes the digest in its own domain, so a proof never verifies on
|
|
227
|
+
* another chain or another router. A Canton source (Daml settles) is
|
|
228
|
+
* CANTON_ORIGIN_ID = 2^63 + n, above Number.MAX_SAFE_INTEGER: pass a bigint.
|
|
229
|
+
*/
|
|
230
|
+
declare function fillProofDomain(chainId: number | bigint, verifyingContract: `0x${string}`): {
|
|
231
|
+
readonly chainId: number | bigint;
|
|
232
|
+
readonly verifyingContract: `0x${string}`;
|
|
233
|
+
readonly name: "CancoreRouter";
|
|
234
|
+
readonly version: "1";
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* The router's `hashFillProof`: the digest attestors sign and `settle` (or Daml
|
|
238
|
+
* `SwapIntent_SettleWithProof` on a Canton source) verifies, in the domain of
|
|
239
|
+
* the order's source router.
|
|
240
|
+
*/
|
|
241
|
+
declare function hashFillProof(proof: FillProof, chainId: number | bigint, verifyingContract: `0x${string}`): `0x${string}`;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The constants of the intent rail: the router's public constants (held to the
|
|
245
|
+
* contract by `spec/constants.json`, which `npm run sync` reads out of the
|
|
246
|
+
* Solidity source — SDK-6) and the constants of the Canton-source encoding
|
|
247
|
+
* (held to `spec/vectors/canton-order.json`, protocol.md §3.8).
|
|
248
|
+
* `PROOF_KIND_ATTESTATION` lives in `./eip712`, next to `FillProof`.
|
|
249
|
+
*/
|
|
250
|
+
/** `CancoreRouter.BPS`: basis points in one whole. */
|
|
251
|
+
declare const BPS = 10000;
|
|
252
|
+
/** `CancoreRouter.MAX_FEE_BPS`: the highest `Order.feeBps` `openFor` accepts — 10 % on top of the net, 1/11 of the total. */
|
|
253
|
+
declare const MAX_FEE_BPS = 1000;
|
|
254
|
+
/** `CancoreRouter.MIN_FILL_TTL`, seconds: `openFor` needs `fillDeadline ≥ now + MIN_FILL_TTL`. */
|
|
255
|
+
declare const MIN_FILL_TTL = 60;
|
|
256
|
+
/** `AttestorSet.MAX_FILL_TTL`, seconds (24 h): `openFor` needs `fillDeadline ≤ now + MAX_FILL_TTL`. */
|
|
257
|
+
declare const MAX_FILL_TTL = 86400;
|
|
258
|
+
/** `AttestorSet.MAX_SIG_TTL`, seconds (24 h): `openFor` needs `createdAt ≤ now ≤ createdAt + MAX_SIG_TTL`. */
|
|
259
|
+
declare const MAX_SIG_TTL = 86400;
|
|
260
|
+
/** `AttestorSet.MAX_PROOF_WINDOW`, seconds (4 h): the cap of `proofWindow`, so `refundAfter ≤ fillDeadline + MAX_PROOF_WINDOW`. */
|
|
261
|
+
declare const MAX_PROOF_WINDOW = 14400;
|
|
262
|
+
/** `AttestorSet.GRACE`, seconds (28 h): the longest intent lifetime; a replaced attestor set keeps verifying this long. */
|
|
263
|
+
declare const GRACE: number;
|
|
264
|
+
/** `AttestorSet.SET_DELAY`, seconds (72 h): a proposed attestor set activates this late; above `MAX_SIG_TTL + GRACE`. */
|
|
265
|
+
declare const SET_DELAY = 259200;
|
|
266
|
+
/** ⌊(2⁶⁴ − 1) / 2⌋ − 36, the largest EVM chain id EIP-2294 allows: every Canton origin id is above it. */
|
|
267
|
+
declare const EIP2294_MAX_CHAIN_ID = 9223372036854775771n;
|
|
268
|
+
/** `Order.originChainId` of a Canton-source order, per Canton network: 2⁶³ + n (2⁶³ itself is unassigned). */
|
|
269
|
+
declare const CANTON_ORIGIN_ID: {
|
|
270
|
+
readonly mainnet: 9223372036854775809n;
|
|
271
|
+
readonly testnet: 9223372036854775810n;
|
|
272
|
+
readonly devnet: 9223372036854775811n;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* `verifyingContract` of the Canton source domain, one for every Canton network:
|
|
276
|
+
* `address(uint160(uint256(keccak256("cancore:canton-source-anchor:v1"))))`, an address no router can be deployed at.
|
|
277
|
+
*/
|
|
278
|
+
declare const CANTON_SOURCE_ANCHOR: "0x2f37b46Ea93001829498b145985fb53028033701";
|
|
279
|
+
/** Domain-separation tag of the owner label (`Order.user` of a Canton-source order). */
|
|
280
|
+
declare const OWNER_LABEL_TAG = "cancore:owner:v1";
|
|
281
|
+
/** Domain-separation tag of the instrument label (`Order.inputToken` of a Canton-source order). */
|
|
282
|
+
declare const INSTRUMENT_LABEL_TAG = "cancore:instrument:v1";
|
|
283
|
+
/** Daml `Numeric 10`: Canton amounts are exact at 10⁻¹⁰, and their EVM form is the amount × 10¹⁰. */
|
|
284
|
+
declare const DAML_NUMERIC_SCALE = 10;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The EIP-712 types and domains of the Cancore intent rail, filler protocol v1.
|
|
288
|
+
*
|
|
289
|
+
* The CODE types (`Order`, `Quote`, `FillTicket`; `FillProof` lives in
|
|
290
|
+
* `../eip712`) come from evm-contracts/abi/typed-data through npm run sync.
|
|
291
|
+
* Their public names stay here so callers use the same synchronized schemas.
|
|
292
|
+
* The PROTOCOL types are off-chain,
|
|
293
|
+
* signed in the `CancoreFillerProtocol` domain by the filler's one message key
|
|
294
|
+
* (or the gateway key), and fixed by this package: a field reordered here
|
|
295
|
+
* changes every digest, and the golden vectors under `spec/protocol/typed-data`
|
|
296
|
+
* fail the moment it happens.
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
type Hex = `0x${string}`;
|
|
300
|
+
/** A wide unsigned integer as the wire carries it (decimal string) or as code holds it. */
|
|
301
|
+
type UintLike = bigint | number | string;
|
|
302
|
+
/** Name and version of the domain every off-chain protocol struct is signed in — no chain id, no verifying contract. */
|
|
303
|
+
declare const FILLER_PROTOCOL_DOMAIN: {
|
|
304
|
+
readonly name: "CancoreFillerProtocol";
|
|
305
|
+
readonly version: "1";
|
|
306
|
+
};
|
|
307
|
+
/** The source-router domain `Order` and `Quote` are hashed in. Canton source: `CANTON_ORIGIN_ID` and the anchor. */
|
|
308
|
+
declare function routerDomain(chainId: UintLike, verifyingContract: Hex): {
|
|
309
|
+
readonly chainId: UintLike;
|
|
310
|
+
readonly verifyingContract: `0x${string}`;
|
|
311
|
+
readonly name: "CancoreRouter";
|
|
312
|
+
readonly version: "1";
|
|
313
|
+
};
|
|
314
|
+
/** `FillerQuote(bytes32 requestId,string fillerId,uint256 amountOut,uint64 validUntil,uint64 nonce)` — signed by the message key. */
|
|
315
|
+
declare const FILLER_QUOTE_TYPES: {
|
|
316
|
+
readonly FillerQuote: readonly [{
|
|
317
|
+
readonly name: "requestId";
|
|
318
|
+
readonly type: "bytes32";
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "fillerId";
|
|
321
|
+
readonly type: "string";
|
|
322
|
+
}, {
|
|
323
|
+
readonly name: "amountOut";
|
|
324
|
+
readonly type: "uint256";
|
|
325
|
+
}, {
|
|
326
|
+
readonly name: "validUntil";
|
|
327
|
+
readonly type: "uint64";
|
|
328
|
+
}, {
|
|
329
|
+
readonly name: "nonce";
|
|
330
|
+
readonly type: "uint64";
|
|
331
|
+
}];
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* `TicketIntent(bytes32 orderHash,uint32 attempt,uint64 validFrom,uint64 validUntil,string fillerId,address deliveryKey,bytes32 repayTo)`
|
|
335
|
+
* — the filler's consent to an offered ticket, signed by its message key; `deliveryKey` and `repayTo` go into the `FillTicket` as they are.
|
|
336
|
+
*/
|
|
337
|
+
declare const TICKET_INTENT_TYPES: {
|
|
338
|
+
readonly TicketIntent: readonly [{
|
|
339
|
+
readonly name: "orderHash";
|
|
340
|
+
readonly type: "bytes32";
|
|
341
|
+
}, {
|
|
342
|
+
readonly name: "attempt";
|
|
343
|
+
readonly type: "uint32";
|
|
344
|
+
}, {
|
|
345
|
+
readonly name: "validFrom";
|
|
346
|
+
readonly type: "uint64";
|
|
347
|
+
}, {
|
|
348
|
+
readonly name: "validUntil";
|
|
349
|
+
readonly type: "uint64";
|
|
350
|
+
}, {
|
|
351
|
+
readonly name: "fillerId";
|
|
352
|
+
readonly type: "string";
|
|
353
|
+
}, {
|
|
354
|
+
readonly name: "deliveryKey";
|
|
355
|
+
readonly type: "address";
|
|
356
|
+
}, {
|
|
357
|
+
readonly name: "repayTo";
|
|
358
|
+
readonly type: "bytes32";
|
|
359
|
+
}];
|
|
360
|
+
};
|
|
361
|
+
/** `TicketReceipt(bytes32 ticketHash,bytes32 ticketSigHash)` — signed by the message key. */
|
|
362
|
+
declare const TICKET_RECEIPT_TYPES: {
|
|
363
|
+
readonly TicketReceipt: readonly [{
|
|
364
|
+
readonly name: "ticketHash";
|
|
365
|
+
readonly type: "bytes32";
|
|
366
|
+
}, {
|
|
367
|
+
readonly name: "ticketSigHash";
|
|
368
|
+
readonly type: "bytes32";
|
|
369
|
+
}];
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* `CantonTicketReceipt(bytes32 orderHash,uint32 attempt,bytes32 deliveryOrderCidHash,uint64 validUntil)` — the receipt of a
|
|
373
|
+
* Canton-form ticket, which has no `FillTicket` and no `ticketSig`; signed by the message key. `fillerId` and `repayTo`
|
|
374
|
+
* are not in it: they travel in `ticket.issued` (protocol.md §3.3, §10 D-O).
|
|
375
|
+
*/
|
|
376
|
+
declare const CANTON_TICKET_RECEIPT_TYPES: {
|
|
377
|
+
readonly CantonTicketReceipt: readonly [{
|
|
378
|
+
readonly name: "orderHash";
|
|
379
|
+
readonly type: "bytes32";
|
|
380
|
+
}, {
|
|
381
|
+
readonly name: "attempt";
|
|
382
|
+
readonly type: "uint32";
|
|
383
|
+
}, {
|
|
384
|
+
readonly name: "deliveryOrderCidHash";
|
|
385
|
+
readonly type: "bytes32";
|
|
386
|
+
}, {
|
|
387
|
+
readonly name: "validUntil";
|
|
388
|
+
readonly type: "uint64";
|
|
389
|
+
}];
|
|
390
|
+
};
|
|
391
|
+
/** `StakeBinding(string partnerId,address stakingAddress,uint256 chainId,uint64 nonce)` — signed by the staking address. */
|
|
392
|
+
declare const STAKE_BINDING_TYPES: {
|
|
393
|
+
readonly StakeBinding: readonly [{
|
|
394
|
+
readonly name: "partnerId";
|
|
395
|
+
readonly type: "string";
|
|
396
|
+
}, {
|
|
397
|
+
readonly name: "stakingAddress";
|
|
398
|
+
readonly type: "address";
|
|
399
|
+
}, {
|
|
400
|
+
readonly name: "chainId";
|
|
401
|
+
readonly type: "uint256";
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: "nonce";
|
|
404
|
+
readonly type: "uint64";
|
|
405
|
+
}];
|
|
406
|
+
};
|
|
407
|
+
/** `FillerAuth(string fillerId,bytes32 nonce,uint64 expiresAt)` — signed by the message key. */
|
|
408
|
+
declare const FILLER_AUTH_TYPES: {
|
|
409
|
+
readonly FillerAuth: readonly [{
|
|
410
|
+
readonly name: "fillerId";
|
|
411
|
+
readonly type: "string";
|
|
412
|
+
}, {
|
|
413
|
+
readonly name: "nonce";
|
|
414
|
+
readonly type: "bytes32";
|
|
415
|
+
}, {
|
|
416
|
+
readonly name: "expiresAt";
|
|
417
|
+
readonly type: "uint64";
|
|
418
|
+
}];
|
|
419
|
+
};
|
|
420
|
+
/** `GatewayMessage(bytes32 bodyHash)` — signed by the gateway key; `bodyHash = gatewayBodyHash(message)`. */
|
|
421
|
+
declare const GATEWAY_MESSAGE_TYPES: {
|
|
422
|
+
readonly GatewayMessage: readonly [{
|
|
423
|
+
readonly name: "bodyHash";
|
|
424
|
+
readonly type: "bytes32";
|
|
425
|
+
}];
|
|
426
|
+
};
|
|
427
|
+
/** `FillerMessage(bytes32 bodyHash)` — the envelope `msgSig` of every filler message, by the message key; `bodyHash = fillerMessageBodyHash(message)`. */
|
|
428
|
+
declare const FILLER_MESSAGE_TYPES: {
|
|
429
|
+
readonly FillerMessage: readonly [{
|
|
430
|
+
readonly name: "bodyHash";
|
|
431
|
+
readonly type: "bytes32";
|
|
432
|
+
}];
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* `FillerKeyRegistration(string fillerId,address messageKey,uint64 issuedAt)` — proof of possession of a message key,
|
|
436
|
+
* signed by that key: at onboarding, and with the NEW key at a manual key change by Cancore staff. There is no rotation type.
|
|
437
|
+
*/
|
|
438
|
+
declare const FILLER_KEY_REGISTRATION_TYPES: {
|
|
439
|
+
readonly FillerKeyRegistration: readonly [{
|
|
440
|
+
readonly name: "fillerId";
|
|
441
|
+
readonly type: "string";
|
|
442
|
+
}, {
|
|
443
|
+
readonly name: "messageKey";
|
|
444
|
+
readonly type: "address";
|
|
445
|
+
}, {
|
|
446
|
+
readonly name: "issuedAt";
|
|
447
|
+
readonly type: "uint64";
|
|
448
|
+
}];
|
|
449
|
+
};
|
|
450
|
+
interface Order {
|
|
451
|
+
user: Hex;
|
|
452
|
+
originChainId: UintLike;
|
|
453
|
+
inputToken: Hex;
|
|
454
|
+
inputAmount: UintLike;
|
|
455
|
+
destination: Hex;
|
|
456
|
+
outputAsset: Hex;
|
|
457
|
+
minReceived: UintLike;
|
|
458
|
+
recipient: Hex;
|
|
459
|
+
createdAt: UintLike;
|
|
460
|
+
fillDeadline: UintLike;
|
|
461
|
+
feeBps: number | string;
|
|
462
|
+
/** `fillerIdHash(fillerId)` of the filler the user picked: only its ticket fills the order and only a proof naming it settles it (`WrongFiller`). */
|
|
463
|
+
fillerId: Hex;
|
|
464
|
+
}
|
|
465
|
+
interface Quote {
|
|
466
|
+
orderHash: Hex;
|
|
467
|
+
quoteDeadline: UintLike;
|
|
468
|
+
}
|
|
469
|
+
interface FillTicket {
|
|
470
|
+
orderHash: Hex;
|
|
471
|
+
/** `fillerIdHash(fillerId)`: the on-chain form of the filler's id. */
|
|
472
|
+
fillerId: Hex;
|
|
473
|
+
/** The only address `fill` accepts this ticket from; the zero address never reaches a router (Canton destinations have no `FillTicket`). */
|
|
474
|
+
deliveryKey: Hex;
|
|
475
|
+
/** Where `settle` pays, encoded for the source chain (`repayToFromEvm`, `repayToFromParty`). */
|
|
476
|
+
repayTo: Hex;
|
|
477
|
+
attempt: number;
|
|
478
|
+
validFrom: UintLike;
|
|
479
|
+
validUntil: UintLike;
|
|
480
|
+
}
|
|
481
|
+
interface FillerQuote {
|
|
482
|
+
/** `requestIdHash(requestId)`, not the string. */
|
|
483
|
+
requestId: Hex;
|
|
484
|
+
fillerId: string;
|
|
485
|
+
amountOut: UintLike;
|
|
486
|
+
validUntil: UintLike;
|
|
487
|
+
nonce: UintLike;
|
|
488
|
+
}
|
|
489
|
+
interface TicketIntent {
|
|
490
|
+
orderHash: Hex;
|
|
491
|
+
attempt: number;
|
|
492
|
+
validFrom: UintLike;
|
|
493
|
+
validUntil: UintLike;
|
|
494
|
+
/** The signer's own id, the string form. */
|
|
495
|
+
fillerId: string;
|
|
496
|
+
/** The address that will send `fill` on the destination; the zero address for a Canton destination. */
|
|
497
|
+
deliveryKey: Hex;
|
|
498
|
+
/** Where `settle` pays, encoded for the source chain. */
|
|
499
|
+
repayTo: Hex;
|
|
500
|
+
}
|
|
501
|
+
interface TicketReceipt {
|
|
502
|
+
/** `hashTypedData` of the `FillTicket` in `FILL_TICKET_DOMAIN`. */
|
|
503
|
+
ticketHash: Hex;
|
|
504
|
+
/** keccak256 of the 65 raw signature bytes. */
|
|
505
|
+
ticketSigHash: Hex;
|
|
506
|
+
}
|
|
507
|
+
interface CantonTicketReceipt {
|
|
508
|
+
orderHash: Hex;
|
|
509
|
+
attempt: number;
|
|
510
|
+
/** `deliveryOrderCidHash(deliveryOrderCid)`: keccak256 of the contract id exactly as `ticket.issued` sent it. */
|
|
511
|
+
deliveryOrderCidHash: Hex;
|
|
512
|
+
/** `ticket.issued.validUntil` (= `DeliveryOrder.validUntil`), unix seconds. */
|
|
513
|
+
validUntil: UintLike;
|
|
514
|
+
}
|
|
515
|
+
interface StakeBinding {
|
|
516
|
+
partnerId: string;
|
|
517
|
+
stakingAddress: Hex;
|
|
518
|
+
chainId: UintLike;
|
|
519
|
+
nonce: UintLike;
|
|
520
|
+
}
|
|
521
|
+
interface FillerAuth {
|
|
522
|
+
fillerId: string;
|
|
523
|
+
nonce: Hex;
|
|
524
|
+
expiresAt: UintLike;
|
|
525
|
+
}
|
|
526
|
+
interface GatewayMessage {
|
|
527
|
+
bodyHash: Hex;
|
|
528
|
+
}
|
|
529
|
+
interface FillerMessage {
|
|
530
|
+
bodyHash: Hex;
|
|
531
|
+
}
|
|
532
|
+
interface FillerKeyRegistration {
|
|
533
|
+
fillerId: string;
|
|
534
|
+
/** The address derived from the key being registered. */
|
|
535
|
+
messageKey: Hex;
|
|
536
|
+
/** Unix seconds. */
|
|
537
|
+
issuedAt: UintLike;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/** The source-router domain an order is hashed in: its chain id and router (Canton: `CANTON_ORIGIN_ID`, `CANTON_SOURCE_ANCHOR`). */
|
|
541
|
+
interface OrderDomain {
|
|
542
|
+
chainId: UintLike;
|
|
543
|
+
verifyingContract: Hex | string;
|
|
544
|
+
}
|
|
545
|
+
/** `CancoreRouter.hashOrder`: the EIP-712 digest of `order` in the router domain `{chainId, verifyingContract}` — the `orderHash`. */
|
|
546
|
+
declare function hashOrder(order: Order, domain: OrderDomain): Hex;
|
|
547
|
+
/** Whether `chainId` is the `Order.originChainId` of a Canton network (`CANTON_ORIGIN_ID`). */
|
|
548
|
+
declare function isCantonOriginId(chainId: UintLike): boolean;
|
|
549
|
+
/**
|
|
550
|
+
* `CancoreRouter.sourceOrderHash`: the order hash as its SOURCE router computed it — what a destination
|
|
551
|
+
* keys `filled` on. A Canton origin hashes under `CANTON_SOURCE_ANCHOR`; an EVM origin needs the source
|
|
552
|
+
* router registered for it (`sourceRouter[originChainId]`), and is refused without one as the router
|
|
553
|
+
* reverts `SourceRouterUnknown`.
|
|
554
|
+
*/
|
|
555
|
+
declare function sourceOrderHash(order: Order, sourceRouter?: Hex | string): Hex;
|
|
556
|
+
/** A Canton-source intent as its owner signs it (`SwapIntentRequest`), the input of `buildCantonSourceOrder`. */
|
|
557
|
+
interface CantonSourceIntent {
|
|
558
|
+
/** Canton party id of the owner, e.g. `alice::1220abc…`. */
|
|
559
|
+
ownerPartyId: string;
|
|
560
|
+
/** `requestId` of the signed request; without it two identical requests would share a hash. */
|
|
561
|
+
requestId: string;
|
|
562
|
+
/** Party id of the instrument admin (registry operator). */
|
|
563
|
+
instrumentAdmin: string;
|
|
564
|
+
/** Instrument id inside that registry, e.g. `CNRX`. */
|
|
565
|
+
instrumentId: string;
|
|
566
|
+
/** Amount given (the total T, fee included), a Daml decimal string, at most 10 decimal places. */
|
|
567
|
+
amount: string;
|
|
568
|
+
/** EVM chain the output is delivered on. */
|
|
569
|
+
destinationChainId: UintLike;
|
|
570
|
+
/** ERC-20 delivered there. */
|
|
571
|
+
wantToken: string;
|
|
572
|
+
/** Its `decimals()`. */
|
|
573
|
+
wantDecimals: number;
|
|
574
|
+
/** Lower bound of the delivery, a decimal string in `wantToken` units. */
|
|
575
|
+
minReceived: string;
|
|
576
|
+
/** Receiver on the destination, an EVM address. */
|
|
577
|
+
recipient: string;
|
|
578
|
+
/** The owner-signed `orderCreatedAt` of the request (not the ledger time of Execute), unix seconds, a whole second. */
|
|
579
|
+
createdAt: number | string;
|
|
580
|
+
/** Unix seconds, a whole second. */
|
|
581
|
+
fillDeadline: number | string;
|
|
582
|
+
/** Inclusive fee rate as a decimal string, e.g. `"0.003"`; at most 4 decimal places, at most `MAX_FEE_BPS / 10 000`. */
|
|
583
|
+
feeRate: string;
|
|
584
|
+
/** One of `CANTON_ORIGIN_ID`. */
|
|
585
|
+
cantonOriginId: UintLike;
|
|
586
|
+
/** Id of the filler the owner picked, as Cancore issued it (e.g. `acme`); the order carries `keccak256(utf8(fillerId))`. */
|
|
587
|
+
fillerId: string;
|
|
588
|
+
}
|
|
589
|
+
interface CantonSourceOrder {
|
|
590
|
+
/** The EVM-form `Order`: wide integers as decimal strings, addresses EIP-55, words lowercase. */
|
|
591
|
+
order: Order;
|
|
592
|
+
/** The Canton source domain: `CancoreRouter` v1, `CANTON_ORIGIN_ID`, `CANTON_SOURCE_ANCHOR`. */
|
|
593
|
+
domain: {
|
|
594
|
+
name: 'CancoreRouter';
|
|
595
|
+
version: '1';
|
|
596
|
+
chainId: string;
|
|
597
|
+
verifyingContract: typeof CANTON_SOURCE_ANCHOR;
|
|
598
|
+
};
|
|
599
|
+
orderHash: Hex;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The EVM-form `Order` of a Canton-source intent and its source-domain hash (protocol.md §3.7).
|
|
603
|
+
* Refuses rather than rounds: an amount, a fee or a time the chain cannot represent exactly is
|
|
604
|
+
* rejected BEFORE the owner signs, because after that the `orderHash` is fixed.
|
|
605
|
+
*/
|
|
606
|
+
declare function buildCantonSourceOrder(intent: CantonSourceIntent): CantonSourceOrder;
|
|
607
|
+
/**
|
|
608
|
+
* `CancoreRouter.WITNESS_TYPE_STRING`: the tail Permit2 appends after
|
|
609
|
+
* `"PermitWitnessTransferFrom(TokenPermissions permitted,address spender,uint256 nonce,uint256 deadline,"`.
|
|
610
|
+
*/
|
|
611
|
+
declare const PERMIT2_WITNESS_TYPE_STRING: string;
|
|
612
|
+
/** The Permit2 witness typed data a wallet renders and signs (`eth_signTypedData_v4` types), the `Order` nested as `witness`. */
|
|
613
|
+
declare const PERMIT_WITNESS_TYPES: {
|
|
614
|
+
readonly Order: readonly [{
|
|
615
|
+
readonly name: "user";
|
|
616
|
+
readonly type: "address";
|
|
617
|
+
}, {
|
|
618
|
+
readonly name: "originChainId";
|
|
619
|
+
readonly type: "uint64";
|
|
620
|
+
}, {
|
|
621
|
+
readonly name: "inputToken";
|
|
622
|
+
readonly type: "address";
|
|
623
|
+
}, {
|
|
624
|
+
readonly name: "inputAmount";
|
|
625
|
+
readonly type: "uint256";
|
|
626
|
+
}, {
|
|
627
|
+
readonly name: "destination";
|
|
628
|
+
readonly type: "bytes32";
|
|
629
|
+
}, {
|
|
630
|
+
readonly name: "outputAsset";
|
|
631
|
+
readonly type: "bytes32";
|
|
632
|
+
}, {
|
|
633
|
+
readonly name: "minReceived";
|
|
634
|
+
readonly type: "uint256";
|
|
635
|
+
}, {
|
|
636
|
+
readonly name: "recipient";
|
|
637
|
+
readonly type: "bytes32";
|
|
638
|
+
}, {
|
|
639
|
+
readonly name: "createdAt";
|
|
640
|
+
readonly type: "uint64";
|
|
641
|
+
}, {
|
|
642
|
+
readonly name: "fillDeadline";
|
|
643
|
+
readonly type: "uint64";
|
|
644
|
+
}, {
|
|
645
|
+
readonly name: "feeBps";
|
|
646
|
+
readonly type: "uint16";
|
|
647
|
+
}, {
|
|
648
|
+
readonly name: "fillerId";
|
|
649
|
+
readonly type: "bytes32";
|
|
650
|
+
}];
|
|
651
|
+
readonly TokenPermissions: readonly [{
|
|
652
|
+
readonly name: "token";
|
|
653
|
+
readonly type: "address";
|
|
654
|
+
}, {
|
|
655
|
+
readonly name: "amount";
|
|
656
|
+
readonly type: "uint256";
|
|
657
|
+
}];
|
|
658
|
+
readonly PermitWitnessTransferFrom: readonly [{
|
|
659
|
+
readonly name: "permitted";
|
|
660
|
+
readonly type: "TokenPermissions";
|
|
661
|
+
}, {
|
|
662
|
+
readonly name: "spender";
|
|
663
|
+
readonly type: "address";
|
|
664
|
+
}, {
|
|
665
|
+
readonly name: "nonce";
|
|
666
|
+
readonly type: "uint256";
|
|
667
|
+
}, {
|
|
668
|
+
readonly name: "deadline";
|
|
669
|
+
readonly type: "uint256";
|
|
670
|
+
}, {
|
|
671
|
+
readonly name: "witness";
|
|
672
|
+
readonly type: "Order";
|
|
673
|
+
}];
|
|
674
|
+
};
|
|
675
|
+
/** The message of `PERMIT_WITNESS_TYPES`: `spender` is the source router, `permitted` the order's input token and amount. */
|
|
676
|
+
interface PermitWitness {
|
|
677
|
+
permitted: {
|
|
678
|
+
token: Hex | string;
|
|
679
|
+
amount: UintLike;
|
|
680
|
+
};
|
|
681
|
+
spender: Hex | string;
|
|
682
|
+
nonce: UintLike;
|
|
683
|
+
deadline: UintLike;
|
|
684
|
+
witness: Order;
|
|
685
|
+
}
|
|
686
|
+
/** The Permit2 domain: `{name: "Permit2", chainId, verifyingContract}` — no version. */
|
|
687
|
+
declare function permit2Domain(chainId: UintLike, permit2?: Hex | string): {
|
|
688
|
+
readonly name: "Permit2";
|
|
689
|
+
readonly chainId: UintLike;
|
|
690
|
+
readonly verifyingContract: string;
|
|
691
|
+
};
|
|
692
|
+
/** The digest the maker signs for `openFor`: `PermitWitnessTransferFrom` with the order as witness, in the Permit2 domain. */
|
|
693
|
+
declare function hashPermitWitness(permit: PermitWitness, chainId: UintLike, permit2?: Hex | string): Hex;
|
|
694
|
+
|
|
695
|
+
interface FeeSplit {
|
|
696
|
+
/** What the filler is paid. */
|
|
697
|
+
payout: bigint;
|
|
698
|
+
/** What Cancore keeps: `total − payout`. */
|
|
699
|
+
fee: bigint;
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* EVM source, `CancoreRouter.settle`: `payout = ⌊T × 10 000 / (10 000 + feeBps)⌋`, `fee = T − payout`.
|
|
703
|
+
* The rounding dust goes to the fee; a total below one net unit (`T × 10 000 < 10 000 + feeBps`)
|
|
704
|
+
* pays 0 and is all fee.
|
|
705
|
+
*/
|
|
706
|
+
declare function inclusiveFeeSplit(total: UintLike, feeBps: UintLike): FeeSplit;
|
|
707
|
+
/**
|
|
708
|
+
* Canton source, Daml `inclusiveFee amount feeRate = amount − amount / (1.0 + feeRate)` in EVM-form
|
|
709
|
+
* units: the same quotient rounded half to even (Daml `Numeric 10` division), so the payout is the
|
|
710
|
+
* EVM one or one unit more. A filler prices a Canton-source order on this, never on the EVM formula (T-12).
|
|
711
|
+
*/
|
|
712
|
+
declare function cantonInclusiveFeeSplit(total: UintLike, feeBps: UintLike): FeeSplit;
|
|
713
|
+
|
|
714
|
+
/** A Canton network, as in its CAIP-2 id `canton:<network>`. */
|
|
715
|
+
type CantonNetwork = keyof typeof CANTON_ORIGIN_ID;
|
|
716
|
+
/** `Order.destination` and `FillProof.destination` of a Canton network: `keccak256(utf8("canton:<network>"))`. */
|
|
717
|
+
declare function encodeCantonDestination(network: CantonNetwork): Hex;
|
|
718
|
+
/** The Canton network an order's `destination` names, or `undefined` when it is not a Canton destination. */
|
|
719
|
+
declare function cantonNetworkOfDestination(destination: string): CantonNetwork | undefined;
|
|
720
|
+
/**
|
|
721
|
+
* `Order.outputAsset` and `FillProof.outputAsset` of a Canton instrument:
|
|
722
|
+
* `keccak256(abi.encode("cancore:instrument:v1", admin, id))`, the full 32 bytes — the same hash a
|
|
723
|
+
* Canton-source `inputToken` label truncates to 20 bytes.
|
|
724
|
+
*/
|
|
725
|
+
declare function encodeCantonOutputAsset(instrument: {
|
|
726
|
+
admin: string;
|
|
727
|
+
id: string;
|
|
728
|
+
}): Hex;
|
|
729
|
+
/** `Order.recipient` and `FillProof.recipient` of a Canton party: `keccak256(utf8(partyId))` over the full party id. */
|
|
730
|
+
declare function encodeCantonRecipient(partyId: string): Hex;
|
|
731
|
+
/**
|
|
732
|
+
* `Order.minReceived` and `FillProof.amountDelivered` of a Canton amount: the Daml `Numeric 10`
|
|
733
|
+
* decimal × 10¹⁰. No rounding: an amount that is not exact at 10⁻¹⁰ is refused before anyone signs.
|
|
734
|
+
*/
|
|
735
|
+
declare function encodeCantonAmount(amount: string): bigint;
|
|
736
|
+
|
|
737
|
+
interface TypedField {
|
|
738
|
+
readonly name: string;
|
|
739
|
+
readonly type: string;
|
|
740
|
+
}
|
|
741
|
+
type TypedDataTypes = Readonly<Record<string, readonly TypedField[]>>;
|
|
742
|
+
type TypedValue = string | number | bigint | boolean;
|
|
743
|
+
interface TypedDataDomain {
|
|
744
|
+
name?: string;
|
|
745
|
+
version?: string;
|
|
746
|
+
chainId?: UintLike;
|
|
747
|
+
verifyingContract?: Hex | string;
|
|
748
|
+
salt?: Hex | string;
|
|
749
|
+
}
|
|
750
|
+
interface TypedDataInput {
|
|
751
|
+
domain: TypedDataDomain;
|
|
752
|
+
types: TypedDataTypes;
|
|
753
|
+
primaryType: string;
|
|
754
|
+
message: Readonly<Record<string, unknown>>;
|
|
755
|
+
}
|
|
756
|
+
/** A JSON value JCS can canonicalise: numbers are safe integers only. */
|
|
757
|
+
type JsonValue = string | number | boolean | null | readonly JsonValue[] | {
|
|
758
|
+
readonly [key: string]: JsonValue;
|
|
759
|
+
};
|
|
760
|
+
/** `Name(type1 name1,…)` of a flat struct. */
|
|
761
|
+
declare function encodeType(types: TypedDataTypes, primaryType: string): string;
|
|
762
|
+
declare function typeHash(types: TypedDataTypes, primaryType: string): Hex;
|
|
763
|
+
declare function hashStruct(types: TypedDataTypes, primaryType: string, message: Readonly<Record<string, unknown>>): Hex;
|
|
764
|
+
/** The domain separator; `EIP712Domain` lists exactly the members present, in the standard order. */
|
|
765
|
+
declare function hashDomain(domain: TypedDataDomain): Hex;
|
|
766
|
+
/** The EIP-712 digest `keccak256(0x1901 ‖ domainSeparator ‖ hashStruct(message))` — what a signature is over. */
|
|
767
|
+
declare function hashTypedData({ domain, types, primaryType, message }: TypedDataInput): Hex;
|
|
768
|
+
/**
|
|
769
|
+
* RFC 8785 canonical JSON. Keys sorted by UTF-16 code units (`Array#sort`),
|
|
770
|
+
* strings as `JSON.stringify` writes them. Numbers are safe integers only —
|
|
771
|
+
* the wire carries every wider value as a decimal string — so the ECMAScript
|
|
772
|
+
* number serialisation JCS borrows is never exercised beyond integers.
|
|
773
|
+
*/
|
|
774
|
+
declare function jcs(value: unknown): string;
|
|
775
|
+
/** `GatewayMessage.bodyHash`: keccak256 of the JCS text of an S→F message without its `sig`. */
|
|
776
|
+
declare function gatewayBodyHash(message: Readonly<Record<string, unknown>>): Hex;
|
|
777
|
+
/** `FillerMessage.bodyHash`: keccak256 of the JCS text of a filler message without its `msgSig`; `id`, `fillerId`, `sentAt` and any inner `sig` stay in. */
|
|
778
|
+
declare function fillerMessageBodyHash(message: object): Hex;
|
|
779
|
+
/** `FillerQuote.requestId`: keccak256(utf8(requestId)); the id is 1..64 printable ASCII (`Canonical.daml:90-93`). */
|
|
780
|
+
declare function requestIdHash(requestId: string): Hex;
|
|
781
|
+
|
|
782
|
+
/** `fillerId`: issued by Cancore at onboarding, ASCII so the draw's UTF-8 byte order is plain byte order (D-H). */
|
|
783
|
+
declare const FILLER_ID_PATTERN: RegExp;
|
|
784
|
+
/** The on-chain form of a filler id, `keccak256(utf8(fillerId))` — `FillTicket`, `Filled`, `FillProof`, `Settled`. */
|
|
785
|
+
declare function fillerIdHash(fillerId: string): Hex;
|
|
786
|
+
/**
|
|
787
|
+
* `repayTo` for an EVM source: the address left-padded with zeros to 32 bytes.
|
|
788
|
+
* Refuses the zero address, which `settle` refuses too (`ZeroAddress`).
|
|
789
|
+
*/
|
|
790
|
+
declare function repayToFromEvm(address: string): Hex;
|
|
791
|
+
/** `repayTo` for a Canton source: `keccak256(utf8(partyId))` of the filler's party registered under its `fillerId`. */
|
|
792
|
+
declare function repayToFromParty(partyId: string): Hex;
|
|
793
|
+
/** Whether `repayTo` is payable on an EVM source: zero top 12 bytes (`InvalidBytes32Address`) and not the zero address (`ZeroAddress`). */
|
|
794
|
+
declare function isEvmRepayTo(repayTo: string): boolean;
|
|
795
|
+
/** The address `settle` pays on an EVM source, `address(uint160(uint256(repayTo)))`; throws where the router reverts. */
|
|
796
|
+
declare function evmAddressFromRepayTo(repayTo: string): Hex;
|
|
797
|
+
/**
|
|
798
|
+
* Whether `sig` has the shape a message key (an EOA) produces and the protocol
|
|
799
|
+
* accepts: 65 bytes `r ‖ s ‖ v`, `v ∈ {27, 28}`, `0 < r < n`, low-s
|
|
800
|
+
* `0 < s ≤ n/2`. Anything else is refused before recovery — an EIP-1271
|
|
801
|
+
* smart-wallet signature among them: the message key is an EOA, verified by
|
|
802
|
+
* ecrecover only. Passing this check says nothing about WHO signed: recover
|
|
803
|
+
* the address and compare it with the registered key.
|
|
804
|
+
*/
|
|
805
|
+
declare function isEoaSignature(sig: unknown): sig is Hex;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* `FillProof` on the wire (§3.1), field for field the struct the source router
|
|
809
|
+
* hashes (`FILL_PROOF_TYPES`, the twelve variant A fields of protocol §3.3).
|
|
810
|
+
*/
|
|
811
|
+
interface FillProofJson {
|
|
812
|
+
kind: number;
|
|
813
|
+
orderHash: Hex;
|
|
814
|
+
destination: Hex;
|
|
815
|
+
fillRef: Hex;
|
|
816
|
+
recipient: Hex;
|
|
817
|
+
outputAsset: Hex;
|
|
818
|
+
amountDelivered: DecString;
|
|
819
|
+
filledAt: DecString;
|
|
820
|
+
/** `fillerIdHash(fillerId)` of the filler that delivered. */
|
|
821
|
+
fillerId: Hex;
|
|
822
|
+
/** The payee of `settle`, encoded for the source chain: the `repayTo` of the filler's ticket. */
|
|
823
|
+
repayTo: Hex;
|
|
824
|
+
attempt: number;
|
|
825
|
+
setId: number;
|
|
826
|
+
}
|
|
827
|
+
/** EVM source: 65-byte `r ‖ s ‖ v`; in payload order the `signature` values are the `sigs` of `settle`. */
|
|
828
|
+
interface AttestationEvm {
|
|
829
|
+
signer: Hex;
|
|
830
|
+
signature: Hex;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Canton source: a `SigEntry` of `SwapIntent_SettleWithProof` with `0x`
|
|
834
|
+
* (strip it for Daml) — the 88-byte DER SubjectPublicKeyInfo of the signer's
|
|
835
|
+
* uncompressed key and a minimal DER signature — plus the address Daml derives
|
|
836
|
+
* from the key.
|
|
837
|
+
*/
|
|
838
|
+
interface AttestationCanton {
|
|
839
|
+
signer: Hex;
|
|
840
|
+
pubKey: Hex;
|
|
841
|
+
signature: Hex;
|
|
842
|
+
}
|
|
843
|
+
interface SettleAttestations extends S2FBase {
|
|
844
|
+
type: 'settle.attestations';
|
|
845
|
+
fillerId: string;
|
|
846
|
+
orderHash: Hex;
|
|
847
|
+
/** Equals `proof.attempt`. */
|
|
848
|
+
attempt: number;
|
|
849
|
+
/** CAIP-2 of the chain `settle` is submitted on: `eip155:<id>` or `canton:<network>`. */
|
|
850
|
+
sourceChainId: string;
|
|
851
|
+
proof: FillProofJson;
|
|
852
|
+
/** At least `threshold`, strictly ascending by `signer`. */
|
|
853
|
+
signatures: AttestationEvm[] | AttestationCanton[];
|
|
854
|
+
/** Equals `proof.setId`; EVM: `attestationSetFor(orderHash)`. */
|
|
855
|
+
setId: number;
|
|
856
|
+
threshold: number;
|
|
857
|
+
/** Unix seconds: `settle` must be included before it. */
|
|
858
|
+
refundAfter: DecString;
|
|
859
|
+
}
|
|
860
|
+
/** What `settle.attestations` carries apart from its envelope: identical on WebSocket and REST. */
|
|
861
|
+
type SettleAttestationsPayload = Omit<SettleAttestations, 'type' | 'id' | 'fillerId' | 'sentAt' | 'sig' | 're'>;
|
|
862
|
+
/** The payload of a `settle.attestations` frame or REST body: everything but `type`, `id`, `fillerId`, `sentAt`, `sig`, `re`. */
|
|
863
|
+
declare function settleAttestationsPayload(frame: object): SettleAttestationsPayload;
|
|
864
|
+
/**
|
|
865
|
+
* `keccak256(utf8(JCS(payload)))`: equal for the pushed frame and the pulled
|
|
866
|
+
* body of the same delivery, whatever their `id`, `sentAt` and `sig`.
|
|
867
|
+
*/
|
|
868
|
+
declare function settleAttestationsPayloadHash(frame: object): Hex;
|
|
869
|
+
/** Whether `settle` for this payload goes to Daml (`SwapIntent_SettleWithProof`) rather than an EVM router. */
|
|
870
|
+
declare const isCantonSource: (sourceChainId: string) => boolean;
|
|
871
|
+
/**
|
|
872
|
+
* The rules of a schema-valid `settle.attestations` that JSON Schema cannot
|
|
873
|
+
* state: `attempt`, `setId` and `orderHash` equal the proof's, at least
|
|
874
|
+
* `threshold` signatures, signers strictly ascending (no duplicates).
|
|
875
|
+
* Returns one message per broken rule, empty when none is.
|
|
876
|
+
*/
|
|
877
|
+
declare function settleAttestationsErrors(payload: SettleAttestationsPayload): string[];
|
|
878
|
+
/** EVM source: the `sigs` argument of `CancoreRouter.settle(order, proof, sigs)`, in payload order. */
|
|
879
|
+
declare function settleSigs(payload: SettleAttestationsPayload): Hex[];
|
|
880
|
+
/** Canton source: the `bundle : [SigEntry]` of `SwapIntent_SettleWithProof` — lowercase hex without `0x`, in payload order. */
|
|
881
|
+
declare function cantonSigEntries(payload: SettleAttestationsPayload): {
|
|
882
|
+
pubKey: string;
|
|
883
|
+
sig: string;
|
|
884
|
+
}[];
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* The wire shapes of filler protocol v1 — WebSocket frames on `/v1`, REST
|
|
888
|
+
* bodies and the public draw/epoch records — as TypeScript. The JSON Schemas
|
|
889
|
+
* under `spec/protocol/` are normative; schemas.test.ts holds the enums below
|
|
890
|
+
* to them. Encoding (protocol §3.1): uint64 and wider as decimal strings,
|
|
891
|
+
* uint8/16/32 as JSON integers, on-chain times in seconds (decimal string),
|
|
892
|
+
* gateway times in milliseconds (JSON integer), hex lowercase.
|
|
893
|
+
*
|
|
894
|
+
* Every frame in both directions is signed by its sender (protocol §3.4):
|
|
895
|
+
* `sig` (gateway key, `GatewayMessage`) on S→F, `msgSig` (the filler's message
|
|
896
|
+
* key, `FillerMessage`) on F→S, and carries `id`, `fillerId` and `sentAt`.
|
|
897
|
+
*
|
|
898
|
+
* Receivers ignore unknown fields and unknown S→F types (V-2), so none of
|
|
899
|
+
* these types is closed. The enum types list the known values; the schemas
|
|
900
|
+
* accept any UPPER_SNAKE value besides them, and a receiver treats an unknown
|
|
901
|
+
* one as OTHER/generic (V-2).
|
|
902
|
+
*/
|
|
903
|
+
|
|
904
|
+
/** Unsigned decimal string: uint64 and wider. */
|
|
905
|
+
type DecString = string;
|
|
906
|
+
/** Unix milliseconds, gateway clock. */
|
|
907
|
+
type TimeMs = number;
|
|
908
|
+
/** EVM token address, or a Canton instrument. */
|
|
909
|
+
type WireAsset = Hex | {
|
|
910
|
+
admin: string;
|
|
911
|
+
id: string;
|
|
912
|
+
};
|
|
913
|
+
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"];
|
|
914
|
+
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"];
|
|
915
|
+
/** HTTP status of each error code on the REST fallback. */
|
|
916
|
+
declare const ERROR_HTTP_STATUS: Readonly<Record<ErrorCode, number>>;
|
|
917
|
+
/** `error.reason` with `TICKET_REFUSED`: the pre-ticket check that failed (S-21). */
|
|
918
|
+
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"];
|
|
919
|
+
declare const EXPIRED_RESULTS: readonly ["FILLED", "NO_SHOW", "NO_SHOW_UNCONFIRMED", "EXEMPT"];
|
|
920
|
+
declare const EXEMPT_REASONS: readonly ["DESTINATION_HALTED", "GATEWAY_FAULT", "REORGED_AFTER_INCLUSION", "RECIPIENT_NOT_READY", "OTHER"];
|
|
921
|
+
/** Verdict at receipt time, on the `quote.ack`. */
|
|
922
|
+
declare const QUOTE_ACK_STATUSES: readonly ["COUNTED", "LATE", "SHORT_TTL"];
|
|
923
|
+
/** Final status of a quote, `GET /v1/filler/quotes`. */
|
|
924
|
+
declare const QUOTE_FINAL_STATUSES: readonly ["COUNTED", "LATE", "SHORT_TTL", "REPLACED", "BAD_SIG", "OUTLIER", "IN_BAND", "OUT_OF_BAND", "WON", "LOST"];
|
|
925
|
+
declare const PENALTY_STEPS: readonly ["L1", "L2", "L3", "L4"];
|
|
926
|
+
declare const DRAW_CLOSED_BY: readonly ["OFFER_TIMEOUT", "OFFER_DECLINE", "TICKET_DECLINE", "TICKET_EXPIRED", "FILLED"];
|
|
927
|
+
declare const TICKET_LIST_STATUSES: readonly ["OFFERED", "ISSUED"];
|
|
928
|
+
type DeclineReason = (typeof DECLINE_REASONS)[number];
|
|
929
|
+
type ErrorCode = (typeof ERROR_CODES)[number];
|
|
930
|
+
type TicketRefusedReason = (typeof TICKET_REFUSED_REASONS)[number];
|
|
931
|
+
type ExpiredResult = (typeof EXPIRED_RESULTS)[number];
|
|
932
|
+
type ExemptReason = (typeof EXEMPT_REASONS)[number];
|
|
933
|
+
type QuoteAckStatus = (typeof QUOTE_ACK_STATUSES)[number];
|
|
934
|
+
type QuoteFinalStatus = (typeof QUOTE_FINAL_STATUSES)[number];
|
|
935
|
+
type PenaltyStep = (typeof PENALTY_STEPS)[number];
|
|
936
|
+
type DrawClosedBy = (typeof DRAW_CLOSED_BY)[number];
|
|
937
|
+
/** `ICancoreRouter.Order` on the wire: every numeric field a decimal string, as `canton-order.json`. */
|
|
938
|
+
interface OrderJson {
|
|
939
|
+
user: Hex;
|
|
940
|
+
originChainId: DecString;
|
|
941
|
+
inputToken: Hex;
|
|
942
|
+
inputAmount: DecString;
|
|
943
|
+
destination: Hex;
|
|
944
|
+
outputAsset: Hex;
|
|
945
|
+
minReceived: DecString;
|
|
946
|
+
recipient: Hex;
|
|
947
|
+
createdAt: DecString;
|
|
948
|
+
fillDeadline: DecString;
|
|
949
|
+
feeBps: DecString;
|
|
950
|
+
fillerId: Hex;
|
|
951
|
+
}
|
|
952
|
+
/** Every S→F frame: signed by the gateway (`GatewayMessage`), addressed (`fillerId`) and timed (`sentAt`). */
|
|
953
|
+
interface S2FBase {
|
|
954
|
+
type: string;
|
|
955
|
+
id: string;
|
|
956
|
+
/** The addressee. Absent only on an `error` that refuses a login (`POST /v1/filler/auth`). */
|
|
957
|
+
fillerId?: string;
|
|
958
|
+
sentAt: TimeMs;
|
|
959
|
+
sig: Hex;
|
|
960
|
+
/** The F→S `id` this frame answers. */
|
|
961
|
+
re?: string;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* What every filler → filler-gateway message and REST request body carries (S-19, T-13): `id` unique per
|
|
965
|
+
* `fillerId` and direction, ≤ 64 characters; the sender's `fillerId`; `sentAt`; `msgSig` by the message key over
|
|
966
|
+
* `FillerMessage{bodyHash: fillerMessageBodyHash(message)}`.
|
|
967
|
+
*/
|
|
968
|
+
interface F2SEnvelope {
|
|
969
|
+
id: string;
|
|
970
|
+
fillerId: string;
|
|
971
|
+
sentAt: TimeMs;
|
|
972
|
+
msgSig: Hex;
|
|
973
|
+
/** The S→F `id` this message answers. */
|
|
974
|
+
re?: string;
|
|
975
|
+
}
|
|
976
|
+
interface F2SBase extends F2SEnvelope {
|
|
977
|
+
type: string;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* The login challenge: the body of `GET /v1/filler/auth/challenge?fillerId=`, addressed to that
|
|
981
|
+
* `fillerId`. REST only — never on the WebSocket.
|
|
982
|
+
*/
|
|
983
|
+
interface AuthChallenge extends S2FBase {
|
|
984
|
+
type: 'auth.challenge';
|
|
985
|
+
fillerId: string;
|
|
986
|
+
nonce: Hex;
|
|
987
|
+
expiresAt: DecString;
|
|
988
|
+
}
|
|
989
|
+
/** The body of `POST /v1/filler/auth` (→ `AuthToken`). REST only — never on the WebSocket. */
|
|
990
|
+
interface AuthResponse extends F2SBase {
|
|
991
|
+
type: 'auth.response';
|
|
992
|
+
fillerId: string;
|
|
993
|
+
keyAddress: Hex;
|
|
994
|
+
protocolVersion: '1';
|
|
995
|
+
/** The `auth.challenge` nonce this answers (optional; senders should send it), so the login finds its challenge directly. */
|
|
996
|
+
nonce?: Hex;
|
|
997
|
+
sig: Hex;
|
|
998
|
+
}
|
|
999
|
+
interface AuthOk extends S2FBase {
|
|
1000
|
+
type: 'auth.ok';
|
|
1001
|
+
fillerId: string;
|
|
1002
|
+
heartbeatIntervalMs: number;
|
|
1003
|
+
}
|
|
1004
|
+
/** Heartbeat from the filler: signed with `msgSig`, like every F→S frame. */
|
|
1005
|
+
interface PingF2S extends F2SBase {
|
|
1006
|
+
type: 'ping';
|
|
1007
|
+
}
|
|
1008
|
+
interface PongF2S extends F2SBase {
|
|
1009
|
+
type: 'pong';
|
|
1010
|
+
re: string;
|
|
1011
|
+
}
|
|
1012
|
+
/** Heartbeat from the gateway: signed, addressed and timed, like every S→F frame (D-C). */
|
|
1013
|
+
interface PingS2F extends S2FBase {
|
|
1014
|
+
type: 'ping';
|
|
1015
|
+
fillerId: string;
|
|
1016
|
+
}
|
|
1017
|
+
interface PongS2F extends S2FBase {
|
|
1018
|
+
type: 'pong';
|
|
1019
|
+
fillerId: string;
|
|
1020
|
+
re: string;
|
|
1021
|
+
}
|
|
1022
|
+
type Ping = PingF2S | PingS2F;
|
|
1023
|
+
type Pong = PongF2S | PongS2F;
|
|
1024
|
+
interface ErrorMessage extends S2FBase {
|
|
1025
|
+
type: 'error';
|
|
1026
|
+
code: ErrorCode;
|
|
1027
|
+
message: string;
|
|
1028
|
+
reason?: TicketRefusedReason;
|
|
1029
|
+
/** With `RATE_LIMITED`: ms (≥ 1) until the refused rate class may be used again, or until the cooldown ends. */
|
|
1030
|
+
retryAfterMs?: number;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* An unsigned, unaddressed refusal, so a filler cannot verify it; a hint only. Every 429 (`RATE_LIMITED`,
|
|
1034
|
+
* on every route), and the refusals of the login routes decided before any signature check:
|
|
1035
|
+
* 400 `BAD_REQUEST`, 404 `UNKNOWN_REQUEST`, and on `POST /v1/filler/auth` 401 `UNAUTHENTICATED`
|
|
1036
|
+
* (no live challenge for the fillerId: ask for a new one).
|
|
1037
|
+
*/
|
|
1038
|
+
interface UnsignedErrorBody {
|
|
1039
|
+
type: 'error';
|
|
1040
|
+
code: ErrorCode;
|
|
1041
|
+
message: string;
|
|
1042
|
+
retryAfterMs?: number;
|
|
1043
|
+
}
|
|
1044
|
+
/** The filler's reply to a gateway frame it cannot handle; informational. */
|
|
1045
|
+
interface ErrorF2S extends F2SBase {
|
|
1046
|
+
type: 'error';
|
|
1047
|
+
re: string;
|
|
1048
|
+
code: ErrorCode;
|
|
1049
|
+
message: string;
|
|
1050
|
+
}
|
|
1051
|
+
interface EpochWeights extends S2FBase {
|
|
1052
|
+
type: 'epoch.weights';
|
|
1053
|
+
epochId: DecString;
|
|
1054
|
+
startsAt: DecString;
|
|
1055
|
+
endsAt: DecString;
|
|
1056
|
+
weightsRoot: Hex;
|
|
1057
|
+
}
|
|
1058
|
+
interface QuoteRequest extends S2FBase {
|
|
1059
|
+
type: 'quote.request';
|
|
1060
|
+
requestId: string;
|
|
1061
|
+
route: {
|
|
1062
|
+
src: string;
|
|
1063
|
+
dst: string;
|
|
1064
|
+
};
|
|
1065
|
+
inputToken: WireAsset;
|
|
1066
|
+
/** The total T the maker deposits, input base units. */
|
|
1067
|
+
inputAmount: DecString;
|
|
1068
|
+
outputAsset: WireAsset;
|
|
1069
|
+
feeBps: number;
|
|
1070
|
+
fillDeadlineHint: DecString;
|
|
1071
|
+
windowCloseAt: TimeMs;
|
|
1072
|
+
quoteTtlMs: number;
|
|
1073
|
+
imbalanceHint?: {
|
|
1074
|
+
dstAsset: WireAsset;
|
|
1075
|
+
netFlow24hUsd: string;
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
/** `sig` = `FillerQuote{requestIdHash(requestId), fillerId, amountOut, validUntil, nonce}` by the message key. */
|
|
1079
|
+
interface QuoteMessage extends F2SBase {
|
|
1080
|
+
type: 'quote';
|
|
1081
|
+
requestId: string;
|
|
1082
|
+
amountOut: DecString;
|
|
1083
|
+
validUntil: DecString;
|
|
1084
|
+
nonce: DecString;
|
|
1085
|
+
sig: Hex;
|
|
1086
|
+
}
|
|
1087
|
+
interface QuoteAck extends S2FBase {
|
|
1088
|
+
type: 'quote.ack';
|
|
1089
|
+
requestId: string;
|
|
1090
|
+
quoteHash: Hex;
|
|
1091
|
+
receivedAt: TimeMs;
|
|
1092
|
+
status: QuoteAckStatus;
|
|
1093
|
+
}
|
|
1094
|
+
interface QuoteReconfirm extends S2FBase {
|
|
1095
|
+
type: 'quote.reconfirm';
|
|
1096
|
+
orderHash: Hex;
|
|
1097
|
+
requestId: string;
|
|
1098
|
+
order: OrderJson;
|
|
1099
|
+
amountOut: DecString;
|
|
1100
|
+
ticketTtl: number;
|
|
1101
|
+
replyBy: TimeMs;
|
|
1102
|
+
}
|
|
1103
|
+
interface QuoteReconfirmReply extends F2SBase {
|
|
1104
|
+
type: 'quote.reconfirm.reply';
|
|
1105
|
+
orderHash: Hex;
|
|
1106
|
+
accept: boolean;
|
|
1107
|
+
validUntil?: DecString;
|
|
1108
|
+
nonce?: DecString;
|
|
1109
|
+
sig?: Hex;
|
|
1110
|
+
}
|
|
1111
|
+
interface TicketOffer extends S2FBase {
|
|
1112
|
+
type: 'ticket.offer';
|
|
1113
|
+
orderHash: Hex;
|
|
1114
|
+
attempt: number;
|
|
1115
|
+
order: OrderJson;
|
|
1116
|
+
amountOut: DecString;
|
|
1117
|
+
validFrom: DecString;
|
|
1118
|
+
validUntil: DecString;
|
|
1119
|
+
acceptBy: TimeMs;
|
|
1120
|
+
}
|
|
1121
|
+
/** `sig` = `TicketIntent{orderHash, attempt, validFrom, validUntil, fillerId, deliveryKey, repayTo}` by the message key. */
|
|
1122
|
+
interface TicketIntentMessage extends F2SBase {
|
|
1123
|
+
type: 'ticket.intent';
|
|
1124
|
+
orderHash: Hex;
|
|
1125
|
+
attempt: number;
|
|
1126
|
+
validFrom: DecString;
|
|
1127
|
+
validUntil: DecString;
|
|
1128
|
+
/** The address that will send `fill`; the zero address for a Canton destination. */
|
|
1129
|
+
deliveryKey: Hex;
|
|
1130
|
+
/** Where `settle` pays, encoded for the source chain. */
|
|
1131
|
+
repayTo: Hex;
|
|
1132
|
+
sig: Hex;
|
|
1133
|
+
}
|
|
1134
|
+
interface TicketDecline extends F2SBase {
|
|
1135
|
+
type: 'ticket.decline';
|
|
1136
|
+
orderHash: Hex;
|
|
1137
|
+
attempt: number;
|
|
1138
|
+
reason: DeclineReason;
|
|
1139
|
+
detail?: string;
|
|
1140
|
+
}
|
|
1141
|
+
interface TicketIntentAck extends S2FBase {
|
|
1142
|
+
type: 'ticket.intent.ack';
|
|
1143
|
+
orderHash: Hex;
|
|
1144
|
+
attempt: number;
|
|
1145
|
+
intentHash: Hex;
|
|
1146
|
+
receivedAt: TimeMs;
|
|
1147
|
+
}
|
|
1148
|
+
/** `FillTicket` on the wire; `fillerId` is the on-chain form, `fillerIdHash(fillerId)`. */
|
|
1149
|
+
interface TicketJson {
|
|
1150
|
+
orderHash: Hex;
|
|
1151
|
+
fillerId: Hex;
|
|
1152
|
+
deliveryKey: Hex;
|
|
1153
|
+
repayTo: Hex;
|
|
1154
|
+
attempt: number;
|
|
1155
|
+
validFrom: DecString;
|
|
1156
|
+
validUntil: DecString;
|
|
1157
|
+
}
|
|
1158
|
+
interface TicketIssuedEvm extends S2FBase {
|
|
1159
|
+
type: 'ticket.issued';
|
|
1160
|
+
form: 'evm';
|
|
1161
|
+
orderHash: Hex;
|
|
1162
|
+
attempt: number;
|
|
1163
|
+
ticket: TicketJson;
|
|
1164
|
+
ticketSig: Hex;
|
|
1165
|
+
}
|
|
1166
|
+
interface TicketIssuedCanton extends S2FBase {
|
|
1167
|
+
type: 'ticket.issued';
|
|
1168
|
+
form: 'canton';
|
|
1169
|
+
orderHash: Hex;
|
|
1170
|
+
attempt: number;
|
|
1171
|
+
deliveryOrderCid: string;
|
|
1172
|
+
validUntil: DecString;
|
|
1173
|
+
repayTo: Hex;
|
|
1174
|
+
}
|
|
1175
|
+
type TicketIssued = TicketIssuedEvm | TicketIssuedCanton;
|
|
1176
|
+
/** EVM-form receipt (`form` absent or `"evm"`): `sig` = `TicketReceipt{ticketHash, ticketSigHash}` by the message key. */
|
|
1177
|
+
interface TicketReceiptEvm extends F2SBase {
|
|
1178
|
+
type: 'ticket.receipt';
|
|
1179
|
+
form?: 'evm';
|
|
1180
|
+
orderHash: Hex;
|
|
1181
|
+
attempt: number;
|
|
1182
|
+
ticketHash: Hex;
|
|
1183
|
+
ticketSigHash: Hex;
|
|
1184
|
+
sig: Hex;
|
|
1185
|
+
}
|
|
1186
|
+
/** Canton-form receipt: `sig` = `CantonTicketReceipt` (`cantonTicketReceipt(frame)`) by the message key; fields as in `ticket.issued`. */
|
|
1187
|
+
interface TicketReceiptCanton extends F2SBase {
|
|
1188
|
+
type: 'ticket.receipt';
|
|
1189
|
+
form: 'canton';
|
|
1190
|
+
orderHash: Hex;
|
|
1191
|
+
attempt: number;
|
|
1192
|
+
deliveryOrderCid: string;
|
|
1193
|
+
validUntil: DecString;
|
|
1194
|
+
sig: Hex;
|
|
1195
|
+
}
|
|
1196
|
+
type TicketReceiptMessage = TicketReceiptEvm | TicketReceiptCanton;
|
|
1197
|
+
interface FillReported extends F2SBase {
|
|
1198
|
+
type: 'fill.reported';
|
|
1199
|
+
orderHash: Hex;
|
|
1200
|
+
attempt: number;
|
|
1201
|
+
txRef: string;
|
|
1202
|
+
}
|
|
1203
|
+
interface TicketExpired extends S2FBase {
|
|
1204
|
+
type: 'ticket.expired';
|
|
1205
|
+
orderHash: Hex;
|
|
1206
|
+
attempt: number;
|
|
1207
|
+
result: ExpiredResult;
|
|
1208
|
+
exemptReason?: ExemptReason;
|
|
1209
|
+
}
|
|
1210
|
+
interface OrderSettled extends S2FBase {
|
|
1211
|
+
type: 'order.settled';
|
|
1212
|
+
orderHash: Hex;
|
|
1213
|
+
payout: DecString;
|
|
1214
|
+
fee: DecString;
|
|
1215
|
+
penaltyWithheld: DecString;
|
|
1216
|
+
txRef: string;
|
|
1217
|
+
}
|
|
1218
|
+
interface PenaltyApplied extends S2FBase {
|
|
1219
|
+
type: 'penalty.applied';
|
|
1220
|
+
violationId: string;
|
|
1221
|
+
code: string;
|
|
1222
|
+
step: PenaltyStep;
|
|
1223
|
+
details: Record<string, unknown>;
|
|
1224
|
+
}
|
|
1225
|
+
type S2FMessage = AuthChallenge | AuthOk | PingS2F | PongS2F | ErrorMessage | EpochWeights | QuoteRequest | QuoteAck | QuoteReconfirm | TicketOffer | TicketIntentAck | TicketIssued | TicketExpired | OrderSettled | PenaltyApplied | SettleAttestations;
|
|
1226
|
+
type F2SMessage = AuthResponse | PingF2S | PongF2S | ErrorF2S | QuoteMessage | QuoteReconfirmReply | TicketIntentMessage | TicketDecline | TicketReceiptMessage | FillReported;
|
|
1227
|
+
/** `POST /v1/filler/auth`: the bearer token of REST and of the WebSocket upgrade, bound to (fillerId, message key). */
|
|
1228
|
+
interface AuthToken {
|
|
1229
|
+
token: string;
|
|
1230
|
+
expiresAt: TimeMs;
|
|
1231
|
+
}
|
|
1232
|
+
/** `GET /v1/filler/auth/challenge` query. */
|
|
1233
|
+
interface ChallengeQuery {
|
|
1234
|
+
fillerId: string;
|
|
1235
|
+
}
|
|
1236
|
+
interface Page<T> {
|
|
1237
|
+
items: T[];
|
|
1238
|
+
nextCursor: string | null;
|
|
1239
|
+
}
|
|
1240
|
+
type TicketList = Page<TicketOffer | TicketIssued>;
|
|
1241
|
+
interface QuoteRecord {
|
|
1242
|
+
quote: QuoteMessage;
|
|
1243
|
+
ack: QuoteAck;
|
|
1244
|
+
status: QuoteFinalStatus;
|
|
1245
|
+
}
|
|
1246
|
+
type QuoteList = Page<QuoteRecord>;
|
|
1247
|
+
/** `GET /v1/filler/attestations/{orderHash}`: the `settle.attestations` frame itself, freshly signed. */
|
|
1248
|
+
type AttestationsResponse = SettleAttestations;
|
|
1249
|
+
interface StakeBindingRequest extends F2SEnvelope {
|
|
1250
|
+
partnerId: string;
|
|
1251
|
+
stakingAddress: Hex;
|
|
1252
|
+
chainId: DecString;
|
|
1253
|
+
nonce: DecString;
|
|
1254
|
+
sig: Hex;
|
|
1255
|
+
}
|
|
1256
|
+
interface FillerStats {
|
|
1257
|
+
won: number;
|
|
1258
|
+
delivered: number;
|
|
1259
|
+
noShow: number;
|
|
1260
|
+
reliability: number;
|
|
1261
|
+
capacityUsd: string;
|
|
1262
|
+
inFlightUsd: string;
|
|
1263
|
+
}
|
|
1264
|
+
interface PenaltyRecord {
|
|
1265
|
+
violationId: string;
|
|
1266
|
+
code: string;
|
|
1267
|
+
step: PenaltyStep;
|
|
1268
|
+
orderHash?: Hex;
|
|
1269
|
+
attempt?: number;
|
|
1270
|
+
at: TimeMs;
|
|
1271
|
+
details: Record<string, unknown>;
|
|
1272
|
+
}
|
|
1273
|
+
type PenaltyList = Page<PenaltyRecord>;
|
|
1274
|
+
interface DrawAttempt {
|
|
1275
|
+
attempt: number;
|
|
1276
|
+
tBase: DecString;
|
|
1277
|
+
closedBy: DrawClosedBy | null;
|
|
1278
|
+
drandRound: DecString;
|
|
1279
|
+
drandRandomness: Hex;
|
|
1280
|
+
drandSignature: Hex;
|
|
1281
|
+
candidates: {
|
|
1282
|
+
fillerId: string;
|
|
1283
|
+
weight: DecString;
|
|
1284
|
+
}[];
|
|
1285
|
+
r: DecString;
|
|
1286
|
+
winnerFillerId: string;
|
|
1287
|
+
fallbackReason: 'DRAW_FALLBACK' | null;
|
|
1288
|
+
}
|
|
1289
|
+
interface DrawRecord {
|
|
1290
|
+
orderHash: Hex;
|
|
1291
|
+
source: string;
|
|
1292
|
+
openRef: string;
|
|
1293
|
+
t0: DecString;
|
|
1294
|
+
epochId: DecString;
|
|
1295
|
+
deltaDrand: number;
|
|
1296
|
+
attempts: DrawAttempt[];
|
|
1297
|
+
sig: Hex;
|
|
1298
|
+
}
|
|
1299
|
+
interface EpochLeaf {
|
|
1300
|
+
fillerId: string;
|
|
1301
|
+
base: DecString;
|
|
1302
|
+
tier: number;
|
|
1303
|
+
reliabilityBps: number;
|
|
1304
|
+
}
|
|
1305
|
+
interface EpochRecord {
|
|
1306
|
+
epochId: DecString;
|
|
1307
|
+
startsAt: DecString;
|
|
1308
|
+
endsAt: DecString;
|
|
1309
|
+
weightsRoot: Hex;
|
|
1310
|
+
leaves: EpochLeaf[];
|
|
1311
|
+
stakeSteps: {
|
|
1312
|
+
tier: number;
|
|
1313
|
+
minStake: DecString;
|
|
1314
|
+
step: DecString;
|
|
1315
|
+
}[];
|
|
1316
|
+
rMinBps: number;
|
|
1317
|
+
snapshotBlocks: Record<string, DecString>;
|
|
1318
|
+
sig: Hex;
|
|
1319
|
+
}
|
|
1320
|
+
/** `GET /v1/gateway`: the mirror of `FILLER_GATEWAYS` for one environment. */
|
|
1321
|
+
interface GatewayInfo {
|
|
1322
|
+
env: string;
|
|
1323
|
+
gateway: Hex;
|
|
1324
|
+
ticketSigners: Hex[];
|
|
1325
|
+
protocolVersion: '1';
|
|
1326
|
+
maxMessageAgeMs: number;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* `FillerKeyRegistration` with its signature by the key being registered (§3.16): handed to Cancore at
|
|
1330
|
+
* onboarding and, signed by the NEW key, at a manual key change by staff. Not a frame — no message changes a key.
|
|
1331
|
+
*/
|
|
1332
|
+
interface SignedFillerKeyRegistration {
|
|
1333
|
+
fillerId: string;
|
|
1334
|
+
messageKey: Hex;
|
|
1335
|
+
issuedAt: DecString;
|
|
1336
|
+
sig: Hex;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/** `hashTicket` of the router: the `FillTicket` digest in the ticket domain, the same on every chain. */
|
|
1340
|
+
declare const hashFillTicket: (ticket: FillTicket) => Hex;
|
|
1341
|
+
/** The `FillerQuote` digest; `quote.requestId` is already `requestIdHash(requestId)`. */
|
|
1342
|
+
declare const hashFillerQuote: (quote: FillerQuote) => Hex;
|
|
1343
|
+
/** The `TicketIntent` digest — the inner `sig` of `ticket.intent`. */
|
|
1344
|
+
declare const hashTicketIntent: (intent: TicketIntent) => Hex;
|
|
1345
|
+
/** What `msgSig` of a filler → filler-gateway message is over: `FillerMessage{bodyHash}` of the message without `msgSig`. */
|
|
1346
|
+
declare const hashFillerMessage: (message: object) => Hex;
|
|
1347
|
+
/** The `FillerKeyRegistration` digest; the registered key signs it, and it must recover to `messageKey`. */
|
|
1348
|
+
declare const hashFillerKeyRegistration: (registration: FillerKeyRegistration) => Hex;
|
|
1349
|
+
/** `keccak256(utf8(deliveryOrderCid))` over the contract id exactly as `ticket.issued` sent it: no trimming, no case change. */
|
|
1350
|
+
declare function deliveryOrderCidHash(deliveryOrderCid: string): Hex;
|
|
1351
|
+
/**
|
|
1352
|
+
* The `CantonTicketReceipt` of a Canton-form ticket, from the fields that name it — the filler reads them from
|
|
1353
|
+
* `ticket.issued`, filler-gateway from the `ticket.receipt` it verifies; both get the same struct. Any other field of
|
|
1354
|
+
* the frame (`fillerId`, `repayTo`) is not part of the receipt and is ignored.
|
|
1355
|
+
*/
|
|
1356
|
+
declare function cantonTicketReceipt(ticket: Pick<TicketIssuedCanton, 'orderHash' | 'attempt' | 'deliveryOrderCid' | 'validUntil'>): CantonTicketReceipt;
|
|
1357
|
+
/** The `CantonTicketReceipt` digest — the inner `sig` of a Canton-form `ticket.receipt`. */
|
|
1358
|
+
declare const hashCantonTicketReceipt: (receipt: CantonTicketReceipt) => Hex;
|
|
1359
|
+
|
|
1360
|
+
interface FillerEnvelopeContext {
|
|
1361
|
+
/** The `fillerId` the session (or bearer token) is authenticated for. */
|
|
1362
|
+
fillerId: string;
|
|
1363
|
+
/** Arrival time, unix ms, the receiver's clock. */
|
|
1364
|
+
receivedAt: number;
|
|
1365
|
+
/** `GET /v1/gateway` `maxMessageAgeMs`. */
|
|
1366
|
+
maxMessageAgeMs: number;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* The error code the gateway answers for the first envelope check `message`
|
|
1370
|
+
* fails, in the order of §3.4, or `null` when every key-free check passes:
|
|
1371
|
+
* `BAD_SIGNATURE` — `msgSig` missing or not a 65-byte low-s EOA signature;
|
|
1372
|
+
* `UNAUTHENTICATED` — `fillerId` is not the session's; `BAD_REQUEST` — `sentAt`
|
|
1373
|
+
* not unix milliseconds, or no valid `id`; `STALE_MESSAGE` — `sentAt` further
|
|
1374
|
+
* than `maxMessageAgeMs` from `receivedAt`.
|
|
1375
|
+
*/
|
|
1376
|
+
declare function fillerEnvelopeError(message: object, ctx: FillerEnvelopeContext): ErrorCode | null;
|
|
1377
|
+
/**
|
|
1378
|
+
* Until when (unix ms, receiver clock) the receiver must remember an accepted
|
|
1379
|
+
* message `id` to refuse its replay: `max(receivedAt, sentAt) + maxMessageAgeMs`.
|
|
1380
|
+
* Freshness is symmetric (`|receivedAt − sentAt| ≤ maxMessageAgeMs`), so a
|
|
1381
|
+
* message whose `sentAt` runs ahead of the receiver's clock stays fresh until
|
|
1382
|
+
* `sentAt + maxMessageAgeMs` — later than `receivedAt + maxMessageAgeMs`.
|
|
1383
|
+
* Forgetting the id earlier would let the byte-identical message in again;
|
|
1384
|
+
* after this time a replay fails the freshness check by itself.
|
|
1385
|
+
*/
|
|
1386
|
+
declare function messageIdRetainUntil(sentAt: number, receivedAt: number, maxMessageAgeMs: number): number;
|
|
1387
|
+
|
|
1388
|
+
interface DrawCandidate {
|
|
1389
|
+
fillerId: string;
|
|
1390
|
+
/** Decimal string on the wire; the integer weight of auction-and-draw A-11. */
|
|
1391
|
+
weight: string | bigint;
|
|
1392
|
+
}
|
|
1393
|
+
interface DrawOutcome {
|
|
1394
|
+
r: bigint;
|
|
1395
|
+
winnerFillerId: string;
|
|
1396
|
+
}
|
|
1397
|
+
/** drand quicknet, the randomness beacon of the draw (auction-and-draw §4). */
|
|
1398
|
+
declare const DRAND_QUICKNET: {
|
|
1399
|
+
readonly chainHash: "52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971";
|
|
1400
|
+
readonly publicKey: "83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a";
|
|
1401
|
+
readonly scheme: "bls-unchained-g1-rfc9380";
|
|
1402
|
+
readonly genesisTime: 1692803367;
|
|
1403
|
+
readonly period: 3;
|
|
1404
|
+
};
|
|
1405
|
+
/** The first quicknet round whose time is at or after `unixSeconds` (A-20: `round_k` for `t_k + δ_drand`). */
|
|
1406
|
+
declare function firstRoundAtOrAfter(unixSeconds: bigint | number): bigint;
|
|
1407
|
+
/** `h = uint256(keccak256(randomness ‖ orderHash ‖ uint32be(attempt)))` — the 68-byte preimage of A-21. */
|
|
1408
|
+
declare function drawValue(randomness: Hex | string, orderHash: Hex, attempt: number): bigint;
|
|
1409
|
+
/**
|
|
1410
|
+
* `r = h mod Σw`; the winner is the first candidate, in ascending UTF-8 byte
|
|
1411
|
+
* order of `fillerId` (A-22), whose cumulative weight exceeds `r`. Sorts a copy
|
|
1412
|
+
* itself, so a verifier compares the outcome, not the order it was served in.
|
|
1413
|
+
*/
|
|
1414
|
+
declare function drawWinner(h: bigint, candidates: readonly DrawCandidate[]): DrawOutcome;
|
|
1415
|
+
|
|
1416
|
+
/** The protocol major this package describes: the `/v1` path and `auth.response.protocolVersion`. */
|
|
1417
|
+
declare const PROTOCOL_VERSION = "1";
|
|
1418
|
+
/**
|
|
1419
|
+
* The WebSocket subprotocol of filler protocol v1. A filler offers it on the
|
|
1420
|
+
* upgrade of `/v1` together with `bearer.<token>`; filler-gateway answers with
|
|
1421
|
+
* this one only and never echoes the token.
|
|
1422
|
+
*/
|
|
1423
|
+
declare const FILLER_WS_SUBPROTOCOL = "cancore-filler.v1";
|
|
1424
|
+
/** Prefix of the second subprotocol a filler offers: `bearer.` + the token of `POST /v1/filler/auth`. */
|
|
1425
|
+
declare const FILLER_WS_BEARER_PREFIX = "bearer.";
|
|
1426
|
+
/**
|
|
1427
|
+
* The subprotocols a filler offers on the upgrade (`Sec-WebSocket-Protocol`):
|
|
1428
|
+
* `['cancore-filler.v1', 'bearer.<token>']`. In a browser
|
|
1429
|
+
* `new WebSocket(url, fillerWsProtocols(token))`; with `ws` the same array.
|
|
1430
|
+
* The second entry carries the bearer token: never log it.
|
|
1431
|
+
*/
|
|
1432
|
+
declare function fillerWsProtocols(token: string): readonly [string, string];
|
|
1433
|
+
/** Close codes filler-gateway closes a filler session with (protocol §3.1). */
|
|
1434
|
+
declare const FILLER_CLOSE_CODES: {
|
|
1435
|
+
/** filler-gateway is shutting down. */
|
|
1436
|
+
readonly GOING_AWAY: 1001;
|
|
1437
|
+
/** The filler missed its heartbeats. */
|
|
1438
|
+
readonly HEARTBEAT_MISSED: 4000;
|
|
1439
|
+
/** A newer session of this fillerId superseded this one. */
|
|
1440
|
+
readonly SUPERSEDED: 4001;
|
|
1441
|
+
/** Cancore staff changed the message key the session was opened with: log in again with the new key. */
|
|
1442
|
+
readonly KEY_CHANGED: 4002;
|
|
1443
|
+
/** The filler is no longer `ACTIVE` (suspended). */
|
|
1444
|
+
readonly NOT_ACTIVE: 4003;
|
|
1445
|
+
/** This session's inbound queue overflowed (count or bytes); only this session is closed. */
|
|
1446
|
+
readonly QUEUE_OVERFLOW: 4008;
|
|
1447
|
+
/**
|
|
1448
|
+
* Sustained excess over the rate limits: every session of the fillerId is
|
|
1449
|
+
* closed and its upgrades and bearer requests are refused for a cooldown;
|
|
1450
|
+
* the `error RATE_LIMITED` sent just before carries `retryAfterMs` = the
|
|
1451
|
+
* remaining cooldown.
|
|
1452
|
+
*/
|
|
1453
|
+
readonly RATE_LIMITED: 4029;
|
|
1454
|
+
};
|
|
1455
|
+
type FillerCloseCode = (typeof FILLER_CLOSE_CODES)[keyof typeof FILLER_CLOSE_CODES];
|
|
1456
|
+
/**
|
|
1457
|
+
* HTTP statuses filler-gateway refuses the WebSocket upgrade with — a plain
|
|
1458
|
+
* HTTP response, no WebSocket, nothing signed. A client sees the upgrade fail
|
|
1459
|
+
* before the socket opens.
|
|
1460
|
+
*/
|
|
1461
|
+
declare const FILLER_UPGRADE_REFUSALS: {
|
|
1462
|
+
/** `cancore-filler.v1` not offered, or not exactly one `bearer.` entry. */
|
|
1463
|
+
readonly 400: "BAD_REQUEST";
|
|
1464
|
+
/** The token is missing, unknown or expired, or the message key changed. */
|
|
1465
|
+
readonly 401: "UNAUTHENTICATED";
|
|
1466
|
+
/** The filler is unknown or not `ACTIVE`. */
|
|
1467
|
+
readonly 403: "NOT_ACTIVE";
|
|
1468
|
+
/** The login rate class is over its limit, or the fillerId is cooling down; `Retry-After` in seconds. */
|
|
1469
|
+
readonly 429: "RATE_LIMITED";
|
|
1470
|
+
/** The replica is at its connection limit, or the fillerId already holds its maximum of live sessions. */
|
|
1471
|
+
readonly 503: "UNAVAILABLE";
|
|
1472
|
+
};
|
|
1473
|
+
interface FillerGateway {
|
|
1474
|
+
/** The key every S→F message is signed with (`GatewayMessage`); null until the environment has one. */
|
|
1475
|
+
gateway: Hex | null;
|
|
1476
|
+
/** Keys that sign `FillTicket`; the same set is registered on every router of the environment. */
|
|
1477
|
+
ticketSigners: readonly Hex[];
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* The published gateway key and ticket signers per environment — the release
|
|
1481
|
+
* data a taker checks every S→F signature and every ticket against, and never
|
|
1482
|
+
* takes from a gateway message. Empty in the RC: the keys do not exist yet
|
|
1483
|
+
* (O-6); the gateway release fills them in. Test keys never appear here.
|
|
1484
|
+
*/
|
|
1485
|
+
declare const FILLER_GATEWAYS: Readonly<Record<DeploymentEnv, FillerGateway>>;
|
|
1486
|
+
|
|
1487
|
+
type JsonSchema = Readonly<Record<string, unknown>>;
|
|
1488
|
+
type MessageDirection = 'S2F' | 'F2S' | 'both';
|
|
1489
|
+
interface RestEndpoint {
|
|
1490
|
+
method: 'GET' | 'POST';
|
|
1491
|
+
path: string;
|
|
1492
|
+
auth: 'none' | 'bearer';
|
|
1493
|
+
/** A `$ref` into rest.schema.json (`#/…`) or a sibling schema (`messages.schema.json#/…`). */
|
|
1494
|
+
request?: string;
|
|
1495
|
+
query?: string;
|
|
1496
|
+
response: string;
|
|
1497
|
+
/** An unsigned refusal body (`unsignedErrorBody`) this endpoint may answer instead of the signed `error` (the login routes). Every 429 is one, on every route. */
|
|
1498
|
+
errorBody?: string;
|
|
1499
|
+
}
|
|
1500
|
+
declare const PROTOCOL_SCHEMAS: {
|
|
1501
|
+
readonly messages: JsonSchema;
|
|
1502
|
+
readonly rest: JsonSchema;
|
|
1503
|
+
readonly records: JsonSchema;
|
|
1504
|
+
};
|
|
1505
|
+
declare const ASYNCAPI: JsonSchema;
|
|
1506
|
+
/** The annotation keywords the schemas use; a strict validator must be told they exist. */
|
|
1507
|
+
declare const SCHEMA_VOCABULARY: readonly string[];
|
|
1508
|
+
/** Frame type → who sends it: S2F gateway to taker, F2S taker to gateway, both. */
|
|
1509
|
+
declare const MESSAGE_DIRECTIONS: Readonly<Record<string, MessageDirection>>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Frame types that travel only as REST bodies — the login, `auth.challenge` and `auth.response` —
|
|
1512
|
+
* never on the WebSocket, which is authenticated by the bearer token offered on the upgrade.
|
|
1513
|
+
*/
|
|
1514
|
+
declare const REST_ONLY_TYPES: readonly string[];
|
|
1515
|
+
declare const REST_ENDPOINTS: readonly RestEndpoint[];
|
|
1516
|
+
/**
|
|
1517
|
+
* The absolute `$ref` of a frame type's schema (or any other `$def` of messages.schema.json).
|
|
1518
|
+
* `direction` picks the copy of a type that goes both ways: `ping`/`pong` from the gateway are
|
|
1519
|
+
* signed (`pingS2F`), from a taker they are not (`pingF2S`); without it, either copy passes.
|
|
1520
|
+
*/
|
|
1521
|
+
declare function messageSchemaRef(type: string, direction?: 'S2F' | 'F2S'): string;
|
|
1522
|
+
|
|
1523
|
+
/** The evm-contracts release these ABIs were taken from, and the commit of the checkout they were read at. */
|
|
76
1524
|
declare const CONTRACTS_RELEASE: {
|
|
77
1525
|
readonly version: "1.4.0-dev";
|
|
78
1526
|
readonly releaseChannel: "dev";
|
|
79
1527
|
readonly updatedAt: "2026-07-24T19:55:00Z";
|
|
1528
|
+
readonly commit: "4056e83cd84a94d9d00eb4486d5cabf55dd71741";
|
|
80
1529
|
};
|
|
81
1530
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
1531
|
+
* Per contract, the build of the release, as evm-contracts
|
|
1532
|
+
* scripts/tools/check-bytecode-match.mjs records it. `creationHexSha256` and
|
|
1533
|
+
* `runtimeHexSha256` are sha256 of the UTF-8 text of the artifact's 0x-prefixed hex of the
|
|
1534
|
+
* creation and runtime bytecode (not keccak256, not of the bytes); `creationHexLength` and
|
|
1535
|
+
* `runtimeHexLength` are the length of that text including the 0x. It pins the build a
|
|
1536
|
+
* release was made from. It is not a hash of `eth_getCode` — a contract with immutables
|
|
1537
|
+
* (CancoreRouter, FeeVault) never matches one — so checking a live deployment against it
|
|
1538
|
+
* needs a rebuild, not a lookup.
|
|
1539
|
+
*/
|
|
1540
|
+
declare const BUILD_HASHES: {
|
|
1541
|
+
readonly HTLC: {
|
|
1542
|
+
readonly creationHexSha256: "93a991d3a6451f7c3f02dfb70b365a48d29bebccc7f16d8dbe3d56d3dfee0af1";
|
|
1543
|
+
readonly runtimeHexSha256: "40ab52456c3b5a04365fc1fad837eb79bbe4b85c8dbd990f549468ae48f97e3a";
|
|
1544
|
+
readonly creationHexLength: 14976;
|
|
1545
|
+
readonly runtimeHexLength: 14686;
|
|
1546
|
+
};
|
|
1547
|
+
readonly FeeVault: {
|
|
1548
|
+
readonly creationHexSha256: "1c97d27c8d3e584f879bb57549d75ef10394a56a298eaf4a772516b9316e2248";
|
|
1549
|
+
readonly runtimeHexSha256: "0631177a64cde0829c2cec8426c08a507564f7d8b084e0237d724ed63faea0e9";
|
|
1550
|
+
readonly creationHexLength: 13176;
|
|
1551
|
+
readonly runtimeHexLength: 10968;
|
|
1552
|
+
};
|
|
1553
|
+
readonly MultiBalanceChecker: {
|
|
1554
|
+
readonly creationHexSha256: "c0a0326694f2a1594e332ba06120692cc98bc06c57d6d8981cb3768e01fad423";
|
|
1555
|
+
readonly runtimeHexSha256: "93a1f0aa251715cc6a1b6a472f10762463b5c24668886630cbc6da5632e5739b";
|
|
1556
|
+
readonly creationHexLength: 2456;
|
|
1557
|
+
readonly runtimeHexLength: 2394;
|
|
1558
|
+
};
|
|
1559
|
+
readonly CancoreRouter: {
|
|
1560
|
+
readonly creationHexSha256: "361c33f0b5c50625ea1fab280886f9df5f96e6353d8d0d7e9fbce11d64cde5f8";
|
|
1561
|
+
readonly runtimeHexSha256: "d3374648eaf5bdd0ddfc3ef6a67cd41ffea64b0551b24baded93cf2cb0aca1e0";
|
|
1562
|
+
readonly creationHexLength: 49814;
|
|
1563
|
+
readonly runtimeHexLength: 44242;
|
|
1564
|
+
};
|
|
1565
|
+
readonly CNRXStaking: {
|
|
1566
|
+
readonly creationHexSha256: "dfda056ee22b593e2f2e1fc4e679fbb9dc34b04964f389b46914402c422b40fb";
|
|
1567
|
+
readonly runtimeHexSha256: "d11534242f166e52f4ad063b5b6b59146e31634d3932f7ad63db05d83a1485f6";
|
|
1568
|
+
readonly creationHexLength: 7412;
|
|
1569
|
+
readonly runtimeHexLength: 6240;
|
|
1570
|
+
};
|
|
1571
|
+
readonly PointsClaim: {
|
|
1572
|
+
readonly creationHexSha256: "0f29890b609f7e15ef4dbcda17a7f2cd7482d016a0057a5f6c4270d7780ff38d";
|
|
1573
|
+
readonly runtimeHexSha256: "f2b10c4ec8458c0d6ab0f465481e645524f618f7a3327822e8ae5d3fd42fa46c";
|
|
1574
|
+
readonly creationHexLength: 14300;
|
|
1575
|
+
readonly runtimeHexLength: 11504;
|
|
1576
|
+
};
|
|
1577
|
+
readonly BurnMintTokenPool: {
|
|
1578
|
+
readonly creationHexSha256: "b5b19721149d9dd63e0650d0a1f95ac82affa4b9c650fdffd375db6ea361e416";
|
|
1579
|
+
readonly runtimeHexSha256: "c9aaa6a40ef4f0caadeb66f0a9adc68b1191949e9e0bdb420f331132bf651c3a";
|
|
1580
|
+
readonly creationHexLength: 41756;
|
|
1581
|
+
readonly runtimeHexLength: 39936;
|
|
1582
|
+
};
|
|
1583
|
+
readonly CNRX: {
|
|
1584
|
+
readonly creationHexSha256: "61b4e114722e99f93aac4bd4ef3cfb7973dd050b66e6ffb326efad29d4cc8c95";
|
|
1585
|
+
readonly runtimeHexSha256: "2b23774e41fb25f820227a50de4f48d7ad79b0bd131c1956aab07c100e0c3948";
|
|
1586
|
+
readonly creationHexLength: 21266;
|
|
1587
|
+
readonly runtimeHexLength: 17374;
|
|
1588
|
+
};
|
|
1589
|
+
};
|
|
1590
|
+
/**
|
|
1591
|
+
* @deprecated Use `BUILD_HASHES`: the same values under names that say what they are
|
|
1592
|
+
* (bytecodeHash → creationHexSha256, deployedBytecodeHash → runtimeHexSha256,
|
|
1593
|
+
* bytecodeLength → creationHexLength, deployedBytecodeLength → runtimeHexLength).
|
|
1594
|
+
* Kept for one release candidate; removed before 0.2.0.
|
|
84
1595
|
*/
|
|
85
1596
|
declare const BYTECODE_HASHES: {
|
|
86
1597
|
readonly HTLC: {
|
|
87
|
-
readonly bytecodeHash: "
|
|
88
|
-
readonly deployedBytecodeHash: "
|
|
89
|
-
readonly bytecodeLength:
|
|
90
|
-
readonly deployedBytecodeLength:
|
|
1598
|
+
readonly bytecodeHash: "93a991d3a6451f7c3f02dfb70b365a48d29bebccc7f16d8dbe3d56d3dfee0af1";
|
|
1599
|
+
readonly deployedBytecodeHash: "40ab52456c3b5a04365fc1fad837eb79bbe4b85c8dbd990f549468ae48f97e3a";
|
|
1600
|
+
readonly bytecodeLength: 14976;
|
|
1601
|
+
readonly deployedBytecodeLength: 14686;
|
|
91
1602
|
};
|
|
92
1603
|
readonly FeeVault: {
|
|
93
|
-
readonly bytecodeHash: "
|
|
94
|
-
readonly deployedBytecodeHash: "
|
|
95
|
-
readonly bytecodeLength:
|
|
96
|
-
readonly deployedBytecodeLength:
|
|
1604
|
+
readonly bytecodeHash: "1c97d27c8d3e584f879bb57549d75ef10394a56a298eaf4a772516b9316e2248";
|
|
1605
|
+
readonly deployedBytecodeHash: "0631177a64cde0829c2cec8426c08a507564f7d8b084e0237d724ed63faea0e9";
|
|
1606
|
+
readonly bytecodeLength: 13176;
|
|
1607
|
+
readonly deployedBytecodeLength: 10968;
|
|
97
1608
|
};
|
|
98
1609
|
readonly MultiBalanceChecker: {
|
|
99
1610
|
readonly bytecodeHash: "c0a0326694f2a1594e332ba06120692cc98bc06c57d6d8981cb3768e01fad423";
|
|
@@ -101,11 +1612,23 @@ declare const BYTECODE_HASHES: {
|
|
|
101
1612
|
readonly bytecodeLength: 2456;
|
|
102
1613
|
readonly deployedBytecodeLength: 2394;
|
|
103
1614
|
};
|
|
104
|
-
readonly
|
|
105
|
-
readonly bytecodeHash: "
|
|
106
|
-
readonly deployedBytecodeHash: "
|
|
107
|
-
readonly bytecodeLength:
|
|
108
|
-
readonly deployedBytecodeLength:
|
|
1615
|
+
readonly CancoreRouter: {
|
|
1616
|
+
readonly bytecodeHash: "361c33f0b5c50625ea1fab280886f9df5f96e6353d8d0d7e9fbce11d64cde5f8";
|
|
1617
|
+
readonly deployedBytecodeHash: "d3374648eaf5bdd0ddfc3ef6a67cd41ffea64b0551b24baded93cf2cb0aca1e0";
|
|
1618
|
+
readonly bytecodeLength: 49814;
|
|
1619
|
+
readonly deployedBytecodeLength: 44242;
|
|
1620
|
+
};
|
|
1621
|
+
readonly CNRXStaking: {
|
|
1622
|
+
readonly bytecodeHash: "dfda056ee22b593e2f2e1fc4e679fbb9dc34b04964f389b46914402c422b40fb";
|
|
1623
|
+
readonly deployedBytecodeHash: "d11534242f166e52f4ad063b5b6b59146e31634d3932f7ad63db05d83a1485f6";
|
|
1624
|
+
readonly bytecodeLength: 7412;
|
|
1625
|
+
readonly deployedBytecodeLength: 6240;
|
|
1626
|
+
};
|
|
1627
|
+
readonly PointsClaim: {
|
|
1628
|
+
readonly bytecodeHash: "0f29890b609f7e15ef4dbcda17a7f2cd7482d016a0057a5f6c4270d7780ff38d";
|
|
1629
|
+
readonly deployedBytecodeHash: "f2b10c4ec8458c0d6ab0f465481e645524f618f7a3327822e8ae5d3fd42fa46c";
|
|
1630
|
+
readonly bytecodeLength: 14300;
|
|
1631
|
+
readonly deployedBytecodeLength: 11504;
|
|
109
1632
|
};
|
|
110
1633
|
readonly BurnMintTokenPool: {
|
|
111
1634
|
readonly bytecodeHash: "b5b19721149d9dd63e0650d0a1f95ac82affa4b9c650fdffd375db6ea361e416";
|
|
@@ -113,13 +1636,20 @@ declare const BYTECODE_HASHES: {
|
|
|
113
1636
|
readonly bytecodeLength: 41756;
|
|
114
1637
|
readonly deployedBytecodeLength: 39936;
|
|
115
1638
|
};
|
|
1639
|
+
readonly CNRX: {
|
|
1640
|
+
readonly bytecodeHash: "61b4e114722e99f93aac4bd4ef3cfb7973dd050b66e6ffb326efad29d4cc8c95";
|
|
1641
|
+
readonly deployedBytecodeHash: "2b23774e41fb25f820227a50de4f48d7ad79b0bd131c1956aab07c100e0c3948";
|
|
1642
|
+
readonly bytecodeLength: 21266;
|
|
1643
|
+
readonly deployedBytecodeLength: 17374;
|
|
1644
|
+
};
|
|
116
1645
|
};
|
|
117
1646
|
|
|
118
1647
|
/**
|
|
119
1648
|
* `@cancore/contracts` — the Cancore EVM contracts as data.
|
|
120
1649
|
*
|
|
121
1650
|
* ABIs (`./abi`), the network registry (`./networks`), the EIP-712 voucher and
|
|
122
|
-
* the release identity
|
|
1651
|
+
* the release identity; and the filler protocol v1 (`./protocol`): its EIP-712
|
|
1652
|
+
* types, hashing helpers and wire shapes. What an integrator
|
|
123
1653
|
* needs to talk to the contracts without copying files out of our repositories,
|
|
124
1654
|
* and what our own frontend, backend and MCP server can stop carrying four
|
|
125
1655
|
* separate copies of.
|
|
@@ -128,4 +1658,4 @@ declare const BYTECODE_HASHES: {
|
|
|
128
1658
|
/** Decode a revert's 4-byte selector into the custom error it names, if it is one of ours. */
|
|
129
1659
|
declare function describeRevert(selectorOrData: string, tables: ReadonlyArray<Readonly<Record<string, string>>>): string | undefined;
|
|
130
1660
|
|
|
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 };
|
|
1661
|
+
export { ASYNCAPI, type AttestationCanton, type AttestationEvm, type AttestationsResponse, type AuthChallenge, type AuthOk, type AuthResponse, type AuthToken, BPS, BUILD_HASHES, BYTECODE_HASHES, CANTON_ORIGIN_ID, CANTON_SOURCE_ANCHOR, CANTON_TICKET_RECEIPT_TYPES, CONTRACTS_RELEASE, type CantonNetwork, type CantonSourceIntent, type CantonSourceOrder, type CantonTicketReceipt, type ChallengeQuery, DAML_NUMERIC_SCALE, DECLINE_REASONS, DEPLOYMENTS, DRAND_QUICKNET, DRAW_CLOSED_BY, type DecString, type DeclineReason, type DeploymentEnv, type DrawAttempt, type DrawCandidate, type DrawClosedBy, type DrawOutcome, type DrawRecord, EIP2294_MAX_CHAIN_ID, 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_CLOSE_CODES, FILLER_GATEWAYS, FILLER_ID_PATTERN, FILLER_KEY_REGISTRATION_TYPES, FILLER_MESSAGE_TYPES, FILLER_PROTOCOL_DOMAIN, FILLER_QUOTE_TYPES, FILLER_UPGRADE_REFUSALS, FILLER_WS_BEARER_PREFIX, FILLER_WS_SUBPROTOCOL, FILL_PROOF_DOMAIN, FILL_PROOF_TYPES, FILL_PROOF_TYPE_STRING, FILL_TICKET_DOMAIN, FILL_TICKET_TYPES, type FeeClaim, type FeeSplit, type FillProof, type FillProofJson, type FillReported, type FillTicket, type FillerAuth, type FillerCloseCode, type FillerEnvelopeContext, type FillerGateway, type FillerKeyRegistration, type FillerMessage, type FillerQuote, type FillerStats, GATEWAY_MESSAGE_TYPES, GRACE, type GatewayInfo, type GatewayMessage, type Hex, INSTRUMENT_LABEL_TAG, type JsonSchema, type JsonValue, MAX_FEE_BPS, MAX_FILL_TTL, MAX_PROOF_WINDOW, MAX_SIG_TTL, MESSAGE_DIRECTIONS, MIN_FILL_TTL, type MessageDirection, ORDER_TYPES, OWNER_LABEL_TAG, type Order, type OrderDomain, type OrderJson, type OrderSettled, PENALTY_STEPS, PERMIT2_ADDRESS, PERMIT2_WITNESS_TYPE_STRING, PERMIT_WITNESS_TYPES, PROOF_KIND_ATTESTATION, PROTOCOL_SCHEMAS, PROTOCOL_VERSION, type Page, type PenaltyApplied, type PenaltyList, type PenaltyRecord, type PenaltyStep, type PermitWitness, 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, REST_ONLY_TYPES, type RestEndpoint, type S2FBase, type S2FMessage, SCHEMA_VOCABULARY, SET_DELAY, 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 TicketReceiptCanton, type TicketReceiptEvm, type TicketReceiptMessage, type TicketRefusedReason, type TimeMs, type TypedDataDomain, type TypedDataInput, type TypedDataTypes, type TypedField, type TypedValue, type UintLike, type UnsignedErrorBody, type WireAsset, buildCantonSourceOrder, cantonInclusiveFeeSplit, cantonNetworkOfDestination, cantonSigEntries, cantonTicketReceipt, deliveryOrderCidHash, deploymentOf, describeRevert, drawValue, drawWinner, encodeCantonAmount, encodeCantonDestination, encodeCantonOutputAsset, encodeCantonRecipient, encodeType, evmAddressFromRepayTo, feeClaimDomain, fillProofDomain, fillerEnvelopeError, fillerIdHash, fillerMessageBodyHash, fillerWsProtocols, firstRoundAtOrAfter, gatewayBodyHash, hashCantonTicketReceipt, hashDomain, hashFillProof, hashFillTicket, hashFillerKeyRegistration, hashFillerMessage, hashFillerQuote, hashOrder, hashPermitWitness, hashStruct, hashTicketIntent, hashTypedData, inclusiveFeeSplit, isCantonOriginId, isCantonSource, isEoaSignature, isEvmRepayTo, jcs, messageIdRetainUntil, messageSchemaRef, permit2Domain, repayToFromEvm, repayToFromParty, requestIdHash, routerDomain, settleAttestationsErrors, settleAttestationsPayload, settleAttestationsPayloadHash, settleSigs, sourceOrderHash, typeHash };
|