@capxul/observability 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 +14 -0
- package/dist/devtools.d.mts +7 -0
- package/dist/devtools.mjs +72 -0
- package/dist/engineering.mjs +119 -105
- package/dist/index.d.mts +5050 -577
- package/dist/index.mjs +2 -2
- package/dist/{src-L9SjUzWV.mjs → src-D6mFWvZL.mjs} +1121 -87
- package/package.json +7 -2
|
@@ -143,6 +143,8 @@ const ZERO_BYTES32 = `0x${"0".repeat(64)}`;
|
|
|
143
143
|
const ASSET_ID_RE = /^eip155:([1-9][0-9]*)\/erc20:(0x[0-9a-f]{40})$/;
|
|
144
144
|
const CURRENCY_SYMBOLS = {
|
|
145
145
|
USD: "$",
|
|
146
|
+
EUR: "€",
|
|
147
|
+
GBP: "£",
|
|
146
148
|
NGN: "NGN",
|
|
147
149
|
GHS: "GHS",
|
|
148
150
|
KES: "KSh",
|
|
@@ -154,6 +156,16 @@ const CURRENCY_SYMBOLS = {
|
|
|
154
156
|
symbol: CURRENCY_SYMBOLS.USD,
|
|
155
157
|
name: "US Dollar"
|
|
156
158
|
},
|
|
159
|
+
{
|
|
160
|
+
code: "EUR",
|
|
161
|
+
symbol: CURRENCY_SYMBOLS.EUR,
|
|
162
|
+
name: "Euro"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
code: "GBP",
|
|
166
|
+
symbol: CURRENCY_SYMBOLS.GBP,
|
|
167
|
+
name: "British Pound"
|
|
168
|
+
},
|
|
157
169
|
{
|
|
158
170
|
code: "NGN",
|
|
159
171
|
symbol: CURRENCY_SYMBOLS.NGN,
|
|
@@ -200,6 +212,13 @@ const AssetAmountSchema = Schema.Struct({
|
|
|
200
212
|
currency: Schema.optional(Schema.Never),
|
|
201
213
|
decimals: Schema.optional(Schema.Never)
|
|
202
214
|
});
|
|
215
|
+
/** Fiat value. Currency never selects or aliases an asset. */
|
|
216
|
+
const MoneySchema = Schema.Struct({
|
|
217
|
+
currency: CurrencyCodeSchema$1,
|
|
218
|
+
value: DecimalStringSchema,
|
|
219
|
+
decimals: Schema.Finite.check(Schema.makeFilter((value) => Number.isSafeInteger(value) && value >= 0 && value <= 255, { message: "must be an integer between 0 and 255" })),
|
|
220
|
+
asset: Schema.optional(Schema.Never)
|
|
221
|
+
});
|
|
203
222
|
//#endregion
|
|
204
223
|
//#region ../protocol/src/primitives/brand-schema.ts
|
|
205
224
|
const lowercasedString = Schema.String.pipe(Schema.decodeTo(Schema.String, {
|
|
@@ -276,6 +295,46 @@ function decodedBase64Size(value) {
|
|
|
276
295
|
}
|
|
277
296
|
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" }));
|
|
278
297
|
//#endregion
|
|
298
|
+
//#region ../protocol/src/documents/money-invoice-schema.ts
|
|
299
|
+
const SIGNATURE_RE$1 = /^0x[0-9a-f]{130}$/;
|
|
300
|
+
const FiatAmountV3Schema = Schema.Struct({
|
|
301
|
+
denomination: Schema.Literal(0),
|
|
302
|
+
currency: CurrencyCodeSchema$1,
|
|
303
|
+
asset: Schema.Literal(""),
|
|
304
|
+
minorUnits: Uint256StringSchema$1,
|
|
305
|
+
decimals: Uint8V3Schema
|
|
306
|
+
});
|
|
307
|
+
const MoneyInvoiceEnvelopeV5Schema = Schema.Struct({
|
|
308
|
+
protocol: Schema.Literal("capxul.payment-document"),
|
|
309
|
+
version: Schema.Literal(5),
|
|
310
|
+
domain: Schema.Struct({
|
|
311
|
+
name: Schema.Literal("CapxulFinancialDocument"),
|
|
312
|
+
version: Schema.Literal("5"),
|
|
313
|
+
chainId: ChainIdSchema$1,
|
|
314
|
+
salt: Schema.Literal("0x7b0fd8a8c3880e03dc03661ad8d3bad2f865203f70562ac8cc01527168b464a3")
|
|
315
|
+
}),
|
|
316
|
+
primaryType: Schema.Literal("Invoice"),
|
|
317
|
+
message: Schema.Struct({
|
|
318
|
+
kind: Schema.Literal(1),
|
|
319
|
+
originId: CanonicalBytes32V3Schema,
|
|
320
|
+
issuedAt: Uint64V3Schema,
|
|
321
|
+
invoiceNumber: ReferenceV3Schema,
|
|
322
|
+
payerRef: AssertionV3Schema,
|
|
323
|
+
payeeRef: AssertionV3Schema,
|
|
324
|
+
amount: FiatAmountV3Schema,
|
|
325
|
+
receivingAccountId: ReferenceV3Schema,
|
|
326
|
+
target: CanonicalAddressV3Schema,
|
|
327
|
+
dueAt: Uint64V3Schema,
|
|
328
|
+
lineItemsHash: CanonicalBytes32V3Schema,
|
|
329
|
+
note: NoteV3Schema,
|
|
330
|
+
discountMinor: Uint256StringSchema$1
|
|
331
|
+
}),
|
|
332
|
+
signature: Schema.optional(Schema.Struct({
|
|
333
|
+
signer: CanonicalAddressV3Schema,
|
|
334
|
+
value: Schema.String.pipe(Schema.refine((value) => SIGNATURE_RE$1.test(value)))
|
|
335
|
+
}))
|
|
336
|
+
});
|
|
337
|
+
//#endregion
|
|
279
338
|
//#region ../protocol/src/documents/schema.ts
|
|
280
339
|
const SIGNATURE_RE = /^0x[0-9a-f]{130}$/;
|
|
281
340
|
const PaymentDocumentDomainV3Schema = Schema.Struct({
|
|
@@ -289,13 +348,7 @@ const ExactAssetV3Schema = Schema.Struct({
|
|
|
289
348
|
minorUnits: Uint256StringSchema$1,
|
|
290
349
|
decimals: Uint8V3Schema
|
|
291
350
|
});
|
|
292
|
-
const ReceiptAmountV3Schema = Schema.Union([Schema.Struct({
|
|
293
|
-
denomination: Schema.Literal(0),
|
|
294
|
-
currency: CurrencyCodeSchema$1,
|
|
295
|
-
asset: Schema.Literal(""),
|
|
296
|
-
minorUnits: Uint256StringSchema$1,
|
|
297
|
-
decimals: Uint8V3Schema
|
|
298
|
-
}), Schema.Struct({
|
|
351
|
+
const ReceiptAmountV3Schema = Schema.Union([FiatAmountV3Schema, Schema.Struct({
|
|
299
352
|
denomination: Schema.Literal(1),
|
|
300
353
|
currency: Schema.Literal(""),
|
|
301
354
|
asset: AssetIdSchema,
|
|
@@ -413,7 +466,11 @@ const InvoiceEnvelopeV4Schema = Schema.Struct({
|
|
|
413
466
|
}),
|
|
414
467
|
signature: Schema.optional(SignatureV3Schema)
|
|
415
468
|
});
|
|
416
|
-
const SupportedPaymentDocumentEnvelopeSchema = Schema.Union([
|
|
469
|
+
const SupportedPaymentDocumentEnvelopeSchema = Schema.Union([
|
|
470
|
+
PaymentDocumentEnvelopeV3Schema,
|
|
471
|
+
InvoiceEnvelopeV4Schema,
|
|
472
|
+
MoneyInvoiceEnvelopeV5Schema
|
|
473
|
+
]);
|
|
417
474
|
//#endregion
|
|
418
475
|
//#region ../protocol/src/documents/read-schema.ts
|
|
419
476
|
const DocumentRefV3Schema = Schema.Struct({
|
|
@@ -428,6 +485,7 @@ const DocumentRefV3Schema = Schema.Struct({
|
|
|
428
485
|
format: Schema.Literals([
|
|
429
486
|
"envelope-v3",
|
|
430
487
|
"envelope-v4",
|
|
488
|
+
"envelope-v5",
|
|
431
489
|
"artifact"
|
|
432
490
|
]),
|
|
433
491
|
role: Schema.Literals([
|
|
@@ -523,22 +581,32 @@ const OrganizationActorRefSchema = Schema.Struct({
|
|
|
523
581
|
orgId: nonEmpty("orgId")
|
|
524
582
|
});
|
|
525
583
|
const ActorRefSchema = Schema.Union([AccountActorRefSchema, OrganizationActorRefSchema]);
|
|
584
|
+
const PartyAccountRefSchema$1 = Schema.Struct({
|
|
585
|
+
kind: Schema.Literal("party_account"),
|
|
586
|
+
partyAccountId: nonEmpty("partyAccountId")
|
|
587
|
+
});
|
|
526
588
|
const hasActorBoundPermission = (actor, orgId, permissionId) => actor.kind === "organization" ? orgId === actor.orgId && permissionId !== void 0 : orgId === void 0 && permissionId === void 0;
|
|
527
|
-
const ActorOrDestinationRefSchema = Schema.Union([
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
589
|
+
const ActorOrDestinationRefSchema = Schema.Union([
|
|
590
|
+
ActorRefSchema,
|
|
591
|
+
Schema.Struct({
|
|
592
|
+
kind: Schema.Literal("destination"),
|
|
593
|
+
destinationId: nonEmpty("destinationId")
|
|
594
|
+
}),
|
|
595
|
+
PartyAccountRefSchema$1
|
|
596
|
+
]);
|
|
531
597
|
const RecipientObservationSchema = Schema.Struct({
|
|
532
598
|
recipient_locator_kind: Schema.Literals([
|
|
533
599
|
"handle",
|
|
534
600
|
"email",
|
|
535
601
|
"party",
|
|
536
|
-
"address"
|
|
602
|
+
"address",
|
|
603
|
+
"party_account"
|
|
537
604
|
]),
|
|
538
605
|
recipient_resolution_status: Schema.Literals([
|
|
539
606
|
"known_party",
|
|
540
607
|
"new_email",
|
|
541
|
-
"external_address"
|
|
608
|
+
"external_address",
|
|
609
|
+
"bank_account"
|
|
542
610
|
]),
|
|
543
611
|
recipient_is_capxul_account: Schema.Boolean,
|
|
544
612
|
recipient_party_id: Schema.optional(Schema.String),
|
|
@@ -549,6 +617,7 @@ const RecipientObservationSchema = Schema.Struct({
|
|
|
549
617
|
])),
|
|
550
618
|
recipient_handle: Schema.optional(Schema.String),
|
|
551
619
|
recipient_address: AddressSchema$1,
|
|
620
|
+
party_account_id: Schema.optional(Schema.String),
|
|
552
621
|
external_address_acknowledged: Schema.Boolean
|
|
553
622
|
});
|
|
554
623
|
//#endregion
|
|
@@ -724,7 +793,7 @@ const PartySchema = Schema.Struct({
|
|
|
724
793
|
status: Schema.Literals(["provisional", "claimed"]),
|
|
725
794
|
displayName: Schema.NullOr(Schema.String),
|
|
726
795
|
handle: Schema.NullOr(Schema.String),
|
|
727
|
-
safeAddress: Schema.String
|
|
796
|
+
safeAddress: Schema.optionalKey(Schema.String)
|
|
728
797
|
});
|
|
729
798
|
Math.floor(Number.MAX_SAFE_INTEGER / 1e3);
|
|
730
799
|
//#endregion
|
|
@@ -740,6 +809,7 @@ Schema.Finite.pipe(Schema.refine((n) => Number.isSafeInteger(n) && n >= 0, { mes
|
|
|
740
809
|
const PAYMENT_STATUSES = [
|
|
741
810
|
"pending",
|
|
742
811
|
"settling",
|
|
812
|
+
"in_transit",
|
|
743
813
|
"unresolved",
|
|
744
814
|
"scheduled",
|
|
745
815
|
"streaming",
|
|
@@ -808,14 +878,22 @@ const PAYMENT_TYPE_FOR_DOCUMENT_KIND = {
|
|
|
808
878
|
function paymentTypeForDocumentKind(kind) {
|
|
809
879
|
return PAYMENT_TYPE_FOR_DOCUMENT_KIND[kind];
|
|
810
880
|
}
|
|
811
|
-
const PaymentRecipient = Schema.Union([
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
881
|
+
const PaymentRecipient = Schema.Union([
|
|
882
|
+
Schema.Struct({
|
|
883
|
+
kind: Schema.Literal("party"),
|
|
884
|
+
partyId: PartyIdSchema,
|
|
885
|
+
label: Schema.String
|
|
886
|
+
}),
|
|
887
|
+
Schema.Struct({
|
|
888
|
+
kind: Schema.Literal("external_address"),
|
|
889
|
+
label: Schema.String
|
|
890
|
+
}),
|
|
891
|
+
Schema.Struct({
|
|
892
|
+
kind: Schema.Literal("party_account"),
|
|
893
|
+
partyAccountId: Schema.String,
|
|
894
|
+
label: Schema.String
|
|
895
|
+
})
|
|
896
|
+
]);
|
|
819
897
|
/** When a Payment's money is released: now, at one time, or streamed over a window. */
|
|
820
898
|
const PaymentTiming = Schema.Union([
|
|
821
899
|
Schema.Struct({ kind: Schema.Literal("instant") }),
|
|
@@ -847,7 +925,8 @@ const PaymentRef = Schema.Union([
|
|
|
847
925
|
Schema.Struct({
|
|
848
926
|
kind: Schema.Literal("party"),
|
|
849
927
|
partyId: PartyIdSchema
|
|
850
|
-
})
|
|
928
|
+
}),
|
|
929
|
+
PartyAccountRefSchema$1
|
|
851
930
|
]);
|
|
852
931
|
/** One Payment as a participant reads it. */
|
|
853
932
|
const Payment = Schema.Struct({
|
|
@@ -876,9 +955,27 @@ const Payment = Schema.Struct({
|
|
|
876
955
|
retryRequired: Schema.Boolean,
|
|
877
956
|
notSent: Schema.optionalKey(Schema.Literal(true))
|
|
878
957
|
})),
|
|
958
|
+
requestedOutput: Schema.optionalKey(MoneySchema),
|
|
959
|
+
outputExact: Schema.optionalKey(Schema.Boolean),
|
|
960
|
+
recipientOnCapxul: Schema.optionalKey(Schema.Boolean),
|
|
961
|
+
recipientWarning: Schema.optionalKey(Schema.Boolean),
|
|
962
|
+
legs: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
963
|
+
kind: Schema.Literals(["funding", "delivery"]),
|
|
964
|
+
state: Schema.Literals([
|
|
965
|
+
"pending",
|
|
966
|
+
"done",
|
|
967
|
+
"failed",
|
|
968
|
+
"refunded"
|
|
969
|
+
])
|
|
970
|
+
}))),
|
|
971
|
+
links: Schema.optionalKey(Schema.Struct({
|
|
972
|
+
quoteId: Schema.String,
|
|
973
|
+
railOperationId: Schema.String,
|
|
974
|
+
refundMovementId: Schema.optionalKey(Schema.String)
|
|
975
|
+
})),
|
|
879
976
|
createdAt: EpochMsSchema$1,
|
|
880
977
|
updatedAt: EpochMsSchema$1
|
|
881
|
-
}).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" })));
|
|
978
|
+
}).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" })));
|
|
882
979
|
//#endregion
|
|
883
980
|
//#region ../protocol/src/payments/value-schema.ts
|
|
884
981
|
const PaymentIdSchema = nonEmpty("paymentId").pipe(Schema.refine((value) => value.length > 0));
|
|
@@ -954,7 +1051,11 @@ const ActivityItemSchema = Schema.Union([Schema.Struct({
|
|
|
954
1051
|
}), Schema.Struct({
|
|
955
1052
|
kind: Schema.Literal("movement"),
|
|
956
1053
|
id: Schema.String,
|
|
957
|
-
classification: Schema.Literals([
|
|
1054
|
+
classification: Schema.Literals([
|
|
1055
|
+
"deposit",
|
|
1056
|
+
"refund",
|
|
1057
|
+
"movement_only_outflow"
|
|
1058
|
+
]),
|
|
958
1059
|
amount: Amount,
|
|
959
1060
|
direction: Direction,
|
|
960
1061
|
counterpartyLabel: Schema.String,
|
|
@@ -1114,7 +1215,7 @@ const ActivityOverlaySchema = Schema.Struct({
|
|
|
1114
1215
|
* cursor, limit or window, a scope the caller does not take part in, or a
|
|
1115
1216
|
* signed-in user whose Account is not ready.
|
|
1116
1217
|
*/
|
|
1117
|
-
const READ = [
|
|
1218
|
+
const READ$1 = [
|
|
1118
1219
|
"NOT_AUTHENTICATED",
|
|
1119
1220
|
"INVALID_INPUT",
|
|
1120
1221
|
...DEFECTS
|
|
@@ -1131,7 +1232,7 @@ const items = {
|
|
|
1131
1232
|
filter: Schema.optionalKey(ActivityFilterSchema)
|
|
1132
1233
|
}),
|
|
1133
1234
|
output: ActivityPageSchema,
|
|
1134
|
-
errors: READ
|
|
1235
|
+
errors: READ$1
|
|
1135
1236
|
}),
|
|
1136
1237
|
/** Per-asset totals and the row count over one window of the actor's activity. */
|
|
1137
1238
|
summary: Operation.query("activity.items.summary", {
|
|
@@ -1140,7 +1241,7 @@ const items = {
|
|
|
1140
1241
|
window: Schema.optionalKey(ActivityRangeSchema)
|
|
1141
1242
|
}),
|
|
1142
1243
|
output: ActivitySummarySchema,
|
|
1143
|
-
errors: READ
|
|
1244
|
+
errors: READ$1
|
|
1144
1245
|
}),
|
|
1145
1246
|
/** One row's exact detail and the reader's annotation; null when the caller cannot read it. */
|
|
1146
1247
|
get: Operation.query("activity.items.get", {
|
|
@@ -1149,7 +1250,7 @@ const items = {
|
|
|
1149
1250
|
actor: Schema.optionalKey(ActivityGetActorSchema)
|
|
1150
1251
|
}),
|
|
1151
1252
|
output: Schema.NullOr(ActivityDetailSchema),
|
|
1152
|
-
errors: READ
|
|
1253
|
+
errors: READ$1
|
|
1153
1254
|
})
|
|
1154
1255
|
};
|
|
1155
1256
|
const annotations = {
|
|
@@ -1168,7 +1269,7 @@ save: Operation.mutation("activity.annotations.save", {
|
|
|
1168
1269
|
output: ActivityAnnotationSchema,
|
|
1169
1270
|
/** An Organization's annotation also needs the caller's exact Account, Safe and command authority. */
|
|
1170
1271
|
errors: [
|
|
1171
|
-
...READ,
|
|
1272
|
+
...READ$1,
|
|
1172
1273
|
"ROLE_PERMISSION_DENIED",
|
|
1173
1274
|
"ACCOUNT_NOT_FOUND",
|
|
1174
1275
|
"SMART_ACCOUNT_MISSING"
|
|
@@ -1183,7 +1284,7 @@ get: Operation.query("activity.overlays.get", {
|
|
|
1183
1284
|
settlementIds: Schema.optionalKey(Schema.Array(Schema.String))
|
|
1184
1285
|
}),
|
|
1185
1286
|
output: ActivityOverlaySchema,
|
|
1186
|
-
errors: READ
|
|
1287
|
+
errors: READ$1
|
|
1187
1288
|
}) };
|
|
1188
1289
|
/** A document read: no session, or a pair the caller may not read or that fails its integrity. */
|
|
1189
1290
|
const DOCUMENT = [
|
|
@@ -1211,6 +1312,259 @@ const documents = {
|
|
|
1211
1312
|
errors: DOCUMENT
|
|
1212
1313
|
})
|
|
1213
1314
|
};
|
|
1315
|
+
const VerificationStateSchema = Schema.Literals([
|
|
1316
|
+
"not_started",
|
|
1317
|
+
"in_progress",
|
|
1318
|
+
"submitted",
|
|
1319
|
+
"needs_more",
|
|
1320
|
+
"liveness_needed",
|
|
1321
|
+
"under_review",
|
|
1322
|
+
"approved",
|
|
1323
|
+
"rejected",
|
|
1324
|
+
"restricted"
|
|
1325
|
+
]);
|
|
1326
|
+
const VerificationQuestionSchema = Schema.Struct({
|
|
1327
|
+
id: Schema.String,
|
|
1328
|
+
label: Schema.String,
|
|
1329
|
+
type: Schema.Literals([
|
|
1330
|
+
"text",
|
|
1331
|
+
"date",
|
|
1332
|
+
"choice",
|
|
1333
|
+
"boolean",
|
|
1334
|
+
"file"
|
|
1335
|
+
]),
|
|
1336
|
+
secret: Schema.Boolean,
|
|
1337
|
+
multiple: Schema.optionalKey(Schema.Boolean),
|
|
1338
|
+
when: Schema.optionalKey(Schema.Struct({
|
|
1339
|
+
field: Schema.String,
|
|
1340
|
+
equals: Schema.Union([Schema.String, Schema.Boolean])
|
|
1341
|
+
})),
|
|
1342
|
+
choices: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
1343
|
+
value: Schema.String,
|
|
1344
|
+
label: Schema.String
|
|
1345
|
+
}))),
|
|
1346
|
+
help: Schema.optionalKey(Schema.String)
|
|
1347
|
+
});
|
|
1348
|
+
const VerificationCurrencySchema = Schema.Struct({
|
|
1349
|
+
currency: Schema.Literals([
|
|
1350
|
+
"usd",
|
|
1351
|
+
"eur",
|
|
1352
|
+
"gbp"
|
|
1353
|
+
]),
|
|
1354
|
+
status: Schema.Literals([
|
|
1355
|
+
"pending",
|
|
1356
|
+
"approved",
|
|
1357
|
+
"needs_more",
|
|
1358
|
+
"rejected",
|
|
1359
|
+
"restricted"
|
|
1360
|
+
])
|
|
1361
|
+
});
|
|
1362
|
+
const Common = {
|
|
1363
|
+
invitationId: Schema.optionalKey(Schema.String),
|
|
1364
|
+
businessStatus: Schema.optionalKey(Schema.Literals([
|
|
1365
|
+
"waiting_people",
|
|
1366
|
+
"in_review",
|
|
1367
|
+
"approved",
|
|
1368
|
+
"rejected",
|
|
1369
|
+
"restricted"
|
|
1370
|
+
])),
|
|
1371
|
+
subjectKind: Schema.optionalKey(Schema.Literals([
|
|
1372
|
+
"person",
|
|
1373
|
+
"business",
|
|
1374
|
+
"business_person"
|
|
1375
|
+
])),
|
|
1376
|
+
organization: Schema.optionalKey(Schema.Struct({
|
|
1377
|
+
id: Schema.String,
|
|
1378
|
+
name: Schema.String
|
|
1379
|
+
})),
|
|
1380
|
+
journeyId: Schema.String,
|
|
1381
|
+
currencies: Schema.Array(VerificationCurrencySchema),
|
|
1382
|
+
next: Schema.Struct({ argv: Schema.Array(Schema.String) })
|
|
1383
|
+
};
|
|
1384
|
+
const VerificationStatusSchema = Schema.Union([
|
|
1385
|
+
Schema.Struct({
|
|
1386
|
+
status: Schema.Literal("not_started"),
|
|
1387
|
+
...Common
|
|
1388
|
+
}),
|
|
1389
|
+
Schema.Struct({
|
|
1390
|
+
status: Schema.Literal("waiting_people"),
|
|
1391
|
+
missingRoles: Schema.Array(Schema.Literals(["control", "signer"])),
|
|
1392
|
+
people: Schema.Array(Schema.Struct({
|
|
1393
|
+
invitationId: Schema.String,
|
|
1394
|
+
name: Schema.String,
|
|
1395
|
+
email: Schema.String,
|
|
1396
|
+
self: Schema.Boolean,
|
|
1397
|
+
status: Schema.Literals([
|
|
1398
|
+
"invited",
|
|
1399
|
+
"submitted",
|
|
1400
|
+
"needs_more"
|
|
1401
|
+
]),
|
|
1402
|
+
delivery: Schema.Literals([
|
|
1403
|
+
"pending",
|
|
1404
|
+
"sent",
|
|
1405
|
+
"failed"
|
|
1406
|
+
])
|
|
1407
|
+
})),
|
|
1408
|
+
...Common
|
|
1409
|
+
}),
|
|
1410
|
+
Schema.Struct({
|
|
1411
|
+
status: Schema.Literal("needs_person"),
|
|
1412
|
+
action: Schema.Literals(["accept_terms", "liveness_check"]),
|
|
1413
|
+
url: Schema.String,
|
|
1414
|
+
...Common
|
|
1415
|
+
}),
|
|
1416
|
+
Schema.Struct({
|
|
1417
|
+
status: Schema.Literal("needs_answers"),
|
|
1418
|
+
questions: Schema.Array(VerificationQuestionSchema),
|
|
1419
|
+
completed: Schema.Array(Schema.Literals([
|
|
1420
|
+
"personal_details",
|
|
1421
|
+
"address",
|
|
1422
|
+
"id"
|
|
1423
|
+
])),
|
|
1424
|
+
issues: Schema.Array(Schema.Struct({
|
|
1425
|
+
fieldId: Schema.String,
|
|
1426
|
+
message: Schema.String
|
|
1427
|
+
})),
|
|
1428
|
+
alternative: Schema.optionalKey(Schema.Struct({
|
|
1429
|
+
action: Schema.Literal("liveness_check"),
|
|
1430
|
+
url: Schema.String
|
|
1431
|
+
})),
|
|
1432
|
+
...Common
|
|
1433
|
+
}),
|
|
1434
|
+
Schema.Struct({
|
|
1435
|
+
status: Schema.Literals([
|
|
1436
|
+
"in_review",
|
|
1437
|
+
"approved",
|
|
1438
|
+
"rejected",
|
|
1439
|
+
"restricted"
|
|
1440
|
+
]),
|
|
1441
|
+
...Common
|
|
1442
|
+
})
|
|
1443
|
+
]);
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region ../protocol/src/banking/schema.ts
|
|
1446
|
+
const BankCurrencySchema = Schema.Literals([
|
|
1447
|
+
"usd",
|
|
1448
|
+
"eur",
|
|
1449
|
+
"gbp"
|
|
1450
|
+
]);
|
|
1451
|
+
const SettlementTokenSchema = Schema.Literals(["usdc", "eurc"]);
|
|
1452
|
+
const BankDetailsStateSchema = Schema.Literals([
|
|
1453
|
+
"requested",
|
|
1454
|
+
"active",
|
|
1455
|
+
"deactivated",
|
|
1456
|
+
"closed",
|
|
1457
|
+
"failed"
|
|
1458
|
+
]);
|
|
1459
|
+
const optionalText$1 = Schema.optionalKey(Schema.String);
|
|
1460
|
+
/** List values are masked. Only an explicit single-currency read reveals these fields. */
|
|
1461
|
+
const BankDetailsFieldsSchema = Schema.Struct({
|
|
1462
|
+
routingNumber: optionalText$1,
|
|
1463
|
+
accountNumber: optionalText$1,
|
|
1464
|
+
iban: optionalText$1,
|
|
1465
|
+
bic: optionalText$1,
|
|
1466
|
+
sortCode: optionalText$1
|
|
1467
|
+
});
|
|
1468
|
+
const BankDetailsSchema = Schema.Struct({
|
|
1469
|
+
receivingAccountId: Schema.String,
|
|
1470
|
+
currency: BankCurrencySchema,
|
|
1471
|
+
state: BankDetailsStateSchema,
|
|
1472
|
+
visibility: Schema.Literals(["masked", "full"]),
|
|
1473
|
+
bankName: optionalText$1,
|
|
1474
|
+
accountHolder: optionalText$1,
|
|
1475
|
+
bankAddress: optionalText$1,
|
|
1476
|
+
paymentRails: Schema.Array(Schema.String),
|
|
1477
|
+
fields: BankDetailsFieldsSchema,
|
|
1478
|
+
destination: Schema.Struct({
|
|
1479
|
+
chainId: Schema.Finite,
|
|
1480
|
+
token: SettlementTokenSchema,
|
|
1481
|
+
address: Schema.String
|
|
1482
|
+
}),
|
|
1483
|
+
developerFeePercent: optionalText$1,
|
|
1484
|
+
minimumDeposit: optionalText$1,
|
|
1485
|
+
notice: optionalText$1
|
|
1486
|
+
});
|
|
1487
|
+
const BankDetailsOverviewSchema = Schema.Struct({
|
|
1488
|
+
accounts: Schema.Array(BankDetailsSchema),
|
|
1489
|
+
verification: Schema.Array(VerificationCurrencySchema)
|
|
1490
|
+
});
|
|
1491
|
+
/** Gross bank money and the net token credit are separate amounts. */
|
|
1492
|
+
const BankDepositSchema = Schema.Struct({
|
|
1493
|
+
bankDepositId: Schema.String,
|
|
1494
|
+
receivingAccountId: Schema.String,
|
|
1495
|
+
currency: BankCurrencySchema,
|
|
1496
|
+
amount: Schema.String,
|
|
1497
|
+
receivedAt: EpochMsSchema$1,
|
|
1498
|
+
sender: optionalText$1,
|
|
1499
|
+
reference: optionalText$1,
|
|
1500
|
+
status: Schema.Literals([
|
|
1501
|
+
"processing",
|
|
1502
|
+
"arriving",
|
|
1503
|
+
"credited",
|
|
1504
|
+
"returned",
|
|
1505
|
+
"below_minimum"
|
|
1506
|
+
]),
|
|
1507
|
+
refundState: Schema.optionalKey(Schema.Literals([
|
|
1508
|
+
"in_flight",
|
|
1509
|
+
"done",
|
|
1510
|
+
"failed"
|
|
1511
|
+
])),
|
|
1512
|
+
credit: Schema.optionalKey(Schema.Struct({
|
|
1513
|
+
amount: AssetAmountSchema,
|
|
1514
|
+
symbol: Schema.Literals(["USDC", "EURC"]),
|
|
1515
|
+
chainId: Schema.Finite,
|
|
1516
|
+
transactionHash: Schema.String,
|
|
1517
|
+
movementId: Schema.String
|
|
1518
|
+
})),
|
|
1519
|
+
match: Schema.optionalKey(Schema.Union([Schema.Struct({
|
|
1520
|
+
kind: Schema.Literal("request"),
|
|
1521
|
+
requestId: Schema.String,
|
|
1522
|
+
reference: Schema.String,
|
|
1523
|
+
how: Schema.Literals(["reference", "manual"])
|
|
1524
|
+
}), Schema.Struct({ kind: Schema.Literal("not_request") })]))
|
|
1525
|
+
});
|
|
1526
|
+
const BankDepositsPageSchema = pageOf(BankDepositSchema);
|
|
1527
|
+
const BankDepositCandidatesPageSchema = pageOf(Schema.Struct({
|
|
1528
|
+
requestId: Schema.String,
|
|
1529
|
+
reference: Schema.String,
|
|
1530
|
+
amount: Schema.Union([AssetAmountSchema, MoneySchema]),
|
|
1531
|
+
dueAt: EpochMsSchema$1,
|
|
1532
|
+
payerPartyId: optionalText$1,
|
|
1533
|
+
payerLabel: optionalText$1
|
|
1534
|
+
}));
|
|
1535
|
+
//#endregion
|
|
1536
|
+
//#region ../protocol/src/payments/payout-schema.ts
|
|
1537
|
+
const PartyAccountRefSchema = Schema.Struct({
|
|
1538
|
+
kind: Schema.Literal("party_account"),
|
|
1539
|
+
partyAccountId: nonEmpty("partyAccountId")
|
|
1540
|
+
});
|
|
1541
|
+
const PaymentQuoteInputSchema = Schema.Struct({
|
|
1542
|
+
actor: Schema.optionalKey(ActorScopeSchema),
|
|
1543
|
+
to: PartyAccountRefSchema,
|
|
1544
|
+
amount: Schema.Union([MoneySchema, AssetAmountSchema]),
|
|
1545
|
+
asset: Schema.optionalKey(AssetIdSchema),
|
|
1546
|
+
requestKey: nonEmpty("requestKey")
|
|
1547
|
+
});
|
|
1548
|
+
const PaymentQuoteSchema = Schema.Struct({
|
|
1549
|
+
quoteId: nonEmpty("quoteId"),
|
|
1550
|
+
partyAccountId: nonEmpty("partyAccountId"),
|
|
1551
|
+
requestedOutput: MoneySchema,
|
|
1552
|
+
outputExact: Schema.Boolean,
|
|
1553
|
+
funding: AssetAmountSchema,
|
|
1554
|
+
expiresAt: Schema.Finite,
|
|
1555
|
+
recipient: Schema.Struct({
|
|
1556
|
+
label: Schema.String,
|
|
1557
|
+
bankName: Schema.optionalKey(Schema.String),
|
|
1558
|
+
last4: Schema.String,
|
|
1559
|
+
currency: BankCurrencySchema,
|
|
1560
|
+
onCapxul: Schema.Boolean
|
|
1561
|
+
}),
|
|
1562
|
+
rate: Schema.optionalKey(DecimalStringSchema),
|
|
1563
|
+
warnings: Schema.Array(Schema.Struct({
|
|
1564
|
+
code: Schema.Literal("RECIPIENT_ON_CAPXUL"),
|
|
1565
|
+
message: Schema.String
|
|
1566
|
+
}))
|
|
1567
|
+
});
|
|
1214
1568
|
//#endregion
|
|
1215
1569
|
//#region ../protocol/src/permissions/value-schema.ts
|
|
1216
1570
|
const PermissionIdSchema = nonEmpty("permissionId").pipe(Schema.refine((value) => value.length > 0));
|
|
@@ -1253,6 +1607,7 @@ const MovementSchema = Schema.Struct({
|
|
|
1253
1607
|
const MovementClassificationSchema = Schema.Literals([
|
|
1254
1608
|
"protocol_settlement",
|
|
1255
1609
|
"deposit",
|
|
1610
|
+
"refund",
|
|
1256
1611
|
"movement_only_outflow"
|
|
1257
1612
|
]);
|
|
1258
1613
|
const MovementAttributionSchema = Schema.Struct({
|
|
@@ -1620,7 +1975,16 @@ const PaymentLedgerRecordSchema = Schema.Union([Schema.Struct({
|
|
|
1620
1975
|
settlementLogIndex: Schema.optional(LogIndexSchema),
|
|
1621
1976
|
settledBlockNumber: Schema.optional(BlockNumberSchema$1),
|
|
1622
1977
|
settledBlockHash: Schema.optional(Bytes32Schema),
|
|
1623
|
-
settledEventLogIndex: Schema.optional(LogIndexSchema)
|
|
1978
|
+
settledEventLogIndex: Schema.optional(LogIndexSchema),
|
|
1979
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
1980
|
+
railOperationId: Schema.optional(nonEmpty("railOperationId")),
|
|
1981
|
+
payoutRecipientLabel: Schema.optional(Schema.String),
|
|
1982
|
+
payoutRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
1983
|
+
payoutWarnRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
1984
|
+
payoutOwnerPartyId: Schema.optional(Schema.String),
|
|
1985
|
+
requestedOutput: Schema.optional(MoneySchema),
|
|
1986
|
+
payoutOutputExact: Schema.optional(Schema.Boolean),
|
|
1987
|
+
refundMovementId: Schema.optional(MovementIdSchema)
|
|
1624
1988
|
}), Schema.Struct({
|
|
1625
1989
|
...PaymentLedgerBaseSchema.fields,
|
|
1626
1990
|
ledgerKind: Schema.Literal("Deposit"),
|
|
@@ -1629,7 +1993,7 @@ const PaymentLedgerRecordSchema = Schema.Union([Schema.Struct({
|
|
|
1629
1993
|
documentHash: Schema.optional(Schema.Never),
|
|
1630
1994
|
permissionId: Schema.optional(Schema.Never),
|
|
1631
1995
|
purposeKind: Schema.optional(Schema.Never)
|
|
1632
|
-
})]).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" }));
|
|
1996
|
+
})]).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" }));
|
|
1633
1997
|
const PaymentCoreErrorSchema = Schema.Union([
|
|
1634
1998
|
Schema.Struct({
|
|
1635
1999
|
code: Schema.Literal("INVALID_TRANSITION"),
|
|
@@ -1680,8 +2044,16 @@ const ProtocolBirthInputSchema = Schema.Struct({
|
|
|
1680
2044
|
documentHash: NonzeroDocumentHashSchema,
|
|
1681
2045
|
documentContentHash: NonzeroDocumentHashSchema,
|
|
1682
2046
|
release: ReleaseTermsSchema,
|
|
2047
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
2048
|
+
railOperationId: Schema.optional(nonEmpty("railOperationId")),
|
|
2049
|
+
payoutRecipientLabel: Schema.optional(Schema.String),
|
|
2050
|
+
payoutRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
2051
|
+
payoutWarnRecipientOnCapxul: Schema.optional(Schema.Boolean),
|
|
2052
|
+
payoutOwnerPartyId: Schema.optional(Schema.String),
|
|
2053
|
+
requestedOutput: Schema.optional(MoneySchema),
|
|
2054
|
+
payoutOutputExact: Schema.optional(Schema.Boolean),
|
|
1683
2055
|
lineage: Schema.optional(PaymentCommandLineageSchema)
|
|
1684
|
-
}).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" }));
|
|
2056
|
+
}).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" }));
|
|
1685
2057
|
const ApplyVerifiedEvidenceCommandSchema = Schema.Struct({
|
|
1686
2058
|
kind: Schema.Literal("apply_verified_evidence"),
|
|
1687
2059
|
paymentId: PaymentIdSchema,
|
|
@@ -1706,7 +2078,11 @@ Schema.Union([
|
|
|
1706
2078
|
paymentIds: Schema.Array(PaymentIdSchema),
|
|
1707
2079
|
userOpHash: Bytes32Schema
|
|
1708
2080
|
}),
|
|
1709
|
-
ApplyVerifiedEvidenceCommandSchema
|
|
2081
|
+
ApplyVerifiedEvidenceCommandSchema,
|
|
2082
|
+
Schema.Struct({
|
|
2083
|
+
kind: Schema.Literal("apply_rail_delivery"),
|
|
2084
|
+
paymentId: PaymentIdSchema
|
|
2085
|
+
})
|
|
1710
2086
|
]);
|
|
1711
2087
|
Schema.Union([
|
|
1712
2088
|
Schema.Struct({
|
|
@@ -1781,12 +2157,11 @@ function paymentDocumentOptionsPayloadSize(options) {
|
|
|
1781
2157
|
}
|
|
1782
2158
|
const PaymentDocumentOptionsSchema = PaymentDocumentOptionsFieldsSchema.check(Schema.makeFilter((options) => paymentDocumentOptionsPayloadSize(options) <= 524288));
|
|
1783
2159
|
const PaymentDocumentOptionsBatchSchema = Schema.Array(PaymentDocumentOptionsSchema).check(Schema.makeFilter((options) => options.length <= 100 && options.reduce((total, itemOptions) => total + paymentDocumentOptionsPayloadSize(itemOptions), 0) <= 524288));
|
|
1784
|
-
//#endregion
|
|
1785
|
-
//#region ../protocol/src/payments/schema/commands.ts
|
|
1786
2160
|
const PaymentBirthItemSchema = Schema.Union([Schema.Struct({
|
|
1787
2161
|
operation: Schema.Literal("send"),
|
|
1788
2162
|
recipient: ActorOrDestinationRefSchema,
|
|
1789
2163
|
amount: AssetAmountSchema,
|
|
2164
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
1790
2165
|
purposeKind: PaymentPurposeKindSchema,
|
|
1791
2166
|
document: Schema.optional(PaymentInstructionInputSchema),
|
|
1792
2167
|
supportingReceipts: Schema.optional(Schema.Array(SupportingReceiptInputSchema)),
|
|
@@ -1806,12 +2181,13 @@ const PaymentBirthItemSchema = Schema.Union([Schema.Struct({
|
|
|
1806
2181
|
operation: Schema.Literal("create_commitment"),
|
|
1807
2182
|
recipient: ActorOrDestinationRefSchema,
|
|
1808
2183
|
amount: AssetAmountSchema,
|
|
2184
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
1809
2185
|
release: ReleaseTermsSchema.pipe(Schema.refine((release) => release.kind === "scheduled" || release.kind === "stream", { message: "Commitment release must be scheduled or stream" })),
|
|
1810
2186
|
purposeKind: PaymentPurposeKindSchema,
|
|
1811
2187
|
document: Schema.optional(PaymentInstructionInputSchema),
|
|
1812
2188
|
supportingReceipts: Schema.optional(Schema.Array(SupportingReceiptInputSchema)),
|
|
1813
2189
|
payroll: Schema.optional(Schema.Never)
|
|
1814
|
-
})]);
|
|
2190
|
+
})]).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" }));
|
|
1815
2191
|
const PaymentBirthCommandSchema = Schema.Struct({
|
|
1816
2192
|
kind: Schema.Literal("birth"),
|
|
1817
2193
|
requestKey: nonEmpty("requestKey"),
|
|
@@ -1923,6 +2299,7 @@ const PaymentExecutionIntentSchema = Schema.Struct({
|
|
|
1923
2299
|
to: PaymentRef,
|
|
1924
2300
|
externalAddressAcknowledged: Schema.optional(Schema.Literal(true)),
|
|
1925
2301
|
amount: AssetAmountSchema,
|
|
2302
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
1926
2303
|
paymentType: Schema.optional(Schema.Literals([
|
|
1927
2304
|
"unspecified",
|
|
1928
2305
|
"invoice",
|
|
@@ -1930,7 +2307,7 @@ const PaymentExecutionIntentSchema = Schema.Struct({
|
|
|
1930
2307
|
"reimbursement"
|
|
1931
2308
|
])),
|
|
1932
2309
|
timing: Schema.optional(PaymentTiming)
|
|
1933
|
-
}).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value)));
|
|
2310
|
+
}).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)));
|
|
1934
2311
|
const PreparePaymentExecutionInputSchema = Schema.Struct({
|
|
1935
2312
|
requestKey: nonEmpty("requestKey"),
|
|
1936
2313
|
signerAddress: AddressSchema$1,
|
|
@@ -1999,6 +2376,7 @@ const SubmittedPaymentCommandExecutionSchema = Schema.Struct({
|
|
|
1999
2376
|
userOpHash: Bytes32Schema,
|
|
2000
2377
|
payments: Schema.Array(Payment)
|
|
2001
2378
|
});
|
|
2379
|
+
const RedirectPaymentRef = PaymentRef.pipe(Schema.refine((recipient) => recipient.kind !== "party_account", { message: "Bank payout recipients cannot receive commitment redirects" }));
|
|
2002
2380
|
const PaymentLifecycleExecutionIntentSchema = Schema.Union([
|
|
2003
2381
|
Schema.Struct({
|
|
2004
2382
|
kind: Schema.Literal("retry"),
|
|
@@ -2015,7 +2393,7 @@ const PaymentLifecycleExecutionIntentSchema = Schema.Union([
|
|
|
2015
2393
|
Schema.Struct({
|
|
2016
2394
|
kind: Schema.Literal("redirect"),
|
|
2017
2395
|
paymentId: PaymentIdSchema,
|
|
2018
|
-
recipient:
|
|
2396
|
+
recipient: RedirectPaymentRef
|
|
2019
2397
|
})
|
|
2020
2398
|
]);
|
|
2021
2399
|
const PreparePaymentLifecycleExecutionInputSchema = Schema.Struct({
|
|
@@ -2042,6 +2420,7 @@ const OrganizationPaymentExecutionItemSchema = Schema.Struct({
|
|
|
2042
2420
|
to: PaymentRef,
|
|
2043
2421
|
externalAddressAcknowledged: Schema.optional(Schema.Literal(true)),
|
|
2044
2422
|
amount: AssetAmountSchema,
|
|
2423
|
+
quoteId: Schema.optional(nonEmpty("quoteId")),
|
|
2045
2424
|
paymentType: Schema.optional(Schema.Literals([
|
|
2046
2425
|
"unspecified",
|
|
2047
2426
|
"invoice",
|
|
@@ -2050,7 +2429,7 @@ const OrganizationPaymentExecutionItemSchema = Schema.Struct({
|
|
|
2050
2429
|
])),
|
|
2051
2430
|
/** When the recipient gets it: instant (the default), or held until a date or over a period. */
|
|
2052
2431
|
timing: Schema.optional(PaymentTiming)
|
|
2053
|
-
}).check(Schema.makeFilter((value) => Schema.is(PaymentDocumentOptionsSchema)(value)));
|
|
2432
|
+
}).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)));
|
|
2054
2433
|
const PrepareOrganizationPaymentExecutionInputSchema = Schema.Struct({
|
|
2055
2434
|
orgId: nonEmpty("orgId"),
|
|
2056
2435
|
permissionId: PermissionIdSchema,
|
|
@@ -2212,7 +2591,11 @@ const ApprovalSummarySchema = Schema.Struct({
|
|
|
2212
2591
|
to: Schema.Struct({ label: Schema.String }),
|
|
2213
2592
|
/** The total, when every item moves one asset; null when nothing moves (a Permission change). */
|
|
2214
2593
|
amount: Schema.NullOr(AssetAmountSchema),
|
|
2215
|
-
network: ApprovalNetworkSchema
|
|
2594
|
+
network: ApprovalNetworkSchema,
|
|
2595
|
+
warnings: Schema.optional(Schema.Array(Schema.Struct({
|
|
2596
|
+
code: Schema.Literal("RECIPIENT_ON_CAPXUL"),
|
|
2597
|
+
message: Schema.String
|
|
2598
|
+
})))
|
|
2216
2599
|
});
|
|
2217
2600
|
/** The exact operation the signature covers: the digest is the one thing the key signs. */
|
|
2218
2601
|
const ApprovalOperationSchema = Schema.Struct({
|
|
@@ -2599,6 +2982,95 @@ const keys = {
|
|
|
2599
2982
|
})
|
|
2600
2983
|
};
|
|
2601
2984
|
//#endregion
|
|
2985
|
+
//#region ../protocol/src/banking/operations.ts
|
|
2986
|
+
const actor$3 = Schema.optionalKey(ActorScopeSchema);
|
|
2987
|
+
const target = {
|
|
2988
|
+
actor: actor$3,
|
|
2989
|
+
currency: BankCurrencySchema
|
|
2990
|
+
};
|
|
2991
|
+
const errors = [
|
|
2992
|
+
"NOT_AUTHENTICATED",
|
|
2993
|
+
"INVALID_INPUT",
|
|
2994
|
+
"ROLE_PERMISSION_DENIED",
|
|
2995
|
+
"ACCOUNT_NOT_FOUND",
|
|
2996
|
+
"SMART_ACCOUNT_MISSING",
|
|
2997
|
+
"PROVIDER_ERROR",
|
|
2998
|
+
...DEFECTS
|
|
2999
|
+
];
|
|
3000
|
+
const writeErrors = [...errors, "WRONG_STATE"];
|
|
3001
|
+
const bankDetails = {
|
|
3002
|
+
list: Operation.query("banking.bankDetails.list", {
|
|
3003
|
+
input: Schema.Struct({ actor: actor$3 }),
|
|
3004
|
+
output: BankDetailsOverviewSchema,
|
|
3005
|
+
errors
|
|
3006
|
+
}),
|
|
3007
|
+
get: Operation.query("banking.bankDetails.get", {
|
|
3008
|
+
input: Schema.Struct(target),
|
|
3009
|
+
output: Schema.NullOr(BankDetailsSchema),
|
|
3010
|
+
errors
|
|
3011
|
+
}),
|
|
3012
|
+
open: Operation.action("banking.bankDetails.open", {
|
|
3013
|
+
input: Schema.Struct(target),
|
|
3014
|
+
output: BankDetailsSchema,
|
|
3015
|
+
errors: writeErrors
|
|
3016
|
+
}),
|
|
3017
|
+
settle: Operation.action("banking.bankDetails.settle", {
|
|
3018
|
+
input: Schema.Struct({
|
|
3019
|
+
...target,
|
|
3020
|
+
token: SettlementTokenSchema
|
|
3021
|
+
}),
|
|
3022
|
+
output: BankDetailsSchema,
|
|
3023
|
+
errors: writeErrors
|
|
3024
|
+
}),
|
|
3025
|
+
deactivate: Operation.action("banking.bankDetails.deactivate", {
|
|
3026
|
+
input: Schema.Struct(target),
|
|
3027
|
+
output: BankDetailsSchema,
|
|
3028
|
+
errors: writeErrors
|
|
3029
|
+
}),
|
|
3030
|
+
reactivate: Operation.action("banking.bankDetails.reactivate", {
|
|
3031
|
+
input: Schema.Struct(target),
|
|
3032
|
+
output: BankDetailsSchema,
|
|
3033
|
+
errors: writeErrors
|
|
3034
|
+
})
|
|
3035
|
+
};
|
|
3036
|
+
const deposits = {
|
|
3037
|
+
list: Operation.query("banking.deposits.list", {
|
|
3038
|
+
input: Schema.Struct({
|
|
3039
|
+
actor: actor$3,
|
|
3040
|
+
cursor: Schema.optionalKey(Schema.String),
|
|
3041
|
+
unmatched: Schema.optionalKey(Schema.Boolean)
|
|
3042
|
+
}),
|
|
3043
|
+
output: BankDepositsPageSchema,
|
|
3044
|
+
errors
|
|
3045
|
+
}),
|
|
3046
|
+
get: Operation.query("banking.deposits.get", {
|
|
3047
|
+
input: Schema.Struct({
|
|
3048
|
+
actor: actor$3,
|
|
3049
|
+
bankDepositId: Schema.String
|
|
3050
|
+
}),
|
|
3051
|
+
output: Schema.NullOr(BankDepositSchema),
|
|
3052
|
+
errors
|
|
3053
|
+
}),
|
|
3054
|
+
candidates: Operation.query("banking.deposits.candidates", {
|
|
3055
|
+
input: Schema.Struct({
|
|
3056
|
+
actor: actor$3,
|
|
3057
|
+
bankDepositId: Schema.String,
|
|
3058
|
+
cursor: Schema.optionalKey(Schema.String)
|
|
3059
|
+
}),
|
|
3060
|
+
output: BankDepositCandidatesPageSchema,
|
|
3061
|
+
errors
|
|
3062
|
+
}),
|
|
3063
|
+
match: Operation.mutation("banking.deposits.match", {
|
|
3064
|
+
input: Schema.Struct({
|
|
3065
|
+
actor: actor$3,
|
|
3066
|
+
bankDepositId: Schema.String,
|
|
3067
|
+
requestId: Schema.NullOr(Schema.String)
|
|
3068
|
+
}),
|
|
3069
|
+
output: BankDepositSchema,
|
|
3070
|
+
errors: writeErrors
|
|
3071
|
+
})
|
|
3072
|
+
};
|
|
3073
|
+
//#endregion
|
|
2602
3074
|
//#region ../protocol/src/documents/operations.ts
|
|
2603
3075
|
/** Every call: no session, or input that does not decode. */
|
|
2604
3076
|
const CALL$8 = ["NOT_AUTHENTICATED", "INVALID_INPUT"];
|
|
@@ -3523,6 +3995,9 @@ function decodeUrlComponent(text) {
|
|
|
3523
3995
|
return text;
|
|
3524
3996
|
}
|
|
3525
3997
|
}
|
|
3998
|
+
function isCoinbaseRpcPath(hostname, segments) {
|
|
3999
|
+
return hostname === "api.developer.coinbase.com" && decodeUrlComponent(segments[1] ?? "") === "rpc" && decodeUrlComponent(segments[2] ?? "") === "v1";
|
|
4000
|
+
}
|
|
3526
4001
|
/** Preserve URL diagnostics while removing credentials from their declared components. */
|
|
3527
4002
|
function redactUrlSecrets(value, source) {
|
|
3528
4003
|
try {
|
|
@@ -3540,9 +4015,10 @@ function redactUrlSecrets(value, source) {
|
|
|
3540
4015
|
const provider = source === "alchemy" || source === "infura" || /(?:^|\.)(?:alchemy\.com|alchemyapi\.io|infura\.io)$/iu.test(url.hostname);
|
|
3541
4016
|
const rawPath = absolute || protocolRelative ? url.pathname : value.split(/[?#]/u)[0] ?? "";
|
|
3542
4017
|
const segments = rawPath.split("/");
|
|
4018
|
+
const coinbaseRpc = isCoinbaseRpcPath(url.hostname, segments);
|
|
3543
4019
|
let path = segments.map((segment, index) => {
|
|
3544
4020
|
const decoded = decodeUrlComponent(segment);
|
|
3545
|
-
const masked = provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
|
|
4021
|
+
const masked = (provider && /^v[23]$/u.test(decodeUrlComponent(segments[index - 1] ?? "")) || coinbaseRpc && index === 4) && decoded.length > 0 ? "[REDACTED]" : maskText(decoded);
|
|
3546
4022
|
changed ||= masked !== decoded;
|
|
3547
4023
|
return masked === decoded ? segment : encodeURIComponent(masked);
|
|
3548
4024
|
}).join("/");
|
|
@@ -4294,6 +4770,159 @@ const setups = {
|
|
|
4294
4770
|
})
|
|
4295
4771
|
};
|
|
4296
4772
|
//#endregion
|
|
4773
|
+
//#region ../protocol/src/parties/accounts-schema.ts
|
|
4774
|
+
const BankAccountOwnerTypeSchema = Schema.Literals(["individual", "business"]);
|
|
4775
|
+
const text = Schema.String;
|
|
4776
|
+
const optionalText = Schema.optionalKey(text);
|
|
4777
|
+
const holder = {
|
|
4778
|
+
holderName: text,
|
|
4779
|
+
bankName: optionalText
|
|
4780
|
+
};
|
|
4781
|
+
const owner = {
|
|
4782
|
+
ownerType: Schema.optionalKey(BankAccountOwnerTypeSchema),
|
|
4783
|
+
firstName: optionalText,
|
|
4784
|
+
lastName: optionalText,
|
|
4785
|
+
businessName: optionalText
|
|
4786
|
+
};
|
|
4787
|
+
const BankBeneficiaryAddressSchema = Schema.Struct({
|
|
4788
|
+
streetLine1: text,
|
|
4789
|
+
streetLine2: optionalText,
|
|
4790
|
+
city: text,
|
|
4791
|
+
state: optionalText,
|
|
4792
|
+
postalCode: optionalText,
|
|
4793
|
+
country: text
|
|
4794
|
+
});
|
|
4795
|
+
const iban = {
|
|
4796
|
+
...holder,
|
|
4797
|
+
currency: Schema.Literal("eur"),
|
|
4798
|
+
iban: text,
|
|
4799
|
+
bic: optionalText
|
|
4800
|
+
};
|
|
4801
|
+
Schema.Union([
|
|
4802
|
+
Schema.Struct({
|
|
4803
|
+
...holder,
|
|
4804
|
+
currency: Schema.Literal("usd"),
|
|
4805
|
+
accountNumber: text,
|
|
4806
|
+
routingNumber: text,
|
|
4807
|
+
accountType: Schema.Literals(["checking", "savings"]),
|
|
4808
|
+
address: BankBeneficiaryAddressSchema
|
|
4809
|
+
}),
|
|
4810
|
+
Schema.Struct({
|
|
4811
|
+
...holder,
|
|
4812
|
+
...owner,
|
|
4813
|
+
currency: Schema.Literal("gbp"),
|
|
4814
|
+
sortCode: text,
|
|
4815
|
+
accountNumber: text
|
|
4816
|
+
}),
|
|
4817
|
+
Schema.Struct({
|
|
4818
|
+
...iban,
|
|
4819
|
+
ownerType: Schema.Literal("individual"),
|
|
4820
|
+
firstName: text,
|
|
4821
|
+
lastName: text
|
|
4822
|
+
}),
|
|
4823
|
+
Schema.Struct({
|
|
4824
|
+
...iban,
|
|
4825
|
+
ownerType: Schema.Literal("business"),
|
|
4826
|
+
businessName: text
|
|
4827
|
+
})
|
|
4828
|
+
]);
|
|
4829
|
+
const BankAccountFilterSchema = Schema.Union([Schema.Struct({ kind: Schema.Literal("self") }), Schema.Struct({
|
|
4830
|
+
kind: Schema.Literal("contact"),
|
|
4831
|
+
ref: RecipientLocatorSchema
|
|
4832
|
+
})]);
|
|
4833
|
+
const BankAccountTargetSchema = Schema.Union([BankAccountFilterSchema, Schema.Struct({
|
|
4834
|
+
kind: Schema.Literal("new"),
|
|
4835
|
+
name: text,
|
|
4836
|
+
email: optionalText
|
|
4837
|
+
})]);
|
|
4838
|
+
const BankAccountSchema = Schema.Struct({
|
|
4839
|
+
partyAccountId: text,
|
|
4840
|
+
ownerPartyId: text,
|
|
4841
|
+
ownerScope: Schema.Literals(["self", "contact"]),
|
|
4842
|
+
currency: BankCurrencySchema,
|
|
4843
|
+
holderName: text,
|
|
4844
|
+
bankName: optionalText,
|
|
4845
|
+
last4: text,
|
|
4846
|
+
state: Schema.Literals([
|
|
4847
|
+
"saved",
|
|
4848
|
+
"active",
|
|
4849
|
+
"inactive"
|
|
4850
|
+
]),
|
|
4851
|
+
recipient: Schema.Struct({
|
|
4852
|
+
ref: RecipientLocatorSchema,
|
|
4853
|
+
label: text,
|
|
4854
|
+
onCapxul: Schema.Boolean
|
|
4855
|
+
})
|
|
4856
|
+
});
|
|
4857
|
+
const BankAccountFieldSchema = Schema.Struct({
|
|
4858
|
+
id: text,
|
|
4859
|
+
label: text,
|
|
4860
|
+
required: Schema.Boolean,
|
|
4861
|
+
choices: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
4862
|
+
value: text,
|
|
4863
|
+
label: text
|
|
4864
|
+
}))),
|
|
4865
|
+
minLength: Schema.optionalKey(nonNegativeInteger("minLength")),
|
|
4866
|
+
maxLength: Schema.optionalKey(nonNegativeInteger("maxLength")),
|
|
4867
|
+
pattern: optionalText
|
|
4868
|
+
});
|
|
4869
|
+
const BankAccountRequirementsSchema = Schema.Struct({
|
|
4870
|
+
currency: BankCurrencySchema,
|
|
4871
|
+
fields: Schema.Array(BankAccountFieldSchema)
|
|
4872
|
+
});
|
|
4873
|
+
//#endregion
|
|
4874
|
+
//#region ../protocol/src/parties/accounts-operations.ts
|
|
4875
|
+
const actor$2 = Schema.optionalKey(ActorScopeSchema);
|
|
4876
|
+
const READ = [
|
|
4877
|
+
"NOT_AUTHENTICATED",
|
|
4878
|
+
"INVALID_INPUT",
|
|
4879
|
+
"ROLE_PERMISSION_DENIED",
|
|
4880
|
+
...DEFECTS
|
|
4881
|
+
];
|
|
4882
|
+
const WRITE = [
|
|
4883
|
+
...READ,
|
|
4884
|
+
"SMART_ACCOUNT_MISSING",
|
|
4885
|
+
"ACCOUNT_NOT_FOUND"
|
|
4886
|
+
];
|
|
4887
|
+
const accounts = {
|
|
4888
|
+
requirements: Operation.query("parties.accounts.requirements", {
|
|
4889
|
+
input: Schema.Struct({
|
|
4890
|
+
actor: actor$2,
|
|
4891
|
+
currency: BankCurrencySchema,
|
|
4892
|
+
ownerType: Schema.optionalKey(BankAccountOwnerTypeSchema),
|
|
4893
|
+
country: Schema.optionalKey(Schema.String)
|
|
4894
|
+
}),
|
|
4895
|
+
output: BankAccountRequirementsSchema,
|
|
4896
|
+
errors: READ
|
|
4897
|
+
}),
|
|
4898
|
+
add: Operation.mutation("parties.accounts.add", {
|
|
4899
|
+
input: Schema.Struct({
|
|
4900
|
+
actor: actor$2,
|
|
4901
|
+
target: BankAccountTargetSchema,
|
|
4902
|
+
details: Schema.Unknown,
|
|
4903
|
+
requestKey: Schema.String
|
|
4904
|
+
}),
|
|
4905
|
+
output: BankAccountSchema,
|
|
4906
|
+
errors: [...WRITE, "PROVIDER_ERROR"]
|
|
4907
|
+
}),
|
|
4908
|
+
list: Operation.query("parties.accounts.list", {
|
|
4909
|
+
input: Schema.Struct({
|
|
4910
|
+
actor: actor$2,
|
|
4911
|
+
target: Schema.optionalKey(BankAccountFilterSchema)
|
|
4912
|
+
}),
|
|
4913
|
+
output: pageOf(BankAccountSchema),
|
|
4914
|
+
errors: READ
|
|
4915
|
+
}),
|
|
4916
|
+
remove: Operation.mutation("parties.accounts.remove", {
|
|
4917
|
+
input: Schema.Struct({
|
|
4918
|
+
actor: actor$2,
|
|
4919
|
+
partyAccountId: Schema.String
|
|
4920
|
+
}),
|
|
4921
|
+
output: Schema.Struct({ partyAccountId: Schema.String }),
|
|
4922
|
+
errors: WRITE
|
|
4923
|
+
})
|
|
4924
|
+
};
|
|
4925
|
+
//#endregion
|
|
4297
4926
|
//#region ../protocol/src/parties/operations.ts
|
|
4298
4927
|
/** Every call: no session, or input that does not decode or validate. */
|
|
4299
4928
|
const CALL$5 = ["NOT_AUTHENTICATED", "INVALID_INPUT"];
|
|
@@ -4306,6 +4935,62 @@ const ADMIN$2 = [
|
|
|
4306
4935
|
"ACCOUNT_NOT_FOUND"
|
|
4307
4936
|
];
|
|
4308
4937
|
const actor$1 = Schema.optionalKey(ActorScopeSchema);
|
|
4938
|
+
const VERIFICATION_ERRORS = [
|
|
4939
|
+
...CALL$5,
|
|
4940
|
+
...DEFECTS,
|
|
4941
|
+
...MEMBER$1,
|
|
4942
|
+
"WRONG_STATE",
|
|
4943
|
+
"PROVIDER_ERROR"
|
|
4944
|
+
];
|
|
4945
|
+
const verificationTarget = {
|
|
4946
|
+
orgId: Schema.optionalKey(Schema.String),
|
|
4947
|
+
invitationId: Schema.optionalKey(Schema.String)
|
|
4948
|
+
};
|
|
4949
|
+
/** Person and business verification. Bridge owns the requirements and the decision. */
|
|
4950
|
+
const verifications$1 = {
|
|
4951
|
+
invite: Operation.action("parties.verifications.invite", {
|
|
4952
|
+
input: Schema.Struct({
|
|
4953
|
+
orgId: Schema.String,
|
|
4954
|
+
people: Schema.Unknown
|
|
4955
|
+
}),
|
|
4956
|
+
output: VerificationStatusSchema,
|
|
4957
|
+
errors: VERIFICATION_ERRORS
|
|
4958
|
+
}),
|
|
4959
|
+
start: Operation.action("parties.verifications.start", {
|
|
4960
|
+
input: Schema.Struct({
|
|
4961
|
+
...verificationTarget,
|
|
4962
|
+
surface: Schema.optionalKey(Schema.Literals([
|
|
4963
|
+
"web",
|
|
4964
|
+
"cli",
|
|
4965
|
+
"agent",
|
|
4966
|
+
"sdk",
|
|
4967
|
+
"unspecified"
|
|
4968
|
+
]))
|
|
4969
|
+
}),
|
|
4970
|
+
output: VerificationStatusSchema,
|
|
4971
|
+
errors: VERIFICATION_ERRORS
|
|
4972
|
+
}),
|
|
4973
|
+
status: Operation.action("parties.verifications.status", {
|
|
4974
|
+
input: Schema.Struct(verificationTarget),
|
|
4975
|
+
output: VerificationStatusSchema,
|
|
4976
|
+
errors: VERIFICATION_ERRORS
|
|
4977
|
+
}),
|
|
4978
|
+
answer: Operation.action("parties.verifications.answer", {
|
|
4979
|
+
input: Schema.Struct({
|
|
4980
|
+
...verificationTarget,
|
|
4981
|
+
answers: Schema.Unknown,
|
|
4982
|
+
surface: Schema.optionalKey(Schema.Literals([
|
|
4983
|
+
"web",
|
|
4984
|
+
"cli",
|
|
4985
|
+
"agent",
|
|
4986
|
+
"sdk",
|
|
4987
|
+
"unspecified"
|
|
4988
|
+
]))
|
|
4989
|
+
}),
|
|
4990
|
+
output: VerificationStatusSchema,
|
|
4991
|
+
errors: VERIFICATION_ERRORS
|
|
4992
|
+
})
|
|
4993
|
+
};
|
|
4309
4994
|
const OneContact = Schema.Struct({
|
|
4310
4995
|
actor: actor$1,
|
|
4311
4996
|
partyId: Schema.String
|
|
@@ -4571,38 +5256,52 @@ const PreparedOfferCheckoutExecutionSchema = Schema.Struct({
|
|
|
4571
5256
|
//#endregion
|
|
4572
5257
|
//#region ../protocol/src/requests/checkout-schema.ts
|
|
4573
5258
|
/** Link holders receive payment terms, not the private Invoice document. */
|
|
4574
|
-
const
|
|
5259
|
+
const InvoiceCheckoutStatusSchema = Schema.Literals([
|
|
5260
|
+
"sent",
|
|
5261
|
+
"pending_settlement",
|
|
5262
|
+
"paid",
|
|
5263
|
+
"cancelled",
|
|
5264
|
+
"declined",
|
|
5265
|
+
"expired",
|
|
5266
|
+
"unavailable"
|
|
5267
|
+
]);
|
|
5268
|
+
const InvoiceCheckoutCommonSchema = Schema.Struct({
|
|
4575
5269
|
documentKind: Schema.optional(Schema.Literals(["memo", "invoice"])),
|
|
4576
5270
|
linkToken: boundedText(128),
|
|
4577
5271
|
issuerLabel: boundedText(256),
|
|
4578
5272
|
dueAt: InvoiceDraftSchema.fields.dueAt,
|
|
5273
|
+
documentHash: Bytes32Schema,
|
|
5274
|
+
status: InvoiceCheckoutStatusSchema
|
|
5275
|
+
});
|
|
5276
|
+
const AssetInvoiceCheckoutSummarySchema = Schema.Struct({
|
|
5277
|
+
...InvoiceCheckoutCommonSchema.fields,
|
|
4579
5278
|
amount: AssetAmountSchema,
|
|
4580
5279
|
chainId: ChainIdSchema$1,
|
|
4581
5280
|
tokenAddress: AddressSchema$1,
|
|
4582
5281
|
rawAmount: Schema.String,
|
|
4583
5282
|
recipientSafe: SafeAddressSchema,
|
|
4584
5283
|
contractAddress: AddressSchema$1,
|
|
4585
|
-
settlementId: Bytes32Schema
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
])
|
|
5284
|
+
settlementId: Bytes32Schema
|
|
5285
|
+
});
|
|
5286
|
+
const MoneyInvoiceCheckoutSummarySchema = Schema.Struct({
|
|
5287
|
+
...InvoiceCheckoutCommonSchema.fields,
|
|
5288
|
+
documentKind: Schema.Literal("invoice"),
|
|
5289
|
+
amount: MoneySchema,
|
|
5290
|
+
bankPayment: Schema.Struct({
|
|
5291
|
+
receivingAccountId: Schema.String,
|
|
5292
|
+
currency: MoneySchema.fields.currency
|
|
5293
|
+
})
|
|
4596
5294
|
});
|
|
5295
|
+
const InvoiceCheckoutSummarySchema = Schema.Union([AssetInvoiceCheckoutSummarySchema, MoneyInvoiceCheckoutSummarySchema]);
|
|
4597
5296
|
const InvoiceCheckoutPreparationSchema = Schema.Struct({
|
|
4598
|
-
invoice:
|
|
5297
|
+
invoice: AssetInvoiceCheckoutSummarySchema,
|
|
4599
5298
|
sourceWallet: AddressSchema$1,
|
|
4600
5299
|
allowance: OfferCheckoutPreparationSchema.fields.allowance,
|
|
4601
5300
|
approval: CheckoutTransactionSchema,
|
|
4602
5301
|
payment: CheckoutTransactionSchema
|
|
4603
5302
|
});
|
|
4604
5303
|
const InvoiceCheckoutStateSchema = Schema.Struct({
|
|
4605
|
-
invoice:
|
|
5304
|
+
invoice: AssetInvoiceCheckoutSummarySchema,
|
|
4606
5305
|
verification: CheckoutStateSchema.fields.verification,
|
|
4607
5306
|
receipt: Schema.NullOr(CheckoutReceiptSchema),
|
|
4608
5307
|
latePayment: Schema.Boolean
|
|
@@ -4632,22 +5331,27 @@ const PrepareInvoiceCheckoutExecutionInputSchema = Schema.Struct({
|
|
|
4632
5331
|
const { checkout: _offerSnapshotField, ...registeredCheckoutExecutionFields } = PreparedOfferCheckoutExecutionSchema.fields;
|
|
4633
5332
|
const PreparedInvoiceCheckoutExecutionSchema = Schema.Struct({
|
|
4634
5333
|
...registeredCheckoutExecutionFields,
|
|
4635
|
-
invoice:
|
|
5334
|
+
invoice: AssetInvoiceCheckoutSummarySchema
|
|
4636
5335
|
});
|
|
4637
5336
|
/** Generic request checkout uses the same fixed obligation and receipt contract. */
|
|
4638
|
-
const
|
|
4639
|
-
...
|
|
5337
|
+
const AssetRequestCheckoutSummarySchema = Schema.Struct({
|
|
5338
|
+
...AssetInvoiceCheckoutSummarySchema.fields,
|
|
4640
5339
|
documentKind: Schema.Literals(["memo", "invoice"])
|
|
4641
5340
|
});
|
|
5341
|
+
const MoneyRequestCheckoutSummarySchema = Schema.Struct({
|
|
5342
|
+
...MoneyInvoiceCheckoutSummarySchema.fields,
|
|
5343
|
+
documentKind: Schema.Literal("invoice")
|
|
5344
|
+
});
|
|
5345
|
+
const RequestCheckoutSummarySchema = Schema.Union([AssetRequestCheckoutSummarySchema, MoneyRequestCheckoutSummarySchema]);
|
|
4642
5346
|
const RequestCheckoutPreparationSchema = Schema.Struct({
|
|
4643
|
-
request:
|
|
5347
|
+
request: AssetRequestCheckoutSummarySchema,
|
|
4644
5348
|
sourceWallet: InvoiceCheckoutPreparationSchema.fields.sourceWallet,
|
|
4645
5349
|
allowance: InvoiceCheckoutPreparationSchema.fields.allowance,
|
|
4646
5350
|
approval: InvoiceCheckoutPreparationSchema.fields.approval,
|
|
4647
5351
|
payment: InvoiceCheckoutPreparationSchema.fields.payment
|
|
4648
5352
|
});
|
|
4649
5353
|
const RequestCheckoutStateSchema = Schema.Struct({
|
|
4650
|
-
request:
|
|
5354
|
+
request: AssetRequestCheckoutSummarySchema,
|
|
4651
5355
|
verification: InvoiceCheckoutStateSchema.fields.verification,
|
|
4652
5356
|
receipt: InvoiceCheckoutStateSchema.fields.receipt,
|
|
4653
5357
|
latePayment: InvoiceCheckoutStateSchema.fields.latePayment
|
|
@@ -4670,7 +5374,7 @@ const RequestCheckoutReconciliationSchema = Schema.Union([
|
|
|
4670
5374
|
]);
|
|
4671
5375
|
const PreparedRequestCheckoutExecutionSchema = Schema.Struct({
|
|
4672
5376
|
...registeredCheckoutExecutionFields,
|
|
4673
|
-
request:
|
|
5377
|
+
request: AssetRequestCheckoutSummarySchema
|
|
4674
5378
|
});
|
|
4675
5379
|
//#endregion
|
|
4676
5380
|
//#region ../protocol/src/payments/witness-schema.ts
|
|
@@ -4702,6 +5406,24 @@ const SendWitnessSchema = Schema.Struct({
|
|
|
4702
5406
|
attempts: Schema.Array(SendAttemptSchema)
|
|
4703
5407
|
});
|
|
4704
5408
|
//#endregion
|
|
5409
|
+
//#region ../protocol/src/payments/payout-operations.ts
|
|
5410
|
+
const quotes = { quote: Operation.action("payments.quotes.quote", {
|
|
5411
|
+
input: PaymentQuoteInputSchema,
|
|
5412
|
+
output: PaymentQuoteSchema,
|
|
5413
|
+
errors: [
|
|
5414
|
+
"NOT_AUTHENTICATED",
|
|
5415
|
+
"INVALID_INPUT",
|
|
5416
|
+
"ROLE_PERMISSION_DENIED",
|
|
5417
|
+
"ACCOUNT_NOT_FOUND",
|
|
5418
|
+
"SMART_ACCOUNT_MISSING",
|
|
5419
|
+
"VERIFICATION_REQUIRED",
|
|
5420
|
+
"INSUFFICIENT_BALANCE",
|
|
5421
|
+
"WRONG_STATE",
|
|
5422
|
+
"PROVIDER_ERROR",
|
|
5423
|
+
...DEFECTS
|
|
5424
|
+
]
|
|
5425
|
+
}) };
|
|
5426
|
+
//#endregion
|
|
4705
5427
|
//#region ../protocol/src/payments/operations.ts
|
|
4706
5428
|
const OrgId$2 = Schema.NonEmptyString;
|
|
4707
5429
|
/** Every call: no session, or input that does not decode or validate. */
|
|
@@ -5879,7 +6601,8 @@ const RequestPartySchema = Schema.Struct({
|
|
|
5879
6601
|
const RequestViewSchema = Schema.Struct({
|
|
5880
6602
|
id: Schema.String,
|
|
5881
6603
|
status: Schema.Literals(REQUEST_STATUSES),
|
|
5882
|
-
amount: AssetAmountSchema,
|
|
6604
|
+
amount: Schema.Union([AssetAmountSchema, MoneySchema]),
|
|
6605
|
+
receivingAccountId: Schema.optionalKey(Schema.String),
|
|
5883
6606
|
reference: Schema.String,
|
|
5884
6607
|
memo: Schema.NullOr(Schema.String),
|
|
5885
6608
|
/** The bearer link a payer follows to the checkout. */
|
|
@@ -5888,6 +6611,7 @@ const RequestViewSchema = Schema.Struct({
|
|
|
5888
6611
|
entitlementGranted: Schema.Boolean,
|
|
5889
6612
|
/** The Payment an approval prepared for this request. */
|
|
5890
6613
|
settledPaymentId: Schema.NullOr(Schema.String),
|
|
6614
|
+
settledDepositRef: Schema.optionalKey(Schema.String),
|
|
5891
6615
|
documents: Schema.Array(DocumentRefV3Schema),
|
|
5892
6616
|
expiresAt: Schema.NullOr(EpochMsSchema$1),
|
|
5893
6617
|
createdAt: EpochMsSchema$1,
|
|
@@ -5902,16 +6626,25 @@ const RequestViewSchema = Schema.Struct({
|
|
|
5902
6626
|
addressedToViewer: Schema.optionalKey(Schema.Boolean)
|
|
5903
6627
|
});
|
|
5904
6628
|
/** Ask a payer for money: a basic request, or one carrying an Invoice. */
|
|
5905
|
-
const
|
|
6629
|
+
const IssueRequestCommonSchema = Schema.Struct({
|
|
5906
6630
|
actor: RequestActorSchema,
|
|
5907
|
-
amount: AssetAmountSchema,
|
|
5908
6631
|
reference: Schema.String,
|
|
5909
6632
|
/** Absent for a link anyone holding it may pay. */
|
|
5910
6633
|
payer: Schema.optionalKey(RecipientLocatorSchema),
|
|
5911
6634
|
memo: Schema.optionalKey(Schema.String),
|
|
5912
|
-
invoice: Schema.optionalKey(InvoiceDraftSchema),
|
|
5913
6635
|
expiresAt: Schema.optionalKey(Schema.Finite)
|
|
5914
6636
|
});
|
|
6637
|
+
const IssueRequestInputSchema = Schema.Union([Schema.Struct({
|
|
6638
|
+
...IssueRequestCommonSchema.fields,
|
|
6639
|
+
amount: AssetAmountSchema,
|
|
6640
|
+
invoice: Schema.optionalKey(InvoiceDraftSchema),
|
|
6641
|
+
receivingAccountId: Schema.optional(Schema.Never)
|
|
6642
|
+
}), Schema.Struct({
|
|
6643
|
+
...IssueRequestCommonSchema.fields,
|
|
6644
|
+
amount: MoneySchema,
|
|
6645
|
+
invoice: InvoiceDraftSchema,
|
|
6646
|
+
receivingAccountId: Schema.String
|
|
6647
|
+
})]);
|
|
5915
6648
|
//#endregion
|
|
5916
6649
|
//#region ../protocol/src/requests/operations.ts
|
|
5917
6650
|
const actor = RequestActorSchema;
|
|
@@ -6345,6 +7078,10 @@ const checkouts = {
|
|
|
6345
7078
|
//#endregion
|
|
6346
7079
|
//#region ../protocol/src/operations.ts
|
|
6347
7080
|
const OPERATIONS = [
|
|
7081
|
+
...Object.values(accounts),
|
|
7082
|
+
...Object.values(quotes),
|
|
7083
|
+
...Object.values(bankDetails),
|
|
7084
|
+
...Object.values(deposits),
|
|
6348
7085
|
...Object.values(sessions),
|
|
6349
7086
|
...Object.values(items),
|
|
6350
7087
|
...Object.values(annotations),
|
|
@@ -6371,6 +7108,7 @@ const OPERATIONS = [
|
|
|
6371
7108
|
...Object.values(treasuries),
|
|
6372
7109
|
...Object.values(setups),
|
|
6373
7110
|
...Object.values(contacts),
|
|
7111
|
+
...Object.values(verifications$1),
|
|
6374
7112
|
...Object.values(destinations),
|
|
6375
7113
|
...Object.values(recipients),
|
|
6376
7114
|
...Object.values(records),
|
|
@@ -6452,9 +7190,11 @@ const PEOPLE_OPERATIONS = {
|
|
|
6452
7190
|
read: "accounts.read",
|
|
6453
7191
|
/** The writes an approval's actions run: the recorded signature, and the scheduled lapse. */
|
|
6454
7192
|
approvals: {
|
|
7193
|
+
consumeApproved: "accounts.approvals.consumeApproved",
|
|
6455
7194
|
expire: "accounts.approvals.expire",
|
|
6456
7195
|
recordApproval: "accounts.approvals.recordApproval",
|
|
6457
|
-
recordExpiry: "accounts.approvals.recordExpiry"
|
|
7196
|
+
recordExpiry: "accounts.approvals.recordExpiry",
|
|
7197
|
+
sendApproved: "accounts.approvals.sendApproved"
|
|
6458
7198
|
},
|
|
6459
7199
|
balances: { readBinding: "accounts.balances.readBinding" },
|
|
6460
7200
|
claims: {
|
|
@@ -6707,9 +7447,38 @@ const ORGANIZATION_OPERATIONS = {
|
|
|
6707
7447
|
load: "organizations.treasuries.load" }
|
|
6708
7448
|
},
|
|
6709
7449
|
/** Parties' internal functions; its public rows join from `OPERATIONS`. */
|
|
6710
|
-
parties: {
|
|
6711
|
-
|
|
6712
|
-
|
|
7450
|
+
parties: {
|
|
7451
|
+
accounts: {
|
|
7452
|
+
register: "parties.accounts.register",
|
|
7453
|
+
prepare: "parties.accounts.prepare",
|
|
7454
|
+
finalize: "parties.accounts.finalize"
|
|
7455
|
+
},
|
|
7456
|
+
verificationSubmit: {
|
|
7457
|
+
send: "parties.verificationSubmit.send",
|
|
7458
|
+
person: "parties.verificationSubmit.person"
|
|
7459
|
+
},
|
|
7460
|
+
verifications: {
|
|
7461
|
+
begin: "parties.verifications.begin",
|
|
7462
|
+
invitePeople: "parties.verifications.invitePeople",
|
|
7463
|
+
loadPeople: "parties.verifications.loadPeople",
|
|
7464
|
+
loadPerson: "parties.verifications.loadPerson",
|
|
7465
|
+
recordPerson: "parties.verifications.recordPerson",
|
|
7466
|
+
recordOwnershipAttestation: "parties.verifications.recordOwnershipAttestation",
|
|
7467
|
+
recordBusinessContact: "parties.verifications.recordBusinessContact",
|
|
7468
|
+
recordBusinessContactRejected: "parties.verifications.recordBusinessContactRejected",
|
|
7469
|
+
deliverPersonInvite: "parties.verifications.deliverPersonInvite",
|
|
7470
|
+
load: "parties.verifications.load",
|
|
7471
|
+
recordSnapshot: "parties.verifications.recordSnapshot",
|
|
7472
|
+
recordPrefill: "parties.verifications.recordPrefill",
|
|
7473
|
+
upload: "parties.verifications.upload",
|
|
7474
|
+
recordDocument: "parties.verifications.recordDocument",
|
|
7475
|
+
loadDocument: "parties.verifications.loadDocument",
|
|
7476
|
+
deleteDocument: "parties.verifications.deleteDocument"
|
|
7477
|
+
},
|
|
7478
|
+
contacts: {
|
|
7479
|
+
/** Posts `contact_relationship_changed` after a contact write commits. */
|
|
7480
|
+
emitRelationshipChanged: "parties.contacts.emitRelationshipChanged" }
|
|
7481
|
+
}
|
|
6713
7482
|
};
|
|
6714
7483
|
//#endregion
|
|
6715
7484
|
//#region src/operations/money.ts
|
|
@@ -6732,10 +7501,6 @@ emitSaved: "activity.annotations.emitSaved" },
|
|
|
6732
7501
|
faucetSafe: { deploy: "FaucetSafe.deploy" },
|
|
6733
7502
|
financialOps: { createPayee: "financialOps.createPayee" },
|
|
6734
7503
|
holdings: { current: "holdings.current" },
|
|
6735
|
-
offramp: {
|
|
6736
|
-
quote: "offramp.quote",
|
|
6737
|
-
status: "offramp.status"
|
|
6738
|
-
},
|
|
6739
7504
|
organizationPayments: {
|
|
6740
7505
|
pay: "organizationPayments.pay",
|
|
6741
7506
|
payBatch: "organizationPayments.payBatch",
|
|
@@ -6918,6 +7683,12 @@ loadBudgetLeft: "permissions.authorities.loadBudgetLeft" },
|
|
|
6918
7683
|
//#endregion
|
|
6919
7684
|
//#region src/operations/platform.ts
|
|
6920
7685
|
const PLATFORM_OPERATIONS = {
|
|
7686
|
+
/** Native Convex deployment requests, before application telemetry can run. */
|
|
7687
|
+
deployments: { convex: {
|
|
7688
|
+
evaluatePush: "deployments.convex.evaluatePush",
|
|
7689
|
+
startPush: "deployments.convex.startPush",
|
|
7690
|
+
finishPush: "deployments.convex.finishPush"
|
|
7691
|
+
} },
|
|
6921
7692
|
/** Applications' internal functions and HTTP endpoints; its public rows join from `OPERATIONS`. */
|
|
6922
7693
|
applications: {
|
|
6923
7694
|
bootstraps: {
|
|
@@ -6952,11 +7723,7 @@ const PLATFORM_OPERATIONS = {
|
|
|
6952
7723
|
/** The scan's read of its saved checkpoint. */
|
|
6953
7724
|
loadCheckpoint: "indexing.movements.loadCheckpoint",
|
|
6954
7725
|
/** The scan's transaction: one window's Movements and its checkpoint. */
|
|
6955
|
-
applyWindow: "indexing.movements.applyWindow"
|
|
6956
|
-
/** Whether a queued `deposit_settled` still describes an included Movement. */
|
|
6957
|
-
isDepositTelemetryCurrent: "indexing.movements.isDepositTelemetryCurrent",
|
|
6958
|
-
/** Posts `deposit_settled` after a Deposit materializes. */
|
|
6959
|
-
emitDepositSettled: "indexing.movements.emitDepositSettled"
|
|
7726
|
+
applyWindow: "indexing.movements.applyWindow"
|
|
6960
7727
|
},
|
|
6961
7728
|
drifts: {
|
|
6962
7729
|
/** The minute cron: compare Convex outcomes to Ponder facts and correct drift. */
|
|
@@ -7034,12 +7801,54 @@ const PLATFORM_OPERATIONS = {
|
|
|
7034
7801
|
}
|
|
7035
7802
|
};
|
|
7036
7803
|
//#endregion
|
|
7804
|
+
//#region src/operations/banking.ts
|
|
7805
|
+
const BANKING_OPERATIONS = { banking: {
|
|
7806
|
+
payouts: {
|
|
7807
|
+
funding: "banking.payouts.funding",
|
|
7808
|
+
prepare: "banking.payouts.prepare",
|
|
7809
|
+
finalize: "banking.payouts.finalize",
|
|
7810
|
+
load: "banking.payouts.load",
|
|
7811
|
+
record: "banking.payouts.record",
|
|
7812
|
+
reconcile: "banking.payouts.reconcile"
|
|
7813
|
+
},
|
|
7814
|
+
deposits: {
|
|
7815
|
+
record: "banking.deposits.record",
|
|
7816
|
+
load: "banking.deposits.load",
|
|
7817
|
+
claimMint: "banking.deposits.claimMint",
|
|
7818
|
+
recordMint: "banking.deposits.recordMint",
|
|
7819
|
+
credit: "banking.deposits.credit",
|
|
7820
|
+
confirm: "banking.deposits.confirm",
|
|
7821
|
+
reconcile: "banking.deposits.reconcile",
|
|
7822
|
+
autoMatch: "banking.deposits.autoMatch"
|
|
7823
|
+
},
|
|
7824
|
+
bankDetails: {
|
|
7825
|
+
prepare: "banking.bankDetails.prepare",
|
|
7826
|
+
finalize: "banking.bankDetails.finalize",
|
|
7827
|
+
load: "banking.bankDetails.load",
|
|
7828
|
+
applyLifecycle: "banking.bankDetails.applyLifecycle"
|
|
7829
|
+
},
|
|
7830
|
+
webhooks: {
|
|
7831
|
+
receive: "banking.webhooks.receive",
|
|
7832
|
+
insert: "banking.webhooks.insert",
|
|
7833
|
+
process: "banking.webhooks.process",
|
|
7834
|
+
load: "banking.webhooks.load",
|
|
7835
|
+
record: "banking.webhooks.record"
|
|
7836
|
+
},
|
|
7837
|
+
reconcile: {
|
|
7838
|
+
catchUp: "banking.reconcile.catchUp",
|
|
7839
|
+
cursor: "banking.reconcile.cursor",
|
|
7840
|
+
advance: "banking.reconcile.advance",
|
|
7841
|
+
recover: "banking.reconcile.recover"
|
|
7842
|
+
}
|
|
7843
|
+
} };
|
|
7844
|
+
//#endregion
|
|
7037
7845
|
//#region src/operations.ts
|
|
7038
7846
|
const CAPXUL_OPERATIONS = withRows({
|
|
7039
7847
|
...PEOPLE_OPERATIONS,
|
|
7040
7848
|
...ORGANIZATION_OPERATIONS,
|
|
7041
7849
|
...MONEY_OPERATIONS,
|
|
7042
|
-
...PLATFORM_OPERATIONS
|
|
7850
|
+
...PLATFORM_OPERATIONS,
|
|
7851
|
+
...BANKING_OPERATIONS
|
|
7043
7852
|
});
|
|
7044
7853
|
/** The named tree, with every operation row added under its own name. */
|
|
7045
7854
|
function withRows(named) {
|
|
@@ -7073,6 +7882,20 @@ function normalizeCapxulOperation(value) {
|
|
|
7073
7882
|
//#endregion
|
|
7074
7883
|
//#region src/catalog/events.ts
|
|
7075
7884
|
const TELEMETRY_EVENT_NAMES = [
|
|
7885
|
+
"verification_started",
|
|
7886
|
+
"verification_terms_accepted",
|
|
7887
|
+
"verification_submitted",
|
|
7888
|
+
"verification_person_invited",
|
|
7889
|
+
"verification_liveness_requested",
|
|
7890
|
+
"verification_information_requested",
|
|
7891
|
+
"verification_approved",
|
|
7892
|
+
"verification_rejected",
|
|
7893
|
+
"bank_details_issued",
|
|
7894
|
+
"bank_deposit_credited",
|
|
7895
|
+
"bank_deposit_returned",
|
|
7896
|
+
"bank_deposit_matched",
|
|
7897
|
+
"banking_webhook_received",
|
|
7898
|
+
"banking_reconcile_completed",
|
|
7076
7899
|
"auth_otp_requested",
|
|
7077
7900
|
"auth_otp_delivered",
|
|
7078
7901
|
"auth_otp_expired",
|
|
@@ -7360,6 +8183,8 @@ const UiStepProps = {
|
|
|
7360
8183
|
* `invoice_issued` carries `issuer_scope_kind`; neither is repeated here.
|
|
7361
8184
|
*/
|
|
7362
8185
|
const JourneyVariantProps = {
|
|
8186
|
+
/** Whose bank verification Bridge decides. */
|
|
8187
|
+
subject_kind: Schema.Literals(["person", "business"]),
|
|
7363
8188
|
/** How a person came to Get started: by themselves, an invite, money that waited, or an invoice. */
|
|
7364
8189
|
entry_path: Schema.optional(Schema.Literals([
|
|
7365
8190
|
"signup",
|
|
@@ -7367,11 +8192,13 @@ const JourneyVariantProps = {
|
|
|
7367
8192
|
"claim",
|
|
7368
8193
|
"invoice"
|
|
7369
8194
|
])),
|
|
7370
|
-
/**
|
|
8195
|
+
/** Caller surface. An undeclared historical caller remains `unspecified`. */
|
|
7371
8196
|
surface: Schema.optional(Schema.Literals([
|
|
7372
8197
|
"web",
|
|
7373
8198
|
"cli",
|
|
7374
|
-
"agent"
|
|
8199
|
+
"agent",
|
|
8200
|
+
"sdk",
|
|
8201
|
+
"unspecified"
|
|
7375
8202
|
])),
|
|
7376
8203
|
/** Who pays: a person from their own account, or an Organization from a Budget. */
|
|
7377
8204
|
payer_kind: Schema.optional(Schema.Literals(["person", "organization"])),
|
|
@@ -7400,6 +8227,11 @@ const JOURNEYS = {
|
|
|
7400
8227
|
finish: "The account is ready: the person's Safe is live",
|
|
7401
8228
|
variants: ["entry_path", "surface"]
|
|
7402
8229
|
},
|
|
8230
|
+
get_verified: {
|
|
8231
|
+
title: "Get verified",
|
|
8232
|
+
finish: "Approved for bank transfers",
|
|
8233
|
+
variants: ["subject_kind", "surface"]
|
|
8234
|
+
},
|
|
7403
8235
|
money_in: {
|
|
7404
8236
|
title: "Money in",
|
|
7405
8237
|
finish: "The first balance above 0",
|
|
@@ -7410,6 +8242,7 @@ const JOURNEYS = {
|
|
|
7410
8242
|
finish: "The payment settles, or the recipient claims it when they had no account",
|
|
7411
8243
|
variants: [
|
|
7412
8244
|
"recipient_is_capxul_account",
|
|
8245
|
+
"recipient_kind",
|
|
7413
8246
|
"payer_kind",
|
|
7414
8247
|
"surface"
|
|
7415
8248
|
]
|
|
@@ -7583,6 +8416,118 @@ const TELEMETRY_JOURNEYS = {
|
|
|
7583
8416
|
}
|
|
7584
8417
|
};
|
|
7585
8418
|
//#endregion
|
|
8419
|
+
//#region src/events/banking.ts
|
|
8420
|
+
const PayoutTelemetryProps = {
|
|
8421
|
+
recipient_kind: Schema.optional(Schema.Literals([
|
|
8422
|
+
"capxul",
|
|
8423
|
+
"wallet",
|
|
8424
|
+
"bank"
|
|
8425
|
+
])),
|
|
8426
|
+
rail: Schema.optional(Schema.Literals(["direct", "bridge"])),
|
|
8427
|
+
recipient_on_capxul: Schema.optional(Schema.Boolean),
|
|
8428
|
+
party_account_id: OptionalString,
|
|
8429
|
+
quote_id: OptionalString,
|
|
8430
|
+
rail_operation_id: OptionalString
|
|
8431
|
+
};
|
|
8432
|
+
/** Issued details are a bank-funding milestone. No account numbers enter this event. */
|
|
8433
|
+
const BankDetailsIssuedTelemetryEventSchema = Schema.Struct({
|
|
8434
|
+
name: Schema.Literal("bank_details_issued"),
|
|
8435
|
+
props: Schema.Struct({
|
|
8436
|
+
...TelemetryEnvelopeProps,
|
|
8437
|
+
receiving_account_id: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u)),
|
|
8438
|
+
currency: Schema.Literals([
|
|
8439
|
+
"usd",
|
|
8440
|
+
"eur",
|
|
8441
|
+
"gbp"
|
|
8442
|
+
]),
|
|
8443
|
+
bank_rail: Schema.Literals([
|
|
8444
|
+
"ach",
|
|
8445
|
+
"wire",
|
|
8446
|
+
"sepa",
|
|
8447
|
+
"faster_payments"
|
|
8448
|
+
]),
|
|
8449
|
+
funding_source: Schema.Literal("bank"),
|
|
8450
|
+
rail: Schema.Literal("bridge"),
|
|
8451
|
+
release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
|
|
8452
|
+
})
|
|
8453
|
+
});
|
|
8454
|
+
const DepositProps = {
|
|
8455
|
+
...TelemetryEnvelopeProps,
|
|
8456
|
+
bank_deposit_id: Schema.String,
|
|
8457
|
+
receiving_account_id: Schema.String,
|
|
8458
|
+
currency: Schema.Literals([
|
|
8459
|
+
"usd",
|
|
8460
|
+
"eur",
|
|
8461
|
+
"gbp"
|
|
8462
|
+
]),
|
|
8463
|
+
bank_rail: Schema.Literals([
|
|
8464
|
+
"ach",
|
|
8465
|
+
"wire",
|
|
8466
|
+
"sepa",
|
|
8467
|
+
"faster_payments"
|
|
8468
|
+
]),
|
|
8469
|
+
rail: Schema.Literal("bridge"),
|
|
8470
|
+
release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
|
|
8471
|
+
};
|
|
8472
|
+
const BankDepositCreditedTelemetryEventSchema = Schema.Struct({
|
|
8473
|
+
name: Schema.Literal("bank_deposit_credited"),
|
|
8474
|
+
props: Schema.Struct({
|
|
8475
|
+
...DepositProps,
|
|
8476
|
+
funding_source: Schema.Literal("bank"),
|
|
8477
|
+
chain_movement_id: Schema.String
|
|
8478
|
+
})
|
|
8479
|
+
});
|
|
8480
|
+
const BankDepositReturnedTelemetryEventSchema = Schema.Struct({
|
|
8481
|
+
name: Schema.Literal("bank_deposit_returned"),
|
|
8482
|
+
props: Schema.Struct({
|
|
8483
|
+
...DepositProps,
|
|
8484
|
+
funding_source: Schema.Literal("bank")
|
|
8485
|
+
})
|
|
8486
|
+
});
|
|
8487
|
+
const BankDepositMatchedTelemetryEventSchema = Schema.Struct({
|
|
8488
|
+
name: Schema.Literal("bank_deposit_matched"),
|
|
8489
|
+
props: Schema.Struct({
|
|
8490
|
+
...DepositProps,
|
|
8491
|
+
request_id: Schema.String,
|
|
8492
|
+
pay_path: Schema.Literal("bank"),
|
|
8493
|
+
issuer_scope_kind: Schema.Literals(["account", "organization"]),
|
|
8494
|
+
match_kind: Schema.Literals(["reference", "manual"])
|
|
8495
|
+
})
|
|
8496
|
+
});
|
|
8497
|
+
/** Journey: none. B0 records provider delivery, not a person's banking outcome. */
|
|
8498
|
+
const BankingWebhookReceivedTelemetryEventSchema = Schema.Struct({
|
|
8499
|
+
name: Schema.Literal("banking_webhook_received"),
|
|
8500
|
+
props: Schema.Struct({
|
|
8501
|
+
...TelemetryEnvelopeProps,
|
|
8502
|
+
release: Schema.optional(Schema.String),
|
|
8503
|
+
signature_result: Schema.Literals([
|
|
8504
|
+
"valid",
|
|
8505
|
+
"missing",
|
|
8506
|
+
"malformed",
|
|
8507
|
+
"stale",
|
|
8508
|
+
"invalid"
|
|
8509
|
+
]),
|
|
8510
|
+
outcome: Schema.Literals([
|
|
8511
|
+
"inserted",
|
|
8512
|
+
"duplicate",
|
|
8513
|
+
"rejected",
|
|
8514
|
+
"failed"
|
|
8515
|
+
]),
|
|
8516
|
+
bridge_event_id: Schema.optional(Schema.String),
|
|
8517
|
+
bridge_event_type: Schema.optional(Schema.String),
|
|
8518
|
+
duration_ms: Schema.Finite
|
|
8519
|
+
})
|
|
8520
|
+
});
|
|
8521
|
+
const BankingReconcileCompletedTelemetryEventSchema = Schema.Struct({
|
|
8522
|
+
name: Schema.Literal("banking_reconcile_completed"),
|
|
8523
|
+
props: Schema.Struct({
|
|
8524
|
+
...TelemetryEnvelopeProps,
|
|
8525
|
+
release: Schema.optional(Schema.String),
|
|
8526
|
+
recovered: Schema.Finite,
|
|
8527
|
+
has_more: Schema.Boolean
|
|
8528
|
+
})
|
|
8529
|
+
});
|
|
8530
|
+
//#endregion
|
|
7586
8531
|
//#region src/events/money.ts
|
|
7587
8532
|
/**
|
|
7588
8533
|
* R08 (#1966): which Safe was read, on which chain, of which token. `currency`
|
|
@@ -7644,12 +8589,14 @@ const RecipientLocatorKindSchema = Schema.Literals([
|
|
|
7644
8589
|
"handle",
|
|
7645
8590
|
"email",
|
|
7646
8591
|
"address",
|
|
7647
|
-
"party"
|
|
8592
|
+
"party",
|
|
8593
|
+
"party_account"
|
|
7648
8594
|
]);
|
|
7649
8595
|
const RecipientResolutionStatusSchema = Schema.Literals([
|
|
7650
8596
|
"known_party",
|
|
7651
8597
|
"new_email",
|
|
7652
|
-
"external_address"
|
|
8598
|
+
"external_address",
|
|
8599
|
+
"bank_account"
|
|
7653
8600
|
]);
|
|
7654
8601
|
const RecipientPartyKindSchema = Schema.Literals([
|
|
7655
8602
|
"person",
|
|
@@ -7657,6 +8604,7 @@ const RecipientPartyKindSchema = Schema.Literals([
|
|
|
7657
8604
|
"unresolved"
|
|
7658
8605
|
]);
|
|
7659
8606
|
const RecipientTelemetryProps = {
|
|
8607
|
+
...PayoutTelemetryProps,
|
|
7660
8608
|
recipient_locator_kind: Schema.optional(RecipientLocatorKindSchema),
|
|
7661
8609
|
recipient_resolution_status: Schema.optional(RecipientResolutionStatusSchema),
|
|
7662
8610
|
recipient_party_id: OptionalString,
|
|
@@ -8209,6 +9157,7 @@ const ActivityFilterProps = {
|
|
|
8209
9157
|
filter_status: Schema.optional(Schema.Array(Schema.Literals([
|
|
8210
9158
|
"pending",
|
|
8211
9159
|
"settling",
|
|
9160
|
+
"in_transit",
|
|
8212
9161
|
"unresolved",
|
|
8213
9162
|
"pending_claim",
|
|
8214
9163
|
"scheduled",
|
|
@@ -8640,6 +9589,18 @@ const CLI_COMMAND_NAMES = [
|
|
|
8640
9589
|
"account.retry",
|
|
8641
9590
|
"balance",
|
|
8642
9591
|
"address",
|
|
9592
|
+
"verify",
|
|
9593
|
+
"verify.start",
|
|
9594
|
+
"verify.status",
|
|
9595
|
+
"bank",
|
|
9596
|
+
"bank.details",
|
|
9597
|
+
"bank.accounts",
|
|
9598
|
+
"bank.accounts.add",
|
|
9599
|
+
"bank.accounts.remove",
|
|
9600
|
+
"bank.pay",
|
|
9601
|
+
"bank.deposits",
|
|
9602
|
+
"bank.match",
|
|
9603
|
+
"bank.settle",
|
|
8643
9604
|
"payment",
|
|
8644
9605
|
"payment.send",
|
|
8645
9606
|
"payment.list",
|
|
@@ -8666,6 +9627,8 @@ const CLI_COMMAND_NAMES = [
|
|
|
8666
9627
|
"offer.deactivate",
|
|
8667
9628
|
"contact",
|
|
8668
9629
|
"contact.add",
|
|
9630
|
+
"contact.bank",
|
|
9631
|
+
"contact.bank.add",
|
|
8669
9632
|
"contact.list",
|
|
8670
9633
|
"contact.get",
|
|
8671
9634
|
"contact.label",
|
|
@@ -8744,6 +9707,8 @@ const CLI_CAPABILITIES = [
|
|
|
8744
9707
|
"diagnostics",
|
|
8745
9708
|
"collection",
|
|
8746
9709
|
"authentication",
|
|
9710
|
+
"verification",
|
|
9711
|
+
"banking",
|
|
8747
9712
|
"account",
|
|
8748
9713
|
"organization",
|
|
8749
9714
|
"contacts",
|
|
@@ -8967,8 +9932,75 @@ const MemberActivationFailedTelemetryEventSchema = Schema.Struct({
|
|
|
8967
9932
|
props: MemberActivationFailedProps
|
|
8968
9933
|
});
|
|
8969
9934
|
//#endregion
|
|
9935
|
+
//#region src/events/verification.ts
|
|
9936
|
+
const Identifier = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/u));
|
|
9937
|
+
const FieldId = Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u));
|
|
9938
|
+
/** Journey: get_verified. Private answers and provider URLs are never properties. */
|
|
9939
|
+
const VerificationProps = Schema.Struct({
|
|
9940
|
+
...TelemetryEnvelopeProps,
|
|
9941
|
+
verification_id: Identifier,
|
|
9942
|
+
invitation_id: Schema.optional(Identifier),
|
|
9943
|
+
party_id: Identifier,
|
|
9944
|
+
subject_kind: JourneyVariantProps.subject_kind,
|
|
9945
|
+
surface: JourneyVariantProps.surface,
|
|
9946
|
+
rail: Schema.Literal("bridge"),
|
|
9947
|
+
verification_state: VerificationStateSchema,
|
|
9948
|
+
missing_field_ids: Schema.optional(Schema.Array(FieldId)),
|
|
9949
|
+
release: Schema.optional(Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/u)))
|
|
9950
|
+
});
|
|
9951
|
+
const VerificationStartedTelemetryEventSchema = Schema.Struct({
|
|
9952
|
+
name: Schema.Literal("verification_started"),
|
|
9953
|
+
props: VerificationProps
|
|
9954
|
+
});
|
|
9955
|
+
const VerificationTermsAcceptedTelemetryEventSchema = Schema.Struct({
|
|
9956
|
+
name: Schema.Literal("verification_terms_accepted"),
|
|
9957
|
+
props: VerificationProps
|
|
9958
|
+
});
|
|
9959
|
+
const VerificationSubmittedTelemetryEventSchema = Schema.Struct({
|
|
9960
|
+
name: Schema.Literal("verification_submitted"),
|
|
9961
|
+
props: VerificationProps
|
|
9962
|
+
});
|
|
9963
|
+
const VerificationPersonInvitedTelemetryEventSchema = Schema.Struct({
|
|
9964
|
+
name: Schema.Literal("verification_person_invited"),
|
|
9965
|
+
props: Schema.Struct({
|
|
9966
|
+
...VerificationProps.fields,
|
|
9967
|
+
subject_kind: Schema.Literal("business"),
|
|
9968
|
+
invitation_id: Identifier
|
|
9969
|
+
})
|
|
9970
|
+
});
|
|
9971
|
+
const VerificationLivenessRequestedTelemetryEventSchema = Schema.Struct({
|
|
9972
|
+
name: Schema.Literal("verification_liveness_requested"),
|
|
9973
|
+
props: VerificationProps
|
|
9974
|
+
});
|
|
9975
|
+
const VerificationInformationRequestedTelemetryEventSchema = Schema.Struct({
|
|
9976
|
+
name: Schema.Literal("verification_information_requested"),
|
|
9977
|
+
props: VerificationProps
|
|
9978
|
+
});
|
|
9979
|
+
const VerificationApprovedTelemetryEventSchema = Schema.Struct({
|
|
9980
|
+
name: Schema.Literal("verification_approved"),
|
|
9981
|
+
props: VerificationProps
|
|
9982
|
+
});
|
|
9983
|
+
const VerificationRejectedTelemetryEventSchema = Schema.Struct({
|
|
9984
|
+
name: Schema.Literal("verification_rejected"),
|
|
9985
|
+
props: VerificationProps
|
|
9986
|
+
});
|
|
9987
|
+
//#endregion
|
|
8970
9988
|
//#region src/catalog/schemas.ts
|
|
8971
9989
|
const TELEMETRY_EVENT_SCHEMAS = {
|
|
9990
|
+
bank_details_issued: BankDetailsIssuedTelemetryEventSchema,
|
|
9991
|
+
bank_deposit_credited: BankDepositCreditedTelemetryEventSchema,
|
|
9992
|
+
bank_deposit_returned: BankDepositReturnedTelemetryEventSchema,
|
|
9993
|
+
bank_deposit_matched: BankDepositMatchedTelemetryEventSchema,
|
|
9994
|
+
verification_started: VerificationStartedTelemetryEventSchema,
|
|
9995
|
+
verification_terms_accepted: VerificationTermsAcceptedTelemetryEventSchema,
|
|
9996
|
+
verification_submitted: VerificationSubmittedTelemetryEventSchema,
|
|
9997
|
+
verification_person_invited: VerificationPersonInvitedTelemetryEventSchema,
|
|
9998
|
+
verification_liveness_requested: VerificationLivenessRequestedTelemetryEventSchema,
|
|
9999
|
+
verification_information_requested: VerificationInformationRequestedTelemetryEventSchema,
|
|
10000
|
+
verification_approved: VerificationApprovedTelemetryEventSchema,
|
|
10001
|
+
verification_rejected: VerificationRejectedTelemetryEventSchema,
|
|
10002
|
+
banking_webhook_received: BankingWebhookReceivedTelemetryEventSchema,
|
|
10003
|
+
banking_reconcile_completed: BankingReconcileCompletedTelemetryEventSchema,
|
|
8972
10004
|
contact_relationship_changed: ContactRelationshipChangedTelemetryEventSchema,
|
|
8973
10005
|
access_recovery_completed: AccessRecoveryCompletedTelemetryEventSchema,
|
|
8974
10006
|
ui_access_step_completed: UiAccessStepCompletedTelemetryEventSchema,
|
|
@@ -9043,6 +10075,8 @@ const TELEMETRY_EVENT_SCHEMAS = {
|
|
|
9043
10075
|
indexer_drift_corrected: IndexerDriftCorrectedTelemetryEventSchema
|
|
9044
10076
|
};
|
|
9045
10077
|
const FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS = [];
|
|
10078
|
+
/** ADR-0020 M00: retain old event decoders, but reject new producers. */
|
|
10079
|
+
const RETIRED_TELEMETRY_EVENTS = ["deposit_initiated", "deposit_settled"];
|
|
9046
10080
|
/**
|
|
9047
10081
|
* Contract-first events whose producer is owned by a later domain node.
|
|
9048
10082
|
*
|
|
@@ -9631,4 +10665,4 @@ var InMemoryTelemetryBusAdapter = class extends EventOnlyPort {
|
|
|
9631
10665
|
}
|
|
9632
10666
|
};
|
|
9633
10667
|
//#endregion
|
|
9634
|
-
export {
|
|
10668
|
+
export { AuthVerifiedTelemetryEventSchema as $, ChainAttemptSchema as $t, BootstrapResolvedTelemetryEventSchema as A, OrganizationCreationReadyTelemetryEventSchema as At, CliCommandCompletedTelemetryEventSchema as B, DepositSettledTelemetryEventSchema as Bt, VerificationInformationRequestedTelemetryEventSchema as C, PermissionMirrorVerificationTelemetryEventSchema as Ct, VerificationSubmittedTelemetryEventSchema as D, OrgInviteProgressedTelemetryEventSchema as Dt, VerificationStartedTelemetryEventSchema as E, OrgInviteExpiredTelemetryEventSchema as Et, OnboardingIntentSelectedTelemetryEventSchema as F, OperationRetriedTelemetryEventSchema as Ft, CLI_COMMAND_NAMES as G, PaymentInitiatedTelemetryEventSchema as Gt, CliDiagnosticCompletedTelemetryEventSchema as H, FaucetFailedTelemetryEventSchema as Ht, OnboardingOrganizationSubmittedTelemetryEventSchema as I, ReceiptPendingTelemetryEventSchema as It, AuthFailedTelemetryEventSchema as J, PaymentVerificationRetryTelemetryEventSchema as Jt, CLI_INVOCATION_KINDS as K, PaymentLifecycleTransitionTelemetryEventSchema as Kt, OnboardingProfileSubmittedTelemetryEventSchema as L, AccountBalanceFailedTelemetryEventSchema as Lt, MemberActivationReadyTelemetryEventSchema as M, UiContactActionCompletedTelemetryEventSchema as Mt, MemberActivationStartedTelemetryEventSchema as N, BundlerErrorTelemetryEventSchema as Nt, VerificationTermsAcceptedTelemetryEventSchema as O, OrgInviteSentTelemetryEventSchema as Ot, OnboardingDashboardReachedTelemetryEventSchema as P, ChainUpstreamFallbackTelemetryEventSchema as Pt, AuthSignedOutTelemetryEventSchema as Q, CAPXUL_ENVS as Qt, ProvisioningSafeConfirmedTelemetryEventSchema as R, AccountBalanceReadTelemetryEventSchema as Rt, VerificationApprovedTelemetryEventSchema as S, MovementScanWindowTelemetryEventSchema as St, VerificationRejectedTelemetryEventSchema as T, OrgInviteAcceptedTelemetryEventSchema as Tt, CliFirstUsedTelemetryEventSchema as U, FaucetRequestedTelemetryEventSchema as Ut, CliCommandStartedTelemetryEventSchema as V, FaucetConfirmedTelemetryEventSchema as Vt, CLI_CAPABILITIES as W, PaymentFailedTelemetryEventSchema as Wt, AuthOtpExpiredTelemetryEventSchema as X, JOURNEYS as Xt, AuthOtpDeliveredTelemetryEventSchema as Y, QuickPayExternalAddressAcknowledgedTelemetryEventSchema as Yt, AuthOtpRequestedTelemetryEventSchema as Z, TELEMETRY_JOURNEYS as Zt, CONTRACT_FIRST_TELEMETRY_EVENTS as _, redactSecrets as _n, ActivityAnnotationSavedTelemetryEventSchema as _t, initializeCapxulBrowserAnalytics as a, PII as an, NativeAuthorizationReviewedTelemetryEventSchema as at, RETIRED_TELEMETRY_EVENTS as b, CAPXUL_ERROR_CODES as bn, MovementScanCheckpointTelemetryEventSchema as bt, utilityAppAnalytics as c, SYNCABLE_CAPXUL_ENVS as cn, InvoiceIssuedTelemetryEventSchema as ct, redactTelemetryEvent as d, TELEMETRY_EVENT_NAMES as dn, PayrollRunTransitionedTelemetryEventSchema as dt, ChainUpstreamSchema as en, IdentityRefusedTelemetryEventSchema as et, redactTelemetryProps as f, CAPXUL_OPERATIONS as fn, UiApprovalSignInRequiredTelemetryEventSchema as ft, BROWSER_GATED_TELEMETRY_EVENTS as g, ORGANIZATION_SETUP_STATUSES as gn, UiTreasuryStepCompletedTelemetryEventSchema as gt, track as h, ORGANIZATION_SETUP_REASONS as hn, UiReceiveStepCompletedTelemetryEventSchema as ht, createPostHogBrowserPageviewTracker as i, JourneyVariantProps as in, NativeAuthorizationFailedTelemetryEventSchema as it, MemberActivationFailedTelemetryEventSchema as j, OrganizationCreationStartedTelemetryEventSchema as jt, BootstrapFailedTelemetryEventSchema as k, OrganizationCreationFailedTelemetryEventSchema as kt, sanitizePostHogBrowserEvent as l, TELEMETRY_PRODUCERS as ln, InvoiceRequestTransitionedTelemetryEventSchema as lt, setTrackHandler as m, normalizeCapxulOperation as mn, UiPayrollActionCompletedTelemetryEventSchema as mt, RecordingTelemetryAdapter as n, EXPECTED_OUTCOME_EVENT_NAME as nn, NativeAuthorizationConnectedTelemetryEventSchema as nt, initializePostHogBrowserAnalytics as o, ResponseHeadersSchema as on, NativeAuthorizationStartedTelemetryEventSchema as ot, getTrackHandler as p, isCapxulOperation as pn, UiInvoiceStepCompletedTelemetryEventSchema as pt, AccessRecoveryCompletedTelemetryEventSchema as q, PaymentSettledTelemetryEventSchema as qt, createCapxulBeforeSend as r, FailureModeSchema as rn, NativeAuthorizationDeniedTelemetryEventSchema as rt, productAppAnalytics as s, SDK_EXPECTED_OUTCOME_EVENT_NAME as sn, UiAccessStepCompletedTelemetryEventSchema as st, InMemoryTelemetryBusAdapter as t, EXCEPTION_EVENT_NAME as tn, NativeAuthorizationAcceptedTelemetryEventSchema as tt, maskCapturedNetworkRequest as u, stampTelemetryEnvelope as un, PayrollGroupChangedTelemetryEventSchema as ut, FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS as v, redactUrlSecrets as vn, UiActivityActionCompletedTelemetryEventSchema as vt, VerificationLivenessRequestedTelemetryEventSchema as w, ContactRelationshipChangedTelemetryEventSchema as wt, TELEMETRY_EVENT_SCHEMAS as x, FAILURE_MODES as xn, MovementScanIncidentTelemetryEventSchema as xt, PRODUCT_MAPPER_GATED_TELEMETRY_EVENTS as y, isCredentialField as yn, IndexerDriftCorrectedTelemetryEventSchema as yt, ProvisioningSafeCreatedTelemetryEventSchema as z, DepositInitiatedTelemetryEventSchema as zt };
|