@capxul/mcp 4.20.0-beta.30 → 4.20.0-beta.32

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.
@@ -357,6 +357,9 @@ function decodeUrlComponent(text) {
357
357
  return text;
358
358
  }
359
359
  }
360
+ function isCoinbaseRpcPath(hostname, segments) {
361
+ return hostname === "api.developer.coinbase.com" && decodeUrlComponent(segments[1] ?? "") === "rpc" && decodeUrlComponent(segments[2] ?? "") === "v1";
362
+ }
360
363
  /** Preserve URL diagnostics while removing credentials from their declared components. */
361
364
  function redactUrlSecrets(value, source) {
362
365
  try {
@@ -374,9 +377,10 @@ function redactUrlSecrets(value, source) {
374
377
  const provider = source === "alchemy" || source === "infura" || /(?:^|\.)(?:alchemy\.com|alchemyapi\.io|infura\.io)$/iu.test(url.hostname);
375
378
  const rawPath = absolute || protocolRelative ? url.pathname : value.split(/[?#]/u)[0] ?? "";
376
379
  const segments = rawPath.split("/");
380
+ const coinbaseRpc = isCoinbaseRpcPath(url.hostname, segments);
377
381
  let path = segments.map((segment, index) => {
378
382
  const decoded = decodeUrlComponent(segment);
379
- const masked = provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
383
+ const masked = (provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) || coinbaseRpc && index === 4) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
380
384
  changed ||= masked !== decoded;
381
385
  return masked === decoded ? segment : encodeURIComponent(masked);
382
386
  }).join("/");
@@ -2953,6 +2957,8 @@ function isEvmAddress(raw) {
2953
2957
  const ASSET_ID_RE$1 = /^eip155:([1-9][0-9]*)\/erc20:(0x[0-9a-f]{40})$/;
2954
2958
  const CURRENCY_SYMBOLS = {
2955
2959
  USD: "$",
2960
+ EUR: "€",
2961
+ GBP: "£",
2956
2962
  NGN: "NGN",
2957
2963
  GHS: "GHS",
2958
2964
  KES: "KSh",
@@ -2964,6 +2970,16 @@ const CURRENCY_SYMBOLS = {
2964
2970
  symbol: CURRENCY_SYMBOLS.USD,
2965
2971
  name: "US Dollar"
2966
2972
  },
2973
+ {
2974
+ code: "EUR",
2975
+ symbol: CURRENCY_SYMBOLS.EUR,
2976
+ name: "Euro"
2977
+ },
2978
+ {
2979
+ code: "GBP",
2980
+ symbol: CURRENCY_SYMBOLS.GBP,
2981
+ name: "British Pound"
2982
+ },
2967
2983
  {
2968
2984
  code: "NGN",
2969
2985
  symbol: CURRENCY_SYMBOLS.NGN,
@@ -3057,6 +3073,13 @@ const AssetAmountSchema = Schema.Struct({
3057
3073
  currency: Schema.optional(Schema.Never),
3058
3074
  decimals: Schema.optional(Schema.Never)
3059
3075
  });
3076
+ /** Fiat value. Currency never selects or aliases an asset. */
3077
+ const MoneySchema = Schema.Struct({
3078
+ currency: CurrencyCodeSchema$1,
3079
+ value: DecimalStringSchema,
3080
+ decimals: Schema.Finite.check(Schema.makeFilter((value) => Number.isSafeInteger(value) && value >= 0 && value <= 255, { message: "must be an integer between 0 and 255" })),
3081
+ asset: Schema.optional(Schema.Never)
3082
+ });
3060
3083
  //#endregion
3061
3084
  //#region ../../packages/protocol/src/primitives/brand-schema.ts
3062
3085
  const lowercasedString = Schema.String.pipe(Schema.decodeTo(Schema.String, {
@@ -3133,6 +3156,46 @@ function decodedBase64Size(value) {
3133
3156
  }
3134
3157
  const CanonicalBase64Schema = Schema.String.check(Schema.makeFilter((value) => value.length > 0 && CANONICAL_BASE64_RE.test(value) && decodedBase64Size(value) <= 131072, { message: "must be canonical padded RFC 4648 base64 of at most 128 KiB" }));
3135
3158
  //#endregion
3159
+ //#region ../../packages/protocol/src/documents/money-invoice-schema.ts
3160
+ const SIGNATURE_RE$1 = /^0x[0-9a-f]{130}$/;
3161
+ const FiatAmountV3Schema = Schema.Struct({
3162
+ denomination: Schema.Literal(0),
3163
+ currency: CurrencyCodeSchema$1,
3164
+ asset: Schema.Literal(""),
3165
+ minorUnits: Uint256StringSchema$1,
3166
+ decimals: Uint8V3Schema
3167
+ });
3168
+ const MoneyInvoiceEnvelopeV5Schema = Schema.Struct({
3169
+ protocol: Schema.Literal("capxul.payment-document"),
3170
+ version: Schema.Literal(5),
3171
+ domain: Schema.Struct({
3172
+ name: Schema.Literal("CapxulFinancialDocument"),
3173
+ version: Schema.Literal("5"),
3174
+ chainId: ChainIdSchema$1,
3175
+ salt: Schema.Literal("0x7b0fd8a8c3880e03dc03661ad8d3bad2f865203f70562ac8cc01527168b464a3")
3176
+ }),
3177
+ primaryType: Schema.Literal("Invoice"),
3178
+ message: Schema.Struct({
3179
+ kind: Schema.Literal(1),
3180
+ originId: CanonicalBytes32V3Schema,
3181
+ issuedAt: Uint64V3Schema,
3182
+ invoiceNumber: ReferenceV3Schema,
3183
+ payerRef: AssertionV3Schema,
3184
+ payeeRef: AssertionV3Schema,
3185
+ amount: FiatAmountV3Schema,
3186
+ receivingAccountId: ReferenceV3Schema,
3187
+ target: CanonicalAddressV3Schema,
3188
+ dueAt: Uint64V3Schema,
3189
+ lineItemsHash: CanonicalBytes32V3Schema,
3190
+ note: NoteV3Schema,
3191
+ discountMinor: Uint256StringSchema$1
3192
+ }),
3193
+ signature: Schema.optional(Schema.Struct({
3194
+ signer: CanonicalAddressV3Schema,
3195
+ value: Schema.String.pipe(Schema.refine((value) => SIGNATURE_RE$1.test(value)))
3196
+ }))
3197
+ });
3198
+ //#endregion
3136
3199
  //#region ../../packages/protocol/src/documents/schema.ts
3137
3200
  const SIGNATURE_RE = /^0x[0-9a-f]{130}$/;
3138
3201
  const PaymentDocumentDomainV3Schema = Schema.Struct({
@@ -3146,13 +3209,7 @@ const ExactAssetV3Schema = Schema.Struct({
3146
3209
  minorUnits: Uint256StringSchema$1,
3147
3210
  decimals: Uint8V3Schema
3148
3211
  });
3149
- const ReceiptAmountV3Schema = Schema.Union([Schema.Struct({
3150
- denomination: Schema.Literal(0),
3151
- currency: CurrencyCodeSchema$1,
3152
- asset: Schema.Literal(""),
3153
- minorUnits: Uint256StringSchema$1,
3154
- decimals: Uint8V3Schema
3155
- }), Schema.Struct({
3212
+ const ReceiptAmountV3Schema = Schema.Union([FiatAmountV3Schema, Schema.Struct({
3156
3213
  denomination: Schema.Literal(1),
3157
3214
  currency: Schema.Literal(""),
3158
3215
  asset: AssetIdSchema,
@@ -3270,7 +3327,11 @@ const InvoiceEnvelopeV4Schema = Schema.Struct({
3270
3327
  }),
3271
3328
  signature: Schema.optional(SignatureV3Schema)
3272
3329
  });
3273
- const SupportedPaymentDocumentEnvelopeSchema = Schema.Union([PaymentDocumentEnvelopeV3Schema, InvoiceEnvelopeV4Schema]);
3330
+ const SupportedPaymentDocumentEnvelopeSchema = Schema.Union([
3331
+ PaymentDocumentEnvelopeV3Schema,
3332
+ InvoiceEnvelopeV4Schema,
3333
+ MoneyInvoiceEnvelopeV5Schema
3334
+ ]);
3274
3335
  //#endregion
3275
3336
  //#region ../../packages/protocol/src/documents/read-schema.ts
3276
3337
  const DocumentRefV3Schema = Schema.Struct({
@@ -3285,6 +3346,7 @@ const DocumentRefV3Schema = Schema.Struct({
3285
3346
  format: Schema.Literals([
3286
3347
  "envelope-v3",
3287
3348
  "envelope-v4",
3349
+ "envelope-v5",
3288
3350
  "artifact"
3289
3351
  ]),
3290
3352
  role: Schema.Literals([
@@ -3294,6 +3356,13 @@ const DocumentRefV3Schema = Schema.Struct({
3294
3356
  ]),
3295
3357
  issuedAt: Schema.NullOr(Uint64V3Schema)
3296
3358
  });
3359
+ function paymentDocumentEnvelopeFormat(envelope) {
3360
+ switch (envelope.version) {
3361
+ case 3: return "envelope-v3";
3362
+ case 4: return "envelope-v4";
3363
+ case 5: return "envelope-v5";
3364
+ }
3365
+ }
3297
3366
  const PaymentDocumentReadRefSchema = Schema.Struct({
3298
3367
  documentHash: CanonicalBytes32V3Schema,
3299
3368
  contentHash: CanonicalBytes32V3Schema
@@ -3399,22 +3468,32 @@ const OrganizationActorRefSchema = Schema.Struct({
3399
3468
  orgId: nonEmpty("orgId")
3400
3469
  });
3401
3470
  const ActorRefSchema = Schema.Union([AccountActorRefSchema, OrganizationActorRefSchema]);
3471
+ const PartyAccountRefSchema$1 = Schema.Struct({
3472
+ kind: Schema.Literal("party_account"),
3473
+ partyAccountId: nonEmpty("partyAccountId")
3474
+ });
3402
3475
  const hasActorBoundPermission = (actor, orgId, permissionId) => actor.kind === "organization" ? orgId === actor.orgId && permissionId !== void 0 : orgId === void 0 && permissionId === void 0;
3403
- const ActorOrDestinationRefSchema = Schema.Union([ActorRefSchema, Schema.Struct({
3404
- kind: Schema.Literal("destination"),
3405
- destinationId: nonEmpty("destinationId")
3406
- })]);
3476
+ const ActorOrDestinationRefSchema = Schema.Union([
3477
+ ActorRefSchema,
3478
+ Schema.Struct({
3479
+ kind: Schema.Literal("destination"),
3480
+ destinationId: nonEmpty("destinationId")
3481
+ }),
3482
+ PartyAccountRefSchema$1
3483
+ ]);
3407
3484
  const RecipientObservationSchema = Schema.Struct({
3408
3485
  recipient_locator_kind: Schema.Literals([
3409
3486
  "handle",
3410
3487
  "email",
3411
3488
  "party",
3412
- "address"
3489
+ "address",
3490
+ "party_account"
3413
3491
  ]),
3414
3492
  recipient_resolution_status: Schema.Literals([
3415
3493
  "known_party",
3416
3494
  "new_email",
3417
- "external_address"
3495
+ "external_address",
3496
+ "bank_account"
3418
3497
  ]),
3419
3498
  recipient_is_capxul_account: Schema.Boolean,
3420
3499
  recipient_party_id: Schema.optional(Schema.String),
@@ -3425,6 +3504,7 @@ const RecipientObservationSchema = Schema.Struct({
3425
3504
  ])),
3426
3505
  recipient_handle: Schema.optional(Schema.String),
3427
3506
  recipient_address: AddressSchema$1,
3507
+ party_account_id: Schema.optional(Schema.String),
3428
3508
  external_address_acknowledged: Schema.Boolean
3429
3509
  });
3430
3510
  //#endregion
@@ -3600,7 +3680,7 @@ const PartySchema = Schema.Struct({
3600
3680
  status: Schema.Literals(["provisional", "claimed"]),
3601
3681
  displayName: Schema.NullOr(Schema.String),
3602
3682
  handle: Schema.NullOr(Schema.String),
3603
- safeAddress: Schema.String
3683
+ safeAddress: Schema.optionalKey(Schema.String)
3604
3684
  });
3605
3685
  //#endregion
3606
3686
  //#region ../../packages/protocol/src/time/schema.ts
@@ -3618,6 +3698,7 @@ const DurationMsSchema$1 = Schema.Finite.pipe(Schema.refine((n) => Number.isSafe
3618
3698
  const PAYMENT_STATUSES = [
3619
3699
  "pending",
3620
3700
  "settling",
3701
+ "in_transit",
3621
3702
  "unresolved",
3622
3703
  "scheduled",
3623
3704
  "streaming",
@@ -3686,14 +3767,22 @@ const PAYMENT_TYPE_FOR_DOCUMENT_KIND = {
3686
3767
  function paymentTypeForDocumentKind(kind) {
3687
3768
  return PAYMENT_TYPE_FOR_DOCUMENT_KIND[kind];
3688
3769
  }
3689
- const PaymentRecipient = Schema.Union([Schema.Struct({
3690
- kind: Schema.Literal("party"),
3691
- partyId: PartyIdSchema,
3692
- label: Schema.String
3693
- }), Schema.Struct({
3694
- kind: Schema.Literal("external_address"),
3695
- label: Schema.String
3696
- })]);
3770
+ const PaymentRecipient = Schema.Union([
3771
+ Schema.Struct({
3772
+ kind: Schema.Literal("party"),
3773
+ partyId: PartyIdSchema,
3774
+ label: Schema.String
3775
+ }),
3776
+ Schema.Struct({
3777
+ kind: Schema.Literal("external_address"),
3778
+ label: Schema.String
3779
+ }),
3780
+ Schema.Struct({
3781
+ kind: Schema.Literal("party_account"),
3782
+ partyAccountId: Schema.String,
3783
+ label: Schema.String
3784
+ })
3785
+ ]);
3697
3786
  /** When a Payment's money is released: now, at one time, or streamed over a window. */
3698
3787
  const PaymentTiming = Schema.Union([
3699
3788
  Schema.Struct({ kind: Schema.Literal("instant") }),
@@ -3725,7 +3814,8 @@ const PaymentRef = Schema.Union([
3725
3814
  Schema.Struct({
3726
3815
  kind: Schema.Literal("party"),
3727
3816
  partyId: PartyIdSchema
3728
- })
3817
+ }),
3818
+ PartyAccountRefSchema$1
3729
3819
  ]);
3730
3820
  /** One Payment as a participant reads it. */
3731
3821
  const Payment = Schema.Struct({
@@ -3754,9 +3844,27 @@ const Payment = Schema.Struct({
3754
3844
  retryRequired: Schema.Boolean,
3755
3845
  notSent: Schema.optionalKey(Schema.Literal(true))
3756
3846
  })),
3847
+ requestedOutput: Schema.optionalKey(MoneySchema),
3848
+ outputExact: Schema.optionalKey(Schema.Boolean),
3849
+ recipientOnCapxul: Schema.optionalKey(Schema.Boolean),
3850
+ recipientWarning: Schema.optionalKey(Schema.Boolean),
3851
+ legs: Schema.optionalKey(Schema.Array(Schema.Struct({
3852
+ kind: Schema.Literals(["funding", "delivery"]),
3853
+ state: Schema.Literals([
3854
+ "pending",
3855
+ "done",
3856
+ "failed",
3857
+ "refunded"
3858
+ ])
3859
+ }))),
3860
+ links: Schema.optionalKey(Schema.Struct({
3861
+ quoteId: Schema.String,
3862
+ railOperationId: Schema.String,
3863
+ refundMovementId: Schema.optionalKey(Schema.String)
3864
+ })),
3757
3865
  createdAt: EpochMsSchema$1,
3758
3866
  updatedAt: EpochMsSchema$1
3759
- }).pipe(Schema.check(Schema.makeFilter((payment) => payment.documents.every((document) => document.role !== "instruction" || document.kind === "memo" || paymentTypeForDocumentKind(document.kind) === payment.paymentType), { message: "document kind must map to paymentType" })));
3867
+ }).pipe(Schema.check(Schema.makeFilter((payment) => payment.documents.every((document) => document.role !== "instruction" || document.kind === "memo" || paymentTypeForDocumentKind(document.kind) === payment.paymentType), { message: "document kind must map to paymentType" }), Schema.makeFilter((payment) => payment.recipient.kind === "party_account" ? payment.requestedOutput !== void 0 && payment.outputExact !== void 0 && payment.recipientOnCapxul !== void 0 && payment.recipientWarning !== void 0 && payment.links !== void 0 && payment.legs?.length === 2 && payment.legs[0]?.kind === "funding" && payment.legs[1]?.kind === "delivery" : payment.requestedOutput === void 0 && payment.outputExact === void 0 && payment.recipientOnCapxul === void 0 && payment.recipientWarning === void 0 && payment.links === void 0 && payment.legs === void 0, { message: "Bank payout Payments require their quote, output and two rail legs" })));
3760
3868
  //#endregion
3761
3869
  //#region ../../packages/protocol/src/payments/model.ts
3762
3870
  function toPaymentId(raw) {
@@ -3837,7 +3945,11 @@ const ActivityItemSchema = Schema.Union([Schema.Struct({
3837
3945
  }), Schema.Struct({
3838
3946
  kind: Schema.Literal("movement"),
3839
3947
  id: Schema.String,
3840
- classification: Schema.Literals(["deposit", "movement_only_outflow"]),
3948
+ classification: Schema.Literals([
3949
+ "deposit",
3950
+ "refund",
3951
+ "movement_only_outflow"
3952
+ ]),
3841
3953
  amount: Amount,
3842
3954
  direction: Direction,
3843
3955
  counterpartyLabel: Schema.String,
@@ -3997,7 +4109,7 @@ const ActivityOverlaySchema = Schema.Struct({
3997
4109
  * cursor, limit or window, a scope the caller does not take part in, or a
3998
4110
  * signed-in user whose Account is not ready.
3999
4111
  */
4000
- const READ = [
4112
+ const READ$1 = [
4001
4113
  "NOT_AUTHENTICATED",
4002
4114
  "INVALID_INPUT",
4003
4115
  ...DEFECTS
@@ -4014,7 +4126,7 @@ const items = {
4014
4126
  filter: Schema.optionalKey(ActivityFilterSchema)
4015
4127
  }),
4016
4128
  output: ActivityPageSchema,
4017
- errors: READ
4129
+ errors: READ$1
4018
4130
  }),
4019
4131
  /** Per-asset totals and the row count over one window of the actor's activity. */
4020
4132
  summary: Operation.query("activity.items.summary", {
@@ -4023,7 +4135,7 @@ const items = {
4023
4135
  window: Schema.optionalKey(ActivityRangeSchema)
4024
4136
  }),
4025
4137
  output: ActivitySummarySchema,
4026
- errors: READ
4138
+ errors: READ$1
4027
4139
  }),
4028
4140
  /** One row's exact detail and the reader's annotation; null when the caller cannot read it. */
4029
4141
  get: Operation.query("activity.items.get", {
@@ -4032,7 +4144,7 @@ const items = {
4032
4144
  actor: Schema.optionalKey(ActivityGetActorSchema)
4033
4145
  }),
4034
4146
  output: Schema.NullOr(ActivityDetailSchema),
4035
- errors: READ
4147
+ errors: READ$1
4036
4148
  })
4037
4149
  };
4038
4150
  const annotations = {
@@ -4051,7 +4163,7 @@ save: Operation.mutation("activity.annotations.save", {
4051
4163
  output: ActivityAnnotationSchema,
4052
4164
  /** An Organization's annotation also needs the caller's exact Account, Safe and command authority. */
4053
4165
  errors: [
4054
- ...READ,
4166
+ ...READ$1,
4055
4167
  "ROLE_PERMISSION_DENIED",
4056
4168
  "ACCOUNT_NOT_FOUND",
4057
4169
  "SMART_ACCOUNT_MISSING"
@@ -4066,7 +4178,7 @@ get: Operation.query("activity.overlays.get", {
4066
4178
  settlementIds: Schema.optionalKey(Schema.Array(Schema.String))
4067
4179
  }),
4068
4180
  output: ActivityOverlaySchema,
4069
- errors: READ
4181
+ errors: READ$1
4070
4182
  }) };
4071
4183
  /** A document read: no session, or a pair the caller may not read or that fails its integrity. */
4072
4184
  const DOCUMENT = [
@@ -4095,6 +4207,272 @@ const documents = {
4095
4207
  })
4096
4208
  };
4097
4209
  //#endregion
4210
+ //#region ../../packages/protocol/src/parties/verification-schema.ts
4211
+ const VERIFICATION_DOCUMENT_FIELDS = [
4212
+ "id_front",
4213
+ "id_back",
4214
+ "proof_of_address",
4215
+ "business_formation",
4216
+ "ownership_information",
4217
+ "proof_of_nature_of_business",
4218
+ "evidence_of_good_standing",
4219
+ "flow_of_funds",
4220
+ "proof_of_signatory_authority"
4221
+ ];
4222
+ const VerificationStateSchema = Schema.Literals([
4223
+ "not_started",
4224
+ "in_progress",
4225
+ "submitted",
4226
+ "needs_more",
4227
+ "liveness_needed",
4228
+ "under_review",
4229
+ "approved",
4230
+ "rejected",
4231
+ "restricted"
4232
+ ]);
4233
+ const VerificationQuestionSchema = Schema.Struct({
4234
+ id: Schema.String,
4235
+ label: Schema.String,
4236
+ type: Schema.Literals([
4237
+ "text",
4238
+ "date",
4239
+ "choice",
4240
+ "boolean",
4241
+ "file"
4242
+ ]),
4243
+ secret: Schema.Boolean,
4244
+ multiple: Schema.optionalKey(Schema.Boolean),
4245
+ when: Schema.optionalKey(Schema.Struct({
4246
+ field: Schema.String,
4247
+ equals: Schema.Union([Schema.String, Schema.Boolean])
4248
+ })),
4249
+ choices: Schema.optionalKey(Schema.Array(Schema.Struct({
4250
+ value: Schema.String,
4251
+ label: Schema.String
4252
+ }))),
4253
+ help: Schema.optionalKey(Schema.String)
4254
+ });
4255
+ const VerificationCurrencySchema = Schema.Struct({
4256
+ currency: Schema.Literals([
4257
+ "usd",
4258
+ "eur",
4259
+ "gbp"
4260
+ ]),
4261
+ status: Schema.Literals([
4262
+ "pending",
4263
+ "approved",
4264
+ "needs_more",
4265
+ "rejected",
4266
+ "restricted"
4267
+ ])
4268
+ });
4269
+ const Common = {
4270
+ invitationId: Schema.optionalKey(Schema.String),
4271
+ businessStatus: Schema.optionalKey(Schema.Literals([
4272
+ "waiting_people",
4273
+ "in_review",
4274
+ "approved",
4275
+ "rejected",
4276
+ "restricted"
4277
+ ])),
4278
+ subjectKind: Schema.optionalKey(Schema.Literals([
4279
+ "person",
4280
+ "business",
4281
+ "business_person"
4282
+ ])),
4283
+ organization: Schema.optionalKey(Schema.Struct({
4284
+ id: Schema.String,
4285
+ name: Schema.String
4286
+ })),
4287
+ journeyId: Schema.String,
4288
+ currencies: Schema.Array(VerificationCurrencySchema),
4289
+ next: Schema.Struct({ argv: Schema.Array(Schema.String) })
4290
+ };
4291
+ const VerificationStatusSchema = Schema.Union([
4292
+ Schema.Struct({
4293
+ status: Schema.Literal("not_started"),
4294
+ ...Common
4295
+ }),
4296
+ Schema.Struct({
4297
+ status: Schema.Literal("waiting_people"),
4298
+ missingRoles: Schema.Array(Schema.Literals(["control", "signer"])),
4299
+ people: Schema.Array(Schema.Struct({
4300
+ invitationId: Schema.String,
4301
+ name: Schema.String,
4302
+ email: Schema.String,
4303
+ self: Schema.Boolean,
4304
+ status: Schema.Literals([
4305
+ "invited",
4306
+ "submitted",
4307
+ "needs_more"
4308
+ ]),
4309
+ delivery: Schema.Literals([
4310
+ "pending",
4311
+ "sent",
4312
+ "failed"
4313
+ ])
4314
+ })),
4315
+ ...Common
4316
+ }),
4317
+ Schema.Struct({
4318
+ status: Schema.Literal("needs_person"),
4319
+ action: Schema.Literals(["accept_terms", "liveness_check"]),
4320
+ url: Schema.String,
4321
+ ...Common
4322
+ }),
4323
+ Schema.Struct({
4324
+ status: Schema.Literal("needs_answers"),
4325
+ questions: Schema.Array(VerificationQuestionSchema),
4326
+ completed: Schema.Array(Schema.Literals([
4327
+ "personal_details",
4328
+ "address",
4329
+ "id"
4330
+ ])),
4331
+ issues: Schema.Array(Schema.Struct({
4332
+ fieldId: Schema.String,
4333
+ message: Schema.String
4334
+ })),
4335
+ alternative: Schema.optionalKey(Schema.Struct({
4336
+ action: Schema.Literal("liveness_check"),
4337
+ url: Schema.String
4338
+ })),
4339
+ ...Common
4340
+ }),
4341
+ Schema.Struct({
4342
+ status: Schema.Literals([
4343
+ "in_review",
4344
+ "approved",
4345
+ "rejected",
4346
+ "restricted"
4347
+ ]),
4348
+ ...Common
4349
+ })
4350
+ ]);
4351
+ //#endregion
4352
+ //#region ../../packages/protocol/src/banking/schema.ts
4353
+ const BankCurrencySchema = Schema.Literals([
4354
+ "usd",
4355
+ "eur",
4356
+ "gbp"
4357
+ ]);
4358
+ const SettlementTokenSchema = Schema.Literals(["usdc", "eurc"]);
4359
+ const BankDetailsStateSchema = Schema.Literals([
4360
+ "requested",
4361
+ "active",
4362
+ "deactivated",
4363
+ "closed",
4364
+ "failed"
4365
+ ]);
4366
+ const optionalText$1 = Schema.optionalKey(Schema.String);
4367
+ /** List values are masked. Only an explicit single-currency read reveals these fields. */
4368
+ const BankDetailsFieldsSchema = Schema.Struct({
4369
+ routingNumber: optionalText$1,
4370
+ accountNumber: optionalText$1,
4371
+ iban: optionalText$1,
4372
+ bic: optionalText$1,
4373
+ sortCode: optionalText$1
4374
+ });
4375
+ const BankDetailsSchema = Schema.Struct({
4376
+ receivingAccountId: Schema.String,
4377
+ currency: BankCurrencySchema,
4378
+ state: BankDetailsStateSchema,
4379
+ visibility: Schema.Literals(["masked", "full"]),
4380
+ bankName: optionalText$1,
4381
+ accountHolder: optionalText$1,
4382
+ bankAddress: optionalText$1,
4383
+ paymentRails: Schema.Array(Schema.String),
4384
+ fields: BankDetailsFieldsSchema,
4385
+ destination: Schema.Struct({
4386
+ chainId: Schema.Finite,
4387
+ token: SettlementTokenSchema,
4388
+ address: Schema.String
4389
+ }),
4390
+ developerFeePercent: optionalText$1,
4391
+ minimumDeposit: optionalText$1,
4392
+ notice: optionalText$1
4393
+ });
4394
+ const BankDetailsOverviewSchema = Schema.Struct({
4395
+ accounts: Schema.Array(BankDetailsSchema),
4396
+ verification: Schema.Array(VerificationCurrencySchema)
4397
+ });
4398
+ /** Gross bank money and the net token credit are separate amounts. */
4399
+ const BankDepositSchema = Schema.Struct({
4400
+ bankDepositId: Schema.String,
4401
+ receivingAccountId: Schema.String,
4402
+ currency: BankCurrencySchema,
4403
+ amount: Schema.String,
4404
+ receivedAt: EpochMsSchema$1,
4405
+ sender: optionalText$1,
4406
+ reference: optionalText$1,
4407
+ status: Schema.Literals([
4408
+ "processing",
4409
+ "arriving",
4410
+ "credited",
4411
+ "returned",
4412
+ "below_minimum"
4413
+ ]),
4414
+ refundState: Schema.optionalKey(Schema.Literals([
4415
+ "in_flight",
4416
+ "done",
4417
+ "failed"
4418
+ ])),
4419
+ credit: Schema.optionalKey(Schema.Struct({
4420
+ amount: AssetAmountSchema,
4421
+ symbol: Schema.Literals(["USDC", "EURC"]),
4422
+ chainId: Schema.Finite,
4423
+ transactionHash: Schema.String,
4424
+ movementId: Schema.String
4425
+ })),
4426
+ match: Schema.optionalKey(Schema.Union([Schema.Struct({
4427
+ kind: Schema.Literal("request"),
4428
+ requestId: Schema.String,
4429
+ reference: Schema.String,
4430
+ how: Schema.Literals(["reference", "manual"])
4431
+ }), Schema.Struct({ kind: Schema.Literal("not_request") })]))
4432
+ });
4433
+ const BankDepositsPageSchema = pageOf(BankDepositSchema);
4434
+ const BankDepositCandidatesPageSchema = pageOf(Schema.Struct({
4435
+ requestId: Schema.String,
4436
+ reference: Schema.String,
4437
+ amount: Schema.Union([AssetAmountSchema, MoneySchema]),
4438
+ dueAt: EpochMsSchema$1,
4439
+ payerPartyId: optionalText$1,
4440
+ payerLabel: optionalText$1
4441
+ }));
4442
+ //#endregion
4443
+ //#region ../../packages/protocol/src/payments/payout-schema.ts
4444
+ const PartyAccountRefSchema = Schema.Struct({
4445
+ kind: Schema.Literal("party_account"),
4446
+ partyAccountId: nonEmpty("partyAccountId")
4447
+ });
4448
+ const PaymentQuoteInputSchema = Schema.Struct({
4449
+ actor: Schema.optionalKey(ActorScopeSchema),
4450
+ to: PartyAccountRefSchema,
4451
+ amount: Schema.Union([MoneySchema, AssetAmountSchema]),
4452
+ asset: Schema.optionalKey(AssetIdSchema),
4453
+ requestKey: nonEmpty("requestKey")
4454
+ });
4455
+ const PaymentQuoteSchema = Schema.Struct({
4456
+ quoteId: nonEmpty("quoteId"),
4457
+ partyAccountId: nonEmpty("partyAccountId"),
4458
+ requestedOutput: MoneySchema,
4459
+ outputExact: Schema.Boolean,
4460
+ funding: AssetAmountSchema,
4461
+ expiresAt: Schema.Finite,
4462
+ recipient: Schema.Struct({
4463
+ label: Schema.String,
4464
+ bankName: Schema.optionalKey(Schema.String),
4465
+ last4: Schema.String,
4466
+ currency: BankCurrencySchema,
4467
+ onCapxul: Schema.Boolean
4468
+ }),
4469
+ rate: Schema.optionalKey(DecimalStringSchema),
4470
+ warnings: Schema.Array(Schema.Struct({
4471
+ code: Schema.Literal("RECIPIENT_ON_CAPXUL"),
4472
+ message: Schema.String
4473
+ }))
4474
+ });
4475
+ //#endregion
4098
4476
  //#region ../../packages/protocol/src/permissions/value-schema.ts
4099
4477
  const PermissionIdSchema = nonEmpty("permissionId").pipe(Schema.refine((value) => value.length > 0));
4100
4478
  const PermissionAssignmentIdSchema = nonEmpty("permissionAssignmentId").pipe(Schema.refine((value) => value.length > 0));
@@ -4136,6 +4514,7 @@ const MovementSchema = Schema.Struct({
4136
4514
  const MovementClassificationSchema = Schema.Literals([
4137
4515
  "protocol_settlement",
4138
4516
  "deposit",
4517
+ "refund",
4139
4518
  "movement_only_outflow"
4140
4519
  ]);
4141
4520
  const MovementAttributionSchema = Schema.Struct({
@@ -4805,7 +5184,7 @@ function parseAbiParameters(params) {
4805
5184
  return abiParameters;
4806
5185
  }
4807
5186
  //#endregion
4808
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/formatAbiItem.js
5187
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/formatAbiItem.js
4809
5188
  function formatAbiItem(abiItem, { includeName = false } = {}) {
4810
5189
  if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error") throw new InvalidDefinitionTypeError(abiItem.type);
4811
5190
  return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
@@ -4819,14 +5198,14 @@ function formatAbiParam(param, { includeName }) {
4819
5198
  return param.type + (includeName && param.name ? ` ${param.name}` : "");
4820
5199
  }
4821
5200
  //#endregion
4822
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/isHex.js
5201
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/isHex.js
4823
5202
  function isHex$1(value, { strict = true } = {}) {
4824
5203
  if (!value) return false;
4825
5204
  if (typeof value !== "string") return false;
4826
5205
  return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
4827
5206
  }
4828
5207
  //#endregion
4829
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/size.js
5208
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/size.js
4830
5209
  /**
4831
5210
  * @description Retrieves the size of the value (in bytes).
4832
5211
  *
@@ -4838,10 +5217,10 @@ function size(value) {
4838
5217
  return value.length;
4839
5218
  }
4840
5219
  //#endregion
4841
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/version.js
5220
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/version.js
4842
5221
  const version$2 = "2.55.18";
4843
5222
  //#endregion
4844
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/base.js
5223
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/base.js
4845
5224
  let errorConfig = {
4846
5225
  getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
4847
5226
  version: `viem@${version$2}`
@@ -4923,7 +5302,7 @@ function walk(err, fn) {
4923
5302
  return fn ? null : err;
4924
5303
  }
4925
5304
  //#endregion
4926
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/abi.js
5305
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/abi.js
4927
5306
  var AbiDecodingDataSizeTooSmallError = class extends BaseError {
4928
5307
  constructor({ data, params, size }) {
4929
5308
  super([`Data size of ${size} bytes is too small for given parameters.`].join("\n"), {
@@ -5055,7 +5434,7 @@ var UnsupportedPackedAbiType = class extends BaseError {
5055
5434
  }
5056
5435
  };
5057
5436
  //#endregion
5058
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/data.js
5437
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/data.js
5059
5438
  var SliceOffsetOutOfBoundsError = class extends BaseError {
5060
5439
  constructor({ offset, position, size }) {
5061
5440
  super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size}).`, { name: "SliceOffsetOutOfBoundsError" });
@@ -5067,7 +5446,7 @@ var SizeExceedsPaddingSizeError = class extends BaseError {
5067
5446
  }
5068
5447
  };
5069
5448
  //#endregion
5070
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/pad.js
5449
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/pad.js
5071
5450
  function pad(hexOrBytes, { dir, size = 32 } = {}) {
5072
5451
  if (typeof hexOrBytes === "string") return padHex(hexOrBytes, {
5073
5452
  dir,
@@ -5103,7 +5482,7 @@ function padBytes(bytes, { dir, size = 32 } = {}) {
5103
5482
  return paddedBytes;
5104
5483
  }
5105
5484
  //#endregion
5106
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/encoding.js
5485
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/encoding.js
5107
5486
  var IntegerOutOfRangeError = class extends BaseError {
5108
5487
  constructor({ max, min, signed, size, value }) {
5109
5488
  super(`Number "${value}" is not in safe ${size ? `${size * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
@@ -5120,7 +5499,7 @@ var SizeOverflowError = class extends BaseError {
5120
5499
  }
5121
5500
  };
5122
5501
  //#endregion
5123
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/trim.js
5502
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/trim.js
5124
5503
  function trim(hexOrBytes, { dir = "left" } = {}) {
5125
5504
  let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
5126
5505
  let sliceLength = 0;
@@ -5134,7 +5513,7 @@ function trim(hexOrBytes, { dir = "left" } = {}) {
5134
5513
  return data;
5135
5514
  }
5136
5515
  //#endregion
5137
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/fromHex.js
5516
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/fromHex.js
5138
5517
  function assertSize(hexOrBytes, { size: size$1 }) {
5139
5518
  if (size(hexOrBytes) > size$1) throw new SizeOverflowError({
5140
5519
  givenSize: size(hexOrBytes),
@@ -5201,7 +5580,7 @@ function hexToNumber(hex, opts = {}) {
5201
5580
  return number;
5202
5581
  }
5203
5582
  //#endregion
5204
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toHex.js
5583
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toHex.js
5205
5584
  const hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
5206
5585
  /**
5207
5586
  * Encodes a string, number, bigint, or ByteArray into a hex string
@@ -5364,7 +5743,7 @@ function stringToHex(value_, opts = {}) {
5364
5743
  return bytesToHex(encoder$2.encode(value_), opts);
5365
5744
  }
5366
5745
  //#endregion
5367
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toBytes.js
5746
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toBytes.js
5368
5747
  const encoder$1 = /*#__PURE__*/ new TextEncoder();
5369
5748
  /**
5370
5749
  * Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.
@@ -5746,7 +6125,7 @@ const gen$1 = (suffix, blockLen, outputLen) => createHasher(() => new Keccak$1(b
5746
6125
  /** keccak-256 hash function. Different from SHA3-256. */
5747
6126
  const keccak_256$1 = /* @__PURE__ */ (() => gen$1(1, 136, 32))();
5748
6127
  //#endregion
5749
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/keccak256.js
6128
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/keccak256.js
5750
6129
  function keccak256$1(value, to_) {
5751
6130
  const to = to_ || "hex";
5752
6131
  const bytes = keccak_256$1(isHex$1(value, { strict: false }) ? toBytes$1(value) : value);
@@ -5754,13 +6133,13 @@ function keccak256$1(value, to_) {
5754
6133
  return toHex(bytes);
5755
6134
  }
5756
6135
  //#endregion
5757
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/hashSignature.js
6136
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/hashSignature.js
5758
6137
  const hash = (value) => keccak256$1(toBytes$1(value));
5759
6138
  function hashSignature(sig) {
5760
6139
  return hash(sig);
5761
6140
  }
5762
6141
  //#endregion
5763
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/normalizeSignature.js
6142
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/normalizeSignature.js
5764
6143
  function normalizeSignature(signature) {
5765
6144
  let active = true;
5766
6145
  let current = "";
@@ -5806,7 +6185,7 @@ function normalizeSignature(signature) {
5806
6185
  return result;
5807
6186
  }
5808
6187
  //#endregion
5809
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toSignature.js
6188
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toSignature.js
5810
6189
  /**
5811
6190
  * Returns the signature for a given function or event definition.
5812
6191
  *
@@ -5831,7 +6210,7 @@ const toSignature = (def) => {
5831
6210
  })());
5832
6211
  };
5833
6212
  //#endregion
5834
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toSignatureHash.js
6213
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toSignatureHash.js
5835
6214
  /**
5836
6215
  * Returns the hash (of the function/event signature) for a given event or function definition.
5837
6216
  */
@@ -5839,7 +6218,7 @@ function toSignatureHash(fn) {
5839
6218
  return hashSignature(toSignature(fn));
5840
6219
  }
5841
6220
  //#endregion
5842
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toEventSelector.js
6221
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toEventSelector.js
5843
6222
  /**
5844
6223
  * Returns the event selector for a given event definition.
5845
6224
  *
@@ -5849,7 +6228,7 @@ function toSignatureHash(fn) {
5849
6228
  */
5850
6229
  const toEventSelector = toSignatureHash;
5851
6230
  //#endregion
5852
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/address.js
6231
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/address.js
5853
6232
  var InvalidAddressError = class extends BaseError {
5854
6233
  constructor({ address }) {
5855
6234
  super(`Address "${address}" is invalid.`, {
@@ -5859,7 +6238,7 @@ var InvalidAddressError = class extends BaseError {
5859
6238
  }
5860
6239
  };
5861
6240
  //#endregion
5862
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/lru.js
6241
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/lru.js
5863
6242
  /**
5864
6243
  * Map with a LRU (Least recently used) policy.
5865
6244
  *
@@ -5895,7 +6274,7 @@ var LruMap = class extends Map {
5895
6274
  }
5896
6275
  };
5897
6276
  //#endregion
5898
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/getAddress.js
6277
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/getAddress.js
5899
6278
  const checksumAddressCache = /*#__PURE__*/ new LruMap(8192);
5900
6279
  function checksumAddress(address_, chainId) {
5901
6280
  if (checksumAddressCache.has(`${address_}.${chainId}`)) return checksumAddressCache.get(`${address_}.${chainId}`);
@@ -5915,7 +6294,7 @@ function getAddress$1(address, chainId) {
5915
6294
  return checksumAddress(address, chainId);
5916
6295
  }
5917
6296
  //#endregion
5918
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/isAddress.js
6297
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/isAddress.js
5919
6298
  const addressRegex = /^0x[a-fA-F0-9]{40}$/;
5920
6299
  /** @internal */
5921
6300
  const isAddressCache = /*#__PURE__*/ new LruMap(8192);
@@ -5933,7 +6312,7 @@ function isAddress$1(address, options) {
5933
6312
  return result;
5934
6313
  }
5935
6314
  //#endregion
5936
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/concat.js
6315
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/concat.js
5937
6316
  function concat$1(values) {
5938
6317
  if (typeof values[0] === "string") return concatHex(values);
5939
6318
  return concatBytes(values);
@@ -5953,7 +6332,7 @@ function concatHex(values) {
5953
6332
  return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
5954
6333
  }
5955
6334
  //#endregion
5956
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/slice.js
6335
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/slice.js
5957
6336
  /**
5958
6337
  * @description Returns a section of the hex or byte array given a start/end bytes offset.
5959
6338
  *
@@ -6006,12 +6385,12 @@ function sliceHex(value_, start, end, { strict } = {}) {
6006
6385
  return value;
6007
6386
  }
6008
6387
  //#endregion
6009
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/regex.js
6388
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/regex.js
6010
6389
  const arrayRegex = /^(.*)\[([0-9]*)\]$/;
6011
6390
  const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
6012
6391
  const integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
6013
6392
  //#endregion
6014
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
6393
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
6015
6394
  /**
6016
6395
  * @description Encodes a list of primitive values into an ABI-encoded hex value.
6017
6396
  *
@@ -6248,7 +6627,7 @@ function isDynamicType(param) {
6248
6627
  return false;
6249
6628
  }
6250
6629
  //#endregion
6251
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
6630
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
6252
6631
  /**
6253
6632
  * Returns the function selector for a given function definition.
6254
6633
  *
@@ -6258,7 +6637,7 @@ function isDynamicType(param) {
6258
6637
  */
6259
6638
  const toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
6260
6639
  //#endregion
6261
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/getAbiItem.js
6640
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/getAbiItem.js
6262
6641
  function getAbiItem(parameters) {
6263
6642
  const { abi, args = [], name } = parameters;
6264
6643
  const isSelector = isHex$1(name, { strict: false });
@@ -6341,7 +6720,7 @@ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
6341
6720
  }
6342
6721
  }
6343
6722
  //#endregion
6344
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
6723
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
6345
6724
  const docsPath = "/docs/contract/encodeFunctionData";
6346
6725
  function prepareEncodeFunctionData(parameters) {
6347
6726
  const { abi, args, functionName } = parameters;
@@ -6362,7 +6741,7 @@ function prepareEncodeFunctionData(parameters) {
6362
6741
  };
6363
6742
  }
6364
6743
  //#endregion
6365
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
6744
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
6366
6745
  function encodeFunctionData(parameters) {
6367
6746
  const { args } = parameters;
6368
6747
  const { abi, functionName } = (() => {
@@ -6373,7 +6752,7 @@ function encodeFunctionData(parameters) {
6373
6752
  return concatHex([functionName, ("inputs" in abiItem && abiItem.inputs ? encodeAbiParameters$1(abiItem.inputs, args ?? []) : void 0) ?? "0x"]);
6374
6753
  }
6375
6754
  //#endregion
6376
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/cursor.js
6755
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/cursor.js
6377
6756
  var NegativeOffsetError = class extends BaseError {
6378
6757
  constructor({ offset }) {
6379
6758
  super(`Offset \`${offset}\` cannot be negative.`, { name: "NegativeOffsetError" });
@@ -6390,7 +6769,7 @@ var RecursiveReadLimitExceededError = class extends BaseError {
6390
6769
  }
6391
6770
  };
6392
6771
  //#endregion
6393
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/cursor.js
6772
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/cursor.js
6394
6773
  const staticCursor = {
6395
6774
  bytes: /* @__PURE__ */ new Uint8Array(),
6396
6775
  dataView: /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(0)),
@@ -6553,7 +6932,7 @@ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
6553
6932
  return cursor;
6554
6933
  }
6555
6934
  //#endregion
6556
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/fromBytes.js
6935
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/fromBytes.js
6557
6936
  /**
6558
6937
  * Decodes a byte array into a bigint.
6559
6938
  *
@@ -6636,7 +7015,7 @@ function bytesToString(bytes_, opts = {}) {
6636
7015
  return new TextDecoder().decode(bytes);
6637
7016
  }
6638
7017
  //#endregion
6639
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
7018
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
6640
7019
  function decodeAbiParameters(params, data) {
6641
7020
  const bytes = typeof data === "string" ? hexToBytes(data) : data;
6642
7021
  const cursor = createCursor(bytes);
@@ -6803,13 +7182,13 @@ function hasDynamicChild(param) {
6803
7182
  return false;
6804
7183
  }
6805
7184
  //#endregion
6806
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/stringify.js
7185
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/stringify.js
6807
7186
  const stringify$1 = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
6808
7187
  const value = typeof value_ === "bigint" ? value_.toString() : value_;
6809
7188
  return typeof replacer === "function" ? replacer(key, value) : value;
6810
7189
  }, space);
6811
7190
  //#endregion
6812
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/Value.js
7191
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/Value.js
6813
7192
  /** @see https://ethereum.github.io/yellowpaper/paper.pdf */
6814
7193
  const exponents = {
6815
7194
  wei: 0,
@@ -6884,7 +7263,7 @@ var InvalidDecimalsError = class extends Error {
6884
7263
  }
6885
7264
  };
6886
7265
  //#endregion
6887
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
7266
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
6888
7267
  /**
6889
7268
  * @description Converts an ECDSA public key to an address.
6890
7269
  *
@@ -6896,7 +7275,7 @@ function publicKeyToAddress(publicKey) {
6896
7275
  return checksumAddress(`0x${keccak256$1(`0x${publicKey.substring(4)}`).substring(26)}`);
6897
7276
  }
6898
7277
  //#endregion
6899
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
7278
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
6900
7279
  async function recoverPublicKey({ hash, signature }) {
6901
7280
  const hashHex = isHex$1(hash) ? hash : toHex(hash);
6902
7281
  const { secp256k1 } = await import("./secp256k1-BSimfttS.mjs");
@@ -6919,7 +7298,7 @@ function toRecoveryBit(yParityOrV) {
6919
7298
  throw new Error("Invalid yParityOrV value");
6920
7299
  }
6921
7300
  //#endregion
6922
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverAddress.js
7301
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverAddress.js
6923
7302
  async function recoverAddress({ hash, signature }) {
6924
7303
  return publicKeyToAddress(await recoverPublicKey({
6925
7304
  hash,
@@ -6927,7 +7306,7 @@ async function recoverAddress({ hash, signature }) {
6927
7306
  }));
6928
7307
  }
6929
7308
  //#endregion
6930
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toRlp.js
7309
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toRlp.js
6931
7310
  function toRlp(bytes, to = "hex") {
6932
7311
  const encodable = getEncodable(bytes);
6933
7312
  const cursor = createCursor(new Uint8Array(encodable.length));
@@ -6993,7 +7372,7 @@ function getSizeOfLength(length) {
6993
7372
  throw new BaseError("Length is too large.");
6994
7373
  }
6995
7374
  //#endregion
6996
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/decodeFunctionData.js
7375
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/decodeFunctionData.js
6997
7376
  function decodeFunctionData(parameters) {
6998
7377
  const { abi, data } = parameters;
6999
7378
  const signature = slice(data, 0, 4);
@@ -7005,7 +7384,7 @@ function decodeFunctionData(parameters) {
7005
7384
  };
7006
7385
  }
7007
7386
  //#endregion
7008
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/encodePacked.js
7387
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/abi/encodePacked.js
7009
7388
  function encodePacked(types, values) {
7010
7389
  if (types.length !== values.length) throw new AbiEncodingLengthMismatchError({
7011
7390
  expectedLength: types.length,
@@ -7060,7 +7439,7 @@ function encode(type, value, isArray = false) {
7060
7439
  throw new UnsupportedPackedAbiType(type);
7061
7440
  }
7062
7441
  //#endregion
7063
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/isBytes.js
7442
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/isBytes.js
7064
7443
  function isBytes(value) {
7065
7444
  if (!value) return false;
7066
7445
  if (typeof value !== "object") return false;
@@ -7068,7 +7447,7 @@ function isBytes(value) {
7068
7447
  return value.BYTES_PER_ELEMENT === 1 && value.constructor.name === "Uint8Array";
7069
7448
  }
7070
7449
  //#endregion
7071
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/getContractAddress.js
7450
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/getContractAddress.js
7072
7451
  function getContractAddress(opts) {
7073
7452
  if (opts.opcode === "CREATE2") return getCreate2Address(opts);
7074
7453
  return getCreateAddress$1(opts);
@@ -7097,7 +7476,7 @@ function getCreate2Address(opts) {
7097
7476
  ])), 12));
7098
7477
  }
7099
7478
  //#endregion
7100
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/typedData.js
7479
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/typedData.js
7101
7480
  var InvalidDomainError = class extends BaseError {
7102
7481
  constructor({ domain }) {
7103
7482
  super(`Invalid domain "${stringify$1(domain)}".`, { metaMessages: ["Must be a valid EIP-712 domain."] });
@@ -7129,7 +7508,7 @@ var InvalidTypedDataTypeError = class extends BaseError {
7129
7508
  }
7130
7509
  };
7131
7510
  //#endregion
7132
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/typedData.js
7511
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/typedData.js
7133
7512
  function validateTypedData(parameters) {
7134
7513
  const { domain, message, primaryType, types } = parameters;
7135
7514
  const validateData = (struct, data) => {
@@ -7203,7 +7582,7 @@ function validateReference(type) {
7203
7582
  if (type === "address" || type === "bool" || type === "string" || type.startsWith("bytes") || type.startsWith("uint") || type.startsWith("int")) throw new InvalidStructTypeError({ type });
7204
7583
  }
7205
7584
  //#endregion
7206
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/hashTypedData.js
7585
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/hashTypedData.js
7207
7586
  function hashTypedData(parameters) {
7208
7587
  const { domain = {}, message, primaryType } = parameters;
7209
7588
  const types = {
@@ -7308,7 +7687,7 @@ function encodeField({ types, name, type, value }) {
7308
7687
  return [{ type }, value];
7309
7688
  }
7310
7689
  //#endregion
7311
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverTypedDataAddress.js
7690
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverTypedDataAddress.js
7312
7691
  async function recoverTypedDataAddress(parameters) {
7313
7692
  const { domain, message, primaryType, signature, types } = parameters;
7314
7693
  return recoverAddress({
@@ -7322,7 +7701,7 @@ async function recoverTypedDataAddress(parameters) {
7322
7701
  });
7323
7702
  }
7324
7703
  //#endregion
7325
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/formatUnits.js
7704
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/formatUnits.js
7326
7705
  /**
7327
7706
  * Divides a number by a given exponent of base 10 (10exponent), and formats it into a string representation of the number..
7328
7707
  *
@@ -7715,7 +8094,16 @@ const PaymentLedgerRecordSchema = Schema.Union([Schema.Struct({
7715
8094
  settlementLogIndex: Schema.optional(LogIndexSchema),
7716
8095
  settledBlockNumber: Schema.optional(BlockNumberSchema$1),
7717
8096
  settledBlockHash: Schema.optional(Bytes32Schema),
7718
- settledEventLogIndex: Schema.optional(LogIndexSchema)
8097
+ settledEventLogIndex: Schema.optional(LogIndexSchema),
8098
+ quoteId: Schema.optional(nonEmpty("quoteId")),
8099
+ railOperationId: Schema.optional(nonEmpty("railOperationId")),
8100
+ payoutRecipientLabel: Schema.optional(Schema.String),
8101
+ payoutRecipientOnCapxul: Schema.optional(Schema.Boolean),
8102
+ payoutWarnRecipientOnCapxul: Schema.optional(Schema.Boolean),
8103
+ payoutOwnerPartyId: Schema.optional(Schema.String),
8104
+ requestedOutput: Schema.optional(MoneySchema),
8105
+ payoutOutputExact: Schema.optional(Schema.Boolean),
8106
+ refundMovementId: Schema.optional(MovementIdSchema)
7719
8107
  }), Schema.Struct({
7720
8108
  ...PaymentLedgerBaseSchema.fields,
7721
8109
  ledgerKind: Schema.Literal("Deposit"),
@@ -7724,7 +8112,7 @@ const PaymentLedgerRecordSchema = Schema.Union([Schema.Struct({
7724
8112
  documentHash: Schema.optional(Schema.Never),
7725
8113
  permissionId: Schema.optional(Schema.Never),
7726
8114
  purposeKind: Schema.optional(Schema.Never)
7727
- })]).pipe(Schema.refine((record) => record.ledgerKind === "Deposit" || hasActorBoundPermission(record.actor, record.actor.kind === "organization" ? record.actor.orgId : void 0, record.permissionId), { message: "Organization Payment and Payout records require permissionId; personal records forbid it" }));
8115
+ })]).pipe(Schema.refine((record) => record.ledgerKind === "Deposit" || hasActorBoundPermission(record.actor, record.actor.kind === "organization" ? record.actor.orgId : void 0, record.permissionId) && (record.recipient.kind === "party_account" ? record.ledgerKind === "Payout" && record.quoteId !== void 0 && record.railOperationId !== void 0 && record.payoutRecipientLabel !== void 0 && record.payoutRecipientOnCapxul !== void 0 && record.payoutWarnRecipientOnCapxul !== void 0 && record.payoutOwnerPartyId !== void 0 && record.requestedOutput !== void 0 && record.payoutOutputExact !== void 0 : record.quoteId === void 0 && record.railOperationId === void 0), { message: "Organization Payment and Payout records require permissionId; personal records forbid it" }));
7728
8116
  const PaymentCoreErrorSchema = Schema.Union([
7729
8117
  Schema.Struct({
7730
8118
  code: Schema.Literal("INVALID_TRANSITION"),
@@ -7775,8 +8163,16 @@ const ProtocolBirthInputSchema = Schema.Struct({
7775
8163
  documentHash: NonzeroDocumentHashSchema,
7776
8164
  documentContentHash: NonzeroDocumentHashSchema,
7777
8165
  release: ReleaseTermsSchema,
8166
+ quoteId: Schema.optional(nonEmpty("quoteId")),
8167
+ railOperationId: Schema.optional(nonEmpty("railOperationId")),
8168
+ payoutRecipientLabel: Schema.optional(Schema.String),
8169
+ payoutRecipientOnCapxul: Schema.optional(Schema.Boolean),
8170
+ payoutWarnRecipientOnCapxul: Schema.optional(Schema.Boolean),
8171
+ payoutOwnerPartyId: Schema.optional(Schema.String),
8172
+ requestedOutput: Schema.optional(MoneySchema),
8173
+ payoutOutputExact: Schema.optional(Schema.Boolean),
7778
8174
  lineage: Schema.optional(PaymentCommandLineageSchema)
7779
- }).pipe(Schema.refine((birth) => hasActorBoundPermission(birth.actor, birth.actor.kind === "organization" ? birth.actor.orgId : void 0, birth.permissionId), { message: "Organization Payment and Payout births require permissionId; personal births forbid it" }));
8175
+ }).pipe(Schema.refine((birth) => hasActorBoundPermission(birth.actor, birth.actor.kind === "organization" ? birth.actor.orgId : void 0, birth.permissionId) && (birth.recipient.kind === "party_account" ? birth.ledgerKind === "Payout" && birth.release.kind === "instant" && birth.quoteId !== void 0 && birth.railOperationId !== void 0 && birth.payoutRecipientLabel !== void 0 && birth.payoutRecipientOnCapxul !== void 0 && birth.payoutWarnRecipientOnCapxul !== void 0 && birth.payoutOwnerPartyId !== void 0 && birth.requestedOutput !== void 0 && birth.payoutOutputExact !== void 0 : birth.quoteId === void 0 && birth.railOperationId === void 0), { message: "Organization Payment and Payout births require permissionId; personal births forbid it" }));
7780
8176
  const ApplyVerifiedEvidenceCommandSchema = Schema.Struct({
7781
8177
  kind: Schema.Literal("apply_verified_evidence"),
7782
8178
  paymentId: PaymentIdSchema,
@@ -7801,7 +8197,11 @@ Schema.Union([
7801
8197
  paymentIds: Schema.Array(PaymentIdSchema),
7802
8198
  userOpHash: Bytes32Schema
7803
8199
  }),
7804
- ApplyVerifiedEvidenceCommandSchema
8200
+ ApplyVerifiedEvidenceCommandSchema,
8201
+ Schema.Struct({
8202
+ kind: Schema.Literal("apply_rail_delivery"),
8203
+ paymentId: PaymentIdSchema
8204
+ })
7805
8205
  ]);
7806
8206
  Schema.Union([
7807
8207
  Schema.Struct({
@@ -7877,12 +8277,11 @@ function paymentDocumentOptionsPayloadSize(options) {
7877
8277
  }
7878
8278
  const PaymentDocumentOptionsSchema = PaymentDocumentOptionsFieldsSchema.check(Schema.makeFilter((options) => paymentDocumentOptionsPayloadSize(options) <= 524288));
7879
8279
  const PaymentDocumentOptionsBatchSchema = Schema.Array(PaymentDocumentOptionsSchema).check(Schema.makeFilter((options) => options.length <= 100 && options.reduce((total, itemOptions) => total + paymentDocumentOptionsPayloadSize(itemOptions), 0) <= 524288));
7880
- //#endregion
7881
- //#region ../../packages/protocol/src/payments/schema/commands.ts
7882
8280
  const PaymentBirthItemSchema = Schema.Union([Schema.Struct({
7883
8281
  operation: Schema.Literal("send"),
7884
8282
  recipient: ActorOrDestinationRefSchema,
7885
8283
  amount: AssetAmountSchema,
8284
+ quoteId: Schema.optional(nonEmpty("quoteId")),
7886
8285
  purposeKind: PaymentPurposeKindSchema,
7887
8286
  document: Schema.optional(PaymentInstructionInputSchema),
7888
8287
  supportingReceipts: Schema.optional(Schema.Array(SupportingReceiptInputSchema)),
@@ -7902,12 +8301,13 @@ const PaymentBirthItemSchema = Schema.Union([Schema.Struct({
7902
8301
  operation: Schema.Literal("create_commitment"),
7903
8302
  recipient: ActorOrDestinationRefSchema,
7904
8303
  amount: AssetAmountSchema,
8304
+ quoteId: Schema.optional(nonEmpty("quoteId")),
7905
8305
  release: ReleaseTermsSchema.pipe(Schema.refine((release) => release.kind === "scheduled" || release.kind === "stream", { message: "Commitment release must be scheduled or stream" })),
7906
8306
  purposeKind: PaymentPurposeKindSchema,
7907
8307
  document: Schema.optional(PaymentInstructionInputSchema),
7908
8308
  supportingReceipts: Schema.optional(Schema.Array(SupportingReceiptInputSchema)),
7909
8309
  payroll: Schema.optional(Schema.Never)
7910
- })]);
8310
+ })]).pipe(Schema.refine((item) => item.recipient.kind === "party_account" ? item.operation === "send" && item.quoteId !== void 0 : item.quoteId === void 0, { message: "Bank payouts require an instant send with its accepted quote" }));
7911
8311
  const PaymentBirthCommandSchema = Schema.Struct({
7912
8312
  kind: Schema.Literal("birth"),
7913
8313
  requestKey: nonEmpty("requestKey"),
@@ -8024,6 +8424,7 @@ const PaymentExecutionIntentSchema = Schema.Struct({
8024
8424
  to: PaymentRef,
8025
8425
  externalAddressAcknowledged: Schema.optional(Schema.Literal(true)),
8026
8426
  amount: AssetAmountSchema,
8427
+ quoteId: Schema.optional(nonEmpty("quoteId")),
8027
8428
  paymentType: Schema.optional(Schema.Literals([
8028
8429
  "unspecified",
8029
8430
  "invoice",
@@ -8031,7 +8432,7 @@ const PaymentExecutionIntentSchema = Schema.Struct({
8031
8432
  "reimbursement"
8032
8433
  ])),
8033
8434
  timing: Schema.optional(PaymentTiming)
8034
- }).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value)));
8435
+ }).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value) && (value.to.kind === "party_account" ? value.quoteId !== void 0 && (value.timing === void 0 || value.timing.kind === "instant") : value.quoteId === void 0)));
8035
8436
  const PreparePaymentExecutionInputSchema = Schema.Struct({
8036
8437
  requestKey: nonEmpty("requestKey"),
8037
8438
  signerAddress: AddressSchema$1,
@@ -8100,6 +8501,7 @@ const SubmittedPaymentCommandExecutionSchema = Schema.Struct({
8100
8501
  userOpHash: Bytes32Schema,
8101
8502
  payments: Schema.Array(Payment)
8102
8503
  });
8504
+ const RedirectPaymentRef = PaymentRef.pipe(Schema.refine((recipient) => recipient.kind !== "party_account", { message: "Bank payout recipients cannot receive commitment redirects" }));
8103
8505
  const PaymentLifecycleExecutionIntentSchema = Schema.Union([
8104
8506
  Schema.Struct({
8105
8507
  kind: Schema.Literal("retry"),
@@ -8116,7 +8518,7 @@ const PaymentLifecycleExecutionIntentSchema = Schema.Union([
8116
8518
  Schema.Struct({
8117
8519
  kind: Schema.Literal("redirect"),
8118
8520
  paymentId: PaymentIdSchema,
8119
- recipient: PaymentRef
8521
+ recipient: RedirectPaymentRef
8120
8522
  })
8121
8523
  ]);
8122
8524
  const PreparePaymentLifecycleExecutionInputSchema = Schema.Struct({
@@ -8143,6 +8545,7 @@ const OrganizationPaymentExecutionItemSchema = Schema.Struct({
8143
8545
  to: PaymentRef,
8144
8546
  externalAddressAcknowledged: Schema.optional(Schema.Literal(true)),
8145
8547
  amount: AssetAmountSchema,
8548
+ quoteId: Schema.optional(nonEmpty("quoteId")),
8146
8549
  paymentType: Schema.optional(Schema.Literals([
8147
8550
  "unspecified",
8148
8551
  "invoice",
@@ -8151,7 +8554,7 @@ const OrganizationPaymentExecutionItemSchema = Schema.Struct({
8151
8554
  ])),
8152
8555
  /** When the recipient gets it: instant (the default), or held until a date or over a period. */
8153
8556
  timing: Schema.optional(PaymentTiming)
8154
- }).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value)));
8557
+ }).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value) && (value.to.kind === "party_account" ? value.quoteId !== void 0 && (value.timing === void 0 || value.timing.kind === "instant") : value.quoteId === void 0)));
8155
8558
  const PrepareOrganizationPaymentExecutionInputSchema = Schema.Struct({
8156
8559
  orgId: nonEmpty("orgId"),
8157
8560
  permissionId: PermissionIdSchema,
@@ -8313,7 +8716,11 @@ const ApprovalSummarySchema = Schema.Struct({
8313
8716
  to: Schema.Struct({ label: Schema.String }),
8314
8717
  /** The total, when every item moves one asset; null when nothing moves (a Permission change). */
8315
8718
  amount: Schema.NullOr(AssetAmountSchema),
8316
- network: ApprovalNetworkSchema
8719
+ network: ApprovalNetworkSchema,
8720
+ warnings: Schema.optional(Schema.Array(Schema.Struct({
8721
+ code: Schema.Literal("RECIPIENT_ON_CAPXUL"),
8722
+ message: Schema.String
8723
+ })))
8317
8724
  });
8318
8725
  /** The exact operation the signature covers: the digest is the one thing the key signs. */
8319
8726
  const ApprovalOperationSchema = Schema.Struct({
@@ -8700,6 +9107,95 @@ const keys = {
8700
9107
  })
8701
9108
  };
8702
9109
  //#endregion
9110
+ //#region ../../packages/protocol/src/banking/operations.ts
9111
+ const actor$3 = Schema.optionalKey(ActorScopeSchema);
9112
+ const target = {
9113
+ actor: actor$3,
9114
+ currency: BankCurrencySchema
9115
+ };
9116
+ const errors = [
9117
+ "NOT_AUTHENTICATED",
9118
+ "INVALID_INPUT",
9119
+ "ROLE_PERMISSION_DENIED",
9120
+ "ACCOUNT_NOT_FOUND",
9121
+ "SMART_ACCOUNT_MISSING",
9122
+ "PROVIDER_ERROR",
9123
+ ...DEFECTS
9124
+ ];
9125
+ const writeErrors = [...errors, "WRONG_STATE"];
9126
+ const bankDetails = {
9127
+ list: Operation.query("banking.bankDetails.list", {
9128
+ input: Schema.Struct({ actor: actor$3 }),
9129
+ output: BankDetailsOverviewSchema,
9130
+ errors
9131
+ }),
9132
+ get: Operation.query("banking.bankDetails.get", {
9133
+ input: Schema.Struct(target),
9134
+ output: Schema.NullOr(BankDetailsSchema),
9135
+ errors
9136
+ }),
9137
+ open: Operation.action("banking.bankDetails.open", {
9138
+ input: Schema.Struct(target),
9139
+ output: BankDetailsSchema,
9140
+ errors: writeErrors
9141
+ }),
9142
+ settle: Operation.action("banking.bankDetails.settle", {
9143
+ input: Schema.Struct({
9144
+ ...target,
9145
+ token: SettlementTokenSchema
9146
+ }),
9147
+ output: BankDetailsSchema,
9148
+ errors: writeErrors
9149
+ }),
9150
+ deactivate: Operation.action("banking.bankDetails.deactivate", {
9151
+ input: Schema.Struct(target),
9152
+ output: BankDetailsSchema,
9153
+ errors: writeErrors
9154
+ }),
9155
+ reactivate: Operation.action("banking.bankDetails.reactivate", {
9156
+ input: Schema.Struct(target),
9157
+ output: BankDetailsSchema,
9158
+ errors: writeErrors
9159
+ })
9160
+ };
9161
+ const deposits = {
9162
+ list: Operation.query("banking.deposits.list", {
9163
+ input: Schema.Struct({
9164
+ actor: actor$3,
9165
+ cursor: Schema.optionalKey(Schema.String),
9166
+ unmatched: Schema.optionalKey(Schema.Boolean)
9167
+ }),
9168
+ output: BankDepositsPageSchema,
9169
+ errors
9170
+ }),
9171
+ get: Operation.query("banking.deposits.get", {
9172
+ input: Schema.Struct({
9173
+ actor: actor$3,
9174
+ bankDepositId: Schema.String
9175
+ }),
9176
+ output: Schema.NullOr(BankDepositSchema),
9177
+ errors
9178
+ }),
9179
+ candidates: Operation.query("banking.deposits.candidates", {
9180
+ input: Schema.Struct({
9181
+ actor: actor$3,
9182
+ bankDepositId: Schema.String,
9183
+ cursor: Schema.optionalKey(Schema.String)
9184
+ }),
9185
+ output: BankDepositCandidatesPageSchema,
9186
+ errors
9187
+ }),
9188
+ match: Operation.mutation("banking.deposits.match", {
9189
+ input: Schema.Struct({
9190
+ actor: actor$3,
9191
+ bankDepositId: Schema.String,
9192
+ requestId: Schema.NullOr(Schema.String)
9193
+ }),
9194
+ output: BankDepositSchema,
9195
+ errors: writeErrors
9196
+ })
9197
+ };
9198
+ //#endregion
8703
9199
  //#region ../../packages/protocol/src/documents/operations.ts
8704
9200
  /** Every call: no session, or input that does not decode. */
8705
9201
  const CALL$8 = ["NOT_AUTHENTICATED", "INVALID_INPUT"];
@@ -10119,6 +10615,159 @@ const setups = {
10119
10615
  })
10120
10616
  };
10121
10617
  //#endregion
10618
+ //#region ../../packages/protocol/src/parties/accounts-schema.ts
10619
+ const BankAccountOwnerTypeSchema = Schema.Literals(["individual", "business"]);
10620
+ const text$1 = Schema.String;
10621
+ const optionalText = Schema.optionalKey(text$1);
10622
+ const holder = {
10623
+ holderName: text$1,
10624
+ bankName: optionalText
10625
+ };
10626
+ const owner = {
10627
+ ownerType: Schema.optionalKey(BankAccountOwnerTypeSchema),
10628
+ firstName: optionalText,
10629
+ lastName: optionalText,
10630
+ businessName: optionalText
10631
+ };
10632
+ const BankBeneficiaryAddressSchema = Schema.Struct({
10633
+ streetLine1: text$1,
10634
+ streetLine2: optionalText,
10635
+ city: text$1,
10636
+ state: optionalText,
10637
+ postalCode: optionalText,
10638
+ country: text$1
10639
+ });
10640
+ const iban = {
10641
+ ...holder,
10642
+ currency: Schema.Literal("eur"),
10643
+ iban: text$1,
10644
+ bic: optionalText
10645
+ };
10646
+ Schema.Union([
10647
+ Schema.Struct({
10648
+ ...holder,
10649
+ currency: Schema.Literal("usd"),
10650
+ accountNumber: text$1,
10651
+ routingNumber: text$1,
10652
+ accountType: Schema.Literals(["checking", "savings"]),
10653
+ address: BankBeneficiaryAddressSchema
10654
+ }),
10655
+ Schema.Struct({
10656
+ ...holder,
10657
+ ...owner,
10658
+ currency: Schema.Literal("gbp"),
10659
+ sortCode: text$1,
10660
+ accountNumber: text$1
10661
+ }),
10662
+ Schema.Struct({
10663
+ ...iban,
10664
+ ownerType: Schema.Literal("individual"),
10665
+ firstName: text$1,
10666
+ lastName: text$1
10667
+ }),
10668
+ Schema.Struct({
10669
+ ...iban,
10670
+ ownerType: Schema.Literal("business"),
10671
+ businessName: text$1
10672
+ })
10673
+ ]);
10674
+ const BankAccountFilterSchema = Schema.Union([Schema.Struct({ kind: Schema.Literal("self") }), Schema.Struct({
10675
+ kind: Schema.Literal("contact"),
10676
+ ref: RecipientLocatorSchema
10677
+ })]);
10678
+ const BankAccountTargetSchema = Schema.Union([BankAccountFilterSchema, Schema.Struct({
10679
+ kind: Schema.Literal("new"),
10680
+ name: text$1,
10681
+ email: optionalText
10682
+ })]);
10683
+ const BankAccountSchema = Schema.Struct({
10684
+ partyAccountId: text$1,
10685
+ ownerPartyId: text$1,
10686
+ ownerScope: Schema.Literals(["self", "contact"]),
10687
+ currency: BankCurrencySchema,
10688
+ holderName: text$1,
10689
+ bankName: optionalText,
10690
+ last4: text$1,
10691
+ state: Schema.Literals([
10692
+ "saved",
10693
+ "active",
10694
+ "inactive"
10695
+ ]),
10696
+ recipient: Schema.Struct({
10697
+ ref: RecipientLocatorSchema,
10698
+ label: text$1,
10699
+ onCapxul: Schema.Boolean
10700
+ })
10701
+ });
10702
+ const BankAccountFieldSchema = Schema.Struct({
10703
+ id: text$1,
10704
+ label: text$1,
10705
+ required: Schema.Boolean,
10706
+ choices: Schema.optionalKey(Schema.Array(Schema.Struct({
10707
+ value: text$1,
10708
+ label: text$1
10709
+ }))),
10710
+ minLength: Schema.optionalKey(nonNegativeInteger("minLength")),
10711
+ maxLength: Schema.optionalKey(nonNegativeInteger("maxLength")),
10712
+ pattern: optionalText
10713
+ });
10714
+ const BankAccountRequirementsSchema = Schema.Struct({
10715
+ currency: BankCurrencySchema,
10716
+ fields: Schema.Array(BankAccountFieldSchema)
10717
+ });
10718
+ //#endregion
10719
+ //#region ../../packages/protocol/src/parties/accounts-operations.ts
10720
+ const actor$2 = Schema.optionalKey(ActorScopeSchema);
10721
+ const READ = [
10722
+ "NOT_AUTHENTICATED",
10723
+ "INVALID_INPUT",
10724
+ "ROLE_PERMISSION_DENIED",
10725
+ ...DEFECTS
10726
+ ];
10727
+ const WRITE = [
10728
+ ...READ,
10729
+ "SMART_ACCOUNT_MISSING",
10730
+ "ACCOUNT_NOT_FOUND"
10731
+ ];
10732
+ const accounts = {
10733
+ requirements: Operation.query("parties.accounts.requirements", {
10734
+ input: Schema.Struct({
10735
+ actor: actor$2,
10736
+ currency: BankCurrencySchema,
10737
+ ownerType: Schema.optionalKey(BankAccountOwnerTypeSchema),
10738
+ country: Schema.optionalKey(Schema.String)
10739
+ }),
10740
+ output: BankAccountRequirementsSchema,
10741
+ errors: READ
10742
+ }),
10743
+ add: Operation.mutation("parties.accounts.add", {
10744
+ input: Schema.Struct({
10745
+ actor: actor$2,
10746
+ target: BankAccountTargetSchema,
10747
+ details: Schema.Unknown,
10748
+ requestKey: Schema.String
10749
+ }),
10750
+ output: BankAccountSchema,
10751
+ errors: [...WRITE, "PROVIDER_ERROR"]
10752
+ }),
10753
+ list: Operation.query("parties.accounts.list", {
10754
+ input: Schema.Struct({
10755
+ actor: actor$2,
10756
+ target: Schema.optionalKey(BankAccountFilterSchema)
10757
+ }),
10758
+ output: pageOf(BankAccountSchema),
10759
+ errors: READ
10760
+ }),
10761
+ remove: Operation.mutation("parties.accounts.remove", {
10762
+ input: Schema.Struct({
10763
+ actor: actor$2,
10764
+ partyAccountId: Schema.String
10765
+ }),
10766
+ output: Schema.Struct({ partyAccountId: Schema.String }),
10767
+ errors: WRITE
10768
+ })
10769
+ };
10770
+ //#endregion
10122
10771
  //#region ../../packages/protocol/src/parties/operations.ts
10123
10772
  /** Every call: no session, or input that does not decode or validate. */
10124
10773
  const CALL$5 = ["NOT_AUTHENTICATED", "INVALID_INPUT"];
@@ -10131,6 +10780,62 @@ const ADMIN$2 = [
10131
10780
  "ACCOUNT_NOT_FOUND"
10132
10781
  ];
10133
10782
  const actor$1 = Schema.optionalKey(ActorScopeSchema);
10783
+ const VERIFICATION_ERRORS = [
10784
+ ...CALL$5,
10785
+ ...DEFECTS,
10786
+ ...MEMBER$1,
10787
+ "WRONG_STATE",
10788
+ "PROVIDER_ERROR"
10789
+ ];
10790
+ const verificationTarget = {
10791
+ orgId: Schema.optionalKey(Schema.String),
10792
+ invitationId: Schema.optionalKey(Schema.String)
10793
+ };
10794
+ /** Person and business verification. Bridge owns the requirements and the decision. */
10795
+ const verifications$1 = {
10796
+ invite: Operation.action("parties.verifications.invite", {
10797
+ input: Schema.Struct({
10798
+ orgId: Schema.String,
10799
+ people: Schema.Unknown
10800
+ }),
10801
+ output: VerificationStatusSchema,
10802
+ errors: VERIFICATION_ERRORS
10803
+ }),
10804
+ start: Operation.action("parties.verifications.start", {
10805
+ input: Schema.Struct({
10806
+ ...verificationTarget,
10807
+ surface: Schema.optionalKey(Schema.Literals([
10808
+ "web",
10809
+ "cli",
10810
+ "agent",
10811
+ "sdk",
10812
+ "unspecified"
10813
+ ]))
10814
+ }),
10815
+ output: VerificationStatusSchema,
10816
+ errors: VERIFICATION_ERRORS
10817
+ }),
10818
+ status: Operation.action("parties.verifications.status", {
10819
+ input: Schema.Struct(verificationTarget),
10820
+ output: VerificationStatusSchema,
10821
+ errors: VERIFICATION_ERRORS
10822
+ }),
10823
+ answer: Operation.action("parties.verifications.answer", {
10824
+ input: Schema.Struct({
10825
+ ...verificationTarget,
10826
+ answers: Schema.Unknown,
10827
+ surface: Schema.optionalKey(Schema.Literals([
10828
+ "web",
10829
+ "cli",
10830
+ "agent",
10831
+ "sdk",
10832
+ "unspecified"
10833
+ ]))
10834
+ }),
10835
+ output: VerificationStatusSchema,
10836
+ errors: VERIFICATION_ERRORS
10837
+ })
10838
+ };
10134
10839
  const OneContact = Schema.Struct({
10135
10840
  actor: actor$1,
10136
10841
  partyId: Schema.String
@@ -10396,38 +11101,52 @@ const PreparedOfferCheckoutExecutionSchema = Schema.Struct({
10396
11101
  //#endregion
10397
11102
  //#region ../../packages/protocol/src/requests/checkout-schema.ts
10398
11103
  /** Link holders receive payment terms, not the private Invoice document. */
10399
- const InvoiceCheckoutSummarySchema = Schema.Struct({
11104
+ const InvoiceCheckoutStatusSchema = Schema.Literals([
11105
+ "sent",
11106
+ "pending_settlement",
11107
+ "paid",
11108
+ "cancelled",
11109
+ "declined",
11110
+ "expired",
11111
+ "unavailable"
11112
+ ]);
11113
+ const InvoiceCheckoutCommonSchema = Schema.Struct({
10400
11114
  documentKind: Schema.optional(Schema.Literals(["memo", "invoice"])),
10401
11115
  linkToken: boundedText(128),
10402
11116
  issuerLabel: boundedText(256),
10403
11117
  dueAt: InvoiceDraftSchema.fields.dueAt,
11118
+ documentHash: Bytes32Schema,
11119
+ status: InvoiceCheckoutStatusSchema
11120
+ });
11121
+ const AssetInvoiceCheckoutSummarySchema = Schema.Struct({
11122
+ ...InvoiceCheckoutCommonSchema.fields,
10404
11123
  amount: AssetAmountSchema,
10405
11124
  chainId: ChainIdSchema$1,
10406
11125
  tokenAddress: AddressSchema$1,
10407
11126
  rawAmount: Schema.String,
10408
11127
  recipientSafe: SafeAddressSchema,
10409
11128
  contractAddress: AddressSchema$1,
10410
- settlementId: Bytes32Schema,
10411
- documentHash: Bytes32Schema,
10412
- status: Schema.Literals([
10413
- "sent",
10414
- "pending_settlement",
10415
- "paid",
10416
- "cancelled",
10417
- "declined",
10418
- "expired",
10419
- "unavailable"
10420
- ])
11129
+ settlementId: Bytes32Schema
11130
+ });
11131
+ const MoneyInvoiceCheckoutSummarySchema = Schema.Struct({
11132
+ ...InvoiceCheckoutCommonSchema.fields,
11133
+ documentKind: Schema.Literal("invoice"),
11134
+ amount: MoneySchema,
11135
+ bankPayment: Schema.Struct({
11136
+ receivingAccountId: Schema.String,
11137
+ currency: MoneySchema.fields.currency
11138
+ })
10421
11139
  });
11140
+ const InvoiceCheckoutSummarySchema = Schema.Union([AssetInvoiceCheckoutSummarySchema, MoneyInvoiceCheckoutSummarySchema]);
10422
11141
  const InvoiceCheckoutPreparationSchema = Schema.Struct({
10423
- invoice: InvoiceCheckoutSummarySchema,
11142
+ invoice: AssetInvoiceCheckoutSummarySchema,
10424
11143
  sourceWallet: AddressSchema$1,
10425
11144
  allowance: OfferCheckoutPreparationSchema.fields.allowance,
10426
11145
  approval: CheckoutTransactionSchema,
10427
11146
  payment: CheckoutTransactionSchema
10428
11147
  });
10429
11148
  const InvoiceCheckoutStateSchema = Schema.Struct({
10430
- invoice: InvoiceCheckoutSummarySchema,
11149
+ invoice: AssetInvoiceCheckoutSummarySchema,
10431
11150
  verification: CheckoutStateSchema.fields.verification,
10432
11151
  receipt: Schema.NullOr(CheckoutReceiptSchema),
10433
11152
  latePayment: Schema.Boolean
@@ -10457,22 +11176,27 @@ const PrepareInvoiceCheckoutExecutionInputSchema = Schema.Struct({
10457
11176
  const { checkout: _offerSnapshotField, ...registeredCheckoutExecutionFields } = PreparedOfferCheckoutExecutionSchema.fields;
10458
11177
  const PreparedInvoiceCheckoutExecutionSchema = Schema.Struct({
10459
11178
  ...registeredCheckoutExecutionFields,
10460
- invoice: InvoiceCheckoutSummarySchema
11179
+ invoice: AssetInvoiceCheckoutSummarySchema
10461
11180
  });
10462
11181
  /** Generic request checkout uses the same fixed obligation and receipt contract. */
10463
- const RequestCheckoutSummarySchema = Schema.Struct({
10464
- ...InvoiceCheckoutSummarySchema.fields,
11182
+ const AssetRequestCheckoutSummarySchema = Schema.Struct({
11183
+ ...AssetInvoiceCheckoutSummarySchema.fields,
10465
11184
  documentKind: Schema.Literals(["memo", "invoice"])
10466
11185
  });
11186
+ const MoneyRequestCheckoutSummarySchema = Schema.Struct({
11187
+ ...MoneyInvoiceCheckoutSummarySchema.fields,
11188
+ documentKind: Schema.Literal("invoice")
11189
+ });
11190
+ const RequestCheckoutSummarySchema = Schema.Union([AssetRequestCheckoutSummarySchema, MoneyRequestCheckoutSummarySchema]);
10467
11191
  const RequestCheckoutPreparationSchema = Schema.Struct({
10468
- request: RequestCheckoutSummarySchema,
11192
+ request: AssetRequestCheckoutSummarySchema,
10469
11193
  sourceWallet: InvoiceCheckoutPreparationSchema.fields.sourceWallet,
10470
11194
  allowance: InvoiceCheckoutPreparationSchema.fields.allowance,
10471
11195
  approval: InvoiceCheckoutPreparationSchema.fields.approval,
10472
11196
  payment: InvoiceCheckoutPreparationSchema.fields.payment
10473
11197
  });
10474
11198
  const RequestCheckoutStateSchema = Schema.Struct({
10475
- request: RequestCheckoutSummarySchema,
11199
+ request: AssetRequestCheckoutSummarySchema,
10476
11200
  verification: InvoiceCheckoutStateSchema.fields.verification,
10477
11201
  receipt: InvoiceCheckoutStateSchema.fields.receipt,
10478
11202
  latePayment: InvoiceCheckoutStateSchema.fields.latePayment
@@ -10495,7 +11219,7 @@ const RequestCheckoutReconciliationSchema = Schema.Union([
10495
11219
  ]);
10496
11220
  const PreparedRequestCheckoutExecutionSchema = Schema.Struct({
10497
11221
  ...registeredCheckoutExecutionFields,
10498
- request: RequestCheckoutSummarySchema
11222
+ request: AssetRequestCheckoutSummarySchema
10499
11223
  });
10500
11224
  //#endregion
10501
11225
  //#region ../../packages/protocol/src/payments/witness-schema.ts
@@ -10527,6 +11251,24 @@ const SendWitnessSchema = Schema.Struct({
10527
11251
  attempts: Schema.Array(SendAttemptSchema)
10528
11252
  });
10529
11253
  //#endregion
11254
+ //#region ../../packages/protocol/src/payments/payout-operations.ts
11255
+ const quotes = { quote: Operation.action("payments.quotes.quote", {
11256
+ input: PaymentQuoteInputSchema,
11257
+ output: PaymentQuoteSchema,
11258
+ errors: [
11259
+ "NOT_AUTHENTICATED",
11260
+ "INVALID_INPUT",
11261
+ "ROLE_PERMISSION_DENIED",
11262
+ "ACCOUNT_NOT_FOUND",
11263
+ "SMART_ACCOUNT_MISSING",
11264
+ "VERIFICATION_REQUIRED",
11265
+ "INSUFFICIENT_BALANCE",
11266
+ "WRONG_STATE",
11267
+ "PROVIDER_ERROR",
11268
+ ...DEFECTS
11269
+ ]
11270
+ }) };
11271
+ //#endregion
10530
11272
  //#region ../../packages/protocol/src/payments/operations.ts
10531
11273
  const OrgId$2 = Schema.NonEmptyString;
10532
11274
  /** Every call: no session, or input that does not decode or validate. */
@@ -11704,7 +12446,8 @@ const RequestPartySchema = Schema.Struct({
11704
12446
  const RequestViewSchema = Schema.Struct({
11705
12447
  id: Schema.String,
11706
12448
  status: Schema.Literals(REQUEST_STATUSES),
11707
- amount: AssetAmountSchema,
12449
+ amount: Schema.Union([AssetAmountSchema, MoneySchema]),
12450
+ receivingAccountId: Schema.optionalKey(Schema.String),
11708
12451
  reference: Schema.String,
11709
12452
  memo: Schema.NullOr(Schema.String),
11710
12453
  /** The bearer link a payer follows to the checkout. */
@@ -11713,6 +12456,7 @@ const RequestViewSchema = Schema.Struct({
11713
12456
  entitlementGranted: Schema.Boolean,
11714
12457
  /** The Payment an approval prepared for this request. */
11715
12458
  settledPaymentId: Schema.NullOr(Schema.String),
12459
+ settledDepositRef: Schema.optionalKey(Schema.String),
11716
12460
  documents: Schema.Array(DocumentRefV3Schema),
11717
12461
  expiresAt: Schema.NullOr(EpochMsSchema$1),
11718
12462
  createdAt: EpochMsSchema$1,
@@ -11727,16 +12471,25 @@ const RequestViewSchema = Schema.Struct({
11727
12471
  addressedToViewer: Schema.optionalKey(Schema.Boolean)
11728
12472
  });
11729
12473
  /** Ask a payer for money: a basic request, or one carrying an Invoice. */
11730
- const IssueRequestInputSchema = Schema.Struct({
12474
+ const IssueRequestCommonSchema = Schema.Struct({
11731
12475
  actor: RequestActorSchema,
11732
- amount: AssetAmountSchema,
11733
12476
  reference: Schema.String,
11734
12477
  /** Absent for a link anyone holding it may pay. */
11735
12478
  payer: Schema.optionalKey(RecipientLocatorSchema),
11736
12479
  memo: Schema.optionalKey(Schema.String),
11737
- invoice: Schema.optionalKey(InvoiceDraftSchema),
11738
12480
  expiresAt: Schema.optionalKey(Schema.Finite)
11739
12481
  });
12482
+ const IssueRequestInputSchema = Schema.Union([Schema.Struct({
12483
+ ...IssueRequestCommonSchema.fields,
12484
+ amount: AssetAmountSchema,
12485
+ invoice: Schema.optionalKey(InvoiceDraftSchema),
12486
+ receivingAccountId: Schema.optional(Schema.Never)
12487
+ }), Schema.Struct({
12488
+ ...IssueRequestCommonSchema.fields,
12489
+ amount: MoneySchema,
12490
+ invoice: InvoiceDraftSchema,
12491
+ receivingAccountId: Schema.String
12492
+ })]);
11740
12493
  //#endregion
11741
12494
  //#region ../../packages/protocol/src/requests/operations.ts
11742
12495
  const actor = RequestActorSchema;
@@ -12170,6 +12923,10 @@ const checkouts = {
12170
12923
  //#endregion
12171
12924
  //#region ../../packages/protocol/src/operations.ts
12172
12925
  const OPERATIONS = [
12926
+ ...Object.values(accounts),
12927
+ ...Object.values(quotes),
12928
+ ...Object.values(bankDetails),
12929
+ ...Object.values(deposits),
12173
12930
  ...Object.values(sessions),
12174
12931
  ...Object.values(items),
12175
12932
  ...Object.values(annotations),
@@ -12196,6 +12953,7 @@ const OPERATIONS = [
12196
12953
  ...Object.values(treasuries),
12197
12954
  ...Object.values(setups),
12198
12955
  ...Object.values(contacts),
12956
+ ...Object.values(verifications$1),
12199
12957
  ...Object.values(destinations),
12200
12958
  ...Object.values(recipients),
12201
12959
  ...Object.values(records),
@@ -12277,9 +13035,11 @@ const PEOPLE_OPERATIONS = {
12277
13035
  read: "accounts.read",
12278
13036
  /** The writes an approval's actions run: the recorded signature, and the scheduled lapse. */
12279
13037
  approvals: {
13038
+ consumeApproved: "accounts.approvals.consumeApproved",
12280
13039
  expire: "accounts.approvals.expire",
12281
13040
  recordApproval: "accounts.approvals.recordApproval",
12282
- recordExpiry: "accounts.approvals.recordExpiry"
13041
+ recordExpiry: "accounts.approvals.recordExpiry",
13042
+ sendApproved: "accounts.approvals.sendApproved"
12283
13043
  },
12284
13044
  balances: { readBinding: "accounts.balances.readBinding" },
12285
13045
  claims: {
@@ -12532,9 +13292,38 @@ const ORGANIZATION_OPERATIONS = {
12532
13292
  load: "organizations.treasuries.load" }
12533
13293
  },
12534
13294
  /** Parties' internal functions; its public rows join from `OPERATIONS`. */
12535
- parties: { contacts: {
12536
- /** Posts `contact_relationship_changed` after a contact write commits. */
12537
- emitRelationshipChanged: "parties.contacts.emitRelationshipChanged" } }
13295
+ parties: {
13296
+ accounts: {
13297
+ register: "parties.accounts.register",
13298
+ prepare: "parties.accounts.prepare",
13299
+ finalize: "parties.accounts.finalize"
13300
+ },
13301
+ verificationSubmit: {
13302
+ send: "parties.verificationSubmit.send",
13303
+ person: "parties.verificationSubmit.person"
13304
+ },
13305
+ verifications: {
13306
+ begin: "parties.verifications.begin",
13307
+ invitePeople: "parties.verifications.invitePeople",
13308
+ loadPeople: "parties.verifications.loadPeople",
13309
+ loadPerson: "parties.verifications.loadPerson",
13310
+ recordPerson: "parties.verifications.recordPerson",
13311
+ recordOwnershipAttestation: "parties.verifications.recordOwnershipAttestation",
13312
+ recordBusinessContact: "parties.verifications.recordBusinessContact",
13313
+ recordBusinessContactRejected: "parties.verifications.recordBusinessContactRejected",
13314
+ deliverPersonInvite: "parties.verifications.deliverPersonInvite",
13315
+ load: "parties.verifications.load",
13316
+ recordSnapshot: "parties.verifications.recordSnapshot",
13317
+ recordPrefill: "parties.verifications.recordPrefill",
13318
+ upload: "parties.verifications.upload",
13319
+ recordDocument: "parties.verifications.recordDocument",
13320
+ loadDocument: "parties.verifications.loadDocument",
13321
+ deleteDocument: "parties.verifications.deleteDocument"
13322
+ },
13323
+ contacts: {
13324
+ /** Posts `contact_relationship_changed` after a contact write commits. */
13325
+ emitRelationshipChanged: "parties.contacts.emitRelationshipChanged" }
13326
+ }
12538
13327
  };
12539
13328
  //#endregion
12540
13329
  //#region ../../packages/observability/src/operations/money.ts
@@ -12557,10 +13346,6 @@ emitSaved: "activity.annotations.emitSaved" },
12557
13346
  faucetSafe: { deploy: "FaucetSafe.deploy" },
12558
13347
  financialOps: { createPayee: "financialOps.createPayee" },
12559
13348
  holdings: { current: "holdings.current" },
12560
- offramp: {
12561
- quote: "offramp.quote",
12562
- status: "offramp.status"
12563
- },
12564
13349
  organizationPayments: {
12565
13350
  pay: "organizationPayments.pay",
12566
13351
  payBatch: "organizationPayments.payBatch",
@@ -12743,6 +13528,12 @@ loadBudgetLeft: "permissions.authorities.loadBudgetLeft" },
12743
13528
  //#endregion
12744
13529
  //#region ../../packages/observability/src/operations/platform.ts
12745
13530
  const PLATFORM_OPERATIONS = {
13531
+ /** Native Convex deployment requests, before application telemetry can run. */
13532
+ deployments: { convex: {
13533
+ evaluatePush: "deployments.convex.evaluatePush",
13534
+ startPush: "deployments.convex.startPush",
13535
+ finishPush: "deployments.convex.finishPush"
13536
+ } },
12746
13537
  /** Applications' internal functions and HTTP endpoints; its public rows join from `OPERATIONS`. */
12747
13538
  applications: {
12748
13539
  bootstraps: {
@@ -12777,11 +13568,7 @@ const PLATFORM_OPERATIONS = {
12777
13568
  /** The scan's read of its saved checkpoint. */
12778
13569
  loadCheckpoint: "indexing.movements.loadCheckpoint",
12779
13570
  /** The scan's transaction: one window's Movements and its checkpoint. */
12780
- applyWindow: "indexing.movements.applyWindow",
12781
- /** Whether a queued `deposit_settled` still describes an included Movement. */
12782
- isDepositTelemetryCurrent: "indexing.movements.isDepositTelemetryCurrent",
12783
- /** Posts `deposit_settled` after a Deposit materializes. */
12784
- emitDepositSettled: "indexing.movements.emitDepositSettled"
13571
+ applyWindow: "indexing.movements.applyWindow"
12785
13572
  },
12786
13573
  drifts: {
12787
13574
  /** The minute cron: compare Convex outcomes to Ponder facts and correct drift. */
@@ -12859,12 +13646,54 @@ const PLATFORM_OPERATIONS = {
12859
13646
  }
12860
13647
  };
12861
13648
  //#endregion
13649
+ //#region ../../packages/observability/src/operations/banking.ts
13650
+ const BANKING_OPERATIONS = { banking: {
13651
+ payouts: {
13652
+ funding: "banking.payouts.funding",
13653
+ prepare: "banking.payouts.prepare",
13654
+ finalize: "banking.payouts.finalize",
13655
+ load: "banking.payouts.load",
13656
+ record: "banking.payouts.record",
13657
+ reconcile: "banking.payouts.reconcile"
13658
+ },
13659
+ deposits: {
13660
+ record: "banking.deposits.record",
13661
+ load: "banking.deposits.load",
13662
+ claimMint: "banking.deposits.claimMint",
13663
+ recordMint: "banking.deposits.recordMint",
13664
+ credit: "banking.deposits.credit",
13665
+ confirm: "banking.deposits.confirm",
13666
+ reconcile: "banking.deposits.reconcile",
13667
+ autoMatch: "banking.deposits.autoMatch"
13668
+ },
13669
+ bankDetails: {
13670
+ prepare: "banking.bankDetails.prepare",
13671
+ finalize: "banking.bankDetails.finalize",
13672
+ load: "banking.bankDetails.load",
13673
+ applyLifecycle: "banking.bankDetails.applyLifecycle"
13674
+ },
13675
+ webhooks: {
13676
+ receive: "banking.webhooks.receive",
13677
+ insert: "banking.webhooks.insert",
13678
+ process: "banking.webhooks.process",
13679
+ load: "banking.webhooks.load",
13680
+ record: "banking.webhooks.record"
13681
+ },
13682
+ reconcile: {
13683
+ catchUp: "banking.reconcile.catchUp",
13684
+ cursor: "banking.reconcile.cursor",
13685
+ advance: "banking.reconcile.advance",
13686
+ recover: "banking.reconcile.recover"
13687
+ }
13688
+ } };
13689
+ //#endregion
12862
13690
  //#region ../../packages/observability/src/operations.ts
12863
13691
  const CAPXUL_OPERATIONS = withRows({
12864
13692
  ...PEOPLE_OPERATIONS,
12865
13693
  ...ORGANIZATION_OPERATIONS,
12866
13694
  ...MONEY_OPERATIONS,
12867
- ...PLATFORM_OPERATIONS
13695
+ ...PLATFORM_OPERATIONS,
13696
+ ...BANKING_OPERATIONS
12868
13697
  });
12869
13698
  /** The named tree, with every operation row added under its own name. */
12870
13699
  function withRows(named) {
@@ -13044,6 +13873,8 @@ const UiStepProps = {
13044
13873
  * `invoice_issued` carries `issuer_scope_kind`; neither is repeated here.
13045
13874
  */
13046
13875
  const JourneyVariantProps = {
13876
+ /** Whose bank verification Bridge decides. */
13877
+ subject_kind: Schema.Literals(["person", "business"]),
13047
13878
  /** How a person came to Get started: by themselves, an invite, money that waited, or an invoice. */
13048
13879
  entry_path: Schema.optional(Schema.Literals([
13049
13880
  "signup",
@@ -13051,11 +13882,13 @@ const JourneyVariantProps = {
13051
13882
  "claim",
13052
13883
  "invoice"
13053
13884
  ])),
13054
- /** Where the person acted. `agent` is an AI agent driving the CLI. */
13885
+ /** Caller surface. An undeclared historical caller remains `unspecified`. */
13055
13886
  surface: Schema.optional(Schema.Literals([
13056
13887
  "web",
13057
13888
  "cli",
13058
- "agent"
13889
+ "agent",
13890
+ "sdk",
13891
+ "unspecified"
13059
13892
  ])),
13060
13893
  /** Who pays: a person from their own account, or an Organization from a Budget. */
13061
13894
  payer_kind: Schema.optional(Schema.Literals(["person", "organization"])),
@@ -13070,6 +13903,116 @@ const JourneyVariantProps = {
13070
13903
  ]))
13071
13904
  };
13072
13905
  //#endregion
13906
+ //#region ../../packages/observability/src/events/banking.ts
13907
+ const PayoutTelemetryProps = {
13908
+ recipient_kind: Schema.optional(Schema.Literals([
13909
+ "capxul",
13910
+ "wallet",
13911
+ "bank"
13912
+ ])),
13913
+ rail: Schema.optional(Schema.Literals(["direct", "bridge"])),
13914
+ recipient_on_capxul: Schema.optional(Schema.Boolean),
13915
+ party_account_id: OptionalString,
13916
+ quote_id: OptionalString,
13917
+ rail_operation_id: OptionalString
13918
+ };
13919
+ Schema.Struct({
13920
+ name: Schema.Literal("bank_details_issued"),
13921
+ props: Schema.Struct({
13922
+ ...TelemetryEnvelopeProps,
13923
+ receiving_account_id: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u)),
13924
+ currency: Schema.Literals([
13925
+ "usd",
13926
+ "eur",
13927
+ "gbp"
13928
+ ]),
13929
+ bank_rail: Schema.Literals([
13930
+ "ach",
13931
+ "wire",
13932
+ "sepa",
13933
+ "faster_payments"
13934
+ ]),
13935
+ funding_source: Schema.Literal("bank"),
13936
+ rail: Schema.Literal("bridge"),
13937
+ release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
13938
+ })
13939
+ });
13940
+ const DepositProps = {
13941
+ ...TelemetryEnvelopeProps,
13942
+ bank_deposit_id: Schema.String,
13943
+ receiving_account_id: Schema.String,
13944
+ currency: Schema.Literals([
13945
+ "usd",
13946
+ "eur",
13947
+ "gbp"
13948
+ ]),
13949
+ bank_rail: Schema.Literals([
13950
+ "ach",
13951
+ "wire",
13952
+ "sepa",
13953
+ "faster_payments"
13954
+ ]),
13955
+ rail: Schema.Literal("bridge"),
13956
+ release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
13957
+ };
13958
+ Schema.Struct({
13959
+ name: Schema.Literal("bank_deposit_credited"),
13960
+ props: Schema.Struct({
13961
+ ...DepositProps,
13962
+ funding_source: Schema.Literal("bank"),
13963
+ chain_movement_id: Schema.String
13964
+ })
13965
+ });
13966
+ Schema.Struct({
13967
+ name: Schema.Literal("bank_deposit_returned"),
13968
+ props: Schema.Struct({
13969
+ ...DepositProps,
13970
+ funding_source: Schema.Literal("bank")
13971
+ })
13972
+ });
13973
+ Schema.Struct({
13974
+ name: Schema.Literal("bank_deposit_matched"),
13975
+ props: Schema.Struct({
13976
+ ...DepositProps,
13977
+ request_id: Schema.String,
13978
+ pay_path: Schema.Literal("bank"),
13979
+ issuer_scope_kind: Schema.Literals(["account", "organization"]),
13980
+ match_kind: Schema.Literals(["reference", "manual"])
13981
+ })
13982
+ });
13983
+ Schema.Struct({
13984
+ name: Schema.Literal("banking_webhook_received"),
13985
+ props: Schema.Struct({
13986
+ ...TelemetryEnvelopeProps,
13987
+ release: Schema.optional(Schema.String),
13988
+ signature_result: Schema.Literals([
13989
+ "valid",
13990
+ "missing",
13991
+ "malformed",
13992
+ "stale",
13993
+ "invalid"
13994
+ ]),
13995
+ outcome: Schema.Literals([
13996
+ "inserted",
13997
+ "duplicate",
13998
+ "rejected",
13999
+ "failed"
14000
+ ]),
14001
+ bridge_event_id: Schema.optional(Schema.String),
14002
+ bridge_event_type: Schema.optional(Schema.String),
14003
+ duration_ms: Schema.Finite
14004
+ })
14005
+ });
14006
+ Schema.Struct({
14007
+ name: Schema.Literal("banking_reconcile_completed"),
14008
+ props: Schema.Struct({
14009
+ ...TelemetryEnvelopeProps,
14010
+ release: Schema.optional(Schema.String),
14011
+ recovered: Schema.Finite,
14012
+ has_more: Schema.Boolean
14013
+ })
14014
+ });
14015
+ //#endregion
13073
14016
  //#region ../../packages/observability/src/events/money.ts
13074
14017
  /**
13075
14018
  * R08 (#1966): which Safe was read, on which chain, of which token. `currency`
@@ -13131,12 +14074,14 @@ const RecipientLocatorKindSchema = Schema.Literals([
13131
14074
  "handle",
13132
14075
  "email",
13133
14076
  "address",
13134
- "party"
14077
+ "party",
14078
+ "party_account"
13135
14079
  ]);
13136
14080
  const RecipientResolutionStatusSchema = Schema.Literals([
13137
14081
  "known_party",
13138
14082
  "new_email",
13139
- "external_address"
14083
+ "external_address",
14084
+ "bank_account"
13140
14085
  ]);
13141
14086
  const RecipientPartyKindSchema = Schema.Literals([
13142
14087
  "person",
@@ -13144,6 +14089,7 @@ const RecipientPartyKindSchema = Schema.Literals([
13144
14089
  "unresolved"
13145
14090
  ]);
13146
14091
  const RecipientTelemetryProps = {
14092
+ ...PayoutTelemetryProps,
13147
14093
  recipient_locator_kind: Schema.optional(RecipientLocatorKindSchema),
13148
14094
  recipient_resolution_status: Schema.optional(RecipientResolutionStatusSchema),
13149
14095
  recipient_party_id: OptionalString,
@@ -14095,6 +15041,18 @@ const CLI_COMMAND_NAMES = [
14095
15041
  "account.retry",
14096
15042
  "balance",
14097
15043
  "address",
15044
+ "verify",
15045
+ "verify.start",
15046
+ "verify.status",
15047
+ "bank",
15048
+ "bank.details",
15049
+ "bank.accounts",
15050
+ "bank.accounts.add",
15051
+ "bank.accounts.remove",
15052
+ "bank.pay",
15053
+ "bank.deposits",
15054
+ "bank.match",
15055
+ "bank.settle",
14098
15056
  "payment",
14099
15057
  "payment.send",
14100
15058
  "payment.list",
@@ -14121,6 +15079,8 @@ const CLI_COMMAND_NAMES = [
14121
15079
  "offer.deactivate",
14122
15080
  "contact",
14123
15081
  "contact.add",
15082
+ "contact.bank",
15083
+ "contact.bank.add",
14124
15084
  "contact.list",
14125
15085
  "contact.get",
14126
15086
  "contact.label",
@@ -14199,6 +15159,8 @@ const CLI_CAPABILITIES = [
14199
15159
  "diagnostics",
14200
15160
  "collection",
14201
15161
  "authentication",
15162
+ "verification",
15163
+ "banking",
14202
15164
  "account",
14203
15165
  "organization",
14204
15166
  "contacts",
@@ -14422,6 +15384,52 @@ Schema.Struct({
14422
15384
  props: MemberActivationFailedProps
14423
15385
  });
14424
15386
  //#endregion
15387
+ //#region ../../packages/observability/src/events/verification.ts
15388
+ const Identifier = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u));
15389
+ const FieldId = Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u));
15390
+ /** Journey: get_verified. Private answers and provider URLs are never properties. */
15391
+ const VerificationProps = Schema.Struct({
15392
+ ...TelemetryEnvelopeProps,
15393
+ verification_id: Identifier,
15394
+ invitation_id: Schema.optional(Identifier),
15395
+ party_id: Identifier,
15396
+ subject_kind: JourneyVariantProps.subject_kind,
15397
+ surface: JourneyVariantProps.surface,
15398
+ rail: Schema.Literal("bridge"),
15399
+ verification_state: VerificationStateSchema,
15400
+ missing_field_ids: Schema.optional(Schema.Array(FieldId)),
15401
+ release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
15402
+ });
15403
+ Schema.Struct({
15404
+ name: Schema.Literal("verification_started"),
15405
+ props: VerificationProps
15406
+ }), Schema.Struct({
15407
+ name: Schema.Literal("verification_terms_accepted"),
15408
+ props: VerificationProps
15409
+ }), Schema.Struct({
15410
+ name: Schema.Literal("verification_submitted"),
15411
+ props: VerificationProps
15412
+ }), Schema.Struct({
15413
+ name: Schema.Literal("verification_person_invited"),
15414
+ props: Schema.Struct({
15415
+ ...VerificationProps.fields,
15416
+ subject_kind: Schema.Literal("business"),
15417
+ invitation_id: Identifier
15418
+ })
15419
+ }), Schema.Struct({
15420
+ name: Schema.Literal("verification_liveness_requested"),
15421
+ props: VerificationProps
15422
+ }), Schema.Struct({
15423
+ name: Schema.Literal("verification_information_requested"),
15424
+ props: VerificationProps
15425
+ }), Schema.Struct({
15426
+ name: Schema.Literal("verification_approved"),
15427
+ props: VerificationProps
15428
+ }), Schema.Struct({
15429
+ name: Schema.Literal("verification_rejected"),
15430
+ props: VerificationProps
15431
+ });
15432
+ //#endregion
14425
15433
  //#region ../../packages/observability/src/telemetry/redaction.ts
14426
15434
  function redactTelemetryProps(name, props, options = {}) {
14427
15435
  if (props === void 0) return void 0;
@@ -15822,7 +16830,7 @@ function mapAccountLifecycle(input) {
15822
16830
  }
15823
16831
  //#endregion
15824
16832
  //#region ../../packages/sdk/package.json
15825
- var version$1 = "4.20.0-beta.30";
16833
+ var version$1 = "4.20.0-beta.32";
15826
16834
  //#endregion
15827
16835
  //#region ../../packages/sdk/src/observability/telemetry/exception-projection.ts
15828
16836
  /** Fixed fallback for failures that have no safe message. */
@@ -16430,7 +17438,20 @@ function admitted(row, error) {
16430
17438
  });
16431
17439
  }
16432
17440
  //#endregion
16433
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/getInitCode.js
17441
+ //#region ../../packages/sdk/src/payments/bank-evidence.ts
17442
+ /** Bank recipients keep their chosen account identity beside the exact funding address. */
17443
+ function bankTargetsMatch(evidence) {
17444
+ const request = evidence.request;
17445
+ if (!("items" in request)) return true;
17446
+ return request.items.every((source, index) => {
17447
+ if (!("to" in source) || source.to.kind !== "party_account") return true;
17448
+ const observation = evidence.recipientObservations[index];
17449
+ const item = evidence.preparedCommand?.items[index];
17450
+ return source.quoteId !== void 0 && item?.operation === "send" && observation?.recipient_locator_kind === "party_account" && observation.recipient_resolution_status === "bank_account" && observation.party_account_id === source.to.partyAccountId && observation.recipient_address.toLowerCase() === item.recipientSafe.toLowerCase();
17451
+ });
17452
+ }
17453
+ //#endregion
17454
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/getInitCode.js
16434
17455
  function getInitCode(userOperation, options = {}) {
16435
17456
  const { forHash } = options;
16436
17457
  const { authorization, factory, factoryData } = userOperation;
@@ -16442,7 +17463,7 @@ function getInitCode(userOperation, options = {}) {
16442
17463
  return concat$1([factory, factoryData ?? "0x"]);
16443
17464
  }
16444
17465
  //#endregion
16445
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js
17466
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js
16446
17467
  /** Magic suffix for paymaster signature encoding (keccak256("PaymasterSignature")[:8]) */
16447
17468
  const paymasterSignatureMagic = "0x22e325a297439656";
16448
17469
  function toPackedUserOperation(userOperation, options = {}) {
@@ -16470,7 +17491,7 @@ function toPackedUserOperation(userOperation, options = {}) {
16470
17491
  };
16471
17492
  }
16472
17493
  //#endregion
16473
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/getUserOperationTypedData.js
17494
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/getUserOperationTypedData.js
16474
17495
  const types = { PackedUserOperation: [
16475
17496
  {
16476
17497
  type: "address",
@@ -16521,7 +17542,7 @@ function getUserOperationTypedData(parameters) {
16521
17542
  };
16522
17543
  }
16523
17544
  //#endregion
16524
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js
17545
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js
16525
17546
  function getUserOperationHash(parameters) {
16526
17547
  const { chainId, entryPointAddress, entryPointVersion } = parameters;
16527
17548
  const userOperation = parameters.userOperation;
@@ -17224,6 +18245,144 @@ function supportedEnvelopeOf(input) {
17224
18245
  function envelopeV3Of(input) {
17225
18246
  return SchemaParser.decodeUnknownSync(PaymentDocumentEnvelopeV3Schema, { onExcessProperty: "error" })(input);
17226
18247
  }
18248
+ //#endregion
18249
+ //#region ../../packages/protocol/src/documents/money-invoice-hash.ts
18250
+ const MONEY_INVOICE_V5_EIP712_TYPES = {
18251
+ EIP712Domain: [
18252
+ {
18253
+ name: "name",
18254
+ type: "string"
18255
+ },
18256
+ {
18257
+ name: "version",
18258
+ type: "string"
18259
+ },
18260
+ {
18261
+ name: "chainId",
18262
+ type: "uint256"
18263
+ },
18264
+ {
18265
+ name: "salt",
18266
+ type: "bytes32"
18267
+ }
18268
+ ],
18269
+ ReceiptAmountV3: [
18270
+ {
18271
+ name: "denomination",
18272
+ type: "uint8"
18273
+ },
18274
+ {
18275
+ name: "currency",
18276
+ type: "string"
18277
+ },
18278
+ {
18279
+ name: "asset",
18280
+ type: "string"
18281
+ },
18282
+ {
18283
+ name: "minorUnits",
18284
+ type: "uint256"
18285
+ },
18286
+ {
18287
+ name: "decimals",
18288
+ type: "uint8"
18289
+ }
18290
+ ],
18291
+ Invoice: [
18292
+ {
18293
+ name: "kind",
18294
+ type: "uint8"
18295
+ },
18296
+ {
18297
+ name: "originId",
18298
+ type: "bytes32"
18299
+ },
18300
+ {
18301
+ name: "issuedAt",
18302
+ type: "uint64"
18303
+ },
18304
+ {
18305
+ name: "invoiceNumber",
18306
+ type: "string"
18307
+ },
18308
+ {
18309
+ name: "payerRef",
18310
+ type: "string"
18311
+ },
18312
+ {
18313
+ name: "payeeRef",
18314
+ type: "string"
18315
+ },
18316
+ {
18317
+ name: "amount",
18318
+ type: "ReceiptAmountV3"
18319
+ },
18320
+ {
18321
+ name: "receivingAccountId",
18322
+ type: "string"
18323
+ },
18324
+ {
18325
+ name: "target",
18326
+ type: "address"
18327
+ },
18328
+ {
18329
+ name: "dueAt",
18330
+ type: "uint64"
18331
+ },
18332
+ {
18333
+ name: "lineItemsHash",
18334
+ type: "bytes32"
18335
+ },
18336
+ {
18337
+ name: "note",
18338
+ type: "string"
18339
+ },
18340
+ {
18341
+ name: "discountMinor",
18342
+ type: "uint256"
18343
+ }
18344
+ ]
18345
+ };
18346
+ function message(envelope) {
18347
+ return {
18348
+ ...envelope.message,
18349
+ originId: toLowerBytes32(envelope.message.originId, "originId"),
18350
+ issuedAt: BigInt(envelope.message.issuedAt),
18351
+ amount: {
18352
+ ...envelope.message.amount,
18353
+ minorUnits: BigInt(envelope.message.amount.minorUnits)
18354
+ },
18355
+ target: toLowerAddress(envelope.message.target, "target"),
18356
+ dueAt: BigInt(envelope.message.dueAt),
18357
+ lineItemsHash: toLowerBytes32(envelope.message.lineItemsHash, "lineItemsHash"),
18358
+ discountMinor: BigInt(envelope.message.discountMinor)
18359
+ };
18360
+ }
18361
+ function domain(envelope) {
18362
+ return {
18363
+ ...envelope.domain,
18364
+ chainId: BigInt(envelope.domain.chainId),
18365
+ salt: toLowerBytes32(envelope.domain.salt, "domain.salt")
18366
+ };
18367
+ }
18368
+ function hashMoneyInvoiceV5(envelope) {
18369
+ return hashTypedData({
18370
+ domain: domain(envelope),
18371
+ primaryType: envelope.primaryType,
18372
+ types: MONEY_INVOICE_V5_EIP712_TYPES,
18373
+ message: message(envelope)
18374
+ });
18375
+ }
18376
+ async function verifyMoneyInvoiceV5Signature(envelope) {
18377
+ if (envelope.signature === void 0) return false;
18378
+ return (await recoverTypedDataAddress({
18379
+ domain: domain(envelope),
18380
+ primaryType: envelope.primaryType,
18381
+ types: MONEY_INVOICE_V5_EIP712_TYPES,
18382
+ message: message(envelope),
18383
+ signature: envelope.signature.value
18384
+ })).toLowerCase() === envelope.signature.signer;
18385
+ }
17227
18386
  /** Version 3 field order is fixed by the accepted Documents contract. */
17228
18387
  const PAYMENT_DOCUMENT_V3_EIP712_TYPES = {
17229
18388
  EIP712Domain: [
@@ -17481,30 +18640,45 @@ const INVOICE_V4_EIP712_TYPES = {
17481
18640
  function invoiceV4Message(envelope) {
17482
18641
  return {
17483
18642
  ...envelope.message,
18643
+ originId: toLowerBytes32(envelope.message.originId, "originId"),
18644
+ issuedAt: BigInt(envelope.message.issuedAt),
17484
18645
  amount: exactAssetV3Message(envelope.message.amount),
18646
+ target: toLowerAddress(envelope.message.target, "target"),
18647
+ dueAt: BigInt(envelope.message.dueAt),
18648
+ lineItemsHash: toLowerBytes32(envelope.message.lineItemsHash, "lineItemsHash"),
17485
18649
  discountMinor: BigInt(envelope.message.discountMinor)
17486
18650
  };
17487
18651
  }
18652
+ function invoiceV4Domain(envelope) {
18653
+ return {
18654
+ ...envelope.domain,
18655
+ chainId: BigInt(envelope.domain.chainId),
18656
+ salt: toLowerBytes32(envelope.domain.salt, "domain.salt")
18657
+ };
18658
+ }
17488
18659
  function hashSupportedPaymentDocument(input) {
17489
18660
  const envelope = supportedEnvelopeOf(input);
17490
- if (envelope.version === 3) return hashPaymentDocumentV3(envelope);
17491
- const types = INVOICE_V4_EIP712_TYPES;
17492
- return hashTypedData({
17493
- domain: envelope.domain,
17494
- primaryType: envelope.primaryType,
17495
- types,
17496
- message: invoiceV4Message(envelope)
17497
- });
18661
+ switch (envelope.version) {
18662
+ case 3: return hashPaymentDocumentV3(envelope);
18663
+ case 4: return hashTypedData({
18664
+ domain: invoiceV4Domain(envelope),
18665
+ primaryType: envelope.primaryType,
18666
+ types: INVOICE_V4_EIP712_TYPES,
18667
+ message: invoiceV4Message(envelope)
18668
+ });
18669
+ case 5: return hashMoneyInvoiceV5(envelope);
18670
+ default: return absurd(envelope);
18671
+ }
17498
18672
  }
17499
18673
  async function verifySupportedPaymentDocumentSignature(input) {
17500
18674
  const envelope = supportedEnvelopeOf(input);
17501
- if (envelope.version === 3) return verifyPaymentDocumentSignatureV3(envelope);
17502
18675
  if (envelope.signature === void 0) return false;
17503
- const types = INVOICE_V4_EIP712_TYPES;
18676
+ if (envelope.version === 3) return verifyPaymentDocumentSignatureV3(envelope);
18677
+ if (envelope.version === 5) return verifyMoneyInvoiceV5Signature(envelope);
17504
18678
  return (await recoverTypedDataAddress({
17505
- domain: envelope.domain,
18679
+ domain: invoiceV4Domain(envelope),
17506
18680
  primaryType: envelope.primaryType,
17507
- types,
18681
+ types: INVOICE_V4_EIP712_TYPES,
17508
18682
  message: invoiceV4Message(envelope),
17509
18683
  signature: envelope.signature.value
17510
18684
  })).toLowerCase() === envelope.signature.signer;
@@ -17580,12 +18754,13 @@ function requestRetryInstruction(input) {
17580
18754
  const bytes = decodeCanonicalBase64V3(document.bytesBase64);
17581
18755
  const envelope = decodeSupportedPaymentDocumentEnvelope(bytes);
17582
18756
  if (envelope.primaryType !== "Memo" && envelope.primaryType !== "Invoice") return void 0;
18757
+ if (envelope.version === 5) return void 0;
17583
18758
  return {
17584
18759
  documentHash: hashSupportedPaymentDocument(envelope),
17585
18760
  contentHash: hashPaymentDocumentContentV3(bytes),
17586
18761
  role: "instruction",
17587
18762
  kind: envelope.primaryType === "Memo" ? "memo" : "invoice",
17588
- format: envelope.version === 4 ? "envelope-v4" : "envelope-v3",
18763
+ format: paymentDocumentEnvelopeFormat(envelope),
17589
18764
  issuedAt: envelope.message.issuedAt
17590
18765
  };
17591
18766
  }
@@ -17638,14 +18813,12 @@ function retryBirthContext(evidence) {
17638
18813
  };
17639
18814
  }
17640
18815
  //#endregion
17641
- //#region ../../packages/protocol/src/evm/assets.ts
18816
+ //#region ../../packages/protocol/src/evm/test-assets.ts
17642
18817
  const SYNTHETIC_TEST_ASSET_SOURCE = "synthetic-test-liquidity";
17643
18818
  /**
17644
- * The candidate tier: five owned test assets, every field read back from Base
17645
- * Sepolia after the deployment that created it (chain 84532, block
17646
- * 46,690,061). Real contracts, authored liquidity, no settlement
17647
- * admission — so rollback is removing consumers, never relabelling a
17648
- * deployed address or deleting its history.
18819
+ * Owned test assets, with metadata read from each creation receipt and contract.
18820
+ * Settlement admission lives in assets.ts. The fixed test exchange uses the
18821
+ * original five assets; bank EURC has its own deployment.
17649
18822
  *
17650
18823
  * `symbol` is the display string the owned contract returns. A
17651
18824
  * provider-supported USDC would be a different contract at a different
@@ -17707,31 +18880,45 @@ const SYNTHETIC_TEST_ASSET_FIXTURES = {
17707
18880
  deploymentStartBlock: 46690061,
17708
18881
  deploymentTransaction: "0x6f6b0302448c7cd7db5c118a8250e548c6e72821df373e5a27550e5cdfa635a1",
17709
18882
  source: SYNTHETIC_TEST_ASSET_SOURCE
18883
+ },
18884
+ eurc: {
18885
+ assetId: assetIdFor(84532, "0x15055b4ed1d248c169b92705757cd9c3d985ad5f"),
18886
+ chainId: toChainId(84532),
18887
+ tokenAddress: "0x15055b4ed1d248c169b92705757cd9c3d985ad5f",
18888
+ symbol: "EURC",
18889
+ decimals: 6,
18890
+ peg: toCurrencyCode("EUR"),
18891
+ deploymentStartBlock: 47893251,
18892
+ deploymentTransaction: "0x4e0ab412d980a672336487afd10da007d51f34f17876b19b13732c8125be90ca",
18893
+ source: SYNTHETIC_TEST_ASSET_SOURCE
17710
18894
  }
17711
18895
  };
17712
- const SYNTHETIC_TEST_ASSETS = [
18896
+ /** EURC is minted for bank deposits and has no admission to the fixed test exchange. */
18897
+ const SYNTHETIC_TEST_ASSETS = [...[
17713
18898
  SYNTHETIC_TEST_ASSET_FIXTURES.usdc,
17714
18899
  SYNTHETIC_TEST_ASSET_FIXTURES.usdt,
17715
18900
  SYNTHETIC_TEST_ASSET_FIXTURES.weth,
17716
18901
  SYNTHETIC_TEST_ASSET_FIXTURES.wbtc,
17717
18902
  SYNTHETIC_TEST_ASSET_FIXTURES.cngn
17718
- ];
18903
+ ], SYNTHETIC_TEST_ASSET_FIXTURES.eurc];
17719
18904
  toChainId(84532);
17720
18905
  /**
17721
18906
  * The settlement tier: the owned test assets admitted to the exact-transfer
17722
- * path and to the treasury reads. USDC, USDT and WETH are equal assets.
18907
+ * path and to the treasury reads. USDC, USDT, WETH and EURC are admitted assets.
17723
18908
  * There is no default token.
17724
18909
  */
17725
18910
  const SETTLEMENT_ASSETS_BASE_SEPOLIA = Object.freeze({
17726
18911
  CAPXUL_TEST_USDC: SYNTHETIC_TEST_ASSET_FIXTURES.usdc,
17727
18912
  CAPXUL_TEST_USDT: SYNTHETIC_TEST_ASSET_FIXTURES.usdt,
17728
- CAPXUL_TEST_WETH: SYNTHETIC_TEST_ASSET_FIXTURES.weth
18913
+ CAPXUL_TEST_WETH: SYNTHETIC_TEST_ASSET_FIXTURES.weth,
18914
+ CAPXUL_TEST_EURC: SYNTHETIC_TEST_ASSET_FIXTURES.eurc
17729
18915
  });
17730
18916
  const CONFIGURED_MONEY_ASSETS = Object.freeze(Object.values(SETTLEMENT_ASSETS_BASE_SEPOLIA));
17731
18917
  Object.freeze({ BASE_SEPOLIA: Object.freeze({
17732
18918
  CAPXUL_TEST_USDC: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_USDC.assetId,
17733
18919
  CAPXUL_TEST_USDT: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_USDT.assetId,
17734
- CAPXUL_TEST_WETH: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_WETH.assetId
18920
+ CAPXUL_TEST_WETH: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_WETH.assetId,
18921
+ CAPXUL_TEST_EURC: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_EURC.assetId
17735
18922
  }) });
17736
18923
  /**
17737
18924
  * Every known asset in ONE identity space. The tiers above declare admission;
@@ -17799,8 +18986,12 @@ function sameAmount(left, right) {
17799
18986
  }
17800
18987
  function verifySupportedPaymentDocumentContext(input, context) {
17801
18988
  const envelope = supportedEnvelopeOf(input);
17802
- if (envelope.version === 3) return verifyPaymentDocumentContextV3(envelope, context);
17803
- return envelope.domain.chainId === context.chainId && envelope.message.originId === context.originId && envelope.message.target === context.target && sameAmount(envelope.message.amount, context.amount);
18989
+ switch (envelope.version) {
18990
+ case 3: return verifyPaymentDocumentContextV3(envelope, context);
18991
+ case 4: return envelope.domain.chainId === context.chainId && envelope.message.originId === context.originId && envelope.message.target === context.target && sameAmount(envelope.message.amount, context.amount);
18992
+ case 5: return false;
18993
+ default: return absurd(envelope);
18994
+ }
17804
18995
  }
17805
18996
  function verifyPaymentDocumentContextV3(envelopeInput, context) {
17806
18997
  const envelope = envelopeV3Of(envelopeInput);
@@ -17839,7 +19030,7 @@ function validateInvoiceLineItems(input) {
17839
19030
  const derivedHash = hashLineItemsV3(items);
17840
19031
  const totalMinor = lineItemsTotalMinorV3(items);
17841
19032
  const hashMatches = derivedHash === envelope.message.lineItemsHash;
17842
- const discountMinor = envelope.version === 4 ? BigInt(envelope.message.discountMinor) : 0n;
19033
+ const discountMinor = envelope.version === 3 ? 0n : BigInt(envelope.message.discountMinor);
17843
19034
  const totalMatches = items.length === 0 ? discountMinor === 0n : discountMinor <= totalMinor && totalMinor - discountMinor === BigInt(envelope.message.amount.minorUnits);
17844
19035
  return {
17845
19036
  ok: hashMatches && totalMatches,
@@ -17849,8 +19040,8 @@ function validateInvoiceLineItems(input) {
17849
19040
  }
17850
19041
  /** Compare generated Invoice content with the confirmed draft before signing. */
17851
19042
  function invoiceDraftMatchesEnvelope(envelope, draft) {
17852
- if (envelope.primaryType !== "Invoice" || envelope.version !== invoiceDraftVersion(draft)) return false;
17853
- return envelope.message.invoiceNumber === draft.invoiceNumber && envelope.message.payerRef === draft.payerRef && envelope.message.payeeRef === draft.payeeRef && envelope.message.dueAt === draft.dueAt && envelope.message.lineItemsHash === hashLineItemsV3(draft.lineItems) && (envelope.version !== 4 || envelope.message.note === (draft.note ?? "") && envelope.message.discountMinor === (draft.discountMinor ?? "0"));
19043
+ if (envelope.primaryType !== "Invoice" || envelope.version !== 5 && envelope.version !== invoiceDraftVersion(draft)) return false;
19044
+ return envelope.message.invoiceNumber === draft.invoiceNumber && envelope.message.payerRef === draft.payerRef && envelope.message.payeeRef === draft.payeeRef && envelope.message.dueAt === draft.dueAt && envelope.message.lineItemsHash === hashLineItemsV3(draft.lineItems) && (envelope.version === 3 || envelope.message.note === (draft.note ?? "") && envelope.message.discountMinor === (draft.discountMinor ?? "0"));
17854
19045
  }
17855
19046
  function hashAdjustmentsV3(input) {
17856
19047
  const adjustments = SchemaParser.decodeUnknownSync(adjustmentsV3Schema, { onExcessProperty: "error" })(input);
@@ -17886,6 +19077,7 @@ async function receiptLinksMatch(source, links) {
17886
19077
  }
17887
19078
  async function documentContextMatches(input, command, item, bundle, ref, exact) {
17888
19079
  const envelope = bundle.envelope;
19080
+ if (envelope.version === 5) return false;
17889
19081
  const request = input.evidence.request;
17890
19082
  const confirmedInstruction = "kind" in request && request.kind === "payment_request" ? request.confirmation.instruction : requestRetryInstruction(input);
17891
19083
  const originId = confirmedInstruction === void 0 ? hashDocumentOriginIdV3({
@@ -17906,7 +19098,7 @@ async function documentContextMatches(input, command, item, bundle, ref, exact)
17906
19098
  minorUnits: exact.minorUnits,
17907
19099
  decimals: exact.decimals
17908
19100
  }
17909
- }) && hashSupportedPaymentDocument(envelope) === item.documentHash && ref.documentHash === item.documentHash && ref.role === "instruction" && ref.format === (envelope.version === 4 ? "envelope-v4" : "envelope-v3") && ref.issuedAt === envelope.message.issuedAt && (envelope.signature === void 0 || await verifySupportedPaymentDocumentSignature(envelope));
19101
+ }) && hashSupportedPaymentDocument(envelope) === item.documentHash && ref.documentHash === item.documentHash && ref.role === "instruction" && ref.format === paymentDocumentEnvelopeFormat(envelope) && ref.issuedAt === envelope.message.issuedAt && (envelope.signature === void 0 || await verifySupportedPaymentDocumentSignature(envelope));
17910
19102
  }
17911
19103
  function payslipContentMatches(source, bundle, ref) {
17912
19104
  const envelope = bundle.envelope;
@@ -19252,7 +20444,7 @@ async function verifiedPreparedCommand(evidence, sessionEmail, signerAddress, ch
19252
20444
  const permissionId = "kind" in evidence.request && evidence.request.kind === "payment_request" ? evidence.request.confirmation.permissionId : "items" in evidence.request ? evidence.request.permissionId : evidence.request.kind === "retry" && evidence.sourceCommand?.kind === "birth" ? evidence.sourceCommand.permissionId : void 0;
19253
20445
  if ("kind" in evidence.request && evidence.request.kind === "offer_checkout") return checkout !== void 0 && "checkoutId" in checkout && verifiesOfferCheckoutBirthEvidence(evidence, checkout, chainId) && verifiesMoneyOperation(evidence, expectedSafe, chainId, evidence.request.permissionId);
19254
20446
  if ("kind" in evidence.request && evidence.request.kind === "invoice_checkout") return checkout !== void 0 && "linkToken" in checkout && sourceWallet !== void 0 && verifiesInvoiceCheckoutBirthEvidence(evidence, checkout, chainId, sourceWallet) && verifiesMoneyOperation(evidence, expectedSafe, chainId, evidence.request.permissionId);
19255
- return verifiesMoneyOperation(evidence, expectedSafe, chainId, permissionId) && await verifiesMoneyBirthEvidence(evidence);
20447
+ return bankTargetsMatch(evidence) && verifiesMoneyOperation(evidence, expectedSafe, chainId, permissionId) && await verifiesMoneyBirthEvidence(evidence);
19256
20448
  }
19257
20449
  //#endregion
19258
20450
  //#region ../../packages/sdk/src/money/asset-amount.ts
@@ -19329,7 +20521,11 @@ function emitPaymentInitiated(telemetry, input, runPromise) {
19329
20521
  payment_lifecycle_id: `payment_lifecycle_${input.paymentId}`,
19330
20522
  ...input.commandId === void 0 ? {} : { command_id: input.commandId },
19331
20523
  ...input.executionId === void 0 ? {} : { execution_id: input.executionId },
19332
- ...input.recipient
20524
+ ...input.recipient,
20525
+ ...input.recipient.recipient_locator_kind === "party_account" ? {
20526
+ recipient_kind: "bank",
20527
+ rail: "bridge"
20528
+ } : {}
19333
20529
  }
19334
20530
  }, runPromise);
19335
20531
  }
@@ -19519,7 +20715,7 @@ function plannedCommitmentMatches(prepared) {
19519
20715
  function recipientMatches(prepared, target) {
19520
20716
  const { to, externalAddressAcknowledged } = prepared.payment;
19521
20717
  const observation = prepared.recipientObservation;
19522
- return observation.recipient_locator_kind === to.kind && observation.recipient_address.toLowerCase() === target && observation.external_address_acknowledged === (externalAddressAcknowledged === true) && (to.kind !== "address" || to.address.toLowerCase() === target) && (to.kind !== "party" || observation.recipient_party_id === to.partyId) && (to.kind !== "handle" || observation.recipient_handle?.toLowerCase() === to.handle.toLowerCase());
20718
+ return observation.recipient_locator_kind === to.kind && observation.recipient_address.toLowerCase() === target && observation.external_address_acknowledged === (externalAddressAcknowledged === true) && (to.kind !== "party_account" || observation.recipient_resolution_status === "bank_account" && observation.party_account_id === to.partyAccountId && prepared.payment.quoteId !== void 0) && (to.kind !== "address" || to.address.toLowerCase() === target) && (to.kind !== "party" || observation.recipient_party_id === to.partyId) && (to.kind !== "handle" || observation.recipient_handle?.toLowerCase() === to.handle.toLowerCase());
19523
20719
  }
19524
20720
  function itemMatches(prepared, amount) {
19525
20721
  const { item, payment } = prepared;
@@ -19584,6 +20780,7 @@ function verifiesPersonalOperation(prepared, expectedSafe, chainId) {
19584
20780
  async function documentReferenceMatches(prepared, amount) {
19585
20781
  const { item, documentBundle: bundle, instructionDocument: ref } = prepared;
19586
20782
  const envelope = bundle.envelope;
20783
+ if (envelope.version === 5) return false;
19587
20784
  if (item.operation !== "send" && item.operation !== "create_commitment") return false;
19588
20785
  return bundle.originId === hashDocumentOriginIdV3({
19589
20786
  chainId: prepared.chainId,
@@ -19597,7 +20794,7 @@ async function documentReferenceMatches(prepared, amount) {
19597
20794
  source: prepared.userOpSenderSafe.toLowerCase(),
19598
20795
  target: item.recipientSafe.toLowerCase(),
19599
20796
  amount
19600
- }) && hashSupportedPaymentDocument(envelope) === item.documentHash && ref.documentHash === item.documentHash && ref.role === "instruction" && ref.format === (envelope.version === 4 ? "envelope-v4" : "envelope-v3") && ref.issuedAt === envelope.message.issuedAt && bundle.adjustments === void 0 && (envelope.signature === void 0 || await verifySupportedPaymentDocumentSignature(envelope));
20797
+ }) && hashSupportedPaymentDocument(envelope) === item.documentHash && ref.documentHash === item.documentHash && ref.role === "instruction" && ref.format === paymentDocumentEnvelopeFormat(envelope) && ref.issuedAt === envelope.message.issuedAt && bundle.adjustments === void 0 && (envelope.signature === void 0 || await verifySupportedPaymentDocumentSignature(envelope));
19601
20798
  }
19602
20799
  function generatedDraftMatches(prepared) {
19603
20800
  const { envelope, lineItems } = prepared.documentBundle;
@@ -19955,6 +21152,21 @@ function executeOrganizationPayment(deps, input, signal, onPreparedClosed, contr
19955
21152
  })).pipe(Effect.mapError((publicError) => ({ publicError })))), controls), deps.runPromise), matchesIntent(input), true, onPreparedClosed, signal, controls, onPrepared);
19956
21153
  }
19957
21154
  //#endregion
21155
+ //#region ../../packages/sdk/src/payments/quotes.ts
21156
+ /** The immutable method scope owns the payer. The backend returns exact funding instructions. */
21157
+ function makePaymentQuote(deps, actor = { kind: "account" }) {
21158
+ return (input, options) => {
21159
+ const controls = deps.invocationControls?.(options) ?? options;
21160
+ return runCapxulEffect(callOperation(deps.convexCall, quotes.quote, copyInvocationObservation(controls, {
21161
+ ...input,
21162
+ actor
21163
+ })).pipe(Effect.tap(() => Effect.annotateCurrentSpan({
21164
+ party_account_id: input.to.partyAccountId,
21165
+ ...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
21166
+ }))), controls, quotes.quote.name, deps.runPromise);
21167
+ };
21168
+ }
21169
+ //#endregion
19958
21170
  //#region ../../packages/sdk/src/parties/backend-refs.ts
19959
21171
  function nonEmptyRefValue(value, field) {
19960
21172
  const trimmed = value.trim();
@@ -20015,6 +21227,176 @@ function backendRef(locator) {
20015
21227
  }
20016
21228
  }
20017
21229
  //#endregion
21230
+ //#region ../../packages/sdk/src/parties/verification-target.ts
21231
+ const verificationTargetInput = (target) => target.kind === "organization" ? { orgId: target.orgId } : target.kind === "invitation" ? { invitationId: target.invitationId } : {};
21232
+ /** Refuse a decoded response that identifies a different immutable scope. */
21233
+ const validateVerificationTarget = (target, status) => {
21234
+ return (target.kind === "personal" ? status.invitationId === void 0 && status.organization === void 0 && status.subjectKind !== "business" && status.subjectKind !== "business_person" : target.kind === "organization" ? status.invitationId === void 0 && status.subjectKind !== "person" && status.subjectKind !== "business_person" && (status.organization?.id === target.orgId || status.status === "not_started" && status.organization === void 0) : status.invitationId === target.invitationId && status.subjectKind !== "business") ? Effect.succeed(status) : Effect.fail(Errors.providerError("verification", "validateResponseScope", "Verification response scope does not match."));
21235
+ };
21236
+ //#endregion
21237
+ //#region ../../packages/sdk/src/parties/verifications.ts
21238
+ const documentReply = Schema.Struct({ documentId: Schema.NonEmptyString });
21239
+ const documentFields = new Set(VERIFICATION_DOCUMENT_FIELDS);
21240
+ const uploadFailure = () => Errors.providerError("verification", "uploadDocument", "The verification document could not be uploaded.");
21241
+ function makeVerificationMethods(deps, selectedTarget) {
21242
+ const target = selectedTarget ?? { kind: "personal" };
21243
+ let journeyId;
21244
+ let actorId;
21245
+ const context = (options) => {
21246
+ const resolved = deps.invocationControls?.(options) ?? options;
21247
+ const snapshot = readInvocationObservation(resolved) ?? { active: true };
21248
+ if (actorId !== snapshot.actorId) journeyId = void 0;
21249
+ actorId = snapshot.actorId;
21250
+ journeyId = options?.journey_id ?? journeyId ?? snapshot.context?.journeyId ?? `verification_${crypto.randomUUID()}`;
21251
+ const controls = {
21252
+ ...resolved,
21253
+ journey_id: journeyId,
21254
+ correlation_id: resolved?.correlation_id ?? snapshot.context?.correlationId ?? crypto.randomUUID()
21255
+ };
21256
+ const captured = snapshot.active ? withCapturedAttemptContext(snapshot.context, controls) : void 0;
21257
+ return attachInvocationObservation(controls, {
21258
+ ...snapshot,
21259
+ ...captured === void 0 ? {} : { context: captured }
21260
+ });
21261
+ };
21262
+ const remember = (status) => {
21263
+ if (status.journeyId !== "") journeyId = status.journeyId;
21264
+ return status;
21265
+ };
21266
+ const upload = (field, blob, options) => Effect.gen(function* () {
21267
+ if (!documentFields.has(field) || !(blob instanceof Blob) || blob.size === 0) return yield* Effect.fail(Errors.invalidInput("files", "Provide a supported verification document."));
21268
+ const jwt = yield* deps.authClient.getConvexJwt(options).pipe(Effect.mapError(toPublicError$1));
21269
+ return yield* Effect.tryPromise({
21270
+ try: async (signal) => {
21271
+ const response = await (deps.fetch ?? globalThis.fetch)(new URL("/parties/verifications/documents", deps.siteBaseUrl), {
21272
+ method: "POST",
21273
+ headers: {
21274
+ Authorization: `Bearer ${jwt.token}`,
21275
+ "Content-Type": blob.type || "application/octet-stream",
21276
+ "X-Capxul-Document-Field": field
21277
+ },
21278
+ body: blob,
21279
+ signal,
21280
+ redirect: "error"
21281
+ });
21282
+ if (!response.ok) throw uploadFailure();
21283
+ return await response.json();
21284
+ },
21285
+ catch: uploadFailure
21286
+ }).pipe(Effect.flatMap(Schema.decodeUnknownEffect(documentReply)), Effect.mapError(uploadFailure), Effect.map((reply) => reply.documentId));
21287
+ });
21288
+ const submit = (input, options) => {
21289
+ const controls = context(options);
21290
+ const hasAnswers = input?.answers !== void 0 || input?.files !== void 0;
21291
+ const people = input?.people;
21292
+ const row = people !== void 0 ? verifications$1.invite : hasAnswers ? verifications$1.answer : verifications$1.start;
21293
+ return runCapxulEffect(Effect.gen(function* () {
21294
+ if (people !== void 0 && target.kind !== "organization") return yield* Effect.fail(Errors.invalidInput("people", "People require an Organization verification scope."));
21295
+ let status;
21296
+ if (!hasAnswers) status = yield* callOperation(deps.convexCall, verifications$1.start, copyInvocationObservation(controls, {
21297
+ ...verificationTargetInput(target),
21298
+ surface: input?.surface ?? "sdk"
21299
+ }));
21300
+ else {
21301
+ const answers = { ...input?.answers };
21302
+ for (const [field, blob] of Object.entries(input?.files ?? {})) answers[field] = yield* upload(field, blob, controls);
21303
+ status = yield* callOperation(deps.convexCall, verifications$1.answer, copyInvocationObservation(controls, {
21304
+ ...verificationTargetInput(target),
21305
+ answers,
21306
+ surface: input?.surface ?? "sdk"
21307
+ }));
21308
+ }
21309
+ if (people !== void 0 && target.kind === "organization") status = yield* callOperation(deps.convexCall, verifications$1.invite, copyInvocationObservation(controls, {
21310
+ orgId: target.orgId,
21311
+ people
21312
+ }));
21313
+ return yield* validateVerificationTarget(target, status);
21314
+ }).pipe(Effect.map(remember)), controls, row.name, deps.runPromise);
21315
+ };
21316
+ const scoped = {
21317
+ start: submit,
21318
+ status: (options) => {
21319
+ const controls = context(options);
21320
+ return runCapxulEffect(callOperation(deps.convexCall, verifications$1.status, copyInvocationObservation(controls, verificationTargetInput(target))).pipe(Effect.flatMap((status) => validateVerificationTarget(target, status)), Effect.map(remember)), controls, verifications$1.status.name, deps.runPromise);
21321
+ }
21322
+ };
21323
+ return selectedTarget === void 0 ? {
21324
+ ...scoped,
21325
+ forInvitation: (invitationId) => makeVerificationMethods(deps, {
21326
+ kind: "invitation",
21327
+ invitationId
21328
+ })
21329
+ } : scoped;
21330
+ }
21331
+ //#endregion
21332
+ //#region ../../packages/sdk/src/parties/relationship-calls.ts
21333
+ function relationshipCalls(deps, convexCall) {
21334
+ const actor = deps.actor.kind === "account" ? { kind: "account" } : {
21335
+ kind: "org",
21336
+ orgId: deps.actor.orgId
21337
+ };
21338
+ const observeContactScope = Effect.annotateCurrentSpan({
21339
+ scope_kind: actor.kind === "org" ? "organization" : "account",
21340
+ ...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
21341
+ });
21342
+ /** One observed call of one contacts row, its reply projected inside the call, under the row's name. */
21343
+ const book = (row, args, options, project) => {
21344
+ const controls = deps.invocationControls?.(options) ?? options;
21345
+ return runPortEffect(projectReply(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError }))), project).pipe(Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
21346
+ };
21347
+ /** As `book`, for a projection that refuses the reply as a value. */
21348
+ const bookChecked = (row, args, options, check) => {
21349
+ const controls = deps.invocationControls?.(options) ?? options;
21350
+ return runPortEffect(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.flatMap((output) => {
21351
+ const checked = check(output);
21352
+ return checked.ok ? Effect.succeed(checked.value) : Effect.fail({ publicError: checked.error });
21353
+ }), Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
21354
+ };
21355
+ return {
21356
+ deps,
21357
+ actor,
21358
+ convexCall,
21359
+ observeContactScope,
21360
+ book,
21361
+ bookChecked
21362
+ };
21363
+ }
21364
+ function missingConvexCall(operation) {
21365
+ return Promise.resolve({
21366
+ ok: false,
21367
+ error: Errors.providerError("convex", operation, "ConvexCallPort is required")
21368
+ });
21369
+ }
21370
+ //#endregion
21371
+ //#region ../../packages/sdk/src/parties/accounts.ts
21372
+ /** The actor is captured once. Private input is admitted by the backend's field rules. */
21373
+ function makeBankAccountMethods({ actor, book }) {
21374
+ return {
21375
+ requirements: (input, options) => book(accounts.requirements, {
21376
+ ...input,
21377
+ actor
21378
+ }, options, (value) => value),
21379
+ add: (input, options) => book(accounts.add, {
21380
+ ...input,
21381
+ actor
21382
+ }, options, (value) => value),
21383
+ list: (input, options) => book(accounts.list, {
21384
+ ...input,
21385
+ actor
21386
+ }, options, (value) => value),
21387
+ remove: (input, options) => book(accounts.remove, {
21388
+ ...input,
21389
+ actor
21390
+ }, options, (value) => value)
21391
+ };
21392
+ }
21393
+ const unavailableBankAccountMethods = () => ({
21394
+ requirements: () => missingConvexCall(accounts.requirements.name),
21395
+ add: () => missingConvexCall(accounts.add.name),
21396
+ list: () => missingConvexCall(accounts.list.name),
21397
+ remove: () => missingConvexCall(accounts.remove.name)
21398
+ });
21399
+ //#endregion
20018
21400
  //#region ../../packages/sdk/src/parties/recipients.ts
20019
21401
  function makeTargetsMethods(deps) {
20020
21402
  return { resolve: (reference, options) => {
@@ -20112,6 +21494,10 @@ async function payObligationRegistered(deps, input, options, generic) {
20112
21494
  error: Errors.invalidInput(generic ? "request" : "invoice", generic ? "Request is unavailable" : "Invoice is unavailable")
20113
21495
  };
20114
21496
  const snapshot = frozen.value;
21497
+ if ("bankPayment" in snapshot) return {
21498
+ ok: false,
21499
+ error: Errors.invalidInput("invoice", "Pay this Invoice by bank transfer.")
21500
+ };
20115
21501
  const { sourceWallet: _sourceWallet, ...wireInput } = input;
20116
21502
  const request = {
20117
21503
  kind: "invoice_checkout",
@@ -20384,6 +21770,8 @@ function mapInboxItem(item) {
20384
21770
  status: mapInboxStatus(item.status),
20385
21771
  documents: item.documents ?? [],
20386
21772
  ...item.issuerSafe === void 0 ? {} : { issuerSafe: item.issuerSafe },
21773
+ ...item.receivingAccountId === void 0 ? {} : { receivingAccountId: item.receivingAccountId },
21774
+ ...item.settledDepositRef === void 0 ? {} : { settledDepositRef: item.settledDepositRef },
20387
21775
  ...item.settledPaymentId == null ? {} : { paymentId: toPaymentId(item.settledPaymentId) }
20388
21776
  };
20389
21777
  }
@@ -20434,6 +21822,7 @@ function makeOfferMethods(deps) {
20434
21822
  }
20435
21823
  //#endregion
20436
21824
  //#region ../../packages/sdk/src/requests/receivables.ts
21825
+ const isMoneyRequestIssue = (input) => "currency" in input.amount;
20437
21826
  function makeActorRequestsMethods(calls) {
20438
21827
  const { actor, deps, book } = calls;
20439
21828
  return {
@@ -20443,15 +21832,24 @@ function makeActorRequestsMethods(calls) {
20443
21832
  const controls = deps.invocationControls?.(options) ?? options;
20444
21833
  return runCapxulEffect(Effect.fail(payer.error), controls, receivables.issue.name, deps.runPromise);
20445
21834
  }
20446
- return book(receivables.issue, {
21835
+ const common = {
20447
21836
  actor,
20448
21837
  payer: payer.value,
20449
- amount: input.amount,
20450
21838
  reference: input.reference,
20451
21839
  ...input.memo === void 0 ? {} : { memo: input.memo },
20452
- ...input.invoice === void 0 ? {} : { invoice: input.invoice },
20453
21840
  ...input.expiresAt === void 0 ? {} : { expiresAt: input.expiresAt }
20454
- }, options, (request) => mapActorRequest(request, input.payer));
21841
+ };
21842
+ const issueArgs = isMoneyRequestIssue(input) ? {
21843
+ ...common,
21844
+ amount: input.amount,
21845
+ invoice: input.invoice,
21846
+ receivingAccountId: input.receivingAccountId
21847
+ } : {
21848
+ ...common,
21849
+ amount: input.amount,
21850
+ ...input.invoice === void 0 ? {} : { invoice: input.invoice }
21851
+ };
21852
+ return book(receivables.issue, issueArgs, options, (request) => mapActorRequest(request, input.payer));
20455
21853
  },
20456
21854
  list: (options) => book(receivables.listCurrent, { actor }, options, (requests) => mapPage(requests, (request) => mapActorRequest(request))),
20457
21855
  get: (requestId, options) => book(receivables.getCurrent, {
@@ -20490,49 +21888,12 @@ function mapActorRequest(request, payer) {
20490
21888
  ...request.settledPaymentId == null ? {} : { paymentId: toPaymentId(request.settledPaymentId) },
20491
21889
  ...typeof request.addressedToViewer === "boolean" ? { addressedToViewer: request.addressedToViewer } : {},
20492
21890
  ...request.issuerSafe === void 0 ? {} : { issuerSafe: request.issuerSafe },
21891
+ ...request.receivingAccountId === void 0 ? {} : { receivingAccountId: request.receivingAccountId },
21892
+ ...request.settledDepositRef === void 0 ? {} : { settledDepositRef: request.settledDepositRef },
20493
21893
  linkToken: request.linkToken
20494
21894
  };
20495
21895
  }
20496
21896
  //#endregion
20497
- //#region ../../packages/sdk/src/parties/relationship-calls.ts
20498
- function relationshipCalls(deps, convexCall) {
20499
- const actor = deps.actor.kind === "account" ? { kind: "account" } : {
20500
- kind: "org",
20501
- orgId: deps.actor.orgId
20502
- };
20503
- const observeContactScope = Effect.annotateCurrentSpan({
20504
- scope_kind: actor.kind === "org" ? "organization" : "account",
20505
- ...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
20506
- });
20507
- /** One observed call of one contacts row, its reply projected inside the call, under the row's name. */
20508
- const book = (row, args, options, project) => {
20509
- const controls = deps.invocationControls?.(options) ?? options;
20510
- return runPortEffect(projectReply(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError }))), project).pipe(Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
20511
- };
20512
- /** As `book`, for a projection that refuses the reply as a value. */
20513
- const bookChecked = (row, args, options, check) => {
20514
- const controls = deps.invocationControls?.(options) ?? options;
20515
- return runPortEffect(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.flatMap((output) => {
20516
- const checked = check(output);
20517
- return checked.ok ? Effect.succeed(checked.value) : Effect.fail({ publicError: checked.error });
20518
- }), Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
20519
- };
20520
- return {
20521
- deps,
20522
- actor,
20523
- convexCall,
20524
- observeContactScope,
20525
- book,
20526
- bookChecked
20527
- };
20528
- }
20529
- function missingConvexCall(operation) {
20530
- return Promise.resolve({
20531
- ok: false,
20532
- error: Errors.providerError("convex", operation, "ConvexCallPort is required")
20533
- });
20534
- }
20535
- //#endregion
20536
21897
  //#region ../../packages/sdk/src/parties/contacts.ts
20537
21898
  function makeAddressBookMethods(calls) {
20538
21899
  const { actor, deps, book } = calls;
@@ -20604,6 +21965,7 @@ function makeActorRelationshipMethods(deps) {
20604
21965
  if (convexCall === void 0) return {
20605
21966
  offers,
20606
21967
  addressBook: unavailableAddressBookMethods(),
21968
+ bankAccounts: unavailableBankAccountMethods(),
20607
21969
  requests: unavailableActorRequestsMethods(),
20608
21970
  inbox: unavailableInboxMethods(),
20609
21971
  profile
@@ -20612,6 +21974,7 @@ function makeActorRelationshipMethods(deps) {
20612
21974
  return {
20613
21975
  offers,
20614
21976
  addressBook: makeAddressBookMethods(calls),
21977
+ bankAccounts: makeBankAccountMethods(calls),
20615
21978
  requests: makeActorRequestsMethods(calls),
20616
21979
  inbox: makeInboxMethods(calls),
20617
21980
  profile
@@ -20816,12 +22179,16 @@ function paymentExecutionIntent(input) {
20816
22179
  ok: false,
20817
22180
  error: Errors.notImplemented("payments", "pay.organizationActor")
20818
22181
  };
20819
- const to = normalizeTargetForBackend(input.to, "to");
20820
- if (!to.ok) return to;
20821
22182
  try {
22183
+ const to = input.to?.kind === "party_account" ? {
22184
+ ok: true,
22185
+ value: input.to
22186
+ } : normalizeTargetForBackend(input.to, "to");
22187
+ if (!to.ok) return to;
20822
22188
  const decoded = Schema.decodeResult(PaymentExecutionIntentSchema, { onExcessProperty: "error" })({
20823
22189
  to: to.value,
20824
22190
  amount: input.amount,
22191
+ ...input.quoteId === void 0 ? {} : { quoteId: input.quoteId },
20825
22192
  ...input.externalAddressAcknowledged === void 0 ? {} : { externalAddressAcknowledged: input.externalAddressAcknowledged },
20826
22193
  ...input.paymentType === void 0 ? {} : { paymentType: input.paymentType },
20827
22194
  ...input.document === void 0 ? {} : { document: input.document },
@@ -20835,10 +22202,10 @@ function paymentExecutionIntent(input) {
20835
22202
  ok: false,
20836
22203
  error: invalidPaymentField(decoded.failure.issue, "invalid personal payment input")
20837
22204
  };
20838
- } catch {
22205
+ } catch (cause) {
20839
22206
  return {
20840
22207
  ok: false,
20841
- error: Errors.invalidInput("payment", "invalid personal payment input")
22208
+ error: cause instanceof CapxulError ? cause : Errors.invalidInput("payment", "invalid personal payment input")
20842
22209
  };
20843
22210
  }
20844
22211
  }
@@ -21362,6 +22729,7 @@ function makePaymentsMethods(deps) {
21362
22729
  const pay = makePersonalPay(deps);
21363
22730
  const { runLifecycle, retryPayment } = makeLifecycleRunners(deps);
21364
22731
  return {
22732
+ quote: makePaymentQuote(deps),
21365
22733
  subscribe: (paymentId, listener, options) => subscribePersonalPayment({
21366
22734
  actor: deps.actor,
21367
22735
  convexCall: deps.convexCall,
@@ -21401,32 +22769,6 @@ function makePaymentsMethods(deps) {
21401
22769
  };
21402
22770
  }
21403
22771
  //#endregion
21404
- //#region ../../packages/sdk/src/payments/offramp.ts
21405
- function makeOfframpMethods() {
21406
- return {
21407
- quote: (input, options) => {
21408
- if (options?.signal?.aborted) return Promise.resolve({
21409
- ok: false,
21410
- error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.offramp.quote })
21411
- });
21412
- return Promise.resolve({
21413
- ok: false,
21414
- error: Errors.notImplemented("offramp", "quote")
21415
- });
21416
- },
21417
- status: (offrampId, options) => {
21418
- if (options?.signal?.aborted) return Promise.resolve({
21419
- ok: false,
21420
- error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.offramp.status })
21421
- });
21422
- return Promise.resolve({
21423
- ok: false,
21424
- error: Errors.notImplemented("offramp", "status")
21425
- });
21426
- }
21427
- };
21428
- }
21429
- //#endregion
21430
22772
  //#region ../../packages/sdk/src/payments/organization-payment-requests.ts
21431
22773
  const organizationPaymentIntentSchema = Schema.Struct({
21432
22774
  orgId: PrepareOrganizationPaymentExecutionInputSchema.fields.orgId,
@@ -21712,6 +23054,10 @@ function makeOrganizationPaymentsMethods(deps, orgId) {
21712
23054
  }), observationOnlyControls(controls), operation, deps.runPromise);
21713
23055
  return {
21714
23056
  ...makeOrganizationPaymentReadMethods(deps, orgId),
23057
+ quote: makePaymentQuote(deps, {
23058
+ kind: "org",
23059
+ orgId
23060
+ }),
21715
23061
  retry: (paymentId, options) => {
21716
23062
  const controls = deps.invocationControls?.(options) ?? options;
21717
23063
  return runCapxulEffect(Effect.gen(function* () {
@@ -21791,21 +23137,6 @@ function makeOrganizationPaymentsMethods(deps, orgId) {
21791
23137
  };
21792
23138
  }
21793
23139
  //#endregion
21794
- //#region ../../packages/sdk/src/observability/telemetry/emit-once.ts
21795
- /**
21796
- * A product event that could not be built or emitted never reaches the caller
21797
- * as a failure, and is never lost silently: the drop is logged by event name.
21798
- */
21799
- function logDroppedEvent(eventName) {
21800
- return (effect) => effect.pipe(Effect.catchCause((cause) => {
21801
- const reason = Cause.squash(cause);
21802
- return Effect.logWarning("product.telemetry.emit.dropped").pipe(Effect.annotateLogs({
21803
- product_event: eventName,
21804
- reason: reason instanceof Error ? reason.message : String(reason)
21805
- }), Effect.ignoreCause);
21806
- }));
21807
- }
21808
- //#endregion
21809
23140
  //#region ../../packages/sdk/src/accounts/events.ts
21810
23141
  async function emitProvisioningTelemetry(telemetry, smartAccount, runPromise) {
21811
23142
  if (telemetry === void 0) return;
@@ -21855,50 +23186,16 @@ function emitAccountBalanceFailed(telemetry, error, runPromise) {
21855
23186
  }
21856
23187
  }, runPromise);
21857
23188
  }
21858
- /** A successful authorized instruction read, not an incoming transfer. */
21859
- function emitDepositInitiated(telemetry, instructions, source, verifiedOrganizationId) {
21860
- return Effect.gen(function* () {
21861
- const organizationId = safeEngineeringIdentifier(verifiedOrganizationId);
21862
- const fields = {
21863
- scope_kind: organizationId === void 0 ? "account" : "organization",
21864
- account_kind: organizationId === void 0 ? "personalSafe" : "orgTreasury",
21865
- ...Number.isSafeInteger(instructions.chainId) && instructions.chainId > 0 ? { chain_id: instructions.chainId } : {},
21866
- ...instructions.network === "base-sepolia" ? { network: instructions.network } : {},
21867
- ...organizationId === void 0 ? {} : { verified_organization_id: organizationId }
21868
- };
21869
- yield* Effect.annotateCurrentSpan(fields);
21870
- if (telemetry === void 0) return;
21871
- const span = yield* Effect.currentSpan;
21872
- const snapshot = readInvocationObservation(source);
21873
- const { organizationId: _hint, ...context } = snapshot?.context ?? {};
21874
- const event = {
21875
- name: "deposit_initiated",
21876
- props: {
21877
- scope_kind: fields.scope_kind,
21878
- account_kind: fields.account_kind,
21879
- ...fields.chain_id === void 0 ? {} : { chain_id: fields.chain_id },
21880
- ...fields.network === void 0 ? {} : { network: fields.network },
21881
- $groups: organizationId === void 0 ? {} : { organization: organizationId },
21882
- ...safeEngineeringIdentifier(snapshot?.actorId) === void 0 ? {} : {
21883
- actor_id: snapshot.actorId,
21884
- actor_kind: "authenticated",
21885
- distinct_id: snapshot.actorId
21886
- },
21887
- trace_id: span.traceId,
21888
- span_id: span.spanId,
21889
- ...organizationId === void 0 ? {} : { organization_id: organizationId }
21890
- }
21891
- };
21892
- yield* telemetry.emit(snapshot === void 0 ? event : attachInvocationObservation(event, {
21893
- active: snapshot.active,
21894
- ...snapshot?.actorId === void 0 ? {} : { actorId: snapshot.actorId },
21895
- context: {
21896
- ...context,
21897
- ...organizationId === void 0 ? {} : { organizationId },
21898
- traceparent: `00-${span.traceId}-${span.spanId}-01`
21899
- }
21900
- }));
21901
- }).pipe(logDroppedEvent("deposit_initiated"));
23189
+ /** Keep instruction-read facts on the operation span without a product event. */
23190
+ function annotateDepositInstructions(instructions, verifiedOrganizationId) {
23191
+ const organizationId = safeEngineeringIdentifier(verifiedOrganizationId);
23192
+ return Effect.annotateCurrentSpan({
23193
+ scope_kind: organizationId === void 0 ? "account" : "organization",
23194
+ account_kind: organizationId === void 0 ? "personalSafe" : "orgTreasury",
23195
+ ...Number.isSafeInteger(instructions.chainId) && instructions.chainId > 0 ? { chain_id: instructions.chainId } : {},
23196
+ ...instructions.network === "base-sepolia" ? { network: instructions.network } : {},
23197
+ ...organizationId === void 0 ? {} : { verified_organization_id: organizationId }
23198
+ });
21902
23199
  }
21903
23200
  //#endregion
21904
23201
  //#region ../../packages/sdk/src/accounts/account-phases.ts
@@ -22447,8 +23744,104 @@ function makeAccountMethods(deps) {
22447
23744
  };
22448
23745
  }
22449
23746
  //#endregion
23747
+ //#region ../../packages/sdk/src/accounts/organization-approvals.ts
23748
+ /** The Organization Payment prepared for `signerAddress` and checked, before any approval. */
23749
+ async function prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal) {
23750
+ const { organizationId, permissionId, requestKey, lineage, ...item } = input;
23751
+ const intent = organizationPaymentIntent(organizationId, {
23752
+ permissionId,
23753
+ items: [item],
23754
+ ...lineage === void 0 ? {} : { lineage },
23755
+ ...requestKey === void 0 ? {} : { requestKey }
23756
+ }, true);
23757
+ if (!intent.ok) return intent;
23758
+ const session = deps.actor?.authSession() ?? null;
23759
+ if (session === null || deps.chainId === void 0) return {
23760
+ ok: false,
23761
+ error: Errors.notAuthenticated()
23762
+ };
23763
+ const expected = {
23764
+ ...intent.value,
23765
+ requestKey: requestKey ?? `pay_${crypto.randomUUID()}`
23766
+ };
23767
+ const prepared = await runIfActive(signal, CAPXUL_OPERATIONS.organizationPayments.prepareExecution, () => callOperation(deps.convexCall, commands$1.prepareOrganization, {
23768
+ ...expected,
23769
+ signerAddress
23770
+ }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
23771
+ if (!prepared.ok) return prepared;
23772
+ const evidence = prepared.value;
23773
+ if (!(await matchesIntent(expected)(evidence.request, evidence) && await verifiedPreparedCommand(evidence, session.email, signerAddress, deps.chainId))) return abandonPrepared(deps, evidence.executionId, "prepared_mismatch", {
23774
+ ok: false,
23775
+ error: Errors.invalidInput("execution", "prepared Organization Payment mismatch")
23776
+ });
23777
+ await emitPreparedInitiation(deps, evidence);
23778
+ return {
23779
+ ok: true,
23780
+ value: evidence
23781
+ };
23782
+ }
23783
+ /** One fresh Payment read: the caller's own, or one in the Organization's scope. */
23784
+ const readPayment = (deps, paymentId, organizationId, signal) => organizationId === void 0 ? runIfActive(signal, records.get.name, () => callOperation(deps.convexCall, records.get, { paymentId }, { fresh: true }).pipe(Effect.map((payment) => ({ payment })), Effect.mapError((publicError) => ({ publicError }))), deps.runPromise) : runIfActive(signal, records.getForOrganization.name, () => callOperation(deps.convexCall, records.getForOrganization, {
23785
+ orgId: organizationId,
23786
+ paymentId
23787
+ }, { fresh: true }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
23788
+ /**
23789
+ * The Payments an approval carries, as they stand. A personal read names only
23790
+ * the caller's own Account's Payments, so an Organization's is read with its
23791
+ * `organizationId`; one that cannot be read is refused, never taken as ended.
23792
+ */
23793
+ async function readApprovalPayments(deps, paymentIds, organizationId, signal) {
23794
+ const reads = await Promise.all(paymentIds.map((paymentId) => readPayment(deps, paymentId, organizationId, signal)));
23795
+ const payments = [];
23796
+ for (const [index, read] of reads.entries()) {
23797
+ if (!read.ok) return read;
23798
+ const { orgId, payment } = read.value;
23799
+ if (payment === null && organizationId === void 0) return {
23800
+ ok: false,
23801
+ error: Errors.invalidInput("organizationId", "this approval pays from an Organization: wait with its organizationId")
23802
+ };
23803
+ if (payment === null || payment.id !== paymentIds[index] || orgId !== organizationId) return {
23804
+ ok: false,
23805
+ error: Errors.invalidInput("paymentId", "the approval's Payments are not this scope's")
23806
+ };
23807
+ payments.push(normalizePaymentTiming(payment));
23808
+ }
23809
+ return {
23810
+ ok: true,
23811
+ value: payments
23812
+ };
23813
+ }
23814
+ //#endregion
23815
+ //#region ../../packages/sdk/src/accounts/bank-approvals.ts
23816
+ /** Read the immutable Payment behind a bank approval before handing it to the person. */
23817
+ async function checkedBankApproval(deps, input, opened) {
23818
+ if (!opened.ok || input.to.kind !== "party_account") return opened;
23819
+ const approval = opened.value;
23820
+ const read = await readApprovalPayments(deps, approval.operation.paymentIds, "organizationId" in input ? input.organizationId : void 0, void 0);
23821
+ if (!read.ok) return read;
23822
+ const [payment] = read.value;
23823
+ let amountMatches = false;
23824
+ try {
23825
+ const funding = toExactAssetAmount(input.amount, CONFIGURED_MONEY_ASSETS);
23826
+ const described = approval.summary.amount === null ? null : toExactAssetAmount(approval.summary.amount, CONFIGURED_MONEY_ASSETS);
23827
+ const stored = payment === void 0 ? null : toExactAssetAmount(payment.amount, CONFIGURED_MONEY_ASSETS);
23828
+ amountMatches = described?.asset === funding.asset && described.minorUnits === funding.minorUnits && stored?.asset === funding.asset && stored.minorUnits === funding.minorUnits;
23829
+ } catch {
23830
+ amountMatches = false;
23831
+ }
23832
+ if (approval.kind === "bank_payout" && read.value.length === 1 && payment?.recipient.kind === "party_account" && payment.recipient.partyAccountId === input.to.partyAccountId && payment.links?.quoteId === input.quoteId && input.quoteId !== void 0 && amountMatches && (payment.recipientWarning !== true || approval.summary.warnings?.some(({ code }) => code === "RECIPIENT_ON_CAPXUL"))) return opened;
23833
+ return abandonPrepared(deps, approval.operation.executionId, "prepared_mismatch", {
23834
+ ok: false,
23835
+ error: Errors.invalidInput("approval", "The bank approval does not match its quoted Payment.")
23836
+ });
23837
+ }
23838
+ //#endregion
22450
23839
  //#region ../../packages/sdk/src/accounts/approval-rules.ts
22451
- const IN_FLIGHT = /* @__PURE__ */ new Set(["pending", "settling"]);
23840
+ const IN_FLIGHT = /* @__PURE__ */ new Set([
23841
+ "pending",
23842
+ "settling",
23843
+ "in_transit"
23844
+ ]);
22452
23845
  /** A Payment the chain has not decided yet. */
22453
23846
  function inFlight(payment) {
22454
23847
  return IN_FLIGHT.has(payment.status);
@@ -22615,9 +24008,10 @@ function toPayrollGroup(wire) {
22615
24008
  }))
22616
24009
  };
22617
24010
  }
24011
+ const PayrollWalletItemSchema = PayrollRunItemInputSchema.pipe(Schema.refine((item) => item.to.kind !== "party_account", { message: "Payroll cannot target saved bank accounts" }));
22618
24012
  function validateRunItems(input) {
22619
24013
  for (const [index, item] of input.items.entries()) {
22620
- if (Schema.decodeResult(PayrollRunItemInputSchema, { onExcessProperty: "error" })(item)._tag === "Failure") return Errors.invalidInput(`items.${index}`, "invalid Payroll item");
24014
+ if (Schema.decodeResult(PayrollWalletItemSchema, { onExcessProperty: "error" })(item)._tag === "Failure") return Errors.invalidInput(`items.${index}`, "invalid Payroll item");
22621
24015
  try {
22622
24016
  const exact = toExactAssetAmount(item.amount, CONFIGURED_MONEY_ASSETS);
22623
24017
  const net = BigInt(item.net);
@@ -22634,7 +24028,7 @@ const RunInputSchema = Schema.Struct({
22634
24028
  permissionId: AuthorizePayrollRunExecutionInputSchema.fields.permissionId,
22635
24029
  asset: AuthorizePayrollRunExecutionInputSchema.fields.asset,
22636
24030
  period: AuthorizePayrollRunExecutionInputSchema.fields.period,
22637
- items: AuthorizePayrollRunExecutionInputSchema.fields.items,
24031
+ items: Schema.Array(PayrollWalletItemSchema),
22638
24032
  requestKey: Schema.optional(AuthorizePayrollRunExecutionInputSchema.fields.requestKey)
22639
24033
  });
22640
24034
  /** Decode caller input before session or signer work. Keep routing outside the input. */
@@ -23038,72 +24432,6 @@ async function prepareVerifiedPayrollRun(deps, input, signerAddress, signal) {
23038
24432
  }, authorized.value.run), authorized.value.replay.kind !== "accepted");
23039
24433
  }
23040
24434
  //#endregion
23041
- //#region ../../packages/sdk/src/accounts/organization-approvals.ts
23042
- /** The Organization Payment prepared for `signerAddress` and checked, before any approval. */
23043
- async function prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal) {
23044
- const { organizationId, permissionId, requestKey, lineage, ...item } = input;
23045
- const intent = organizationPaymentIntent(organizationId, {
23046
- permissionId,
23047
- items: [item],
23048
- ...lineage === void 0 ? {} : { lineage },
23049
- ...requestKey === void 0 ? {} : { requestKey }
23050
- }, true);
23051
- if (!intent.ok) return intent;
23052
- const session = deps.actor?.authSession() ?? null;
23053
- if (session === null || deps.chainId === void 0) return {
23054
- ok: false,
23055
- error: Errors.notAuthenticated()
23056
- };
23057
- const expected = {
23058
- ...intent.value,
23059
- requestKey: requestKey ?? `pay_${crypto.randomUUID()}`
23060
- };
23061
- const prepared = await runIfActive(signal, CAPXUL_OPERATIONS.organizationPayments.prepareExecution, () => callOperation(deps.convexCall, commands$1.prepareOrganization, {
23062
- ...expected,
23063
- signerAddress
23064
- }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
23065
- if (!prepared.ok) return prepared;
23066
- const evidence = prepared.value;
23067
- return await matchesIntent(expected)(evidence.request, evidence) && await verifiedPreparedCommand(evidence, session.email, signerAddress, deps.chainId) ? {
23068
- ok: true,
23069
- value: evidence
23070
- } : abandonPrepared(deps, evidence.executionId, "prepared_mismatch", {
23071
- ok: false,
23072
- error: Errors.invalidInput("execution", "prepared Organization Payment mismatch")
23073
- });
23074
- }
23075
- /** One fresh Payment read: the caller's own, or one in the Organization's scope. */
23076
- const readPayment = (deps, paymentId, organizationId, signal) => organizationId === void 0 ? runIfActive(signal, records.get.name, () => callOperation(deps.convexCall, records.get, { paymentId }, { fresh: true }).pipe(Effect.map((payment) => ({ payment })), Effect.mapError((publicError) => ({ publicError }))), deps.runPromise) : runIfActive(signal, records.getForOrganization.name, () => callOperation(deps.convexCall, records.getForOrganization, {
23077
- orgId: organizationId,
23078
- paymentId
23079
- }, { fresh: true }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
23080
- /**
23081
- * The Payments an approval carries, as they stand. A personal read names only
23082
- * the caller's own Account's Payments, so an Organization's is read with its
23083
- * `organizationId`; one that cannot be read is refused, never taken as ended.
23084
- */
23085
- async function readApprovalPayments(deps, paymentIds, organizationId, signal) {
23086
- const reads = await Promise.all(paymentIds.map((paymentId) => readPayment(deps, paymentId, organizationId, signal)));
23087
- const payments = [];
23088
- for (const [index, read] of reads.entries()) {
23089
- if (!read.ok) return read;
23090
- const { orgId, payment } = read.value;
23091
- if (payment === null && organizationId === void 0) return {
23092
- ok: false,
23093
- error: Errors.invalidInput("organizationId", "this approval pays from an Organization: wait with its organizationId")
23094
- };
23095
- if (payment === null || payment.id !== paymentIds[index] || orgId !== organizationId) return {
23096
- ok: false,
23097
- error: Errors.invalidInput("paymentId", "the approval's Payments are not this scope's")
23098
- };
23099
- payments.push(normalizePaymentTiming(payment));
23100
- }
23101
- return {
23102
- ok: true,
23103
- value: payments
23104
- };
23105
- }
23106
- //#endregion
23107
24435
  //#region ../../packages/sdk/src/accounts/approvals.ts
23108
24436
  /** A Permission write or an invitation, rather than a Payment. */
23109
24437
  const isPermissionChange = (input) => "permission" in input || "invite" in input;
@@ -23150,20 +24478,24 @@ function makeApprovalsMethods(deps) {
23150
24478
  if (!prepared.ok) return prepared;
23151
24479
  const { executionId } = prepared.value;
23152
24480
  const opened = await call(approvals.request.name, approvals.request, { executionId });
24481
+ if (opened.ok && opened.value.operation.executionId !== executionId) return abandonPrepared(deps, executionId, "prepared_mismatch", {
24482
+ ok: false,
24483
+ error: Errors.invalidInput("approval", "The approval names another prepared execution.")
24484
+ });
23153
24485
  return opened.ok ? opened : abandonPrepared(deps, executionId, "cancelled", opened);
23154
24486
  };
23155
24487
  const prepare = async (input, options) => {
23156
24488
  const signal = options?.signal;
23157
24489
  if (isCommandApproval(input)) return openApproval(signal, (signerAddress) => prepareVerifiedCommand(deps, input, signerAddress, signal));
23158
24490
  if (isPermissionChange(input)) return openApproval(signal, async (signerAddress) => {
23159
- const { prepareVerifiedPermissionChange } = await import("./permission-approvals-Kbhw35ZT.mjs");
24491
+ const { prepareVerifiedPermissionChange } = await import("./permission-approvals-wsiJGmLO.mjs");
23160
24492
  return prepareVerifiedPermissionChange(deps, input, signerAddress, signal);
23161
24493
  });
23162
- if ("organizationId" in input) return openApproval(signal, (signerAddress) => prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal));
24494
+ if ("organizationId" in input) return checkedBankApproval(deps, input, await openApproval(signal, (signerAddress) => prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal)));
23163
24495
  const intent = paymentExecutionIntent(input);
23164
24496
  if (!intent.ok) return intent;
23165
24497
  const { actor, chainId } = deps;
23166
- return openApproval(signal, async (signerAddress) => {
24498
+ return checkedBankApproval(deps, input, await openApproval(signal, async (signerAddress) => {
23167
24499
  if (actor === void 0 || chainId === void 0) return {
23168
24500
  ok: false,
23169
24501
  error: Errors.notImplemented("approvals", "prepareComposition")
@@ -23176,7 +24508,7 @@ function makeApprovalsMethods(deps) {
23176
24508
  }, intent.value, signerAddress, input.requestKey ?? `pay_${crypto.randomUUID()}`, signal);
23177
24509
  if (prepared.ok) await emitPreparedPaymentInitiated(deps, prepared.value);
23178
24510
  return prepared;
23179
- });
24511
+ }));
23180
24512
  };
23181
24513
  const approve = async (approvalId) => {
23182
24514
  const { signer } = deps;
@@ -23589,7 +24921,7 @@ function headlineValuation(balances, displayCurrency, rates = MONEY_READ_RATES)
23589
24921
  const valuation = valueIn(balances.map((position) => ({
23590
24922
  asset: position.asset,
23591
24923
  value: pick(position)
23592
- })), displayCurrency, rates);
24924
+ })).filter((amount) => toRaw(amount, requireAsset(amount.asset)) !== 0n), displayCurrency, rates);
23593
24925
  if (valuation.unrated.length > 0) return null;
23594
24926
  return valuation.total ?? {
23595
24927
  currency: displayCurrency,
@@ -25209,7 +26541,7 @@ function makeMeMethods(deps) {
25209
26541
  })), Effect.mapError((publicError) => ({ publicError }))), deps.runPromise),
25210
26542
  depositInstructions: (options) => {
25211
26543
  const controls = deps.invocationControls?.(options) ?? options;
25212
- return runPortEffect(callOperation(deps.convexCall, summaries.depositInstructions, copyInvocationObservation(controls, {})).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.tap((instructions) => emitDepositInitiated(deps.telemetry, instructions, controls))), controls, summaries.depositInstructions.name, deps.runPromise);
26544
+ return runPortEffect(callOperation(deps.convexCall, summaries.depositInstructions, copyInvocationObservation(controls, {})).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.tap(annotateDepositInstructions)), controls, summaries.depositInstructions.name, deps.runPromise);
25213
26545
  }
25214
26546
  };
25215
26547
  }
@@ -38077,7 +39409,7 @@ function readOrgDepositInstructionsProgram(orgId) {
38077
39409
  address: String(org.account.address).toLowerCase(),
38078
39410
  label: "Capxul org treasury"
38079
39411
  };
38080
- yield* emitDepositInitiated(deps.telemetry, instructions, deps.invocationSource, String(org.id));
39412
+ yield* annotateDepositInstructions(instructions, String(org.id));
38081
39413
  return instructions;
38082
39414
  });
38083
39415
  }
@@ -38186,6 +39518,141 @@ function makeOrgReadMethods(deps, orgId, shared) {
38186
39518
  };
38187
39519
  }
38188
39520
  //#endregion
39521
+ //#region ../../packages/sdk/src/banking/deposits.ts
39522
+ function makeBankDepositMethods(deps, actor) {
39523
+ const controls = (options) => deps.invocationControls?.(options) ?? options;
39524
+ const call = (program, invocation, operation) => runCapxulEffect(program, invocation, operation, deps.runPromise);
39525
+ return {
39526
+ list: (options) => {
39527
+ const invocation = controls(options);
39528
+ return call(callOperation(deps.convexCall, deposits.list, copyInvocationObservation(invocation, {
39529
+ ...actor === void 0 ? {} : { actor },
39530
+ ...options?.cursor === void 0 ? {} : { cursor: options.cursor },
39531
+ ...options?.unmatched === void 0 ? {} : { unmatched: options.unmatched }
39532
+ })), invocation, deposits.list.name);
39533
+ },
39534
+ get: (bankDepositId, options) => {
39535
+ const invocation = controls(options);
39536
+ return call(callOperation(deps.convexCall, deposits.get, copyInvocationObservation(invocation, {
39537
+ ...actor === void 0 ? {} : { actor },
39538
+ bankDepositId
39539
+ })), invocation, deposits.get.name);
39540
+ },
39541
+ candidates: (bankDepositId, options) => {
39542
+ const invocation = controls(options);
39543
+ return call(callOperation(deps.convexCall, deposits.candidates, copyInvocationObservation(invocation, {
39544
+ ...actor === void 0 ? {} : { actor },
39545
+ bankDepositId,
39546
+ ...options?.cursor === void 0 ? {} : { cursor: options.cursor }
39547
+ })), invocation, deposits.candidates.name);
39548
+ },
39549
+ match: (bankDepositId, requestId, options) => {
39550
+ const invocation = controls(options);
39551
+ return call(callOperation(deps.convexCall, deposits.match, copyInvocationObservation(invocation, {
39552
+ ...actor === void 0 ? {} : { actor },
39553
+ bankDepositId,
39554
+ requestId
39555
+ })), invocation, deposits.match.name);
39556
+ }
39557
+ };
39558
+ }
39559
+ const unavailable$1 = () => Promise.resolve({
39560
+ ok: false,
39561
+ error: Errors.notImplemented("banking", "executionComposition")
39562
+ });
39563
+ const makeUnavailableBankDepositMethods = () => ({
39564
+ list: unavailable$1,
39565
+ get: unavailable$1,
39566
+ candidates: unavailable$1,
39567
+ match: unavailable$1
39568
+ });
39569
+ //#endregion
39570
+ //#region ../../packages/sdk/src/banking/bank-details.ts
39571
+ const unavailable = () => Promise.resolve({
39572
+ ok: false,
39573
+ error: Errors.notImplemented("banking", "executionComposition")
39574
+ });
39575
+ function makeBankingMethods(deps, actor) {
39576
+ let journeyId;
39577
+ let actorId;
39578
+ const controls = (options, journey) => {
39579
+ const resolved = deps.invocationControls?.(options) ?? options;
39580
+ if (!journey) return resolved;
39581
+ const snapshot = readInvocationObservation(resolved) ?? { active: true };
39582
+ if (actorId !== snapshot.actorId) journeyId = void 0;
39583
+ actorId = snapshot.actorId;
39584
+ journeyId = options?.journey_id ?? journeyId ?? snapshot.context?.journeyId ?? `bank_details_${crypto.randomUUID()}`;
39585
+ const next = {
39586
+ ...resolved,
39587
+ journey_id: journeyId
39588
+ };
39589
+ const captured = snapshot.active ? withCapturedAttemptContext(snapshot.context, next) : void 0;
39590
+ return attachInvocationObservation(next, {
39591
+ ...snapshot,
39592
+ ...captured === void 0 ? {} : { context: captured }
39593
+ });
39594
+ };
39595
+ const call = (program, options, operation) => runCapxulEffect(program, options, operation, deps.runPromise);
39596
+ return {
39597
+ deposits: makeBankDepositMethods(deps, actor),
39598
+ details: {
39599
+ list: (options) => {
39600
+ const invocation = controls(options, false);
39601
+ return call(callOperation(deps.convexCall, bankDetails.list, copyInvocationObservation(invocation, actor === void 0 ? {} : { actor })), invocation, bankDetails.list.name);
39602
+ },
39603
+ get: (currency, options) => {
39604
+ const invocation = controls(options, false);
39605
+ return call(callOperation(deps.convexCall, bankDetails.get, copyInvocationObservation(invocation, {
39606
+ ...actor === void 0 ? {} : { actor },
39607
+ currency
39608
+ })), invocation, bankDetails.get.name);
39609
+ },
39610
+ open: (currency, options) => {
39611
+ const invocation = controls(options, true);
39612
+ return call(callOperation(deps.convexCall, bankDetails.open, copyInvocationObservation(invocation, {
39613
+ ...actor === void 0 ? {} : { actor },
39614
+ currency
39615
+ })), invocation, bankDetails.open.name);
39616
+ },
39617
+ settle: (currency, token, options) => {
39618
+ const invocation = controls(options, false);
39619
+ return call(callOperation(deps.convexCall, bankDetails.settle, copyInvocationObservation(invocation, {
39620
+ ...actor === void 0 ? {} : { actor },
39621
+ currency,
39622
+ token
39623
+ })), invocation, bankDetails.settle.name);
39624
+ },
39625
+ deactivate: (currency, options) => {
39626
+ const invocation = controls(options, false);
39627
+ return call(callOperation(deps.convexCall, bankDetails.deactivate, copyInvocationObservation(invocation, {
39628
+ ...actor === void 0 ? {} : { actor },
39629
+ currency
39630
+ })), invocation, bankDetails.deactivate.name);
39631
+ },
39632
+ reactivate: (currency, options) => {
39633
+ const invocation = controls(options, false);
39634
+ return call(callOperation(deps.convexCall, bankDetails.reactivate, copyInvocationObservation(invocation, {
39635
+ ...actor === void 0 ? {} : { actor },
39636
+ currency
39637
+ })), invocation, bankDetails.reactivate.name);
39638
+ }
39639
+ }
39640
+ };
39641
+ }
39642
+ function makeUnavailableBankingMethods() {
39643
+ return {
39644
+ deposits: makeUnavailableBankDepositMethods(),
39645
+ details: {
39646
+ list: unavailable,
39647
+ get: unavailable,
39648
+ open: unavailable,
39649
+ settle: unavailable,
39650
+ deactivate: unavailable,
39651
+ reactivate: unavailable
39652
+ }
39653
+ };
39654
+ }
39655
+ //#endregion
38189
39656
  //#region ../../packages/sdk/src/organizations/unavailable-methods.ts
38190
39657
  function makeNotImplementedPermissionMethods() {
38191
39658
  return {
@@ -38204,6 +39671,7 @@ function makeNotImplementedPermissionMethods() {
38204
39671
  }
38205
39672
  function makeNotImplementedOrganizationPaymentsMethods() {
38206
39673
  return {
39674
+ quote: organizationPaymentExecutionUnavailable,
38207
39675
  previewRetry: organizationPaymentExecutionUnavailable,
38208
39676
  list: organizationPaymentExecutionUnavailable,
38209
39677
  get: organizationPaymentExecutionUnavailable,
@@ -38219,6 +39687,12 @@ const orgMeUnavailable = () => Promise.resolve({
38219
39687
  ok: false,
38220
39688
  error: Errors.notImplemented("org", "me")
38221
39689
  });
39690
+ function makeUnavailableVerificationMethods() {
39691
+ return {
39692
+ start: verificationExecutionUnavailable,
39693
+ status: verificationExecutionUnavailable
39694
+ };
39695
+ }
38222
39696
  /**
38223
39697
  * The closed invitation surface for a client with no backend seam. It reports
38224
39698
  * `NOT_IMPLEMENTED` for every method rather than an empty list or a fabricated
@@ -38242,6 +39716,10 @@ const invitationExecutionUnavailable = () => Promise.resolve({
38242
39716
  ok: false,
38243
39717
  error: Errors.notImplemented("invitations", "executionComposition")
38244
39718
  });
39719
+ const verificationExecutionUnavailable = () => Promise.resolve({
39720
+ ok: false,
39721
+ error: Errors.notImplemented("verification", "executionComposition")
39722
+ });
38245
39723
  const permissionExecutionUnavailable = () => Promise.resolve({
38246
39724
  ok: false,
38247
39725
  error: Errors.notImplemented("permissions", "executionComposition")
@@ -38342,6 +39820,7 @@ function makeOrgMethods(deps) {
38342
39820
  error: Errors.notImplemented("invitations", "listOwn")
38343
39821
  }) : makeOwnInvitationsMethod(invitationMethodsDeps(deps, deps.convexCall)) });
38344
39822
  const paymentMethods = /* @__PURE__ */ new Map();
39823
+ const scopedMethods = /* @__PURE__ */ new Map();
38345
39824
  return {
38346
39825
  orgs,
38347
39826
  org(orgId) {
@@ -38351,6 +39830,14 @@ function makeOrgMethods(deps) {
38351
39830
  payments = convexCall === void 0 ? makeNotImplementedOrganizationPaymentsMethods() : makeOrganizationPaymentsMethods(orgMoneyDeps(deps, convexCall), String(orgId));
38352
39831
  paymentMethods.set(orgId, payments);
38353
39832
  }
39833
+ let scoped = scopedMethods.get(orgId);
39834
+ if (scoped === void 0) {
39835
+ scoped = {
39836
+ banking: deps.banking === void 0 ? makeUnavailableBankingMethods() : deps.banking(String(orgId)),
39837
+ verification: deps.verification === void 0 ? makeUnavailableVerificationMethods() : deps.verification(String(orgId))
39838
+ };
39839
+ scopedMethods.set(orgId, scoped);
39840
+ }
38354
39841
  return {
38355
39842
  ...makeActorRelationshipMethods({
38356
39843
  runPromise: deps.runPromise,
@@ -38366,6 +39853,7 @@ function makeOrgMethods(deps) {
38366
39853
  convexCall,
38367
39854
  ...observedRunnerDeps(deps)
38368
39855
  }, String(orgId)),
39856
+ ...scoped,
38369
39857
  setup: {
38370
39858
  get: (options) => invokeSetup(deps.organizationSetup, "get", () => deps.organizationSetup.get(orgId, options)),
38371
39859
  subscribe: (listener, options) => invokeSetup(deps.organizationSetup, "subscribe", () => deps.organizationSetup.subscribe(orgId, listener, options)),
@@ -38625,4 +40113,4 @@ var ConvexOrganizationSetupAdapter = class {
38625
40113
  }
38626
40114
  };
38627
40115
  //#endregion
38628
- export { isSignerNotReadySignal as $, ChainIdSchema$1 as $t, makeApprovalsMethods as A, detectAuthCacheAdapter as An, publicKeyToAddress as At, BASE_SEPOLIA_CHAIN_ID as B, redactUrlSecrets as Bn, toBytes$1 as Bt, makeAccountsMethods as C, copyInvocationObservation as Cn, toOrgId as Ct, ConvexCallPortTag as D, toPublishableKey as Dn, isBytes32 as Dt, TelemetryPortTag as E, toAllowedOrigin as En, images as Et, makeDestinationsMethods as F, AuthCachePortTag as Fn, concatHex as Ft, failureEvidenceProps as G, CapxulError as Gn, hexToBigInt as Gt, asCapxulError as H, isRecord as Hn, numberToHex as Ht, makeCheckoutMethods as I, deserializeCapxulError as In, isAddress$1 as It, withCapturedAttemptContext as J, isFailureMode as Jn, BaseError as Jt, observeFailedResult as K, isCapxulError as Kn, hexToNumber as Kt, makeTargetsMethods as L, serializeCapxulError as Ln, InvalidAddressError as Lt, logDroppedEvent as M, toEpochMs as Mn, createCursor as Mt, makeOfframpMethods as N, toAuthUserId as Nn, slice as Nt, convexCallErrorFromCapxul as O, AuthClientError as On, hashTypedData as Ot, makePaymentsMethods as P, toEmail as Pn, concat$1 as Pt, isEcdsaSignatureHex as Q, EpochMsSchema$1 as Qt, abandonPrepared as R, decodeChainCause as Rn, keccak256$1 as Rt, PonderIndexerAdapter as S, attachInvocationObservation as Sn, ORGANIZATION_SETUP_STATUSES as St, AccountReadPortTag as T, sanitizeObservationContext as Tn, AppIdSchema$1 as Tt, toPublicError$1 as U, readField as Un, stringToHex as Ut, callOperation as V, isCredentialField as Vn, bytesToHex as Vt, failureDetail as W, Errors as Wn, toHex as Wt, UNOBSERVABLE_SIGNER_STATUS as X, isHex$1 as Xt, version$1 as Y, size as Yt, causeChain as Z, DurationMsSchema$1 as Zt, makePaymentDocumentsMethods as _, SystemClockLayer as _n, OPERATIONS as _t, verifiedConfiguration as a, askIdentity as an, toCountryCode as at, SmartAccountPortTag as b, BetterAuthBrowserLayer as bn, setups as bt, preparePermission as c, runPortEffect as cn, toHandle as ct, buildCommand as d, toCapxulResult as dn, CLI_CAPABILITIES as dt, isEvmAddress as en, openfortSignerNotReadyCode as et, validateReplacementInput as f, formatTraceparent as fn, CLI_COMMAND_NAMES as ft, makeActivityMethods as g, oauthBearerAuthClient as gn, normalizeCapxulOperation as gt, makeMeMethods as h, carryInvocationParentSpan as hn, isCapxulOperation as ht, prepareConfiguration as i, makeAuthMethods as in, makeClientRequestMethods as it, makeAccountMethods as j, globalLocalStorage as jn, formatGwei as jt, bindProductTelemetryInvocation as k, AuthClientPortTag as kn, toRlp as kt, preparedIdentity as l, sessionFromActor as ln, validateHandle as lt, bootIdentityFlow as m, ActorFailure as mn, CAPXUL_OPERATIONS as mt, makeOrgMethods as n, absurd as nn, signerFailure as nt, ConvexOrganizationAdapter as o, publicIdentityFailure as on, toKycTier as ot, executeIdentityProductObservation as p, CAPXUL_ERROR_CODES as pn, CLI_INVOCATION_KINDS as pt, observeSdkClient as q, FAILURE_MODES$1 as qn, trim as qt, authorInvitation as r, getFunctionName as rn, makeCurrentUserMethods as rt, OrgPortTag as s, runIdentityFacade as sn, toTesterKind as st, ConvexOrganizationSetupAdapter as t, toAddress as tn, recoverRawDigestSigner as tt, verifiedPreparation as u, runCapxulEffect as un, redactTelemetryProps as ut, makeSmartAccountMethods as v, ClockPortTag as vn, details as vt, ConvexAccountLayer as w, readInvocationObservation as wn, diagnostics as wt, makeHoldingsMethods as x, observationRequestHeaders as xn, ORGANIZATION_SETUP_REASONS as xt, ConvexSmartAccountLayer as y, BetterAuthNodeLayer as yn, onboardings as yt, normalizeSafeSaltEmail as z, redactSecrets as zn, hexToBytes as zt };
40116
+ export { isSignerNotReadySignal as $, ChainIdSchema$1 as $t, bindProductTelemetryInvocation as A, detectAuthCacheAdapter as An, publicKeyToAddress as At, BASE_SEPOLIA_CHAIN_ID as B, redactUrlSecrets as Bn, toBytes$1 as Bt, PonderIndexerAdapter as C, copyInvocationObservation as Cn, toOrgId as Ct, TelemetryPortTag as D, toPublishableKey as Dn, isBytes32 as Dt, AccountReadPortTag as E, toAllowedOrigin as En, images as Et, makeCheckoutMethods as F, AuthCachePortTag as Fn, concatHex as Ft, failureEvidenceProps as G, CapxulError as Gn, hexToBigInt as Gt, asCapxulError as H, isRecord as Hn, numberToHex as Ht, makeTargetsMethods as I, deserializeCapxulError as In, isAddress$1 as It, withCapturedAttemptContext as J, isFailureMode as Jn, BaseError as Jt, observeFailedResult as K, isCapxulError as Kn, hexToNumber as Kt, makeVerificationMethods as L, serializeCapxulError as Ln, InvalidAddressError as Lt, makeAccountMethods as M, toEpochMs as Mn, createCursor as Mt, makePaymentsMethods as N, toAuthUserId as Nn, slice as Nt, ConvexCallPortTag as O, AuthClientError as On, hashTypedData as Ot, makeDestinationsMethods as P, toEmail as Pn, concat$1 as Pt, isEcdsaSignatureHex as Q, EpochMsSchema$1 as Qt, abandonPrepared as R, decodeChainCause as Rn, keccak256$1 as Rt, makeHoldingsMethods as S, attachInvocationObservation as Sn, ORGANIZATION_SETUP_STATUSES as St, ConvexAccountLayer as T, sanitizeObservationContext as Tn, AppIdSchema$1 as Tt, toPublicError$1 as U, readField as Un, stringToHex as Ut, callOperation as V, isCredentialField as Vn, bytesToHex as Vt, failureDetail as W, Errors as Wn, toHex as Wt, UNOBSERVABLE_SIGNER_STATUS as X, isHex$1 as Xt, version$1 as Y, size as Yt, causeChain as Z, DurationMsSchema$1 as Zt, makeActivityMethods as _, SystemClockLayer as _n, OPERATIONS as _t, prepareConfiguration as a, askIdentity as an, toCountryCode as at, ConvexSmartAccountLayer as b, BetterAuthBrowserLayer as bn, setups as bt, OrgPortTag as c, runPortEffect as cn, toHandle as ct, verifiedPreparation as d, toCapxulResult as dn, CLI_CAPABILITIES as dt, isEvmAddress as en, openfortSignerNotReadyCode as et, buildCommand as f, formatTraceparent as fn, CLI_COMMAND_NAMES as ft, makeMeMethods as g, oauthBearerAuthClient as gn, normalizeCapxulOperation as gt, bootIdentityFlow as h, carryInvocationParentSpan as hn, isCapxulOperation as ht, authorInvitation as i, makeAuthMethods as in, makeClientRequestMethods as it, makeApprovalsMethods as j, globalLocalStorage as jn, formatGwei as jt, convexCallErrorFromCapxul as k, AuthClientPortTag as kn, toRlp as kt, preparePermission as l, sessionFromActor as ln, validateHandle as lt, executeIdentityProductObservation as m, ActorFailure as mn, CAPXUL_OPERATIONS as mt, makeOrgMethods as n, absurd as nn, signerFailure as nt, verifiedConfiguration as o, publicIdentityFailure as on, toKycTier as ot, validateReplacementInput as p, CAPXUL_ERROR_CODES as pn, CLI_INVOCATION_KINDS as pt, observeSdkClient as q, FAILURE_MODES$1 as qn, trim as qt, makeBankingMethods as r, getFunctionName as rn, makeCurrentUserMethods as rt, ConvexOrganizationAdapter as s, runIdentityFacade as sn, toTesterKind as st, ConvexOrganizationSetupAdapter as t, toAddress as tn, recoverRawDigestSigner as tt, preparedIdentity as u, runCapxulEffect as un, redactTelemetryProps as ut, makePaymentDocumentsMethods as v, ClockPortTag as vn, details as vt, makeAccountsMethods as w, readInvocationObservation as wn, diagnostics as wt, SmartAccountPortTag as x, observationRequestHeaders as xn, ORGANIZATION_SETUP_REASONS as xt, makeSmartAccountMethods as y, BetterAuthNodeLayer as yn, onboardings as yt, normalizeSafeSaltEmail as z, redactSecrets as zn, hexToBytes as zt };