@ftptech/canton-agent-wallet 0.1.14 → 0.1.16

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.
@@ -29,5 +29,20 @@ export declare function makeRelaySigner(wallet: AgentWallet, opts?: {
29
29
  * Without it, a relay-prepared tx that carries the DSO outside the root
30
30
  * choice arg fails closed (the round-3 no-pin-fallback removal). */
31
31
  trustedDso?: string;
32
+ /** Optional spend ceiling: the MAX amount this signer will EVER sign for, in
33
+ * the same unit the 402 quotes (compared against `input.amount`). When set,
34
+ * the signer REFUSES to sign — fail closed, before any relay call — if the
35
+ * to-be-signed amount exceeds it. This makes the spend breaker load-bearing
36
+ * against an over-quoting (or MITM'd) merchant: the agent never signs a
37
+ * charge larger than the caller authorized, no matter what the 402 returns.
38
+ * Omitted → no ceiling (legacy behavior; the published MCP/pay path is
39
+ * unaffected when unset). */
40
+ maxPaymentValue?: string;
41
+ /** Optional expected-payee pin: the ONLY recipient this signer will sign a
42
+ * transfer to (compared against `input.receiver`). When set, the signer
43
+ * REFUSES to sign — fail closed, before any relay call — if the 402's payTo
44
+ * is anything else, defending against a MITM'd merchant that swaps `payTo`
45
+ * to drain funds to an attacker. Omitted → no pin (legacy behavior). */
46
+ expectedPayTo?: string;
32
47
  }): CantonSigner;
33
48
  //# sourceMappingURL=relay-signer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relay-signer.d.ts","sourceRoot":"","sources":["../src/relay-signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE;IACJ,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;yEAGqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB,GACL,YAAY,CA0Dd"}
1
+ {"version":3,"file":"relay-signer.d.ts","sourceRoot":"","sources":["../src/relay-signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE;IACJ,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;yEAGqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;kCAO8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;6EAIyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;CACnB,GACL,YAAY,CAmMd"}
@@ -1,5 +1,5 @@
1
1
  import { RelayClient } from "./relay-client.js";
2
- import { transfer, createTransferCommand } from "./tx.js";
2
+ import { transfer, createTransferCommand, allocate, createSenderConsent } from "./tx.js";
3
3
  import { resolveHashBinding } from "./hash-binding.js";
4
4
  import { resolveTrustedDsoParty } from "./trusted-dso.js";
5
5
  export function makeRelaySigner(wallet, opts = {}) {
@@ -17,9 +17,41 @@ export function makeRelaySigner(wallet, opts = {}) {
17
17
  // auto-DSO then works for any mainnet payment no matter how the wallet was
18
18
  // created. Without a resolvable DSO, value-moving prepared bytes carrying it
19
19
  // outside the root choice arg are refused (fail-closed).
20
+ // Spend breaker — applied at the TOP of BOTH signer arms, fail-CLOSED, BEFORE
21
+ // any relay call. Refuses to sign a merchant-quoted amount above the caller's
22
+ // ceiling or to a payee the caller did not authorize. Both pins are OPTIONAL;
23
+ // unset means the corresponding check is skipped (legacy behavior preserved).
24
+ // The amount is compared as a Number in the SAME unit as `input.amount`,
25
+ // matching the existing balance fast-fail (`Number(bal.cc) < Number(amount)`).
26
+ const enforceSpendLimits = (to, amount) => {
27
+ if (opts.expectedPayTo !== undefined && to !== opts.expectedPayTo) {
28
+ throw new Error(`refusing to sign: payee ${to} does not match the expected payTo ` +
29
+ `${opts.expectedPayTo} (a merchant cannot redirect this payment)`);
30
+ }
31
+ if (opts.maxPaymentValue !== undefined) {
32
+ const want = Number(amount);
33
+ const cap = Number(opts.maxPaymentValue);
34
+ // A configured-but-broken ceiling must FAIL CLOSED, never silently disable
35
+ // the cap: `want > NaN` is always false, so a non-finite cap would wave
36
+ // every amount through. Refuse to sign instead.
37
+ if (!Number.isFinite(cap)) {
38
+ throw new Error(`refusing to sign: configured max payment value ` +
39
+ `${JSON.stringify(opts.maxPaymentValue)} is not a finite number`);
40
+ }
41
+ if (!Number.isFinite(want)) {
42
+ throw new Error(`refusing to sign: payment amount ${JSON.stringify(amount)} is not a ` +
43
+ `finite number`);
44
+ }
45
+ if (want > cap) {
46
+ throw new Error(`refusing to sign: payment amount ${amount} exceeds the max ` +
47
+ `payment value ${opts.maxPaymentValue} (the merchant over-quoted)`);
48
+ }
49
+ }
50
+ };
20
51
  return {
21
52
  party: wallet.party,
22
53
  async signCip56Transfer(input) {
54
+ enforceSpendLimits(input.receiver, input.amount);
23
55
  const trustedDso = opts.trustedDso ?? resolveTrustedDsoParty(process.env, wallet.network);
24
56
  const updateId = await transfer(relay, wallet, {
25
57
  receiver: input.receiver,
@@ -30,7 +62,101 @@ export function makeRelaySigner(wallet, opts = {}) {
30
62
  });
31
63
  return { payerParty: wallet.party, updateId, transferInstructionCid: null };
32
64
  },
65
+ async signAllocation(input) {
66
+ // Spend breaker FIRST (fail-closed, before any relay call), exactly like
67
+ // the other arms.
68
+ enforceSpendLimits(input.receiver, input.amount);
69
+ const trustedDso = opts.trustedDso ?? resolveTrustedDsoParty(process.env, wallet.network);
70
+ const r = await allocate(relay, wallet, {
71
+ receiver: input.receiver,
72
+ amount: input.amount,
73
+ executor: input.executor,
74
+ synchronizerId: input.synchronizerId,
75
+ allocateBeforeSeconds: input.allocateBeforeSeconds,
76
+ settleBeforeSeconds: input.settleBeforeSeconds,
77
+ ...(input.transferMeta ? { transferMeta: input.transferMeta } : {}),
78
+ hashBinding,
79
+ ...(trustedDso !== undefined ? { expectInstrumentAdmin: trustedDso } : {}),
80
+ });
81
+ return {
82
+ payerParty: r.payerParty,
83
+ allocationCid: r.allocationCid,
84
+ allocationInstructionCid: r.allocationInstructionCid,
85
+ updateId: r.updateId,
86
+ };
87
+ },
88
+ async signAllocationDirect(input) {
89
+ // Spend breaker FIRST (fail-closed, before any relay call), exactly like
90
+ // the other arms.
91
+ enforceSpendLimits(input.receiver, input.amount);
92
+ // Ensure the standing both-party DirectSettlementConsent {sender, merchant}
93
+ // exists (facilitator-alone mint off the two once-total consents). On the
94
+ // first DIRECT payment the agent's own SenderConsent may not be onboarded
95
+ // yet — `mintDirectConsent` then throws; create it ONCE and retry. If the
96
+ // retry still throws, the MERCHANT has not onboarded its MerchantConsent (the
97
+ // agent cannot create that on the merchant's behalf), so surface a clear,
98
+ // actionable error preserving the original relay error as `cause`.
99
+ let directConsentCid;
100
+ try {
101
+ const mint = await relay.mintDirectConsent({
102
+ sender: wallet.party,
103
+ merchant: input.receiver,
104
+ });
105
+ directConsentCid = mint.directConsentCid;
106
+ }
107
+ catch (firstErr) {
108
+ // The agent's own SenderConsent is the only standing consent it can mint.
109
+ // Create it once (verify-before-sign, the agent's own key) then retry.
110
+ await createSenderConsent(relay, wallet, {
111
+ facilitator: input.executor,
112
+ synchronizerId: input.synchronizerId,
113
+ hashBinding,
114
+ });
115
+ try {
116
+ const mint = await relay.mintDirectConsent({
117
+ sender: wallet.party,
118
+ merchant: input.receiver,
119
+ });
120
+ directConsentCid = mint.directConsentCid;
121
+ }
122
+ catch (retryErr) {
123
+ // Still failing after the sender side is onboarded → the merchant has
124
+ // not onboarded its MerchantConsent. The agent cannot pay direct to a
125
+ // merchant that has not opted into the direct path.
126
+ throw new Error(`cannot pay merchant ${input.receiver} via allocation-direct: it has ` +
127
+ `not onboarded a MerchantConsent with this facilitator yet (the agent ` +
128
+ `created its own SenderConsent but the both-party consent still cannot ` +
129
+ `be minted). The merchant must run merchant-onboard once before it can ` +
130
+ `receive direct payments.`, { cause: retryErr instanceof Error ? retryErr : firstErr });
131
+ }
132
+ }
133
+ const trustedDso = opts.trustedDso ?? resolveTrustedDsoParty(process.env, wallet.network);
134
+ // The on-ledger lock is IDENTICAL to the allocation-api arm (same
135
+ // AllocationFactory_Allocate, receiver = merchant, executor = facilitator);
136
+ // verify-before-sign in `allocate` re-checks every money-critical field.
137
+ const r = await allocate(relay, wallet, {
138
+ receiver: input.receiver,
139
+ amount: input.amount,
140
+ executor: input.executor,
141
+ synchronizerId: input.synchronizerId,
142
+ allocateBeforeSeconds: input.allocateBeforeSeconds,
143
+ settleBeforeSeconds: input.settleBeforeSeconds,
144
+ ...(input.transferMeta ? { transferMeta: input.transferMeta } : {}),
145
+ hashBinding,
146
+ ...(trustedDso !== undefined ? { expectInstrumentAdmin: trustedDso } : {}),
147
+ });
148
+ return {
149
+ payerParty: r.payerParty,
150
+ allocationCid: r.allocationCid,
151
+ allocationInstructionCid: r.allocationInstructionCid,
152
+ updateId: r.updateId,
153
+ directConsentCid,
154
+ };
155
+ },
33
156
  async signTransferCommand(input) {
157
+ // Spend breaker FIRST — before even the balance pre-check, so a refused
158
+ // amount/payee never touches the relay (no network, no info leak).
159
+ enforceSpendLimits(input.receiver, input.amount);
34
160
  // Fast-fail an underfunded wallet: without this, an unfunded agent's pay
35
161
  // loops the client re-pay retries (each settle just rejects "no inputs")
36
162
  // for ~30s and then returns an opaque "rejected" — surface a clear
@@ -1 +1 @@
1
- {"version":3,"file":"relay-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QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/tx.d.ts CHANGED
@@ -79,6 +79,110 @@ export declare function createTransferCommand(relay: RelayClient, wallet: AgentW
79
79
  nonce: number;
80
80
  createUpdateId: string;
81
81
  }>;
82
+ /**
83
+ * allocation-api (CIP-56 DVP) — exercise `AllocationFactory_Allocate` to LOCK
84
+ * the agent's funds into an Allocation naming the facilitator as
85
+ * settlement.executor. The facilitator later submits Allocation_ExecuteTransfer
86
+ * (sponsored gas) to settle. The agent signs only the lock here (its own key;
87
+ * the choice's sole controller is transferLeg.sender = the agent) — no gas, no
88
+ * nonce, no merchant preapproval.
89
+ *
90
+ * Mirrors the cip56 `transfer` flow: resolve the allocation factory via the
91
+ * relay → build the allocate exercise → VERIFY-before-sign over the EXACT
92
+ * prepared bytes (pinning sender/receiver/amount/instrument + the executor +
93
+ * the deadline window) → sign locally → execute via relay → read back the
94
+ * created Allocation cid from THIS transaction's events.
95
+ *
96
+ * SECURITY: every money/escrow-critical field the verifier pins (sender == own
97
+ * party, receiver == merchant payTo, amount == required, instrument == intent,
98
+ * settlement.executor == facilitatorParty) is CALLER INTENT passed in `opts`,
99
+ * NOT taken from the relay's resolve response. The relay-resolved factory
100
+ * refs/admin/context are used only to BUILD the exercise; they widen nothing the
101
+ * agent will sign. The cid returned moves no funds on its own — the facilitator
102
+ * independently re-validates every field at /verify + /settle, and only the
103
+ * executor (+ baked-in sender/receiver auth) can ever move the locked funds.
104
+ */
105
+ export declare function allocate(relay: RelayClient, wallet: AgentWallet, opts: {
106
+ /** Merchant party id (PaymentRequirements.payTo). CALLER INTENT. */
107
+ receiver: string;
108
+ /** Daml Decimal amount string (PaymentRequirements.amount). CALLER INTENT. */
109
+ amount: string;
110
+ /** The facilitator party that MUST be settlement.executor
111
+ * (extra.executor = extra.facilitatorParty). CALLER INTENT — pinned by
112
+ * exact equality at the allocation's executor position. */
113
+ executor: string;
114
+ /** Synchronizer id (extra.synchronizerId). CALLER INTENT — pins the prepare's
115
+ * synchronizer + the SIGNED Metadata.synchronizer_id. */
116
+ synchronizerId: string;
117
+ /** Relative allocateBefore deadline (extra.allocateBeforeSeconds). */
118
+ allocateBeforeSeconds: number;
119
+ /** Relative settleBefore deadline (extra.settleBeforeSeconds). MUST be
120
+ * strictly greater than allocateBeforeSeconds. */
121
+ settleBeforeSeconds: number;
122
+ /** Instrument id the agent expects (default "Amulet"). CALLER INTENT. */
123
+ expectInstrumentId?: string;
124
+ /** Optional, independently-trusted instrument admin (DSO) to pin. */
125
+ expectInstrumentAdmin?: string;
126
+ /** x402 reconciliation metadata stamped into transferLeg.meta (paymentId,
127
+ * resourceUrl, version, memo?). */
128
+ transferMeta?: Record<string, string>;
129
+ /** Hash-binding policy; defaults to fail-closed (see HashBindingOptions). */
130
+ hashBinding?: HashBindingOptions;
131
+ }): Promise<{
132
+ payerParty: string;
133
+ /** The Allocation cid (the _Completed case — Amulet creates it synchronously). */
134
+ allocationCid: string | null;
135
+ /** The AllocationInstruction cid (the _Pending case). Track A rejects pending,
136
+ * but the relay surfaces it so the facilitator can return the right error. */
137
+ allocationInstructionCid: string | null;
138
+ /** updateId of the AllocationFactory_Allocate exercise. */
139
+ updateId: string;
140
+ }>;
141
+ /**
142
+ * x402-direct "Design B" onboarding (SENDER side, ONCE-TOTAL). Create the standing
143
+ * `SenderConsent {sender = self, facilitator}` the facilitator later uses to MINT
144
+ * the both-party DirectSettlementConsent for ANY merchant it names. The choice's
145
+ * sole signatory is the SENDER = the agent, so the agent signs only its own create
146
+ * (its own key; no gas, no facilitator signature). Creating the consent MOVES NO
147
+ * FUNDS — it only durably captures the sender's one-time authorization.
148
+ *
149
+ * Mirrors the cip56/v1/allocate flows: build the create exercise → VERIFY-before-sign
150
+ * over the EXACT prepared bytes (pinning the created template + the consent's
151
+ * {sender == self, facilitator} principals + act_as == self, and the foreign-party
152
+ * backstop allowing ONLY {self, facilitator}) → sign locally → execute via the relay
153
+ * → return the create's updateId.
154
+ *
155
+ * SECURITY: every pinned field is CALLER INTENT passed in `opts`, never taken from
156
+ * the relay. A relay-substituted facilitator (which could later mint a both-party
157
+ * consent and settle the agent's allocations) is rejected by the [1] facilitator pin
158
+ * + the foreign-party backstop; a relay-injected value-moving exercise / extra leg /
159
+ * foreign submitter is rejected by the create-root invariant. The cid moves no funds
160
+ * on its own — the facilitator's later DirectSettlementConsent_Execute re-validates
161
+ * every term against the live allocation.
162
+ */
163
+ export declare function createSenderConsent(relay: RelayClient, wallet: AgentWallet, opts: {
164
+ /** The facilitator party the consent grants (extra.facilitatorParty). CALLER
165
+ * INTENT — pinned by exact equality at the consent's [1] facilitator position. */
166
+ facilitator: string;
167
+ /** Caller-intent synchronizer id to PREPARE on + pin the SIGNED
168
+ * Metadata.synchronizer_id to. The consent lives on a specific synchronizer. */
169
+ synchronizerId: string;
170
+ /** Hash-binding policy; defaults to fail-closed (see HashBindingOptions). */
171
+ hashBinding?: HashBindingOptions;
172
+ }): Promise<string>;
173
+ /**
174
+ * x402-direct "Design B" onboarding (MERCHANT side, ONCE-TOTAL). Symmetric to
175
+ * `createSenderConsent`: create the standing `MerchantConsent {merchant = self,
176
+ * facilitator}` the facilitator later uses to MINT the both-party
177
+ * DirectSettlementConsent (MerchantConsent_Accept) from ANY sender it names. The
178
+ * choice's sole signatory is the MERCHANT = the agent. Creating the consent MOVES NO
179
+ * FUNDS. Same verify-before-sign guarantees as the sender side.
180
+ */
181
+ export declare function createMerchantConsent(relay: RelayClient, wallet: AgentWallet, opts: {
182
+ facilitator: string;
183
+ synchronizerId: string;
184
+ hashBinding?: HashBindingOptions;
185
+ }): Promise<string>;
82
186
  /**
83
187
  * Accept every pending incoming transfer (e.g. the agent's initial funding).
84
188
  *
@@ -99,4 +203,128 @@ export declare function claimAll(relay: RelayClient, wallet: AgentWallet, opts?:
99
203
  claimed: number;
100
204
  updateIds: string[];
101
205
  }>;
206
+ /**
207
+ * Reclaim a locked allocation: exercise `Allocation_Withdraw` on the agent's own
208
+ * `AmuletAllocation`, returning its locked funds to the agent (Track B — "locked
209
+ * funds always recoverable"). The choice's sole controller is
210
+ * `allocation.transferLeg.sender` = the agent, and `Allocation_Withdraw` returns
211
+ * the funds to the sender BY CONSTRUCTION — there is no attacker-controllable
212
+ * destination in the choice argument.
213
+ *
214
+ * SECURITY: like every path, this is NOT exempt from verify-before-sign. A
215
+ * malicious relay could return a DIFFERENT choice that DOES move value to an
216
+ * attacker (Allocation_ExecuteTransfer / a TransferFactory_Transfer drain), a
217
+ * withdraw of a DIFFERENT allocation, an injected outbound transfer leg, or a
218
+ * foreign-party submission. We pass `kind: "allocation-withdraw"`, which
219
+ * structurally proves the prepared transaction is a single `Allocation_Withdraw`
220
+ * on EXACTLY `opts.allocationCid` (caller intent, REQUIRED contract-id pin),
221
+ * submitted by the agent (act_as == wallet.party), with NO foreign party
222
+ * anywhere — and binds the signed hash to those bytes (fail-closed by default,
223
+ * exactly like the accept/allocate paths). `opts.hashBinding` lets a programmatic
224
+ * caller supply a participant-conformant recompute; the CLI resolves it from the
225
+ * environment (default fail-closed).
226
+ *
227
+ * No caller-intent synchronizer is threaded (like the claim/accept path): the
228
+ * withdraw carries no caller-chosen domain — `prepareSignExecute` omits the
229
+ * synchronizerId arg.
230
+ */
231
+ export declare function reclaimAllocation(relay: RelayClient, wallet: AgentWallet, opts: {
232
+ allocationCid: string;
233
+ hashBinding?: HashBindingOptions;
234
+ /** CALLER-INTENT reference parties for the lock-expiry withdraw: the
235
+ * allocation executor / lock holder (facilitator) and the instrument admin
236
+ * (DSO). Supply when the allocation was locked to a facilitator (Design A) so
237
+ * the verify foreign-party backstop permits the AmuletRules/round/unlock refs
238
+ * these two legitimately produce. Omit on the no-lock path. */
239
+ facilitator?: string;
240
+ instrumentAdmin?: string;
241
+ /** CALLER-INTENT allocation RECEIVER (the merchant). Supply for a "Design B"
242
+ * DIRECT allocation, where the receiver is the MERCHANT (not the facilitator)
243
+ * — the legitimate `Allocation_Withdraw` expire-lock choice-context then
244
+ * references the merchant party, so the verify foreign-party backstop must
245
+ * permit EXACTLY this caller-pinned party. Pass the allocation's known
246
+ * receiver (never a relay-supplied value). Omit for "Design A" escrow, where
247
+ * receiver == facilitator (already permitted) — behavior is then unchanged. */
248
+ receiver?: string;
249
+ }): Promise<string>;
250
+ /**
251
+ * x402-escrow "Design A" ACCEPT: the SENDER (the agent — an external party whose
252
+ * key the agent-wallet holds) exercises `X402EscrowOffer_Accept` on an
253
+ * `X402EscrowOffer` the facilitator created, to capture its one-time
254
+ * authorization. ACCEPTING MOVES NO FUNDS — it only archives the offer and creates
255
+ * the `X402Escrow` whose signatories are {facilitator, sender}; the facilitator
256
+ * later settles the locked allocation ALONE off the joint authority captured here.
257
+ * The choice's sole controller is the offer's `sender` = the agent, so the agent
258
+ * signs only its own accept (its own key; no gas, no merchant signature).
259
+ *
260
+ * Mirrors the reclaim (`reclaimAllocation` / `Allocation_Withdraw`) flow: build
261
+ * the exercise → VERIFY-before-sign over the EXACT prepared bytes → sign locally →
262
+ * execute via the relay → read back the created `X402Escrow` cid from THIS
263
+ * transaction's events (the agent is relay-only). The sender is an OBSERVER of the
264
+ * offer (not a stakeholder that has it in its ACS), so the offer contract is
265
+ * DISCLOSED via `opts.offerDisclosedContract` (the facilitator surfaces its
266
+ * created_event_blob).
267
+ *
268
+ * SECURITY: like every path, this is NOT exempt from verify-before-sign. A
269
+ * malicious relay could return a DIFFERENT, value-MOVING choice (an
270
+ * Allocation_ExecuteTransfer / TransferFactory_Transfer / CreateTransferCommand /
271
+ * Allocation_Withdraw drain), an accept of a DIFFERENT offer, an injected outbound
272
+ * transfer leg as a consequence, a relay-SUBSTITUTED facilitator (who could later
273
+ * settle the escrow to an attacker), or a foreign-party submission. We pass
274
+ * `kind: "escrow-accept"`, which structurally proves the prepared transaction is a
275
+ * single `X402EscrowOffer_Accept` on EXACTLY `opts.offerCid` (caller intent,
276
+ * REQUIRED contract-id pin), submitted by the agent (act_as == wallet.party),
277
+ * creating an escrow only among the caller-intended {sender, facilitator
278
+ * (+merchant/instrumentAdmin)} parties — and binds the signed hash to those bytes
279
+ * (fail-closed by default, exactly like the reclaim/accept paths). `opts.hashBinding`
280
+ * lets a programmatic caller supply a participant-conformant recompute; the CLI
281
+ * resolves it from the environment (default fail-closed).
282
+ *
283
+ * Returns `{ escrowCid, updateId }`. `escrowCid` is read back via the relay from
284
+ * the accept transaction's events; it is `null` if the relay could not resolve it
285
+ * within its poll budget (the cid moves no funds — the facilitator independently
286
+ * re-validates the escrow + allocation terms at settle).
287
+ */
288
+ export declare function acceptEscrowOffer(relay: RelayClient, wallet: AgentWallet, opts: {
289
+ /** The `X402EscrowOffer` cid to accept. CALLER INTENT — REQUIRED contract-id
290
+ * pin (the verify arm refuses an accept of any other contract). */
291
+ offerCid: string;
292
+ /** The offer's resolved templateId for the exercise target. The choice is
293
+ * exercised THROUGH `#x402-escrow:X402Escrow:X402EscrowOffer` by default; pass
294
+ * a concrete (package-id-qualified) templateId to override. */
295
+ offerTemplateId?: string;
296
+ /** The facilitator party (offer signatory; settles alone). CALLER INTENT —
297
+ * pinned + added to the allowed-escrow-party set. REQUIRED. */
298
+ facilitator: string;
299
+ /** Optional merchant party recorded on the created escrow (reference-only).
300
+ * Supply when the honest escrow names a distinct merchant so the backstop
301
+ * allows it; omit when merchant collapses onto facilitator/sender. */
302
+ merchant?: string;
303
+ /** Optional instrument admin (DSO) recorded on the created escrow. */
304
+ instrumentAdmin?: string;
305
+ /** Optional Decimal amount the sender intends the escrow to settle. CALLER
306
+ * INTENT — when supplied, the verify arm pins the created `X402Escrow`'s
307
+ * recorded `amount` (a Numeric the party-leaf backstop cannot see) to it by
308
+ * canonical equality, closing the amount-swap gap where a malicious/buggy
309
+ * facilitator authored the offer with an inflated amount. Never taken from the
310
+ * relay. Omit only when the caller has no intended amount to assert. */
311
+ amount?: string;
312
+ /** The sender is an OBSERVER of the offer, so disclose the offer contract.
313
+ * Shape mirrors the v1 EPAR / allocation disclosed-contract envelope. */
314
+ offerDisclosedContract?: {
315
+ templateId: string;
316
+ contractId: string;
317
+ createdEventBlob: string;
318
+ synchronizerId: string;
319
+ };
320
+ /** Caller-intent synchronizer id to PREPARE on + pin the SIGNED
321
+ * Metadata.synchronizer_id to. REQUIRED (the accept carries a caller-chosen
322
+ * domain — the offer/escrow live on a specific synchronizer). */
323
+ synchronizerId: string;
324
+ /** Hash-binding policy; defaults to fail-closed (see HashBindingOptions). */
325
+ hashBinding?: HashBindingOptions;
326
+ }): Promise<{
327
+ escrowCid: string | null;
328
+ updateId: string;
329
+ }>;
102
330
  //# sourceMappingURL=tx.d.ts.map
package/dist/tx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../src/tx.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAKL,KAAK,kBAAkB,EAIxB,MAAM,sBAAsB,CAAC;AAiI9B;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;6DAEyD;IACzD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;6EAGyE;IACzE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC,GACA,OAAO,CAAC,MAAM,CAAC,CAkEjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,EACnB,IAAI,EA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