@cancore/contracts 0.2.0-rc.15 → 0.2.0-rc.18
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 +23 -1
- package/dist/index.d.ts +54 -5
- package/dist/index.js +174 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/spec/protocol/asyncapi.json +61 -0
- package/spec/protocol/messages.schema.json +85 -4
- package/spec/protocol/rest.schema.json +22 -3
- package/spec/protocol/vectors/messages.json +98 -0
package/README.md
CHANGED
|
@@ -322,6 +322,7 @@ the Canton traffic. Two messages, on the WebSocket or as REST bodies:
|
|
|
322
322
|
| `delivery.fill` | `orderHash`, `attempt` | `DeliveryOrder_Fill` of a Canton ticket issued to the filler |
|
|
323
323
|
| `intent.settle` | `orderHash` | `SwapIntent_SettleWithProof` of a Canton-source order the filler delivered |
|
|
324
324
|
| `holdings.transfer` | `asset`, `amount`, `toParty` | `TransferFactory_Transfer` of its own holdings to a party it names; what its open delivery orders need stays |
|
|
325
|
+
| `preapproval.create` | `admin` | the party's transfer preapproval with the registry of the instrument admin `admin` (CNRX: `CnrxTransferPreapproval`, signed by the party), so a transfer to the party completes at once instead of waiting for it to accept |
|
|
325
326
|
|
|
326
327
|
`canton.prepare` → `canton.prepared` (`operationId`, `legs`, `summary`, `expiresAt`);
|
|
327
328
|
`canton.submit` (one Ed25519 signature per leg) → `canton.submitted`.
|
|
@@ -333,6 +334,8 @@ is only what Cancore says about it, so before signing a leg the node MUST:
|
|
|
333
334
|
prepared-transaction hashing of `hashingSchemeVersion`, decode the transaction and check it
|
|
334
335
|
against `summary` for the op: template and choice, acting and receiving parties, instrument,
|
|
335
336
|
amount;
|
|
337
|
+
for `preapproval.create` the one created preapproval — of the pinned registry package, receiver
|
|
338
|
+
its own party, the asked admin, nothing else in the transaction;
|
|
336
339
|
- `kind: 'topology'` (only in `party.allocate`; the schema refuses it in any other op) — recompute
|
|
337
340
|
the multihash over `topologyTransactions` and check that they create `summary.partyId` with
|
|
338
341
|
`summary.publicKey` as its only signing key, hosted on the Cancore participant.
|
|
@@ -345,13 +348,21 @@ never taken from `summary` alone: for `delivery.fill` the `TransferFactory_Trans
|
|
|
345
348
|
other leg is the fee to the operator — against the intent it delivered for.
|
|
346
349
|
|
|
347
350
|
On any difference it does not sign. The kind of a leg is closed: an unknown kind is refused. Submit is idempotent per `operationId`. REST: `POST /v1/filler/canton/prepare`,
|
|
348
|
-
`POST /v1/filler/canton/submit`; reads of the own party: `GET /v1/filler/canton/party
|
|
351
|
+
`POST /v1/filler/canton/submit`; reads of the own party: `GET /v1/filler/canton/party` (with
|
|
352
|
+
`preapprovals`, the party's live transfer preapprovals),
|
|
349
353
|
`/holdings`, `/delivery-orders`, and `/intents/{orderHash}` — the live Canton-source `SwapIntent`
|
|
350
354
|
naming the party as its filler, with its committed allocation, which the node checks before
|
|
351
355
|
`ticket.receipt` (V-C1…V-C6; 404 `UNKNOWN_TICKET` when none names it). Refusals: `CANTON_NOT_READY` (409), `CANTON_REFUSED` (422),
|
|
352
356
|
`CANTON_UNAVAILABLE` (503, retry), `OPERATION_EXPIRED` (410, prepare again), plus
|
|
353
357
|
`UNKNOWN_TICKET`, `TICKET_CLOSED` and `NOT_ELIGIBLE` for an operation on someone else's ticket or party.
|
|
354
358
|
|
|
359
|
+
The filler's own routes (§3.20): Cancore staff approve the routes a filler may serve; the
|
|
360
|
+
filler switches each approved route on or off itself. `GET /v1/filler/routes` answers
|
|
361
|
+
`routes.state` — every approved route with `active`; `POST /v1/filler/routes` takes `routes.set`
|
|
362
|
+
— the full list the filler serves from now on, sealed by its message key — applies it at once and
|
|
363
|
+
answers the new `routes.state`. A listed route that is not approved refuses the whole request
|
|
364
|
+
`ROUTE_NOT_APPROVED` (403) and nothing changes. Both are REST only, rate class `service`.
|
|
365
|
+
|
|
355
366
|
`FILLER_GATEWAYS` is where the gateway key and the ticket signers of each environment are
|
|
356
367
|
published. It is empty in the RC: no gateway key exists yet.
|
|
357
368
|
|
|
@@ -454,6 +465,17 @@ Full documentation: <https://docs.cancore.io/sdk/contracts>
|
|
|
454
465
|
|
|
455
466
|
## Changes
|
|
456
467
|
|
|
468
|
+
- `0.2.0-rc.17` — Canton op `preapproval.create` (CAN-2904): `params {admin}`, `summary {party,
|
|
469
|
+
admin, instrumentAllowances, requestedAt, executeBefore}`, `result {preapprovalCid}` — the filler's
|
|
470
|
+
external party signs its own transfer preapproval with a registry, the one way it can be credited
|
|
471
|
+
directly (a CNRX mint or a transfer to it otherwise needs its signature to accept). `CantonParty`
|
|
472
|
+
gains optional `preapprovals` (`CantonPreapproval {admin, contractId, instrumentAllowances,
|
|
473
|
+
executeBefore}`). Additive.
|
|
474
|
+
- `0.2.0-rc.16` — the filler's own routes (CAN-2793, protocol §3.20): REST-only frames
|
|
475
|
+
`routes.set` (F→S, the full list of routes the filler serves, sealed by its message key) and
|
|
476
|
+
`routes.state` (S→F, every route approved for the filler with `active`); `GET` and
|
|
477
|
+
`POST /v1/filler/routes`; error code `ROUTE_NOT_APPROVED` (403); types `RouteRef`, `RoutesSet`,
|
|
478
|
+
`RoutesState`. Additive.
|
|
457
479
|
- `0.2.0-rc.15` — REST read `GET /v1/filler/canton/intents/{orderHash}` (CAN-1863): the live
|
|
458
480
|
Canton-source `SwapIntent` naming the filler's party, with its committed allocation by its
|
|
459
481
|
AllocationV2 view (`CantonIntent`, `CantonAllocation`, `CantonAllocationLeg`; `$defs`
|
package/dist/index.d.ts
CHANGED
|
@@ -915,7 +915,7 @@ type WireAsset = Hex | {
|
|
|
915
915
|
id: string;
|
|
916
916
|
};
|
|
917
917
|
declare const DECLINE_REASONS: readonly ["NO_INVENTORY", "RISK_LIMIT", "PRICE_MOVED", "PAUSED", "OTHER", "TICKET_SIGNER_UNKNOWN", "TICKET_MISMATCH", "TICKET_TTL_TOO_SHORT", "TICKET_ISSUED_LATE", "TICKET_BEYOND_DEADLINE", "ESCROW_NOT_OPEN", "ESCROW_MISMATCH", "PROOF_WINDOW_TOO_SHORT", "SKEW_MARGIN_TOO_SHORT", "DRAW_MISMATCH"];
|
|
918
|
-
declare const ERROR_CODES: readonly ["BAD_REQUEST", "UNAUTHENTICATED", "UNSUPPORTED_VERSION", "UNSUPPORTED_TYPE", "BAD_SIGNATURE", "STALE_MESSAGE", "REPLAYED_MESSAGE", "TICKET_REFUSED", "UNKNOWN_REQUEST", "UNKNOWN_TICKET", "TICKET_CLOSED", "NOT_ELIGIBLE", "RATE_LIMITED", "INTERNAL", "ATTESTATIONS_NOT_READY", "CANTON_NOT_READY", "CANTON_REFUSED", "CANTON_UNAVAILABLE", "OPERATION_EXPIRED"];
|
|
918
|
+
declare const ERROR_CODES: readonly ["BAD_REQUEST", "UNAUTHENTICATED", "UNSUPPORTED_VERSION", "UNSUPPORTED_TYPE", "BAD_SIGNATURE", "STALE_MESSAGE", "REPLAYED_MESSAGE", "TICKET_REFUSED", "UNKNOWN_REQUEST", "UNKNOWN_TICKET", "TICKET_CLOSED", "NOT_ELIGIBLE", "RATE_LIMITED", "INTERNAL", "ATTESTATIONS_NOT_READY", "CANTON_NOT_READY", "CANTON_REFUSED", "CANTON_UNAVAILABLE", "OPERATION_EXPIRED", "ROUTE_NOT_APPROVED"];
|
|
919
919
|
/** HTTP status of each error code on the REST fallback. */
|
|
920
920
|
declare const ERROR_HTTP_STATUS: Readonly<Record<ErrorCode, number>>;
|
|
921
921
|
/** `error.reason` with `TICKET_REFUSED`: the pre-ticket check that failed (S-21). */
|
|
@@ -931,7 +931,7 @@ declare const PENALTY_STEPS: readonly ["RECORDED", "BANNED", "UNBANNED"];
|
|
|
931
931
|
declare const DRAW_CLOSED_BY: readonly ["OFFER_TIMEOUT", "OFFER_DECLINE", "TICKET_DECLINE", "TICKET_EXPIRED", "FILLED"];
|
|
932
932
|
declare const TICKET_LIST_STATUSES: readonly ["OFFERED", "ISSUED"];
|
|
933
933
|
/** The Canton operations of the filler's own party (§3.19): the backend prepares and submits, the node signs with its party key. */
|
|
934
|
-
declare const CANTON_OPS: readonly ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer"];
|
|
934
|
+
declare const CANTON_OPS: readonly ["party.allocate", "registry.accept", "delivery.fill", "intent.settle", "holdings.transfer", "preapproval.create"];
|
|
935
935
|
/** `holdings.transfer` result: the receiver holds it, or a TransferInstruction waits for it to accept. */
|
|
936
936
|
declare const CANTON_TRANSFER_OUTCOMES: readonly ["COMPLETED", "PENDING"];
|
|
937
937
|
declare const CANTON_LEG_KINDS: readonly ["transaction", "topology"];
|
|
@@ -1260,6 +1260,10 @@ interface CantonOpParams {
|
|
|
1260
1260
|
amount: string;
|
|
1261
1261
|
toParty: string;
|
|
1262
1262
|
};
|
|
1263
|
+
/** The party's transfer preapproval with the registry of the instrument admin `admin`: transfers to it complete at once. */
|
|
1264
|
+
'preapproval.create': {
|
|
1265
|
+
admin: string;
|
|
1266
|
+
};
|
|
1263
1267
|
}
|
|
1264
1268
|
/** What the prepared legs do, by op: the node checks it before it signs. */
|
|
1265
1269
|
interface CantonOpSummary {
|
|
@@ -1319,6 +1323,20 @@ interface CantonOpSummary {
|
|
|
1319
1323
|
inputHoldingCids: string[];
|
|
1320
1324
|
executeBefore: DecString;
|
|
1321
1325
|
};
|
|
1326
|
+
'preapproval.create': {
|
|
1327
|
+
/** The receiver: the filler's own party. */
|
|
1328
|
+
party: string;
|
|
1329
|
+
/** The registry's instrument admin, as asked. */
|
|
1330
|
+
admin: string;
|
|
1331
|
+
/** Instrument ids the preapproval is limited to; empty: every instrument of the admin. */
|
|
1332
|
+
instrumentAllowances: string[];
|
|
1333
|
+
/** Unix s; null for a registry whose preapproval has no validity window (DA Utilities). */
|
|
1334
|
+
requestedAt: DecString | null;
|
|
1335
|
+
/** Unix s: the preapproval expires then; renew it before. null: it never lapses. */
|
|
1336
|
+
executeBefore: DecString | null;
|
|
1337
|
+
/** DA Utilities only: the registry operator the preapproval names. */
|
|
1338
|
+
operator?: string;
|
|
1339
|
+
};
|
|
1322
1340
|
}
|
|
1323
1341
|
/** What the committed operation created, by op. */
|
|
1324
1342
|
interface CantonOpResult {
|
|
@@ -1336,6 +1354,9 @@ interface CantonOpResult {
|
|
|
1336
1354
|
outcome: (typeof CANTON_TRANSFER_OUTCOMES)[number];
|
|
1337
1355
|
transferInstructionCid?: string;
|
|
1338
1356
|
};
|
|
1357
|
+
'preapproval.create': {
|
|
1358
|
+
preapprovalCid: string;
|
|
1359
|
+
};
|
|
1339
1360
|
}
|
|
1340
1361
|
/**
|
|
1341
1362
|
* A prepared transaction to sign. The node MUST, before signing (§3.19): recompute `hash` from
|
|
@@ -1408,8 +1429,26 @@ type CantonSubmitted = {
|
|
|
1408
1429
|
result: CantonOpResult[K];
|
|
1409
1430
|
};
|
|
1410
1431
|
}[CantonOp];
|
|
1411
|
-
|
|
1412
|
-
|
|
1432
|
+
/** A route of the catalogue: CAIP-2 source and destination. */
|
|
1433
|
+
interface RouteRef {
|
|
1434
|
+
src: string;
|
|
1435
|
+
dst: string;
|
|
1436
|
+
}
|
|
1437
|
+
/** The full list of routes the filler serves from now on (§3.20); each must be approved for it, else ROUTE_NOT_APPROVED and nothing changes. */
|
|
1438
|
+
interface RoutesSet extends F2SBase {
|
|
1439
|
+
type: 'routes.set';
|
|
1440
|
+
routes: RouteRef[];
|
|
1441
|
+
}
|
|
1442
|
+
/** Every route approved for the filler; it is asked for quotes on a route only while `active`. */
|
|
1443
|
+
interface RoutesState extends S2FBase {
|
|
1444
|
+
type: 'routes.state';
|
|
1445
|
+
fillerId: string;
|
|
1446
|
+
routes: (RouteRef & {
|
|
1447
|
+
active: boolean;
|
|
1448
|
+
})[];
|
|
1449
|
+
}
|
|
1450
|
+
type S2FMessage = AuthChallenge | AuthOk | PingS2F | PongS2F | ErrorMessage | EpochWeights | QuoteRequest | QuoteAck | QuoteReconfirm | TicketOffer | TicketIntentAck | TicketIssued | TicketExpired | OrderSettled | PenaltyApplied | SettleAttestations | CantonPrepared | CantonSubmitted | RoutesState;
|
|
1451
|
+
type F2SMessage = AuthResponse | PingF2S | PongF2S | ErrorF2S | QuoteMessage | QuoteReconfirmReply | TicketIntentMessage | TicketDecline | TicketReceiptMessage | FillReported | CantonPrepare | CantonSubmit | RoutesSet;
|
|
1413
1452
|
/** `POST /v1/filler/auth`: the bearer token of REST and of the WebSocket upgrade, bound to (fillerId, message key). */
|
|
1414
1453
|
interface AuthToken {
|
|
1415
1454
|
token: string;
|
|
@@ -1457,6 +1496,14 @@ interface PenaltyRecord {
|
|
|
1457
1496
|
details: Record<string, unknown>;
|
|
1458
1497
|
}
|
|
1459
1498
|
type PenaltyList = Page<PenaltyRecord>;
|
|
1499
|
+
/** A live transfer preapproval of the party with one registry (`preapproval.create`); `executeBefore` in unix s (the Daml Time cut to seconds). */
|
|
1500
|
+
/** `executeBefore` null: the registry's preapproval has no validity window (DA Utilities) and never lapses. */
|
|
1501
|
+
interface CantonPreapproval {
|
|
1502
|
+
admin: string;
|
|
1503
|
+
contractId: string;
|
|
1504
|
+
instrumentAllowances: string[];
|
|
1505
|
+
executeBefore: DecString | null;
|
|
1506
|
+
}
|
|
1460
1507
|
/** `GET /v1/filler/canton/party`: the party registered for the fillerId and its `FillerRegistryEntry`. */
|
|
1461
1508
|
interface CantonParty {
|
|
1462
1509
|
party: string | null;
|
|
@@ -1466,6 +1513,8 @@ interface CantonParty {
|
|
|
1466
1513
|
proposalCid: string | null;
|
|
1467
1514
|
entryCid: string | null;
|
|
1468
1515
|
};
|
|
1516
|
+
/** The party's live transfer preapprovals, one per registry admin at most; absent from a gateway that predates them. */
|
|
1517
|
+
preapprovals?: CantonPreapproval[];
|
|
1469
1518
|
}
|
|
1470
1519
|
interface CantonHolding {
|
|
1471
1520
|
contractId: string;
|
|
@@ -1942,4 +1991,4 @@ declare const BYTECODE_HASHES: {
|
|
|
1942
1991
|
declare function describeRevert(selectorOrData: string, tables: ReadonlyArray<Readonly<Record<string, string>>>): string | undefined;
|
|
1943
1992
|
|
|
1944
1993
|
export { ASYNCAPI, BPS, BUILD_HASHES, BYTECODE_HASHES, CANTON_LEG_KINDS, CANTON_OPS, CANTON_ORIGIN_ID, CANTON_PARTICIPANTS, CANTON_REGISTRY_STATES, CANTON_SOURCE_ANCHOR, CANTON_TICKET_RECEIPT_TYPES, CANTON_TRANSFER_OUTCOMES, CONTRACTS_RELEASE, DAML_NUMERIC_SCALE, DECLINE_REASONS, DEPLOYMENTS, DRAND_QUICKNET, DRAW_CLOSED_BY, EIP2294_MAX_CHAIN_ID, ERROR_CODES, ERROR_HTTP_STATUS, EXEMPT_REASONS, EXPIRED_RESULTS, FEE_CLAIM_DOMAIN_NAME, FEE_CLAIM_DOMAIN_VERSION, FEE_CLAIM_TYPES, FILLER_AUTH_TYPES, FILLER_CLOSE_CODES, FILLER_GATEWAYS, FILLER_ID_PATTERN, FILLER_KEY_REGISTRATION_TYPES, FILLER_MESSAGE_TYPES, FILLER_PROTOCOL_DOMAIN, FILLER_QUOTE_TYPES, FILLER_UPGRADE_REFUSALS, FILLER_WS_BEARER_PREFIX, FILLER_WS_SUBPROTOCOL, FILL_PROOF_DOMAIN, FILL_PROOF_TYPES, FILL_PROOF_TYPE_STRING, FILL_TICKET_DOMAIN, FILL_TICKET_TYPES, GATEWAY_MESSAGE_TYPES, GRACE, INSTRUMENT_LABEL_TAG, MAX_FEE_BPS, MAX_FILL_TTL, MAX_PROOF_WINDOW, MAX_SIG_TTL, MESSAGE_DIRECTIONS, MIN_FILL_TTL, ORDER_TYPES, OWNER_LABEL_TAG, PENALTY_STEPS, PERMIT2_ADDRESS, PERMIT2_WITNESS_TYPE_STRING, PERMIT_WITNESS_TYPES, PROOF_KIND_ATTESTATION, PROTOCOL_SCHEMAS, PROTOCOL_VERSION, QUOTE_ACK_STATUSES, QUOTE_FINAL_STATUSES, QUOTE_TYPES, REST_ENDPOINTS, REST_ONLY_TYPES, SCHEMA_VOCABULARY, SET_DELAY, STAKE_BINDING_TYPES, TICKET_INTENT_TYPES, TICKET_LIST_STATUSES, TICKET_RECEIPT_TYPES, TICKET_REFUSED_REASONS, buildCantonSourceOrder, cantonInclusiveFeeSplit, cantonNetworkOfDestination, cantonSigEntries, cantonTicketReceipt, deliveryOrderCidHash, deploymentOf, describeRevert, drawValue, drawWinner, encodeCantonAmount, encodeCantonDestination, encodeCantonOutputAsset, encodeCantonRecipient, encodeType, evmAddressFromRepayTo, feeClaimDomain, fillProofDomain, fillerEnvelopeError, fillerIdHash, fillerMessageBodyHash, fillerWsProtocols, firstRoundAtOrAfter, gatewayBodyHash, hashCantonTicketReceipt, hashDomain, hashFillProof, hashFillTicket, hashFillerKeyRegistration, hashFillerMessage, hashFillerQuote, hashOrder, hashPermitWitness, hashStruct, hashTicketIntent, hashTypedData, inclusiveFeeSplit, isCantonOriginId, isCantonSource, isEoaSignature, isEvmRepayTo, jcs, messageIdRetainUntil, messageSchemaRef, permit2Domain, repayToFromEvm, repayToFromParty, requestIdHash, routerDomain, settleAttestationsErrors, settleAttestationsPayload, settleAttestationsPayloadHash, settleSigs, sourceOrderHash, typeHash };
|
|
1945
|
-
export type { AttestationCanton, AttestationEvm, AttestationsResponse, AuthChallenge, AuthOk, AuthResponse, AuthToken, CantonAllocation, CantonAllocationLeg, CantonAsset, CantonDeliveryOrder, CantonDeliveryOrderList, CantonHolding, CantonHoldingList, CantonIntent, CantonLeg, CantonLegKind, CantonLegTopology, CantonLegTransaction, CantonNetwork, CantonOp, CantonOpParams, CantonOpResult, CantonOpSummary, CantonParty, CantonPrepare, CantonPrepared, CantonRegistryState, CantonSignature, CantonSourceIntent, CantonSourceOrder, CantonSubmit, CantonSubmitted, CantonTicketReceipt, ChallengeQuery, DecString, DeclineReason, DeploymentEnv, DrawAttempt, DrawCandidate, DrawClosedBy, DrawOutcome, DrawRecord, EpochLeaf, EpochRecord, EpochWeights, ErrorCode, ErrorF2S, ErrorMessage, EvmDeployment, ExemptReason, ExpiredResult, F2SBase, F2SEnvelope, F2SMessage, FeeClaim, FeeSplit, FillProof, FillProofJson, FillReported, FillTicket, FillerAuth, FillerCloseCode, FillerEnvelopeContext, FillerGateway, FillerKeyRegistration, FillerMessage, FillerQuote, FillerStats, GatewayInfo, GatewayMessage, Hex, JsonSchema, JsonValue, MessageDirection, Order, OrderDomain, OrderJson, OrderSettled, Page, PenaltyApplied, PenaltyList, PenaltyRecord, PenaltyStep, PermitWitness, Ping, PingF2S, PingS2F, Pong, PongF2S, PongS2F, Quote, QuoteAck, QuoteAckStatus, QuoteFinalStatus, QuoteList, QuoteMessage, QuoteReconfirm, QuoteReconfirmReply, QuoteRecord, QuoteRequest, RestEndpoint, S2FBase, S2FMessage, SettleAttestations, SettleAttestationsPayload, SignedFillerKeyRegistration, StakeBinding, StakeBindingRequest, TicketDecline, TicketExpired, TicketIntent, TicketIntentAck, TicketIntentMessage, TicketIssued, TicketIssuedCanton, TicketIssuedEvm, TicketJson, TicketList, TicketOffer, TicketReceipt, TicketReceiptCanton, TicketReceiptEvm, TicketReceiptMessage, TicketRefusedReason, TimeMs, TypedDataDomain, TypedDataInput, TypedDataTypes, TypedField, TypedValue, UintLike, UnsignedErrorBody, WireAsset };
|
|
1994
|
+
export type { AttestationCanton, AttestationEvm, AttestationsResponse, AuthChallenge, AuthOk, AuthResponse, AuthToken, CantonAllocation, CantonAllocationLeg, CantonAsset, CantonDeliveryOrder, CantonDeliveryOrderList, CantonHolding, CantonHoldingList, CantonIntent, CantonLeg, CantonLegKind, CantonLegTopology, CantonLegTransaction, CantonNetwork, CantonOp, CantonOpParams, CantonOpResult, CantonOpSummary, CantonParty, CantonPreapproval, CantonPrepare, CantonPrepared, CantonRegistryState, CantonSignature, CantonSourceIntent, CantonSourceOrder, CantonSubmit, CantonSubmitted, CantonTicketReceipt, ChallengeQuery, DecString, DeclineReason, DeploymentEnv, DrawAttempt, DrawCandidate, DrawClosedBy, DrawOutcome, DrawRecord, EpochLeaf, EpochRecord, EpochWeights, ErrorCode, ErrorF2S, ErrorMessage, EvmDeployment, ExemptReason, ExpiredResult, F2SBase, F2SEnvelope, F2SMessage, FeeClaim, FeeSplit, FillProof, FillProofJson, FillReported, FillTicket, FillerAuth, FillerCloseCode, FillerEnvelopeContext, FillerGateway, FillerKeyRegistration, FillerMessage, FillerQuote, FillerStats, GatewayInfo, GatewayMessage, Hex, JsonSchema, JsonValue, MessageDirection, Order, OrderDomain, OrderJson, OrderSettled, Page, PenaltyApplied, PenaltyList, PenaltyRecord, PenaltyStep, PermitWitness, Ping, PingF2S, PingS2F, Pong, PongF2S, PongS2F, Quote, QuoteAck, QuoteAckStatus, QuoteFinalStatus, QuoteList, QuoteMessage, QuoteReconfirm, QuoteReconfirmReply, QuoteRecord, QuoteRequest, RestEndpoint, RouteRef, RoutesSet, RoutesState, S2FBase, S2FMessage, SettleAttestations, SettleAttestationsPayload, SignedFillerKeyRegistration, StakeBinding, StakeBindingRequest, TicketDecline, TicketExpired, TicketIntent, TicketIntentAck, TicketIntentMessage, TicketIssued, TicketIssuedCanton, TicketIssuedEvm, TicketJson, TicketList, TicketOffer, TicketReceipt, TicketReceiptCanton, TicketReceiptEvm, TicketReceiptMessage, TicketRefusedReason, TimeMs, TypedDataDomain, TypedDataInput, TypedDataTypes, TypedField, TypedValue, UintLike, UnsignedErrorBody, WireAsset };
|
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",
|
|
@@ -802,7 +804,7 @@ var QUOTE_FINAL_STATUSES = [...QUOTE_ACK_STATUSES, "REPLACED", "BAD_SIG", "OUTLI
|
|
|
802
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"];
|
|
@@ -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
|
},
|
|
@@ -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,27 @@ 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: { oneOf: [{ $ref: "#/$defs/timeS" }, { type: "null" }], description: "unix s: the Daml Time (microseconds) cut to whole seconds; null for a registry whose preapproval has no validity window (DA Utilities)" },
|
|
3306
|
+
executeBefore: { oneOf: [{ $ref: "#/$defs/timeS" }, { type: "null" }], description: "unix s, cut likewise: the preapproval expires then; null \u2014 it never lapses" },
|
|
3307
|
+
operator: { type: "string", minLength: 1, description: "DA Utilities only: the registry operator the preapproval names (its observer)" }
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3214
3312
|
}
|
|
3215
3313
|
],
|
|
3216
3314
|
required: ["type", "re", "operationId", "op", "legs", "summary", "expiresAt"],
|
|
@@ -3289,6 +3387,14 @@ var messages_schema_default = {
|
|
|
3289
3387
|
}
|
|
3290
3388
|
}
|
|
3291
3389
|
}
|
|
3390
|
+
},
|
|
3391
|
+
{
|
|
3392
|
+
if: { type: "object", properties: { op: { const: "preapproval.create" } }, required: ["op"] },
|
|
3393
|
+
then: {
|
|
3394
|
+
type: "object",
|
|
3395
|
+
required: ["result"],
|
|
3396
|
+
properties: { result: { type: "object", required: ["preapprovalCid"], properties: { preapprovalCid: { type: "string", minLength: 1 } } } }
|
|
3397
|
+
}
|
|
3292
3398
|
}
|
|
3293
3399
|
],
|
|
3294
3400
|
required: ["type", "re", "operationId", "op", "result"],
|
|
@@ -3300,6 +3406,44 @@ var messages_schema_default = {
|
|
|
3300
3406
|
updateId: { type: "string", minLength: 1 },
|
|
3301
3407
|
result: { type: "object" }
|
|
3302
3408
|
}
|
|
3409
|
+
},
|
|
3410
|
+
routeRef: {
|
|
3411
|
+
type: "object",
|
|
3412
|
+
description: "A route of the catalogue (GET /v1/intents/routes): CAIP-2 source and destination",
|
|
3413
|
+
required: ["src", "dst"],
|
|
3414
|
+
properties: { src: { $ref: "#/$defs/caip2" }, dst: { $ref: "#/$defs/caip2" } }
|
|
3415
|
+
},
|
|
3416
|
+
"routes.set": {
|
|
3417
|
+
"x-direction": "F2S",
|
|
3418
|
+
"x-rest-only": true,
|
|
3419
|
+
type: "object",
|
|
3420
|
+
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",
|
|
3421
|
+
allOf: [{ $ref: "#/$defs/f2sBase" }],
|
|
3422
|
+
required: ["type", "routes"],
|
|
3423
|
+
properties: {
|
|
3424
|
+
type: { const: "routes.set" },
|
|
3425
|
+
routes: { type: "array", maxItems: 50, uniqueItems: true, items: { $ref: "#/$defs/routeRef" } }
|
|
3426
|
+
}
|
|
3427
|
+
},
|
|
3428
|
+
"routes.state": {
|
|
3429
|
+
"x-direction": "S2F",
|
|
3430
|
+
"x-rest-only": true,
|
|
3431
|
+
type: "object",
|
|
3432
|
+
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",
|
|
3433
|
+
allOf: [{ $ref: "#/$defs/s2fBase" }],
|
|
3434
|
+
required: ["type", "routes"],
|
|
3435
|
+
properties: {
|
|
3436
|
+
type: { const: "routes.state" },
|
|
3437
|
+
routes: {
|
|
3438
|
+
type: "array",
|
|
3439
|
+
items: {
|
|
3440
|
+
allOf: [{ $ref: "#/$defs/routeRef" }],
|
|
3441
|
+
type: "object",
|
|
3442
|
+
required: ["active"],
|
|
3443
|
+
properties: { active: { type: "boolean" } }
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3303
3447
|
}
|
|
3304
3448
|
}
|
|
3305
3449
|
};
|
|
@@ -3405,7 +3549,7 @@ var rest_schema_default = {
|
|
|
3405
3549
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
3406
3550
|
$id: "https://cancore.io/schemas/filler-protocol/v1/rest.schema.json",
|
|
3407
3551
|
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, 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/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.",
|
|
3552
|
+
$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
3553
|
"x-endpoints": [
|
|
3410
3554
|
{ method: "GET", path: "/v1/filler/auth/challenge", auth: "none", query: "#/$defs/challengeQuery", response: "messages.schema.json#/$defs/auth.challenge", errorBody: "#/$defs/unsignedErrorBody" },
|
|
3411
3555
|
{ method: "POST", path: "/v1/filler/auth", auth: "none", request: "messages.schema.json#/$defs/auth.response", response: "#/$defs/authToken", errorBody: "#/$defs/unsignedErrorBody" },
|
|
@@ -3426,7 +3570,9 @@ var rest_schema_default = {
|
|
|
3426
3570
|
{ method: "GET", path: "/v1/filler/canton/party", auth: "bearer", response: "#/$defs/cantonParty" },
|
|
3427
3571
|
{ method: "GET", path: "/v1/filler/canton/holdings", auth: "bearer", query: "#/$defs/pageQuery", response: "#/$defs/cantonHoldingList" },
|
|
3428
3572
|
{ method: "GET", path: "/v1/filler/canton/delivery-orders", auth: "bearer", query: "#/$defs/pageQuery", response: "#/$defs/cantonDeliveryOrderList" },
|
|
3429
|
-
{ method: "GET", path: "/v1/filler/canton/intents/{orderHash}", auth: "bearer", response: "#/$defs/cantonIntent" }
|
|
3573
|
+
{ method: "GET", path: "/v1/filler/canton/intents/{orderHash}", auth: "bearer", response: "#/$defs/cantonIntent" },
|
|
3574
|
+
{ method: "GET", path: "/v1/filler/routes", auth: "bearer", response: "messages.schema.json#/$defs/routes.state" },
|
|
3575
|
+
{ method: "POST", path: "/v1/filler/routes", auth: "bearer", request: "messages.schema.json#/$defs/routes.set", response: "messages.schema.json#/$defs/routes.state" }
|
|
3430
3576
|
],
|
|
3431
3577
|
"x-error-status": {
|
|
3432
3578
|
BAD_REQUEST: 400,
|
|
@@ -3447,7 +3593,8 @@ var rest_schema_default = {
|
|
|
3447
3593
|
CANTON_NOT_READY: 409,
|
|
3448
3594
|
CANTON_REFUSED: 422,
|
|
3449
3595
|
CANTON_UNAVAILABLE: 503,
|
|
3450
|
-
OPERATION_EXPIRED: 410
|
|
3596
|
+
OPERATION_EXPIRED: 410,
|
|
3597
|
+
ROUTE_NOT_APPROVED: 403
|
|
3451
3598
|
},
|
|
3452
3599
|
$defs: {
|
|
3453
3600
|
errorBody: { $ref: "messages.schema.json#/$defs/errorS2F" },
|
|
@@ -3570,6 +3717,23 @@ var rest_schema_default = {
|
|
|
3570
3717
|
proposalCid: { type: ["string", "null"] },
|
|
3571
3718
|
entryCid: { type: ["string", "null"] }
|
|
3572
3719
|
}
|
|
3720
|
+
},
|
|
3721
|
+
preapprovals: {
|
|
3722
|
+
type: "array",
|
|
3723
|
+
description: "the party's live transfer preapprovals (preapproval.create), at most one per registry admin; absent from a gateway that predates them",
|
|
3724
|
+
items: {
|
|
3725
|
+
type: "object",
|
|
3726
|
+
required: ["admin", "contractId", "instrumentAllowances", "executeBefore"],
|
|
3727
|
+
properties: {
|
|
3728
|
+
admin: { type: "string", minLength: 1 },
|
|
3729
|
+
contractId: { type: "string", minLength: 1 },
|
|
3730
|
+
instrumentAllowances: { type: "array", maxItems: 10, items: { type: "string", minLength: 1 } },
|
|
3731
|
+
executeBefore: {
|
|
3732
|
+
oneOf: [{ $ref: "messages.schema.json#/$defs/timeS" }, { type: "null" }],
|
|
3733
|
+
description: "unix s: the Daml Time (microseconds) cut to whole seconds; the preapproval expires then. null: the registry's preapproval has no validity window (DA Utilities) and never lapses"
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3573
3737
|
}
|
|
3574
3738
|
}
|
|
3575
3739
|
},
|