@cancore/contracts 0.1.0 → 0.2.0-rc.13
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 +522 -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 +1774 -29
- package/dist/index.js +3692 -21
- 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 +1587 -0
- package/spec/protocol/messages.schema.json +906 -0
- package/spec/protocol/records.schema.json +94 -0
- package/spec/protocol/rest.schema.json +193 -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 +743 -0
- package/spec/protocol/vectors/records.json +81 -0
- package/spec/protocol/vectors/settle-attestations.json +544 -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
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cancore.io/schemas/filler-protocol/v1/messages.schema.json",
|
|
4
|
+
"title": "Cancore filler protocol v1 — WebSocket frames",
|
|
5
|
+
"$comment": "One $def per frame type, validated by name ($defs/<type>). The schemas encode the SENDER rule (protocol §3.1): lowercase hex, uint64 and wider as canonical decimal strings, uint8/16/32 as JSON integers, gateway times in milliseconds. No object is closed (V-2): receivers ignore unknown fields, takers ignore unknown S→F types, and treat an unknown reason/result/code as OTHER/generic. Every enum is open: anyOf [known values, futureEnumValue]. x-direction: S2F = gateway to filler, F2S = filler to gateway, both = either way (ping, pong, error; <type>S2F is the gateway's copy, <type>F2S the filler's). x-rest-only: the type travels only as a REST body (auth.challenge, auth.response: the login of protocol §3.6), never on the WebSocket. Every frame in both directions carries id, sentAt and fillerId (optional only on a gateway error that refuses a login, POST /v1/filler/auth) and is signed (protocol §3.4): `sig` = the gateway key over GatewayMessage{bodyHash} on S2F, `msgSig` = the filler's message key over FillerMessage{bodyHash} on F2S, bodyHash = keccak256(JCS(frame without that field)). No exceptions: ticket.decline, a declining quote.reconfirm.reply, fill.reported, pong and error from the filler are signed too.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"uintDec64": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$", "maxLength": 20, "description": "uint64 as a decimal string: digits only, no sign, no exponent, no leading zero" },
|
|
8
|
+
"uintDec256": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$", "maxLength": 78, "description": "uint256 as a decimal string" },
|
|
9
|
+
"intDecUsd": { "type": "string", "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$", "description": "signed decimal USD amount" },
|
|
10
|
+
"uint8": { "type": "integer", "minimum": 0, "maximum": 255 },
|
|
11
|
+
"uint16": { "type": "integer", "minimum": 0, "maximum": 65535 },
|
|
12
|
+
"uint32": { "type": "integer", "minimum": 0, "maximum": 4294967295 },
|
|
13
|
+
"address": { "type": "string", "pattern": "^0x[0-9a-f]{40}$", "description": "EVM address, lowercase hex" },
|
|
14
|
+
"bytes32": { "type": "string", "pattern": "^0x[0-9a-f]{64}$" },
|
|
15
|
+
"repayTo": { "$ref": "#/$defs/bytes32", "description": "where settle pays the filler, encoded for the SOURCE chain (protocol §3.15): EVM — the address left-padded to 32 bytes (repayToEvm); Canton — keccak256(utf8(partyId)) of the filler's registered party" },
|
|
16
|
+
"repayToEvm": { "type": "string", "pattern": "^0x0{24}(?!0{40})[0-9a-f]{40}$", "description": "repayTo for an EVM source: zero top 12 bytes (the router refuses others, InvalidBytes32Address) and not the zero address (ZeroAddress). A receiver that knows the source chain checks repayTo against this" },
|
|
17
|
+
"deliveryKey": { "$ref": "#/$defs/address", "description": "the address that sends fill on the destination (FillTicket.deliveryKey); the zero address for a Canton destination" },
|
|
18
|
+
"sig65": { "type": "string", "pattern": "^0x[0-9a-f]{64}[0-7][0-9a-f]{63}(1b|1c)$", "description": "65-byte r ‖ s ‖ v of an EOA, low-s, v ∈ {27, 28}; no EIP-1271. The pattern refuses any other length or v and an s with its top bit set; isEoaSignature checks the exact bound s ≤ n/2" },
|
|
19
|
+
"timeMs": { "type": "integer", "minimum": 1000000000000, "maximum": 9007199254740991, "description": "unix milliseconds, gateway clock; the minimum rejects seconds" },
|
|
20
|
+
"durationMs": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
|
|
21
|
+
"timeS": { "$ref": "#/$defs/uintDec64", "description": "unix seconds as a decimal string (on-chain and signed times)" },
|
|
22
|
+
"caip2": { "type": "string", "pattern": "^(eip155:[1-9][0-9]*|canton:(mainnet|testnet|devnet))$" },
|
|
23
|
+
"cantonAsset": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"required": ["admin", "id"],
|
|
26
|
+
"properties": { "admin": { "type": "string", "minLength": 1 }, "id": { "type": "string", "minLength": 1 } }
|
|
27
|
+
},
|
|
28
|
+
"asset": { "oneOf": [{ "$ref": "#/$defs/address" }, { "$ref": "#/$defs/cantonAsset" }] },
|
|
29
|
+
"requestId": { "type": "string", "pattern": "^[!-~]{1,64}$", "description": "1..64 printable ASCII (Canonical.daml:90-93)" },
|
|
30
|
+
"fillerId": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,62}$" },
|
|
31
|
+
"messageId": { "type": "string", "minLength": 1, "maxLength": 64, "description": "unique per fillerId and direction across every session of that fillerId; never reused by its sender within maxMessageAgeMs" },
|
|
32
|
+
"protocolVersion": { "const": "1" },
|
|
33
|
+
"order": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"description": "ICancoreRouter.Order, twelve fields, every numeric field a decimal string (the shape of canton-order.json vector.order)",
|
|
36
|
+
"required": ["user", "originChainId", "inputToken", "inputAmount", "destination", "outputAsset", "minReceived", "recipient", "createdAt", "fillDeadline", "feeBps", "fillerId"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"user": { "$ref": "#/$defs/address" },
|
|
39
|
+
"originChainId": { "$ref": "#/$defs/uintDec64" },
|
|
40
|
+
"inputToken": { "$ref": "#/$defs/address" },
|
|
41
|
+
"inputAmount": { "$ref": "#/$defs/uintDec256" },
|
|
42
|
+
"destination": { "$ref": "#/$defs/bytes32" },
|
|
43
|
+
"outputAsset": { "$ref": "#/$defs/bytes32" },
|
|
44
|
+
"minReceived": { "$ref": "#/$defs/uintDec256" },
|
|
45
|
+
"recipient": { "$ref": "#/$defs/bytes32" },
|
|
46
|
+
"createdAt": { "$ref": "#/$defs/timeS" },
|
|
47
|
+
"fillDeadline": { "$ref": "#/$defs/timeS" },
|
|
48
|
+
"feeBps": { "type": "string", "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$", "description": "uint16" },
|
|
49
|
+
"fillerId": { "$ref": "#/$defs/bytes32", "description": "keccak256(utf8(fillerId)) of the filler the user picked" }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"ticket": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"description": "FillTicket(bytes32 orderHash,bytes32 fillerId,address deliveryKey,bytes32 repayTo,uint32 attempt,uint64 validFrom,uint64 validUntil); fillerId is keccak256(utf8(fillerId)), deliveryKey and repayTo are those of the filler's signed ticket.intent (S-22)",
|
|
55
|
+
"required": ["orderHash", "fillerId", "deliveryKey", "repayTo", "attempt", "validFrom", "validUntil"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
58
|
+
"fillerId": { "$ref": "#/$defs/bytes32" },
|
|
59
|
+
"deliveryKey": { "$ref": "#/$defs/address" },
|
|
60
|
+
"repayTo": { "$ref": "#/$defs/repayTo" },
|
|
61
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
62
|
+
"validFrom": { "$ref": "#/$defs/timeS" },
|
|
63
|
+
"validUntil": { "$ref": "#/$defs/timeS" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"futureEnumValue": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$", "description": "a value added to an open enum within v1 (V-2); the receiver treats it as OTHER/generic. Every protocol enum is `anyOf: [{enum: known values}, futureEnumValue]`" },
|
|
67
|
+
"declineReason": {
|
|
68
|
+
"anyOf": [
|
|
69
|
+
{ "enum": ["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"] },
|
|
70
|
+
{ "$ref": "#/$defs/futureEnumValue" }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"errorCode": {
|
|
74
|
+
"anyOf": [
|
|
75
|
+
{ "enum": ["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", "CANTON_NOT_READY", "CANTON_REFUSED", "CANTON_UNAVAILABLE", "OPERATION_EXPIRED"] },
|
|
76
|
+
{ "$ref": "#/$defs/futureEnumValue" }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"ticketRefusedReason": {
|
|
80
|
+
"anyOf": [
|
|
81
|
+
{ "enum": ["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"] },
|
|
82
|
+
{ "$ref": "#/$defs/futureEnumValue" }
|
|
83
|
+
],
|
|
84
|
+
"description": "error.reason with TICKET_REFUSED: the pre-ticket check that failed (S-21); the order is re-drawn, nothing is recorded against the filler"
|
|
85
|
+
},
|
|
86
|
+
"expiredResult": { "anyOf": [{ "enum": ["FILLED", "NO_SHOW", "NO_SHOW_UNCONFIRMED", "EXEMPT"] }, { "$ref": "#/$defs/futureEnumValue" }] },
|
|
87
|
+
"exemptReason": { "anyOf": [{ "enum": ["DESTINATION_HALTED", "GATEWAY_FAULT", "REORGED_AFTER_INCLUSION", "RECIPIENT_NOT_READY", "OTHER"] }, { "$ref": "#/$defs/futureEnumValue" }] },
|
|
88
|
+
"quoteAckStatus": { "anyOf": [{ "enum": ["COUNTED", "LATE", "SHORT_TTL"] }, { "$ref": "#/$defs/futureEnumValue" }], "description": "verdict at receipt time; the final status is on GET /v1/filler/quotes" },
|
|
89
|
+
"penaltyStep": { "anyOf": [{ "enum": ["L1", "L2", "L3", "L4"] }, { "$ref": "#/$defs/futureEnumValue" }] },
|
|
90
|
+
"s2fEnvelope": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"required": ["type", "id", "sentAt", "sig"],
|
|
93
|
+
"properties": {
|
|
94
|
+
"type": { "type": "string" },
|
|
95
|
+
"id": { "$ref": "#/$defs/messageId" },
|
|
96
|
+
"fillerId": { "$ref": "#/$defs/fillerId", "description": "the addressee" },
|
|
97
|
+
"sentAt": { "$ref": "#/$defs/timeMs" },
|
|
98
|
+
"sig": { "$ref": "#/$defs/sig65", "description": "gateway key over GatewayMessage{bodyHash = keccak256(JCS(frame without sig))}" },
|
|
99
|
+
"re": { "$ref": "#/$defs/messageId" }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"s2fBase": { "allOf": [{ "$ref": "#/$defs/s2fEnvelope" }, { "type": "object", "required": ["fillerId"], "properties": { "fillerId": { "$ref": "#/$defs/fillerId" } } }] },
|
|
103
|
+
"f2sEnvelope": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "What every filler → filler-gateway message and REST request body carries (protocol §3.4, S-19): the gateway refuses one without it, with another fillerId than the session's, with a stale sentAt or a reused id",
|
|
106
|
+
"required": ["id", "fillerId", "sentAt", "msgSig"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"id": { "$ref": "#/$defs/messageId" },
|
|
109
|
+
"fillerId": { "$ref": "#/$defs/fillerId", "description": "the sender; must be the fillerId the session is authenticated for" },
|
|
110
|
+
"sentAt": { "$ref": "#/$defs/timeMs" },
|
|
111
|
+
"msgSig": { "$ref": "#/$defs/sig65", "description": "the filler's message key over FillerMessage{bodyHash = keccak256(JCS(message without msgSig))}; the body keeps id, fillerId, sentAt and any inner sig" },
|
|
112
|
+
"re": { "$ref": "#/$defs/messageId" }
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"f2sBase": { "allOf": [{ "$ref": "#/$defs/f2sEnvelope" }, { "type": "object", "required": ["type"], "properties": { "type": { "type": "string" } } }] },
|
|
116
|
+
"fillerKeyRegistration": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"description": "Proof of possession of a message key (protocol §3.16): FillerKeyRegistration{fillerId, messageKey, issuedAt} signed by that key — at onboarding, and with the NEW key at a manual key change by Cancore staff, who submit it to the key registry of filler-gateway. Not a frame: there is no key-change message. sig must be an EOA signature (65 bytes, low-s, v ∈ {27, 28}) that recovers to messageKey; an EIP-1271 signature is refused",
|
|
119
|
+
"required": ["fillerId", "messageKey", "issuedAt", "sig"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"fillerId": { "$ref": "#/$defs/fillerId" },
|
|
122
|
+
"messageKey": { "$ref": "#/$defs/address" },
|
|
123
|
+
"issuedAt": { "$ref": "#/$defs/timeS" },
|
|
124
|
+
"sig": { "$ref": "#/$defs/sig65" }
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"auth.challenge": {
|
|
128
|
+
"x-direction": "S2F",
|
|
129
|
+
"x-rest-only": true,
|
|
130
|
+
"type": "object",
|
|
131
|
+
"description": "The login challenge, addressed to the fillerId it was asked for: the 200 body of GET /v1/filler/auth/challenge?fillerId=. Never sent on the WebSocket. The filler checks the gateway sig and that fillerId is its own before it signs FillerAuth{fillerId, nonce, expiresAt}",
|
|
132
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
133
|
+
"required": ["type", "nonce", "expiresAt"],
|
|
134
|
+
"properties": { "type": { "const": "auth.challenge" }, "nonce": { "$ref": "#/$defs/bytes32" }, "expiresAt": { "$ref": "#/$defs/timeS" } }
|
|
135
|
+
},
|
|
136
|
+
"auth.response": {
|
|
137
|
+
"x-direction": "F2S",
|
|
138
|
+
"type": "object",
|
|
139
|
+
"x-rest-only": true,
|
|
140
|
+
"description": "The body of POST /v1/filler/auth, answered with {token, expiresAt}. sig = FillerAuth{fillerId, nonce, expiresAt} by the registered message key of fillerId (keyAddress = its address); msgSig by the same key. Never sent on the WebSocket: a WebSocket connection is authenticated by the bearer token offered on the upgrade",
|
|
141
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
142
|
+
"required": ["type", "fillerId", "keyAddress", "protocolVersion", "sig"],
|
|
143
|
+
"properties": {
|
|
144
|
+
"type": { "const": "auth.response" },
|
|
145
|
+
"fillerId": { "$ref": "#/$defs/fillerId" },
|
|
146
|
+
"keyAddress": { "$ref": "#/$defs/address" },
|
|
147
|
+
"protocolVersion": { "type": "string", "description": "the gateway answers UNSUPPORTED_VERSION to anything it does not serve; v1 senders send \"1\"" },
|
|
148
|
+
"nonce": { "$ref": "#/$defs/bytes32", "description": "the auth.challenge nonce this response answers (optional; senders SHOULD send it), so POST /v1/filler/auth finds the live challenge of this fillerId without trying every one" },
|
|
149
|
+
"sig": { "$ref": "#/$defs/sig65" }
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"auth.ok": {
|
|
153
|
+
"x-direction": "S2F",
|
|
154
|
+
"type": "object",
|
|
155
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
156
|
+
"required": ["type", "heartbeatIntervalMs"],
|
|
157
|
+
"properties": { "type": { "const": "auth.ok" }, "heartbeatIntervalMs": { "$ref": "#/$defs/durationMs" } }
|
|
158
|
+
},
|
|
159
|
+
"ping": {
|
|
160
|
+
"x-direction": "both",
|
|
161
|
+
"description": "Heartbeat, either way. A receiver checks the copy of its direction: pingS2F (gateway sig) or pingF2S (filler msgSig)",
|
|
162
|
+
"anyOf": [{ "$ref": "#/$defs/pingF2S" }, { "$ref": "#/$defs/pingS2F" }]
|
|
163
|
+
},
|
|
164
|
+
"pingF2S": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
167
|
+
"required": ["type", "id"],
|
|
168
|
+
"properties": { "type": { "const": "ping" }, "id": { "$ref": "#/$defs/messageId" } }
|
|
169
|
+
},
|
|
170
|
+
"pingS2F": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
173
|
+
"required": ["type", "id"],
|
|
174
|
+
"properties": { "type": { "const": "ping" }, "id": { "$ref": "#/$defs/messageId" } }
|
|
175
|
+
},
|
|
176
|
+
"pong": {
|
|
177
|
+
"x-direction": "both",
|
|
178
|
+
"description": "Answer to a ping, re = ping.id. A receiver checks the copy of its direction: pongS2F (gateway sig) or pongF2S (filler msgSig)",
|
|
179
|
+
"anyOf": [{ "$ref": "#/$defs/pongF2S" }, { "$ref": "#/$defs/pongS2F" }]
|
|
180
|
+
},
|
|
181
|
+
"pongF2S": {
|
|
182
|
+
"type": "object",
|
|
183
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
184
|
+
"required": ["type", "re"],
|
|
185
|
+
"properties": { "type": { "const": "pong" }, "re": { "$ref": "#/$defs/messageId" } }
|
|
186
|
+
},
|
|
187
|
+
"pongS2F": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
190
|
+
"required": ["type", "re"],
|
|
191
|
+
"properties": { "type": { "const": "pong" }, "re": { "$ref": "#/$defs/messageId" } }
|
|
192
|
+
},
|
|
193
|
+
"error": {
|
|
194
|
+
"x-direction": "both",
|
|
195
|
+
"description": "Either way. A receiver checks the copy of its direction: errorS2F (the gateway's reply, also the REST error body) or errorF2S (the filler's reply to a gateway frame it cannot handle)",
|
|
196
|
+
"anyOf": [{ "$ref": "#/$defs/errorF2S" }, { "$ref": "#/$defs/errorS2F" }]
|
|
197
|
+
},
|
|
198
|
+
"errorS2F": {
|
|
199
|
+
"type": "object",
|
|
200
|
+
"description": "Reply to the F→S frame `re`; also the REST error body. fillerId may be absent on a refusal of POST /v1/filler/auth, which is not authenticated yet. reason names the failed pre-ticket check with TICKET_REFUSED. retryAfterMs comes with RATE_LIMITED only",
|
|
201
|
+
"allOf": [{ "$ref": "#/$defs/s2fEnvelope" }],
|
|
202
|
+
"required": ["type", "code", "message"],
|
|
203
|
+
"properties": {
|
|
204
|
+
"type": { "const": "error" },
|
|
205
|
+
"code": { "$ref": "#/$defs/errorCode" },
|
|
206
|
+
"message": { "type": "string" },
|
|
207
|
+
"reason": { "$ref": "#/$defs/ticketRefusedReason" },
|
|
208
|
+
"retryAfterMs": { "$ref": "#/$defs/durationMs", "type": "integer", "minimum": 1, "description": "with RATE_LIMITED: ms (≥ 1) until the rate class of the refused message holds a token again, or until the cooldown of the fillerId ends; the filler sends nothing of that class before it" }
|
|
209
|
+
},
|
|
210
|
+
"if": { "type": "object", "properties": { "code": { "const": "TICKET_REFUSED" } }, "required": ["code"] },
|
|
211
|
+
"then": { "type": "object", "required": ["reason"], "properties": { "reason": true } }
|
|
212
|
+
},
|
|
213
|
+
"errorF2S": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"description": "The filler's reply to the S→F frame `re` it cannot handle (malformed, unknown orderHash); informational, it changes no state in filler-gateway. Signed like every filler message",
|
|
216
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
217
|
+
"required": ["type", "re", "code", "message"],
|
|
218
|
+
"properties": { "type": { "const": "error" }, "re": { "$ref": "#/$defs/messageId" }, "code": { "$ref": "#/$defs/errorCode" }, "message": { "type": "string" } }
|
|
219
|
+
},
|
|
220
|
+
"epoch.weights": {
|
|
221
|
+
"x-direction": "S2F",
|
|
222
|
+
"type": "object",
|
|
223
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
224
|
+
"required": ["type", "epochId", "startsAt", "endsAt", "weightsRoot"],
|
|
225
|
+
"properties": {
|
|
226
|
+
"type": { "const": "epoch.weights" },
|
|
227
|
+
"epochId": { "$ref": "#/$defs/uintDec64" },
|
|
228
|
+
"startsAt": { "$ref": "#/$defs/timeS" },
|
|
229
|
+
"endsAt": { "$ref": "#/$defs/timeS" },
|
|
230
|
+
"weightsRoot": { "$ref": "#/$defs/bytes32" }
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"quote.request": {
|
|
234
|
+
"x-direction": "S2F",
|
|
235
|
+
"type": "object",
|
|
236
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
237
|
+
"required": ["type", "requestId", "route", "inputToken", "inputAmount", "outputAsset", "feeBps", "fillDeadlineHint", "windowCloseAt", "quoteTtlMs"],
|
|
238
|
+
"properties": {
|
|
239
|
+
"type": { "const": "quote.request" },
|
|
240
|
+
"requestId": { "$ref": "#/$defs/requestId" },
|
|
241
|
+
"route": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"required": ["src", "dst"],
|
|
244
|
+
"properties": { "src": { "$ref": "#/$defs/caip2" }, "dst": { "$ref": "#/$defs/caip2" } }
|
|
245
|
+
},
|
|
246
|
+
"inputToken": { "$ref": "#/$defs/asset" },
|
|
247
|
+
"inputAmount": { "$ref": "#/$defs/uintDec256", "description": "the total T the maker deposits (inclusive fee), input base units" },
|
|
248
|
+
"outputAsset": { "$ref": "#/$defs/asset" },
|
|
249
|
+
"feeBps": { "$ref": "#/$defs/uint16" },
|
|
250
|
+
"fillDeadlineHint": { "$ref": "#/$defs/timeS" },
|
|
251
|
+
"windowCloseAt": { "$ref": "#/$defs/timeMs" },
|
|
252
|
+
"quoteTtlMs": { "$ref": "#/$defs/durationMs" },
|
|
253
|
+
"imbalanceHint": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"required": ["dstAsset", "netFlow24hUsd"],
|
|
256
|
+
"properties": { "dstAsset": { "$ref": "#/$defs/asset" }, "netFlow24hUsd": { "$ref": "#/$defs/intDecUsd" } }
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"quote": {
|
|
261
|
+
"x-direction": "F2S",
|
|
262
|
+
"type": "object",
|
|
263
|
+
"description": "sig = FillerQuote{keccak256(utf8(requestId)), fillerId, amountOut, validUntil, nonce} by the message key, fillerId the envelope's; counts only if validUntil × 1000 ≥ windowCloseAt + quoteTtlMs",
|
|
264
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
265
|
+
"required": ["type", "requestId", "amountOut", "validUntil", "nonce", "sig"],
|
|
266
|
+
"properties": {
|
|
267
|
+
"type": { "const": "quote" },
|
|
268
|
+
"requestId": { "$ref": "#/$defs/requestId" },
|
|
269
|
+
"amountOut": { "$ref": "#/$defs/uintDec256" },
|
|
270
|
+
"validUntil": { "$ref": "#/$defs/timeS" },
|
|
271
|
+
"nonce": { "$ref": "#/$defs/uintDec64" },
|
|
272
|
+
"sig": { "$ref": "#/$defs/sig65" }
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"quote.ack": {
|
|
276
|
+
"x-direction": "S2F",
|
|
277
|
+
"type": "object",
|
|
278
|
+
"description": "For every well-formed, correctly signed quote, late ones included (S-12)",
|
|
279
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
280
|
+
"required": ["type", "requestId", "quoteHash", "receivedAt", "status"],
|
|
281
|
+
"properties": {
|
|
282
|
+
"type": { "const": "quote.ack" },
|
|
283
|
+
"requestId": { "$ref": "#/$defs/requestId" },
|
|
284
|
+
"quoteHash": { "$ref": "#/$defs/bytes32" },
|
|
285
|
+
"receivedAt": { "$ref": "#/$defs/timeMs" },
|
|
286
|
+
"status": { "$ref": "#/$defs/quoteAckStatus" }
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"quote.reconfirm": {
|
|
290
|
+
"x-direction": "S2F",
|
|
291
|
+
"type": "object",
|
|
292
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
293
|
+
"required": ["type", "orderHash", "requestId", "order", "amountOut", "ticketTtl", "replyBy"],
|
|
294
|
+
"properties": {
|
|
295
|
+
"type": { "const": "quote.reconfirm" },
|
|
296
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
297
|
+
"requestId": { "$ref": "#/$defs/requestId" },
|
|
298
|
+
"order": { "$ref": "#/$defs/order" },
|
|
299
|
+
"amountOut": { "$ref": "#/$defs/uintDec256" },
|
|
300
|
+
"ticketTtl": { "$ref": "#/$defs/uint32", "description": "seconds" },
|
|
301
|
+
"replyBy": { "$ref": "#/$defs/timeMs" }
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"quote.reconfirm.reply": {
|
|
305
|
+
"x-direction": "F2S",
|
|
306
|
+
"type": "object",
|
|
307
|
+
"description": "An accept carries sig = FillerQuote{keccak256(utf8(requestId)), fillerId, amountOut, validUntil, nonce} by the message key; a decline carries only the envelope msgSig",
|
|
308
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
309
|
+
"required": ["type", "orderHash", "accept"],
|
|
310
|
+
"properties": {
|
|
311
|
+
"type": { "const": "quote.reconfirm.reply" },
|
|
312
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
313
|
+
"accept": { "type": "boolean" },
|
|
314
|
+
"validUntil": { "$ref": "#/$defs/timeS" },
|
|
315
|
+
"nonce": { "$ref": "#/$defs/uintDec64" },
|
|
316
|
+
"sig": { "$ref": "#/$defs/sig65" }
|
|
317
|
+
},
|
|
318
|
+
"if": { "type": "object", "properties": { "accept": { "const": true } }, "required": ["accept"] },
|
|
319
|
+
"then": { "type": "object", "required": ["validUntil", "nonce", "sig"], "properties": { "validUntil": true, "nonce": true, "sig": true } }
|
|
320
|
+
},
|
|
321
|
+
"ticket.offer": {
|
|
322
|
+
"x-direction": "S2F",
|
|
323
|
+
"type": "object",
|
|
324
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
325
|
+
"required": ["type", "orderHash", "attempt", "order", "amountOut", "validFrom", "validUntil", "acceptBy"],
|
|
326
|
+
"properties": {
|
|
327
|
+
"type": { "const": "ticket.offer" },
|
|
328
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
329
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
330
|
+
"order": { "$ref": "#/$defs/order" },
|
|
331
|
+
"amountOut": { "$ref": "#/$defs/uintDec256" },
|
|
332
|
+
"validFrom": { "$ref": "#/$defs/timeS" },
|
|
333
|
+
"validUntil": { "$ref": "#/$defs/timeS" },
|
|
334
|
+
"acceptBy": { "$ref": "#/$defs/timeMs" }
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"ticket.intent": {
|
|
338
|
+
"x-direction": "F2S",
|
|
339
|
+
"type": "object",
|
|
340
|
+
"description": "sig = TicketIntent{orderHash, attempt, validFrom, validUntil, fillerId, deliveryKey, repayTo} by the message key, fillerId the envelope's; orderHash, attempt, validFrom, validUntil equal the offer; the issued ticket carries exactly this deliveryKey and repayTo (S-22), or the gateway answers error TICKET_REFUSED (S-21)",
|
|
341
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
342
|
+
"required": ["type", "orderHash", "attempt", "validFrom", "validUntil", "deliveryKey", "repayTo", "sig"],
|
|
343
|
+
"properties": {
|
|
344
|
+
"type": { "const": "ticket.intent" },
|
|
345
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
346
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
347
|
+
"validFrom": { "$ref": "#/$defs/timeS" },
|
|
348
|
+
"validUntil": { "$ref": "#/$defs/timeS" },
|
|
349
|
+
"deliveryKey": { "$ref": "#/$defs/deliveryKey" },
|
|
350
|
+
"repayTo": { "$ref": "#/$defs/repayTo" },
|
|
351
|
+
"sig": { "$ref": "#/$defs/sig65" }
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"ticket.decline": {
|
|
355
|
+
"x-direction": "F2S",
|
|
356
|
+
"type": "object",
|
|
357
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
358
|
+
"required": ["type", "orderHash", "attempt", "reason"],
|
|
359
|
+
"properties": {
|
|
360
|
+
"type": { "const": "ticket.decline" },
|
|
361
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
362
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
363
|
+
"reason": { "$ref": "#/$defs/declineReason" },
|
|
364
|
+
"detail": { "type": "string" }
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"ticket.intent.ack": {
|
|
368
|
+
"x-direction": "S2F",
|
|
369
|
+
"type": "object",
|
|
370
|
+
"description": "Idempotent: a repeated identical intent gets the identical ack",
|
|
371
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
372
|
+
"required": ["type", "orderHash", "attempt", "intentHash", "receivedAt"],
|
|
373
|
+
"properties": {
|
|
374
|
+
"type": { "const": "ticket.intent.ack" },
|
|
375
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
376
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
377
|
+
"intentHash": { "$ref": "#/$defs/bytes32" },
|
|
378
|
+
"receivedAt": { "$ref": "#/$defs/timeMs" }
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"ticket.issued": {
|
|
382
|
+
"x-direction": "S2F",
|
|
383
|
+
"type": "object",
|
|
384
|
+
"description": "form discriminates the EVM-destination ticket (FillTicket + ticketSig) from the Canton-destination one (DeliveryOrder, with its repayTo); a form added within v1 (V-2) is checked against the common fields only. The filler checks fillerId, deliveryKey and repayTo against its own ticket.intent before it delivers (T-15)",
|
|
385
|
+
"required": ["type", "form", "orderHash", "attempt"],
|
|
386
|
+
"properties": {
|
|
387
|
+
"type": { "const": "ticket.issued" },
|
|
388
|
+
"form": { "anyOf": [{ "enum": ["evm", "canton"] }, { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }] },
|
|
389
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
390
|
+
"attempt": { "$ref": "#/$defs/uint32" }
|
|
391
|
+
},
|
|
392
|
+
"allOf": [
|
|
393
|
+
{ "$ref": "#/$defs/s2fBase" },
|
|
394
|
+
{
|
|
395
|
+
"if": { "type": "object", "properties": { "form": { "const": "evm" } }, "required": ["form"] },
|
|
396
|
+
"then": { "type": "object", "required": ["ticket", "ticketSig"], "properties": { "ticket": { "$ref": "#/$defs/ticket" }, "ticketSig": { "$ref": "#/$defs/sig65" } } }
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"if": { "type": "object", "properties": { "form": { "const": "canton" } }, "required": ["form"] },
|
|
400
|
+
"then": { "type": "object", "required": ["deliveryOrderCid", "validUntil", "repayTo"], "properties": { "deliveryOrderCid": { "type": "string", "minLength": 1 }, "validUntil": { "$ref": "#/$defs/timeS" }, "repayTo": { "$ref": "#/$defs/repayTo", "description": "the repayTo of the DeliveryOrder, = the filler's signed ticket.intent (S-22); fillerId is the envelope's" } } }
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
},
|
|
404
|
+
"ticket.receipt": {
|
|
405
|
+
"x-direction": "F2S",
|
|
406
|
+
"type": "object",
|
|
407
|
+
"description": "form follows the issued ticket (S-14). EVM form (form absent or \"evm\"): sig = TicketReceipt{ticketHash, ticketSigHash} by the message key. Canton form: sig = CantonTicketReceipt{orderHash, attempt, deliveryOrderCidHash = keccak256(utf8(deliveryOrderCid)), validUntil} by the message key, deliveryOrderCid and validUntil exactly as in ticket.issued; fillerId and repayTo are not part of it (protocol §3.3, §10 D-O)",
|
|
408
|
+
"required": ["type", "orderHash", "attempt", "sig"],
|
|
409
|
+
"properties": {
|
|
410
|
+
"type": { "const": "ticket.receipt" },
|
|
411
|
+
"form": { "anyOf": [{ "enum": ["evm", "canton"] }, { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }] },
|
|
412
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
413
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
414
|
+
"sig": { "$ref": "#/$defs/sig65" }
|
|
415
|
+
},
|
|
416
|
+
"allOf": [
|
|
417
|
+
{ "$ref": "#/$defs/f2sBase" },
|
|
418
|
+
{
|
|
419
|
+
"if": { "type": "object", "properties": { "form": { "const": "evm" } } },
|
|
420
|
+
"then": { "type": "object", "required": ["ticketHash", "ticketSigHash"], "properties": { "ticketHash": { "$ref": "#/$defs/bytes32" }, "ticketSigHash": { "$ref": "#/$defs/bytes32" } } }
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"if": { "type": "object", "properties": { "form": { "const": "canton" } }, "required": ["form"] },
|
|
424
|
+
"then": { "type": "object", "required": ["deliveryOrderCid", "validUntil"], "properties": { "deliveryOrderCid": { "type": "string", "minLength": 1, "description": "the contract id of the DeliveryOrder, exactly as ticket.issued sent it" }, "validUntil": { "$ref": "#/$defs/timeS", "description": "= ticket.issued.validUntil" } } }
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
"fill.reported": {
|
|
429
|
+
"x-direction": "F2S",
|
|
430
|
+
"type": "object",
|
|
431
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
432
|
+
"required": ["type", "orderHash", "attempt", "txRef"],
|
|
433
|
+
"properties": {
|
|
434
|
+
"type": { "const": "fill.reported" },
|
|
435
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
436
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
437
|
+
"txRef": { "type": "string", "minLength": 1, "description": "EVM tx hash or Canton update id" }
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"ticket.expired": {
|
|
441
|
+
"x-direction": "S2F",
|
|
442
|
+
"type": "object",
|
|
443
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
444
|
+
"required": ["type", "orderHash", "attempt", "result"],
|
|
445
|
+
"properties": {
|
|
446
|
+
"type": { "const": "ticket.expired" },
|
|
447
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
448
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
449
|
+
"result": { "$ref": "#/$defs/expiredResult" },
|
|
450
|
+
"exemptReason": { "$ref": "#/$defs/exemptReason" }
|
|
451
|
+
},
|
|
452
|
+
"if": { "type": "object", "properties": { "result": { "const": "EXEMPT" } }, "required": ["result"] },
|
|
453
|
+
"then": { "type": "object", "required": ["exemptReason"], "properties": { "exemptReason": true } }
|
|
454
|
+
},
|
|
455
|
+
"order.settled": {
|
|
456
|
+
"x-direction": "S2F",
|
|
457
|
+
"type": "object",
|
|
458
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
459
|
+
"required": ["type", "orderHash", "payout", "fee", "penaltyWithheld", "txRef"],
|
|
460
|
+
"properties": {
|
|
461
|
+
"type": { "const": "order.settled" },
|
|
462
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
463
|
+
"payout": { "$ref": "#/$defs/uintDec256" },
|
|
464
|
+
"fee": { "$ref": "#/$defs/uintDec256" },
|
|
465
|
+
"penaltyWithheld": { "$ref": "#/$defs/uintDec256" },
|
|
466
|
+
"txRef": { "type": "string", "minLength": 1 }
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"penalty.applied": {
|
|
470
|
+
"x-direction": "S2F",
|
|
471
|
+
"type": "object",
|
|
472
|
+
"allOf": [{ "$ref": "#/$defs/s2fBase" }],
|
|
473
|
+
"required": ["type", "violationId", "code", "step", "details"],
|
|
474
|
+
"properties": {
|
|
475
|
+
"type": { "const": "penalty.applied" },
|
|
476
|
+
"violationId": { "type": "string", "minLength": 1 },
|
|
477
|
+
"code": { "type": "string", "minLength": 1 },
|
|
478
|
+
"step": { "$ref": "#/$defs/penaltyStep" },
|
|
479
|
+
"details": { "type": "object" }
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
"fillProof": {
|
|
483
|
+
"type": "object",
|
|
484
|
+
"description": "FillProof as the source router hashes it (FILL_PROOF_TYPES, the twelve variant A fields, protocol §3.3), encoded per protocol §3.1: kind, attempt, setId JSON integers; amountDelivered, filledAt decimal strings; fillerId the on-chain form keccak256(utf8(fillerId))",
|
|
485
|
+
"required": ["kind", "orderHash", "destination", "fillRef", "recipient", "outputAsset", "amountDelivered", "filledAt", "fillerId", "repayTo", "attempt", "setId"],
|
|
486
|
+
"properties": {
|
|
487
|
+
"kind": { "$ref": "#/$defs/uint8" },
|
|
488
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
489
|
+
"destination": { "$ref": "#/$defs/bytes32" },
|
|
490
|
+
"fillRef": { "$ref": "#/$defs/bytes32" },
|
|
491
|
+
"recipient": { "$ref": "#/$defs/bytes32" },
|
|
492
|
+
"outputAsset": { "$ref": "#/$defs/bytes32" },
|
|
493
|
+
"amountDelivered": { "$ref": "#/$defs/uintDec256" },
|
|
494
|
+
"filledAt": { "$ref": "#/$defs/timeS" },
|
|
495
|
+
"fillerId": { "$ref": "#/$defs/bytes32", "description": "keccak256(utf8(fillerId)) of the filler that delivered: this filler's" },
|
|
496
|
+
"repayTo": { "$ref": "#/$defs/repayTo", "description": "the payee of settle, encoded for the source chain: the repayTo of this filler's ticket" },
|
|
497
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
498
|
+
"setId": { "$ref": "#/$defs/uint32" }
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
"attestationEvm": {
|
|
502
|
+
"type": "object",
|
|
503
|
+
"description": "One attestor signature for an EVM source: EIP-712 over FillProof in the source-router domain; in the payload's order the signature values are the sigs argument of settle",
|
|
504
|
+
"required": ["signer", "signature"],
|
|
505
|
+
"properties": { "signer": { "$ref": "#/$defs/address" }, "signature": { "$ref": "#/$defs/sig65" } }
|
|
506
|
+
},
|
|
507
|
+
"attestationCanton": {
|
|
508
|
+
"type": "object",
|
|
509
|
+
"description": "One attestor signature for a Canton source: the same digest, carried as SwapIntent_SettleWithProof takes it (SigEntry {pubKey, sig}; strip 0x for Daml). signer is the address Daml derives from pubKey",
|
|
510
|
+
"required": ["signer", "pubKey", "signature"],
|
|
511
|
+
"properties": {
|
|
512
|
+
"signer": { "$ref": "#/$defs/address" },
|
|
513
|
+
"pubKey": { "type": "string", "pattern": "^0x3056301006072a8648ce3d020106052b8104000a03420004[0-9a-f]{128}$", "description": "DER SubjectPublicKeyInfo of the uncompressed secp256k1 key (88 bytes), as KMS GetPublicKey returns it" },
|
|
514
|
+
"signature": { "type": "string", "pattern": "^0x30([0-9a-f]{2}){7,71}$", "description": "minimal DER ECDSA signature, low-s, no recovery byte" }
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"settle.attestations": {
|
|
518
|
+
"x-direction": "S2F",
|
|
519
|
+
"type": "object",
|
|
520
|
+
"description": "≥ threshold attestor signatures over the filler's FillProof (§10 D-N, S-13). Sent once per (orderHash, attempt); GET /v1/filler/attestations/{orderHash} serves the same payload. signatures: at least threshold entries, strictly ascending by signer (not expressible here; settleAttestationsErrors checks it). sourceChainId picks the entry form: eip155 → attestationEvm, canton → attestationCanton",
|
|
521
|
+
"allOf": [
|
|
522
|
+
{ "$ref": "#/$defs/s2fBase" },
|
|
523
|
+
{
|
|
524
|
+
"if": { "type": "object", "properties": { "sourceChainId": { "type": "string", "pattern": "^canton:" } }, "required": ["sourceChainId"] },
|
|
525
|
+
"then": { "type": "object", "properties": { "signatures": { "type": "array", "items": { "$ref": "#/$defs/attestationCanton" } } } },
|
|
526
|
+
"else": { "type": "object", "properties": { "signatures": { "type": "array", "items": { "$ref": "#/$defs/attestationEvm" } } } }
|
|
527
|
+
}
|
|
528
|
+
],
|
|
529
|
+
"required": ["type", "orderHash", "attempt", "sourceChainId", "proof", "signatures", "setId", "threshold", "refundAfter"],
|
|
530
|
+
"properties": {
|
|
531
|
+
"type": { "const": "settle.attestations" },
|
|
532
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
533
|
+
"attempt": { "$ref": "#/$defs/uint32", "description": "equals proof.attempt" },
|
|
534
|
+
"sourceChainId": { "$ref": "#/$defs/caip2", "description": "where settle is submitted" },
|
|
535
|
+
"proof": { "$ref": "#/$defs/fillProof" },
|
|
536
|
+
"signatures": { "type": "array", "minItems": 1 },
|
|
537
|
+
"setId": { "$ref": "#/$defs/uint32", "description": "equals proof.setId; EVM: attestationSetFor(orderHash)" },
|
|
538
|
+
"threshold": { "type": "integer", "minimum": 1, "maximum": 4294967295, "description": "k of that set" },
|
|
539
|
+
"refundAfter": { "$ref": "#/$defs/timeS", "description": "from this time settle reverts; the node gets its settle included before it" }
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
"cantonOp": {
|
|
543
|
+
"description": "A Canton operation of the filler's own external party on the Cancore participant (protocol §3.19): the backend prepares and submits it, the node signs it with its party key and never talks to a Ledger API. party.allocate creates the party (topology); registry.accept accepts the FillerRegistryEntryProposal of the fillerId; delivery.fill exercises DeliveryOrder_Fill of a Canton ticket issued to the filler; intent.settle exercises SwapIntent_SettleWithProof of a Canton-source order the filler delivered; holdings.transfer moves the party's own holdings to a party it names (TransferFactory_Transfer)",
|
|
544
|
+
"anyOf": [
|
|
545
|
+
{ "enum": ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer"] },
|
|
546
|
+
{ "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$" }
|
|
547
|
+
]
|
|
548
|
+
},
|
|
549
|
+
"operationId": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"pattern": "^[!-~]{1,64}$",
|
|
552
|
+
"description": "the handle canton.prepared hands out for canton.submit: opaque, 1..64 printable ASCII, valid until expiresAt"
|
|
553
|
+
},
|
|
554
|
+
"edPublicKey": { "type": "string", "pattern": "^0x[0-9a-f]{64}$", "description": "the raw 32-byte Ed25519 public key of the filler's Canton party, lowercase hex" },
|
|
555
|
+
"edSignature": { "type": "string", "pattern": "^0x[0-9a-f]{128}$", "description": "64-byte Ed25519 signature by the party key over the bytes of a leg's hash, lowercase hex" },
|
|
556
|
+
"cantonLegTransaction": {
|
|
557
|
+
"type": "object",
|
|
558
|
+
"description": "A prepared Canton transaction to sign. MUST before signing (protocol §3.19): the node recomputes `hash` from `preparedTransaction` with the participant's prepared-transaction hashing of `hashingSchemeVersion`, decodes the transaction and checks it against `summary` for the op of the message — template and choice, acting and receiving parties, instrument, amount; on any difference it does not sign. It signs the 32 hash bytes with its party key",
|
|
559
|
+
"required": ["legId", "kind", "hash", "preparedTransaction", "hashingSchemeVersion"],
|
|
560
|
+
"properties": {
|
|
561
|
+
"legId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
562
|
+
"kind": { "const": "transaction" },
|
|
563
|
+
"hash": { "type": "string", "pattern": "^0x[0-9a-f]{64}$", "description": "the 32-byte prepared-transaction hash" },
|
|
564
|
+
"preparedTransaction": {
|
|
565
|
+
"type": "string",
|
|
566
|
+
"minLength": 1,
|
|
567
|
+
"pattern": "^[A-Za-z0-9+/]+={0,2}$",
|
|
568
|
+
"description": "the prepared transaction (base64 protobuf) the hash is over. Never logged"
|
|
569
|
+
},
|
|
570
|
+
"hashingSchemeVersion": {
|
|
571
|
+
"type": "string",
|
|
572
|
+
"pattern": "^HASHING_SCHEME_VERSION_V[0-9]+$",
|
|
573
|
+
"description": "the participant's prepared-transaction hashing scheme the hash was computed with"
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"cantonLegTopology": {
|
|
578
|
+
"type": "object",
|
|
579
|
+
"description": "The onboarding topology of the filler's party, in `party.allocate` only (a topology leg in any other op is refused by the schema). MUST before signing (protocol §3.19): the node recomputes the multihash over `topologyTransactions` and checks that they create the party of `summary.partyId` with the key of `summary.publicKey` as its only signing key, hosted on the Cancore participant; on any difference it does not sign. It signs the 34 multihash bytes with its party key",
|
|
580
|
+
"required": ["legId", "kind", "hash", "topologyTransactions"],
|
|
581
|
+
"properties": {
|
|
582
|
+
"legId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
583
|
+
"kind": { "const": "topology" },
|
|
584
|
+
"hash": { "type": "string", "pattern": "^0x1220[0-9a-f]{64}$", "description": "the topology multihash: 0x1220 ‖ sha256" },
|
|
585
|
+
"topologyTransactions": {
|
|
586
|
+
"type": "array",
|
|
587
|
+
"minItems": 1,
|
|
588
|
+
"items": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9+/]+={0,2}$" },
|
|
589
|
+
"description": "the topology transactions (base64 protobuf) the multihash is over, in order"
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
"cantonSignature": {
|
|
594
|
+
"type": "object",
|
|
595
|
+
"required": ["legId", "signature"],
|
|
596
|
+
"properties": { "legId": { "type": "string", "minLength": 1, "maxLength": 128 }, "signature": { "$ref": "#/$defs/edSignature" } }
|
|
597
|
+
},
|
|
598
|
+
"canton.prepare": {
|
|
599
|
+
"x-direction": "F2S",
|
|
600
|
+
"type": "object",
|
|
601
|
+
"description": "Prepare a Canton operation of the sender's own party (§3.19); answered by canton.prepared (re = this id) or error. params select the operation only: the backend picks every contract itself (holdings, delivery order, intent, registry entry, disclosed contracts, attestor signatures). Admission: party.allocate — the fillerId has no party yet, or this key's party; registry.accept — a proposal for the fillerId and its party is live; delivery.fill — an ISSUED Canton ticket of this filler for (orderHash, attempt), before validUntil; intent.settle — a Canton-source order this filler delivered, with attestations held; holdings.transfer — enough unlocked holdings of the asset beyond what the party's open delivery orders need, to a party other than its own. Each prepare prepares afresh and replaces the filler's open operation of the same op and target",
|
|
602
|
+
"allOf": [
|
|
603
|
+
{ "$ref": "#/$defs/f2sBase" },
|
|
604
|
+
{
|
|
605
|
+
"if": { "type": "object", "properties": { "op": { "const": "party.allocate" } }, "required": ["op"] },
|
|
606
|
+
"then": {
|
|
607
|
+
"type": "object",
|
|
608
|
+
"required": ["params"],
|
|
609
|
+
"properties": { "params": { "type": "object", "required": ["publicKey"], "properties": { "publicKey": { "$ref": "#/$defs/edPublicKey" } } } }
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"if": { "type": "object", "properties": { "op": { "const": "registry.accept" } }, "required": ["op"] },
|
|
614
|
+
"then": { "type": "object", "required": ["params"], "properties": { "params": { "type": "object" } } }
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"if": { "type": "object", "properties": { "op": { "const": "delivery.fill" } }, "required": ["op"] },
|
|
618
|
+
"then": {
|
|
619
|
+
"type": "object",
|
|
620
|
+
"required": ["params"],
|
|
621
|
+
"properties": {
|
|
622
|
+
"params": {
|
|
623
|
+
"type": "object",
|
|
624
|
+
"required": ["orderHash", "attempt"],
|
|
625
|
+
"properties": { "orderHash": { "$ref": "#/$defs/bytes32" }, "attempt": { "$ref": "#/$defs/uint32" } }
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"if": { "type": "object", "properties": { "op": { "const": "intent.settle" } }, "required": ["op"] },
|
|
632
|
+
"then": {
|
|
633
|
+
"type": "object",
|
|
634
|
+
"required": ["params"],
|
|
635
|
+
"properties": { "params": { "type": "object", "required": ["orderHash"], "properties": { "orderHash": { "$ref": "#/$defs/bytes32" } } } }
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"if": { "type": "object", "properties": { "op": { "const": "holdings.transfer" } }, "required": ["op"] },
|
|
640
|
+
"then": {
|
|
641
|
+
"type": "object",
|
|
642
|
+
"required": ["params"],
|
|
643
|
+
"properties": {
|
|
644
|
+
"params": {
|
|
645
|
+
"type": "object",
|
|
646
|
+
"required": ["asset", "amount", "toParty"],
|
|
647
|
+
"properties": {
|
|
648
|
+
"asset": { "$ref": "#/$defs/cantonAsset" },
|
|
649
|
+
"amount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$", "description": "Daml Decimal, > 0" },
|
|
650
|
+
"toParty": { "type": "string", "minLength": 1, "maxLength": 255, "description": "the receiving Canton party; never the filler's own" }
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
],
|
|
657
|
+
"required": ["type", "op", "params"],
|
|
658
|
+
"properties": { "type": { "const": "canton.prepare" }, "op": { "$ref": "#/$defs/cantonOp" }, "params": { "type": "object" } }
|
|
659
|
+
},
|
|
660
|
+
"canton.prepared": {
|
|
661
|
+
"x-direction": "S2F",
|
|
662
|
+
"type": "object",
|
|
663
|
+
"description": "A prepared operation. The node MUST verify every leg before it signs it (cantonLegTransaction, cantonLegTopology): what it signs is what Cancore assembled, and summary is only what Cancore says about it — a leg that does not match summary, or summary that does not match what the node expects of the op, is not signed. Topology legs come with party.allocate only; every other op prepares transactions. Then the node signs every leg's hash with its party key and sends canton.submit before expiresAt. An operationId stays valid until its own expiresAt whatever is prepared after it",
|
|
664
|
+
"allOf": [
|
|
665
|
+
{ "$ref": "#/$defs/s2fBase" },
|
|
666
|
+
{
|
|
667
|
+
"if": { "type": "object", "properties": { "op": { "const": "party.allocate" } }, "required": ["op"] },
|
|
668
|
+
"then": { "type": "object", "properties": { "legs": { "type": "array", "items": { "$ref": "#/$defs/cantonLegTopology" } } } },
|
|
669
|
+
"else": { "type": "object", "properties": { "legs": { "type": "array", "items": { "$ref": "#/$defs/cantonLegTransaction" } } } }
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"if": { "type": "object", "properties": { "op": { "const": "party.allocate" } }, "required": ["op"] },
|
|
673
|
+
"then": {
|
|
674
|
+
"type": "object",
|
|
675
|
+
"required": ["summary"],
|
|
676
|
+
"properties": {
|
|
677
|
+
"summary": {
|
|
678
|
+
"type": "object",
|
|
679
|
+
"required": ["partyId", "publicKey", "hosting"],
|
|
680
|
+
"properties": {
|
|
681
|
+
"partyId": { "type": "string", "minLength": 1 },
|
|
682
|
+
"publicKey": { "$ref": "#/$defs/edPublicKey" },
|
|
683
|
+
"hosting": {
|
|
684
|
+
"type": "object",
|
|
685
|
+
"required": ["participantUid", "permission", "threshold"],
|
|
686
|
+
"description": "how the topology hosts the party: on the Cancore participant alone, with Confirmation permission, threshold 1 — the node checks the decoded topology against it",
|
|
687
|
+
"properties": { "participantUid": { "type": "string", "minLength": 1 }, "permission": { "const": "CONFIRMATION" }, "threshold": { "const": 1 } }
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"if": { "type": "object", "properties": { "op": { "const": "registry.accept" } }, "required": ["op"] },
|
|
696
|
+
"then": {
|
|
697
|
+
"type": "object",
|
|
698
|
+
"required": ["summary"],
|
|
699
|
+
"properties": {
|
|
700
|
+
"summary": {
|
|
701
|
+
"type": "object",
|
|
702
|
+
"required": ["fillerId", "party", "operator", "proposalCid"],
|
|
703
|
+
"properties": {
|
|
704
|
+
"fillerId": { "$ref": "#/$defs/fillerId" },
|
|
705
|
+
"party": { "type": "string", "minLength": 1 },
|
|
706
|
+
"operator": { "type": "string", "minLength": 1 },
|
|
707
|
+
"proposalCid": { "type": "string", "minLength": 1 }
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"if": { "type": "object", "properties": { "op": { "const": "delivery.fill" } }, "required": ["op"] },
|
|
715
|
+
"then": {
|
|
716
|
+
"type": "object",
|
|
717
|
+
"required": ["summary"],
|
|
718
|
+
"properties": {
|
|
719
|
+
"summary": {
|
|
720
|
+
"type": "object",
|
|
721
|
+
"required": [
|
|
722
|
+
"orderHash",
|
|
723
|
+
"attempt",
|
|
724
|
+
"deliveryOrderCid",
|
|
725
|
+
"recipient",
|
|
726
|
+
"asset",
|
|
727
|
+
"amount",
|
|
728
|
+
"repayTo",
|
|
729
|
+
"validUntil",
|
|
730
|
+
"inputHoldingCids",
|
|
731
|
+
"executeBefore",
|
|
732
|
+
"transferFactoryCid"
|
|
733
|
+
],
|
|
734
|
+
"properties": {
|
|
735
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
736
|
+
"attempt": { "$ref": "#/$defs/uint32" },
|
|
737
|
+
"deliveryOrderCid": { "type": "string", "minLength": 1 },
|
|
738
|
+
"recipient": { "type": "string", "minLength": 1, "description": "the Canton party the order delivers to" },
|
|
739
|
+
"asset": { "$ref": "#/$defs/cantonAsset" },
|
|
740
|
+
"amount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$", "description": "DeliveryOrder.amount, Daml Decimal" },
|
|
741
|
+
"repayTo": { "$ref": "#/$defs/repayTo" },
|
|
742
|
+
"validUntil": { "$ref": "#/$defs/timeS" },
|
|
743
|
+
"inputHoldingCids": {
|
|
744
|
+
"type": "array",
|
|
745
|
+
"minItems": 1,
|
|
746
|
+
"items": { "type": "string", "minLength": 1 },
|
|
747
|
+
"description": "the party's holdings the transfer spends; whatever they hold beyond amount comes back as change"
|
|
748
|
+
},
|
|
749
|
+
"executeBefore": { "$ref": "#/$defs/timeS", "description": "the transfer's executeBefore: the order's fillDeadline" },
|
|
750
|
+
"transferFactoryCid": { "type": "string", "minLength": 1, "description": "the registry factory the order pins" }
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"if": { "type": "object", "properties": { "op": { "const": "intent.settle" } }, "required": ["op"] },
|
|
758
|
+
"then": {
|
|
759
|
+
"type": "object",
|
|
760
|
+
"required": ["summary"],
|
|
761
|
+
"properties": {
|
|
762
|
+
"summary": {
|
|
763
|
+
"type": "object",
|
|
764
|
+
"required": ["orderHash", "intentCid", "asset", "amount", "executeBefore", "payee", "giveAmount", "fee"],
|
|
765
|
+
"properties": {
|
|
766
|
+
"orderHash": { "$ref": "#/$defs/bytes32" },
|
|
767
|
+
"intentCid": { "type": "string", "minLength": 1 },
|
|
768
|
+
"asset": { "$ref": "#/$defs/cantonAsset" },
|
|
769
|
+
"amount": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$",
|
|
772
|
+
"description": "what the settlement pays the payee: giveAmount less fee.amount, Daml Decimal"
|
|
773
|
+
},
|
|
774
|
+
"executeBefore": { "$ref": "#/$defs/timeS" },
|
|
775
|
+
"payee": { "type": "string", "minLength": 1, "description": "the party paid: the filler's own" },
|
|
776
|
+
"giveAmount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$", "description": "the intent's committed give, fee-inclusive" },
|
|
777
|
+
"fee": {
|
|
778
|
+
"type": "object",
|
|
779
|
+
"required": ["receiver", "amount"],
|
|
780
|
+
"properties": {
|
|
781
|
+
"receiver": { "type": "string", "minLength": 1, "description": "the operator party" },
|
|
782
|
+
"amount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$" }
|
|
783
|
+
},
|
|
784
|
+
"description": "the settlement's fee leg; amount 0 when there is none"
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"if": { "type": "object", "properties": { "op": { "const": "holdings.transfer" } }, "required": ["op"] },
|
|
793
|
+
"then": {
|
|
794
|
+
"type": "object",
|
|
795
|
+
"required": ["summary"],
|
|
796
|
+
"properties": {
|
|
797
|
+
"summary": {
|
|
798
|
+
"type": "object",
|
|
799
|
+
"required": ["asset", "amount", "receiver", "inputHoldingCids", "executeBefore"],
|
|
800
|
+
"properties": {
|
|
801
|
+
"asset": { "$ref": "#/$defs/cantonAsset" },
|
|
802
|
+
"amount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$" },
|
|
803
|
+
"receiver": { "type": "string", "minLength": 1 },
|
|
804
|
+
"inputHoldingCids": {
|
|
805
|
+
"type": "array",
|
|
806
|
+
"minItems": 1,
|
|
807
|
+
"items": { "type": "string", "minLength": 1 },
|
|
808
|
+
"description": "the party's holdings the transfer spends; what they hold beyond amount comes back as change"
|
|
809
|
+
},
|
|
810
|
+
"executeBefore": { "$ref": "#/$defs/timeS" }
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
],
|
|
817
|
+
"required": ["type", "re", "operationId", "op", "legs", "summary", "expiresAt"],
|
|
818
|
+
"properties": {
|
|
819
|
+
"type": { "const": "canton.prepared" },
|
|
820
|
+
"re": { "$ref": "#/$defs/messageId" },
|
|
821
|
+
"operationId": { "$ref": "#/$defs/operationId" },
|
|
822
|
+
"op": { "$ref": "#/$defs/cantonOp" },
|
|
823
|
+
"legs": { "type": "array", "minItems": 1 },
|
|
824
|
+
"summary": { "type": "object" },
|
|
825
|
+
"expiresAt": { "$ref": "#/$defs/timeMs" }
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
"canton.submit": {
|
|
829
|
+
"x-direction": "F2S",
|
|
830
|
+
"type": "object",
|
|
831
|
+
"description": "Submit a prepared operation: one party-key signature per leg. Idempotent per operationId: a repeat (after a lost answer or CANTON_UNAVAILABLE) is answered with the same canton.submitted and never executes twice. OPERATION_EXPIRED: prepare again",
|
|
832
|
+
"allOf": [{ "$ref": "#/$defs/f2sBase" }],
|
|
833
|
+
"required": ["type", "operationId", "signatures"],
|
|
834
|
+
"properties": {
|
|
835
|
+
"type": { "const": "canton.submit" },
|
|
836
|
+
"operationId": { "$ref": "#/$defs/operationId" },
|
|
837
|
+
"signatures": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/cantonSignature" } }
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
"canton.submitted": {
|
|
841
|
+
"x-direction": "S2F",
|
|
842
|
+
"type": "object",
|
|
843
|
+
"description": "The operation committed. updateId is its Canton update (absent for party.allocate, a topology change); result names what it created, by op",
|
|
844
|
+
"allOf": [
|
|
845
|
+
{ "$ref": "#/$defs/s2fBase" },
|
|
846
|
+
{
|
|
847
|
+
"if": { "type": "object", "properties": { "op": { "const": "party.allocate" } }, "required": ["op"] },
|
|
848
|
+
"then": {
|
|
849
|
+
"type": "object",
|
|
850
|
+
"required": ["result"],
|
|
851
|
+
"properties": { "result": { "type": "object", "required": ["partyId"], "properties": { "partyId": { "type": "string", "minLength": 1 } } } }
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"if": { "type": "object", "properties": { "op": { "const": "registry.accept" } }, "required": ["op"] },
|
|
856
|
+
"then": {
|
|
857
|
+
"type": "object",
|
|
858
|
+
"required": ["result"],
|
|
859
|
+
"properties": { "result": { "type": "object", "required": ["entryCid"], "properties": { "entryCid": { "type": "string", "minLength": 1 } } } }
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"if": { "type": "object", "properties": { "op": { "const": "delivery.fill" } }, "required": ["op"] },
|
|
864
|
+
"then": {
|
|
865
|
+
"type": "object",
|
|
866
|
+
"required": ["result"],
|
|
867
|
+
"properties": { "result": { "type": "object", "required": ["receiptCid"], "properties": { "receiptCid": { "type": "string", "minLength": 1 } } } }
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
"if": { "type": "object", "properties": { "op": { "const": "intent.settle" } }, "required": ["op"] },
|
|
872
|
+
"then": { "type": "object", "required": ["result"], "properties": { "result": { "type": "object" } } }
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
"if": { "type": "object", "properties": { "op": { "const": "holdings.transfer" } }, "required": ["op"] },
|
|
876
|
+
"then": {
|
|
877
|
+
"type": "object",
|
|
878
|
+
"required": ["result"],
|
|
879
|
+
"properties": {
|
|
880
|
+
"result": {
|
|
881
|
+
"type": "object",
|
|
882
|
+
"required": ["outcome"],
|
|
883
|
+
"properties": {
|
|
884
|
+
"outcome": {
|
|
885
|
+
"anyOf": [{ "enum": ["COMPLETED", "PENDING"] }, { "$ref": "#/$defs/futureEnumValue" }],
|
|
886
|
+
"description": "COMPLETED: the receiver holds it (a preapproval accepted it); PENDING: a TransferInstruction waits for the receiver to accept"
|
|
887
|
+
},
|
|
888
|
+
"transferInstructionCid": { "type": "string", "minLength": 1, "description": "with PENDING" }
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
],
|
|
895
|
+
"required": ["type", "re", "operationId", "op", "result"],
|
|
896
|
+
"properties": {
|
|
897
|
+
"type": { "const": "canton.submitted" },
|
|
898
|
+
"re": { "$ref": "#/$defs/messageId" },
|
|
899
|
+
"operationId": { "$ref": "#/$defs/operationId" },
|
|
900
|
+
"op": { "$ref": "#/$defs/cantonOp" },
|
|
901
|
+
"updateId": { "type": "string", "minLength": 1 },
|
|
902
|
+
"result": { "type": "object" }
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|