@cancore/contracts 0.2.0-rc.14 → 0.2.0-rc.17
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 +37 -10
- package/dist/index.d.ts +113 -7
- package/dist/index.js +244 -14
- package/dist/index.js.map +1 -1
- package/dist/networks.d.ts +2 -1
- package/package.json +1 -1
- package/spec/constants.json +1 -1
- package/spec/protocol/asyncapi.json +62 -1
- package/spec/protocol/messages.schema.json +85 -5
- package/spec/protocol/rest.schema.json +89 -3
- package/spec/protocol/vectors/messages.json +99 -1
package/dist/index.js
CHANGED
|
@@ -760,7 +760,8 @@ var ERROR_CODES = [
|
|
|
760
760
|
"CANTON_NOT_READY",
|
|
761
761
|
"CANTON_REFUSED",
|
|
762
762
|
"CANTON_UNAVAILABLE",
|
|
763
|
-
"OPERATION_EXPIRED"
|
|
763
|
+
"OPERATION_EXPIRED",
|
|
764
|
+
"ROUTE_NOT_APPROVED"
|
|
764
765
|
];
|
|
765
766
|
var ERROR_HTTP_STATUS = {
|
|
766
767
|
BAD_REQUEST: 400,
|
|
@@ -781,7 +782,8 @@ var ERROR_HTTP_STATUS = {
|
|
|
781
782
|
CANTON_NOT_READY: 409,
|
|
782
783
|
CANTON_REFUSED: 422,
|
|
783
784
|
CANTON_UNAVAILABLE: 503,
|
|
784
|
-
OPERATION_EXPIRED: 410
|
|
785
|
+
OPERATION_EXPIRED: 410,
|
|
786
|
+
ROUTE_NOT_APPROVED: 403
|
|
785
787
|
};
|
|
786
788
|
var TICKET_REFUSED_REASONS = [
|
|
787
789
|
"REPAY_TO_INVALID",
|
|
@@ -799,10 +801,10 @@ var EXPIRED_RESULTS = ["FILLED", "NO_SHOW", "NO_SHOW_UNCONFIRMED", "EXEMPT"];
|
|
|
799
801
|
var EXEMPT_REASONS = ["DESTINATION_HALTED", "GATEWAY_FAULT", "REORGED_AFTER_INCLUSION", "RECIPIENT_NOT_READY", "OTHER"];
|
|
800
802
|
var QUOTE_ACK_STATUSES = ["COUNTED", "LATE", "SHORT_TTL"];
|
|
801
803
|
var QUOTE_FINAL_STATUSES = [...QUOTE_ACK_STATUSES, "REPLACED", "BAD_SIG", "OUTLIER", "IN_BAND", "OUT_OF_BAND", "WON", "LOST"];
|
|
802
|
-
var PENALTY_STEPS = ["
|
|
804
|
+
var PENALTY_STEPS = ["RECORDED", "BANNED", "UNBANNED"];
|
|
803
805
|
var DRAW_CLOSED_BY = ["OFFER_TIMEOUT", "OFFER_DECLINE", "TICKET_DECLINE", "TICKET_EXPIRED", "FILLED"];
|
|
804
806
|
var TICKET_LIST_STATUSES = ["OFFERED", "ISSUED"];
|
|
805
|
-
var CANTON_OPS = ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer"];
|
|
807
|
+
var CANTON_OPS = ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer", "preapproval.create"];
|
|
806
808
|
var CANTON_TRANSFER_OUTCOMES = ["COMPLETED", "PENDING"];
|
|
807
809
|
var CANTON_LEG_KINDS = ["transaction", "topology"];
|
|
808
810
|
var CANTON_REGISTRY_STATES = ["NONE", "PROPOSED", "ACTIVE", "REMOVED"];
|
|
@@ -2018,7 +2020,7 @@ var asyncapi_default = {
|
|
|
2018
2020
|
sentAt: 1790001e6,
|
|
2019
2021
|
violationId: "v-1",
|
|
2020
2022
|
code: "NO_SHOW",
|
|
2021
|
-
step: "
|
|
2023
|
+
step: "RECORDED",
|
|
2022
2024
|
details: {
|
|
2023
2025
|
orderHash: "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b",
|
|
2024
2026
|
attempt: 0
|
|
@@ -2209,6 +2211,20 @@ var asyncapi_default = {
|
|
|
2209
2211
|
toParty: "alice::1220f0e1d2c3b4a5968778695a4b3c2d1e0ff0e1d2c3b4a5968778695a4b3c2d1e0f"
|
|
2210
2212
|
}
|
|
2211
2213
|
}
|
|
2214
|
+
},
|
|
2215
|
+
{
|
|
2216
|
+
name: "canton-prepare-6",
|
|
2217
|
+
payload: {
|
|
2218
|
+
type: "canton.prepare",
|
|
2219
|
+
id: "cp-6",
|
|
2220
|
+
fillerId: "acme-markets",
|
|
2221
|
+
sentAt: 17899902e5,
|
|
2222
|
+
msgSig: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
2223
|
+
op: "preapproval.create",
|
|
2224
|
+
params: {
|
|
2225
|
+
admin: "cancore-registry::1220aa"
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2212
2228
|
}
|
|
2213
2229
|
]
|
|
2214
2230
|
},
|
|
@@ -2297,6 +2313,36 @@ var asyncapi_default = {
|
|
|
2297
2313
|
},
|
|
2298
2314
|
expiresAt: 1790000326300
|
|
2299
2315
|
}
|
|
2316
|
+
},
|
|
2317
|
+
{
|
|
2318
|
+
name: "canton-prepared-3",
|
|
2319
|
+
payload: {
|
|
2320
|
+
type: "canton.prepared",
|
|
2321
|
+
id: "g-25",
|
|
2322
|
+
fillerId: "acme-markets",
|
|
2323
|
+
sig: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
2324
|
+
sentAt: 1789990200200,
|
|
2325
|
+
re: "cp-6",
|
|
2326
|
+
operationId: "op-6",
|
|
2327
|
+
op: "preapproval.create",
|
|
2328
|
+
legs: [
|
|
2329
|
+
{
|
|
2330
|
+
legId: "preapproval-create-0",
|
|
2331
|
+
kind: "transaction",
|
|
2332
|
+
hash: "0x71bb89bb58a7348d8860b4a84b1e598fc03e1368f144ef24d1cc9e292a1be331",
|
|
2333
|
+
preparedTransaction: "CgMyLjESBTAuMC4x",
|
|
2334
|
+
hashingSchemeVersion: "HASHING_SCHEME_VERSION_V2"
|
|
2335
|
+
}
|
|
2336
|
+
],
|
|
2337
|
+
summary: {
|
|
2338
|
+
party: "acme-markets::1220a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90",
|
|
2339
|
+
admin: "cancore-registry::1220aa",
|
|
2340
|
+
instrumentAllowances: [],
|
|
2341
|
+
requestedAt: "1789990200",
|
|
2342
|
+
executeBefore: "1821526200"
|
|
2343
|
+
},
|
|
2344
|
+
expiresAt: 1789990500200
|
|
2345
|
+
}
|
|
2300
2346
|
}
|
|
2301
2347
|
]
|
|
2302
2348
|
},
|
|
@@ -2389,6 +2435,23 @@ var asyncapi_default = {
|
|
|
2389
2435
|
transferInstructionCid: "00ti"
|
|
2390
2436
|
}
|
|
2391
2437
|
}
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
name: "canton-submitted-4",
|
|
2441
|
+
payload: {
|
|
2442
|
+
type: "canton.submitted",
|
|
2443
|
+
id: "g-26",
|
|
2444
|
+
fillerId: "acme-markets",
|
|
2445
|
+
sig: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b",
|
|
2446
|
+
sentAt: 1789990202e3,
|
|
2447
|
+
re: "cs-6",
|
|
2448
|
+
operationId: "op-6",
|
|
2449
|
+
op: "preapproval.create",
|
|
2450
|
+
updateId: "1220ab0e",
|
|
2451
|
+
result: {
|
|
2452
|
+
preapprovalCid: "00pa"
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2392
2455
|
}
|
|
2393
2456
|
]
|
|
2394
2457
|
}
|
|
@@ -2471,7 +2534,7 @@ var messages_schema_default = {
|
|
|
2471
2534
|
},
|
|
2472
2535
|
errorCode: {
|
|
2473
2536
|
anyOf: [
|
|
2474
|
-
{ 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"] },
|
|
2537
|
+
{ 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", "ROUTE_NOT_APPROVED"] },
|
|
2475
2538
|
{ $ref: "#/$defs/futureEnumValue" }
|
|
2476
2539
|
]
|
|
2477
2540
|
},
|
|
@@ -2485,7 +2548,7 @@ var messages_schema_default = {
|
|
|
2485
2548
|
expiredResult: { anyOf: [{ enum: ["FILLED", "NO_SHOW", "NO_SHOW_UNCONFIRMED", "EXEMPT"] }, { $ref: "#/$defs/futureEnumValue" }] },
|
|
2486
2549
|
exemptReason: { anyOf: [{ enum: ["DESTINATION_HALTED", "GATEWAY_FAULT", "REORGED_AFTER_INCLUSION", "RECIPIENT_NOT_READY", "OTHER"] }, { $ref: "#/$defs/futureEnumValue" }] },
|
|
2487
2550
|
quoteAckStatus: { anyOf: [{ enum: ["COUNTED", "LATE", "SHORT_TTL"] }, { $ref: "#/$defs/futureEnumValue" }], description: "verdict at receipt time; the final status is on GET /v1/filler/quotes" },
|
|
2488
|
-
penaltyStep: { anyOf: [{ enum: ["
|
|
2551
|
+
penaltyStep: { anyOf: [{ enum: ["RECORDED", "BANNED", "UNBANNED"] }, { $ref: "#/$defs/futureEnumValue" }] },
|
|
2489
2552
|
s2fEnvelope: {
|
|
2490
2553
|
type: "object",
|
|
2491
2554
|
required: ["type", "id", "sentAt", "sig"],
|
|
@@ -2939,9 +3002,9 @@ var messages_schema_default = {
|
|
|
2939
3002
|
}
|
|
2940
3003
|
},
|
|
2941
3004
|
cantonOp: {
|
|
2942
|
-
description: "A Canton operation of the filler's own external party on the Cancore participant (protocol \xA73.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)",
|
|
3005
|
+
description: "A Canton operation of the filler's own external party on the Cancore participant (protocol \xA73.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); preapproval.create gives the party a transfer preapproval with the registry of an instrument admin, so transfers to it complete at once",
|
|
2943
3006
|
anyOf: [
|
|
2944
|
-
{ enum: ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer"] },
|
|
3007
|
+
{ enum: ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer", "preapproval.create"] },
|
|
2945
3008
|
{ type: "string", pattern: "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$" }
|
|
2946
3009
|
]
|
|
2947
3010
|
},
|
|
@@ -2997,7 +3060,7 @@ var messages_schema_default = {
|
|
|
2997
3060
|
"canton.prepare": {
|
|
2998
3061
|
"x-direction": "F2S",
|
|
2999
3062
|
type: "object",
|
|
3000
|
-
description: "Prepare a Canton operation of the sender's own party (\xA73.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 \u2014 the fillerId has no party yet, or this key's party; registry.accept \u2014 a proposal for the fillerId and its party is live; delivery.fill \u2014 an ISSUED Canton ticket of this filler for (orderHash, attempt), before validUntil; intent.settle \u2014 a Canton-source order this filler delivered, with attestations held; holdings.transfer \u2014 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",
|
|
3063
|
+
description: "Prepare a Canton operation of the sender's own party (\xA73.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 \u2014 the fillerId has no party yet, or this key's party; registry.accept \u2014 a proposal for the fillerId and its party is live; delivery.fill \u2014 an ISSUED Canton ticket of this filler for (orderHash, attempt), before validUntil; intent.settle \u2014 a Canton-source order this filler delivered, with attestations held; holdings.transfer \u2014 enough unlocked holdings of the asset beyond what the party's open delivery orders need, to a party other than its own; preapproval.create \u2014 a registry admin Cancore serves and no live preapproval of the party with it. Each prepare prepares afresh and replaces the filler's open operation of the same op and target",
|
|
3001
3064
|
allOf: [
|
|
3002
3065
|
{ $ref: "#/$defs/f2sBase" },
|
|
3003
3066
|
{
|
|
@@ -3051,6 +3114,20 @@ var messages_schema_default = {
|
|
|
3051
3114
|
}
|
|
3052
3115
|
}
|
|
3053
3116
|
}
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
if: { type: "object", properties: { op: { const: "preapproval.create" } }, required: ["op"] },
|
|
3120
|
+
then: {
|
|
3121
|
+
type: "object",
|
|
3122
|
+
required: ["params"],
|
|
3123
|
+
properties: {
|
|
3124
|
+
params: {
|
|
3125
|
+
type: "object",
|
|
3126
|
+
required: ["admin"],
|
|
3127
|
+
properties: { admin: { type: "string", minLength: 1, maxLength: 255, description: "the instrument admin whose registry the preapproval is with" } }
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3054
3131
|
}
|
|
3055
3132
|
],
|
|
3056
3133
|
required: ["type", "op", "params"],
|
|
@@ -3211,6 +3288,26 @@ var messages_schema_default = {
|
|
|
3211
3288
|
}
|
|
3212
3289
|
}
|
|
3213
3290
|
}
|
|
3291
|
+
},
|
|
3292
|
+
{
|
|
3293
|
+
if: { type: "object", properties: { op: { const: "preapproval.create" } }, required: ["op"] },
|
|
3294
|
+
then: {
|
|
3295
|
+
type: "object",
|
|
3296
|
+
required: ["summary"],
|
|
3297
|
+
properties: {
|
|
3298
|
+
summary: {
|
|
3299
|
+
type: "object",
|
|
3300
|
+
required: ["party", "admin", "instrumentAllowances", "requestedAt", "executeBefore"],
|
|
3301
|
+
properties: {
|
|
3302
|
+
party: { type: "string", minLength: 1, description: "the receiver: the filler's own party" },
|
|
3303
|
+
admin: { type: "string", minLength: 1, description: "the registry's instrument admin, as asked" },
|
|
3304
|
+
instrumentAllowances: { type: "array", maxItems: 10, items: { type: "string", minLength: 1 }, description: "instrument ids it is limited to; empty: every instrument of the admin" },
|
|
3305
|
+
requestedAt: { $ref: "#/$defs/timeS", description: "unix s: the Daml Time (microseconds) cut to whole seconds" },
|
|
3306
|
+
executeBefore: { $ref: "#/$defs/timeS", description: "unix s, cut likewise: the preapproval expires then" }
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3214
3311
|
}
|
|
3215
3312
|
],
|
|
3216
3313
|
required: ["type", "re", "operationId", "op", "legs", "summary", "expiresAt"],
|
|
@@ -3289,6 +3386,14 @@ var messages_schema_default = {
|
|
|
3289
3386
|
}
|
|
3290
3387
|
}
|
|
3291
3388
|
}
|
|
3389
|
+
},
|
|
3390
|
+
{
|
|
3391
|
+
if: { type: "object", properties: { op: { const: "preapproval.create" } }, required: ["op"] },
|
|
3392
|
+
then: {
|
|
3393
|
+
type: "object",
|
|
3394
|
+
required: ["result"],
|
|
3395
|
+
properties: { result: { type: "object", required: ["preapprovalCid"], properties: { preapprovalCid: { type: "string", minLength: 1 } } } }
|
|
3396
|
+
}
|
|
3292
3397
|
}
|
|
3293
3398
|
],
|
|
3294
3399
|
required: ["type", "re", "operationId", "op", "result"],
|
|
@@ -3300,6 +3405,44 @@ var messages_schema_default = {
|
|
|
3300
3405
|
updateId: { type: "string", minLength: 1 },
|
|
3301
3406
|
result: { type: "object" }
|
|
3302
3407
|
}
|
|
3408
|
+
},
|
|
3409
|
+
routeRef: {
|
|
3410
|
+
type: "object",
|
|
3411
|
+
description: "A route of the catalogue (GET /v1/intents/routes): CAIP-2 source and destination",
|
|
3412
|
+
required: ["src", "dst"],
|
|
3413
|
+
properties: { src: { $ref: "#/$defs/caip2" }, dst: { $ref: "#/$defs/caip2" } }
|
|
3414
|
+
},
|
|
3415
|
+
"routes.set": {
|
|
3416
|
+
"x-direction": "F2S",
|
|
3417
|
+
"x-rest-only": true,
|
|
3418
|
+
type: "object",
|
|
3419
|
+
description: "The routes the filler serves from now on (protocol \xA73.20): the body of POST /v1/filler/routes. The full list: a route Cancore approved for the filler and not listed here is switched off, a listed one switched on. Every listed route must be approved for the filler (filler_routes enabled by staff), else the whole request is refused ROUTE_NOT_APPROVED and nothing changes. An empty list switches every route off",
|
|
3420
|
+
allOf: [{ $ref: "#/$defs/f2sBase" }],
|
|
3421
|
+
required: ["type", "routes"],
|
|
3422
|
+
properties: {
|
|
3423
|
+
type: { const: "routes.set" },
|
|
3424
|
+
routes: { type: "array", maxItems: 50, uniqueItems: true, items: { $ref: "#/$defs/routeRef" } }
|
|
3425
|
+
}
|
|
3426
|
+
},
|
|
3427
|
+
"routes.state": {
|
|
3428
|
+
"x-direction": "S2F",
|
|
3429
|
+
"x-rest-only": true,
|
|
3430
|
+
type: "object",
|
|
3431
|
+
description: "Every route Cancore approved for the filler and whether the filler serves it now (active): the 200 body of GET and POST /v1/filler/routes. The filler is asked for quotes on a route only while it is approved and active",
|
|
3432
|
+
allOf: [{ $ref: "#/$defs/s2fBase" }],
|
|
3433
|
+
required: ["type", "routes"],
|
|
3434
|
+
properties: {
|
|
3435
|
+
type: { const: "routes.state" },
|
|
3436
|
+
routes: {
|
|
3437
|
+
type: "array",
|
|
3438
|
+
items: {
|
|
3439
|
+
allOf: [{ $ref: "#/$defs/routeRef" }],
|
|
3440
|
+
type: "object",
|
|
3441
|
+
required: ["active"],
|
|
3442
|
+
properties: { active: { type: "boolean" } }
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3303
3446
|
}
|
|
3304
3447
|
}
|
|
3305
3448
|
};
|
|
@@ -3405,7 +3548,7 @@ var rest_schema_default = {
|
|
|
3405
3548
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
3406
3549
|
$id: "https://cancore.io/schemas/filler-protocol/v1/rest.schema.json",
|
|
3407
3550
|
title: "Cancore filler protocol v1 \u2014 REST fallback",
|
|
3408
|
-
$comment: "protocol \xA73.6. Bodies are the WebSocket frames: every request body is a filler message with its envelope (id, fillerId, sentAt) and msgSig, verified before processing as on the WebSocket (S-19); every response is a freshly signed S\u2192F message. Login: GET /v1/filler/auth/challenge?fillerId= returns a signed auth.challenge addressed to that fillerId; POST /v1/filler/auth with the auth.response (FillerAuth over it) returns {token, expiresAt}. The challenge route is anonymous and its refusals are UNSIGNED (unsignedErrorBody, no sig, nothing journalled): 400 BAD_REQUEST \u2014 fillerId missing or not a fillerId; 404 UNKNOWN_REQUEST \u2014 fillerId unknown or not ACTIVE; the anonymous login steps are charged to no fillerId's rate limits (knowing a fillerId cannot lock its filler out); a 429 here comes only from the per-IP limit in front of filler-gateway. POST /v1/filler/auth refuses UNSIGNED too as long as it has checked no signature: 400 BAD_REQUEST \u2014 no or a malformed fillerId; 404 UNKNOWN_REQUEST \u2014 fillerId unknown or not ACTIVE; 401 UNAUTHENTICATED \u2014 the fillerId holds no live challenge (evicted, expired or used: ask for a new one). Its refusals after the signature checks (BAD_SIGNATURE, STALE_MESSAGE, REPLAYED_MESSAGE, UNSUPPORTED_VERSION, NOT_ELIGIBLE, UNAUTHENTICATED) are the signed error. The other /v1/filler/* routes need `Authorization: Bearer <token>`; the token is bound to (fillerId, message key) and stops working when it expires, when the message key is changed, or when the filler is no longer ACTIVE. The same token opens the WebSocket (asyncapi.json: offered as the subprotocol bearer.<token>). A ticket of another filler is 404 UNKNOWN_TICKET. Rate limits are per fillerId and rate class (quote, ticket, service, read for every bearer GET, login, cantonPrepare for canton.prepare of \xA73.19 \u2014 an hourly budget per filler, 60 by default \u2014 and canton for canton.submit, so a spent prepare budget never holds back the submit of an operation already prepared), shared by REST and every WebSocket session of it: over the limit a bearer route answers 429 with an UNSIGNED unsignedErrorBody {type: error, code: RATE_LIMITED, message, retryAfterMs} and a Retry-After header (seconds, rounded up), journals nothing one by one, and the request changes nothing; during the cooldown after sustained excess every bearer route answers so. Every 429 is unsigned, on every route; a filler decides by the status and takes retryAfterMs (else Retry-After) as a hint. Every other non-2xx of a bearer route is the signed error. GET /v1/filler/attestations/{orderHash} answers 404 ATTESTATIONS_NOT_READY until the gateway holds \u2265 threshold verified signatures for this filler's fill, and 404 UNKNOWN_TICKET when this filler holds no ticket on the order. /v1/filler/canton/* (\xA73.19) serve only the caller's own party: POST prepare and submit take the canton.prepare and canton.submit messages and answer canton.prepared and canton.submitted (the same frames as on the WebSocket); GET party, holdings
|
|
3551
|
+
$comment: "protocol \xA73.6. Bodies are the WebSocket frames: every request body is a filler message with its envelope (id, fillerId, sentAt) and msgSig, verified before processing as on the WebSocket (S-19); every response is a freshly signed S\u2192F message. Login: GET /v1/filler/auth/challenge?fillerId= returns a signed auth.challenge addressed to that fillerId; POST /v1/filler/auth with the auth.response (FillerAuth over it) returns {token, expiresAt}. The challenge route is anonymous and its refusals are UNSIGNED (unsignedErrorBody, no sig, nothing journalled): 400 BAD_REQUEST \u2014 fillerId missing or not a fillerId; 404 UNKNOWN_REQUEST \u2014 fillerId unknown or not ACTIVE; the anonymous login steps are charged to no fillerId's rate limits (knowing a fillerId cannot lock its filler out); a 429 here comes only from the per-IP limit in front of filler-gateway. POST /v1/filler/auth refuses UNSIGNED too as long as it has checked no signature: 400 BAD_REQUEST \u2014 no or a malformed fillerId; 404 UNKNOWN_REQUEST \u2014 fillerId unknown or not ACTIVE; 401 UNAUTHENTICATED \u2014 the fillerId holds no live challenge (evicted, expired or used: ask for a new one). Its refusals after the signature checks (BAD_SIGNATURE, STALE_MESSAGE, REPLAYED_MESSAGE, UNSUPPORTED_VERSION, NOT_ELIGIBLE, UNAUTHENTICATED) are the signed error. The other /v1/filler/* routes need `Authorization: Bearer <token>`; the token is bound to (fillerId, message key) and stops working when it expires, when the message key is changed, or when the filler is no longer ACTIVE. The same token opens the WebSocket (asyncapi.json: offered as the subprotocol bearer.<token>). A ticket of another filler is 404 UNKNOWN_TICKET. Rate limits are per fillerId and rate class (quote, ticket, service, read for every bearer GET, login, cantonPrepare for canton.prepare of \xA73.19 \u2014 an hourly budget per filler, 60 by default \u2014 and canton for canton.submit, so a spent prepare budget never holds back the submit of an operation already prepared), shared by REST and every WebSocket session of it: over the limit a bearer route answers 429 with an UNSIGNED unsignedErrorBody {type: error, code: RATE_LIMITED, message, retryAfterMs} and a Retry-After header (seconds, rounded up), journals nothing one by one, and the request changes nothing; during the cooldown after sustained excess every bearer route answers so. Every 429 is unsigned, on every route; a filler decides by the status and takes retryAfterMs (else Retry-After) as a hint. Every other non-2xx of a bearer route is the signed error. GET /v1/filler/attestations/{orderHash} answers 404 ATTESTATIONS_NOT_READY until the gateway holds \u2265 threshold verified signatures for this filler's fill, and 404 UNKNOWN_TICKET when this filler holds no ticket on the order. /v1/filler/canton/* (\xA73.19) serve only the caller's own party: POST prepare and submit take the canton.prepare and canton.submit messages and answer canton.prepared and canton.submitted (the same frames as on the WebSocket); GET party, holdings, delivery-orders and intents/{orderHash} read the party registered for the fillerId, and answer 409 CANTON_NOT_READY while it has none; intents/{orderHash} answers 404 UNKNOWN_TICKET when no live SwapIntent with that orderHash names the party. /v1/filler/routes (\xA73.20): GET answers routes.state, every route Cancore approved for the filler and whether the filler serves it; POST takes routes.set, the full list of routes the filler serves from now on, applied at once and audited, and answers the new routes.state; a listed route that is not approved for the filler refuses the whole request 403 ROUTE_NOT_APPROVED (its message names the routes) and changes nothing; rate class service. /v1/draws/* and /v1/gateway are public. Every non-2xx body is the signed `error` frame, with the HTTP status of x-error-status \u2014 except a 429 (always unsignedErrorBody) and the unsigned refusals of an endpoint that names an errorBody. x-endpoints: request/query/response/errorBody name a $def here or in messages.schema.json.",
|
|
3409
3552
|
"x-endpoints": [
|
|
3410
3553
|
{ method: "GET", path: "/v1/filler/auth/challenge", auth: "none", query: "#/$defs/challengeQuery", response: "messages.schema.json#/$defs/auth.challenge", errorBody: "#/$defs/unsignedErrorBody" },
|
|
3411
3554
|
{ method: "POST", path: "/v1/filler/auth", auth: "none", request: "messages.schema.json#/$defs/auth.response", response: "#/$defs/authToken", errorBody: "#/$defs/unsignedErrorBody" },
|
|
@@ -3425,7 +3568,10 @@ var rest_schema_default = {
|
|
|
3425
3568
|
{ method: "POST", path: "/v1/filler/canton/submit", auth: "bearer", request: "messages.schema.json#/$defs/canton.submit", response: "messages.schema.json#/$defs/canton.submitted" },
|
|
3426
3569
|
{ method: "GET", path: "/v1/filler/canton/party", auth: "bearer", response: "#/$defs/cantonParty" },
|
|
3427
3570
|
{ method: "GET", path: "/v1/filler/canton/holdings", auth: "bearer", query: "#/$defs/pageQuery", response: "#/$defs/cantonHoldingList" },
|
|
3428
|
-
{ method: "GET", path: "/v1/filler/canton/delivery-orders", auth: "bearer", query: "#/$defs/pageQuery", response: "#/$defs/cantonDeliveryOrderList" }
|
|
3571
|
+
{ method: "GET", path: "/v1/filler/canton/delivery-orders", auth: "bearer", query: "#/$defs/pageQuery", response: "#/$defs/cantonDeliveryOrderList" },
|
|
3572
|
+
{ method: "GET", path: "/v1/filler/canton/intents/{orderHash}", auth: "bearer", response: "#/$defs/cantonIntent" },
|
|
3573
|
+
{ method: "GET", path: "/v1/filler/routes", auth: "bearer", response: "messages.schema.json#/$defs/routes.state" },
|
|
3574
|
+
{ method: "POST", path: "/v1/filler/routes", auth: "bearer", request: "messages.schema.json#/$defs/routes.set", response: "messages.schema.json#/$defs/routes.state" }
|
|
3429
3575
|
],
|
|
3430
3576
|
"x-error-status": {
|
|
3431
3577
|
BAD_REQUEST: 400,
|
|
@@ -3446,7 +3592,8 @@ var rest_schema_default = {
|
|
|
3446
3592
|
CANTON_NOT_READY: 409,
|
|
3447
3593
|
CANTON_REFUSED: 422,
|
|
3448
3594
|
CANTON_UNAVAILABLE: 503,
|
|
3449
|
-
OPERATION_EXPIRED: 410
|
|
3595
|
+
OPERATION_EXPIRED: 410,
|
|
3596
|
+
ROUTE_NOT_APPROVED: 403
|
|
3450
3597
|
},
|
|
3451
3598
|
$defs: {
|
|
3452
3599
|
errorBody: { $ref: "messages.schema.json#/$defs/errorS2F" },
|
|
@@ -3569,6 +3716,20 @@ var rest_schema_default = {
|
|
|
3569
3716
|
proposalCid: { type: ["string", "null"] },
|
|
3570
3717
|
entryCid: { type: ["string", "null"] }
|
|
3571
3718
|
}
|
|
3719
|
+
},
|
|
3720
|
+
preapprovals: {
|
|
3721
|
+
type: "array",
|
|
3722
|
+
description: "the party's live transfer preapprovals (preapproval.create), at most one per registry admin; absent from a gateway that predates them",
|
|
3723
|
+
items: {
|
|
3724
|
+
type: "object",
|
|
3725
|
+
required: ["admin", "contractId", "instrumentAllowances", "executeBefore"],
|
|
3726
|
+
properties: {
|
|
3727
|
+
admin: { type: "string", minLength: 1 },
|
|
3728
|
+
contractId: { type: "string", minLength: 1 },
|
|
3729
|
+
instrumentAllowances: { type: "array", maxItems: 10, items: { type: "string", minLength: 1 } },
|
|
3730
|
+
executeBefore: { $ref: "messages.schema.json#/$defs/timeS", description: "unix s: the Daml Time (microseconds) cut to whole seconds; the preapproval expires then" }
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3572
3733
|
}
|
|
3573
3734
|
}
|
|
3574
3735
|
},
|
|
@@ -3607,6 +3768,75 @@ var rest_schema_default = {
|
|
|
3607
3768
|
description: "The live DeliveryOrders naming the party as filler, oldest first",
|
|
3608
3769
|
required: ["items", "nextCursor"],
|
|
3609
3770
|
properties: { items: { type: "array", items: { $ref: "#/$defs/cantonDeliveryOrder" } }, nextCursor: { type: ["string", "null"] } }
|
|
3771
|
+
},
|
|
3772
|
+
cantonIntent: {
|
|
3773
|
+
type: "object",
|
|
3774
|
+
description: "A live SwapIntent of a Canton source that names the caller's party as its filler, as that party sees it (an observer), with its committed allocation as the operator reads it (an executor). What the node checks before ticket.receipt (fillers.md V-C1\u2026V-C6); the node recomputes orderHash from these fields itself. 404 UNKNOWN_TICKET when no live SwapIntent with this orderHash names the party; 409 CANTON_NOT_READY when the fillerId has no party",
|
|
3775
|
+
required: ["intentCid", "templateId", "orderHash", "owner", "operator", "filler", "fillerId", "requestId", "asset", "amount", "destination", "minReceived", "feeRate", "fillDeadline", "refundAfter", "orderCreatedAt", "allocationCid", "allocation"],
|
|
3776
|
+
properties: {
|
|
3777
|
+
intentCid: { type: "string", minLength: 1 },
|
|
3778
|
+
templateId: { type: "string", pattern: "^[0-9a-f]{64}:[A-Za-z0-9_.]+:[A-Za-z0-9_]+$", description: "<package id>:Intent.SwapIntent:SwapIntent" },
|
|
3779
|
+
orderHash: { $ref: "messages.schema.json#/$defs/bytes32" },
|
|
3780
|
+
owner: { type: "string", minLength: 1 },
|
|
3781
|
+
operator: { type: "string", minLength: 1 },
|
|
3782
|
+
filler: { type: "string", minLength: 1 },
|
|
3783
|
+
fillerId: { type: "string", minLength: 1 },
|
|
3784
|
+
requestId: { type: "string", minLength: 1 },
|
|
3785
|
+
asset: { $ref: "messages.schema.json#/$defs/cantonAsset", description: "SwapIntent.instrumentId" },
|
|
3786
|
+
amount: { type: "string", pattern: "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$", description: "Daml Decimal: the committed give, fee-inclusive" },
|
|
3787
|
+
destination: {
|
|
3788
|
+
type: "object",
|
|
3789
|
+
description: "an EVM destination (Destination.Evm); an intent to any other destination is not served",
|
|
3790
|
+
required: ["chainId", "token", "recipient"],
|
|
3791
|
+
properties: {
|
|
3792
|
+
chainId: { $ref: "messages.schema.json#/$defs/uintDec64" },
|
|
3793
|
+
token: { $ref: "messages.schema.json#/$defs/address" },
|
|
3794
|
+
recipient: { $ref: "messages.schema.json#/$defs/address" }
|
|
3795
|
+
}
|
|
3796
|
+
},
|
|
3797
|
+
minReceived: {
|
|
3798
|
+
type: "object",
|
|
3799
|
+
required: ["units", "decimals"],
|
|
3800
|
+
properties: { units: { $ref: "messages.schema.json#/$defs/uintDec256" }, decimals: { type: "integer", minimum: 0, maximum: 255 } }
|
|
3801
|
+
},
|
|
3802
|
+
feeRate: { type: "string", pattern: "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$", description: "Daml Decimal" },
|
|
3803
|
+
fillDeadline: { $ref: "messages.schema.json#/$defs/timeS" },
|
|
3804
|
+
refundAfter: { $ref: "messages.schema.json#/$defs/timeS" },
|
|
3805
|
+
orderCreatedAt: { $ref: "messages.schema.json#/$defs/timeS", description: "the owner's signing time: the order's createdAt" },
|
|
3806
|
+
allocationCid: { type: "string", minLength: 1, description: "SwapIntent.allocationCid" },
|
|
3807
|
+
allocation: {
|
|
3808
|
+
anyOf: [{ $ref: "#/$defs/cantonAllocation" }, { type: "null" }],
|
|
3809
|
+
description: "the contract allocationCid names, by its AllocationV2 view; null when it is not live"
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
},
|
|
3813
|
+
cantonAllocation: {
|
|
3814
|
+
type: "object",
|
|
3815
|
+
required: ["contractId", "templateId", "admin", "authorizer", "committed", "settlementId", "executors", "settlementDeadline", "legs"],
|
|
3816
|
+
properties: {
|
|
3817
|
+
contractId: { type: "string", minLength: 1 },
|
|
3818
|
+
templateId: { type: "string", pattern: "^[0-9a-f]{64}:[A-Za-z0-9_.]+:[A-Za-z0-9_]+$" },
|
|
3819
|
+
admin: { type: "string", minLength: 1 },
|
|
3820
|
+
authorizer: { type: ["string", "null"], minLength: 1, description: "the owner of the authorizer account; null for an account without one" },
|
|
3821
|
+
committed: { type: "boolean" },
|
|
3822
|
+
settlementId: { type: "string" },
|
|
3823
|
+
executors: { type: "array", items: { type: "string", minLength: 1 } },
|
|
3824
|
+
settlementDeadline: { anyOf: [{ $ref: "messages.schema.json#/$defs/timeS" }, { type: "null" }] },
|
|
3825
|
+
legs: {
|
|
3826
|
+
type: "array",
|
|
3827
|
+
items: {
|
|
3828
|
+
type: "object",
|
|
3829
|
+
required: ["legId", "side", "otherside", "amount", "instrumentId"],
|
|
3830
|
+
properties: {
|
|
3831
|
+
legId: { type: "string" },
|
|
3832
|
+
side: { anyOf: [{ enum: ["SENDER", "RECEIVER"] }, { $ref: "messages.schema.json#/$defs/futureEnumValue" }], description: "a side the node does not know is refused by it" },
|
|
3833
|
+
otherside: { type: ["string", "null"], minLength: 1, description: "the owner of the other side's account" },
|
|
3834
|
+
amount: { type: "string", pattern: "^(0|[1-9][0-9]*)(\\.[0-9]{1,10})?$", description: "Daml Decimal" },
|
|
3835
|
+
instrumentId: { type: "string", minLength: 1 }
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3610
3840
|
}
|
|
3611
3841
|
}
|
|
3612
3842
|
};
|
|
@@ -3661,7 +3891,7 @@ var CONTRACTS_RELEASE = {
|
|
|
3661
3891
|
"version": "1.4.0-dev",
|
|
3662
3892
|
"releaseChannel": "dev",
|
|
3663
3893
|
"updatedAt": "2026-07-24T19:55:00Z",
|
|
3664
|
-
"commit": "
|
|
3894
|
+
"commit": "2f681b9bb74db55c0fe9fec31282bca54b997985"
|
|
3665
3895
|
};
|
|
3666
3896
|
var BUILD_HASHES = {
|
|
3667
3897
|
"HTLC": {
|