@capxul/sdk 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.
- package/README.md +23 -0
- package/dist/{access-B-2qmxF_.mjs → access-l_ci38yt.mjs} +1671 -337
- package/dist/{index-DidkO1aY.d.mts → index-VeQh7FNW.d.mts} +5615 -839
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{organizations-wucUfgJr.mjs → organizations-UEg_C-_v.mjs} +159 -3
- package/dist/{permission-approvals-BLI_uadD.mjs → permission-approvals-vDZJpy8H.mjs} +2 -2
- package/dist/{production-2L76NWS5.mjs → production-BzEOaP6l.mjs} +249 -110
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +2 -2
- package/package.json +5 -4
|
@@ -634,6 +634,9 @@ function decodeUrlComponent(text) {
|
|
|
634
634
|
return text;
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
+
function isCoinbaseRpcPath(hostname, segments) {
|
|
638
|
+
return hostname === "api.developer.coinbase.com" && decodeUrlComponent(segments[1] ?? "") === "rpc" && decodeUrlComponent(segments[2] ?? "") === "v1";
|
|
639
|
+
}
|
|
637
640
|
/** Preserve URL diagnostics while removing credentials from their declared components. */
|
|
638
641
|
function redactUrlSecrets(value, source) {
|
|
639
642
|
try {
|
|
@@ -651,9 +654,10 @@ function redactUrlSecrets(value, source) {
|
|
|
651
654
|
const provider = source === "alchemy" || source === "infura" || /(?:^|\.)(?:alchemy\.com|alchemyapi\.io|infura\.io)$/iu.test(url.hostname);
|
|
652
655
|
const rawPath = absolute || protocolRelative ? url.pathname : value.split(/[?#]/u)[0] ?? "";
|
|
653
656
|
const segments = rawPath.split("/");
|
|
657
|
+
const coinbaseRpc = isCoinbaseRpcPath(url.hostname, segments);
|
|
654
658
|
let path = segments.map((segment, index) => {
|
|
655
659
|
const decoded = decodeUrlComponent(segment);
|
|
656
|
-
const masked = provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
|
|
660
|
+
const masked = (provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) || coinbaseRpc && index === 4) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
|
|
657
661
|
changed ||= masked !== decoded;
|
|
658
662
|
return masked === decoded ? segment : encodeURIComponent(masked);
|
|
659
663
|
}).join("/");
|
|
@@ -2690,6 +2694,8 @@ function isEvmAddress(raw) {
|
|
|
2690
2694
|
const ASSET_ID_RE = /^eip155:([1-9][0-9]*)\/erc20:(0x[0-9a-f]{40})$/;
|
|
2691
2695
|
const CURRENCY_SYMBOLS = {
|
|
2692
2696
|
USD: "$",
|
|
2697
|
+
EUR: "€",
|
|
2698
|
+
GBP: "£",
|
|
2693
2699
|
NGN: "NGN",
|
|
2694
2700
|
GHS: "GHS",
|
|
2695
2701
|
KES: "KSh",
|
|
@@ -2701,6 +2707,16 @@ const CURRENCY_SYMBOLS = {
|
|
|
2701
2707
|
symbol: CURRENCY_SYMBOLS.USD,
|
|
2702
2708
|
name: "US Dollar"
|
|
2703
2709
|
},
|
|
2710
|
+
{
|
|
2711
|
+
code: "EUR",
|
|
2712
|
+
symbol: CURRENCY_SYMBOLS.EUR,
|
|
2713
|
+
name: "Euro"
|
|
2714
|
+
},
|
|
2715
|
+
{
|
|
2716
|
+
code: "GBP",
|
|
2717
|
+
symbol: CURRENCY_SYMBOLS.GBP,
|
|
2718
|
+
name: "British Pound"
|
|
2719
|
+
},
|
|
2704
2720
|
{
|
|
2705
2721
|
code: "NGN",
|
|
2706
2722
|
symbol: CURRENCY_SYMBOLS.NGN,
|
|
@@ -2797,6 +2813,13 @@ const AssetAmountSchema = Schema.Struct({
|
|
|
2797
2813
|
currency: Schema.optional(Schema.Never),
|
|
2798
2814
|
decimals: Schema.optional(Schema.Never)
|
|
2799
2815
|
});
|
|
2816
|
+
/** Fiat value. Currency never selects or aliases an asset. */
|
|
2817
|
+
const MoneySchema = Schema.Struct({
|
|
2818
|
+
currency: CurrencyCodeSchema$1,
|
|
2819
|
+
value: DecimalStringSchema,
|
|
2820
|
+
decimals: Schema.Finite.check(Schema.makeFilter((value) => Number.isSafeInteger(value) && value >= 0 && value <= 255, { message: "must be an integer between 0 and 255" })),
|
|
2821
|
+
asset: Schema.optional(Schema.Never)
|
|
2822
|
+
});
|
|
2800
2823
|
//#endregion
|
|
2801
2824
|
//#region ../protocol/src/primitives/brand-schema.ts
|
|
2802
2825
|
const lowercasedString = Schema.String.pipe(Schema.decodeTo(Schema.String, {
|
|
@@ -2873,6 +2896,46 @@ function decodedBase64Size(value) {
|
|
|
2873
2896
|
}
|
|
2874
2897
|
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" }));
|
|
2875
2898
|
//#endregion
|
|
2899
|
+
//#region ../protocol/src/documents/money-invoice-schema.ts
|
|
2900
|
+
const SIGNATURE_RE$1 = /^0x[0-9a-f]{130}$/;
|
|
2901
|
+
const FiatAmountV3Schema = Schema.Struct({
|
|
2902
|
+
denomination: Schema.Literal(0),
|
|
2903
|
+
currency: CurrencyCodeSchema$1,
|
|
2904
|
+
asset: Schema.Literal(""),
|
|
2905
|
+
minorUnits: Uint256StringSchema$1,
|
|
2906
|
+
decimals: Uint8V3Schema
|
|
2907
|
+
});
|
|
2908
|
+
const MoneyInvoiceEnvelopeV5Schema = Schema.Struct({
|
|
2909
|
+
protocol: Schema.Literal("capxul.payment-document"),
|
|
2910
|
+
version: Schema.Literal(5),
|
|
2911
|
+
domain: Schema.Struct({
|
|
2912
|
+
name: Schema.Literal("CapxulFinancialDocument"),
|
|
2913
|
+
version: Schema.Literal("5"),
|
|
2914
|
+
chainId: ChainIdSchema$1,
|
|
2915
|
+
salt: Schema.Literal("0x7b0fd8a8c3880e03dc03661ad8d3bad2f865203f70562ac8cc01527168b464a3")
|
|
2916
|
+
}),
|
|
2917
|
+
primaryType: Schema.Literal("Invoice"),
|
|
2918
|
+
message: Schema.Struct({
|
|
2919
|
+
kind: Schema.Literal(1),
|
|
2920
|
+
originId: CanonicalBytes32V3Schema,
|
|
2921
|
+
issuedAt: Uint64V3Schema,
|
|
2922
|
+
invoiceNumber: ReferenceV3Schema,
|
|
2923
|
+
payerRef: AssertionV3Schema,
|
|
2924
|
+
payeeRef: AssertionV3Schema,
|
|
2925
|
+
amount: FiatAmountV3Schema,
|
|
2926
|
+
receivingAccountId: ReferenceV3Schema,
|
|
2927
|
+
target: CanonicalAddressV3Schema,
|
|
2928
|
+
dueAt: Uint64V3Schema,
|
|
2929
|
+
lineItemsHash: CanonicalBytes32V3Schema,
|
|
2930
|
+
note: NoteV3Schema,
|
|
2931
|
+
discountMinor: Uint256StringSchema$1
|
|
2932
|
+
}),
|
|
2933
|
+
signature: Schema.optional(Schema.Struct({
|
|
2934
|
+
signer: CanonicalAddressV3Schema,
|
|
2935
|
+
value: Schema.String.pipe(Schema.refine((value) => SIGNATURE_RE$1.test(value)))
|
|
2936
|
+
}))
|
|
2937
|
+
});
|
|
2938
|
+
//#endregion
|
|
2876
2939
|
//#region ../protocol/src/documents/schema.ts
|
|
2877
2940
|
const SIGNATURE_RE = /^0x[0-9a-f]{130}$/;
|
|
2878
2941
|
const PaymentDocumentDomainV3Schema = Schema.Struct({
|
|
@@ -2886,13 +2949,7 @@ const ExactAssetV3Schema = Schema.Struct({
|
|
|
2886
2949
|
minorUnits: Uint256StringSchema$1,
|
|
2887
2950
|
decimals: Uint8V3Schema
|
|
2888
2951
|
});
|
|
2889
|
-
const ReceiptAmountV3Schema = Schema.Union([Schema.Struct({
|
|
2890
|
-
denomination: Schema.Literal(0),
|
|
2891
|
-
currency: CurrencyCodeSchema$1,
|
|
2892
|
-
asset: Schema.Literal(""),
|
|
2893
|
-
minorUnits: Uint256StringSchema$1,
|
|
2894
|
-
decimals: Uint8V3Schema
|
|
2895
|
-
}), Schema.Struct({
|
|
2952
|
+
const ReceiptAmountV3Schema = Schema.Union([FiatAmountV3Schema, Schema.Struct({
|
|
2896
2953
|
denomination: Schema.Literal(1),
|
|
2897
2954
|
currency: Schema.Literal(""),
|
|
2898
2955
|
asset: AssetIdSchema,
|
|
@@ -3010,7 +3067,11 @@ const InvoiceEnvelopeV4Schema = Schema.Struct({
|
|
|
3010
3067
|
}),
|
|
3011
3068
|
signature: Schema.optional(SignatureV3Schema)
|
|
3012
3069
|
});
|
|
3013
|
-
const SupportedPaymentDocumentEnvelopeSchema = Schema.Union([
|
|
3070
|
+
const SupportedPaymentDocumentEnvelopeSchema = Schema.Union([
|
|
3071
|
+
PaymentDocumentEnvelopeV3Schema,
|
|
3072
|
+
InvoiceEnvelopeV4Schema,
|
|
3073
|
+
MoneyInvoiceEnvelopeV5Schema
|
|
3074
|
+
]);
|
|
3014
3075
|
//#endregion
|
|
3015
3076
|
//#region ../protocol/src/documents/read-schema.ts
|
|
3016
3077
|
const DocumentRefV3Schema = Schema.Struct({
|
|
@@ -3025,6 +3086,7 @@ const DocumentRefV3Schema = Schema.Struct({
|
|
|
3025
3086
|
format: Schema.Literals([
|
|
3026
3087
|
"envelope-v3",
|
|
3027
3088
|
"envelope-v4",
|
|
3089
|
+
"envelope-v5",
|
|
3028
3090
|
"artifact"
|
|
3029
3091
|
]),
|
|
3030
3092
|
role: Schema.Literals([
|
|
@@ -3034,6 +3096,13 @@ const DocumentRefV3Schema = Schema.Struct({
|
|
|
3034
3096
|
]),
|
|
3035
3097
|
issuedAt: Schema.NullOr(Uint64V3Schema)
|
|
3036
3098
|
});
|
|
3099
|
+
function paymentDocumentEnvelopeFormat(envelope) {
|
|
3100
|
+
switch (envelope.version) {
|
|
3101
|
+
case 3: return "envelope-v3";
|
|
3102
|
+
case 4: return "envelope-v4";
|
|
3103
|
+
case 5: return "envelope-v5";
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3037
3106
|
const PaymentDocumentReadRefSchema = Schema.Struct({
|
|
3038
3107
|
documentHash: CanonicalBytes32V3Schema,
|
|
3039
3108
|
contentHash: CanonicalBytes32V3Schema
|
|
@@ -3139,22 +3208,32 @@ const OrganizationActorRefSchema = Schema.Struct({
|
|
|
3139
3208
|
orgId: nonEmpty("orgId")
|
|
3140
3209
|
});
|
|
3141
3210
|
const ActorRefSchema = Schema.Union([AccountActorRefSchema, OrganizationActorRefSchema]);
|
|
3211
|
+
const PartyAccountRefSchema$1 = Schema.Struct({
|
|
3212
|
+
kind: Schema.Literal("party_account"),
|
|
3213
|
+
partyAccountId: nonEmpty("partyAccountId")
|
|
3214
|
+
});
|
|
3142
3215
|
const hasActorBoundPermission = (actor, orgId, permissionId) => actor.kind === "organization" ? orgId === actor.orgId && permissionId !== void 0 : orgId === void 0 && permissionId === void 0;
|
|
3143
|
-
const ActorOrDestinationRefSchema = Schema.Union([
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3216
|
+
const ActorOrDestinationRefSchema = Schema.Union([
|
|
3217
|
+
ActorRefSchema,
|
|
3218
|
+
Schema.Struct({
|
|
3219
|
+
kind: Schema.Literal("destination"),
|
|
3220
|
+
destinationId: nonEmpty("destinationId")
|
|
3221
|
+
}),
|
|
3222
|
+
PartyAccountRefSchema$1
|
|
3223
|
+
]);
|
|
3147
3224
|
const RecipientObservationSchema = Schema.Struct({
|
|
3148
3225
|
recipient_locator_kind: Schema.Literals([
|
|
3149
3226
|
"handle",
|
|
3150
3227
|
"email",
|
|
3151
3228
|
"party",
|
|
3152
|
-
"address"
|
|
3229
|
+
"address",
|
|
3230
|
+
"party_account"
|
|
3153
3231
|
]),
|
|
3154
3232
|
recipient_resolution_status: Schema.Literals([
|
|
3155
3233
|
"known_party",
|
|
3156
3234
|
"new_email",
|
|
3157
|
-
"external_address"
|
|
3235
|
+
"external_address",
|
|
3236
|
+
"bank_account"
|
|
3158
3237
|
]),
|
|
3159
3238
|
recipient_is_capxul_account: Schema.Boolean,
|
|
3160
3239
|
recipient_party_id: Schema.optional(Schema.String),
|
|
@@ -3165,6 +3244,7 @@ const RecipientObservationSchema = Schema.Struct({
|
|
|
3165
3244
|
])),
|
|
3166
3245
|
recipient_handle: Schema.optional(Schema.String),
|
|
3167
3246
|
recipient_address: AddressSchema$1,
|
|
3247
|
+
party_account_id: Schema.optional(Schema.String),
|
|
3168
3248
|
external_address_acknowledged: Schema.Boolean
|
|
3169
3249
|
});
|
|
3170
3250
|
//#endregion
|
|
@@ -3340,7 +3420,7 @@ const PartySchema = Schema.Struct({
|
|
|
3340
3420
|
status: Schema.Literals(["provisional", "claimed"]),
|
|
3341
3421
|
displayName: Schema.NullOr(Schema.String),
|
|
3342
3422
|
handle: Schema.NullOr(Schema.String),
|
|
3343
|
-
safeAddress: Schema.String
|
|
3423
|
+
safeAddress: Schema.optionalKey(Schema.String)
|
|
3344
3424
|
});
|
|
3345
3425
|
//#endregion
|
|
3346
3426
|
//#region ../protocol/src/time/schema.ts
|
|
@@ -3358,6 +3438,7 @@ const DurationMsSchema$1 = Schema.Finite.pipe(Schema.refine((n) => Number.isSafe
|
|
|
3358
3438
|
const PAYMENT_STATUSES = [
|
|
3359
3439
|
"pending",
|
|
3360
3440
|
"settling",
|
|
3441
|
+
"in_transit",
|
|
3361
3442
|
"unresolved",
|
|
3362
3443
|
"scheduled",
|
|
3363
3444
|
"streaming",
|
|
@@ -3426,14 +3507,22 @@ const PAYMENT_TYPE_FOR_DOCUMENT_KIND = {
|
|
|
3426
3507
|
function paymentTypeForDocumentKind(kind) {
|
|
3427
3508
|
return PAYMENT_TYPE_FOR_DOCUMENT_KIND[kind];
|
|
3428
3509
|
}
|
|
3429
|
-
const PaymentRecipient = Schema.Union([
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3510
|
+
const PaymentRecipient = Schema.Union([
|
|
3511
|
+
Schema.Struct({
|
|
3512
|
+
kind: Schema.Literal("party"),
|
|
3513
|
+
partyId: PartyIdSchema,
|
|
3514
|
+
label: Schema.String
|
|
3515
|
+
}),
|
|
3516
|
+
Schema.Struct({
|
|
3517
|
+
kind: Schema.Literal("external_address"),
|
|
3518
|
+
label: Schema.String
|
|
3519
|
+
}),
|
|
3520
|
+
Schema.Struct({
|
|
3521
|
+
kind: Schema.Literal("party_account"),
|
|
3522
|
+
partyAccountId: Schema.String,
|
|
3523
|
+
label: Schema.String
|
|
3524
|
+
})
|
|
3525
|
+
]);
|
|
3437
3526
|
/** When a Payment's money is released: now, at one time, or streamed over a window. */
|
|
3438
3527
|
const PaymentTiming = Schema.Union([
|
|
3439
3528
|
Schema.Struct({ kind: Schema.Literal("instant") }),
|
|
@@ -3465,7 +3554,8 @@ const PaymentRef = Schema.Union([
|
|
|
3465
3554
|
Schema.Struct({
|
|
3466
3555
|
kind: Schema.Literal("party"),
|
|
3467
3556
|
partyId: PartyIdSchema
|
|
3468
|
-
})
|
|
3557
|
+
}),
|
|
3558
|
+
PartyAccountRefSchema$1
|
|
3469
3559
|
]);
|
|
3470
3560
|
/** One Payment as a participant reads it. */
|
|
3471
3561
|
const Payment = Schema.Struct({
|
|
@@ -3494,9 +3584,27 @@ const Payment = Schema.Struct({
|
|
|
3494
3584
|
retryRequired: Schema.Boolean,
|
|
3495
3585
|
notSent: Schema.optionalKey(Schema.Literal(true))
|
|
3496
3586
|
})),
|
|
3587
|
+
requestedOutput: Schema.optionalKey(MoneySchema),
|
|
3588
|
+
outputExact: Schema.optionalKey(Schema.Boolean),
|
|
3589
|
+
recipientOnCapxul: Schema.optionalKey(Schema.Boolean),
|
|
3590
|
+
recipientWarning: Schema.optionalKey(Schema.Boolean),
|
|
3591
|
+
legs: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
3592
|
+
kind: Schema.Literals(["funding", "delivery"]),
|
|
3593
|
+
state: Schema.Literals([
|
|
3594
|
+
"pending",
|
|
3595
|
+
"done",
|
|
3596
|
+
"failed",
|
|
3597
|
+
"refunded"
|
|
3598
|
+
])
|
|
3599
|
+
}))),
|
|
3600
|
+
links: Schema.optionalKey(Schema.Struct({
|
|
3601
|
+
quoteId: Schema.String,
|
|
3602
|
+
railOperationId: Schema.String,
|
|
3603
|
+
refundMovementId: Schema.optionalKey(Schema.String)
|
|
3604
|
+
})),
|
|
3497
3605
|
createdAt: EpochMsSchema$1,
|
|
3498
3606
|
updatedAt: EpochMsSchema$1
|
|
3499
|
-
}).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" })));
|
|
3607
|
+
}).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" })));
|
|
3500
3608
|
//#endregion
|
|
3501
3609
|
//#region ../protocol/src/payments/model.ts
|
|
3502
3610
|
function toPaymentId(raw) {
|
|
@@ -3577,7 +3685,11 @@ const ActivityItemSchema = Schema.Union([Schema.Struct({
|
|
|
3577
3685
|
}), Schema.Struct({
|
|
3578
3686
|
kind: Schema.Literal("movement"),
|
|
3579
3687
|
id: Schema.String,
|
|
3580
|
-
classification: Schema.Literals([
|
|
3688
|
+
classification: Schema.Literals([
|
|
3689
|
+
"deposit",
|
|
3690
|
+
"refund",
|
|
3691
|
+
"movement_only_outflow"
|
|
3692
|
+
]),
|
|
3581
3693
|
amount: Amount,
|
|
3582
3694
|
direction: Direction,
|
|
3583
3695
|
counterpartyLabel: Schema.String,
|
|
@@ -3737,7 +3849,7 @@ const ActivityOverlaySchema = Schema.Struct({
|
|
|
3737
3849
|
* cursor, limit or window, a scope the caller does not take part in, or a
|
|
3738
3850
|
* signed-in user whose Account is not ready.
|
|
3739
3851
|
*/
|
|
3740
|
-
const READ = [
|
|
3852
|
+
const READ$1 = [
|
|
3741
3853
|
"NOT_AUTHENTICATED",
|
|
3742
3854
|
"INVALID_INPUT",
|
|
3743
3855
|
...DEFECTS
|
|
@@ -3754,7 +3866,7 @@ const items = {
|
|
|
3754
3866
|
filter: Schema.optionalKey(ActivityFilterSchema)
|
|
3755
3867
|
}),
|
|
3756
3868
|
output: ActivityPageSchema,
|
|
3757
|
-
errors: READ
|
|
3869
|
+
errors: READ$1
|
|
3758
3870
|
}),
|
|
3759
3871
|
/** Per-asset totals and the row count over one window of the actor's activity. */
|
|
3760
3872
|
summary: Operation.query("activity.items.summary", {
|
|
@@ -3763,7 +3875,7 @@ const items = {
|
|
|
3763
3875
|
window: Schema.optionalKey(ActivityRangeSchema)
|
|
3764
3876
|
}),
|
|
3765
3877
|
output: ActivitySummarySchema,
|
|
3766
|
-
errors: READ
|
|
3878
|
+
errors: READ$1
|
|
3767
3879
|
}),
|
|
3768
3880
|
/** One row's exact detail and the reader's annotation; null when the caller cannot read it. */
|
|
3769
3881
|
get: Operation.query("activity.items.get", {
|
|
@@ -3772,7 +3884,7 @@ const items = {
|
|
|
3772
3884
|
actor: Schema.optionalKey(ActivityGetActorSchema)
|
|
3773
3885
|
}),
|
|
3774
3886
|
output: Schema.NullOr(ActivityDetailSchema),
|
|
3775
|
-
errors: READ
|
|
3887
|
+
errors: READ$1
|
|
3776
3888
|
})
|
|
3777
3889
|
};
|
|
3778
3890
|
const annotations = {
|
|
@@ -3791,7 +3903,7 @@ save: Operation.mutation("activity.annotations.save", {
|
|
|
3791
3903
|
output: ActivityAnnotationSchema,
|
|
3792
3904
|
/** An Organization's annotation also needs the caller's exact Account, Safe and command authority. */
|
|
3793
3905
|
errors: [
|
|
3794
|
-
...READ,
|
|
3906
|
+
...READ$1,
|
|
3795
3907
|
"ROLE_PERMISSION_DENIED",
|
|
3796
3908
|
"ACCOUNT_NOT_FOUND",
|
|
3797
3909
|
"SMART_ACCOUNT_MISSING"
|
|
@@ -3806,7 +3918,7 @@ get: Operation.query("activity.overlays.get", {
|
|
|
3806
3918
|
settlementIds: Schema.optionalKey(Schema.Array(Schema.String))
|
|
3807
3919
|
}),
|
|
3808
3920
|
output: ActivityOverlaySchema,
|
|
3809
|
-
errors: READ
|
|
3921
|
+
errors: READ$1
|
|
3810
3922
|
}) };
|
|
3811
3923
|
/** A document read: no session, or a pair the caller may not read or that fails its integrity. */
|
|
3812
3924
|
const DOCUMENT = [
|
|
@@ -3835,6 +3947,272 @@ const documents = {
|
|
|
3835
3947
|
})
|
|
3836
3948
|
};
|
|
3837
3949
|
//#endregion
|
|
3950
|
+
//#region ../protocol/src/parties/verification-schema.ts
|
|
3951
|
+
const VERIFICATION_DOCUMENT_FIELDS = [
|
|
3952
|
+
"id_front",
|
|
3953
|
+
"id_back",
|
|
3954
|
+
"proof_of_address",
|
|
3955
|
+
"business_formation",
|
|
3956
|
+
"ownership_information",
|
|
3957
|
+
"proof_of_nature_of_business",
|
|
3958
|
+
"evidence_of_good_standing",
|
|
3959
|
+
"flow_of_funds",
|
|
3960
|
+
"proof_of_signatory_authority"
|
|
3961
|
+
];
|
|
3962
|
+
const VerificationStateSchema = Schema.Literals([
|
|
3963
|
+
"not_started",
|
|
3964
|
+
"in_progress",
|
|
3965
|
+
"submitted",
|
|
3966
|
+
"needs_more",
|
|
3967
|
+
"liveness_needed",
|
|
3968
|
+
"under_review",
|
|
3969
|
+
"approved",
|
|
3970
|
+
"rejected",
|
|
3971
|
+
"restricted"
|
|
3972
|
+
]);
|
|
3973
|
+
const VerificationQuestionSchema = Schema.Struct({
|
|
3974
|
+
id: Schema.String,
|
|
3975
|
+
label: Schema.String,
|
|
3976
|
+
type: Schema.Literals([
|
|
3977
|
+
"text",
|
|
3978
|
+
"date",
|
|
3979
|
+
"choice",
|
|
3980
|
+
"boolean",
|
|
3981
|
+
"file"
|
|
3982
|
+
]),
|
|
3983
|
+
secret: Schema.Boolean,
|
|
3984
|
+
multiple: Schema.optionalKey(Schema.Boolean),
|
|
3985
|
+
when: Schema.optionalKey(Schema.Struct({
|
|
3986
|
+
field: Schema.String,
|
|
3987
|
+
equals: Schema.Union([Schema.String, Schema.Boolean])
|
|
3988
|
+
})),
|
|
3989
|
+
choices: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
3990
|
+
value: Schema.String,
|
|
3991
|
+
label: Schema.String
|
|
3992
|
+
}))),
|
|
3993
|
+
help: Schema.optionalKey(Schema.String)
|
|
3994
|
+
});
|
|
3995
|
+
const VerificationCurrencySchema = Schema.Struct({
|
|
3996
|
+
currency: Schema.Literals([
|
|
3997
|
+
"usd",
|
|
3998
|
+
"eur",
|
|
3999
|
+
"gbp"
|
|
4000
|
+
]),
|
|
4001
|
+
status: Schema.Literals([
|
|
4002
|
+
"pending",
|
|
4003
|
+
"approved",
|
|
4004
|
+
"needs_more",
|
|
4005
|
+
"rejected",
|
|
4006
|
+
"restricted"
|
|
4007
|
+
])
|
|
4008
|
+
});
|
|
4009
|
+
const Common = {
|
|
4010
|
+
invitationId: Schema.optionalKey(Schema.String),
|
|
4011
|
+
businessStatus: Schema.optionalKey(Schema.Literals([
|
|
4012
|
+
"waiting_people",
|
|
4013
|
+
"in_review",
|
|
4014
|
+
"approved",
|
|
4015
|
+
"rejected",
|
|
4016
|
+
"restricted"
|
|
4017
|
+
])),
|
|
4018
|
+
subjectKind: Schema.optionalKey(Schema.Literals([
|
|
4019
|
+
"person",
|
|
4020
|
+
"business",
|
|
4021
|
+
"business_person"
|
|
4022
|
+
])),
|
|
4023
|
+
organization: Schema.optionalKey(Schema.Struct({
|
|
4024
|
+
id: Schema.String,
|
|
4025
|
+
name: Schema.String
|
|
4026
|
+
})),
|
|
4027
|
+
journeyId: Schema.String,
|
|
4028
|
+
currencies: Schema.Array(VerificationCurrencySchema),
|
|
4029
|
+
next: Schema.Struct({ argv: Schema.Array(Schema.String) })
|
|
4030
|
+
};
|
|
4031
|
+
const VerificationStatusSchema = Schema.Union([
|
|
4032
|
+
Schema.Struct({
|
|
4033
|
+
status: Schema.Literal("not_started"),
|
|
4034
|
+
...Common
|
|
4035
|
+
}),
|
|
4036
|
+
Schema.Struct({
|
|
4037
|
+
status: Schema.Literal("waiting_people"),
|
|
4038
|
+
missingRoles: Schema.Array(Schema.Literals(["control", "signer"])),
|
|
4039
|
+
people: Schema.Array(Schema.Struct({
|
|
4040
|
+
invitationId: Schema.String,
|
|
4041
|
+
name: Schema.String,
|
|
4042
|
+
email: Schema.String,
|
|
4043
|
+
self: Schema.Boolean,
|
|
4044
|
+
status: Schema.Literals([
|
|
4045
|
+
"invited",
|
|
4046
|
+
"submitted",
|
|
4047
|
+
"needs_more"
|
|
4048
|
+
]),
|
|
4049
|
+
delivery: Schema.Literals([
|
|
4050
|
+
"pending",
|
|
4051
|
+
"sent",
|
|
4052
|
+
"failed"
|
|
4053
|
+
])
|
|
4054
|
+
})),
|
|
4055
|
+
...Common
|
|
4056
|
+
}),
|
|
4057
|
+
Schema.Struct({
|
|
4058
|
+
status: Schema.Literal("needs_person"),
|
|
4059
|
+
action: Schema.Literals(["accept_terms", "liveness_check"]),
|
|
4060
|
+
url: Schema.String,
|
|
4061
|
+
...Common
|
|
4062
|
+
}),
|
|
4063
|
+
Schema.Struct({
|
|
4064
|
+
status: Schema.Literal("needs_answers"),
|
|
4065
|
+
questions: Schema.Array(VerificationQuestionSchema),
|
|
4066
|
+
completed: Schema.Array(Schema.Literals([
|
|
4067
|
+
"personal_details",
|
|
4068
|
+
"address",
|
|
4069
|
+
"id"
|
|
4070
|
+
])),
|
|
4071
|
+
issues: Schema.Array(Schema.Struct({
|
|
4072
|
+
fieldId: Schema.String,
|
|
4073
|
+
message: Schema.String
|
|
4074
|
+
})),
|
|
4075
|
+
alternative: Schema.optionalKey(Schema.Struct({
|
|
4076
|
+
action: Schema.Literal("liveness_check"),
|
|
4077
|
+
url: Schema.String
|
|
4078
|
+
})),
|
|
4079
|
+
...Common
|
|
4080
|
+
}),
|
|
4081
|
+
Schema.Struct({
|
|
4082
|
+
status: Schema.Literals([
|
|
4083
|
+
"in_review",
|
|
4084
|
+
"approved",
|
|
4085
|
+
"rejected",
|
|
4086
|
+
"restricted"
|
|
4087
|
+
]),
|
|
4088
|
+
...Common
|
|
4089
|
+
})
|
|
4090
|
+
]);
|
|
4091
|
+
//#endregion
|
|
4092
|
+
//#region ../protocol/src/banking/schema.ts
|
|
4093
|
+
const BankCurrencySchema = Schema.Literals([
|
|
4094
|
+
"usd",
|
|
4095
|
+
"eur",
|
|
4096
|
+
"gbp"
|
|
4097
|
+
]);
|
|
4098
|
+
const SettlementTokenSchema = Schema.Literals(["usdc", "eurc"]);
|
|
4099
|
+
const BankDetailsStateSchema = Schema.Literals([
|
|
4100
|
+
"requested",
|
|
4101
|
+
"active",
|
|
4102
|
+
"deactivated",
|
|
4103
|
+
"closed",
|
|
4104
|
+
"failed"
|
|
4105
|
+
]);
|
|
4106
|
+
const optionalText$1 = Schema.optionalKey(Schema.String);
|
|
4107
|
+
/** List values are masked. Only an explicit single-currency read reveals these fields. */
|
|
4108
|
+
const BankDetailsFieldsSchema = Schema.Struct({
|
|
4109
|
+
routingNumber: optionalText$1,
|
|
4110
|
+
accountNumber: optionalText$1,
|
|
4111
|
+
iban: optionalText$1,
|
|
4112
|
+
bic: optionalText$1,
|
|
4113
|
+
sortCode: optionalText$1
|
|
4114
|
+
});
|
|
4115
|
+
const BankDetailsSchema = Schema.Struct({
|
|
4116
|
+
receivingAccountId: Schema.String,
|
|
4117
|
+
currency: BankCurrencySchema,
|
|
4118
|
+
state: BankDetailsStateSchema,
|
|
4119
|
+
visibility: Schema.Literals(["masked", "full"]),
|
|
4120
|
+
bankName: optionalText$1,
|
|
4121
|
+
accountHolder: optionalText$1,
|
|
4122
|
+
bankAddress: optionalText$1,
|
|
4123
|
+
paymentRails: Schema.Array(Schema.String),
|
|
4124
|
+
fields: BankDetailsFieldsSchema,
|
|
4125
|
+
destination: Schema.Struct({
|
|
4126
|
+
chainId: Schema.Finite,
|
|
4127
|
+
token: SettlementTokenSchema,
|
|
4128
|
+
address: Schema.String
|
|
4129
|
+
}),
|
|
4130
|
+
developerFeePercent: optionalText$1,
|
|
4131
|
+
minimumDeposit: optionalText$1,
|
|
4132
|
+
notice: optionalText$1
|
|
4133
|
+
});
|
|
4134
|
+
const BankDetailsOverviewSchema = Schema.Struct({
|
|
4135
|
+
accounts: Schema.Array(BankDetailsSchema),
|
|
4136
|
+
verification: Schema.Array(VerificationCurrencySchema)
|
|
4137
|
+
});
|
|
4138
|
+
/** Gross bank money and the net token credit are separate amounts. */
|
|
4139
|
+
const BankDepositSchema = Schema.Struct({
|
|
4140
|
+
bankDepositId: Schema.String,
|
|
4141
|
+
receivingAccountId: Schema.String,
|
|
4142
|
+
currency: BankCurrencySchema,
|
|
4143
|
+
amount: Schema.String,
|
|
4144
|
+
receivedAt: EpochMsSchema$1,
|
|
4145
|
+
sender: optionalText$1,
|
|
4146
|
+
reference: optionalText$1,
|
|
4147
|
+
status: Schema.Literals([
|
|
4148
|
+
"processing",
|
|
4149
|
+
"arriving",
|
|
4150
|
+
"credited",
|
|
4151
|
+
"returned",
|
|
4152
|
+
"below_minimum"
|
|
4153
|
+
]),
|
|
4154
|
+
refundState: Schema.optionalKey(Schema.Literals([
|
|
4155
|
+
"in_flight",
|
|
4156
|
+
"done",
|
|
4157
|
+
"failed"
|
|
4158
|
+
])),
|
|
4159
|
+
credit: Schema.optionalKey(Schema.Struct({
|
|
4160
|
+
amount: AssetAmountSchema,
|
|
4161
|
+
symbol: Schema.Literals(["USDC", "EURC"]),
|
|
4162
|
+
chainId: Schema.Finite,
|
|
4163
|
+
transactionHash: Schema.String,
|
|
4164
|
+
movementId: Schema.String
|
|
4165
|
+
})),
|
|
4166
|
+
match: Schema.optionalKey(Schema.Union([Schema.Struct({
|
|
4167
|
+
kind: Schema.Literal("request"),
|
|
4168
|
+
requestId: Schema.String,
|
|
4169
|
+
reference: Schema.String,
|
|
4170
|
+
how: Schema.Literals(["reference", "manual"])
|
|
4171
|
+
}), Schema.Struct({ kind: Schema.Literal("not_request") })]))
|
|
4172
|
+
});
|
|
4173
|
+
const BankDepositsPageSchema = pageOf(BankDepositSchema);
|
|
4174
|
+
const BankDepositCandidatesPageSchema = pageOf(Schema.Struct({
|
|
4175
|
+
requestId: Schema.String,
|
|
4176
|
+
reference: Schema.String,
|
|
4177
|
+
amount: Schema.Union([AssetAmountSchema, MoneySchema]),
|
|
4178
|
+
dueAt: EpochMsSchema$1,
|
|
4179
|
+
payerPartyId: optionalText$1,
|
|
4180
|
+
payerLabel: optionalText$1
|
|
4181
|
+
}));
|
|
4182
|
+
//#endregion
|
|
4183
|
+
//#region ../protocol/src/payments/payout-schema.ts
|
|
4184
|
+
const PartyAccountRefSchema = Schema.Struct({
|
|
4185
|
+
kind: Schema.Literal("party_account"),
|
|
4186
|
+
partyAccountId: nonEmpty("partyAccountId")
|
|
4187
|
+
});
|
|
4188
|
+
const PaymentQuoteInputSchema = Schema.Struct({
|
|
4189
|
+
actor: Schema.optionalKey(ActorScopeSchema),
|
|
4190
|
+
to: PartyAccountRefSchema,
|
|
4191
|
+
amount: Schema.Union([MoneySchema, AssetAmountSchema]),
|
|
4192
|
+
asset: Schema.optionalKey(AssetIdSchema),
|
|
4193
|
+
requestKey: nonEmpty("requestKey")
|
|
4194
|
+
});
|
|
4195
|
+
const PaymentQuoteSchema = Schema.Struct({
|
|
4196
|
+
quoteId: nonEmpty("quoteId"),
|
|
4197
|
+
partyAccountId: nonEmpty("partyAccountId"),
|
|
4198
|
+
requestedOutput: MoneySchema,
|
|
4199
|
+
outputExact: Schema.Boolean,
|
|
4200
|
+
funding: AssetAmountSchema,
|
|
4201
|
+
expiresAt: Schema.Finite,
|
|
4202
|
+
recipient: Schema.Struct({
|
|
4203
|
+
label: Schema.String,
|
|
4204
|
+
bankName: Schema.optionalKey(Schema.String),
|
|
4205
|
+
last4: Schema.String,
|
|
4206
|
+
currency: BankCurrencySchema,
|
|
4207
|
+
onCapxul: Schema.Boolean
|
|
4208
|
+
}),
|
|
4209
|
+
rate: Schema.optionalKey(DecimalStringSchema),
|
|
4210
|
+
warnings: Schema.Array(Schema.Struct({
|
|
4211
|
+
code: Schema.Literal("RECIPIENT_ON_CAPXUL"),
|
|
4212
|
+
message: Schema.String
|
|
4213
|
+
}))
|
|
4214
|
+
});
|
|
4215
|
+
//#endregion
|
|
3838
4216
|
//#region ../protocol/src/permissions/value-schema.ts
|
|
3839
4217
|
const PermissionIdSchema = nonEmpty("permissionId").pipe(Schema.refine((value) => value.length > 0));
|
|
3840
4218
|
const PermissionAssignmentIdSchema = nonEmpty("permissionAssignmentId").pipe(Schema.refine((value) => value.length > 0));
|
|
@@ -3876,6 +4254,7 @@ const MovementSchema = Schema.Struct({
|
|
|
3876
4254
|
const MovementClassificationSchema = Schema.Literals([
|
|
3877
4255
|
"protocol_settlement",
|
|
3878
4256
|
"deposit",
|
|
4257
|
+
"refund",
|
|
3879
4258
|
"movement_only_outflow"
|
|
3880
4259
|
]);
|
|
3881
4260
|
const MovementAttributionSchema = Schema.Struct({
|
|
@@ -4275,7 +4654,16 @@ const PaymentLedgerRecordSchema = Schema.Union([Schema.Struct({
|
|
|
4275
4654
|
settlementLogIndex: Schema.optional(LogIndexSchema),
|
|
4276
4655
|
settledBlockNumber: Schema.optional(BlockNumberSchema$1),
|
|
4277
4656
|
settledBlockHash: Schema.optional(Bytes32Schema),
|
|
4278
|
-
settledEventLogIndex: Schema.optional(LogIndexSchema)
|
|
4657
|
+
settledEventLogIndex: Schema.optional(LogIndexSchema),
|
|
4658
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
4659
|
+
railOperationId: Schema.optional(nonEmpty("railOperationId")),
|
|
4660
|
+
payoutRecipientLabel: Schema.optional(Schema.String),
|
|
4661
|
+
payoutRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
4662
|
+
payoutWarnRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
4663
|
+
payoutOwnerPartyId: Schema.optional(Schema.String),
|
|
4664
|
+
requestedOutput: Schema.optional(MoneySchema),
|
|
4665
|
+
payoutOutputExact: Schema.optional(Schema.Boolean),
|
|
4666
|
+
refundMovementId: Schema.optional(MovementIdSchema)
|
|
4279
4667
|
}), Schema.Struct({
|
|
4280
4668
|
...PaymentLedgerBaseSchema.fields,
|
|
4281
4669
|
ledgerKind: Schema.Literal("Deposit"),
|
|
@@ -4284,7 +4672,7 @@ const PaymentLedgerRecordSchema = Schema.Union([Schema.Struct({
|
|
|
4284
4672
|
documentHash: Schema.optional(Schema.Never),
|
|
4285
4673
|
permissionId: Schema.optional(Schema.Never),
|
|
4286
4674
|
purposeKind: Schema.optional(Schema.Never)
|
|
4287
|
-
})]).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" }));
|
|
4675
|
+
})]).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" }));
|
|
4288
4676
|
const PaymentCoreErrorSchema = Schema.Union([
|
|
4289
4677
|
Schema.Struct({
|
|
4290
4678
|
code: Schema.Literal("INVALID_TRANSITION"),
|
|
@@ -4335,8 +4723,16 @@ const ProtocolBirthInputSchema = Schema.Struct({
|
|
|
4335
4723
|
documentHash: NonzeroDocumentHashSchema,
|
|
4336
4724
|
documentContentHash: NonzeroDocumentHashSchema,
|
|
4337
4725
|
release: ReleaseTermsSchema,
|
|
4726
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
4727
|
+
railOperationId: Schema.optional(nonEmpty("railOperationId")),
|
|
4728
|
+
payoutRecipientLabel: Schema.optional(Schema.String),
|
|
4729
|
+
payoutRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
4730
|
+
payoutWarnRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
4731
|
+
payoutOwnerPartyId: Schema.optional(Schema.String),
|
|
4732
|
+
requestedOutput: Schema.optional(MoneySchema),
|
|
4733
|
+
payoutOutputExact: Schema.optional(Schema.Boolean),
|
|
4338
4734
|
lineage: Schema.optional(PaymentCommandLineageSchema)
|
|
4339
|
-
}).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" }));
|
|
4735
|
+
}).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" }));
|
|
4340
4736
|
const ApplyVerifiedEvidenceCommandSchema = Schema.Struct({
|
|
4341
4737
|
kind: Schema.Literal("apply_verified_evidence"),
|
|
4342
4738
|
paymentId: PaymentIdSchema,
|
|
@@ -4361,7 +4757,11 @@ Schema.Union([
|
|
|
4361
4757
|
paymentIds: Schema.Array(PaymentIdSchema),
|
|
4362
4758
|
userOpHash: Bytes32Schema
|
|
4363
4759
|
}),
|
|
4364
|
-
ApplyVerifiedEvidenceCommandSchema
|
|
4760
|
+
ApplyVerifiedEvidenceCommandSchema,
|
|
4761
|
+
Schema.Struct({
|
|
4762
|
+
kind: Schema.Literal("apply_rail_delivery"),
|
|
4763
|
+
paymentId: PaymentIdSchema
|
|
4764
|
+
})
|
|
4365
4765
|
]);
|
|
4366
4766
|
Schema.Union([
|
|
4367
4767
|
Schema.Struct({
|
|
@@ -4437,12 +4837,11 @@ function paymentDocumentOptionsPayloadSize(options) {
|
|
|
4437
4837
|
}
|
|
4438
4838
|
const PaymentDocumentOptionsSchema = PaymentDocumentOptionsFieldsSchema.check(Schema.makeFilter((options) => paymentDocumentOptionsPayloadSize(options) <= 524288));
|
|
4439
4839
|
const PaymentDocumentOptionsBatchSchema = Schema.Array(PaymentDocumentOptionsSchema).check(Schema.makeFilter((options) => options.length <= 100 && options.reduce((total, itemOptions) => total + paymentDocumentOptionsPayloadSize(itemOptions), 0) <= 524288));
|
|
4440
|
-
//#endregion
|
|
4441
|
-
//#region ../protocol/src/payments/schema/commands.ts
|
|
4442
4840
|
const PaymentBirthItemSchema = Schema.Union([Schema.Struct({
|
|
4443
4841
|
operation: Schema.Literal("send"),
|
|
4444
4842
|
recipient: ActorOrDestinationRefSchema,
|
|
4445
4843
|
amount: AssetAmountSchema,
|
|
4844
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
4446
4845
|
purposeKind: PaymentPurposeKindSchema,
|
|
4447
4846
|
document: Schema.optional(PaymentInstructionInputSchema),
|
|
4448
4847
|
supportingReceipts: Schema.optional(Schema.Array(SupportingReceiptInputSchema)),
|
|
@@ -4462,12 +4861,13 @@ const PaymentBirthItemSchema = Schema.Union([Schema.Struct({
|
|
|
4462
4861
|
operation: Schema.Literal("create_commitment"),
|
|
4463
4862
|
recipient: ActorOrDestinationRefSchema,
|
|
4464
4863
|
amount: AssetAmountSchema,
|
|
4864
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
4465
4865
|
release: ReleaseTermsSchema.pipe(Schema.refine((release) => release.kind === "scheduled" || release.kind === "stream", { message: "Commitment release must be scheduled or stream" })),
|
|
4466
4866
|
purposeKind: PaymentPurposeKindSchema,
|
|
4467
4867
|
document: Schema.optional(PaymentInstructionInputSchema),
|
|
4468
4868
|
supportingReceipts: Schema.optional(Schema.Array(SupportingReceiptInputSchema)),
|
|
4469
4869
|
payroll: Schema.optional(Schema.Never)
|
|
4470
|
-
})]);
|
|
4870
|
+
})]).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" }));
|
|
4471
4871
|
const PaymentBirthCommandSchema = Schema.Struct({
|
|
4472
4872
|
kind: Schema.Literal("birth"),
|
|
4473
4873
|
requestKey: nonEmpty("requestKey"),
|
|
@@ -4584,6 +4984,7 @@ const PaymentExecutionIntentSchema = Schema.Struct({
|
|
|
4584
4984
|
to: PaymentRef,
|
|
4585
4985
|
externalAddressAcknowledged: Schema.optional(Schema.Literal(true)),
|
|
4586
4986
|
amount: AssetAmountSchema,
|
|
4987
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
4587
4988
|
paymentType: Schema.optional(Schema.Literals([
|
|
4588
4989
|
"unspecified",
|
|
4589
4990
|
"invoice",
|
|
@@ -4591,7 +4992,7 @@ const PaymentExecutionIntentSchema = Schema.Struct({
|
|
|
4591
4992
|
"reimbursement"
|
|
4592
4993
|
])),
|
|
4593
4994
|
timing: Schema.optional(PaymentTiming)
|
|
4594
|
-
}).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value)));
|
|
4995
|
+
}).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)));
|
|
4595
4996
|
const PreparePaymentExecutionInputSchema = Schema.Struct({
|
|
4596
4997
|
requestKey: nonEmpty("requestKey"),
|
|
4597
4998
|
signerAddress: AddressSchema$1,
|
|
@@ -4660,6 +5061,7 @@ const SubmittedPaymentCommandExecutionSchema = Schema.Struct({
|
|
|
4660
5061
|
userOpHash: Bytes32Schema,
|
|
4661
5062
|
payments: Schema.Array(Payment)
|
|
4662
5063
|
});
|
|
5064
|
+
const RedirectPaymentRef = PaymentRef.pipe(Schema.refine((recipient) => recipient.kind !== "party_account", { message: "Bank payout recipients cannot receive commitment redirects" }));
|
|
4663
5065
|
const PaymentLifecycleExecutionIntentSchema = Schema.Union([
|
|
4664
5066
|
Schema.Struct({
|
|
4665
5067
|
kind: Schema.Literal("retry"),
|
|
@@ -4676,7 +5078,7 @@ const PaymentLifecycleExecutionIntentSchema = Schema.Union([
|
|
|
4676
5078
|
Schema.Struct({
|
|
4677
5079
|
kind: Schema.Literal("redirect"),
|
|
4678
5080
|
paymentId: PaymentIdSchema,
|
|
4679
|
-
recipient:
|
|
5081
|
+
recipient: RedirectPaymentRef
|
|
4680
5082
|
})
|
|
4681
5083
|
]);
|
|
4682
5084
|
const PreparePaymentLifecycleExecutionInputSchema = Schema.Struct({
|
|
@@ -4703,6 +5105,7 @@ const OrganizationPaymentExecutionItemSchema = Schema.Struct({
|
|
|
4703
5105
|
to: PaymentRef,
|
|
4704
5106
|
externalAddressAcknowledged: Schema.optional(Schema.Literal(true)),
|
|
4705
5107
|
amount: AssetAmountSchema,
|
|
5108
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
4706
5109
|
paymentType: Schema.optional(Schema.Literals([
|
|
4707
5110
|
"unspecified",
|
|
4708
5111
|
"invoice",
|
|
@@ -4711,7 +5114,7 @@ const OrganizationPaymentExecutionItemSchema = Schema.Struct({
|
|
|
4711
5114
|
])),
|
|
4712
5115
|
/** When the recipient gets it: instant (the default), or held until a date or over a period. */
|
|
4713
5116
|
timing: Schema.optional(PaymentTiming)
|
|
4714
|
-
}).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value)));
|
|
5117
|
+
}).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)));
|
|
4715
5118
|
const PrepareOrganizationPaymentExecutionInputSchema = Schema.Struct({
|
|
4716
5119
|
orgId: nonEmpty("orgId"),
|
|
4717
5120
|
permissionId: PermissionIdSchema,
|
|
@@ -4873,7 +5276,11 @@ const ApprovalSummarySchema = Schema.Struct({
|
|
|
4873
5276
|
to: Schema.Struct({ label: Schema.String }),
|
|
4874
5277
|
/** The total, when every item moves one asset; null when nothing moves (a Permission change). */
|
|
4875
5278
|
amount: Schema.NullOr(AssetAmountSchema),
|
|
4876
|
-
network: ApprovalNetworkSchema
|
|
5279
|
+
network: ApprovalNetworkSchema,
|
|
5280
|
+
warnings: Schema.optional(Schema.Array(Schema.Struct({
|
|
5281
|
+
code: Schema.Literal("RECIPIENT_ON_CAPXUL"),
|
|
5282
|
+
message: Schema.String
|
|
5283
|
+
})))
|
|
4877
5284
|
});
|
|
4878
5285
|
/** The exact operation the signature covers: the digest is the one thing the key signs. */
|
|
4879
5286
|
const ApprovalOperationSchema = Schema.Struct({
|
|
@@ -5260,6 +5667,95 @@ const keys = {
|
|
|
5260
5667
|
})
|
|
5261
5668
|
};
|
|
5262
5669
|
//#endregion
|
|
5670
|
+
//#region ../protocol/src/banking/operations.ts
|
|
5671
|
+
const actor$3 = Schema.optionalKey(ActorScopeSchema);
|
|
5672
|
+
const target = {
|
|
5673
|
+
actor: actor$3,
|
|
5674
|
+
currency: BankCurrencySchema
|
|
5675
|
+
};
|
|
5676
|
+
const errors = [
|
|
5677
|
+
"NOT_AUTHENTICATED",
|
|
5678
|
+
"INVALID_INPUT",
|
|
5679
|
+
"ROLE_PERMISSION_DENIED",
|
|
5680
|
+
"ACCOUNT_NOT_FOUND",
|
|
5681
|
+
"SMART_ACCOUNT_MISSING",
|
|
5682
|
+
"PROVIDER_ERROR",
|
|
5683
|
+
...DEFECTS
|
|
5684
|
+
];
|
|
5685
|
+
const writeErrors = [...errors, "WRONG_STATE"];
|
|
5686
|
+
const bankDetails = {
|
|
5687
|
+
list: Operation.query("banking.bankDetails.list", {
|
|
5688
|
+
input: Schema.Struct({ actor: actor$3 }),
|
|
5689
|
+
output: BankDetailsOverviewSchema,
|
|
5690
|
+
errors
|
|
5691
|
+
}),
|
|
5692
|
+
get: Operation.query("banking.bankDetails.get", {
|
|
5693
|
+
input: Schema.Struct(target),
|
|
5694
|
+
output: Schema.NullOr(BankDetailsSchema),
|
|
5695
|
+
errors
|
|
5696
|
+
}),
|
|
5697
|
+
open: Operation.action("banking.bankDetails.open", {
|
|
5698
|
+
input: Schema.Struct(target),
|
|
5699
|
+
output: BankDetailsSchema,
|
|
5700
|
+
errors: writeErrors
|
|
5701
|
+
}),
|
|
5702
|
+
settle: Operation.action("banking.bankDetails.settle", {
|
|
5703
|
+
input: Schema.Struct({
|
|
5704
|
+
...target,
|
|
5705
|
+
token: SettlementTokenSchema
|
|
5706
|
+
}),
|
|
5707
|
+
output: BankDetailsSchema,
|
|
5708
|
+
errors: writeErrors
|
|
5709
|
+
}),
|
|
5710
|
+
deactivate: Operation.action("banking.bankDetails.deactivate", {
|
|
5711
|
+
input: Schema.Struct(target),
|
|
5712
|
+
output: BankDetailsSchema,
|
|
5713
|
+
errors: writeErrors
|
|
5714
|
+
}),
|
|
5715
|
+
reactivate: Operation.action("banking.bankDetails.reactivate", {
|
|
5716
|
+
input: Schema.Struct(target),
|
|
5717
|
+
output: BankDetailsSchema,
|
|
5718
|
+
errors: writeErrors
|
|
5719
|
+
})
|
|
5720
|
+
};
|
|
5721
|
+
const deposits = {
|
|
5722
|
+
list: Operation.query("banking.deposits.list", {
|
|
5723
|
+
input: Schema.Struct({
|
|
5724
|
+
actor: actor$3,
|
|
5725
|
+
cursor: Schema.optionalKey(Schema.String),
|
|
5726
|
+
unmatched: Schema.optionalKey(Schema.Boolean)
|
|
5727
|
+
}),
|
|
5728
|
+
output: BankDepositsPageSchema,
|
|
5729
|
+
errors
|
|
5730
|
+
}),
|
|
5731
|
+
get: Operation.query("banking.deposits.get", {
|
|
5732
|
+
input: Schema.Struct({
|
|
5733
|
+
actor: actor$3,
|
|
5734
|
+
bankDepositId: Schema.String
|
|
5735
|
+
}),
|
|
5736
|
+
output: Schema.NullOr(BankDepositSchema),
|
|
5737
|
+
errors
|
|
5738
|
+
}),
|
|
5739
|
+
candidates: Operation.query("banking.deposits.candidates", {
|
|
5740
|
+
input: Schema.Struct({
|
|
5741
|
+
actor: actor$3,
|
|
5742
|
+
bankDepositId: Schema.String,
|
|
5743
|
+
cursor: Schema.optionalKey(Schema.String)
|
|
5744
|
+
}),
|
|
5745
|
+
output: BankDepositCandidatesPageSchema,
|
|
5746
|
+
errors
|
|
5747
|
+
}),
|
|
5748
|
+
match: Operation.mutation("banking.deposits.match", {
|
|
5749
|
+
input: Schema.Struct({
|
|
5750
|
+
actor: actor$3,
|
|
5751
|
+
bankDepositId: Schema.String,
|
|
5752
|
+
requestId: Schema.NullOr(Schema.String)
|
|
5753
|
+
}),
|
|
5754
|
+
output: BankDepositSchema,
|
|
5755
|
+
errors: writeErrors
|
|
5756
|
+
})
|
|
5757
|
+
};
|
|
5758
|
+
//#endregion
|
|
5263
5759
|
//#region ../protocol/src/documents/operations.ts
|
|
5264
5760
|
/** Every call: no session, or input that does not decode. */
|
|
5265
5761
|
const CALL$8 = ["NOT_AUTHENTICATED", "INVALID_INPUT"];
|
|
@@ -6896,6 +7392,159 @@ const setups = {
|
|
|
6896
7392
|
})
|
|
6897
7393
|
};
|
|
6898
7394
|
//#endregion
|
|
7395
|
+
//#region ../protocol/src/parties/accounts-schema.ts
|
|
7396
|
+
const BankAccountOwnerTypeSchema = Schema.Literals(["individual", "business"]);
|
|
7397
|
+
const text$1 = Schema.String;
|
|
7398
|
+
const optionalText = Schema.optionalKey(text$1);
|
|
7399
|
+
const holder = {
|
|
7400
|
+
holderName: text$1,
|
|
7401
|
+
bankName: optionalText
|
|
7402
|
+
};
|
|
7403
|
+
const owner = {
|
|
7404
|
+
ownerType: Schema.optionalKey(BankAccountOwnerTypeSchema),
|
|
7405
|
+
firstName: optionalText,
|
|
7406
|
+
lastName: optionalText,
|
|
7407
|
+
businessName: optionalText
|
|
7408
|
+
};
|
|
7409
|
+
const BankBeneficiaryAddressSchema = Schema.Struct({
|
|
7410
|
+
streetLine1: text$1,
|
|
7411
|
+
streetLine2: optionalText,
|
|
7412
|
+
city: text$1,
|
|
7413
|
+
state: optionalText,
|
|
7414
|
+
postalCode: optionalText,
|
|
7415
|
+
country: text$1
|
|
7416
|
+
});
|
|
7417
|
+
const iban = {
|
|
7418
|
+
...holder,
|
|
7419
|
+
currency: Schema.Literal("eur"),
|
|
7420
|
+
iban: text$1,
|
|
7421
|
+
bic: optionalText
|
|
7422
|
+
};
|
|
7423
|
+
Schema.Union([
|
|
7424
|
+
Schema.Struct({
|
|
7425
|
+
...holder,
|
|
7426
|
+
currency: Schema.Literal("usd"),
|
|
7427
|
+
accountNumber: text$1,
|
|
7428
|
+
routingNumber: text$1,
|
|
7429
|
+
accountType: Schema.Literals(["checking", "savings"]),
|
|
7430
|
+
address: BankBeneficiaryAddressSchema
|
|
7431
|
+
}),
|
|
7432
|
+
Schema.Struct({
|
|
7433
|
+
...holder,
|
|
7434
|
+
...owner,
|
|
7435
|
+
currency: Schema.Literal("gbp"),
|
|
7436
|
+
sortCode: text$1,
|
|
7437
|
+
accountNumber: text$1
|
|
7438
|
+
}),
|
|
7439
|
+
Schema.Struct({
|
|
7440
|
+
...iban,
|
|
7441
|
+
ownerType: Schema.Literal("individual"),
|
|
7442
|
+
firstName: text$1,
|
|
7443
|
+
lastName: text$1
|
|
7444
|
+
}),
|
|
7445
|
+
Schema.Struct({
|
|
7446
|
+
...iban,
|
|
7447
|
+
ownerType: Schema.Literal("business"),
|
|
7448
|
+
businessName: text$1
|
|
7449
|
+
})
|
|
7450
|
+
]);
|
|
7451
|
+
const BankAccountFilterSchema = Schema.Union([Schema.Struct({ kind: Schema.Literal("self") }), Schema.Struct({
|
|
7452
|
+
kind: Schema.Literal("contact"),
|
|
7453
|
+
ref: RecipientLocatorSchema
|
|
7454
|
+
})]);
|
|
7455
|
+
const BankAccountTargetSchema = Schema.Union([BankAccountFilterSchema, Schema.Struct({
|
|
7456
|
+
kind: Schema.Literal("new"),
|
|
7457
|
+
name: text$1,
|
|
7458
|
+
email: optionalText
|
|
7459
|
+
})]);
|
|
7460
|
+
const BankAccountSchema = Schema.Struct({
|
|
7461
|
+
partyAccountId: text$1,
|
|
7462
|
+
ownerPartyId: text$1,
|
|
7463
|
+
ownerScope: Schema.Literals(["self", "contact"]),
|
|
7464
|
+
currency: BankCurrencySchema,
|
|
7465
|
+
holderName: text$1,
|
|
7466
|
+
bankName: optionalText,
|
|
7467
|
+
last4: text$1,
|
|
7468
|
+
state: Schema.Literals([
|
|
7469
|
+
"saved",
|
|
7470
|
+
"active",
|
|
7471
|
+
"inactive"
|
|
7472
|
+
]),
|
|
7473
|
+
recipient: Schema.Struct({
|
|
7474
|
+
ref: RecipientLocatorSchema,
|
|
7475
|
+
label: text$1,
|
|
7476
|
+
onCapxul: Schema.Boolean
|
|
7477
|
+
})
|
|
7478
|
+
});
|
|
7479
|
+
const BankAccountFieldSchema = Schema.Struct({
|
|
7480
|
+
id: text$1,
|
|
7481
|
+
label: text$1,
|
|
7482
|
+
required: Schema.Boolean,
|
|
7483
|
+
choices: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
7484
|
+
value: text$1,
|
|
7485
|
+
label: text$1
|
|
7486
|
+
}))),
|
|
7487
|
+
minLength: Schema.optionalKey(nonNegativeInteger("minLength")),
|
|
7488
|
+
maxLength: Schema.optionalKey(nonNegativeInteger("maxLength")),
|
|
7489
|
+
pattern: optionalText
|
|
7490
|
+
});
|
|
7491
|
+
const BankAccountRequirementsSchema = Schema.Struct({
|
|
7492
|
+
currency: BankCurrencySchema,
|
|
7493
|
+
fields: Schema.Array(BankAccountFieldSchema)
|
|
7494
|
+
});
|
|
7495
|
+
//#endregion
|
|
7496
|
+
//#region ../protocol/src/parties/accounts-operations.ts
|
|
7497
|
+
const actor$2 = Schema.optionalKey(ActorScopeSchema);
|
|
7498
|
+
const READ = [
|
|
7499
|
+
"NOT_AUTHENTICATED",
|
|
7500
|
+
"INVALID_INPUT",
|
|
7501
|
+
"ROLE_PERMISSION_DENIED",
|
|
7502
|
+
...DEFECTS
|
|
7503
|
+
];
|
|
7504
|
+
const WRITE = [
|
|
7505
|
+
...READ,
|
|
7506
|
+
"SMART_ACCOUNT_MISSING",
|
|
7507
|
+
"ACCOUNT_NOT_FOUND"
|
|
7508
|
+
];
|
|
7509
|
+
const accounts = {
|
|
7510
|
+
requirements: Operation.query("parties.accounts.requirements", {
|
|
7511
|
+
input: Schema.Struct({
|
|
7512
|
+
actor: actor$2,
|
|
7513
|
+
currency: BankCurrencySchema,
|
|
7514
|
+
ownerType: Schema.optionalKey(BankAccountOwnerTypeSchema),
|
|
7515
|
+
country: Schema.optionalKey(Schema.String)
|
|
7516
|
+
}),
|
|
7517
|
+
output: BankAccountRequirementsSchema,
|
|
7518
|
+
errors: READ
|
|
7519
|
+
}),
|
|
7520
|
+
add: Operation.mutation("parties.accounts.add", {
|
|
7521
|
+
input: Schema.Struct({
|
|
7522
|
+
actor: actor$2,
|
|
7523
|
+
target: BankAccountTargetSchema,
|
|
7524
|
+
details: Schema.Unknown,
|
|
7525
|
+
requestKey: Schema.String
|
|
7526
|
+
}),
|
|
7527
|
+
output: BankAccountSchema,
|
|
7528
|
+
errors: [...WRITE, "PROVIDER_ERROR"]
|
|
7529
|
+
}),
|
|
7530
|
+
list: Operation.query("parties.accounts.list", {
|
|
7531
|
+
input: Schema.Struct({
|
|
7532
|
+
actor: actor$2,
|
|
7533
|
+
target: Schema.optionalKey(BankAccountFilterSchema)
|
|
7534
|
+
}),
|
|
7535
|
+
output: pageOf(BankAccountSchema),
|
|
7536
|
+
errors: READ
|
|
7537
|
+
}),
|
|
7538
|
+
remove: Operation.mutation("parties.accounts.remove", {
|
|
7539
|
+
input: Schema.Struct({
|
|
7540
|
+
actor: actor$2,
|
|
7541
|
+
partyAccountId: Schema.String
|
|
7542
|
+
}),
|
|
7543
|
+
output: Schema.Struct({ partyAccountId: Schema.String }),
|
|
7544
|
+
errors: WRITE
|
|
7545
|
+
})
|
|
7546
|
+
};
|
|
7547
|
+
//#endregion
|
|
6899
7548
|
//#region ../protocol/src/parties/operations.ts
|
|
6900
7549
|
/** Every call: no session, or input that does not decode or validate. */
|
|
6901
7550
|
const CALL$5 = ["NOT_AUTHENTICATED", "INVALID_INPUT"];
|
|
@@ -6908,6 +7557,62 @@ const ADMIN$2 = [
|
|
|
6908
7557
|
"ACCOUNT_NOT_FOUND"
|
|
6909
7558
|
];
|
|
6910
7559
|
const actor$1 = Schema.optionalKey(ActorScopeSchema);
|
|
7560
|
+
const VERIFICATION_ERRORS = [
|
|
7561
|
+
...CALL$5,
|
|
7562
|
+
...DEFECTS,
|
|
7563
|
+
...MEMBER$1,
|
|
7564
|
+
"WRONG_STATE",
|
|
7565
|
+
"PROVIDER_ERROR"
|
|
7566
|
+
];
|
|
7567
|
+
const verificationTarget = {
|
|
7568
|
+
orgId: Schema.optionalKey(Schema.String),
|
|
7569
|
+
invitationId: Schema.optionalKey(Schema.String)
|
|
7570
|
+
};
|
|
7571
|
+
/** Person and business verification. Bridge owns the requirements and the decision. */
|
|
7572
|
+
const verifications$1 = {
|
|
7573
|
+
invite: Operation.action("parties.verifications.invite", {
|
|
7574
|
+
input: Schema.Struct({
|
|
7575
|
+
orgId: Schema.String,
|
|
7576
|
+
people: Schema.Unknown
|
|
7577
|
+
}),
|
|
7578
|
+
output: VerificationStatusSchema,
|
|
7579
|
+
errors: VERIFICATION_ERRORS
|
|
7580
|
+
}),
|
|
7581
|
+
start: Operation.action("parties.verifications.start", {
|
|
7582
|
+
input: Schema.Struct({
|
|
7583
|
+
...verificationTarget,
|
|
7584
|
+
surface: Schema.optionalKey(Schema.Literals([
|
|
7585
|
+
"web",
|
|
7586
|
+
"cli",
|
|
7587
|
+
"agent",
|
|
7588
|
+
"sdk",
|
|
7589
|
+
"unspecified"
|
|
7590
|
+
]))
|
|
7591
|
+
}),
|
|
7592
|
+
output: VerificationStatusSchema,
|
|
7593
|
+
errors: VERIFICATION_ERRORS
|
|
7594
|
+
}),
|
|
7595
|
+
status: Operation.action("parties.verifications.status", {
|
|
7596
|
+
input: Schema.Struct(verificationTarget),
|
|
7597
|
+
output: VerificationStatusSchema,
|
|
7598
|
+
errors: VERIFICATION_ERRORS
|
|
7599
|
+
}),
|
|
7600
|
+
answer: Operation.action("parties.verifications.answer", {
|
|
7601
|
+
input: Schema.Struct({
|
|
7602
|
+
...verificationTarget,
|
|
7603
|
+
answers: Schema.Unknown,
|
|
7604
|
+
surface: Schema.optionalKey(Schema.Literals([
|
|
7605
|
+
"web",
|
|
7606
|
+
"cli",
|
|
7607
|
+
"agent",
|
|
7608
|
+
"sdk",
|
|
7609
|
+
"unspecified"
|
|
7610
|
+
]))
|
|
7611
|
+
}),
|
|
7612
|
+
output: VerificationStatusSchema,
|
|
7613
|
+
errors: VERIFICATION_ERRORS
|
|
7614
|
+
})
|
|
7615
|
+
};
|
|
6911
7616
|
const OneContact = Schema.Struct({
|
|
6912
7617
|
actor: actor$1,
|
|
6913
7618
|
partyId: Schema.String
|
|
@@ -7173,38 +7878,52 @@ const PreparedOfferCheckoutExecutionSchema = Schema.Struct({
|
|
|
7173
7878
|
//#endregion
|
|
7174
7879
|
//#region ../protocol/src/requests/checkout-schema.ts
|
|
7175
7880
|
/** Link holders receive payment terms, not the private Invoice document. */
|
|
7176
|
-
const
|
|
7881
|
+
const InvoiceCheckoutStatusSchema = Schema.Literals([
|
|
7882
|
+
"sent",
|
|
7883
|
+
"pending_settlement",
|
|
7884
|
+
"paid",
|
|
7885
|
+
"cancelled",
|
|
7886
|
+
"declined",
|
|
7887
|
+
"expired",
|
|
7888
|
+
"unavailable"
|
|
7889
|
+
]);
|
|
7890
|
+
const InvoiceCheckoutCommonSchema = Schema.Struct({
|
|
7177
7891
|
documentKind: Schema.optional(Schema.Literals(["memo", "invoice"])),
|
|
7178
7892
|
linkToken: boundedText(128),
|
|
7179
7893
|
issuerLabel: boundedText(256),
|
|
7180
7894
|
dueAt: InvoiceDraftSchema.fields.dueAt,
|
|
7895
|
+
documentHash: Bytes32Schema,
|
|
7896
|
+
status: InvoiceCheckoutStatusSchema
|
|
7897
|
+
});
|
|
7898
|
+
const AssetInvoiceCheckoutSummarySchema = Schema.Struct({
|
|
7899
|
+
...InvoiceCheckoutCommonSchema.fields,
|
|
7181
7900
|
amount: AssetAmountSchema,
|
|
7182
7901
|
chainId: ChainIdSchema$1,
|
|
7183
7902
|
tokenAddress: AddressSchema$1,
|
|
7184
7903
|
rawAmount: Schema.String,
|
|
7185
7904
|
recipientSafe: SafeAddressSchema,
|
|
7186
7905
|
contractAddress: AddressSchema$1,
|
|
7187
|
-
settlementId: Bytes32Schema
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
])
|
|
7906
|
+
settlementId: Bytes32Schema
|
|
7907
|
+
});
|
|
7908
|
+
const MoneyInvoiceCheckoutSummarySchema = Schema.Struct({
|
|
7909
|
+
...InvoiceCheckoutCommonSchema.fields,
|
|
7910
|
+
documentKind: Schema.Literal("invoice"),
|
|
7911
|
+
amount: MoneySchema,
|
|
7912
|
+
bankPayment: Schema.Struct({
|
|
7913
|
+
receivingAccountId: Schema.String,
|
|
7914
|
+
currency: MoneySchema.fields.currency
|
|
7915
|
+
})
|
|
7198
7916
|
});
|
|
7917
|
+
const InvoiceCheckoutSummarySchema = Schema.Union([AssetInvoiceCheckoutSummarySchema, MoneyInvoiceCheckoutSummarySchema]);
|
|
7199
7918
|
const InvoiceCheckoutPreparationSchema = Schema.Struct({
|
|
7200
|
-
invoice:
|
|
7919
|
+
invoice: AssetInvoiceCheckoutSummarySchema,
|
|
7201
7920
|
sourceWallet: AddressSchema$1,
|
|
7202
7921
|
allowance: OfferCheckoutPreparationSchema.fields.allowance,
|
|
7203
7922
|
approval: CheckoutTransactionSchema,
|
|
7204
7923
|
payment: CheckoutTransactionSchema
|
|
7205
7924
|
});
|
|
7206
7925
|
const InvoiceCheckoutStateSchema = Schema.Struct({
|
|
7207
|
-
invoice:
|
|
7926
|
+
invoice: AssetInvoiceCheckoutSummarySchema,
|
|
7208
7927
|
verification: CheckoutStateSchema.fields.verification,
|
|
7209
7928
|
receipt: Schema.NullOr(CheckoutReceiptSchema),
|
|
7210
7929
|
latePayment: Schema.Boolean
|
|
@@ -7234,22 +7953,27 @@ const PrepareInvoiceCheckoutExecutionInputSchema = Schema.Struct({
|
|
|
7234
7953
|
const { checkout: _offerSnapshotField, ...registeredCheckoutExecutionFields } = PreparedOfferCheckoutExecutionSchema.fields;
|
|
7235
7954
|
const PreparedInvoiceCheckoutExecutionSchema = Schema.Struct({
|
|
7236
7955
|
...registeredCheckoutExecutionFields,
|
|
7237
|
-
invoice:
|
|
7956
|
+
invoice: AssetInvoiceCheckoutSummarySchema
|
|
7238
7957
|
});
|
|
7239
7958
|
/** Generic request checkout uses the same fixed obligation and receipt contract. */
|
|
7240
|
-
const
|
|
7241
|
-
...
|
|
7959
|
+
const AssetRequestCheckoutSummarySchema = Schema.Struct({
|
|
7960
|
+
...AssetInvoiceCheckoutSummarySchema.fields,
|
|
7242
7961
|
documentKind: Schema.Literals(["memo", "invoice"])
|
|
7243
7962
|
});
|
|
7963
|
+
const MoneyRequestCheckoutSummarySchema = Schema.Struct({
|
|
7964
|
+
...MoneyInvoiceCheckoutSummarySchema.fields,
|
|
7965
|
+
documentKind: Schema.Literal("invoice")
|
|
7966
|
+
});
|
|
7967
|
+
const RequestCheckoutSummarySchema = Schema.Union([AssetRequestCheckoutSummarySchema, MoneyRequestCheckoutSummarySchema]);
|
|
7244
7968
|
const RequestCheckoutPreparationSchema = Schema.Struct({
|
|
7245
|
-
request:
|
|
7969
|
+
request: AssetRequestCheckoutSummarySchema,
|
|
7246
7970
|
sourceWallet: InvoiceCheckoutPreparationSchema.fields.sourceWallet,
|
|
7247
7971
|
allowance: InvoiceCheckoutPreparationSchema.fields.allowance,
|
|
7248
7972
|
approval: InvoiceCheckoutPreparationSchema.fields.approval,
|
|
7249
7973
|
payment: InvoiceCheckoutPreparationSchema.fields.payment
|
|
7250
7974
|
});
|
|
7251
7975
|
const RequestCheckoutStateSchema = Schema.Struct({
|
|
7252
|
-
request:
|
|
7976
|
+
request: AssetRequestCheckoutSummarySchema,
|
|
7253
7977
|
verification: InvoiceCheckoutStateSchema.fields.verification,
|
|
7254
7978
|
receipt: InvoiceCheckoutStateSchema.fields.receipt,
|
|
7255
7979
|
latePayment: InvoiceCheckoutStateSchema.fields.latePayment
|
|
@@ -7272,7 +7996,7 @@ const RequestCheckoutReconciliationSchema = Schema.Union([
|
|
|
7272
7996
|
]);
|
|
7273
7997
|
const PreparedRequestCheckoutExecutionSchema = Schema.Struct({
|
|
7274
7998
|
...registeredCheckoutExecutionFields,
|
|
7275
|
-
request:
|
|
7999
|
+
request: AssetRequestCheckoutSummarySchema
|
|
7276
8000
|
});
|
|
7277
8001
|
//#endregion
|
|
7278
8002
|
//#region ../protocol/src/payments/witness-schema.ts
|
|
@@ -7304,6 +8028,24 @@ const SendWitnessSchema = Schema.Struct({
|
|
|
7304
8028
|
attempts: Schema.Array(SendAttemptSchema)
|
|
7305
8029
|
});
|
|
7306
8030
|
//#endregion
|
|
8031
|
+
//#region ../protocol/src/payments/payout-operations.ts
|
|
8032
|
+
const quotes = { quote: Operation.action("payments.quotes.quote", {
|
|
8033
|
+
input: PaymentQuoteInputSchema,
|
|
8034
|
+
output: PaymentQuoteSchema,
|
|
8035
|
+
errors: [
|
|
8036
|
+
"NOT_AUTHENTICATED",
|
|
8037
|
+
"INVALID_INPUT",
|
|
8038
|
+
"ROLE_PERMISSION_DENIED",
|
|
8039
|
+
"ACCOUNT_NOT_FOUND",
|
|
8040
|
+
"SMART_ACCOUNT_MISSING",
|
|
8041
|
+
"VERIFICATION_REQUIRED",
|
|
8042
|
+
"INSUFFICIENT_BALANCE",
|
|
8043
|
+
"WRONG_STATE",
|
|
8044
|
+
"PROVIDER_ERROR",
|
|
8045
|
+
...DEFECTS
|
|
8046
|
+
]
|
|
8047
|
+
}) };
|
|
8048
|
+
//#endregion
|
|
7307
8049
|
//#region ../protocol/src/payments/operations.ts
|
|
7308
8050
|
const OrgId$2 = Schema.NonEmptyString;
|
|
7309
8051
|
/** Every call: no session, or input that does not decode or validate. */
|
|
@@ -8481,7 +9223,8 @@ const RequestPartySchema = Schema.Struct({
|
|
|
8481
9223
|
const RequestViewSchema = Schema.Struct({
|
|
8482
9224
|
id: Schema.String,
|
|
8483
9225
|
status: Schema.Literals(REQUEST_STATUSES),
|
|
8484
|
-
amount: AssetAmountSchema,
|
|
9226
|
+
amount: Schema.Union([AssetAmountSchema, MoneySchema]),
|
|
9227
|
+
receivingAccountId: Schema.optionalKey(Schema.String),
|
|
8485
9228
|
reference: Schema.String,
|
|
8486
9229
|
memo: Schema.NullOr(Schema.String),
|
|
8487
9230
|
/** The bearer link a payer follows to the checkout. */
|
|
@@ -8490,6 +9233,7 @@ const RequestViewSchema = Schema.Struct({
|
|
|
8490
9233
|
entitlementGranted: Schema.Boolean,
|
|
8491
9234
|
/** The Payment an approval prepared for this request. */
|
|
8492
9235
|
settledPaymentId: Schema.NullOr(Schema.String),
|
|
9236
|
+
settledDepositRef: Schema.optionalKey(Schema.String),
|
|
8493
9237
|
documents: Schema.Array(DocumentRefV3Schema),
|
|
8494
9238
|
expiresAt: Schema.NullOr(EpochMsSchema$1),
|
|
8495
9239
|
createdAt: EpochMsSchema$1,
|
|
@@ -8504,16 +9248,25 @@ const RequestViewSchema = Schema.Struct({
|
|
|
8504
9248
|
addressedToViewer: Schema.optionalKey(Schema.Boolean)
|
|
8505
9249
|
});
|
|
8506
9250
|
/** Ask a payer for money: a basic request, or one carrying an Invoice. */
|
|
8507
|
-
const
|
|
9251
|
+
const IssueRequestCommonSchema = Schema.Struct({
|
|
8508
9252
|
actor: RequestActorSchema,
|
|
8509
|
-
amount: AssetAmountSchema,
|
|
8510
9253
|
reference: Schema.String,
|
|
8511
9254
|
/** Absent for a link anyone holding it may pay. */
|
|
8512
9255
|
payer: Schema.optionalKey(RecipientLocatorSchema),
|
|
8513
9256
|
memo: Schema.optionalKey(Schema.String),
|
|
8514
|
-
invoice: Schema.optionalKey(InvoiceDraftSchema),
|
|
8515
9257
|
expiresAt: Schema.optionalKey(Schema.Finite)
|
|
8516
9258
|
});
|
|
9259
|
+
const IssueRequestInputSchema = Schema.Union([Schema.Struct({
|
|
9260
|
+
...IssueRequestCommonSchema.fields,
|
|
9261
|
+
amount: AssetAmountSchema,
|
|
9262
|
+
invoice: Schema.optionalKey(InvoiceDraftSchema),
|
|
9263
|
+
receivingAccountId: Schema.optional(Schema.Never)
|
|
9264
|
+
}), Schema.Struct({
|
|
9265
|
+
...IssueRequestCommonSchema.fields,
|
|
9266
|
+
amount: MoneySchema,
|
|
9267
|
+
invoice: InvoiceDraftSchema,
|
|
9268
|
+
receivingAccountId: Schema.String
|
|
9269
|
+
})]);
|
|
8517
9270
|
//#endregion
|
|
8518
9271
|
//#region ../protocol/src/requests/operations.ts
|
|
8519
9272
|
const actor = RequestActorSchema;
|
|
@@ -8947,6 +9700,10 @@ const checkouts = {
|
|
|
8947
9700
|
//#endregion
|
|
8948
9701
|
//#region ../protocol/src/operations.ts
|
|
8949
9702
|
const OPERATIONS = [
|
|
9703
|
+
...Object.values(accounts),
|
|
9704
|
+
...Object.values(quotes),
|
|
9705
|
+
...Object.values(bankDetails),
|
|
9706
|
+
...Object.values(deposits),
|
|
8950
9707
|
...Object.values(sessions),
|
|
8951
9708
|
...Object.values(items),
|
|
8952
9709
|
...Object.values(annotations),
|
|
@@ -8973,6 +9730,7 @@ const OPERATIONS = [
|
|
|
8973
9730
|
...Object.values(treasuries),
|
|
8974
9731
|
...Object.values(setups),
|
|
8975
9732
|
...Object.values(contacts),
|
|
9733
|
+
...Object.values(verifications$1),
|
|
8976
9734
|
...Object.values(destinations),
|
|
8977
9735
|
...Object.values(recipients),
|
|
8978
9736
|
...Object.values(records),
|
|
@@ -9054,9 +9812,11 @@ const PEOPLE_OPERATIONS = {
|
|
|
9054
9812
|
read: "accounts.read",
|
|
9055
9813
|
/** The writes an approval's actions run: the recorded signature, and the scheduled lapse. */
|
|
9056
9814
|
approvals: {
|
|
9815
|
+
consumeApproved: "accounts.approvals.consumeApproved",
|
|
9057
9816
|
expire: "accounts.approvals.expire",
|
|
9058
9817
|
recordApproval: "accounts.approvals.recordApproval",
|
|
9059
|
-
recordExpiry: "accounts.approvals.recordExpiry"
|
|
9818
|
+
recordExpiry: "accounts.approvals.recordExpiry",
|
|
9819
|
+
sendApproved: "accounts.approvals.sendApproved"
|
|
9060
9820
|
},
|
|
9061
9821
|
balances: { readBinding: "accounts.balances.readBinding" },
|
|
9062
9822
|
claims: {
|
|
@@ -9309,9 +10069,38 @@ const ORGANIZATION_OPERATIONS = {
|
|
|
9309
10069
|
load: "organizations.treasuries.load" }
|
|
9310
10070
|
},
|
|
9311
10071
|
/** Parties' internal functions; its public rows join from `OPERATIONS`. */
|
|
9312
|
-
parties: {
|
|
9313
|
-
|
|
9314
|
-
|
|
10072
|
+
parties: {
|
|
10073
|
+
accounts: {
|
|
10074
|
+
register: "parties.accounts.register",
|
|
10075
|
+
prepare: "parties.accounts.prepare",
|
|
10076
|
+
finalize: "parties.accounts.finalize"
|
|
10077
|
+
},
|
|
10078
|
+
verificationSubmit: {
|
|
10079
|
+
send: "parties.verificationSubmit.send",
|
|
10080
|
+
person: "parties.verificationSubmit.person"
|
|
10081
|
+
},
|
|
10082
|
+
verifications: {
|
|
10083
|
+
begin: "parties.verifications.begin",
|
|
10084
|
+
invitePeople: "parties.verifications.invitePeople",
|
|
10085
|
+
loadPeople: "parties.verifications.loadPeople",
|
|
10086
|
+
loadPerson: "parties.verifications.loadPerson",
|
|
10087
|
+
recordPerson: "parties.verifications.recordPerson",
|
|
10088
|
+
recordOwnershipAttestation: "parties.verifications.recordOwnershipAttestation",
|
|
10089
|
+
recordBusinessContact: "parties.verifications.recordBusinessContact",
|
|
10090
|
+
recordBusinessContactRejected: "parties.verifications.recordBusinessContactRejected",
|
|
10091
|
+
deliverPersonInvite: "parties.verifications.deliverPersonInvite",
|
|
10092
|
+
load: "parties.verifications.load",
|
|
10093
|
+
recordSnapshot: "parties.verifications.recordSnapshot",
|
|
10094
|
+
recordPrefill: "parties.verifications.recordPrefill",
|
|
10095
|
+
upload: "parties.verifications.upload",
|
|
10096
|
+
recordDocument: "parties.verifications.recordDocument",
|
|
10097
|
+
loadDocument: "parties.verifications.loadDocument",
|
|
10098
|
+
deleteDocument: "parties.verifications.deleteDocument"
|
|
10099
|
+
},
|
|
10100
|
+
contacts: {
|
|
10101
|
+
/** Posts `contact_relationship_changed` after a contact write commits. */
|
|
10102
|
+
emitRelationshipChanged: "parties.contacts.emitRelationshipChanged" }
|
|
10103
|
+
}
|
|
9315
10104
|
};
|
|
9316
10105
|
//#endregion
|
|
9317
10106
|
//#region ../observability/src/operations/money.ts
|
|
@@ -9334,10 +10123,6 @@ emitSaved: "activity.annotations.emitSaved" },
|
|
|
9334
10123
|
faucetSafe: { deploy: "FaucetSafe.deploy" },
|
|
9335
10124
|
financialOps: { createPayee: "financialOps.createPayee" },
|
|
9336
10125
|
holdings: { current: "holdings.current" },
|
|
9337
|
-
offramp: {
|
|
9338
|
-
quote: "offramp.quote",
|
|
9339
|
-
status: "offramp.status"
|
|
9340
|
-
},
|
|
9341
10126
|
organizationPayments: {
|
|
9342
10127
|
pay: "organizationPayments.pay",
|
|
9343
10128
|
payBatch: "organizationPayments.payBatch",
|
|
@@ -9520,6 +10305,12 @@ loadBudgetLeft: "permissions.authorities.loadBudgetLeft" },
|
|
|
9520
10305
|
//#endregion
|
|
9521
10306
|
//#region ../observability/src/operations/platform.ts
|
|
9522
10307
|
const PLATFORM_OPERATIONS = {
|
|
10308
|
+
/** Native Convex deployment requests, before application telemetry can run. */
|
|
10309
|
+
deployments: { convex: {
|
|
10310
|
+
evaluatePush: "deployments.convex.evaluatePush",
|
|
10311
|
+
startPush: "deployments.convex.startPush",
|
|
10312
|
+
finishPush: "deployments.convex.finishPush"
|
|
10313
|
+
} },
|
|
9523
10314
|
/** Applications' internal functions and HTTP endpoints; its public rows join from `OPERATIONS`. */
|
|
9524
10315
|
applications: {
|
|
9525
10316
|
bootstraps: {
|
|
@@ -9554,11 +10345,7 @@ const PLATFORM_OPERATIONS = {
|
|
|
9554
10345
|
/** The scan's read of its saved checkpoint. */
|
|
9555
10346
|
loadCheckpoint: "indexing.movements.loadCheckpoint",
|
|
9556
10347
|
/** The scan's transaction: one window's Movements and its checkpoint. */
|
|
9557
|
-
applyWindow: "indexing.movements.applyWindow"
|
|
9558
|
-
/** Whether a queued `deposit_settled` still describes an included Movement. */
|
|
9559
|
-
isDepositTelemetryCurrent: "indexing.movements.isDepositTelemetryCurrent",
|
|
9560
|
-
/** Posts `deposit_settled` after a Deposit materializes. */
|
|
9561
|
-
emitDepositSettled: "indexing.movements.emitDepositSettled"
|
|
10348
|
+
applyWindow: "indexing.movements.applyWindow"
|
|
9562
10349
|
},
|
|
9563
10350
|
drifts: {
|
|
9564
10351
|
/** The minute cron: compare Convex outcomes to Ponder facts and correct drift. */
|
|
@@ -9636,12 +10423,54 @@ const PLATFORM_OPERATIONS = {
|
|
|
9636
10423
|
}
|
|
9637
10424
|
};
|
|
9638
10425
|
//#endregion
|
|
10426
|
+
//#region ../observability/src/operations/banking.ts
|
|
10427
|
+
const BANKING_OPERATIONS = { banking: {
|
|
10428
|
+
payouts: {
|
|
10429
|
+
funding: "banking.payouts.funding",
|
|
10430
|
+
prepare: "banking.payouts.prepare",
|
|
10431
|
+
finalize: "banking.payouts.finalize",
|
|
10432
|
+
load: "banking.payouts.load",
|
|
10433
|
+
record: "banking.payouts.record",
|
|
10434
|
+
reconcile: "banking.payouts.reconcile"
|
|
10435
|
+
},
|
|
10436
|
+
deposits: {
|
|
10437
|
+
record: "banking.deposits.record",
|
|
10438
|
+
load: "banking.deposits.load",
|
|
10439
|
+
claimMint: "banking.deposits.claimMint",
|
|
10440
|
+
recordMint: "banking.deposits.recordMint",
|
|
10441
|
+
credit: "banking.deposits.credit",
|
|
10442
|
+
confirm: "banking.deposits.confirm",
|
|
10443
|
+
reconcile: "banking.deposits.reconcile",
|
|
10444
|
+
autoMatch: "banking.deposits.autoMatch"
|
|
10445
|
+
},
|
|
10446
|
+
bankDetails: {
|
|
10447
|
+
prepare: "banking.bankDetails.prepare",
|
|
10448
|
+
finalize: "banking.bankDetails.finalize",
|
|
10449
|
+
load: "banking.bankDetails.load",
|
|
10450
|
+
applyLifecycle: "banking.bankDetails.applyLifecycle"
|
|
10451
|
+
},
|
|
10452
|
+
webhooks: {
|
|
10453
|
+
receive: "banking.webhooks.receive",
|
|
10454
|
+
insert: "banking.webhooks.insert",
|
|
10455
|
+
process: "banking.webhooks.process",
|
|
10456
|
+
load: "banking.webhooks.load",
|
|
10457
|
+
record: "banking.webhooks.record"
|
|
10458
|
+
},
|
|
10459
|
+
reconcile: {
|
|
10460
|
+
catchUp: "banking.reconcile.catchUp",
|
|
10461
|
+
cursor: "banking.reconcile.cursor",
|
|
10462
|
+
advance: "banking.reconcile.advance",
|
|
10463
|
+
recover: "banking.reconcile.recover"
|
|
10464
|
+
}
|
|
10465
|
+
} };
|
|
10466
|
+
//#endregion
|
|
9639
10467
|
//#region ../observability/src/operations.ts
|
|
9640
10468
|
const CAPXUL_OPERATIONS = withRows({
|
|
9641
10469
|
...PEOPLE_OPERATIONS,
|
|
9642
10470
|
...ORGANIZATION_OPERATIONS,
|
|
9643
10471
|
...MONEY_OPERATIONS,
|
|
9644
|
-
...PLATFORM_OPERATIONS
|
|
10472
|
+
...PLATFORM_OPERATIONS,
|
|
10473
|
+
...BANKING_OPERATIONS
|
|
9645
10474
|
});
|
|
9646
10475
|
/** The named tree, with every operation row added under its own name. */
|
|
9647
10476
|
function withRows(named) {
|
|
@@ -9849,6 +10678,8 @@ const UiStepProps = {
|
|
|
9849
10678
|
* `invoice_issued` carries `issuer_scope_kind`; neither is repeated here.
|
|
9850
10679
|
*/
|
|
9851
10680
|
const JourneyVariantProps = {
|
|
10681
|
+
/** Whose bank verification Bridge decides. */
|
|
10682
|
+
subject_kind: Schema.Literals(["person", "business"]),
|
|
9852
10683
|
/** How a person came to Get started: by themselves, an invite, money that waited, or an invoice. */
|
|
9853
10684
|
entry_path: Schema.optional(Schema.Literals([
|
|
9854
10685
|
"signup",
|
|
@@ -9856,11 +10687,13 @@ const JourneyVariantProps = {
|
|
|
9856
10687
|
"claim",
|
|
9857
10688
|
"invoice"
|
|
9858
10689
|
])),
|
|
9859
|
-
/**
|
|
10690
|
+
/** Caller surface. An undeclared historical caller remains `unspecified`. */
|
|
9860
10691
|
surface: Schema.optional(Schema.Literals([
|
|
9861
10692
|
"web",
|
|
9862
10693
|
"cli",
|
|
9863
|
-
"agent"
|
|
10694
|
+
"agent",
|
|
10695
|
+
"sdk",
|
|
10696
|
+
"unspecified"
|
|
9864
10697
|
])),
|
|
9865
10698
|
/** Who pays: a person from their own account, or an Organization from a Budget. */
|
|
9866
10699
|
payer_kind: Schema.optional(Schema.Literals(["person", "organization"])),
|
|
@@ -9875,6 +10708,116 @@ const JourneyVariantProps = {
|
|
|
9875
10708
|
]))
|
|
9876
10709
|
};
|
|
9877
10710
|
//#endregion
|
|
10711
|
+
//#region ../observability/src/events/banking.ts
|
|
10712
|
+
const PayoutTelemetryProps = {
|
|
10713
|
+
recipient_kind: Schema.optional(Schema.Literals([
|
|
10714
|
+
"capxul",
|
|
10715
|
+
"wallet",
|
|
10716
|
+
"bank"
|
|
10717
|
+
])),
|
|
10718
|
+
rail: Schema.optional(Schema.Literals(["direct", "bridge"])),
|
|
10719
|
+
recipient_on_capxul: Schema.optional(Schema.Boolean),
|
|
10720
|
+
party_account_id: OptionalString,
|
|
10721
|
+
quote_id: OptionalString,
|
|
10722
|
+
rail_operation_id: OptionalString
|
|
10723
|
+
};
|
|
10724
|
+
Schema.Struct({
|
|
10725
|
+
name: Schema.Literal("bank_details_issued"),
|
|
10726
|
+
props: Schema.Struct({
|
|
10727
|
+
...TelemetryEnvelopeProps,
|
|
10728
|
+
receiving_account_id: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u)),
|
|
10729
|
+
currency: Schema.Literals([
|
|
10730
|
+
"usd",
|
|
10731
|
+
"eur",
|
|
10732
|
+
"gbp"
|
|
10733
|
+
]),
|
|
10734
|
+
bank_rail: Schema.Literals([
|
|
10735
|
+
"ach",
|
|
10736
|
+
"wire",
|
|
10737
|
+
"sepa",
|
|
10738
|
+
"faster_payments"
|
|
10739
|
+
]),
|
|
10740
|
+
funding_source: Schema.Literal("bank"),
|
|
10741
|
+
rail: Schema.Literal("bridge"),
|
|
10742
|
+
release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
|
|
10743
|
+
})
|
|
10744
|
+
});
|
|
10745
|
+
const DepositProps = {
|
|
10746
|
+
...TelemetryEnvelopeProps,
|
|
10747
|
+
bank_deposit_id: Schema.String,
|
|
10748
|
+
receiving_account_id: Schema.String,
|
|
10749
|
+
currency: Schema.Literals([
|
|
10750
|
+
"usd",
|
|
10751
|
+
"eur",
|
|
10752
|
+
"gbp"
|
|
10753
|
+
]),
|
|
10754
|
+
bank_rail: Schema.Literals([
|
|
10755
|
+
"ach",
|
|
10756
|
+
"wire",
|
|
10757
|
+
"sepa",
|
|
10758
|
+
"faster_payments"
|
|
10759
|
+
]),
|
|
10760
|
+
rail: Schema.Literal("bridge"),
|
|
10761
|
+
release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
|
|
10762
|
+
};
|
|
10763
|
+
Schema.Struct({
|
|
10764
|
+
name: Schema.Literal("bank_deposit_credited"),
|
|
10765
|
+
props: Schema.Struct({
|
|
10766
|
+
...DepositProps,
|
|
10767
|
+
funding_source: Schema.Literal("bank"),
|
|
10768
|
+
chain_movement_id: Schema.String
|
|
10769
|
+
})
|
|
10770
|
+
});
|
|
10771
|
+
Schema.Struct({
|
|
10772
|
+
name: Schema.Literal("bank_deposit_returned"),
|
|
10773
|
+
props: Schema.Struct({
|
|
10774
|
+
...DepositProps,
|
|
10775
|
+
funding_source: Schema.Literal("bank")
|
|
10776
|
+
})
|
|
10777
|
+
});
|
|
10778
|
+
Schema.Struct({
|
|
10779
|
+
name: Schema.Literal("bank_deposit_matched"),
|
|
10780
|
+
props: Schema.Struct({
|
|
10781
|
+
...DepositProps,
|
|
10782
|
+
request_id: Schema.String,
|
|
10783
|
+
pay_path: Schema.Literal("bank"),
|
|
10784
|
+
issuer_scope_kind: Schema.Literals(["account", "organization"]),
|
|
10785
|
+
match_kind: Schema.Literals(["reference", "manual"])
|
|
10786
|
+
})
|
|
10787
|
+
});
|
|
10788
|
+
Schema.Struct({
|
|
10789
|
+
name: Schema.Literal("banking_webhook_received"),
|
|
10790
|
+
props: Schema.Struct({
|
|
10791
|
+
...TelemetryEnvelopeProps,
|
|
10792
|
+
release: Schema.optional(Schema.String),
|
|
10793
|
+
signature_result: Schema.Literals([
|
|
10794
|
+
"valid",
|
|
10795
|
+
"missing",
|
|
10796
|
+
"malformed",
|
|
10797
|
+
"stale",
|
|
10798
|
+
"invalid"
|
|
10799
|
+
]),
|
|
10800
|
+
outcome: Schema.Literals([
|
|
10801
|
+
"inserted",
|
|
10802
|
+
"duplicate",
|
|
10803
|
+
"rejected",
|
|
10804
|
+
"failed"
|
|
10805
|
+
]),
|
|
10806
|
+
bridge_event_id: Schema.optional(Schema.String),
|
|
10807
|
+
bridge_event_type: Schema.optional(Schema.String),
|
|
10808
|
+
duration_ms: Schema.Finite
|
|
10809
|
+
})
|
|
10810
|
+
});
|
|
10811
|
+
Schema.Struct({
|
|
10812
|
+
name: Schema.Literal("banking_reconcile_completed"),
|
|
10813
|
+
props: Schema.Struct({
|
|
10814
|
+
...TelemetryEnvelopeProps,
|
|
10815
|
+
release: Schema.optional(Schema.String),
|
|
10816
|
+
recovered: Schema.Finite,
|
|
10817
|
+
has_more: Schema.Boolean
|
|
10818
|
+
})
|
|
10819
|
+
});
|
|
10820
|
+
//#endregion
|
|
9878
10821
|
//#region ../observability/src/events/money.ts
|
|
9879
10822
|
/**
|
|
9880
10823
|
* R08 (#1966): which Safe was read, on which chain, of which token. `currency`
|
|
@@ -9936,12 +10879,14 @@ const RecipientLocatorKindSchema = Schema.Literals([
|
|
|
9936
10879
|
"handle",
|
|
9937
10880
|
"email",
|
|
9938
10881
|
"address",
|
|
9939
|
-
"party"
|
|
10882
|
+
"party",
|
|
10883
|
+
"party_account"
|
|
9940
10884
|
]);
|
|
9941
10885
|
const RecipientResolutionStatusSchema = Schema.Literals([
|
|
9942
10886
|
"known_party",
|
|
9943
10887
|
"new_email",
|
|
9944
|
-
"external_address"
|
|
10888
|
+
"external_address",
|
|
10889
|
+
"bank_account"
|
|
9945
10890
|
]);
|
|
9946
10891
|
const RecipientPartyKindSchema = Schema.Literals([
|
|
9947
10892
|
"person",
|
|
@@ -9949,6 +10894,7 @@ const RecipientPartyKindSchema = Schema.Literals([
|
|
|
9949
10894
|
"unresolved"
|
|
9950
10895
|
]);
|
|
9951
10896
|
const RecipientTelemetryProps = {
|
|
10897
|
+
...PayoutTelemetryProps,
|
|
9952
10898
|
recipient_locator_kind: Schema.optional(RecipientLocatorKindSchema),
|
|
9953
10899
|
recipient_resolution_status: Schema.optional(RecipientResolutionStatusSchema),
|
|
9954
10900
|
recipient_party_id: OptionalString,
|
|
@@ -10490,6 +11436,7 @@ const ActivityFilterProps = {
|
|
|
10490
11436
|
filter_status: Schema.optional(Schema.Array(Schema.Literals([
|
|
10491
11437
|
"pending",
|
|
10492
11438
|
"settling",
|
|
11439
|
+
"in_transit",
|
|
10493
11440
|
"unresolved",
|
|
10494
11441
|
"pending_claim",
|
|
10495
11442
|
"scheduled",
|
|
@@ -10900,6 +11847,18 @@ const CLI_COMMAND_NAMES = [
|
|
|
10900
11847
|
"account.retry",
|
|
10901
11848
|
"balance",
|
|
10902
11849
|
"address",
|
|
11850
|
+
"verify",
|
|
11851
|
+
"verify.start",
|
|
11852
|
+
"verify.status",
|
|
11853
|
+
"bank",
|
|
11854
|
+
"bank.details",
|
|
11855
|
+
"bank.accounts",
|
|
11856
|
+
"bank.accounts.add",
|
|
11857
|
+
"bank.accounts.remove",
|
|
11858
|
+
"bank.pay",
|
|
11859
|
+
"bank.deposits",
|
|
11860
|
+
"bank.match",
|
|
11861
|
+
"bank.settle",
|
|
10903
11862
|
"payment",
|
|
10904
11863
|
"payment.send",
|
|
10905
11864
|
"payment.list",
|
|
@@ -10926,6 +11885,8 @@ const CLI_COMMAND_NAMES = [
|
|
|
10926
11885
|
"offer.deactivate",
|
|
10927
11886
|
"contact",
|
|
10928
11887
|
"contact.add",
|
|
11888
|
+
"contact.bank",
|
|
11889
|
+
"contact.bank.add",
|
|
10929
11890
|
"contact.list",
|
|
10930
11891
|
"contact.get",
|
|
10931
11892
|
"contact.label",
|
|
@@ -11004,6 +11965,8 @@ const CLI_CAPABILITIES = [
|
|
|
11004
11965
|
"diagnostics",
|
|
11005
11966
|
"collection",
|
|
11006
11967
|
"authentication",
|
|
11968
|
+
"verification",
|
|
11969
|
+
"banking",
|
|
11007
11970
|
"account",
|
|
11008
11971
|
"organization",
|
|
11009
11972
|
"contacts",
|
|
@@ -11227,6 +12190,52 @@ Schema.Struct({
|
|
|
11227
12190
|
props: MemberActivationFailedProps
|
|
11228
12191
|
});
|
|
11229
12192
|
//#endregion
|
|
12193
|
+
//#region ../observability/src/events/verification.ts
|
|
12194
|
+
const Identifier = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u));
|
|
12195
|
+
const FieldId = Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u));
|
|
12196
|
+
/** Journey: get_verified. Private answers and provider URLs are never properties. */
|
|
12197
|
+
const VerificationProps = Schema.Struct({
|
|
12198
|
+
...TelemetryEnvelopeProps,
|
|
12199
|
+
verification_id: Identifier,
|
|
12200
|
+
invitation_id: Schema.optional(Identifier),
|
|
12201
|
+
party_id: Identifier,
|
|
12202
|
+
subject_kind: JourneyVariantProps.subject_kind,
|
|
12203
|
+
surface: JourneyVariantProps.surface,
|
|
12204
|
+
rail: Schema.Literal("bridge"),
|
|
12205
|
+
verification_state: VerificationStateSchema,
|
|
12206
|
+
missing_field_ids: Schema.optional(Schema.Array(FieldId)),
|
|
12207
|
+
release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
|
|
12208
|
+
});
|
|
12209
|
+
Schema.Struct({
|
|
12210
|
+
name: Schema.Literal("verification_started"),
|
|
12211
|
+
props: VerificationProps
|
|
12212
|
+
}), Schema.Struct({
|
|
12213
|
+
name: Schema.Literal("verification_terms_accepted"),
|
|
12214
|
+
props: VerificationProps
|
|
12215
|
+
}), Schema.Struct({
|
|
12216
|
+
name: Schema.Literal("verification_submitted"),
|
|
12217
|
+
props: VerificationProps
|
|
12218
|
+
}), Schema.Struct({
|
|
12219
|
+
name: Schema.Literal("verification_person_invited"),
|
|
12220
|
+
props: Schema.Struct({
|
|
12221
|
+
...VerificationProps.fields,
|
|
12222
|
+
subject_kind: Schema.Literal("business"),
|
|
12223
|
+
invitation_id: Identifier
|
|
12224
|
+
})
|
|
12225
|
+
}), Schema.Struct({
|
|
12226
|
+
name: Schema.Literal("verification_liveness_requested"),
|
|
12227
|
+
props: VerificationProps
|
|
12228
|
+
}), Schema.Struct({
|
|
12229
|
+
name: Schema.Literal("verification_information_requested"),
|
|
12230
|
+
props: VerificationProps
|
|
12231
|
+
}), Schema.Struct({
|
|
12232
|
+
name: Schema.Literal("verification_approved"),
|
|
12233
|
+
props: VerificationProps
|
|
12234
|
+
}), Schema.Struct({
|
|
12235
|
+
name: Schema.Literal("verification_rejected"),
|
|
12236
|
+
props: VerificationProps
|
|
12237
|
+
});
|
|
12238
|
+
//#endregion
|
|
11230
12239
|
//#region ../observability/src/telemetry/redaction.ts
|
|
11231
12240
|
function redactTelemetryEvent(event, options = {}) {
|
|
11232
12241
|
const props = redactTelemetryProps(event.name, event.props, options);
|
|
@@ -12694,7 +13703,7 @@ function mapAccountLifecycle(input) {
|
|
|
12694
13703
|
}
|
|
12695
13704
|
//#endregion
|
|
12696
13705
|
//#region package.json
|
|
12697
|
-
var version = "4.20.0-beta.
|
|
13706
|
+
var version = "4.20.0-beta.33";
|
|
12698
13707
|
//#endregion
|
|
12699
13708
|
//#region src/observability/telemetry/exception-projection.ts
|
|
12700
13709
|
/** Fixed fallback for failures that have no safe message. */
|
|
@@ -13512,6 +14521,19 @@ function admitted(row, error) {
|
|
|
13512
14521
|
});
|
|
13513
14522
|
}
|
|
13514
14523
|
//#endregion
|
|
14524
|
+
//#region src/payments/bank-evidence.ts
|
|
14525
|
+
/** Bank recipients keep their chosen account identity beside the exact funding address. */
|
|
14526
|
+
function bankTargetsMatch(evidence) {
|
|
14527
|
+
const request = evidence.request;
|
|
14528
|
+
if (!("items" in request)) return true;
|
|
14529
|
+
return request.items.every((source, index) => {
|
|
14530
|
+
if (!("to" in source) || source.to.kind !== "party_account") return true;
|
|
14531
|
+
const observation = evidence.recipientObservations[index];
|
|
14532
|
+
const item = evidence.preparedCommand?.items[index];
|
|
14533
|
+
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();
|
|
14534
|
+
});
|
|
14535
|
+
}
|
|
14536
|
+
//#endregion
|
|
13515
14537
|
//#region ../protocol/src/evm/safe-contracts.ts
|
|
13516
14538
|
const BASE_SEPOLIA_CHAIN_ID = 84532;
|
|
13517
14539
|
const SAFE_PROXY_FACTORY = "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67";
|
|
@@ -14138,6 +15160,144 @@ function supportedEnvelopeOf(input) {
|
|
|
14138
15160
|
function envelopeV3Of(input) {
|
|
14139
15161
|
return SchemaParser.decodeUnknownSync(PaymentDocumentEnvelopeV3Schema, { onExcessProperty: "error" })(input);
|
|
14140
15162
|
}
|
|
15163
|
+
//#endregion
|
|
15164
|
+
//#region ../protocol/src/documents/money-invoice-hash.ts
|
|
15165
|
+
const MONEY_INVOICE_V5_EIP712_TYPES = {
|
|
15166
|
+
EIP712Domain: [
|
|
15167
|
+
{
|
|
15168
|
+
name: "name",
|
|
15169
|
+
type: "string"
|
|
15170
|
+
},
|
|
15171
|
+
{
|
|
15172
|
+
name: "version",
|
|
15173
|
+
type: "string"
|
|
15174
|
+
},
|
|
15175
|
+
{
|
|
15176
|
+
name: "chainId",
|
|
15177
|
+
type: "uint256"
|
|
15178
|
+
},
|
|
15179
|
+
{
|
|
15180
|
+
name: "salt",
|
|
15181
|
+
type: "bytes32"
|
|
15182
|
+
}
|
|
15183
|
+
],
|
|
15184
|
+
ReceiptAmountV3: [
|
|
15185
|
+
{
|
|
15186
|
+
name: "denomination",
|
|
15187
|
+
type: "uint8"
|
|
15188
|
+
},
|
|
15189
|
+
{
|
|
15190
|
+
name: "currency",
|
|
15191
|
+
type: "string"
|
|
15192
|
+
},
|
|
15193
|
+
{
|
|
15194
|
+
name: "asset",
|
|
15195
|
+
type: "string"
|
|
15196
|
+
},
|
|
15197
|
+
{
|
|
15198
|
+
name: "minorUnits",
|
|
15199
|
+
type: "uint256"
|
|
15200
|
+
},
|
|
15201
|
+
{
|
|
15202
|
+
name: "decimals",
|
|
15203
|
+
type: "uint8"
|
|
15204
|
+
}
|
|
15205
|
+
],
|
|
15206
|
+
Invoice: [
|
|
15207
|
+
{
|
|
15208
|
+
name: "kind",
|
|
15209
|
+
type: "uint8"
|
|
15210
|
+
},
|
|
15211
|
+
{
|
|
15212
|
+
name: "originId",
|
|
15213
|
+
type: "bytes32"
|
|
15214
|
+
},
|
|
15215
|
+
{
|
|
15216
|
+
name: "issuedAt",
|
|
15217
|
+
type: "uint64"
|
|
15218
|
+
},
|
|
15219
|
+
{
|
|
15220
|
+
name: "invoiceNumber",
|
|
15221
|
+
type: "string"
|
|
15222
|
+
},
|
|
15223
|
+
{
|
|
15224
|
+
name: "payerRef",
|
|
15225
|
+
type: "string"
|
|
15226
|
+
},
|
|
15227
|
+
{
|
|
15228
|
+
name: "payeeRef",
|
|
15229
|
+
type: "string"
|
|
15230
|
+
},
|
|
15231
|
+
{
|
|
15232
|
+
name: "amount",
|
|
15233
|
+
type: "ReceiptAmountV3"
|
|
15234
|
+
},
|
|
15235
|
+
{
|
|
15236
|
+
name: "receivingAccountId",
|
|
15237
|
+
type: "string"
|
|
15238
|
+
},
|
|
15239
|
+
{
|
|
15240
|
+
name: "target",
|
|
15241
|
+
type: "address"
|
|
15242
|
+
},
|
|
15243
|
+
{
|
|
15244
|
+
name: "dueAt",
|
|
15245
|
+
type: "uint64"
|
|
15246
|
+
},
|
|
15247
|
+
{
|
|
15248
|
+
name: "lineItemsHash",
|
|
15249
|
+
type: "bytes32"
|
|
15250
|
+
},
|
|
15251
|
+
{
|
|
15252
|
+
name: "note",
|
|
15253
|
+
type: "string"
|
|
15254
|
+
},
|
|
15255
|
+
{
|
|
15256
|
+
name: "discountMinor",
|
|
15257
|
+
type: "uint256"
|
|
15258
|
+
}
|
|
15259
|
+
]
|
|
15260
|
+
};
|
|
15261
|
+
function message(envelope) {
|
|
15262
|
+
return {
|
|
15263
|
+
...envelope.message,
|
|
15264
|
+
originId: toLowerBytes32(envelope.message.originId, "originId"),
|
|
15265
|
+
issuedAt: BigInt(envelope.message.issuedAt),
|
|
15266
|
+
amount: {
|
|
15267
|
+
...envelope.message.amount,
|
|
15268
|
+
minorUnits: BigInt(envelope.message.amount.minorUnits)
|
|
15269
|
+
},
|
|
15270
|
+
target: toLowerAddress(envelope.message.target, "target"),
|
|
15271
|
+
dueAt: BigInt(envelope.message.dueAt),
|
|
15272
|
+
lineItemsHash: toLowerBytes32(envelope.message.lineItemsHash, "lineItemsHash"),
|
|
15273
|
+
discountMinor: BigInt(envelope.message.discountMinor)
|
|
15274
|
+
};
|
|
15275
|
+
}
|
|
15276
|
+
function domain(envelope) {
|
|
15277
|
+
return {
|
|
15278
|
+
...envelope.domain,
|
|
15279
|
+
chainId: BigInt(envelope.domain.chainId),
|
|
15280
|
+
salt: toLowerBytes32(envelope.domain.salt, "domain.salt")
|
|
15281
|
+
};
|
|
15282
|
+
}
|
|
15283
|
+
function hashMoneyInvoiceV5(envelope) {
|
|
15284
|
+
return hashTypedData({
|
|
15285
|
+
domain: domain(envelope),
|
|
15286
|
+
primaryType: envelope.primaryType,
|
|
15287
|
+
types: MONEY_INVOICE_V5_EIP712_TYPES,
|
|
15288
|
+
message: message(envelope)
|
|
15289
|
+
});
|
|
15290
|
+
}
|
|
15291
|
+
async function verifyMoneyInvoiceV5Signature(envelope) {
|
|
15292
|
+
if (envelope.signature === void 0) return false;
|
|
15293
|
+
return (await recoverTypedDataAddress({
|
|
15294
|
+
domain: domain(envelope),
|
|
15295
|
+
primaryType: envelope.primaryType,
|
|
15296
|
+
types: MONEY_INVOICE_V5_EIP712_TYPES,
|
|
15297
|
+
message: message(envelope),
|
|
15298
|
+
signature: envelope.signature.value
|
|
15299
|
+
})).toLowerCase() === envelope.signature.signer;
|
|
15300
|
+
}
|
|
14141
15301
|
/** Version 3 field order is fixed by the accepted Documents contract. */
|
|
14142
15302
|
const PAYMENT_DOCUMENT_V3_EIP712_TYPES = {
|
|
14143
15303
|
EIP712Domain: [
|
|
@@ -14395,30 +15555,45 @@ const INVOICE_V4_EIP712_TYPES = {
|
|
|
14395
15555
|
function invoiceV4Message(envelope) {
|
|
14396
15556
|
return {
|
|
14397
15557
|
...envelope.message,
|
|
15558
|
+
originId: toLowerBytes32(envelope.message.originId, "originId"),
|
|
15559
|
+
issuedAt: BigInt(envelope.message.issuedAt),
|
|
14398
15560
|
amount: exactAssetV3Message(envelope.message.amount),
|
|
15561
|
+
target: toLowerAddress(envelope.message.target, "target"),
|
|
15562
|
+
dueAt: BigInt(envelope.message.dueAt),
|
|
15563
|
+
lineItemsHash: toLowerBytes32(envelope.message.lineItemsHash, "lineItemsHash"),
|
|
14399
15564
|
discountMinor: BigInt(envelope.message.discountMinor)
|
|
14400
15565
|
};
|
|
14401
15566
|
}
|
|
15567
|
+
function invoiceV4Domain(envelope) {
|
|
15568
|
+
return {
|
|
15569
|
+
...envelope.domain,
|
|
15570
|
+
chainId: BigInt(envelope.domain.chainId),
|
|
15571
|
+
salt: toLowerBytes32(envelope.domain.salt, "domain.salt")
|
|
15572
|
+
};
|
|
15573
|
+
}
|
|
14402
15574
|
function hashSupportedPaymentDocument(input) {
|
|
14403
15575
|
const envelope = supportedEnvelopeOf(input);
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
15576
|
+
switch (envelope.version) {
|
|
15577
|
+
case 3: return hashPaymentDocumentV3(envelope);
|
|
15578
|
+
case 4: return hashTypedData({
|
|
15579
|
+
domain: invoiceV4Domain(envelope),
|
|
15580
|
+
primaryType: envelope.primaryType,
|
|
15581
|
+
types: INVOICE_V4_EIP712_TYPES,
|
|
15582
|
+
message: invoiceV4Message(envelope)
|
|
15583
|
+
});
|
|
15584
|
+
case 5: return hashMoneyInvoiceV5(envelope);
|
|
15585
|
+
default: return absurd(envelope);
|
|
15586
|
+
}
|
|
14412
15587
|
}
|
|
14413
15588
|
async function verifySupportedPaymentDocumentSignature(input) {
|
|
14414
15589
|
const envelope = supportedEnvelopeOf(input);
|
|
14415
|
-
if (envelope.version === 3) return verifyPaymentDocumentSignatureV3(envelope);
|
|
14416
15590
|
if (envelope.signature === void 0) return false;
|
|
14417
|
-
|
|
15591
|
+
if (envelope.version === 3) return verifyPaymentDocumentSignatureV3(envelope);
|
|
15592
|
+
if (envelope.version === 5) return verifyMoneyInvoiceV5Signature(envelope);
|
|
14418
15593
|
return (await recoverTypedDataAddress({
|
|
14419
|
-
domain: envelope
|
|
15594
|
+
domain: invoiceV4Domain(envelope),
|
|
14420
15595
|
primaryType: envelope.primaryType,
|
|
14421
|
-
types,
|
|
15596
|
+
types: INVOICE_V4_EIP712_TYPES,
|
|
14422
15597
|
message: invoiceV4Message(envelope),
|
|
14423
15598
|
signature: envelope.signature.value
|
|
14424
15599
|
})).toLowerCase() === envelope.signature.signer;
|
|
@@ -14494,12 +15669,13 @@ function requestRetryInstruction(input) {
|
|
|
14494
15669
|
const bytes = decodeCanonicalBase64V3(document.bytesBase64);
|
|
14495
15670
|
const envelope = decodeSupportedPaymentDocumentEnvelope(bytes);
|
|
14496
15671
|
if (envelope.primaryType !== "Memo" && envelope.primaryType !== "Invoice") return void 0;
|
|
15672
|
+
if (envelope.version === 5) return void 0;
|
|
14497
15673
|
return {
|
|
14498
15674
|
documentHash: hashSupportedPaymentDocument(envelope),
|
|
14499
15675
|
contentHash: hashPaymentDocumentContentV3(bytes),
|
|
14500
15676
|
role: "instruction",
|
|
14501
15677
|
kind: envelope.primaryType === "Memo" ? "memo" : "invoice",
|
|
14502
|
-
format: envelope
|
|
15678
|
+
format: paymentDocumentEnvelopeFormat(envelope),
|
|
14503
15679
|
issuedAt: envelope.message.issuedAt
|
|
14504
15680
|
};
|
|
14505
15681
|
}
|
|
@@ -14552,14 +15728,12 @@ function retryBirthContext(evidence) {
|
|
|
14552
15728
|
};
|
|
14553
15729
|
}
|
|
14554
15730
|
//#endregion
|
|
14555
|
-
//#region ../protocol/src/evm/assets.ts
|
|
15731
|
+
//#region ../protocol/src/evm/test-assets.ts
|
|
14556
15732
|
const SYNTHETIC_TEST_ASSET_SOURCE = "synthetic-test-liquidity";
|
|
14557
15733
|
/**
|
|
14558
|
-
*
|
|
14559
|
-
*
|
|
14560
|
-
*
|
|
14561
|
-
* admission — so rollback is removing consumers, never relabelling a
|
|
14562
|
-
* deployed address or deleting its history.
|
|
15734
|
+
* Owned test assets, with metadata read from each creation receipt and contract.
|
|
15735
|
+
* Settlement admission lives in assets.ts. The fixed test exchange uses the
|
|
15736
|
+
* original five assets; bank EURC has its own deployment.
|
|
14563
15737
|
*
|
|
14564
15738
|
* `symbol` is the display string the owned contract returns. A
|
|
14565
15739
|
* provider-supported USDC would be a different contract at a different
|
|
@@ -14621,32 +15795,46 @@ const SYNTHETIC_TEST_ASSET_FIXTURES = {
|
|
|
14621
15795
|
deploymentStartBlock: 46690061,
|
|
14622
15796
|
deploymentTransaction: "0x6f6b0302448c7cd7db5c118a8250e548c6e72821df373e5a27550e5cdfa635a1",
|
|
14623
15797
|
source: SYNTHETIC_TEST_ASSET_SOURCE
|
|
15798
|
+
},
|
|
15799
|
+
eurc: {
|
|
15800
|
+
assetId: assetIdFor(84532, "0x15055b4ed1d248c169b92705757cd9c3d985ad5f"),
|
|
15801
|
+
chainId: toChainId(84532),
|
|
15802
|
+
tokenAddress: "0x15055b4ed1d248c169b92705757cd9c3d985ad5f",
|
|
15803
|
+
symbol: "EURC",
|
|
15804
|
+
decimals: 6,
|
|
15805
|
+
peg: toCurrencyCode("EUR"),
|
|
15806
|
+
deploymentStartBlock: 47893251,
|
|
15807
|
+
deploymentTransaction: "0x4e0ab412d980a672336487afd10da007d51f34f17876b19b13732c8125be90ca",
|
|
15808
|
+
source: SYNTHETIC_TEST_ASSET_SOURCE
|
|
14624
15809
|
}
|
|
14625
15810
|
};
|
|
14626
|
-
|
|
15811
|
+
/** EURC is minted for bank deposits and has no admission to the fixed test exchange. */
|
|
15812
|
+
const SYNTHETIC_TEST_ASSETS = [...[
|
|
14627
15813
|
SYNTHETIC_TEST_ASSET_FIXTURES.usdc,
|
|
14628
15814
|
SYNTHETIC_TEST_ASSET_FIXTURES.usdt,
|
|
14629
15815
|
SYNTHETIC_TEST_ASSET_FIXTURES.weth,
|
|
14630
15816
|
SYNTHETIC_TEST_ASSET_FIXTURES.wbtc,
|
|
14631
15817
|
SYNTHETIC_TEST_ASSET_FIXTURES.cngn
|
|
14632
|
-
];
|
|
15818
|
+
], SYNTHETIC_TEST_ASSET_FIXTURES.eurc];
|
|
14633
15819
|
toChainId(84532);
|
|
14634
15820
|
/**
|
|
14635
15821
|
* The settlement tier: the owned test assets admitted to the exact-transfer
|
|
14636
|
-
* path and to the treasury reads. USDC, USDT and
|
|
15822
|
+
* path and to the treasury reads. USDC, USDT, WETH and EURC are admitted assets.
|
|
14637
15823
|
* There is no default token.
|
|
14638
15824
|
*/
|
|
14639
15825
|
const SETTLEMENT_ASSETS_BASE_SEPOLIA = Object.freeze({
|
|
14640
15826
|
CAPXUL_TEST_USDC: SYNTHETIC_TEST_ASSET_FIXTURES.usdc,
|
|
14641
15827
|
CAPXUL_TEST_USDT: SYNTHETIC_TEST_ASSET_FIXTURES.usdt,
|
|
14642
|
-
CAPXUL_TEST_WETH: SYNTHETIC_TEST_ASSET_FIXTURES.weth
|
|
15828
|
+
CAPXUL_TEST_WETH: SYNTHETIC_TEST_ASSET_FIXTURES.weth,
|
|
15829
|
+
CAPXUL_TEST_EURC: SYNTHETIC_TEST_ASSET_FIXTURES.eurc
|
|
14643
15830
|
});
|
|
14644
15831
|
const CONFIGURED_MONEY_ASSETS = Object.freeze(Object.values(SETTLEMENT_ASSETS_BASE_SEPOLIA));
|
|
14645
15832
|
/** Public AssetIds for the admitted Base Sepolia test assets. */
|
|
14646
15833
|
const TOKENS = Object.freeze({ BASE_SEPOLIA: Object.freeze({
|
|
14647
15834
|
CAPXUL_TEST_USDC: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_USDC.assetId,
|
|
14648
15835
|
CAPXUL_TEST_USDT: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_USDT.assetId,
|
|
14649
|
-
CAPXUL_TEST_WETH: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_WETH.assetId
|
|
15836
|
+
CAPXUL_TEST_WETH: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_WETH.assetId,
|
|
15837
|
+
CAPXUL_TEST_EURC: SETTLEMENT_ASSETS_BASE_SEPOLIA.CAPXUL_TEST_EURC.assetId
|
|
14650
15838
|
}) });
|
|
14651
15839
|
/**
|
|
14652
15840
|
* Every known asset in ONE identity space. The tiers above declare admission;
|
|
@@ -14714,8 +15902,12 @@ function sameAmount(left, right) {
|
|
|
14714
15902
|
}
|
|
14715
15903
|
function verifySupportedPaymentDocumentContext(input, context) {
|
|
14716
15904
|
const envelope = supportedEnvelopeOf(input);
|
|
14717
|
-
|
|
14718
|
-
|
|
15905
|
+
switch (envelope.version) {
|
|
15906
|
+
case 3: return verifyPaymentDocumentContextV3(envelope, context);
|
|
15907
|
+
case 4: return envelope.domain.chainId === context.chainId && envelope.message.originId === context.originId && envelope.message.target === context.target && sameAmount(envelope.message.amount, context.amount);
|
|
15908
|
+
case 5: return false;
|
|
15909
|
+
default: return absurd(envelope);
|
|
15910
|
+
}
|
|
14719
15911
|
}
|
|
14720
15912
|
function verifyPaymentDocumentContextV3(envelopeInput, context) {
|
|
14721
15913
|
const envelope = envelopeV3Of(envelopeInput);
|
|
@@ -14754,7 +15946,7 @@ function validateInvoiceLineItems(input) {
|
|
|
14754
15946
|
const derivedHash = hashLineItemsV3(items);
|
|
14755
15947
|
const totalMinor = lineItemsTotalMinorV3(items);
|
|
14756
15948
|
const hashMatches = derivedHash === envelope.message.lineItemsHash;
|
|
14757
|
-
const discountMinor = envelope.version ===
|
|
15949
|
+
const discountMinor = envelope.version === 3 ? 0n : BigInt(envelope.message.discountMinor);
|
|
14758
15950
|
const totalMatches = items.length === 0 ? discountMinor === 0n : discountMinor <= totalMinor && totalMinor - discountMinor === BigInt(envelope.message.amount.minorUnits);
|
|
14759
15951
|
return {
|
|
14760
15952
|
ok: hashMatches && totalMatches,
|
|
@@ -14764,8 +15956,8 @@ function validateInvoiceLineItems(input) {
|
|
|
14764
15956
|
}
|
|
14765
15957
|
/** Compare generated Invoice content with the confirmed draft before signing. */
|
|
14766
15958
|
function invoiceDraftMatchesEnvelope(envelope, draft) {
|
|
14767
|
-
if (envelope.primaryType !== "Invoice" || envelope.version !== invoiceDraftVersion(draft)) return false;
|
|
14768
|
-
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
|
|
15959
|
+
if (envelope.primaryType !== "Invoice" || envelope.version !== 5 && envelope.version !== invoiceDraftVersion(draft)) return false;
|
|
15960
|
+
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"));
|
|
14769
15961
|
}
|
|
14770
15962
|
function hashAdjustmentsV3(input) {
|
|
14771
15963
|
const adjustments = SchemaParser.decodeUnknownSync(adjustmentsV3Schema, { onExcessProperty: "error" })(input);
|
|
@@ -14801,6 +15993,7 @@ async function receiptLinksMatch(source, links) {
|
|
|
14801
15993
|
}
|
|
14802
15994
|
async function documentContextMatches(input, command, item, bundle, ref, exact) {
|
|
14803
15995
|
const envelope = bundle.envelope;
|
|
15996
|
+
if (envelope.version === 5) return false;
|
|
14804
15997
|
const request = input.evidence.request;
|
|
14805
15998
|
const confirmedInstruction = "kind" in request && request.kind === "payment_request" ? request.confirmation.instruction : requestRetryInstruction(input);
|
|
14806
15999
|
const originId = confirmedInstruction === void 0 ? hashDocumentOriginIdV3({
|
|
@@ -14821,7 +16014,7 @@ async function documentContextMatches(input, command, item, bundle, ref, exact)
|
|
|
14821
16014
|
minorUnits: exact.minorUnits,
|
|
14822
16015
|
decimals: exact.decimals
|
|
14823
16016
|
}
|
|
14824
|
-
}) && hashSupportedPaymentDocument(envelope) === item.documentHash && ref.documentHash === item.documentHash && ref.role === "instruction" && ref.format === (envelope
|
|
16017
|
+
}) && 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));
|
|
14825
16018
|
}
|
|
14826
16019
|
function payslipContentMatches(source, bundle, ref) {
|
|
14827
16020
|
const envelope = bundle.envelope;
|
|
@@ -16167,7 +17360,7 @@ async function verifiedPreparedCommand(evidence, sessionEmail, signerAddress, ch
|
|
|
16167
17360
|
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;
|
|
16168
17361
|
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);
|
|
16169
17362
|
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);
|
|
16170
|
-
return verifiesMoneyOperation(evidence, expectedSafe, chainId, permissionId) && await verifiesMoneyBirthEvidence(evidence);
|
|
17363
|
+
return bankTargetsMatch(evidence) && verifiesMoneyOperation(evidence, expectedSafe, chainId, permissionId) && await verifiesMoneyBirthEvidence(evidence);
|
|
16171
17364
|
}
|
|
16172
17365
|
//#endregion
|
|
16173
17366
|
//#region src/money/parse.ts
|
|
@@ -16315,7 +17508,11 @@ function emitPaymentInitiated(telemetry, input, runPromise) {
|
|
|
16315
17508
|
payment_lifecycle_id: `payment_lifecycle_${input.paymentId}`,
|
|
16316
17509
|
...input.commandId === void 0 ? {} : { command_id: input.commandId },
|
|
16317
17510
|
...input.executionId === void 0 ? {} : { execution_id: input.executionId },
|
|
16318
|
-
...input.recipient
|
|
17511
|
+
...input.recipient,
|
|
17512
|
+
...input.recipient.recipient_locator_kind === "party_account" ? {
|
|
17513
|
+
recipient_kind: "bank",
|
|
17514
|
+
rail: "bridge"
|
|
17515
|
+
} : {}
|
|
16319
17516
|
}
|
|
16320
17517
|
}, runPromise);
|
|
16321
17518
|
}
|
|
@@ -16505,7 +17702,7 @@ function plannedCommitmentMatches(prepared) {
|
|
|
16505
17702
|
function recipientMatches(prepared, target) {
|
|
16506
17703
|
const { to, externalAddressAcknowledged } = prepared.payment;
|
|
16507
17704
|
const observation = prepared.recipientObservation;
|
|
16508
|
-
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());
|
|
17705
|
+
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());
|
|
16509
17706
|
}
|
|
16510
17707
|
function itemMatches(prepared, amount) {
|
|
16511
17708
|
const { item, payment } = prepared;
|
|
@@ -16570,6 +17767,7 @@ function verifiesPersonalOperation(prepared, expectedSafe, chainId) {
|
|
|
16570
17767
|
async function documentReferenceMatches(prepared, amount) {
|
|
16571
17768
|
const { item, documentBundle: bundle, instructionDocument: ref } = prepared;
|
|
16572
17769
|
const envelope = bundle.envelope;
|
|
17770
|
+
if (envelope.version === 5) return false;
|
|
16573
17771
|
if (item.operation !== "send" && item.operation !== "create_commitment") return false;
|
|
16574
17772
|
return bundle.originId === hashDocumentOriginIdV3({
|
|
16575
17773
|
chainId: prepared.chainId,
|
|
@@ -16583,7 +17781,7 @@ async function documentReferenceMatches(prepared, amount) {
|
|
|
16583
17781
|
source: prepared.userOpSenderSafe.toLowerCase(),
|
|
16584
17782
|
target: item.recipientSafe.toLowerCase(),
|
|
16585
17783
|
amount
|
|
16586
|
-
}) && hashSupportedPaymentDocument(envelope) === item.documentHash && ref.documentHash === item.documentHash && ref.role === "instruction" && ref.format === (envelope
|
|
17784
|
+
}) && 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));
|
|
16587
17785
|
}
|
|
16588
17786
|
function generatedDraftMatches(prepared) {
|
|
16589
17787
|
const { envelope, lineItems } = prepared.documentBundle;
|
|
@@ -16941,6 +18139,21 @@ function executeOrganizationPayment(deps, input, signal, onPreparedClosed, contr
|
|
|
16941
18139
|
})).pipe(Effect.mapError((publicError) => ({ publicError })))), controls), deps.runPromise), matchesIntent(input), true, onPreparedClosed, signal, controls, onPrepared);
|
|
16942
18140
|
}
|
|
16943
18141
|
//#endregion
|
|
18142
|
+
//#region src/payments/quotes.ts
|
|
18143
|
+
/** The immutable method scope owns the payer. The backend returns exact funding instructions. */
|
|
18144
|
+
function makePaymentQuote(deps, actor = { kind: "account" }) {
|
|
18145
|
+
return (input, options) => {
|
|
18146
|
+
const controls = deps.invocationControls?.(options) ?? options;
|
|
18147
|
+
return runCapxulEffect(callOperation(deps.convexCall, quotes.quote, copyInvocationObservation(controls, {
|
|
18148
|
+
...input,
|
|
18149
|
+
actor
|
|
18150
|
+
})).pipe(Effect.tap(() => Effect.annotateCurrentSpan({
|
|
18151
|
+
party_account_id: input.to.partyAccountId,
|
|
18152
|
+
...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
|
|
18153
|
+
}))), controls, quotes.quote.name, deps.runPromise);
|
|
18154
|
+
};
|
|
18155
|
+
}
|
|
18156
|
+
//#endregion
|
|
16944
18157
|
//#region src/parties/backend-refs.ts
|
|
16945
18158
|
function nonEmptyRefValue(value, field) {
|
|
16946
18159
|
const trimmed = value.trim();
|
|
@@ -17001,14 +18214,184 @@ function backendRef(locator) {
|
|
|
17001
18214
|
}
|
|
17002
18215
|
}
|
|
17003
18216
|
//#endregion
|
|
17004
|
-
//#region src/parties/
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
18217
|
+
//#region src/parties/verification-target.ts
|
|
18218
|
+
const verificationTargetInput = (target) => target.kind === "organization" ? { orgId: target.orgId } : target.kind === "invitation" ? { invitationId: target.invitationId } : {};
|
|
18219
|
+
/** Refuse a decoded response that identifies a different immutable scope. */
|
|
18220
|
+
const validateVerificationTarget = (target, status) => {
|
|
18221
|
+
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."));
|
|
18222
|
+
};
|
|
18223
|
+
//#endregion
|
|
18224
|
+
//#region src/parties/verifications.ts
|
|
18225
|
+
const documentReply = Schema.Struct({ documentId: Schema.NonEmptyString });
|
|
18226
|
+
const documentFields = new Set(VERIFICATION_DOCUMENT_FIELDS);
|
|
18227
|
+
const uploadFailure = () => Errors.providerError("verification", "uploadDocument", "The verification document could not be uploaded.");
|
|
18228
|
+
function makeVerificationMethods(deps, selectedTarget) {
|
|
18229
|
+
const target = selectedTarget ?? { kind: "personal" };
|
|
18230
|
+
let journeyId;
|
|
18231
|
+
let actorId;
|
|
18232
|
+
const context = (options) => {
|
|
18233
|
+
const resolved = deps.invocationControls?.(options) ?? options;
|
|
18234
|
+
const snapshot = readInvocationObservation(resolved) ?? { active: true };
|
|
18235
|
+
if (actorId !== snapshot.actorId) journeyId = void 0;
|
|
18236
|
+
actorId = snapshot.actorId;
|
|
18237
|
+
journeyId = options?.journey_id ?? journeyId ?? snapshot.context?.journeyId ?? `verification_${crypto.randomUUID()}`;
|
|
18238
|
+
const controls = {
|
|
18239
|
+
...resolved,
|
|
18240
|
+
journey_id: journeyId,
|
|
18241
|
+
correlation_id: resolved?.correlation_id ?? snapshot.context?.correlationId ?? crypto.randomUUID()
|
|
18242
|
+
};
|
|
18243
|
+
const captured = snapshot.active ? withCapturedAttemptContext(snapshot.context, controls) : void 0;
|
|
18244
|
+
return attachInvocationObservation(controls, {
|
|
18245
|
+
...snapshot,
|
|
18246
|
+
...captured === void 0 ? {} : { context: captured }
|
|
18247
|
+
});
|
|
18248
|
+
};
|
|
18249
|
+
const remember = (status) => {
|
|
18250
|
+
if (status.journeyId !== "") journeyId = status.journeyId;
|
|
18251
|
+
return status;
|
|
18252
|
+
};
|
|
18253
|
+
const upload = (field, blob, options) => Effect.gen(function* () {
|
|
18254
|
+
if (!documentFields.has(field) || !(blob instanceof Blob) || blob.size === 0) return yield* Effect.fail(Errors.invalidInput("files", "Provide a supported verification document."));
|
|
18255
|
+
const jwt = yield* deps.authClient.getConvexJwt(options).pipe(Effect.mapError(toPublicError$1));
|
|
18256
|
+
return yield* Effect.tryPromise({
|
|
18257
|
+
try: async (signal) => {
|
|
18258
|
+
const response = await (deps.fetch ?? globalThis.fetch)(new URL("/parties/verifications/documents", deps.siteBaseUrl), {
|
|
18259
|
+
method: "POST",
|
|
18260
|
+
headers: {
|
|
18261
|
+
Authorization: `Bearer ${jwt.token}`,
|
|
18262
|
+
"Content-Type": blob.type || "application/octet-stream",
|
|
18263
|
+
"X-Capxul-Document-Field": field
|
|
18264
|
+
},
|
|
18265
|
+
body: blob,
|
|
18266
|
+
signal,
|
|
18267
|
+
redirect: "error"
|
|
18268
|
+
});
|
|
18269
|
+
if (!response.ok) throw uploadFailure();
|
|
18270
|
+
return await response.json();
|
|
18271
|
+
},
|
|
18272
|
+
catch: uploadFailure
|
|
18273
|
+
}).pipe(Effect.flatMap(Schema.decodeUnknownEffect(documentReply)), Effect.mapError(uploadFailure), Effect.map((reply) => reply.documentId));
|
|
18274
|
+
});
|
|
18275
|
+
const submit = (input, options) => {
|
|
18276
|
+
const controls = context(options);
|
|
18277
|
+
const hasAnswers = input?.answers !== void 0 || input?.files !== void 0;
|
|
18278
|
+
const people = input?.people;
|
|
18279
|
+
const row = people !== void 0 ? verifications$1.invite : hasAnswers ? verifications$1.answer : verifications$1.start;
|
|
18280
|
+
return runCapxulEffect(Effect.gen(function* () {
|
|
18281
|
+
if (people !== void 0 && target.kind !== "organization") return yield* Effect.fail(Errors.invalidInput("people", "People require an Organization verification scope."));
|
|
18282
|
+
let status;
|
|
18283
|
+
if (!hasAnswers) status = yield* callOperation(deps.convexCall, verifications$1.start, copyInvocationObservation(controls, {
|
|
18284
|
+
...verificationTargetInput(target),
|
|
18285
|
+
surface: input?.surface ?? "sdk"
|
|
18286
|
+
}));
|
|
18287
|
+
else {
|
|
18288
|
+
const answers = { ...input?.answers };
|
|
18289
|
+
for (const [field, blob] of Object.entries(input?.files ?? {})) answers[field] = yield* upload(field, blob, controls);
|
|
18290
|
+
status = yield* callOperation(deps.convexCall, verifications$1.answer, copyInvocationObservation(controls, {
|
|
18291
|
+
...verificationTargetInput(target),
|
|
18292
|
+
answers,
|
|
18293
|
+
surface: input?.surface ?? "sdk"
|
|
18294
|
+
}));
|
|
18295
|
+
}
|
|
18296
|
+
if (people !== void 0 && target.kind === "organization") status = yield* callOperation(deps.convexCall, verifications$1.invite, copyInvocationObservation(controls, {
|
|
18297
|
+
orgId: target.orgId,
|
|
18298
|
+
people
|
|
18299
|
+
}));
|
|
18300
|
+
return yield* validateVerificationTarget(target, status);
|
|
18301
|
+
}).pipe(Effect.map(remember)), controls, row.name, deps.runPromise);
|
|
18302
|
+
};
|
|
18303
|
+
const scoped = {
|
|
18304
|
+
start: submit,
|
|
18305
|
+
status: (options) => {
|
|
18306
|
+
const controls = context(options);
|
|
18307
|
+
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);
|
|
18308
|
+
}
|
|
18309
|
+
};
|
|
18310
|
+
return selectedTarget === void 0 ? {
|
|
18311
|
+
...scoped,
|
|
18312
|
+
forInvitation: (invitationId) => makeVerificationMethods(deps, {
|
|
18313
|
+
kind: "invitation",
|
|
18314
|
+
invitationId
|
|
18315
|
+
})
|
|
18316
|
+
} : scoped;
|
|
18317
|
+
}
|
|
18318
|
+
//#endregion
|
|
18319
|
+
//#region src/parties/relationship-calls.ts
|
|
18320
|
+
function relationshipCalls(deps, convexCall) {
|
|
18321
|
+
const actor = deps.actor.kind === "account" ? { kind: "account" } : {
|
|
18322
|
+
kind: "org",
|
|
18323
|
+
orgId: deps.actor.orgId
|
|
18324
|
+
};
|
|
18325
|
+
const observeContactScope = Effect.annotateCurrentSpan({
|
|
18326
|
+
scope_kind: actor.kind === "org" ? "organization" : "account",
|
|
18327
|
+
...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
|
|
18328
|
+
});
|
|
18329
|
+
/** One observed call of one contacts row, its reply projected inside the call, under the row's name. */
|
|
18330
|
+
const book = (row, args, options, project) => {
|
|
18331
|
+
const controls = deps.invocationControls?.(options) ?? options;
|
|
18332
|
+
return runPortEffect(projectReply(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError }))), project).pipe(Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
|
|
18333
|
+
};
|
|
18334
|
+
/** As `book`, for a projection that refuses the reply as a value. */
|
|
18335
|
+
const bookChecked = (row, args, options, check) => {
|
|
18336
|
+
const controls = deps.invocationControls?.(options) ?? options;
|
|
18337
|
+
return runPortEffect(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.flatMap((output) => {
|
|
18338
|
+
const checked = check(output);
|
|
18339
|
+
return checked.ok ? Effect.succeed(checked.value) : Effect.fail({ publicError: checked.error });
|
|
18340
|
+
}), Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
|
|
18341
|
+
};
|
|
18342
|
+
return {
|
|
18343
|
+
deps,
|
|
18344
|
+
actor,
|
|
18345
|
+
convexCall,
|
|
18346
|
+
observeContactScope,
|
|
18347
|
+
book,
|
|
18348
|
+
bookChecked
|
|
18349
|
+
};
|
|
18350
|
+
}
|
|
18351
|
+
function missingConvexCall(operation) {
|
|
18352
|
+
return Promise.resolve({
|
|
18353
|
+
ok: false,
|
|
18354
|
+
error: Errors.providerError("convex", operation, "ConvexCallPort is required")
|
|
18355
|
+
});
|
|
18356
|
+
}
|
|
18357
|
+
//#endregion
|
|
18358
|
+
//#region src/parties/accounts.ts
|
|
18359
|
+
/** The actor is captured once. Private input is admitted by the backend's field rules. */
|
|
18360
|
+
function makeBankAccountMethods({ actor, book }) {
|
|
18361
|
+
return {
|
|
18362
|
+
requirements: (input, options) => book(accounts.requirements, {
|
|
18363
|
+
...input,
|
|
18364
|
+
actor
|
|
18365
|
+
}, options, (value) => value),
|
|
18366
|
+
add: (input, options) => book(accounts.add, {
|
|
18367
|
+
...input,
|
|
18368
|
+
actor
|
|
18369
|
+
}, options, (value) => value),
|
|
18370
|
+
list: (input, options) => book(accounts.list, {
|
|
18371
|
+
...input,
|
|
18372
|
+
actor
|
|
18373
|
+
}, options, (value) => value),
|
|
18374
|
+
remove: (input, options) => book(accounts.remove, {
|
|
18375
|
+
...input,
|
|
18376
|
+
actor
|
|
18377
|
+
}, options, (value) => value)
|
|
18378
|
+
};
|
|
18379
|
+
}
|
|
18380
|
+
const unavailableBankAccountMethods = () => ({
|
|
18381
|
+
requirements: () => missingConvexCall(accounts.requirements.name),
|
|
18382
|
+
add: () => missingConvexCall(accounts.add.name),
|
|
18383
|
+
list: () => missingConvexCall(accounts.list.name),
|
|
18384
|
+
remove: () => missingConvexCall(accounts.remove.name)
|
|
18385
|
+
});
|
|
18386
|
+
//#endregion
|
|
18387
|
+
//#region src/parties/recipients.ts
|
|
18388
|
+
function makeTargetsMethods(deps) {
|
|
18389
|
+
return { resolve: (reference, options) => {
|
|
18390
|
+
const controls = deps.invocationControls?.(options) ?? options;
|
|
18391
|
+
return runPortEffect(projectReply(Effect.suspend(() => {
|
|
18392
|
+
const recipient = normalizeTargetForBackend(reference, "reference");
|
|
18393
|
+
return recipient.ok ? callOperation(deps.convexCall, recipients.resolve, copyInvocationObservation(controls, { recipient: recipient.value })).pipe(Effect.mapError((publicError) => ({ publicError }))) : Effect.fail({ publicError: recipient.error });
|
|
18394
|
+
}), resolvedTargetFromResolution), controls, recipients.resolve.name, deps.runPromise);
|
|
17012
18395
|
} };
|
|
17013
18396
|
}
|
|
17014
18397
|
/** A locator as the backend returned it, its address and Party id proved, not asserted. */
|
|
@@ -17129,6 +18512,10 @@ async function payObligationRegistered(deps, input, options, generic) {
|
|
|
17129
18512
|
error: Errors.invalidInput(generic ? "request" : "invoice", generic ? "Request is unavailable" : "Invoice is unavailable")
|
|
17130
18513
|
};
|
|
17131
18514
|
const snapshot = frozen.value;
|
|
18515
|
+
if ("bankPayment" in snapshot) return {
|
|
18516
|
+
ok: false,
|
|
18517
|
+
error: Errors.invalidInput("invoice", "Pay this Invoice by bank transfer.")
|
|
18518
|
+
};
|
|
17132
18519
|
const { sourceWallet: _sourceWallet, ...wireInput } = input;
|
|
17133
18520
|
const request = {
|
|
17134
18521
|
kind: "invoice_checkout",
|
|
@@ -17401,6 +18788,8 @@ function mapInboxItem(item) {
|
|
|
17401
18788
|
status: mapInboxStatus(item.status),
|
|
17402
18789
|
documents: item.documents ?? [],
|
|
17403
18790
|
...item.issuerSafe === void 0 ? {} : { issuerSafe: item.issuerSafe },
|
|
18791
|
+
...item.receivingAccountId === void 0 ? {} : { receivingAccountId: item.receivingAccountId },
|
|
18792
|
+
...item.settledDepositRef === void 0 ? {} : { settledDepositRef: item.settledDepositRef },
|
|
17404
18793
|
...item.settledPaymentId == null ? {} : { paymentId: toPaymentId(item.settledPaymentId) }
|
|
17405
18794
|
};
|
|
17406
18795
|
}
|
|
@@ -17451,6 +18840,7 @@ function makeOfferMethods(deps) {
|
|
|
17451
18840
|
}
|
|
17452
18841
|
//#endregion
|
|
17453
18842
|
//#region src/requests/receivables.ts
|
|
18843
|
+
const isMoneyRequestIssue = (input) => "currency" in input.amount;
|
|
17454
18844
|
function makeActorRequestsMethods(calls) {
|
|
17455
18845
|
const { actor, deps, book } = calls;
|
|
17456
18846
|
return {
|
|
@@ -17460,15 +18850,24 @@ function makeActorRequestsMethods(calls) {
|
|
|
17460
18850
|
const controls = deps.invocationControls?.(options) ?? options;
|
|
17461
18851
|
return runCapxulEffect(Effect.fail(payer.error), controls, receivables.issue.name, deps.runPromise);
|
|
17462
18852
|
}
|
|
17463
|
-
|
|
18853
|
+
const common = {
|
|
17464
18854
|
actor,
|
|
17465
18855
|
payer: payer.value,
|
|
17466
|
-
amount: input.amount,
|
|
17467
18856
|
reference: input.reference,
|
|
17468
18857
|
...input.memo === void 0 ? {} : { memo: input.memo },
|
|
17469
|
-
...input.invoice === void 0 ? {} : { invoice: input.invoice },
|
|
17470
18858
|
...input.expiresAt === void 0 ? {} : { expiresAt: input.expiresAt }
|
|
17471
|
-
}
|
|
18859
|
+
};
|
|
18860
|
+
const issueArgs = isMoneyRequestIssue(input) ? {
|
|
18861
|
+
...common,
|
|
18862
|
+
amount: input.amount,
|
|
18863
|
+
invoice: input.invoice,
|
|
18864
|
+
receivingAccountId: input.receivingAccountId
|
|
18865
|
+
} : {
|
|
18866
|
+
...common,
|
|
18867
|
+
amount: input.amount,
|
|
18868
|
+
...input.invoice === void 0 ? {} : { invoice: input.invoice }
|
|
18869
|
+
};
|
|
18870
|
+
return book(receivables.issue, issueArgs, options, (request) => mapActorRequest(request, input.payer));
|
|
17472
18871
|
},
|
|
17473
18872
|
list: (options) => book(receivables.listCurrent, { actor }, options, (requests) => mapPage(requests, (request) => mapActorRequest(request))),
|
|
17474
18873
|
get: (requestId, options) => book(receivables.getCurrent, {
|
|
@@ -17507,49 +18906,12 @@ function mapActorRequest(request, payer) {
|
|
|
17507
18906
|
...request.settledPaymentId == null ? {} : { paymentId: toPaymentId(request.settledPaymentId) },
|
|
17508
18907
|
...typeof request.addressedToViewer === "boolean" ? { addressedToViewer: request.addressedToViewer } : {},
|
|
17509
18908
|
...request.issuerSafe === void 0 ? {} : { issuerSafe: request.issuerSafe },
|
|
18909
|
+
...request.receivingAccountId === void 0 ? {} : { receivingAccountId: request.receivingAccountId },
|
|
18910
|
+
...request.settledDepositRef === void 0 ? {} : { settledDepositRef: request.settledDepositRef },
|
|
17510
18911
|
linkToken: request.linkToken
|
|
17511
18912
|
};
|
|
17512
18913
|
}
|
|
17513
18914
|
//#endregion
|
|
17514
|
-
//#region src/parties/relationship-calls.ts
|
|
17515
|
-
function relationshipCalls(deps, convexCall) {
|
|
17516
|
-
const actor = deps.actor.kind === "account" ? { kind: "account" } : {
|
|
17517
|
-
kind: "org",
|
|
17518
|
-
orgId: deps.actor.orgId
|
|
17519
|
-
};
|
|
17520
|
-
const observeContactScope = Effect.annotateCurrentSpan({
|
|
17521
|
-
scope_kind: actor.kind === "org" ? "organization" : "account",
|
|
17522
|
-
...actor.kind === "org" ? { verified_organization_id: actor.orgId } : {}
|
|
17523
|
-
});
|
|
17524
|
-
/** One observed call of one contacts row, its reply projected inside the call, under the row's name. */
|
|
17525
|
-
const book = (row, args, options, project) => {
|
|
17526
|
-
const controls = deps.invocationControls?.(options) ?? options;
|
|
17527
|
-
return runPortEffect(projectReply(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError }))), project).pipe(Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
|
|
17528
|
-
};
|
|
17529
|
-
/** As `book`, for a projection that refuses the reply as a value. */
|
|
17530
|
-
const bookChecked = (row, args, options, check) => {
|
|
17531
|
-
const controls = deps.invocationControls?.(options) ?? options;
|
|
17532
|
-
return runPortEffect(callOperation(convexCall, row, copyInvocationObservation(controls, args)).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.flatMap((output) => {
|
|
17533
|
-
const checked = check(output);
|
|
17534
|
-
return checked.ok ? Effect.succeed(checked.value) : Effect.fail({ publicError: checked.error });
|
|
17535
|
-
}), Effect.tap(() => observeContactScope)), controls, row.name, deps.runPromise);
|
|
17536
|
-
};
|
|
17537
|
-
return {
|
|
17538
|
-
deps,
|
|
17539
|
-
actor,
|
|
17540
|
-
convexCall,
|
|
17541
|
-
observeContactScope,
|
|
17542
|
-
book,
|
|
17543
|
-
bookChecked
|
|
17544
|
-
};
|
|
17545
|
-
}
|
|
17546
|
-
function missingConvexCall(operation) {
|
|
17547
|
-
return Promise.resolve({
|
|
17548
|
-
ok: false,
|
|
17549
|
-
error: Errors.providerError("convex", operation, "ConvexCallPort is required")
|
|
17550
|
-
});
|
|
17551
|
-
}
|
|
17552
|
-
//#endregion
|
|
17553
18915
|
//#region src/parties/contacts.ts
|
|
17554
18916
|
function makeAddressBookMethods(calls) {
|
|
17555
18917
|
const { actor, deps, book } = calls;
|
|
@@ -17621,6 +18983,7 @@ function makeActorRelationshipMethods(deps) {
|
|
|
17621
18983
|
if (convexCall === void 0) return {
|
|
17622
18984
|
offers,
|
|
17623
18985
|
addressBook: unavailableAddressBookMethods(),
|
|
18986
|
+
bankAccounts: unavailableBankAccountMethods(),
|
|
17624
18987
|
requests: unavailableActorRequestsMethods(),
|
|
17625
18988
|
inbox: unavailableInboxMethods(),
|
|
17626
18989
|
profile
|
|
@@ -17629,6 +18992,7 @@ function makeActorRelationshipMethods(deps) {
|
|
|
17629
18992
|
return {
|
|
17630
18993
|
offers,
|
|
17631
18994
|
addressBook: makeAddressBookMethods(calls),
|
|
18995
|
+
bankAccounts: makeBankAccountMethods(calls),
|
|
17632
18996
|
requests: makeActorRequestsMethods(calls),
|
|
17633
18997
|
inbox: makeInboxMethods(calls),
|
|
17634
18998
|
profile
|
|
@@ -17833,12 +19197,16 @@ function paymentExecutionIntent(input) {
|
|
|
17833
19197
|
ok: false,
|
|
17834
19198
|
error: Errors.notImplemented("payments", "pay.organizationActor")
|
|
17835
19199
|
};
|
|
17836
|
-
const to = normalizeTargetForBackend(input.to, "to");
|
|
17837
|
-
if (!to.ok) return to;
|
|
17838
19200
|
try {
|
|
19201
|
+
const to = input.to?.kind === "party_account" ? {
|
|
19202
|
+
ok: true,
|
|
19203
|
+
value: input.to
|
|
19204
|
+
} : normalizeTargetForBackend(input.to, "to");
|
|
19205
|
+
if (!to.ok) return to;
|
|
17839
19206
|
const decoded = Schema.decodeResult(PaymentExecutionIntentSchema, { onExcessProperty: "error" })({
|
|
17840
19207
|
to: to.value,
|
|
17841
19208
|
amount: input.amount,
|
|
19209
|
+
...input.quoteId === void 0 ? {} : { quoteId: input.quoteId },
|
|
17842
19210
|
...input.externalAddressAcknowledged === void 0 ? {} : { externalAddressAcknowledged: input.externalAddressAcknowledged },
|
|
17843
19211
|
...input.paymentType === void 0 ? {} : { paymentType: input.paymentType },
|
|
17844
19212
|
...input.document === void 0 ? {} : { document: input.document },
|
|
@@ -17852,10 +19220,10 @@ function paymentExecutionIntent(input) {
|
|
|
17852
19220
|
ok: false,
|
|
17853
19221
|
error: invalidPaymentField(decoded.failure.issue, "invalid personal payment input")
|
|
17854
19222
|
};
|
|
17855
|
-
} catch {
|
|
19223
|
+
} catch (cause) {
|
|
17856
19224
|
return {
|
|
17857
19225
|
ok: false,
|
|
17858
|
-
error: Errors.invalidInput("payment", "invalid personal payment input")
|
|
19226
|
+
error: cause instanceof CapxulError ? cause : Errors.invalidInput("payment", "invalid personal payment input")
|
|
17859
19227
|
};
|
|
17860
19228
|
}
|
|
17861
19229
|
}
|
|
@@ -18379,6 +19747,7 @@ function makePaymentsMethods(deps) {
|
|
|
18379
19747
|
const pay = makePersonalPay(deps);
|
|
18380
19748
|
const { runLifecycle, retryPayment } = makeLifecycleRunners(deps);
|
|
18381
19749
|
return {
|
|
19750
|
+
quote: makePaymentQuote(deps),
|
|
18382
19751
|
subscribe: (paymentId, listener, options) => subscribePersonalPayment({
|
|
18383
19752
|
actor: deps.actor,
|
|
18384
19753
|
convexCall: deps.convexCall,
|
|
@@ -18418,32 +19787,6 @@ function makePaymentsMethods(deps) {
|
|
|
18418
19787
|
};
|
|
18419
19788
|
}
|
|
18420
19789
|
//#endregion
|
|
18421
|
-
//#region src/payments/offramp.ts
|
|
18422
|
-
function makeOfframpMethods() {
|
|
18423
|
-
return {
|
|
18424
|
-
quote: (input, options) => {
|
|
18425
|
-
if (options?.signal?.aborted) return Promise.resolve({
|
|
18426
|
-
ok: false,
|
|
18427
|
-
error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.offramp.quote })
|
|
18428
|
-
});
|
|
18429
|
-
return Promise.resolve({
|
|
18430
|
-
ok: false,
|
|
18431
|
-
error: Errors.notImplemented("offramp", "quote")
|
|
18432
|
-
});
|
|
18433
|
-
},
|
|
18434
|
-
status: (offrampId, options) => {
|
|
18435
|
-
if (options?.signal?.aborted) return Promise.resolve({
|
|
18436
|
-
ok: false,
|
|
18437
|
-
error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.offramp.status })
|
|
18438
|
-
});
|
|
18439
|
-
return Promise.resolve({
|
|
18440
|
-
ok: false,
|
|
18441
|
-
error: Errors.notImplemented("offramp", "status")
|
|
18442
|
-
});
|
|
18443
|
-
}
|
|
18444
|
-
};
|
|
18445
|
-
}
|
|
18446
|
-
//#endregion
|
|
18447
19790
|
//#region src/payments/organization-payment-requests.ts
|
|
18448
19791
|
const organizationPaymentIntentSchema = Schema.Struct({
|
|
18449
19792
|
orgId: PrepareOrganizationPaymentExecutionInputSchema.fields.orgId,
|
|
@@ -18729,6 +20072,10 @@ function makeOrganizationPaymentsMethods(deps, orgId) {
|
|
|
18729
20072
|
}), observationOnlyControls(controls), operation, deps.runPromise);
|
|
18730
20073
|
return {
|
|
18731
20074
|
...makeOrganizationPaymentReadMethods(deps, orgId),
|
|
20075
|
+
quote: makePaymentQuote(deps, {
|
|
20076
|
+
kind: "org",
|
|
20077
|
+
orgId
|
|
20078
|
+
}),
|
|
18732
20079
|
retry: (paymentId, options) => {
|
|
18733
20080
|
const controls = deps.invocationControls?.(options) ?? options;
|
|
18734
20081
|
return runCapxulEffect(Effect.gen(function* () {
|
|
@@ -18808,21 +20155,6 @@ function makeOrganizationPaymentsMethods(deps, orgId) {
|
|
|
18808
20155
|
};
|
|
18809
20156
|
}
|
|
18810
20157
|
//#endregion
|
|
18811
|
-
//#region src/observability/telemetry/emit-once.ts
|
|
18812
|
-
/**
|
|
18813
|
-
* A product event that could not be built or emitted never reaches the caller
|
|
18814
|
-
* as a failure, and is never lost silently: the drop is logged by event name.
|
|
18815
|
-
*/
|
|
18816
|
-
function logDroppedEvent(eventName) {
|
|
18817
|
-
return (effect) => effect.pipe(Effect.catchCause((cause) => {
|
|
18818
|
-
const reason = Cause.squash(cause);
|
|
18819
|
-
return Effect.logWarning("product.telemetry.emit.dropped").pipe(Effect.annotateLogs({
|
|
18820
|
-
product_event: eventName,
|
|
18821
|
-
reason: reason instanceof Error ? reason.message : String(reason)
|
|
18822
|
-
}), Effect.ignoreCause);
|
|
18823
|
-
}));
|
|
18824
|
-
}
|
|
18825
|
-
//#endregion
|
|
18826
20158
|
//#region src/accounts/events.ts
|
|
18827
20159
|
async function emitProvisioningTelemetry(telemetry, smartAccount, runPromise) {
|
|
18828
20160
|
if (telemetry === void 0) return;
|
|
@@ -18872,50 +20204,16 @@ function emitAccountBalanceFailed(telemetry, error, runPromise) {
|
|
|
18872
20204
|
}
|
|
18873
20205
|
}, runPromise);
|
|
18874
20206
|
}
|
|
18875
|
-
/**
|
|
18876
|
-
function
|
|
18877
|
-
|
|
18878
|
-
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
};
|
|
18886
|
-
yield* Effect.annotateCurrentSpan(fields);
|
|
18887
|
-
if (telemetry === void 0) return;
|
|
18888
|
-
const span = yield* Effect.currentSpan;
|
|
18889
|
-
const snapshot = readInvocationObservation(source);
|
|
18890
|
-
const { organizationId: _hint, ...context } = snapshot?.context ?? {};
|
|
18891
|
-
const event = {
|
|
18892
|
-
name: "deposit_initiated",
|
|
18893
|
-
props: {
|
|
18894
|
-
scope_kind: fields.scope_kind,
|
|
18895
|
-
account_kind: fields.account_kind,
|
|
18896
|
-
...fields.chain_id === void 0 ? {} : { chain_id: fields.chain_id },
|
|
18897
|
-
...fields.network === void 0 ? {} : { network: fields.network },
|
|
18898
|
-
$groups: organizationId === void 0 ? {} : { organization: organizationId },
|
|
18899
|
-
...safeEngineeringIdentifier(snapshot?.actorId) === void 0 ? {} : {
|
|
18900
|
-
actor_id: snapshot.actorId,
|
|
18901
|
-
actor_kind: "authenticated",
|
|
18902
|
-
distinct_id: snapshot.actorId
|
|
18903
|
-
},
|
|
18904
|
-
trace_id: span.traceId,
|
|
18905
|
-
span_id: span.spanId,
|
|
18906
|
-
...organizationId === void 0 ? {} : { organization_id: organizationId }
|
|
18907
|
-
}
|
|
18908
|
-
};
|
|
18909
|
-
yield* telemetry.emit(snapshot === void 0 ? event : attachInvocationObservation(event, {
|
|
18910
|
-
active: snapshot.active,
|
|
18911
|
-
...snapshot?.actorId === void 0 ? {} : { actorId: snapshot.actorId },
|
|
18912
|
-
context: {
|
|
18913
|
-
...context,
|
|
18914
|
-
...organizationId === void 0 ? {} : { organizationId },
|
|
18915
|
-
traceparent: `00-${span.traceId}-${span.spanId}-01`
|
|
18916
|
-
}
|
|
18917
|
-
}));
|
|
18918
|
-
}).pipe(logDroppedEvent("deposit_initiated"));
|
|
20207
|
+
/** Keep instruction-read facts on the operation span without a product event. */
|
|
20208
|
+
function annotateDepositInstructions(instructions, verifiedOrganizationId) {
|
|
20209
|
+
const organizationId = safeEngineeringIdentifier(verifiedOrganizationId);
|
|
20210
|
+
return Effect.annotateCurrentSpan({
|
|
20211
|
+
scope_kind: organizationId === void 0 ? "account" : "organization",
|
|
20212
|
+
account_kind: organizationId === void 0 ? "personalSafe" : "orgTreasury",
|
|
20213
|
+
...Number.isSafeInteger(instructions.chainId) && instructions.chainId > 0 ? { chain_id: instructions.chainId } : {},
|
|
20214
|
+
...instructions.network === "base-sepolia" ? { network: instructions.network } : {},
|
|
20215
|
+
...organizationId === void 0 ? {} : { verified_organization_id: organizationId }
|
|
20216
|
+
});
|
|
18919
20217
|
}
|
|
18920
20218
|
//#endregion
|
|
18921
20219
|
//#region src/accounts/account-phases.ts
|
|
@@ -19464,8 +20762,104 @@ function makeAccountMethods(deps) {
|
|
|
19464
20762
|
};
|
|
19465
20763
|
}
|
|
19466
20764
|
//#endregion
|
|
20765
|
+
//#region src/accounts/organization-approvals.ts
|
|
20766
|
+
/** The Organization Payment prepared for `signerAddress` and checked, before any approval. */
|
|
20767
|
+
async function prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal) {
|
|
20768
|
+
const { organizationId, permissionId, requestKey, lineage, ...item } = input;
|
|
20769
|
+
const intent = organizationPaymentIntent(organizationId, {
|
|
20770
|
+
permissionId,
|
|
20771
|
+
items: [item],
|
|
20772
|
+
...lineage === void 0 ? {} : { lineage },
|
|
20773
|
+
...requestKey === void 0 ? {} : { requestKey }
|
|
20774
|
+
}, true);
|
|
20775
|
+
if (!intent.ok) return intent;
|
|
20776
|
+
const session = deps.actor?.authSession() ?? null;
|
|
20777
|
+
if (session === null || deps.chainId === void 0) return {
|
|
20778
|
+
ok: false,
|
|
20779
|
+
error: Errors.notAuthenticated()
|
|
20780
|
+
};
|
|
20781
|
+
const expected = {
|
|
20782
|
+
...intent.value,
|
|
20783
|
+
requestKey: requestKey ?? `pay_${crypto.randomUUID()}`
|
|
20784
|
+
};
|
|
20785
|
+
const prepared = await runIfActive(signal, CAPXUL_OPERATIONS.organizationPayments.prepareExecution, () => callOperation(deps.convexCall, commands$1.prepareOrganization, {
|
|
20786
|
+
...expected,
|
|
20787
|
+
signerAddress
|
|
20788
|
+
}).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
|
|
20789
|
+
if (!prepared.ok) return prepared;
|
|
20790
|
+
const evidence = prepared.value;
|
|
20791
|
+
if (!(await matchesIntent(expected)(evidence.request, evidence) && await verifiedPreparedCommand(evidence, session.email, signerAddress, deps.chainId))) return abandonPrepared(deps, evidence.executionId, "prepared_mismatch", {
|
|
20792
|
+
ok: false,
|
|
20793
|
+
error: Errors.invalidInput("execution", "prepared Organization Payment mismatch")
|
|
20794
|
+
});
|
|
20795
|
+
await emitPreparedInitiation(deps, evidence);
|
|
20796
|
+
return {
|
|
20797
|
+
ok: true,
|
|
20798
|
+
value: evidence
|
|
20799
|
+
};
|
|
20800
|
+
}
|
|
20801
|
+
/** One fresh Payment read: the caller's own, or one in the Organization's scope. */
|
|
20802
|
+
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, {
|
|
20803
|
+
orgId: organizationId,
|
|
20804
|
+
paymentId
|
|
20805
|
+
}, { fresh: true }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
|
|
20806
|
+
/**
|
|
20807
|
+
* The Payments an approval carries, as they stand. A personal read names only
|
|
20808
|
+
* the caller's own Account's Payments, so an Organization's is read with its
|
|
20809
|
+
* `organizationId`; one that cannot be read is refused, never taken as ended.
|
|
20810
|
+
*/
|
|
20811
|
+
async function readApprovalPayments(deps, paymentIds, organizationId, signal) {
|
|
20812
|
+
const reads = await Promise.all(paymentIds.map((paymentId) => readPayment(deps, paymentId, organizationId, signal)));
|
|
20813
|
+
const payments = [];
|
|
20814
|
+
for (const [index, read] of reads.entries()) {
|
|
20815
|
+
if (!read.ok) return read;
|
|
20816
|
+
const { orgId, payment } = read.value;
|
|
20817
|
+
if (payment === null && organizationId === void 0) return {
|
|
20818
|
+
ok: false,
|
|
20819
|
+
error: Errors.invalidInput("organizationId", "this approval pays from an Organization: wait with its organizationId")
|
|
20820
|
+
};
|
|
20821
|
+
if (payment === null || payment.id !== paymentIds[index] || orgId !== organizationId) return {
|
|
20822
|
+
ok: false,
|
|
20823
|
+
error: Errors.invalidInput("paymentId", "the approval's Payments are not this scope's")
|
|
20824
|
+
};
|
|
20825
|
+
payments.push(normalizePaymentTiming(payment));
|
|
20826
|
+
}
|
|
20827
|
+
return {
|
|
20828
|
+
ok: true,
|
|
20829
|
+
value: payments
|
|
20830
|
+
};
|
|
20831
|
+
}
|
|
20832
|
+
//#endregion
|
|
20833
|
+
//#region src/accounts/bank-approvals.ts
|
|
20834
|
+
/** Read the immutable Payment behind a bank approval before handing it to the person. */
|
|
20835
|
+
async function checkedBankApproval(deps, input, opened) {
|
|
20836
|
+
if (!opened.ok || input.to.kind !== "party_account") return opened;
|
|
20837
|
+
const approval = opened.value;
|
|
20838
|
+
const read = await readApprovalPayments(deps, approval.operation.paymentIds, "organizationId" in input ? input.organizationId : void 0, void 0);
|
|
20839
|
+
if (!read.ok) return read;
|
|
20840
|
+
const [payment] = read.value;
|
|
20841
|
+
let amountMatches = false;
|
|
20842
|
+
try {
|
|
20843
|
+
const funding = toExactAssetAmount(input.amount, CONFIGURED_MONEY_ASSETS);
|
|
20844
|
+
const described = approval.summary.amount === null ? null : toExactAssetAmount(approval.summary.amount, CONFIGURED_MONEY_ASSETS);
|
|
20845
|
+
const stored = payment === void 0 ? null : toExactAssetAmount(payment.amount, CONFIGURED_MONEY_ASSETS);
|
|
20846
|
+
amountMatches = described?.asset === funding.asset && described.minorUnits === funding.minorUnits && stored?.asset === funding.asset && stored.minorUnits === funding.minorUnits;
|
|
20847
|
+
} catch {
|
|
20848
|
+
amountMatches = false;
|
|
20849
|
+
}
|
|
20850
|
+
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;
|
|
20851
|
+
return abandonPrepared(deps, approval.operation.executionId, "prepared_mismatch", {
|
|
20852
|
+
ok: false,
|
|
20853
|
+
error: Errors.invalidInput("approval", "The bank approval does not match its quoted Payment.")
|
|
20854
|
+
});
|
|
20855
|
+
}
|
|
20856
|
+
//#endregion
|
|
19467
20857
|
//#region src/accounts/approval-rules.ts
|
|
19468
|
-
const IN_FLIGHT = /* @__PURE__ */ new Set([
|
|
20858
|
+
const IN_FLIGHT = /* @__PURE__ */ new Set([
|
|
20859
|
+
"pending",
|
|
20860
|
+
"settling",
|
|
20861
|
+
"in_transit"
|
|
20862
|
+
]);
|
|
19469
20863
|
/** A Payment the chain has not decided yet. */
|
|
19470
20864
|
function inFlight(payment) {
|
|
19471
20865
|
return IN_FLIGHT.has(payment.status);
|
|
@@ -19632,9 +21026,10 @@ function toPayrollGroup(wire) {
|
|
|
19632
21026
|
}))
|
|
19633
21027
|
};
|
|
19634
21028
|
}
|
|
21029
|
+
const PayrollWalletItemSchema = PayrollRunItemInputSchema.pipe(Schema.refine((item) => item.to.kind !== "party_account", { message: "Payroll cannot target saved bank accounts" }));
|
|
19635
21030
|
function validateRunItems(input) {
|
|
19636
21031
|
for (const [index, item] of input.items.entries()) {
|
|
19637
|
-
if (Schema.decodeResult(
|
|
21032
|
+
if (Schema.decodeResult(PayrollWalletItemSchema, { onExcessProperty: "error" })(item)._tag === "Failure") return Errors.invalidInput(`items.${index}`, "invalid Payroll item");
|
|
19638
21033
|
try {
|
|
19639
21034
|
const exact = toExactAssetAmount(item.amount, CONFIGURED_MONEY_ASSETS);
|
|
19640
21035
|
const net = BigInt(item.net);
|
|
@@ -19651,7 +21046,7 @@ const RunInputSchema = Schema.Struct({
|
|
|
19651
21046
|
permissionId: AuthorizePayrollRunExecutionInputSchema.fields.permissionId,
|
|
19652
21047
|
asset: AuthorizePayrollRunExecutionInputSchema.fields.asset,
|
|
19653
21048
|
period: AuthorizePayrollRunExecutionInputSchema.fields.period,
|
|
19654
|
-
items:
|
|
21049
|
+
items: Schema.Array(PayrollWalletItemSchema),
|
|
19655
21050
|
requestKey: Schema.optional(AuthorizePayrollRunExecutionInputSchema.fields.requestKey)
|
|
19656
21051
|
});
|
|
19657
21052
|
/** Decode caller input before session or signer work. Keep routing outside the input. */
|
|
@@ -20055,72 +21450,6 @@ async function prepareVerifiedPayrollRun(deps, input, signerAddress, signal) {
|
|
|
20055
21450
|
}, authorized.value.run), authorized.value.replay.kind !== "accepted");
|
|
20056
21451
|
}
|
|
20057
21452
|
//#endregion
|
|
20058
|
-
//#region src/accounts/organization-approvals.ts
|
|
20059
|
-
/** The Organization Payment prepared for `signerAddress` and checked, before any approval. */
|
|
20060
|
-
async function prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal) {
|
|
20061
|
-
const { organizationId, permissionId, requestKey, lineage, ...item } = input;
|
|
20062
|
-
const intent = organizationPaymentIntent(organizationId, {
|
|
20063
|
-
permissionId,
|
|
20064
|
-
items: [item],
|
|
20065
|
-
...lineage === void 0 ? {} : { lineage },
|
|
20066
|
-
...requestKey === void 0 ? {} : { requestKey }
|
|
20067
|
-
}, true);
|
|
20068
|
-
if (!intent.ok) return intent;
|
|
20069
|
-
const session = deps.actor?.authSession() ?? null;
|
|
20070
|
-
if (session === null || deps.chainId === void 0) return {
|
|
20071
|
-
ok: false,
|
|
20072
|
-
error: Errors.notAuthenticated()
|
|
20073
|
-
};
|
|
20074
|
-
const expected = {
|
|
20075
|
-
...intent.value,
|
|
20076
|
-
requestKey: requestKey ?? `pay_${crypto.randomUUID()}`
|
|
20077
|
-
};
|
|
20078
|
-
const prepared = await runIfActive(signal, CAPXUL_OPERATIONS.organizationPayments.prepareExecution, () => callOperation(deps.convexCall, commands$1.prepareOrganization, {
|
|
20079
|
-
...expected,
|
|
20080
|
-
signerAddress
|
|
20081
|
-
}).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
|
|
20082
|
-
if (!prepared.ok) return prepared;
|
|
20083
|
-
const evidence = prepared.value;
|
|
20084
|
-
return await matchesIntent(expected)(evidence.request, evidence) && await verifiedPreparedCommand(evidence, session.email, signerAddress, deps.chainId) ? {
|
|
20085
|
-
ok: true,
|
|
20086
|
-
value: evidence
|
|
20087
|
-
} : abandonPrepared(deps, evidence.executionId, "prepared_mismatch", {
|
|
20088
|
-
ok: false,
|
|
20089
|
-
error: Errors.invalidInput("execution", "prepared Organization Payment mismatch")
|
|
20090
|
-
});
|
|
20091
|
-
}
|
|
20092
|
-
/** One fresh Payment read: the caller's own, or one in the Organization's scope. */
|
|
20093
|
-
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, {
|
|
20094
|
-
orgId: organizationId,
|
|
20095
|
-
paymentId
|
|
20096
|
-
}, { fresh: true }).pipe(Effect.mapError((publicError) => ({ publicError }))), deps.runPromise);
|
|
20097
|
-
/**
|
|
20098
|
-
* The Payments an approval carries, as they stand. A personal read names only
|
|
20099
|
-
* the caller's own Account's Payments, so an Organization's is read with its
|
|
20100
|
-
* `organizationId`; one that cannot be read is refused, never taken as ended.
|
|
20101
|
-
*/
|
|
20102
|
-
async function readApprovalPayments(deps, paymentIds, organizationId, signal) {
|
|
20103
|
-
const reads = await Promise.all(paymentIds.map((paymentId) => readPayment(deps, paymentId, organizationId, signal)));
|
|
20104
|
-
const payments = [];
|
|
20105
|
-
for (const [index, read] of reads.entries()) {
|
|
20106
|
-
if (!read.ok) return read;
|
|
20107
|
-
const { orgId, payment } = read.value;
|
|
20108
|
-
if (payment === null && organizationId === void 0) return {
|
|
20109
|
-
ok: false,
|
|
20110
|
-
error: Errors.invalidInput("organizationId", "this approval pays from an Organization: wait with its organizationId")
|
|
20111
|
-
};
|
|
20112
|
-
if (payment === null || payment.id !== paymentIds[index] || orgId !== organizationId) return {
|
|
20113
|
-
ok: false,
|
|
20114
|
-
error: Errors.invalidInput("paymentId", "the approval's Payments are not this scope's")
|
|
20115
|
-
};
|
|
20116
|
-
payments.push(normalizePaymentTiming(payment));
|
|
20117
|
-
}
|
|
20118
|
-
return {
|
|
20119
|
-
ok: true,
|
|
20120
|
-
value: payments
|
|
20121
|
-
};
|
|
20122
|
-
}
|
|
20123
|
-
//#endregion
|
|
20124
21453
|
//#region src/accounts/approvals.ts
|
|
20125
21454
|
/** A Permission write or an invitation, rather than a Payment. */
|
|
20126
21455
|
const isPermissionChange = (input) => "permission" in input || "invite" in input;
|
|
@@ -20167,20 +21496,24 @@ function makeApprovalsMethods(deps) {
|
|
|
20167
21496
|
if (!prepared.ok) return prepared;
|
|
20168
21497
|
const { executionId } = prepared.value;
|
|
20169
21498
|
const opened = await call(approvals.request.name, approvals.request, { executionId });
|
|
21499
|
+
if (opened.ok && opened.value.operation.executionId !== executionId) return abandonPrepared(deps, executionId, "prepared_mismatch", {
|
|
21500
|
+
ok: false,
|
|
21501
|
+
error: Errors.invalidInput("approval", "The approval names another prepared execution.")
|
|
21502
|
+
});
|
|
20170
21503
|
return opened.ok ? opened : abandonPrepared(deps, executionId, "cancelled", opened);
|
|
20171
21504
|
};
|
|
20172
21505
|
const prepare = async (input, options) => {
|
|
20173
21506
|
const signal = options?.signal;
|
|
20174
21507
|
if (isCommandApproval(input)) return openApproval(signal, (signerAddress) => prepareVerifiedCommand(deps, input, signerAddress, signal));
|
|
20175
21508
|
if (isPermissionChange(input)) return openApproval(signal, async (signerAddress) => {
|
|
20176
|
-
const { prepareVerifiedPermissionChange } = await import("./permission-approvals-
|
|
21509
|
+
const { prepareVerifiedPermissionChange } = await import("./permission-approvals-vDZJpy8H.mjs");
|
|
20177
21510
|
return prepareVerifiedPermissionChange(deps, input, signerAddress, signal);
|
|
20178
21511
|
});
|
|
20179
|
-
if ("organizationId" in input) return openApproval(signal, (signerAddress) => prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal));
|
|
21512
|
+
if ("organizationId" in input) return checkedBankApproval(deps, input, await openApproval(signal, (signerAddress) => prepareVerifiedOrganizationPayment(deps, input, signerAddress, signal)));
|
|
20180
21513
|
const intent = paymentExecutionIntent(input);
|
|
20181
21514
|
if (!intent.ok) return intent;
|
|
20182
21515
|
const { actor, chainId } = deps;
|
|
20183
|
-
return openApproval(signal, async (signerAddress) => {
|
|
21516
|
+
return checkedBankApproval(deps, input, await openApproval(signal, async (signerAddress) => {
|
|
20184
21517
|
if (actor === void 0 || chainId === void 0) return {
|
|
20185
21518
|
ok: false,
|
|
20186
21519
|
error: Errors.notImplemented("approvals", "prepareComposition")
|
|
@@ -20193,7 +21526,7 @@ function makeApprovalsMethods(deps) {
|
|
|
20193
21526
|
}, intent.value, signerAddress, input.requestKey ?? `pay_${crypto.randomUUID()}`, signal);
|
|
20194
21527
|
if (prepared.ok) await emitPreparedPaymentInitiated(deps, prepared.value);
|
|
20195
21528
|
return prepared;
|
|
20196
|
-
});
|
|
21529
|
+
}));
|
|
20197
21530
|
};
|
|
20198
21531
|
const approve = async (approvalId) => {
|
|
20199
21532
|
const { signer } = deps;
|
|
@@ -20655,7 +21988,7 @@ function headlineValuation(balances, displayCurrency, rates = MONEY_READ_RATES)
|
|
|
20655
21988
|
const valuation = valueIn(balances.map((position) => ({
|
|
20656
21989
|
asset: position.asset,
|
|
20657
21990
|
value: pick(position)
|
|
20658
|
-
})), displayCurrency, rates);
|
|
21991
|
+
})).filter((amount) => toRaw(amount, requireAsset(amount.asset)) !== 0n), displayCurrency, rates);
|
|
20659
21992
|
if (valuation.unrated.length > 0) return null;
|
|
20660
21993
|
return valuation.total ?? {
|
|
20661
21994
|
currency: displayCurrency,
|
|
@@ -22264,6 +23597,7 @@ function paymentPhase(status) {
|
|
|
22264
23597
|
switch (status) {
|
|
22265
23598
|
case "pending":
|
|
22266
23599
|
case "settling":
|
|
23600
|
+
case "in_transit":
|
|
22267
23601
|
case "scheduled":
|
|
22268
23602
|
case "streaming": return PENDING;
|
|
22269
23603
|
case "pending_claim": return AWAITING_ACTOR;
|
|
@@ -22318,7 +23652,7 @@ function makeMeMethods(deps) {
|
|
|
22318
23652
|
})), Effect.mapError((publicError) => ({ publicError }))), deps.runPromise),
|
|
22319
23653
|
depositInstructions: (options) => {
|
|
22320
23654
|
const controls = deps.invocationControls?.(options) ?? options;
|
|
22321
|
-
return runPortEffect(callOperation(deps.convexCall, summaries.depositInstructions, copyInvocationObservation(controls, {})).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.tap(
|
|
23655
|
+
return runPortEffect(callOperation(deps.convexCall, summaries.depositInstructions, copyInvocationObservation(controls, {})).pipe(Effect.mapError((publicError) => ({ publicError })), Effect.tap(annotateDepositInstructions)), controls, summaries.depositInstructions.name, deps.runPromise);
|
|
22322
23656
|
}
|
|
22323
23657
|
};
|
|
22324
23658
|
}
|
|
@@ -23224,4 +24558,4 @@ function executeIdentityProductObservation(telemetry, record, state) {
|
|
|
23224
24558
|
return ignoreTransportFailure(() => invocationTelemetry.emit(mapped), "emit", mapped.name).pipe(Effect.andThen(ignoreTransportFailure(after, mapped.name === "auth_signed_out" ? "reset" : "identify", mapped.name)));
|
|
23225
24559
|
}
|
|
23226
24560
|
//#endregion
|
|
23227
|
-
export {
|
|
24561
|
+
export { parseAssetAmount as $, hashPermissionReplacementPreview as $n, EXPECTED_OPERATION_OUTCOMES as $r, isSettingUpLifecycle as $t, registerProductTelemetryInvocation as A, toDurationMs as Ai, onboardings as An, toExactAssetAmount as Ar, safe4337MultiSendUserOpCallData as At, makePaymentsMethods as B, FAILURE_MODES$1 as Bi, invitations as Bn, publicIdentityFailure as Br, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as Bt, AccountReadPortTag as C, AuthClientPortTag as Ci, EXCEPTION_EVENT_NAME as Cn, toPermissionAssignmentId as Cr, SEND_SIGNATURE as Ct, convexCallErrorFromCapxul as D, BrowserAuthCacheAdapter as Di, normalizeCapxulOperation as Dn, currencySymbolFor as Dr, deriveCapxulSafeAddress as Dt, ConvexCallPortTag as E, InMemoryAuthCacheAdapter as Ei, isCapxulOperation as En, ChainIdSchema$1 as Er, TOKENS as Et, decodePayrollRunInput as F, toJwtToken as Fi, PreparedPermissionExecutionSchema as Fn, toWeiAmount as Fr, callOperation as Ft, isCheckoutSettlementConsumed as G, AuthCachePortTag as Gi, workspaces as Gn, runCapxulEffect as Gr, withCapturedAttemptContext as Gt, makeDestinationsMethods as H, isRecord as Hi, roles as Hn, runPortEffect as Hr, observeFailedResult as Ht, toPayrollGroupId as I, toSessionToken as Ii, PermissionCommandViewSchema as In, absurd as Ir, asCapxulError as It, subscribeFreshQuery as J, ORGANIZATION_SETUP_STATUSES as Jn, defectAsCapxulError as Jr, normalizeExceptionErrorKind as Jt, makeTargetsMethods as K, OrganizationSetupSchema as Kn, withVerifiedOrganizationScope as Kr, EXCEPTION_MESSAGE as Kt, makeAccountMethods as L, Errors as Li, PayrollGroupIdSchema as Ln, reference as Lr, toPublicError$1 as Lt, makeApprovalsMethods as M, toEpochSeconds as Mi, commands as Mn, isEvmAddress as Mr, BASE_SEPOLIA_CHAIN_ID as Mt, makePayrollMethods as N, toAuthUserId as Ni, configurations as Nn, toAddress as Nr, MULTI_SEND_CALL_ONLY as Nt, retryIdempotentRead as O, parseAuthSession as Oi, OPERATIONS as On, toAssetId as Or, normalizeSafeSaltEmail as Ot, makeUnavailablePayrollMethods as P, toEmail as Pi, replacements as Pn, toChainId as Pr, SAFE_SENTINEL_OWNERS as Pt, formatAssetAmount as Q, InvitationViewSchema as Qn, CAPXUL_ERROR_CODES as Qr, version as Qt, annotateDepositInstructions as R, CapxulError as Ri, PayrollGroupInputSchema as Rn, makeAuthMethods as Rr, failureDetail as Rt, valueIn as S, AuthClientError as Si, CLI_INVOCATION_KINDS as Sn, toBudgetId as Sr, SEND_BATCH_SIGNATURE as St, TelemetryPortTag as T, globalLocalStorage as Ti, CAPXUL_OPERATIONS as Tn, toRoleKey as Tr, CONFIGURED_MONEY_ASSETS as Tt, makeActorRelationshipMethods as U, readField as Ui, setups as Un, sessionFromActor as Ur, observeSdkClient as Ut, waitForPaymentSubmission as V, isFailureMode as Vi, members as Vn, runIdentityFacade as Vr, postHogFailureObservation as Vt, makeCheckoutMethods as W, AuthCacheError as Wi, treasuries as Wn, observationOnlyControls as Wr, observationContextProps as Wt, assetAmountFromRaw as X, decodeChainCause as Xn, toCapxulResult as Xr, projectSdkException as Xt, abandonPrepared as Y, CHAIN_UPSTREAMS as Yn, runIfActive as Yr, normalizeExceptionOperation as Yt, assetSymbolFor as Z, toOrgId as Zn, formatTraceparent as Zr, safeExceptionLabel as Zt, accountFromAccountPositions as _, isCredentialField as _i, validateHandle as _n, toLowerHex as _r, ROLES_SET_ALLOWANCE_ABI as _t, paymentPhase as a, ClockError as ai, openfortSignerNotReadyCode as an, roleKeyForPermission as ar, fingerprintPaymentIntent as at, MONEY_READ_RATES as b, toPublishableKey as bi, CLI_CAPABILITIES as bn, DurationMsSchema$1 as br, ROLE_MANAGEMENT_SIGNATURES as bt, makePaymentDocumentsMethods as c, BetterAuthNodeLayer as ci, resolveFailureMode as cn, images as cr, resolveOrgPermissionIdentity as ct, SmartAccountPortTag as d, attachInvocationObservation as di, toCountryCode as dn, toAccountId as dr, MULTI_SEND_SELECTOR as dt, ActorFailure as ei, UNOBSERVABLE_SIGNER_STATUS as en, decodePermissionIntent as er, requireAsset as et, smartAccountErrorFromCapxul as f, copyInvocationObservation as fi, toKycTier as fn, PaymentDocumentOptionsSchema as fr, OPERATOR as ft, ConvexAccountLayer as g, redactUrlSecrets as gi, toPartyId as gn, toLowerBytes32 as gr, ROLES_EXEC_TRANSACTION_WITH_ROLE_ABI as gt, makeAccountsMethods as h, redactSecrets as hi, toHandle as hn, toLowerAddress as hr, ROLES_ASSIGN_ROLES_ABI as ht, inboxPhase as i, SystemClockLayer as ii, isSignerNotReadySignal as in, ORG_BUDGET_ACTIONS as ir, canonicalJson as it, wireChainId as j, toEpochMs as ji, authorities as jn, EVM_ADDRESS_RE$1 as jr, buildSafeMultiSendExecTransactionCall as jt, bindProductTelemetryInvocation as k, parseCachedJwt as ki, details as kn, toCurrencyCode as kr, safe4337ExecuteUserOpCallData as kt, makeSmartAccountMethods as l, BetterAuthBrowserLayer as li, makeCurrentUserMethods as ln, bankDetails as lr, CREATE_COMMITMENT_SIGNATURE as lt, PonderIndexerAdapter as m, sanitizeObservationContext as mi, HANDLE_RE as mn, toExactHex as mr, PARAMETER_TYPE as mt, bootIdentityFlow as n, withInvocationParentSpan as ni, injectedWalletSigner as nn, CurrentPolicySchema as nr, isMoneyParseError as nt, requestPhase as o, ClockPortTag as oi, recoverRawDigestSigner as on, diagnostics as or, moneySafeOpDigest as ot, makeHoldingsMethods as p, readInvocationObservation as pi, toTesterKind as pn, isBytes32 as pr, OWNER_COMMITMENT_SIGNATURES as pt, makeVerificationMethods as q, ORGANIZATION_SETUP_REASONS as qn, awaitCapxulResult as qr, SDK_VERSION as qt, makeMeMethods as r, oauthBearerAuthClient as ri, isEcdsaSignatureHex as rn, MONTHLY_REFILL_PERIOD_SECONDS as rr, parseMoney as rt, makeActivityMethods as s, readClockNow as si, signerFailure as sn, AppIdSchema$1 as sr, ZODIAC_MODULE_PROXY_FACTORY as st, executeIdentityProductObservation as t, carryInvocationParentSpan as ti, causeChain as tn, keepRefillOnChange as tr, toRaw as tt, ConvexSmartAccountLayer as u, observationRequestHeaders as ui, makeClientRequestMethods as un, deposits as ur, MODULE_PROXY_FACTORY_ABI as ut, accountPositionsFromWire as v, toAllowedOrigin as vi, redactTelemetryEvent as vn, PAYMENT_DIRECTIONS as vr, ROLES_SET_TRANSACTION_UNWRAPPER_ABI as vt, accountReadErrorFromCapxul as w, detectAuthCacheAdapter as wi, stampTelemetryEnvelope as wn, toPermissionId as wr, CAPXUL_PAYMENTS_V2_ADDRESS as wt, valueActivitySummary as x, authClientPortFromPromiseAdapter as xi, CLI_COMMAND_NAMES as xn, EpochMsSchema$1 as xr, SAFE_ENABLE_MODULE_ABI as xt, positionPeg as y, toAppId as yi, redactTelemetryProps as yn, PAYMENT_STATUSES as yr, ROLES_SET_UP_ABI as yt, makeOrganizationPaymentsMethods as z, isCapxulError as zi, FixedOfferDraftSchema as zn, askIdentity as zr, failureEvidenceProps as zt };
|