@ftptech/canton-agent-wallet 0.1.15 → 0.1.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/dist/tx.js CHANGED
@@ -7,8 +7,14 @@
7
7
  */
8
8
  import { signHashB64 } from "./keys.js";
9
9
  import { resolveHashBinding } from "./hash-binding.js";
10
- import { assertHashBinding, assertPreparedTransferMatches, assertPreparedCreateTransferCommandMatches, assertPreparedAcceptMatches, } from "./verify-prepared.js";
10
+ import { assertHashBinding, assertPreparedTransferMatches, assertPreparedCreateTransferCommandMatches, assertPreparedAcceptMatches, assertPreparedAllocationMatches, assertPreparedAllocationWithdrawMatches, assertPreparedEscrowAcceptMatches, assertPreparedConsentCreateMatches, } from "./verify-prepared.js";
11
11
  const TI_IFACE = "#splice-api-token-transfer-instruction-v1:Splice.Api.Token.TransferInstructionV1:TransferInstruction";
12
+ /** The AllocationV1 interface the reclaim (`Allocation_Withdraw`) choice is
13
+ * exercised THROUGH. Like TI_IFACE, the `#`-prefixed package name lets the
14
+ * participant resolve the interface package at prepare time (the concrete
15
+ * AmuletAllocation template implements it). CALLER INTENT — the verify arm
16
+ * pins the target contract id + the choice + own-party, never this string. */
17
+ const ALLOCATION_IFACE = "#splice-api-token-allocation-v1:Splice.Api.Token.AllocationV1:Allocation";
12
18
  /**
13
19
  * The instrument id the agent's self-custody wallet pays in: Canton Coin is the
14
20
  * Splice "Amulet" instrument. This is CALLER INTENT — a fixed value the agent
@@ -20,6 +26,29 @@ const TI_IFACE = "#splice-api-token-transfer-instruction-v1:Splice.Api.Token.Tra
20
26
  * the instrument id to this constant; the admin is validated only positionally.
21
27
  */
22
28
  const EXPECTED_INSTRUMENT_ID = "Amulet";
29
+ /**
30
+ * The x402-escrow "Design A" offer template the sender accepts. The `#`-prefixed
31
+ * package NAME (not the hex package-id) lets the participant resolve the package
32
+ * at prepare time — the same `#package:Module:Entity` convention the TI/Allocation
33
+ * interface choices use above. CALLER INTENT — the verify arm pins the target
34
+ * contract id + the choice + own-party, never this string; the optional
35
+ * template-qualified-name pin (`X402Escrow:X402EscrowOffer`) additionally pins the
36
+ * exercised template's module:entity. (Deployed package-id, for reference:
37
+ * c3cfbcddd75cb7a986412fd088bcfdc8d00e6d6672ab772903c6fee22c0dd228, module
38
+ * X402Escrow, template X402EscrowOffer.) */
39
+ const X402_ESCROW_OFFER_TEMPLATE_ID = "#x402-escrow:X402Escrow:X402EscrowOffer";
40
+ /** The exercised offer template's `module:entity` qualified name (package-id
41
+ * dropped — it changes across upgrades), pinned by the escrow-accept verify arm. */
42
+ const X402_ESCROW_OFFER_QUALIFIED_NAME = "X402Escrow:X402EscrowOffer";
43
+ /** The x402-direct "Design B" standing-consent templates the agent creates by
44
+ * SIGNING ITS OWN create (signatory = the agent). The `#`-prefixed package NAME
45
+ * lets the participant resolve its vetted version at prepare time — the same
46
+ * convention the escrow offer / TI / Allocation interface refs use above. CALLER
47
+ * INTENT — the verify arm pins the created template's module:entity + the consent's
48
+ * {self, facilitator} principals, never this string. (Deployed package-id, for
49
+ * reference: x402-direct-0.1.0-f819db3288986a7f6c3157359ed02040e0a6080ceb6890309ecbb71eeeb93780.) */
50
+ const X402_DIRECT_SENDER_CONSENT_TEMPLATE_ID = "#x402-direct:X402Direct:SenderConsent";
51
+ const X402_DIRECT_MERCHANT_CONSENT_TEMPLATE_ID = "#x402-direct:X402Direct:MerchantConsent";
23
52
  function rid(prefix) {
24
53
  return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
25
54
  }
@@ -74,6 +103,39 @@ synchronizerId) {
74
103
  else if (verify.kind === "v1") {
75
104
  assertPreparedCreateTransferCommandMatches(preparedTransaction, verify.expect);
76
105
  }
106
+ else if (verify.kind === "allocation") {
107
+ // allocation-api path: structurally prove the prepared tx is a single
108
+ // AllocationFactory_Allocate locking funds with the intended
109
+ // sender/receiver/amount/instrument AND naming the facilitator (not an
110
+ // attacker) as settlement.executor, with a valid deadline window.
111
+ assertPreparedAllocationMatches(preparedTransaction, verify.expect);
112
+ }
113
+ else if (verify.kind === "allocation-withdraw") {
114
+ // reclaim path (Track B): structurally prove the prepared tx is a single
115
+ // Allocation_Withdraw on the caller's OWN allocation cid, submitted by the
116
+ // agent, with no outbound transfer leg and no foreign party — Allocation_Withdraw
117
+ // returns funds to the sender by construction, so anything else is a redirect.
118
+ assertPreparedAllocationWithdrawMatches(preparedTransaction, verify.expect);
119
+ }
120
+ else if (verify.kind === "escrow-accept") {
121
+ // x402-escrow "Design A" accept: structurally prove the prepared tx is a
122
+ // single X402EscrowOffer_Accept on the caller's OWN offer cid, submitted by
123
+ // the agent (sender), creating an X402Escrow only among the caller-intended
124
+ // parties — no value-moving choice, no injected outbound transfer leg, no
125
+ // foreign party. Accepting moves NO funds (it only archives the offer + creates
126
+ // the escrow), so anything else is a relay-injected drain.
127
+ assertPreparedEscrowAcceptMatches(preparedTransaction, verify.expect);
128
+ }
129
+ else if (verify.kind === "consent-create") {
130
+ // x402-direct "Design B" onboarding: structurally prove the prepared tx is a
131
+ // single SenderConsent / MerchantConsent CREATE by the agent (the signing
132
+ // party), naming exactly {selfParty, facilitator} — no value-moving choice, no
133
+ // injected outbound leg, no relay-substituted facilitator, no foreign-party
134
+ // submission. Creating a standing consent moves NO funds (it only captures the
135
+ // party's one-time authorization), so anything else is a relay-injected drain or
136
+ // a substituted facilitator that could later settle the agent's allocations.
137
+ assertPreparedConsentCreateMatches(preparedTransaction, verify.expect);
138
+ }
77
139
  else {
78
140
  // claim path: structurally prove the prepared tx is a single inbound
79
141
  // TransferInstruction_Accept by the agent, not an outbound drain.
@@ -290,6 +352,199 @@ export async function createTransferCommand(relay, wallet, opts) {
290
352
  createUpdateId,
291
353
  };
292
354
  }
355
+ /**
356
+ * allocation-api (CIP-56 DVP) — exercise `AllocationFactory_Allocate` to LOCK
357
+ * the agent's funds into an Allocation naming the facilitator as
358
+ * settlement.executor. The facilitator later submits Allocation_ExecuteTransfer
359
+ * (sponsored gas) to settle. The agent signs only the lock here (its own key;
360
+ * the choice's sole controller is transferLeg.sender = the agent) — no gas, no
361
+ * nonce, no merchant preapproval.
362
+ *
363
+ * Mirrors the cip56 `transfer` flow: resolve the allocation factory via the
364
+ * relay → build the allocate exercise → VERIFY-before-sign over the EXACT
365
+ * prepared bytes (pinning sender/receiver/amount/instrument + the executor +
366
+ * the deadline window) → sign locally → execute via relay → read back the
367
+ * created Allocation cid from THIS transaction's events.
368
+ *
369
+ * SECURITY: every money/escrow-critical field the verifier pins (sender == own
370
+ * party, receiver == merchant payTo, amount == required, instrument == intent,
371
+ * settlement.executor == facilitatorParty) is CALLER INTENT passed in `opts`,
372
+ * NOT taken from the relay's resolve response. The relay-resolved factory
373
+ * refs/admin/context are used only to BUILD the exercise; they widen nothing the
374
+ * agent will sign. The cid returned moves no funds on its own — the facilitator
375
+ * independently re-validates every field at /verify + /settle, and only the
376
+ * executor (+ baked-in sender/receiver auth) can ever move the locked funds.
377
+ */
378
+ export async function allocate(relay, wallet, opts) {
379
+ if (!(opts.settleBeforeSeconds > opts.allocateBeforeSeconds)) {
380
+ throw new Error(`allocate: settleBeforeSeconds (${opts.settleBeforeSeconds}) must be > ` +
381
+ `allocateBeforeSeconds (${opts.allocateBeforeSeconds})`);
382
+ }
383
+ const bal = await relay.balance(wallet.party);
384
+ const inputHoldingCids = bal.holdings.map((h) => h.cid);
385
+ const f = await relay.resolveAllocationFactory({
386
+ sender: wallet.party,
387
+ receiver: opts.receiver,
388
+ amount: opts.amount,
389
+ executor: opts.executor,
390
+ allocateBeforeSeconds: opts.allocateBeforeSeconds,
391
+ settleBeforeSeconds: opts.settleBeforeSeconds,
392
+ ...(opts.transferMeta ? { meta: opts.transferMeta } : {}),
393
+ });
394
+ const now = Date.now();
395
+ // Mirror the relay's resolve deadlines so verify-before-sign sees the same
396
+ // window the relay prepared against. The verify arm asserts allocateBefore <
397
+ // settleBefore and settleBefore in the future; we compute them here from the
398
+ // caller-intent relative seconds so the relay cannot widen them silently.
399
+ const requestedAt = new Date(now - 2000).toISOString();
400
+ const allocateBefore = new Date(now + opts.allocateBeforeSeconds * 1000).toISOString();
401
+ const settleBefore = new Date(now + opts.settleBeforeSeconds * 1000).toISOString();
402
+ const allocation = {
403
+ settlement: {
404
+ executor: opts.executor,
405
+ settlementRef: f.settlementRef,
406
+ requestedAt,
407
+ allocateBefore,
408
+ settleBefore,
409
+ meta: { values: {} },
410
+ },
411
+ transferLegId: f.transferLegId,
412
+ transferLeg: {
413
+ sender: wallet.party,
414
+ receiver: opts.receiver,
415
+ amount: opts.amount,
416
+ instrumentId: f.instrumentId,
417
+ meta: { values: opts.transferMeta ?? {} },
418
+ },
419
+ };
420
+ const ex = {
421
+ ExerciseCommand: {
422
+ templateId: f.allocationFactoryTemplateId,
423
+ contractId: f.factoryId,
424
+ choice: "AllocationFactory_Allocate",
425
+ choiceArgument: {
426
+ expectedAdmin: f.instrumentId.admin,
427
+ allocation,
428
+ requestedAt,
429
+ inputHoldingCids,
430
+ extraArgs: { context: f.choiceContextData, meta: { values: {} } },
431
+ },
432
+ },
433
+ };
434
+ const updateId = await prepareSignExecute(relay, wallet, [ex], f.disclosedContracts, {
435
+ kind: "allocation",
436
+ expect: {
437
+ // Trust anchors are CALLER INTENT only — never the relay's resolve response:
438
+ sender: wallet.party,
439
+ // OWN-PARTY PIN: the allocate controller IS the sender, so the prepared
440
+ // transferLeg.sender MUST equal the agent's own party. Threaded from
441
+ // wallet.party (known independently of the relay). Fails closed on any
442
+ // sender/receiver transposition regardless of the unconfirmed field order.
443
+ expectedSender: wallet.party,
444
+ receiver: opts.receiver,
445
+ amount: opts.amount,
446
+ instrumentId: opts.expectInstrumentId ?? EXPECTED_INSTRUMENT_ID,
447
+ executor: opts.executor,
448
+ // Pin the exercise's target to the SAME factory cid we built against
449
+ // (resolve→prepare TOCTOU defense-in-depth).
450
+ expectedContractId: f.factoryId,
451
+ ...(opts.expectInstrumentAdmin !== undefined
452
+ ? { instrumentAdmin: opts.expectInstrumentAdmin }
453
+ : {}),
454
+ synchronizerId: opts.synchronizerId,
455
+ nowMs: Date.now(),
456
+ },
457
+ }, opts.hashBinding, opts.synchronizerId);
458
+ // Read THIS transaction's events (via the relay) to surface the created
459
+ // Allocation / AllocationInstruction cid. The relay resolves it for us (the
460
+ // agent is relay-only). The cid moves no funds; the facilitator re-validates
461
+ // and executes.
462
+ const alloc = await relay.allocationResult(wallet.party, updateId);
463
+ return {
464
+ payerParty: wallet.party,
465
+ allocationCid: alloc.allocationCid ?? null,
466
+ allocationInstructionCid: alloc.allocationInstructionCid ?? null,
467
+ updateId,
468
+ };
469
+ }
470
+ /**
471
+ * x402-direct "Design B" onboarding (SENDER side, ONCE-TOTAL). Create the standing
472
+ * `SenderConsent {sender = self, facilitator}` the facilitator later uses to MINT
473
+ * the both-party DirectSettlementConsent for ANY merchant it names. The choice's
474
+ * sole signatory is the SENDER = the agent, so the agent signs only its own create
475
+ * (its own key; no gas, no facilitator signature). Creating the consent MOVES NO
476
+ * FUNDS — it only durably captures the sender's one-time authorization.
477
+ *
478
+ * Mirrors the cip56/v1/allocate flows: build the create exercise → VERIFY-before-sign
479
+ * over the EXACT prepared bytes (pinning the created template + the consent's
480
+ * {sender == self, facilitator} principals + act_as == self, and the foreign-party
481
+ * backstop allowing ONLY {self, facilitator}) → sign locally → execute via the relay
482
+ * → return the create's updateId.
483
+ *
484
+ * SECURITY: every pinned field is CALLER INTENT passed in `opts`, never taken from
485
+ * the relay. A relay-substituted facilitator (which could later mint a both-party
486
+ * consent and settle the agent's allocations) is rejected by the [1] facilitator pin
487
+ * + the foreign-party backstop; a relay-injected value-moving exercise / extra leg /
488
+ * foreign submitter is rejected by the create-root invariant. The cid moves no funds
489
+ * on its own — the facilitator's later DirectSettlementConsent_Execute re-validates
490
+ * every term against the live allocation.
491
+ */
492
+ export async function createSenderConsent(relay, wallet, opts) {
493
+ return createDirectConsent(relay, wallet, {
494
+ consent: "sender",
495
+ templateId: X402_DIRECT_SENDER_CONSENT_TEMPLATE_ID,
496
+ // SenderConsent create-args (Daml declaration order): [0] sender, [1] facilitator.
497
+ createArguments: { sender: wallet.party, facilitator: opts.facilitator },
498
+ facilitator: opts.facilitator,
499
+ synchronizerId: opts.synchronizerId,
500
+ ...(opts.hashBinding ? { hashBinding: opts.hashBinding } : {}),
501
+ });
502
+ }
503
+ /**
504
+ * x402-direct "Design B" onboarding (MERCHANT side, ONCE-TOTAL). Symmetric to
505
+ * `createSenderConsent`: create the standing `MerchantConsent {merchant = self,
506
+ * facilitator}` the facilitator later uses to MINT the both-party
507
+ * DirectSettlementConsent (MerchantConsent_Accept) from ANY sender it names. The
508
+ * choice's sole signatory is the MERCHANT = the agent. Creating the consent MOVES NO
509
+ * FUNDS. Same verify-before-sign guarantees as the sender side.
510
+ */
511
+ export async function createMerchantConsent(relay, wallet, opts) {
512
+ return createDirectConsent(relay, wallet, {
513
+ consent: "merchant",
514
+ templateId: X402_DIRECT_MERCHANT_CONSENT_TEMPLATE_ID,
515
+ // MerchantConsent create-args (Daml declaration order): [0] merchant, [1] facilitator.
516
+ createArguments: { merchant: wallet.party, facilitator: opts.facilitator },
517
+ facilitator: opts.facilitator,
518
+ synchronizerId: opts.synchronizerId,
519
+ ...(opts.hashBinding ? { hashBinding: opts.hashBinding } : {}),
520
+ });
521
+ }
522
+ /** Shared create+verify+sign for the two standing x402-direct consents (the only
523
+ * difference is the template + the [0] field label). No funds move; the consent
524
+ * binds exactly {self, facilitator}. */
525
+ async function createDirectConsent(relay, wallet, args) {
526
+ const ex = {
527
+ CreateCommand: {
528
+ templateId: args.templateId,
529
+ createArguments: args.createArguments,
530
+ },
531
+ };
532
+ return prepareSignExecute(relay, wallet, [ex], [], // a bare consent create discloses nothing (signatory = the agent).
533
+ // VERIFY-before-sign: the prepared tx MUST be a single SenderConsent /
534
+ // MerchantConsent create by the agent naming exactly {self, facilitator} —
535
+ // never a relay-swapped value-moving choice, a substituted facilitator, an
536
+ // outbound drain, or a foreign-party submission.
537
+ {
538
+ kind: "consent-create",
539
+ expect: {
540
+ selfParty: wallet.party,
541
+ facilitator: args.facilitator,
542
+ consent: args.consent,
543
+ synchronizerId: args.synchronizerId,
544
+ nowMs: Date.now(),
545
+ },
546
+ }, args.hashBinding, args.synchronizerId);
547
+ }
293
548
  /**
294
549
  * Accept every pending incoming transfer (e.g. the agent's initial funding).
295
550
  *
@@ -327,4 +582,164 @@ export async function claimAll(relay, wallet, opts = {}) {
327
582
  }
328
583
  return { claimed: pending.length, updateIds };
329
584
  }
585
+ /**
586
+ * Reclaim a locked allocation: exercise `Allocation_Withdraw` on the agent's own
587
+ * `AmuletAllocation`, returning its locked funds to the agent (Track B — "locked
588
+ * funds always recoverable"). The choice's sole controller is
589
+ * `allocation.transferLeg.sender` = the agent, and `Allocation_Withdraw` returns
590
+ * the funds to the sender BY CONSTRUCTION — there is no attacker-controllable
591
+ * destination in the choice argument.
592
+ *
593
+ * SECURITY: like every path, this is NOT exempt from verify-before-sign. A
594
+ * malicious relay could return a DIFFERENT choice that DOES move value to an
595
+ * attacker (Allocation_ExecuteTransfer / a TransferFactory_Transfer drain), a
596
+ * withdraw of a DIFFERENT allocation, an injected outbound transfer leg, or a
597
+ * foreign-party submission. We pass `kind: "allocation-withdraw"`, which
598
+ * structurally proves the prepared transaction is a single `Allocation_Withdraw`
599
+ * on EXACTLY `opts.allocationCid` (caller intent, REQUIRED contract-id pin),
600
+ * submitted by the agent (act_as == wallet.party), with NO foreign party
601
+ * anywhere — and binds the signed hash to those bytes (fail-closed by default,
602
+ * exactly like the accept/allocate paths). `opts.hashBinding` lets a programmatic
603
+ * caller supply a participant-conformant recompute; the CLI resolves it from the
604
+ * environment (default fail-closed).
605
+ *
606
+ * No caller-intent synchronizer is threaded (like the claim/accept path): the
607
+ * withdraw carries no caller-chosen domain — `prepareSignExecute` omits the
608
+ * synchronizerId arg.
609
+ */
610
+ export async function reclaimAllocation(relay, wallet, opts) {
611
+ const hashBinding = opts.hashBinding ?? resolveHashBinding();
612
+ // Resolve the (possibly empty) withdraw choice-context + the disclosed
613
+ // AmuletAllocation contract via the relay (the agent has no Scan access).
614
+ const ctx = await relay.resolveWithdraw({ allocationCid: opts.allocationCid });
615
+ const ex = {
616
+ ExerciseCommand: {
617
+ // Exercise THROUGH the AllocationV1 interface; the concrete AmuletAllocation
618
+ // implements it. The choice's controller is transferLeg.sender = the agent.
619
+ templateId: ALLOCATION_IFACE,
620
+ contractId: opts.allocationCid,
621
+ choice: "Allocation_Withdraw",
622
+ choiceArgument: {
623
+ extraArgs: { context: ctx.choiceContextData, meta: { values: {} } },
624
+ },
625
+ },
626
+ };
627
+ return prepareSignExecute(relay, wallet, [ex], ctx.disclosedContracts,
628
+ // VERIFY-before-sign: the prepared tx MUST be a single Allocation_Withdraw on
629
+ // the caller's OWN allocation cid by the agent — never a relay-swapped choice,
630
+ // a different contract, an outbound drain, or a foreign-party submission.
631
+ {
632
+ kind: "allocation-withdraw",
633
+ expect: {
634
+ selfParty: wallet.party,
635
+ allocationCid: opts.allocationCid,
636
+ nowMs: Date.now(),
637
+ ...(opts.facilitator ? { facilitator: opts.facilitator } : {}),
638
+ ...(opts.instrumentAdmin ? { instrumentAdmin: opts.instrumentAdmin } : {}),
639
+ // Design B DIRECT: pin the allocation's MERCHANT receiver so the verify
640
+ // backstop permits exactly that one party (Design A omits it — receiver ==
641
+ // facilitator). Caller intent only; never the relay's value.
642
+ ...(opts.receiver ? { receiver: opts.receiver } : {}),
643
+ },
644
+ }, hashBinding);
645
+ }
646
+ /**
647
+ * x402-escrow "Design A" ACCEPT: the SENDER (the agent — an external party whose
648
+ * key the agent-wallet holds) exercises `X402EscrowOffer_Accept` on an
649
+ * `X402EscrowOffer` the facilitator created, to capture its one-time
650
+ * authorization. ACCEPTING MOVES NO FUNDS — it only archives the offer and creates
651
+ * the `X402Escrow` whose signatories are {facilitator, sender}; the facilitator
652
+ * later settles the locked allocation ALONE off the joint authority captured here.
653
+ * The choice's sole controller is the offer's `sender` = the agent, so the agent
654
+ * signs only its own accept (its own key; no gas, no merchant signature).
655
+ *
656
+ * Mirrors the reclaim (`reclaimAllocation` / `Allocation_Withdraw`) flow: build
657
+ * the exercise → VERIFY-before-sign over the EXACT prepared bytes → sign locally →
658
+ * execute via the relay → read back the created `X402Escrow` cid from THIS
659
+ * transaction's events (the agent is relay-only). The sender is an OBSERVER of the
660
+ * offer (not a stakeholder that has it in its ACS), so the offer contract is
661
+ * DISCLOSED via `opts.offerDisclosedContract` (the facilitator surfaces its
662
+ * created_event_blob).
663
+ *
664
+ * SECURITY: like every path, this is NOT exempt from verify-before-sign. A
665
+ * malicious relay could return a DIFFERENT, value-MOVING choice (an
666
+ * Allocation_ExecuteTransfer / TransferFactory_Transfer / CreateTransferCommand /
667
+ * Allocation_Withdraw drain), an accept of a DIFFERENT offer, an injected outbound
668
+ * transfer leg as a consequence, a relay-SUBSTITUTED facilitator (who could later
669
+ * settle the escrow to an attacker), or a foreign-party submission. We pass
670
+ * `kind: "escrow-accept"`, which structurally proves the prepared transaction is a
671
+ * single `X402EscrowOffer_Accept` on EXACTLY `opts.offerCid` (caller intent,
672
+ * REQUIRED contract-id pin), submitted by the agent (act_as == wallet.party),
673
+ * creating an escrow only among the caller-intended {sender, facilitator
674
+ * (+merchant/instrumentAdmin)} parties — and binds the signed hash to those bytes
675
+ * (fail-closed by default, exactly like the reclaim/accept paths). `opts.hashBinding`
676
+ * lets a programmatic caller supply a participant-conformant recompute; the CLI
677
+ * resolves it from the environment (default fail-closed).
678
+ *
679
+ * Returns `{ escrowCid, updateId }`. `escrowCid` is read back via the relay from
680
+ * the accept transaction's events; it is `null` if the relay could not resolve it
681
+ * within its poll budget (the cid moves no funds — the facilitator independently
682
+ * re-validates the escrow + allocation terms at settle).
683
+ */
684
+ export async function acceptEscrowOffer(relay, wallet, opts) {
685
+ const hashBinding = opts.hashBinding ?? resolveHashBinding();
686
+ const offerTemplateId = opts.offerTemplateId ?? X402_ESCROW_OFFER_TEMPLATE_ID;
687
+ // X402EscrowOffer_Accept takes NO arguments (the choice has no `with` block) —
688
+ // it captures the sender's authorization and creates the X402Escrow. Encode an
689
+ // empty choice argument; the verify arm proves the chosen value introduces no
690
+ // party (the created escrow's parties live in the consequence Create, where the
691
+ // foreign-party backstop pins them to caller intent).
692
+ const ex = {
693
+ ExerciseCommand: {
694
+ templateId: offerTemplateId,
695
+ contractId: opts.offerCid,
696
+ choice: "X402EscrowOffer_Accept",
697
+ choiceArgument: {},
698
+ },
699
+ };
700
+ // Disclose the offer (the sender is an observer, not a stakeholder with it in
701
+ // its ACS). Empty when the caller did not supply the blob (the relay/facilitator
702
+ // may already have it in scope); the verify arm does not depend on disclosure.
703
+ const disclosedContracts = opts.offerDisclosedContract
704
+ ? [
705
+ {
706
+ templateId: opts.offerDisclosedContract.templateId,
707
+ contractId: opts.offerDisclosedContract.contractId,
708
+ createdEventBlob: opts.offerDisclosedContract.createdEventBlob,
709
+ synchronizerId: opts.offerDisclosedContract.synchronizerId,
710
+ },
711
+ ]
712
+ : [];
713
+ const updateId = await prepareSignExecute(relay, wallet, [ex], disclosedContracts,
714
+ // VERIFY-before-sign: the prepared tx MUST be a single X402EscrowOffer_Accept
715
+ // on the caller's OWN offer cid by the agent (sender) — never a relay-swapped
716
+ // (value-moving) choice, a different contract, an outbound drain, a
717
+ // relay-substituted facilitator, or a foreign-party submission.
718
+ {
719
+ kind: "escrow-accept",
720
+ expect: {
721
+ selfParty: wallet.party,
722
+ offerCid: opts.offerCid,
723
+ facilitator: opts.facilitator,
724
+ ...(opts.merchant !== undefined ? { merchant: opts.merchant } : {}),
725
+ ...(opts.instrumentAdmin !== undefined
726
+ ? { instrumentAdmin: opts.instrumentAdmin }
727
+ : {}),
728
+ // Pin the created escrow's recorded amount to caller intent (closes the
729
+ // amount-swap gap — a Numeric the party backstop cannot see).
730
+ ...(opts.amount !== undefined ? { amount: opts.amount } : {}),
731
+ // Pin the exercised template's module:entity (package-id dropped) and the
732
+ // SIGNED synchronizer to caller intent.
733
+ templateQualifiedName: X402_ESCROW_OFFER_QUALIFIED_NAME,
734
+ synchronizerId: opts.synchronizerId,
735
+ nowMs: Date.now(),
736
+ },
737
+ }, hashBinding, opts.synchronizerId);
738
+ // Read THIS transaction's events (via the relay) to surface the created
739
+ // X402Escrow cid. The agent is relay-only; the relay reads the tx by updateId
740
+ // and matches the created `X402Escrow` template. The cid moves no funds — the
741
+ // facilitator re-validates the escrow + allocation terms at settle.
742
+ const res = await relay.escrowResult(wallet.party, updateId).catch(() => null);
743
+ return { escrowCid: res?.escrowCid ?? null, updateId };
744
+ }
330
745
  //# sourceMappingURL=tx.js.map
package/dist/tx.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tx.js","sourceRoot":"","sources":["../src/tx.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,0CAA0C,EAC1C,2BAA2B,GAK5B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,QAAQ,GACZ,sGAAsG,CAAC;AAEzG;;;;;;;;;GASG;AACH,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAExC,SAAS,GAAG,CAAC,MAAc;IACzB,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC7E,CAAC;AAiBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,KAAK,UAAU,kBAAkB,CAC/B,KAAkB,EAClB,MAAmB,EACnB,QAAmB,EACnB,kBAA6B,EAC7B,MAAkB,EAClB,WAAgC;AAChC;;;qEAGqE;AACrE,cAAuB;IAEvB,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,aAAa,CAA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