Skip to content

Interface: CantonRequirementsSpec ​

Defined in: packages/x402-express/src/schemes/canton-exact.ts:60

Declarative requirements for canton-exact.

Extends ​

Properties ​

amount ​

ts
amount: Resolvable<string>;

Defined in: packages/x402-express/src/scheme.ts:68

Price in atomic units, as an integer string: 1 CC = 1e10, so "500000000" is 0.05 CC. The same unit the wire carries — the middleware does not convert, so a price means the same thing here as in a builder or in an echoed requirement.

Inherited from ​

BaseRequirementsSpec.amount


asset ​

ts
asset: Resolvable<string>;

Defined in: packages/x402-express/src/schemes/canton-exact.ts:77

The instrument id this way to pay is priced in. Required, since amount is atomic units of whatever this names.

ts
asset: "Amulet"   // Canton Coin. NOT "CC" — that is the wire SYMBOL, and
                  // Amulet is the one instrument whose id differs from it.
asset: "USDCx"    // id and symbol match here

Only the id. The registry admin, the synchronizer and the relaying feePayer are the facilitator's own facts, so they are always read from its GET /v2/supported and cannot be configured here: a wrong one would only surface at verify, after the payer had signed. An id the facilitator does not advertise is refused, and the refusal lists what it does.


description? ​

ts
description?: Resolvable<string>;

Defined in: packages/x402-express/src/scheme.ts:48

Human description. Default: Access to <path>.

Inherited from ​

BaseRequirementsSpec.description


executeBeforeSeconds? ​

ts
executeBeforeSeconds?: Resolvable<number>;

Defined in: packages/x402-express/src/schemes/canton-exact.ts:84

Seconds of life the payer gives the transfer it signs. Default 120. Unlike maxTimeoutSeconds this one reaches the ledger, as the transfer's executeBefore, and the verifier refuses a transfer already inside its last few seconds. It is the only deadline left in the protocol.


maxTimeoutSeconds? ​

ts
maxTimeoutSeconds?: Resolvable<number>;

Defined in: packages/x402-express/src/scheme.ts:54

Seconds the client has to complete payment. Default 60. Compared: the facilitator holds a payment for at most this long, and a payer echoing a longer one is refused with policy_timeout.

Inherited from ​

BaseRequirementsSpec.maxTimeoutSeconds


memo? ​

ts
memo?: (req) => string | Promise<string>;

Defined in: packages/x402-express/src/schemes/canton-exact.ts:105

Generate (and, if you want, persist) the merchant reference for this challenge — an order or payment id to reconcile against. Called once per challenge ISSUED: on the 402 that offers terms, and not on a request that pays terms already offered. Persisting here is therefore safe — a successful payment mints nothing. Quoting a memo BINDS it: the payer must sign the identical value or verification refuses the payment, which is what makes it usable as a reconciliation key and as a replay key. UTF-8, at most 256 bytes. Omit it to quote none.

Name it ONCE in the shared terms if it books anything. A 402 is one sale however many ways it offers to pay for it, and entries carrying the same function are issued one memo between them — so the same body written out in two entries is two functions, two memos, and two orders booked for a sale that is paid once. An entry naming its own overrides the shared one and gets its own, which is the merchant asking for that.

(Function-only by design: a static value would tag every payment alike, which is the one thing reference data must not do.)

Parameters ​

req ​

Request

Returns ​

string | Promise<string>


network? ​

ts
network?: Resolvable<string>;

Defined in: packages/x402-express/src/scheme.ts:42

Network id — on Canton a canton:<name> from x402-core's networks.

Optional when the scheme can discover it; see the scheme's own spec.

Inherited from ​

BaseRequirementsSpec.network


payTo ​

ts
payTo: Resolvable<string>;

Defined in: packages/x402-express/src/scheme.ts:36

Merchant party receiving payment.

Inherited from ​

BaseRequirementsSpec.payTo


resource? ​

ts
resource?: Resolvable<string>;

Defined in: packages/x402-express/src/scheme.ts:46

Resource URL. Default: the request's absolute URL.

Inherited from ​

BaseRequirementsSpec.resource


scheme? ​

ts
scheme?: Resolvable<string>;

Defined in: packages/x402-express/src/scheme.ts:44

Scheme id. Defaults to the scheme adapter's own id.

Inherited from ​

BaseRequirementsSpec.scheme