@capxul/mcp 4.20.0-beta.31 → 4.20.0-beta.33

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,
@@ -13685,6 +14631,7 @@ const ActivityFilterProps = {
13685
14631
  filter_status: Schema.optional(Schema.Array(Schema.Literals([
13686
14632
  "pending",
13687
14633
  "settling",
14634
+ "in_transit",
13688
14635
  "unresolved",
13689
14636
  "pending_claim",
13690
14637
  "scheduled",
@@ -14095,6 +15042,18 @@ const CLI_COMMAND_NAMES = [
14095
15042
  "account.retry",
14096
15043
  "balance",
14097
15044
  "address",
15045
+ "verify",
15046
+ "verify.start",
15047
+ "verify.status",
15048
+ "bank",
15049
+ "bank.details",
15050
+ "bank.accounts",
15051
+ "bank.accounts.add",
15052
+ "bank.accounts.remove",
15053
+ "bank.pay",
15054
+ "bank.deposits",
15055
+ "bank.match",
15056
+ "bank.settle",
14098
15057
  "payment",
14099
15058
  "payment.send",
14100
15059
  "payment.list",
@@ -14121,6 +15080,8 @@ const CLI_COMMAND_NAMES = [
14121
15080
  "offer.deactivate",
14122
15081
  "contact",
14123
15082
  "contact.add",
15083
+ "contact.bank",
15084
+ "contact.bank.add",
14124
15085
  "contact.list",
14125
15086
  "contact.get",
14126
15087
  "contact.label",
@@ -14199,6 +15160,8 @@ const CLI_CAPABILITIES = [
14199
15160
  "diagnostics",
14200
15161
  "collection",
14201
15162
  "authentication",
15163
+ "verification",
15164
+ "banking",
14202
15165
  "account",
14203
15166
  "organization",
14204
15167
  "contacts",
@@ -14422,6 +15385,52 @@ Schema.Struct({
14422
15385
  props: MemberActivationFailedProps
14423
15386
  });
14424
15387
  //#endregion
15388
+ //#region ../../packages/observability/src/events/verification.ts
15389
+ const Identifier = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u));
15390
+ const FieldId = Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u));
15391
+ /** Journey: get_verified. Private answers and provider URLs are never properties. */
15392
+ const VerificationProps = Schema.Struct({
15393
+ ...TelemetryEnvelopeProps,
15394
+ verification_id: Identifier,
15395
+ invitation_id: Schema.optional(Identifier),
15396
+ party_id: Identifier,
15397
+ subject_kind: JourneyVariantProps.subject_kind,
15398
+ surface: JourneyVariantProps.surface,
15399
+ rail: Schema.Literal("bridge"),
15400
+ verification_state: VerificationStateSchema,
15401
+ missing_field_ids: Schema.optional(Schema.Array(FieldId)),
15402
+ release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
15403
+ });
15404
+ Schema.Struct({
15405
+ name: Schema.Literal("verification_started"),
15406
+ props: VerificationProps
15407
+ }), Schema.Struct({
15408
+ name: Schema.Literal("verification_terms_accepted"),
15409
+ props: VerificationProps
15410
+ }), Schema.Struct({
15411
+ name: Schema.Literal("verification_submitted"),
15412
+ props: VerificationProps
15413
+ }), Schema.Struct({
15414
+ name: Schema.Literal("verification_person_invited"),
15415
+ props: Schema.Struct({
15416
+ ...VerificationProps.fields,
15417
+ subject_kind: Schema.Literal("business"),
15418
+ invitation_id: Identifier
15419
+ })
15420
+ }), Schema.Struct({
15421
+ name: Schema.Literal("verification_liveness_requested"),
15422
+ props: VerificationProps
15423
+ }), Schema.Struct({
15424
+ name: Schema.Literal("verification_information_requested"),
15425
+ props: VerificationProps
15426
+ }), Schema.Struct({
15427
+ name: Schema.Literal("verification_approved"),
15428
+ props: VerificationProps
15429
+ }), Schema.Struct({
15430
+ name: Schema.Literal("verification_rejected"),
15431
+ props: VerificationProps
15432
+ });
15433
+ //#endregion
14425
15434
  //#region ../../packages/observability/src/telemetry/redaction.ts
14426
15435
  function redactTelemetryProps(name, props, options = {}) {
14427
15436
  if (props === void 0) return void 0;
@@ -15822,7 +16831,7 @@ function mapAccountLifecycle(input) {
15822
16831
  }
15823
16832
  //#endregion
15824
16833
  //#region ../../packages/sdk/package.json
15825
- var version$1 = "4.20.0-beta.31";
16834
+ var version$1 = "4.20.0-beta.33";
15826
16835
  //#endregion
15827
16836
  //#region ../../packages/sdk/src/observability/telemetry/exception-projection.ts
15828
16837
  /** Fixed fallback for failures that have no safe message. */
@@ -16430,7 +17439,20 @@ function admitted(row, error) {
16430
17439
  });
16431
17440
  }
16432
17441
  //#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
17442
+ //#region ../../packages/sdk/src/payments/bank-evidence.ts
17443
+ /** Bank recipients keep their chosen account identity beside the exact funding address. */
17444
+ function bankTargetsMatch(evidence) {
17445
+ const request = evidence.request;
17446
+ if (!("items" in request)) return true;
17447
+ return request.items.every((source, index) => {
17448
+ if (!("to" in source) || source.to.kind !== "party_account") return true;
17449
+ const observation = evidence.recipientObservations[index];
17450
+ const item = evidence.preparedCommand?.items[index];
17451
+ 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();
17452
+ });
17453
+ }
17454
+ //#endregion
17455
+ //#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
17456
  function getInitCode(userOperation, options = {}) {
16435
17457
  const { forHash } = options;
16436
17458
  const { authorization, factory, factoryData } = userOperation;
@@ -16442,7 +17464,7 @@ function getInitCode(userOperation, options = {}) {
16442
17464
  return concat$1([factory, factoryData ?? "0x"]);
16443
17465
  }
16444
17466
  //#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
17467
+ //#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
17468
  /** Magic suffix for paymaster signature encoding (keccak256("PaymasterSignature")[:8]) */
16447
17469
  const paymasterSignatureMagic = "0x22e325a297439656";
16448
17470
  function toPackedUserOperation(userOperation, options = {}) {
@@ -16470,7 +17492,7 @@ function toPackedUserOperation(userOperation, options = {}) {
16470
17492
  };
16471
17493
  }
16472
17494
  //#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
17495
+ //#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
17496
  const types = { PackedUserOperation: [
16475
17497
  {
16476
17498
  type: "address",
@@ -16521,7 +17543,7 @@ function getUserOperationTypedData(parameters) {
16521
17543
  };
16522
17544
  }
16523
17545
  //#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
17546
+ //#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
17547
  function getUserOperationHash(parameters) {
16526
17548
  const { chainId, entryPointAddress, entryPointVersion } = parameters;
16527
17549
  const userOperation = parameters.userOperation;
@@ -17224,6 +18246,144 @@ function supportedEnvelopeOf(input) {
17224
18246
  function envelopeV3Of(input) {
17225
18247
  return SchemaParser.decodeUnknownSync(PaymentDocumentEnvelopeV3Schema, { onExcessProperty: "error" })(input);
17226
18248
  }
18249
+ //#endregion
18250
+ //#region ../../packages/protocol/src/documents/money-invoice-hash.ts
18251
+ const MONEY_INVOICE_V5_EIP712_TYPES = {
18252
+ EIP712Domain: [
18253
+ {
18254
+ name: "name",
18255
+ type: "string"
18256
+ },
18257
+ {
18258
+ name: "version",
18259
+ type: "string"
18260
+ },
18261
+ {
18262
+ name: "chainId",
18263
+ type: "uint256"
18264
+ },
18265
+ {
18266
+ name: "salt",
18267
+ type: "bytes32"
18268
+ }
18269
+ ],
18270
+ ReceiptAmountV3: [
18271
+ {
18272
+ name: "denomination",
18273
+ type: "uint8"
18274
+ },
18275
+ {
18276
+ name: "currency",
18277
+ type: "string"
18278
+ },
18279
+ {
18280
+ name: "asset",
18281
+ type: "string"
18282
+ },
18283
+ {
18284
+ name: "minorUnits",
18285
+ type: "uint256"
18286
+ },
18287
+ {
18288
+ name: "decimals",
18289
+ type: "uint8"
18290
+ }
18291
+ ],
18292
+ Invoice: [
18293
+ {
18294
+ name: "kind",
18295
+ type: "uint8"
18296
+ },
18297
+ {
18298
+ name: "originId",
18299
+ type: "bytes32"
18300
+ },
18301
+ {
18302
+ name: "issuedAt",
18303
+ type: "uint64"
18304
+ },
18305
+ {
18306
+ name: "invoiceNumber",
18307
+ type: "string"
18308
+ },
18309
+ {
18310
+ name: "payerRef",
18311
+ type: "string"
18312
+ },
18313
+ {
18314
+ name: "payeeRef",
18315
+ type: "string"
18316
+ },
18317
+ {
18318
+ name: "amount",
18319
+ type: "ReceiptAmountV3"
18320
+ },
18321
+ {
18322
+ name: "receivingAccountId",
18323
+ type: "string"
18324
+ },
18325
+ {
18326
+ name: "target",
18327
+ type: "address"
18328
+ },
18329
+ {
18330
+ name: "dueAt",
18331
+ type: "uint64"
18332
+ },
18333
+ {
18334
+ name: "lineItemsHash",
18335
+ type: "bytes32"
18336
+ },
18337
+ {
18338
+ name: "note",
18339
+ type: "string"
18340
+ },
18341
+ {
18342
+ name: "discountMinor",
18343
+ type: "uint256"
18344
+ }
18345
+ ]
18346
+ };
18347
+ function message(envelope) {
18348
+ return {
18349
+ ...envelope.message,
18350
+ originId: toLowerBytes32(envelope.message.originId, "originId"),
18351
+ issuedAt: BigInt(envelope.message.issuedAt),
18352
+ amount: {
18353
+ ...envelope.message.amount,
18354
+ minorUnits: BigInt(envelope.message.amount.minorUnits)
18355
+ },
18356
+ target: toLowerAddress(envelope.message.target, "target"),
18357
+ dueAt: BigInt(envelope.message.dueAt),
18358
+ lineItemsHash: toLowerBytes32(envelope.message.lineItemsHash, "lineItemsHash"),
18359
+ discountMinor: BigInt(envelope.message.discountMinor)
18360
+ };
18361
+ }
18362
+ function domain(envelope) {
18363
+ return {
18364
+ ...envelope.domain,
18365
+ chainId: BigInt(envelope.domain.chainId),
18366
+ salt: toLowerBytes32(envelope.domain.salt, "domain.salt")
18367
+ };
18368
+ }
18369
+ function hashMoneyInvoiceV5(envelope) {
18370
+ return hashTypedData({
18371
+ domain: domain(envelope),
18372
+ primaryType: envelope.primaryType,
18373
+ types: MONEY_INVOICE_V5_EIP712_TYPES,
18374
+ message: message(envelope)
18375
+ });
18376
+ }
18377
+ async function verifyMoneyInvoiceV5Signature(envelope) {
18378
+ if (envelope.signature === void 0) return false;
18379
+ return (await recoverTypedDataAddress({
18380
+ domain: domain(envelope),
18381
+ primaryType: envelope.primaryType,
18382
+ types: MONEY_INVOICE_V5_EIP712_TYPES,
18383
+ message: message(envelope),
18384
+ signature: envelope.signature.value
18385
+ })).toLowerCase() === envelope.signature.signer;
18386
+ }
17227
18387
  /** Version 3 field order is fixed by the accepted Documents contract. */
17228
18388
  const PAYMENT_DOCUMENT_V3_EIP712_TYPES = {
17229
18389
  EIP712Domain: [
@@ -17481,30 +18641,45 @@ const INVOICE_V4_EIP712_TYPES = {
17481
18641
  function invoiceV4Message(envelope) {
17482
18642
  return {
17483
18643
  ...envelope.message,
18644
+ originId: toLowerBytes32(envelope.message.originId, "originId"),
18645
+ issuedAt: BigInt(envelope.message.issuedAt),
17484
18646
  amount: exactAssetV3Message(envelope.message.amount),
18647
+ target: toLowerAddress(envelope.message.target, "target"),
18648
+ dueAt: BigInt(envelope.message.dueAt),
18649
+ lineItemsHash: toLowerBytes32(envelope.message.lineItemsHash, "lineItemsHash"),
17485
18650
  discountMinor: BigInt(envelope.message.discountMinor)
17486
18651
  };
17487
18652
  }
18653
+ function invoiceV4Domain(envelope) {
18654
+ return {
18655
+ ...envelope.domain,
18656
+ chainId: BigInt(envelope.domain.chainId),
18657
+ salt: toLowerBytes32(envelope.domain.salt, "domain.salt")
18658
+ };
18659
+ }
17488
18660
  function hashSupportedPaymentDocument(input) {
17489
18661
  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
- });
18662
+ switch (envelope.version) {
18663
+ case 3: return hashPaymentDocumentV3(envelope);
18664
+ case 4: return hashTypedData({
18665
+ domain: invoiceV4Domain(envelope),
18666
+ primaryType: envelope.primaryType,
18667
+ types: INVOICE_V4_EIP712_TYPES,
18668
+ message: invoiceV4Message(envelope)
18669
+ });
18670
+ case 5: return hashMoneyInvoiceV5(envelope);
18671
+ default: return absurd(envelope);
18672
+ }
17498
18673
  }
17499
18674
  async function verifySupportedPaymentDocumentSignature(input) {
17500
18675
  const envelope = supportedEnvelopeOf(input);
17501
- if (envelope.version === 3) return verifyPaymentDocumentSignatureV3(envelope);
17502
18676
  if (envelope.signature === void 0) return false;
17503
- const types = INVOICE_V4_EIP712_TYPES;
18677
+ if (envelope.version === 3) return verifyPaymentDocumentSignatureV3(envelope);
18678
+ if (envelope.version === 5) return verifyMoneyInvoiceV5Signature(envelope);
17504
18679
  return (await recoverTypedDataAddress({
17505
- domain: envelope.domain,
18680
+ domain: invoiceV4Domain(envelope),
17506
18681
  primaryType: envelope.primaryType,
17507
- types,
18682
+ types: INVOICE_V4_EIP712_TYPES,
17508
18683
  message: invoiceV4Message(envelope),
17509
18684
  signature: envelope.signature.value
17510
18685
  })).toLowerCase() === envelope.signature.signer;
@@ -17580,12 +18755,13 @@ function requestRetryInstruction(input) {
17580
18755
  const bytes = decodeCanonicalBase64V3(document.bytesBase64);
17581
18756
  const envelope = decodeSupportedPaymentDocumentEnvelope(bytes);
17582
18757
  if (envelope.primaryType !== "Memo" && envelope.primaryType !== "Invoice") return void 0;
18758
+ if (envelope.version === 5) return void 0;
17583
18759
  return {
17584
18760
  documentHash: hashSupportedPaymentDocument(envelope),
17585
18761
  contentHash: hashPaymentDocumentContentV3(bytes),
17586
18762
  role: "instruction",
17587
18763
  kind: envelope.primaryType === "Memo" ? "memo" : "invoice",
17588
- format: envelope.version === 4 ? "envelope-v4" : "envelope-v3",
18764
+ format: paymentDocumentEnvelopeFormat(envelope),
17589
18765
  issuedAt: envelope.message.issuedAt
17590
18766
  };
17591
18767
  }
@@ -17638,14 +18814,12 @@ function retryBirthContext(evidence) {
17638
18814
  };
17639
18815
  }
17640
18816
  //#endregion
17641
- //#region ../../packages/protocol/src/evm/assets.ts
18817
+ //#region ../../packages/protocol/src/evm/test-assets.ts
17642
18818
  const SYNTHETIC_TEST_ASSET_SOURCE = "synthetic-test-liquidity";
17643
18819
  /**
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.
18820
+ * Owned test assets, with metadata read from each creation receipt and contract.
18821
+ * Settlement admission lives in assets.ts. The fixed test exchange uses the
18822
+ * original five assets; bank EURC has its own deployment.
17649
18823
  *
17650
18824
  * `symbol` is the display string the owned contract returns. A
17651
18825
  * provider-supported USDC would be a different contract at a different
@@ -17707,31 +18881,45 @@ const SYNTHETIC_TEST_ASSET_FIXTURES = {
17707
18881
  deploymentStartBlock: 46690061,
17708
18882
  deploymentTransaction: "0x6f6b0302448c7cd7db5c118a8250e548c6e72821df373e5a27550e5cdfa635a1",
17709
18883
  source: SYNTHETIC_TEST_ASSET_SOURCE
18884
+ },
18885
+ eurc: {
18886
+ assetId: assetIdFor(84532, "0x15055b4ed1d248c169b92705757cd9c3d985ad5f"),
18887
+ chainId: toChainId(84532),
18888
+ tokenAddress: "0x15055b4ed1d248c169b92705757cd9c3d985ad5f",
18889
+ symbol: "EURC",
18890
+ decimals: 6,
18891
+ peg: toCurrencyCode("EUR"),
18892
+ deploymentStartBlock: 47893251,
18893
+ deploymentTransaction: "0x4e0ab412d980a672336487afd10da007d51f34f17876b19b13732c8125be90ca",
18894
+ source: SYNTHETIC_TEST_ASSET_SOURCE
17710
18895
  }
17711
18896
  };
17712
- const SYNTHETIC_TEST_ASSETS = [
18897
+ /** EURC is minted for bank deposits and has no admission to the fixed test exchange. */
18898
+ const SYNTHETIC_TEST_ASSETS = [...[
17713
18899
  SYNTHETIC_TEST_ASSET_FIXTURES.usdc,
17714
18900
  SYNTHETIC_TEST_ASSET_FIXTURES.usdt,
17715
18901
  SYNTHETIC_TEST_ASSET_FIXTURES.weth,
17716
18902
  SYNTHETIC_TEST_ASSET_FIXTURES.wbtc,
17717
18903
  SYNTHETIC_TEST_ASSET_FIXTURES.cngn
17718
- ];
18904
+ ], SYNTHETIC_TEST_ASSET_FIXTURES.eurc];
17719
18905
  toChainId(84532);
17720
18906
  /**
17721
18907
  * 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.
18908
+ * path and to the treasury reads. USDC, USDT, WETH and EURC are admitted assets.
17723
18909
  * There is no default token.
17724
18910
  */
17725
18911
  const SETTLEMENT_ASSETS_BASE_SEPOLIA = Object.freeze({
17726
18912
  CAPXUL_TEST_USDC: SYNTHETIC_TEST_ASSET_FIXTURES.usdc,
17727
18913
  CAPXUL_TEST_USDT: SYNTHETIC_TEST_ASSET_FIXTURES.usdt,
17728
- CAPXUL_TEST_WETH: SYNTHETIC_TEST_ASSET_FIXTURES.weth
18914
+ CAPXUL_TEST_WETH: SYNTHETIC_TEST_ASSET_FIXTURES.weth,
18915
+ CAPXUL_TEST_EURC: SYNTHETIC_TEST_ASSET_FIXTURES.eurc
17729
18916
  });
17730
18917
  const CONFIGURED_MONEY_ASSETS = Object.freeze(Object.values(SETTLEMENT_ASSETS_BASE_SEPOLIA));
17731
18918
  Object.freeze({ BASE_SEPOLIA: Object.freeze({
17732
18919
  CAPXUL_TEST_USDC: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_USDC.assetId,
17733
18920
  CAPXUL_TEST_USDT: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_USDT.assetId,
17734
- CAPXUL_TEST_WETH: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_WETH.assetId
18921
+ CAPXUL_TEST_WETH: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_WETH.assetId,
18922
+ CAPXUL_TEST_EURC: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_EURC.assetId
17735
18923
  }) });
17736
18924
  /**
17737
18925
  * Every known asset in ONE identity space. The tiers above declare admission;
@@ -17799,8 +18987,12 @@ function sameAmount(left, right) {
17799
18987
  }
17800
18988
  function verifySupportedPaymentDocumentContext(input, context) {
17801
18989
  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);
18990
+ switch (envelope.version) {
18991
+ case 3: return verifyPaymentDocumentContextV3(envelope, context);
18992
+ case 4: return envelope.domain.chainId === context.chainId && envelope.message.originId === context.originId && envelope.message.target === context.target && sameAmount(envelope.message.amount, context.amount);
18993
+ case 5: return false;
18994
+ default: return absurd(envelope);
18995
+ }
17804
18996
  }
17805
18997
  function verifyPaymentDocumentContextV3(envelopeInput, context) {
17806
18998
  const envelope = envelopeV3Of(envelopeInput);
@@ -17839,7 +19031,7 @@ function validateInvoiceLineItems(input) {
17839
19031
  const derivedHash = hashLineItemsV3(items);
17840
19032
  const totalMinor = lineItemsTotalMinorV3(items);
17841
19033
  const hashMatches = derivedHash === envelope.message.lineItemsHash;
17842
- const discountMinor = envelope.version === 4 ? BigInt(envelope.message.discountMinor) : 0n;
19034
+ const discountMinor = envelope.version === 3 ? 0n : BigInt(envelope.message.discountMinor);
17843
19035
  const totalMatches = items.length === 0 ? discountMinor === 0n : discountMinor <= totalMinor && totalMinor - discountMinor === BigInt(envelope.message.amount.minorUnits);
17844
19036
  return {
17845
19037
  ok: hashMatches && totalMatches,
@@ -17849,8 +19041,8 @@ function validateInvoiceLineItems(input) {
17849
19041
  }
17850
19042
  /** Compare generated Invoice content with the confirmed draft before signing. */
17851
19043
  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"));
19044
+ if (envelope.primaryType !== "Invoice" || envelope.version !== 5 && envelope.version !== invoiceDraftVersion(draft)) return false;
19045
+ 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
19046
  }
17855
19047
  function hashAdjustmentsV3(input) {
17856
19048
  const adjustments = SchemaParser.decodeUnknownSync(adjustmentsV3Schema, { onExcessProperty: "error" })(input);
@@ -17886,6 +19078,7 @@ async function receiptLinksMatch(source, links) {
17886
19078
  }
17887
19079
  async function documentContextMatches(input, command, item, bundle, ref, exact) {
17888
19080
  const envelope = bundle.envelope;
19081
+ if (envelope.version === 5) return false;
17889
19082
  const request = input.evidence.request;
17890
19083
  const confirmedInstruction = "kind" in request && request.kind === "payment_request" ? request.confirmation.instruction : requestRetryInstruction(input);
17891
19084
  const originId = confirmedInstruction === void 0 ? hashDocumentOriginIdV3({
@@ -17906,7 +19099,7 @@ async function documentContextMatches(input, command, item, bundle, ref, exact)
17906
19099
  minorUnits: exact.minorUnits,
17907
19100
  decimals: exact.decimals
17908
19101
  }
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));
19102
+ }) && 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
19103
  }
17911
19104
  function payslipContentMatches(source, bundle, ref) {
17912
19105
  const envelope = bundle.envelope;
@@ -19252,7 +20445,7 @@ async function verifiedPreparedCommand(evidence, sessionEmail, signerAddress, ch
19252
20445
  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
20446
  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
20447
  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);
20448
+ return bankTargetsMatch(evidence) && verifiesMoneyOperation(evidence, expectedSafe, chainId, permissionId) && await verifiesMoneyBirthEvidence(evidence);
19256
20449
  }
19257
20450
  //#endregion
19258
20451
  //#region ../../packages/sdk/src/money/asset-amount.ts
@@ -19329,7 +20522,11 @@ function emitPaymentInitiated(telemetry, input, runPromise) {
19329
20522
  payment_lifecycle_id: `payment_lifecycle_${input.paymentId}`,
19330
20523
  ...input.commandId === void 0 ? {} : { command_id: input.commandId },
19331
20524
  ...input.executionId === void 0 ? {} : { execution_id: input.executionId },
19332
- ...input.recipient
20525
+ ...input.recipient,
20526
+ ...input.recipient.recipient_locator_kind === "party_account" ? {
20527
+ recipient_kind: "bank",
20528
+ rail: "bridge"
20529
+ } : {}
19333
20530
  }
19334
20531
  }, runPromise);
19335
20532
  }
@@ -19519,7 +20716,7 @@ function plannedCommitmentMatches(prepared) {
19519
20716
  function recipientMatches(prepared, target) {
19520
20717
  const { to, externalAddressAcknowledged } = prepared.payment;
19521
20718
  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());
20719
+ 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
20720
  }
19524
20721
  function itemMatches(prepared, amount) {
19525
20722
  const { item, payment } = prepared;
@@ -19584,6 +20781,7 @@ function verifiesPersonalOperation(prepared, expectedSafe, chainId) {
19584
20781
  async function documentReferenceMatches(prepared, amount) {
19585
20782
  const { item, documentBundle: bundle, instructionDocument: ref } = prepared;
19586
20783
  const envelope = bundle.envelope;
20784
+ if (envelope.version === 5) return false;
19587
20785
  if (item.operation !== "send" && item.operation !== "create_commitment") return false;
19588
20786
  return bundle.originId === hashDocumentOriginIdV3({
19589
20787
  chainId: prepared.chainId,
@@ -19597,7 +20795,7 @@ async function documentReferenceMatches(prepared, amount) {
19597
20795
  source: prepared.userOpSenderSafe.toLowerCase(),
19598
20796
  target: item.recipientSafe.toLowerCase(),
19599
20797
  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));
20798
+ }) && 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
20799
  }
19602
20800
  function generatedDraftMatches(prepared) {
19603
20801
  const { envelope, lineItems } = prepared.documentBundle;
@@ -19955,6 +21153,21 @@ function executeOrganizationPayment(deps, input, signal, onPreparedClosed, contr
19955
21153
  })).pipe(Effect.mapError((publicError) => ({ publicError })))), controls), deps.runPromise), matchesIntent(input), true, onPreparedClosed, signal, controls, onPrepared);
19956
21154
  }
19957
21155
  //#endregion
21156
+ //#region ../../packages/sdk/src/payments/quotes.ts
21157
+ /** The immutable method scope owns the payer. The backend returns exact funding instructions. */
21158
+ function makePaymentQuote(deps, actor = { kind: "account" }) {
21159
+ return (input, options) => {
21160
+ const controls = deps.invocationControls?.(options) ?? options;
21161
+ return runCapxulEffect(callOperation(deps.convexCall, quotes.quote, copyInvocationObservation(controls, {
21162
+ ...input,
21163
+ actor
21164
+ })).pipe(Effect.tap(() => Effect.annotateCurrentSpan({
21165
+ party_account_id: input.to.partyAccountId,
21166
+ ...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
21167
+ }))), controls, quotes.quote.name, deps.runPromise);
21168
+ };
21169
+ }
21170
+ //#endregion
19958
21171
  //#region ../../packages/sdk/src/parties/backend-refs.ts
19959
21172
  function nonEmptyRefValue(value, field) {
19960
21173
  const trimmed = value.trim();
@@ -20015,6 +21228,176 @@ function backendRef(locator) {
20015
21228
  }
20016
21229
  }
20017
21230
  //#endregion
21231
+ //#region ../../packages/sdk/src/parties/verification-target.ts
21232
+ const verificationTargetInput = (target) => target.kind === "organization" ? { orgId: target.orgId } : target.kind === "invitation" ? { invitationId: target.invitationId } : {};
21233
+ /** Refuse a decoded response that identifies a different immutable scope. */
21234
+ const validateVerificationTarget = (target, status) => {
21235
+ 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."));
21236
+ };
21237
+ //#endregion
21238
+ //#region ../../packages/sdk/src/parties/verifications.ts
21239
+ const documentReply = Schema.Struct({ documentId: Schema.NonEmptyString });
21240
+ const documentFields = new Set(VERIFICATION_DOCUMENT_FIELDS);
21241
+ const uploadFailure = () => Errors.providerError("verification", "uploadDocument", "The verification document could not be uploaded.");
21242
+ function makeVerificationMethods(deps, selectedTarget) {
21243
+ const target = selectedTarget ?? { kind: "personal" };
21244
+ let journeyId;
21245
+ let actorId;
21246
+ const context = (options) => {
21247
+ const resolved = deps.invocationControls?.(options) ?? options;
21248
+ const snapshot = readInvocationObservation(resolved) ?? { active: true };
21249
+ if (actorId !== snapshot.actorId) journeyId = void 0;
21250
+ actorId = snapshot.actorId;
21251
+ journeyId = options?.journey_id ?? journeyId ?? snapshot.context?.journeyId ?? `verification_${crypto.randomUUID()}`;
21252
+ const controls = {
21253
+ ...resolved,
21254
+ journey_id: journeyId,
21255
+ correlation_id: resolved?.correlation_id ?? snapshot.context?.correlationId ?? crypto.randomUUID()
21256
+ };
21257
+ const captured = snapshot.active ? withCapturedAttemptContext(snapshot.context, controls) : void 0;
21258
+ return attachInvocationObservation(controls, {
21259
+ ...snapshot,
21260
+ ...captured === void 0 ? {} : { context: captured }
21261
+ });
21262
+ };
21263
+ const remember = (status) => {
21264
+ if (status.journeyId !== "") journeyId = status.journeyId;
21265
+ return status;
21266
+ };
21267
+ const upload = (field, blob, options) => Effect.gen(function* () {
21268
+ if (!documentFields.has(field) || !(blob instanceof Blob) || blob.size === 0) return yield* Effect.fail(Errors.invalidInput("files", "Provide a supported verification document."));
21269
+ const jwt = yield* deps.authClient.getConvexJwt(options).pipe(Effect.mapError(toPublicError$1));
21270
+ return yield* Effect.tryPromise({
21271
+ try: async (signal) => {
21272
+ const response = await (deps.fetch ?? globalThis.fetch)(new URL("/parties/verifications/documents", deps.siteBaseUrl), {
21273
+ method: "POST",
21274
+ headers: {
21275
+ Authorization: `Bearer ${jwt.token}`,
21276
+ "Content-Type": blob.type || "application/octet-stream",
21277
+ "X-Capxul-Document-Field": field
21278
+ },
21279
+ body: blob,
21280
+ signal,
21281
+ redirect: "error"
21282
+ });
21283
+ if (!response.ok) throw uploadFailure();
21284
+ return await response.json();
21285
+ },
21286
+ catch: uploadFailure
21287
+ }).pipe(Effect.flatMap(Schema.decodeUnknownEffect(documentReply)), Effect.mapError(uploadFailure), Effect.map((reply) => reply.documentId));
21288
+ });
21289
+ const submit = (input, options) => {
21290
+ const controls = context(options);
21291
+ const hasAnswers = input?.answers !== void 0 || input?.files !== void 0;
21292
+ const people = input?.people;
21293
+ const row = people !== void 0 ? verifications$1.invite : hasAnswers ? verifications$1.answer : verifications$1.start;
21294
+ return runCapxulEffect(Effect.gen(function* () {
21295
+ if (people !== void 0 && target.kind !== "organization") return yield* Effect.fail(Errors.invalidInput("people", "People require an Organization verification scope."));
21296
+ let status;
21297
+ if (!hasAnswers) status = yield* callOperation(deps.convexCall, verifications$1.start, copyInvocationObservation(controls, {
21298
+ ...verificationTargetInput(target),
21299
+ surface: input?.surface ?? "sdk"
21300
+ }));
21301
+ else {
21302
+ const answers = { ...input?.answers };
21303
+ for (const [field, blob] of Object.entries(input?.files ?? {})) answers[field] = yield* upload(field, blob, controls);
21304
+ status = yield* callOperation(deps.convexCall, verifications$1.answer, copyInvocationObservation(controls, {
21305
+ ...verificationTargetInput(target),
21306
+ answers,
21307
+ surface: input?.surface ?? "sdk"
21308
+ }));
21309
+ }
21310
+ if (people !== void 0 && target.kind === "organization") status = yield* callOperation(deps.convexCall, verifications$1.invite, copyInvocationObservation(controls, {
21311
+ orgId: target.orgId,
21312
+ people
21313
+ }));
21314
+ return yield* validateVerificationTarget(target, status);
21315
+ }).pipe(Effect.map(remember)), controls, row.name, deps.runPromise);
21316
+ };
21317
+ const scoped = {
21318
+ start: submit,
21319
+ status: (options) => {
21320
+ const controls = context(options);
21321
+ 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);
21322
+ }
21323
+ };
21324
+ return selectedTarget === void 0 ? {
21325
+ ...scoped,
21326
+ forInvitation: (invitationId) => makeVerificationMethods(deps, {
21327
+ kind: "invitation",
21328
+ invitationId
21329
+ })
21330
+ } : scoped;
21331
+ }
21332
+ //#endregion
21333
+ //#region ../../packages/sdk/src/parties/relationship-calls.ts
21334
+ function relationshipCalls(deps, convexCall) {
21335
+ const actor = deps.actor.kind === "account" ? { kind: "account" } : {
21336
+ kind: "org",
21337
+ orgId: deps.actor.orgId
21338
+ };
21339
+ const observeContactScope = Effect.annotateCurrentSpan({
21340
+ scope_kind: actor.kind === "org" ? "organization" : "account",
21341
+ ...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
21342
+ });
21343
+ /** One observed call of one contacts row, its reply projected inside the call, under the row's name. */
21344
+ const book = (row, args, options, project) => {
21345
+ const controls = deps.invocationControls?.(options) ?? options;
21346
+ return runPortEffect(projectReply(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError }))), project).pipe(Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
21347
+ };
21348
+ /** As `book`, for a projection that refuses the reply as a value. */
21349
+ const bookChecked = (row, args, options, check) => {
21350
+ const controls = deps.invocationControls?.(options) ?? options;
21351
+ return runPortEffect(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.flatMap((output) => {
21352
+ const checked = check(output);
21353
+ return checked.ok ? Effect.succeed(checked.value) : Effect.fail({ publicError: checked.error });
21354
+ }), Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
21355
+ };
21356
+ return {
21357
+ deps,
21358
+ actor,
21359
+ convexCall,
21360
+ observeContactScope,
21361
+ book,
21362
+ bookChecked
21363
+ };
21364
+ }
21365
+ function missingConvexCall(operation) {
21366
+ return Promise.resolve({
21367
+ ok: false,
21368
+ error: Errors.providerError("convex", operation, "ConvexCallPort is required")
21369
+ });
21370
+ }
21371
+ //#endregion
21372
+ //#region ../../packages/sdk/src/parties/accounts.ts
21373
+ /** The actor is captured once. Private input is admitted by the backend's field rules. */
21374
+ function makeBankAccountMethods({ actor, book }) {
21375
+ return {
21376
+ requirements: (input, options) => book(accounts.requirements, {
21377
+ ...input,
21378
+ actor
21379
+ }, options, (value) => value),
21380
+ add: (input, options) => book(accounts.add, {
21381
+ ...input,
21382
+ actor
21383
+ }, options, (value) => value),
21384
+ list: (input, options) => book(accounts.list, {
21385
+ ...input,
21386
+ actor
21387
+ }, options, (value) => value),
21388
+ remove: (input, options) => book(accounts.remove, {
21389
+ ...input,
21390
+ actor
21391
+ }, options, (value) => value)
21392
+ };
21393
+ }
21394
+ const unavailableBankAccountMethods = () => ({
21395
+ requirements: () => missingConvexCall(accounts.requirements.name),
21396
+ add: () => missingConvexCall(accounts.add.name),
21397
+ list: () => missingConvexCall(accounts.list.name),
21398
+ remove: () => missingConvexCall(accounts.remove.name)
21399
+ });
21400
+ //#endregion
20018
21401
  //#region ../../packages/sdk/src/parties/recipients.ts
20019
21402
  function makeTargetsMethods(deps) {
20020
21403
  return { resolve: (reference, options) => {
@@ -20112,6 +21495,10 @@ async function payObligationRegistered(deps, input, options, generic) {
20112
21495
  error: Errors.invalidInput(generic ? "request" : "invoice", generic ? "Request is unavailable" : "Invoice is unavailable")
20113
21496
  };
20114
21497
  const snapshot = frozen.value;
21498
+ if ("bankPayment" in snapshot) return {
21499
+ ok: false,
21500
+ error: Errors.invalidInput("invoice", "Pay this Invoice by bank transfer.")
21501
+ };
20115
21502
  const { sourceWallet: _sourceWallet, ...wireInput } = input;
20116
21503
  const request = {
20117
21504
  kind: "invoice_checkout",
@@ -20384,6 +21771,8 @@ function mapInboxItem(item) {
20384
21771
  status: mapInboxStatus(item.status),
20385
21772
  documents: item.documents ?? [],
20386
21773
  ...item.issuerSafe === void 0 ? {} : { issuerSafe: item.issuerSafe },
21774
+ ...item.receivingAccountId === void 0 ? {} : { receivingAccountId: item.receivingAccountId },
21775
+ ...item.settledDepositRef === void 0 ? {} : { settledDepositRef: item.settledDepositRef },
20387
21776
  ...item.settledPaymentId == null ? {} : { paymentId: toPaymentId(item.settledPaymentId) }
20388
21777
  };
20389
21778
  }
@@ -20434,6 +21823,7 @@ function makeOfferMethods(deps) {
20434
21823
  }
20435
21824
  //#endregion
20436
21825
  //#region ../../packages/sdk/src/requests/receivables.ts
21826
+ const isMoneyRequestIssue = (input) => "currency" in input.amount;
20437
21827
  function makeActorRequestsMethods(calls) {
20438
21828
  const { actor, deps, book } = calls;
20439
21829
  return {
@@ -20443,15 +21833,24 @@ function makeActorRequestsMethods(calls) {
20443
21833
  const controls = deps.invocationControls?.(options) ?? options;
20444
21834
  return runCapxulEffect(Effect.fail(payer.error), controls, receivables.issue.name, deps.runPromise);
20445
21835
  }
20446
- return book(receivables.issue, {
21836
+ const common = {
20447
21837
  actor,
20448
21838
  payer: payer.value,
20449
- amount: input.amount,
20450
21839
  reference: input.reference,
20451
21840
  ...input.memo === void 0 ? {} : { memo: input.memo },
20452
- ...input.invoice === void 0 ? {} : { invoice: input.invoice },
20453
21841
  ...input.expiresAt === void 0 ? {} : { expiresAt: input.expiresAt }
20454
- }, options, (request) => mapActorRequest(request, input.payer));
21842
+ };
21843
+ const issueArgs = isMoneyRequestIssue(input) ? {
21844
+ ...common,
21845
+ amount: input.amount,
21846
+ invoice: input.invoice,
21847
+ receivingAccountId: input.receivingAccountId
21848
+ } : {
21849
+ ...common,
21850
+ amount: input.amount,
21851
+ ...input.invoice === void 0 ? {} : { invoice: input.invoice }
21852
+ };
21853
+ return book(receivables.issue, issueArgs, options, (request) => mapActorRequest(request, input.payer));
20455
21854
  },
20456
21855
  list: (options) => book(receivables.listCurrent, { actor }, options, (requests) => mapPage(requests, (request) => mapActorRequest(request))),
20457
21856
  get: (requestId, options) => book(receivables.getCurrent, {
@@ -20490,49 +21889,12 @@ function mapActorRequest(request, payer) {
20490
21889
  ...request.settledPaymentId == null ? {} : { paymentId: toPaymentId(request.settledPaymentId) },
20491
21890
  ...typeof request.addressedToViewer === "boolean" ? { addressedToViewer: request.addressedToViewer } : {},
20492
21891
  ...request.issuerSafe === void 0 ? {} : { issuerSafe: request.issuerSafe },
21892
+ ...request.receivingAccountId === void 0 ? {} : { receivingAccountId: request.receivingAccountId },
21893
+ ...request.settledDepositRef === void 0 ? {} : { settledDepositRef: request.settledDepositRef },
20493
21894
  linkToken: request.linkToken
20494
21895
  };
20495
21896
  }
20496
21897
  //#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
21898
  //#region ../../packages/sdk/src/parties/contacts.ts
20537
21899
  function makeAddressBookMethods(calls) {
20538
21900
  const { actor, deps, book } = calls;
@@ -20604,6 +21966,7 @@ function makeActorRelationshipMethods(deps) {
20604
21966
  if (convexCall === void 0) return {
20605
21967
  offers,
20606
21968
  addressBook: unavailableAddressBookMethods(),
21969
+ bankAccounts: unavailableBankAccountMethods(),
20607
21970
  requests: unavailableActorRequestsMethods(),
20608
21971
  inbox: unavailableInboxMethods(),
20609
21972
  profile
@@ -20612,6 +21975,7 @@ function makeActorRelationshipMethods(deps) {
20612
21975
  return {
20613
21976
  offers,
20614
21977
  addressBook: makeAddressBookMethods(calls),
21978
+ bankAccounts: makeBankAccountMethods(calls),
20615
21979
  requests: makeActorRequestsMethods(calls),
20616
21980
  inbox: makeInboxMethods(calls),
20617
21981
  profile
@@ -20816,12 +22180,16 @@ function paymentExecutionIntent(input) {
20816
22180
  ok: false,
20817
22181
  error: Errors.notImplemented("payments", "pay.organizationActor")
20818
22182
  };
20819
- const to = normalizeTargetForBackend(input.to, "to");
20820
- if (!to.ok) return to;
20821
22183
  try {
22184
+ const to = input.to?.kind === "party_account" ? {
22185
+ ok: true,
22186
+ value: input.to
22187
+ } : normalizeTargetForBackend(input.to, "to");
22188
+ if (!to.ok) return to;
20822
22189
  const decoded = Schema.decodeResult(PaymentExecutionIntentSchema, { onExcessProperty: "error" })({
20823
22190
  to: to.value,
20824
22191
  amount: input.amount,
22192
+ ...input.quoteId === void 0 ? {} : { quoteId: input.quoteId },
20825
22193
  ...input.externalAddressAcknowledged === void 0 ? {} : { externalAddressAcknowledged: input.externalAddressAcknowledged },
20826
22194
  ...input.paymentType === void 0 ? {} : { paymentType: input.paymentType },
20827
22195
  ...input.document === void 0 ? {} : { document: input.document },
@@ -20835,10 +22203,10 @@ function paymentExecutionIntent(input) {
20835
22203
  ok: false,
20836
22204
  error: invalidPaymentField(decoded.failure.issue, "invalid personal payment input")
20837
22205
  };
20838
- } catch {
22206
+ } catch (cause) {
20839
22207
  return {
20840
22208
  ok: false,
20841
- error: Errors.invalidInput("payment", "invalid personal payment input")
22209
+ error: cause instanceof CapxulError ? cause : Errors.invalidInput("payment", "invalid personal payment input")
20842
22210
  };
20843
22211
  }
20844
22212
  }
@@ -21362,6 +22730,7 @@ function makePaymentsMethods(deps) {
21362
22730
  const pay = makePersonalPay(deps);
21363
22731
  const { runLifecycle, retryPayment } = makeLifecycleRunners(deps);
21364
22732
  return {
22733
+ quote: makePaymentQuote(deps),
21365
22734
  subscribe: (paymentId, listener, options) => subscribePersonalPayment({
21366
22735
  actor: deps.actor,
21367
22736
  convexCall: deps.convexCall,
@@ -21401,32 +22770,6 @@ function makePaymentsMethods(deps) {
21401
22770
  };
21402
22771
  }
21403
22772
  //#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
22773
  //#region ../../packages/sdk/src/payments/organization-payment-requests.ts
21431
22774
  const organizationPaymentIntentSchema = Schema.Struct({
21432
22775
  orgId: PrepareOrganizationPaymentExecutionInputSchema.fields.orgId,
@@ -21712,6 +23055,10 @@ function makeOrganizationPaymentsMethods(deps, orgId) {
21712
23055
  }), observationOnlyControls(controls), operation, deps.runPromise);
21713
23056
  return {
21714
23057
  ...makeOrganizationPaymentReadMethods(deps, orgId),
23058
+ quote: makePaymentQuote(deps, {
23059
+ kind: "org",
23060
+ orgId
23061
+ }),
21715
23062
  retry: (paymentId, options) => {
21716
23063
  const controls = deps.invocationControls?.(options) ?? options;
21717
23064
  return runCapxulEffect(Effect.gen(function* () {
@@ -21791,21 +23138,6 @@ function makeOrganizationPaymentsMethods(deps, orgId) {
21791
23138
  };
21792
23139
  }
21793
23140
  //#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
23141
  //#region ../../packages/sdk/src/accounts/events.ts
21810
23142
  async function emitProvisioningTelemetry(telemetry, smartAccount, runPromise) {
21811
23143
  if (telemetry === void 0) return;
@@ -21855,50 +23187,16 @@ function emitAccountBalanceFailed(telemetry, error, runPromise) {
21855
23187
  }
21856
23188
  }, runPromise);
21857
23189
  }
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"));
23190
+ /** Keep instruction-read facts on the operation span without a product event. */
23191
+ function annotateDepositInstructions(instructions, verifiedOrganizationId) {
23192
+ const organizationId = safeEngineeringIdentifier(verifiedOrganizationId);
23193
+ return Effect.annotateCurrentSpan({
23194
+ scope_kind: organizationId === void 0 ? "account" : "organization",
23195
+ account_kind: organizationId === void 0 ? "personalSafe" : "orgTreasury",
23196
+ ...Number.isSafeInteger(instructions.chainId) && instructions.chainId > 0 ? { chain_id: instructions.chainId } : {},
23197
+ ...instructions.network === "base-sepolia" ? { network: instructions.network } : {},
23198
+ ...organizationId === void 0 ? {} : { verified_organization_id: organizationId }
23199
+ });
21902
23200
  }
21903
23201
  //#endregion
21904
23202
  //#region ../../packages/sdk/src/accounts/account-phases.ts
@@ -22447,8 +23745,104 @@ function makeAccountMethods(deps) {
22447
23745
  };
22448
23746
  }
22449
23747
  //#endregion
23748
+ //#region ../../packages/sdk/src/accounts/organization-approvals.ts
23749
+ /** The Organization Payment prepared for `signerAddress` and checked, before any approval. */
23750
+ async function prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal) {
23751
+ const { organizationId, permissionId, requestKey, lineage, ...item } = input;
23752
+ const intent = organizationPaymentIntent(organizationId, {
23753
+ permissionId,
23754
+ items: [item],
23755
+ ...lineage === void 0 ? {} : { lineage },
23756
+ ...requestKey === void 0 ? {} : { requestKey }
23757
+ }, true);
23758
+ if (!intent.ok) return intent;
23759
+ const session = deps.actor?.authSession() ?? null;
23760
+ if (session === null || deps.chainId === void 0) return {
23761
+ ok: false,
23762
+ error: Errors.notAuthenticated()
23763
+ };
23764
+ const expected = {
23765
+ ...intent.value,
23766
+ requestKey: requestKey ?? `pay_${crypto.randomUUID()}`
23767
+ };
23768
+ const prepared = await runIfActive(signal, CAPXUL_OPERATIONS.organizationPayments.prepareExecution, () => callOperation(deps.convexCall, commands$1.prepareOrganization, {
23769
+ ...expected,
23770
+ signerAddress
23771
+ }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
23772
+ if (!prepared.ok) return prepared;
23773
+ const evidence = prepared.value;
23774
+ if (!(await matchesIntent(expected)(evidence.request, evidence) && await verifiedPreparedCommand(evidence, session.email, signerAddress, deps.chainId))) return abandonPrepared(deps, evidence.executionId, "prepared_mismatch", {
23775
+ ok: false,
23776
+ error: Errors.invalidInput("execution", "prepared Organization Payment mismatch")
23777
+ });
23778
+ await emitPreparedInitiation(deps, evidence);
23779
+ return {
23780
+ ok: true,
23781
+ value: evidence
23782
+ };
23783
+ }
23784
+ /** One fresh Payment read: the caller's own, or one in the Organization's scope. */
23785
+ 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, {
23786
+ orgId: organizationId,
23787
+ paymentId
23788
+ }, { fresh: true }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
23789
+ /**
23790
+ * The Payments an approval carries, as they stand. A personal read names only
23791
+ * the caller's own Account's Payments, so an Organization's is read with its
23792
+ * `organizationId`; one that cannot be read is refused, never taken as ended.
23793
+ */
23794
+ async function readApprovalPayments(deps, paymentIds, organizationId, signal) {
23795
+ const reads = await Promise.all(paymentIds.map((paymentId) => readPayment(deps, paymentId, organizationId, signal)));
23796
+ const payments = [];
23797
+ for (const [index, read] of reads.entries()) {
23798
+ if (!read.ok) return read;
23799
+ const { orgId, payment } = read.value;
23800
+ if (payment === null && organizationId === void 0) return {
23801
+ ok: false,
23802
+ error: Errors.invalidInput("organizationId", "this approval pays from an Organization: wait with its organizationId")
23803
+ };
23804
+ if (payment === null || payment.id !== paymentIds[index] || orgId !== organizationId) return {
23805
+ ok: false,
23806
+ error: Errors.invalidInput("paymentId", "the approval's Payments are not this scope's")
23807
+ };
23808
+ payments.push(normalizePaymentTiming(payment));
23809
+ }
23810
+ return {
23811
+ ok: true,
23812
+ value: payments
23813
+ };
23814
+ }
23815
+ //#endregion
23816
+ //#region ../../packages/sdk/src/accounts/bank-approvals.ts
23817
+ /** Read the immutable Payment behind a bank approval before handing it to the person. */
23818
+ async function checkedBankApproval(deps, input, opened) {
23819
+ if (!opened.ok || input.to.kind !== "party_account") return opened;
23820
+ const approval = opened.value;
23821
+ const read = await readApprovalPayments(deps, approval.operation.paymentIds, "organizationId" in input ? input.organizationId : void 0, void 0);
23822
+ if (!read.ok) return read;
23823
+ const [payment] = read.value;
23824
+ let amountMatches = false;
23825
+ try {
23826
+ const funding = toExactAssetAmount(input.amount, CONFIGURED_MONEY_ASSETS);
23827
+ const described = approval.summary.amount === null ? null : toExactAssetAmount(approval.summary.amount, CONFIGURED_MONEY_ASSETS);
23828
+ const stored = payment === void 0 ? null : toExactAssetAmount(payment.amount, CONFIGURED_MONEY_ASSETS);
23829
+ amountMatches = described?.asset === funding.asset && described.minorUnits === funding.minorUnits && stored?.asset === funding.asset && stored.minorUnits === funding.minorUnits;
23830
+ } catch {
23831
+ amountMatches = false;
23832
+ }
23833
+ 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;
23834
+ return abandonPrepared(deps, approval.operation.executionId, "prepared_mismatch", {
23835
+ ok: false,
23836
+ error: Errors.invalidInput("approval", "The bank approval does not match its quoted Payment.")
23837
+ });
23838
+ }
23839
+ //#endregion
22450
23840
  //#region ../../packages/sdk/src/accounts/approval-rules.ts
22451
- const IN_FLIGHT = /* @__PURE__ */ new Set(["pending", "settling"]);
23841
+ const IN_FLIGHT = /* @__PURE__ */ new Set([
23842
+ "pending",
23843
+ "settling",
23844
+ "in_transit"
23845
+ ]);
22452
23846
  /** A Payment the chain has not decided yet. */
22453
23847
  function inFlight(payment) {
22454
23848
  return IN_FLIGHT.has(payment.status);
@@ -22615,9 +24009,10 @@ function toPayrollGroup(wire) {
22615
24009
  }))
22616
24010
  };
22617
24011
  }
24012
+ const PayrollWalletItemSchema = PayrollRunItemInputSchema.pipe(Schema.refine((item) => item.to.kind !== "party_account", { message: "Payroll cannot target saved bank accounts" }));
22618
24013
  function validateRunItems(input) {
22619
24014
  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");
24015
+ if (Schema.decodeResult(PayrollWalletItemSchema, { onExcessProperty: "error" })(item)._tag === "Failure") return Errors.invalidInput(`items.${index}`, "invalid Payroll item");
22621
24016
  try {
22622
24017
  const exact = toExactAssetAmount(item.amount, CONFIGURED_MONEY_ASSETS);
22623
24018
  const net = BigInt(item.net);
@@ -22634,7 +24029,7 @@ const RunInputSchema = Schema.Struct({
22634
24029
  permissionId: AuthorizePayrollRunExecutionInputSchema.fields.permissionId,
22635
24030
  asset: AuthorizePayrollRunExecutionInputSchema.fields.asset,
22636
24031
  period: AuthorizePayrollRunExecutionInputSchema.fields.period,
22637
- items: AuthorizePayrollRunExecutionInputSchema.fields.items,
24032
+ items: Schema.Array(PayrollWalletItemSchema),
22638
24033
  requestKey: Schema.optional(AuthorizePayrollRunExecutionInputSchema.fields.requestKey)
22639
24034
  });
22640
24035
  /** Decode caller input before session or signer work. Keep routing outside the input. */
@@ -23038,72 +24433,6 @@ async function prepareVerifiedPayrollRun(deps, input, signerAddress, signal) {
23038
24433
  }, authorized.value.run), authorized.value.replay.kind !== "accepted");
23039
24434
  }
23040
24435
  //#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
24436
  //#region ../../packages/sdk/src/accounts/approvals.ts
23108
24437
  /** A Permission write or an invitation, rather than a Payment. */
23109
24438
  const isPermissionChange = (input) => "permission" in input || "invite" in input;
@@ -23150,20 +24479,24 @@ function makeApprovalsMethods(deps) {
23150
24479
  if (!prepared.ok) return prepared;
23151
24480
  const { executionId } = prepared.value;
23152
24481
  const opened = await call(approvals.request.name, approvals.request, { executionId });
24482
+ if (opened.ok && opened.value.operation.executionId !== executionId) return abandonPrepared(deps, executionId, "prepared_mismatch", {
24483
+ ok: false,
24484
+ error: Errors.invalidInput("approval", "The approval names another prepared execution.")
24485
+ });
23153
24486
  return opened.ok ? opened : abandonPrepared(deps, executionId, "cancelled", opened);
23154
24487
  };
23155
24488
  const prepare = async (input, options) => {
23156
24489
  const signal = options?.signal;
23157
24490
  if (isCommandApproval(input)) return openApproval(signal, (signerAddress) => prepareVerifiedCommand(deps, input, signerAddress, signal));
23158
24491
  if (isPermissionChange(input)) return openApproval(signal, async (signerAddress) => {
23159
- const { prepareVerifiedPermissionChange } = await import("./permission-approvals-B2xmvEKE.mjs");
24492
+ const { prepareVerifiedPermissionChange } = await import("./permission-approvals-DMdZgL2O.mjs");
23160
24493
  return prepareVerifiedPermissionChange(deps, input, signerAddress, signal);
23161
24494
  });
23162
- if ("organizationId" in input) return openApproval(signal, (signerAddress) => prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal));
24495
+ if ("organizationId" in input) return checkedBankApproval(deps, input, await openApproval(signal, (signerAddress) => prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal)));
23163
24496
  const intent = paymentExecutionIntent(input);
23164
24497
  if (!intent.ok) return intent;
23165
24498
  const { actor, chainId } = deps;
23166
- return openApproval(signal, async (signerAddress) => {
24499
+ return checkedBankApproval(deps, input, await openApproval(signal, async (signerAddress) => {
23167
24500
  if (actor === void 0 || chainId === void 0) return {
23168
24501
  ok: false,
23169
24502
  error: Errors.notImplemented("approvals", "prepareComposition")
@@ -23176,7 +24509,7 @@ function makeApprovalsMethods(deps) {
23176
24509
  }, intent.value, signerAddress, input.requestKey ?? `pay_${crypto.randomUUID()}`, signal);
23177
24510
  if (prepared.ok) await emitPreparedPaymentInitiated(deps, prepared.value);
23178
24511
  return prepared;
23179
- });
24512
+ }));
23180
24513
  };
23181
24514
  const approve = async (approvalId) => {
23182
24515
  const { signer } = deps;
@@ -23589,7 +24922,7 @@ function headlineValuation(balances, displayCurrency, rates = MONEY_READ_RATES)
23589
24922
  const valuation = valueIn(balances.map((position) => ({
23590
24923
  asset: position.asset,
23591
24924
  value: pick(position)
23592
- })), displayCurrency, rates);
24925
+ })).filter((amount) => toRaw(amount, requireAsset(amount.asset)) !== 0n), displayCurrency, rates);
23593
24926
  if (valuation.unrated.length > 0) return null;
23594
24927
  return valuation.total ?? {
23595
24928
  currency: displayCurrency,
@@ -25209,7 +26542,7 @@ function makeMeMethods(deps) {
25209
26542
  })), Effect.mapError((publicError) => ({ publicError }))), deps.runPromise),
25210
26543
  depositInstructions: (options) => {
25211
26544
  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);
26545
+ return runPortEffect(callOperation(deps.convexCall, summaries.depositInstructions, copyInvocationObservation(controls, {})).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.tap(annotateDepositInstructions)), controls, summaries.depositInstructions.name, deps.runPromise);
25213
26546
  }
25214
26547
  };
25215
26548
  }
@@ -38077,7 +39410,7 @@ function readOrgDepositInstructionsProgram(orgId) {
38077
39410
  address: String(org.account.address).toLowerCase(),
38078
39411
  label: "Capxul org treasury"
38079
39412
  };
38080
- yield* emitDepositInitiated(deps.telemetry, instructions, deps.invocationSource, String(org.id));
39413
+ yield* annotateDepositInstructions(instructions, String(org.id));
38081
39414
  return instructions;
38082
39415
  });
38083
39416
  }
@@ -38186,6 +39519,141 @@ function makeOrgReadMethods(deps, orgId, shared) {
38186
39519
  };
38187
39520
  }
38188
39521
  //#endregion
39522
+ //#region ../../packages/sdk/src/banking/deposits.ts
39523
+ function makeBankDepositMethods(deps, actor) {
39524
+ const controls = (options) => deps.invocationControls?.(options) ?? options;
39525
+ const call = (program, invocation, operation) => runCapxulEffect(program, invocation, operation, deps.runPromise);
39526
+ return {
39527
+ list: (options) => {
39528
+ const invocation = controls(options);
39529
+ return call(callOperation(deps.convexCall, deposits.list, copyInvocationObservation(invocation, {
39530
+ ...actor === void 0 ? {} : { actor },
39531
+ ...options?.cursor === void 0 ? {} : { cursor: options.cursor },
39532
+ ...options?.unmatched === void 0 ? {} : { unmatched: options.unmatched }
39533
+ })), invocation, deposits.list.name);
39534
+ },
39535
+ get: (bankDepositId, options) => {
39536
+ const invocation = controls(options);
39537
+ return call(callOperation(deps.convexCall, deposits.get, copyInvocationObservation(invocation, {
39538
+ ...actor === void 0 ? {} : { actor },
39539
+ bankDepositId
39540
+ })), invocation, deposits.get.name);
39541
+ },
39542
+ candidates: (bankDepositId, options) => {
39543
+ const invocation = controls(options);
39544
+ return call(callOperation(deps.convexCall, deposits.candidates, copyInvocationObservation(invocation, {
39545
+ ...actor === void 0 ? {} : { actor },
39546
+ bankDepositId,
39547
+ ...options?.cursor === void 0 ? {} : { cursor: options.cursor }
39548
+ })), invocation, deposits.candidates.name);
39549
+ },
39550
+ match: (bankDepositId, requestId, options) => {
39551
+ const invocation = controls(options);
39552
+ return call(callOperation(deps.convexCall, deposits.match, copyInvocationObservation(invocation, {
39553
+ ...actor === void 0 ? {} : { actor },
39554
+ bankDepositId,
39555
+ requestId
39556
+ })), invocation, deposits.match.name);
39557
+ }
39558
+ };
39559
+ }
39560
+ const unavailable$1 = () => Promise.resolve({
39561
+ ok: false,
39562
+ error: Errors.notImplemented("banking", "executionComposition")
39563
+ });
39564
+ const makeUnavailableBankDepositMethods = () => ({
39565
+ list: unavailable$1,
39566
+ get: unavailable$1,
39567
+ candidates: unavailable$1,
39568
+ match: unavailable$1
39569
+ });
39570
+ //#endregion
39571
+ //#region ../../packages/sdk/src/banking/bank-details.ts
39572
+ const unavailable = () => Promise.resolve({
39573
+ ok: false,
39574
+ error: Errors.notImplemented("banking", "executionComposition")
39575
+ });
39576
+ function makeBankingMethods(deps, actor) {
39577
+ let journeyId;
39578
+ let actorId;
39579
+ const controls = (options, journey) => {
39580
+ const resolved = deps.invocationControls?.(options) ?? options;
39581
+ if (!journey) return resolved;
39582
+ const snapshot = readInvocationObservation(resolved) ?? { active: true };
39583
+ if (actorId !== snapshot.actorId) journeyId = void 0;
39584
+ actorId = snapshot.actorId;
39585
+ journeyId = options?.journey_id ?? journeyId ?? snapshot.context?.journeyId ?? `bank_details_${crypto.randomUUID()}`;
39586
+ const next = {
39587
+ ...resolved,
39588
+ journey_id: journeyId
39589
+ };
39590
+ const captured = snapshot.active ? withCapturedAttemptContext(snapshot.context, next) : void 0;
39591
+ return attachInvocationObservation(next, {
39592
+ ...snapshot,
39593
+ ...captured === void 0 ? {} : { context: captured }
39594
+ });
39595
+ };
39596
+ const call = (program, options, operation) => runCapxulEffect(program, options, operation, deps.runPromise);
39597
+ return {
39598
+ deposits: makeBankDepositMethods(deps, actor),
39599
+ details: {
39600
+ list: (options) => {
39601
+ const invocation = controls(options, false);
39602
+ return call(callOperation(deps.convexCall, bankDetails.list, copyInvocationObservation(invocation, actor === void 0 ? {} : { actor })), invocation, bankDetails.list.name);
39603
+ },
39604
+ get: (currency, options) => {
39605
+ const invocation = controls(options, false);
39606
+ return call(callOperation(deps.convexCall, bankDetails.get, copyInvocationObservation(invocation, {
39607
+ ...actor === void 0 ? {} : { actor },
39608
+ currency
39609
+ })), invocation, bankDetails.get.name);
39610
+ },
39611
+ open: (currency, options) => {
39612
+ const invocation = controls(options, true);
39613
+ return call(callOperation(deps.convexCall, bankDetails.open, copyInvocationObservation(invocation, {
39614
+ ...actor === void 0 ? {} : { actor },
39615
+ currency
39616
+ })), invocation, bankDetails.open.name);
39617
+ },
39618
+ settle: (currency, token, options) => {
39619
+ const invocation = controls(options, false);
39620
+ return call(callOperation(deps.convexCall, bankDetails.settle, copyInvocationObservation(invocation, {
39621
+ ...actor === void 0 ? {} : { actor },
39622
+ currency,
39623
+ token
39624
+ })), invocation, bankDetails.settle.name);
39625
+ },
39626
+ deactivate: (currency, options) => {
39627
+ const invocation = controls(options, false);
39628
+ return call(callOperation(deps.convexCall, bankDetails.deactivate, copyInvocationObservation(invocation, {
39629
+ ...actor === void 0 ? {} : { actor },
39630
+ currency
39631
+ })), invocation, bankDetails.deactivate.name);
39632
+ },
39633
+ reactivate: (currency, options) => {
39634
+ const invocation = controls(options, false);
39635
+ return call(callOperation(deps.convexCall, bankDetails.reactivate, copyInvocationObservation(invocation, {
39636
+ ...actor === void 0 ? {} : { actor },
39637
+ currency
39638
+ })), invocation, bankDetails.reactivate.name);
39639
+ }
39640
+ }
39641
+ };
39642
+ }
39643
+ function makeUnavailableBankingMethods() {
39644
+ return {
39645
+ deposits: makeUnavailableBankDepositMethods(),
39646
+ details: {
39647
+ list: unavailable,
39648
+ get: unavailable,
39649
+ open: unavailable,
39650
+ settle: unavailable,
39651
+ deactivate: unavailable,
39652
+ reactivate: unavailable
39653
+ }
39654
+ };
39655
+ }
39656
+ //#endregion
38189
39657
  //#region ../../packages/sdk/src/organizations/unavailable-methods.ts
38190
39658
  function makeNotImplementedPermissionMethods() {
38191
39659
  return {
@@ -38204,6 +39672,7 @@ function makeNotImplementedPermissionMethods() {
38204
39672
  }
38205
39673
  function makeNotImplementedOrganizationPaymentsMethods() {
38206
39674
  return {
39675
+ quote: organizationPaymentExecutionUnavailable,
38207
39676
  previewRetry: organizationPaymentExecutionUnavailable,
38208
39677
  list: organizationPaymentExecutionUnavailable,
38209
39678
  get: organizationPaymentExecutionUnavailable,
@@ -38219,6 +39688,12 @@ const orgMeUnavailable = () => Promise.resolve({
38219
39688
  ok: false,
38220
39689
  error: Errors.notImplemented("org", "me")
38221
39690
  });
39691
+ function makeUnavailableVerificationMethods() {
39692
+ return {
39693
+ start: verificationExecutionUnavailable,
39694
+ status: verificationExecutionUnavailable
39695
+ };
39696
+ }
38222
39697
  /**
38223
39698
  * The closed invitation surface for a client with no backend seam. It reports
38224
39699
  * `NOT_IMPLEMENTED` for every method rather than an empty list or a fabricated
@@ -38242,6 +39717,10 @@ const invitationExecutionUnavailable = () => Promise.resolve({
38242
39717
  ok: false,
38243
39718
  error: Errors.notImplemented("invitations", "executionComposition")
38244
39719
  });
39720
+ const verificationExecutionUnavailable = () => Promise.resolve({
39721
+ ok: false,
39722
+ error: Errors.notImplemented("verification", "executionComposition")
39723
+ });
38245
39724
  const permissionExecutionUnavailable = () => Promise.resolve({
38246
39725
  ok: false,
38247
39726
  error: Errors.notImplemented("permissions", "executionComposition")
@@ -38342,6 +39821,7 @@ function makeOrgMethods(deps) {
38342
39821
  error: Errors.notImplemented("invitations", "listOwn")
38343
39822
  }) : makeOwnInvitationsMethod(invitationMethodsDeps(deps, deps.convexCall)) });
38344
39823
  const paymentMethods = /* @__PURE__ */ new Map();
39824
+ const scopedMethods = /* @__PURE__ */ new Map();
38345
39825
  return {
38346
39826
  orgs,
38347
39827
  org(orgId) {
@@ -38351,6 +39831,14 @@ function makeOrgMethods(deps) {
38351
39831
  payments = convexCall === void 0 ? makeNotImplementedOrganizationPaymentsMethods() : makeOrganizationPaymentsMethods(orgMoneyDeps(deps, convexCall), String(orgId));
38352
39832
  paymentMethods.set(orgId, payments);
38353
39833
  }
39834
+ let scoped = scopedMethods.get(orgId);
39835
+ if (scoped === void 0) {
39836
+ scoped = {
39837
+ banking: deps.banking === void 0 ? makeUnavailableBankingMethods() : deps.banking(String(orgId)),
39838
+ verification: deps.verification === void 0 ? makeUnavailableVerificationMethods() : deps.verification(String(orgId))
39839
+ };
39840
+ scopedMethods.set(orgId, scoped);
39841
+ }
38354
39842
  return {
38355
39843
  ...makeActorRelationshipMethods({
38356
39844
  runPromise: deps.runPromise,
@@ -38366,6 +39854,7 @@ function makeOrgMethods(deps) {
38366
39854
  convexCall,
38367
39855
  ...observedRunnerDeps(deps)
38368
39856
  }, String(orgId)),
39857
+ ...scoped,
38369
39858
  setup: {
38370
39859
  get: (options) => invokeSetup(deps.organizationSetup, "get", () => deps.organizationSetup.get(orgId, options)),
38371
39860
  subscribe: (listener, options) => invokeSetup(deps.organizationSetup, "subscribe", () => deps.organizationSetup.subscribe(orgId, listener, options)),
@@ -38625,4 +40114,4 @@ var ConvexOrganizationSetupAdapter = class {
38625
40114
  }
38626
40115
  };
38627
40116
  //#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 };
40117
+ 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 };