@ftptech/canton-agent-wallet 0.5.1 → 0.6.1

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.
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * makeRelaySigner — a CantonSigner backed by the facilitator relay + the agent's
3
- * self-custody key. It implements the allocation-direct x402 transfer method:
3
+ * self-custody key. It implements the transfer-factory x402 transfer method:
4
4
  *
5
- * - `signAllocationDirect` (allocation-direct, CIP-56 DVP "2-tx DIRECT"):
6
- * ensure the standing both-party DirectSettlementConsent, resolve the
7
- * AllocationFactory (+ its disclosed contracts / choice context) via the
8
- * relay, build AllocationFactory_Allocate, verify-before-sign, sign locally,
9
- * execute.
5
+ * - `signTransferFactory` (transfer-factory, "V3", 1-tx meta-transaction):
6
+ * the relay PREPARES a token-standard `TransferFactory_Transfer` (sender =
7
+ * the agent, receiver = the merchant); verify-before-sign pins every
8
+ * money-critical field, the agent signs locally, and the relay stashes the
9
+ * signed submission for the facilitator to relay at /settle.
10
10
  *
11
- * The x402 client (`ExactCantonScheme`) calls `signAllocationDirect` when the
12
- * 402's `extra.assetTransferMethod === "allocation-direct"` (see scheme.ts). The relay
13
- * only prepares + forwards; it never holds the key, so it can never move the
14
- * agent's funds, and verify-before-sign + hash-binding keep the self-custody
11
+ * The x402 client (`ExactCantonScheme`) calls `signTransferFactory` when the
12
+ * 402's `extra.assetTransferMethod === "transfer-factory"` (see scheme.ts). The
13
+ * relay only prepares + forwards; it never holds the key, so it can never move
14
+ * the agent's funds, and verify-before-sign + hash-binding keep the self-custody
15
15
  * guarantee.
16
16
  */
17
17
  import type { CantonSigner } from "@ftptech/x402-canton-client";
@@ -1 +1 @@
1
- {"version":3,"file":"relay-signer.d.ts","sourceRoot":"","sources":["../src/relay-signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAUhE,OAAO,KA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,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,CAsFd"}
@@ -1,5 +1,5 @@
1
1
  import { RelayClient } from "./relay-client.js";
2
- import { allocate, createSenderConsent, isStaleInputHoldingError, payViaTransferFactory, } from "./tx.js";
2
+ import { isStaleInputHoldingError, payViaTransferFactory, } from "./tx.js";
3
3
  import { resolveHashBinding } from "./hash-binding.js";
4
4
  import { resolveTrustedDsoParty } from "./trusted-dso.js";
5
5
  /** Bounded backoff (ms) for retrying an allocate the relay rejected because its
@@ -74,78 +74,10 @@ export function makeRelaySigner(wallet, opts = {}) {
74
74
  };
75
75
  return {
76
76
  party: wallet.party,
77
- async signAllocationDirect(input) {
78
- // Spend breaker FIRST (fail-closed, before any relay call), exactly like
79
- // the other arms.
80
- enforceSpendLimits(input.receiver, input.amount);
81
- // Ensure the standing both-party DirectSettlementConsent {sender, merchant}
82
- // exists (facilitator-alone mint off the two once-total consents). On the
83
- // first DIRECT payment the agent's own SenderConsent may not be onboarded
84
- // yet — `mintDirectConsent` then throws; create it ONCE and retry. If the
85
- // retry still throws, the MERCHANT has not onboarded its MerchantConsent (the
86
- // agent cannot create that on the merchant's behalf), so surface a clear,
87
- // actionable error preserving the original relay error as `cause`.
88
- let directConsentCid;
89
- try {
90
- const mint = await relay.mintDirectConsent({
91
- sender: wallet.party,
92
- merchant: input.receiver,
93
- });
94
- directConsentCid = mint.directConsentCid;
95
- }
96
- catch (firstErr) {
97
- // The agent's own SenderConsent is the only standing consent it can mint.
98
- // Create it once (verify-before-sign, the agent's own key) then retry.
99
- await createSenderConsent(relay, wallet, {
100
- facilitator: input.executor,
101
- synchronizerId: input.synchronizerId,
102
- hashBinding,
103
- });
104
- try {
105
- const mint = await relay.mintDirectConsent({
106
- sender: wallet.party,
107
- merchant: input.receiver,
108
- });
109
- directConsentCid = mint.directConsentCid;
110
- }
111
- catch (retryErr) {
112
- // Still failing after the sender side is onboarded → the merchant has
113
- // not onboarded its MerchantConsent. The agent cannot pay direct to a
114
- // merchant that has not opted into the direct path.
115
- throw new Error(`cannot pay merchant ${input.receiver} via allocation-direct: it has ` +
116
- `not onboarded a MerchantConsent with this facilitator yet (the agent ` +
117
- `created its own SenderConsent but the both-party consent still cannot ` +
118
- `be minted). The merchant must run merchant-onboard once before it can ` +
119
- `receive direct payments.`, { cause: retryErr instanceof Error ? retryErr : firstErr });
120
- }
121
- }
122
- const trustedDso = opts.trustedDso ?? resolveTrustedDsoParty(process.env, wallet.network);
123
- // The on-ledger lock is IDENTICAL to the allocation-api arm (same
124
- // AllocationFactory_Allocate, receiver = merchant, executor = facilitator);
125
- // verify-before-sign in `allocate` re-checks every money-critical field.
126
- const r = await withStaleInputRetry(() => allocate(relay, wallet, {
127
- receiver: input.receiver,
128
- amount: input.amount,
129
- executor: input.executor,
130
- synchronizerId: input.synchronizerId,
131
- allocateBeforeSeconds: input.allocateBeforeSeconds,
132
- settleBeforeSeconds: input.settleBeforeSeconds,
133
- ...(input.transferMeta ? { transferMeta: input.transferMeta } : {}),
134
- hashBinding,
135
- ...(trustedDso !== undefined ? { expectInstrumentAdmin: trustedDso } : {}),
136
- }));
137
- return {
138
- payerParty: r.payerParty,
139
- allocationCid: r.allocationCid,
140
- allocationInstructionCid: r.allocationInstructionCid,
141
- updateId: r.updateId,
142
- directConsentCid,
143
- };
144
- },
145
77
  async signTransferFactory(input) {
146
- // Spend breaker FIRST (fail-closed, before any relay call), same as the
147
- // allocation-direct arm — the agent never signs a charge above the caller's
148
- // ceiling or to a payee it did not authorize.
78
+ // Spend breaker FIRST (fail-closed, before any relay call) — the agent
79
+ // never signs a charge above the caller's ceiling or to a payee it did not
80
+ // authorize.
149
81
  enforceSpendLimits(input.receiver, input.amount);
150
82
  const trustedDso = opts.trustedDso ?? resolveTrustedDsoParty(process.env, wallet.network);
151
83
  // Prepare (relay-built) → verify-before-sign (assertPreparedTransferMatches
@@ -1 +1 @@
1
- {"version":3,"file":"relay-signer.js","sourceRoot":"","sources":["../src/relay-signer.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI1D;;;;;;;iCAOiC;AACjC,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAqB,EACrB,QAAuC,CAAC,EAAE,EAAE,EAAE,CAC5C,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEvC,KAAK,IAAI,OAAO,GAAG,CAAC,GAAI,OAAO,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,MAAM,GAAG,EAAE,CAAC;QACrB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IACE,OAAO,GAAG,sBAAsB,CAAC,MAAM;gBACvC,wBAAwB,CAAC,GAAG,CAAC,EAC7B,CAAC;gBACD,MAAM,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAE,CAAC,CAAC;gBAC9C,SAAS;YACX,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,OAuBI,EAAE;IAEN,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,EAAE,QAAQ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KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,CAAC,mBAAmB,CAAC,KAAK;YAC7B,uEAAuE;YACvE,2EAA2E;YAC3E,aAAa;YACb,kBAAkB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjD,MAAM,UAAU,GACd,IAAI,CAAC,UAAU,IAAI,sBAAsB,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YACzE,4EAA4E;YAC5E,uEAAuE;YACvE,2EAA2E;YAC3E,+DAA+D;YAC/D,MAAM,CAAC,GAAG,MAAM,mBAAmB,CAAC,GAAG,EAAE,CACvC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE;gBACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;gBAChD,kBAAkB,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE;gBACzC,WAAW;gBACX,GAAG,CAAC,UAAU,KAAK,SAAS;oBAC1B,CAAC,CAAC,EAAE,qBAAqB,EAAE,UAAU,EAAE;oBACvC,CAAC,CAAC,EAAE,CAAC;aACR,CAAC,CACH,CAAC;YACF,OAAO;gBACL,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,aAAa,EAAE,CAAC,CAAC,aAAa;gBAC9B,cAAc,EAAE,CAAC,CAAC,MAAM;aACzB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/tx.d.ts CHANGED
@@ -96,110 +96,6 @@ export declare function reserveHolding(party: string, holdings: Array<{
96
96
  * @internal
97
97
  */
98
98
  export declare function isStaleInputHoldingError(err: unknown): boolean;
99
- /**
100
- * allocation-api (CIP-56 DVP) — exercise `AllocationFactory_Allocate` to LOCK
101
- * the agent's funds into an Allocation naming the facilitator as
102
- * settlement.executor. The facilitator later submits Allocation_ExecuteTransfer
103
- * (sponsored gas) to settle. The agent signs only the lock here (its own key;
104
- * the choice's sole controller is transferLeg.sender = the agent) — no gas, no
105
- * nonce, no merchant preapproval.
106
- *
107
- * Mirrors the cip56 `transfer` flow: resolve the allocation factory via the
108
- * relay → build the allocate exercise → VERIFY-before-sign over the EXACT
109
- * prepared bytes (pinning sender/receiver/amount/instrument + the executor +
110
- * the deadline window) → sign locally → execute via relay → read back the
111
- * created Allocation cid from THIS transaction's events.
112
- *
113
- * SECURITY: every money/escrow-critical field the verifier pins (sender == own
114
- * party, receiver == merchant payTo, amount == required, instrument == intent,
115
- * settlement.executor == extra.feePayer) is CALLER INTENT passed in `opts`,
116
- * NOT taken from the relay's resolve response. The relay-resolved factory
117
- * refs/admin/context are used only to BUILD the exercise; they widen nothing the
118
- * agent will sign. The cid returned moves no funds on its own — the facilitator
119
- * independently re-validates every field at /verify + /settle, and only the
120
- * executor (+ baked-in sender/receiver auth) can ever move the locked funds.
121
- */
122
- export declare function allocate(relay: RelayClient, wallet: AgentWallet, opts: {
123
- /** Merchant party id (PaymentRequirements.payTo). CALLER INTENT. */
124
- receiver: string;
125
- /** Daml Decimal amount string (PaymentRequirements.amount). CALLER INTENT. */
126
- amount: string;
127
- /** The facilitator party that MUST be settlement.executor (= extra.feePayer).
128
- * CALLER INTENT — pinned by exact equality at the allocation's executor
129
- * position. */
130
- executor: string;
131
- /** Synchronizer id (extra.synchronizerId). CALLER INTENT — pins the prepare's
132
- * synchronizer + the SIGNED Metadata.synchronizer_id. */
133
- synchronizerId: string;
134
- /** Relative allocateBefore deadline (extra.allocateBeforeSeconds). */
135
- allocateBeforeSeconds: number;
136
- /** Relative settleBefore deadline (extra.settleBeforeSeconds). MUST be
137
- * strictly greater than allocateBeforeSeconds. */
138
- settleBeforeSeconds: number;
139
- /** Instrument id the agent expects (default "Amulet"). CALLER INTENT. */
140
- expectInstrumentId?: string;
141
- /** Optional, independently-trusted instrument admin (DSO) to pin. */
142
- expectInstrumentAdmin?: string;
143
- /** x402 reconciliation metadata stamped into transferLeg.meta (paymentId,
144
- * resourceUrl, version, memo?). */
145
- transferMeta?: Record<string, string>;
146
- /** Hash-binding policy; defaults to fail-closed (see HashBindingOptions). */
147
- hashBinding?: HashBindingOptions;
148
- }): Promise<{
149
- payerParty: string;
150
- /** The Allocation cid (the _Completed case — Amulet creates it synchronously). */
151
- allocationCid: string | null;
152
- /** The AllocationInstruction cid (the _Pending case). Track A rejects pending,
153
- * but the relay surfaces it so the facilitator can return the right error. */
154
- allocationInstructionCid: string | null;
155
- /** updateId of the AllocationFactory_Allocate exercise. */
156
- updateId: string;
157
- }>;
158
- /**
159
- * x402-direct "Design B" onboarding (SENDER side, ONCE-TOTAL). Create the standing
160
- * `SenderConsent {sender = self, facilitator}` the facilitator later uses to MINT
161
- * the both-party DirectSettlementConsent for ANY merchant it names. The choice's
162
- * sole signatory is the SENDER = the agent, so the agent signs only its own create
163
- * (its own key; no gas, no facilitator signature). Creating the consent MOVES NO
164
- * FUNDS — it only durably captures the sender's one-time authorization.
165
- *
166
- * Mirrors the cip56/v1/allocate flows: build the create exercise → VERIFY-before-sign
167
- * over the EXACT prepared bytes (pinning the created template + the consent's
168
- * {sender == self, facilitator} principals + act_as == self, and the foreign-party
169
- * backstop allowing ONLY {self, facilitator}) → sign locally → execute via the relay
170
- * → return the create's updateId.
171
- *
172
- * SECURITY: every pinned field is CALLER INTENT passed in `opts`, never taken from
173
- * the relay. A relay-substituted facilitator (which could later mint a both-party
174
- * consent and settle the agent's allocations) is rejected by the [1] facilitator pin
175
- * + the foreign-party backstop; a relay-injected value-moving exercise / extra leg /
176
- * foreign submitter is rejected by the create-root invariant. The cid moves no funds
177
- * on its own — the facilitator's later DirectSettlementConsent_Execute re-validates
178
- * every term against the live allocation.
179
- */
180
- export declare function createSenderConsent(relay: RelayClient, wallet: AgentWallet, opts: {
181
- /** The facilitator party the consent grants (= extra.feePayer). CALLER
182
- * INTENT — pinned by exact equality at the consent's [1] facilitator position. */
183
- facilitator: string;
184
- /** Caller-intent synchronizer id to PREPARE on + pin the SIGNED
185
- * Metadata.synchronizer_id to. The consent lives on a specific synchronizer. */
186
- synchronizerId: string;
187
- /** Hash-binding policy; defaults to fail-closed (see HashBindingOptions). */
188
- hashBinding?: HashBindingOptions;
189
- }): Promise<string>;
190
- /**
191
- * x402-direct "Design B" onboarding (MERCHANT side, ONCE-TOTAL). Symmetric to
192
- * `createSenderConsent`: create the standing `MerchantConsent {merchant = self,
193
- * facilitator}` the facilitator later uses to MINT the both-party
194
- * DirectSettlementConsent (MerchantConsent_Accept) from ANY sender it names. The
195
- * choice's sole signatory is the MERCHANT = the agent. Creating the consent MOVES NO
196
- * FUNDS. Same verify-before-sign guarantees as the sender side.
197
- */
198
- export declare function createMerchantConsent(relay: RelayClient, wallet: AgentWallet, opts: {
199
- facilitator: string;
200
- synchronizerId: string;
201
- hashBinding?: HashBindingOptions;
202
- }): Promise<string>;
203
99
  /**
204
100
  * Accept every pending incoming transfer (e.g. the agent's initial funding).
205
101
  *
@@ -220,64 +116,9 @@ export declare function claimAll(relay: RelayClient, wallet: AgentWallet, opts?:
220
116
  claimed: number;
221
117
  updateIds: string[];
222
118
  }>;
223
- /**
224
- * Reclaim a locked allocation: exercise `Allocation_Withdraw` on the agent's own
225
- * `AmuletAllocation`, returning its locked funds to the agent (Track B — "locked
226
- * funds always recoverable"). The choice's sole controller is
227
- * `allocation.transferLeg.sender` = the agent, and `Allocation_Withdraw` returns
228
- * the funds to the sender BY CONSTRUCTION — there is no attacker-controllable
229
- * destination in the choice argument.
230
- *
231
- * SECURITY: like every path, this is NOT exempt from verify-before-sign. A
232
- * malicious relay could return a DIFFERENT choice that DOES move value to an
233
- * attacker (Allocation_ExecuteTransfer / a TransferFactory_Transfer drain), a
234
- * withdraw of a DIFFERENT allocation, an injected outbound transfer leg, or a
235
- * foreign-party submission. We pass `kind: "allocation-withdraw"`, which
236
- * structurally proves the prepared transaction is a single `Allocation_Withdraw`
237
- * on EXACTLY `opts.allocationCid` (caller intent, REQUIRED contract-id pin),
238
- * submitted by the agent (act_as == wallet.party), with NO foreign party
239
- * anywhere — and binds the signed hash to those bytes (fail-closed by default,
240
- * exactly like the accept/allocate paths). `opts.hashBinding` lets a programmatic
241
- * caller supply a participant-conformant recompute; the CLI resolves it from the
242
- * environment (default fail-closed).
243
- *
244
- * No caller-intent synchronizer is threaded (like the claim/accept path): the
245
- * withdraw carries no caller-chosen domain — `prepareSignExecute` omits the
246
- * synchronizerId arg.
247
- */
248
- export declare function reclaimAllocation(relay: RelayClient, wallet: AgentWallet, opts: {
249
- allocationCid: string;
250
- hashBinding?: HashBindingOptions;
251
- /** CALLER-INTENT reference parties for the lock-expiry withdraw: the
252
- * allocation executor / lock holder (facilitator) and the instrument admin
253
- * (DSO). Supply when the allocation was locked to a facilitator (Design A) so
254
- * the verify foreign-party backstop permits the AmuletRules/round/unlock refs
255
- * these two legitimately produce. Omit on the no-lock path. */
256
- facilitator?: string;
257
- instrumentAdmin?: string;
258
- /** CALLER-INTENT allocation RECEIVER (the merchant). Supply for a "Design B"
259
- * DIRECT allocation, where the receiver is the MERCHANT (not the facilitator)
260
- * — the legitimate `Allocation_Withdraw` expire-lock choice-context then
261
- * references the merchant party, so the verify foreign-party backstop must
262
- * permit EXACTLY this caller-pinned party. Pass the allocation's known
263
- * receiver (never a relay-supplied value). Omit for "Design A" escrow, where
264
- * receiver == facilitator (already permitted) — behavior is then unchanged. */
265
- receiver?: string;
266
- }): Promise<string>;
267
- /**
268
- * SELF-PROVISION a merchant TransferPreapproval so this wallet's incoming
269
- * transfer-factory ("V3") payments settle DIRECT (1-tx) instead of Pending.
270
- * The merchant is BOTH provider and receiver (single controller), so it signs
271
- * with its OWN key — no facilitator CanActAs delegation, no operator token.
272
- *
273
- * The wallet must already hold a little CC (the choice burns a small fee from
274
- * the merchant's own Amulet). VERIFY-BEFORE-SIGN: the relay-prepared transaction
275
- * is refused unless it is exactly a single-root self-preapproval (see
276
- * assertPreparedSelfPreapproval).
277
- */
278
119
  export declare function selfProvisionPreapproval(relay: RelayClient, wallet: AgentWallet, opts?: {
279
120
  expiresAt?: string;
280
- }): Promise<{
121
+ }, sleep?: (ms: number) => Promise<void>): Promise<{
281
122
  updateId: string;
282
123
  }>;
283
124
  //# 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,EAQL,KAAK,kBAAkB,EAMxB,MAAM,sBAAsB,CAAC;AAkL9B;;;;;;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;IACjC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B,GACA,OAAO,CAAC,MAAM,CAAC,CAkEjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,6DAA6D;IAC7D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