@capxul/sdk 3.1.0 → 4.0.0
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 +15 -9
- package/dist/{OAuthBearerAuthClient-DfS4QOg7.mjs → OAuthBearerAuthClient-BHvDR8_0.mjs} +1 -1
- package/dist/{OAuthBearerAuthClient-BxTiv8dg.d.mts → OAuthBearerAuthClient-D-DLYlKj.d.mts} +1 -1
- package/dist/{clock-m_aHLaNm.mjs → clock-C2AUlq1V.mjs} +35 -2
- package/dist/{create-capxul-client-dk67qjlK.mjs → create-capxul-client-DyCEJZtD.mjs} +6557 -5691
- package/dist/index.d.mts +421 -5
- package/dist/index.mjs +41 -15
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +2 -2
- package/dist/{observation-B3PCugGC.d.mts → observation-DtzTdv20.d.mts} +103 -68
- package/dist/{signer-BpjdawiY.d.mts → signer-C0hZ6Kiy.d.mts} +14 -7
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +7 -7
- package/package.json +6 -6
package/dist/node/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-
|
|
1
|
+
import { D as toAddress, a as parseCachedJwt, i as parseAuthSession, n as InMemoryAuthCacheAdapter, o as AuthCacheError, r as BrowserAuthCacheAdapter, s as AuthCachePortTag } from "../clock-C2AUlq1V.mjs";
|
|
2
|
+
import { t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-BHvDR8_0.mjs";
|
|
3
3
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
4
4
|
import { privateKeyToAccount } from "viem/accounts";
|
|
5
5
|
import * as os from "node:os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Hex } from "viem";
|
|
1
|
+
import { $ as PublishableKey, A as AppId, D as AllowanceKey, E as Address$1, F as ChainId, G as OrgId, H as EpochMs, I as CountryCode, J as PayrollGroupId, K as PartyId, L as CurrencyCode, M as AuthUserId, N as BlockNumber, O as AllowedOrigin, P as BudgetId, Q as Profile, R as DocumentHash, St as FailureMode, V as Email, W as Money, X as PermissionAssignmentId, Y as PayrollRunId, Z as PermissionId, _ as ClockPort, a as SignerStatusStore, at as WeiAmount, c as AccountProviderSource, et as RoleKey, ft as CapxulError, g as SmartAccount$1, gt as Failure, h as Session$1, it as TxHash, j as AuthSession, k as AnonymousDistinctId, l as AccountRequirement, m as Profile$1, mt as CapxulErrorDetails, n as CapxulSigner, nt as SmartAccount, p as CapxulResult, pt as CapxulErrorCode, q as PaymentCommandId, rt as TesterKind, tt as SessionToken, v as AuthClientPort, w as Account$1, x as AuthCachePort, y as CanSendOtpStatus, z as DurationMs } from "./signer-C0hZ6Kiy.mjs";
|
|
3
2
|
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
3
|
+
import { Hex } from "viem";
|
|
4
4
|
import { FunctionReference } from "convex/server";
|
|
5
5
|
//#region src/domain/machine/shell.d.ts
|
|
6
6
|
declare const INVOCATION_PARENT_SPAN: unique symbol;
|
|
@@ -260,6 +260,7 @@ declare const isClaimed: (state: IdentityState) => boolean;
|
|
|
260
260
|
*/
|
|
261
261
|
interface HandledErrorReportContext {
|
|
262
262
|
readonly layer?: string;
|
|
263
|
+
/** Host input is normalized at the reporting boundary. */
|
|
263
264
|
readonly operation?: string;
|
|
264
265
|
readonly failure_mode?: FailureMode;
|
|
265
266
|
readonly provider?: string;
|
|
@@ -278,7 +279,7 @@ interface TelemetryPort {
|
|
|
278
279
|
}
|
|
279
280
|
//#endregion
|
|
280
281
|
//#region ../observability/src/index.d.ts
|
|
281
|
-
declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident"];
|
|
282
|
+
declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "payment_lifecycle_transition", "quick_pay_external_address_acknowledged", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident"];
|
|
282
283
|
type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
|
|
283
284
|
type TelemetryProps = Record<string, unknown>;
|
|
284
285
|
type TelemetryEvent = {
|
|
@@ -322,8 +323,10 @@ type EngineeringTelemetryBootstrapPolicyV1 = Schema.Schema.Type<typeof Engineeri
|
|
|
322
323
|
//#endregion
|
|
323
324
|
//#region ../wire/src/status.d.ts
|
|
324
325
|
/** The closed Payment status authority. */
|
|
325
|
-
declare const PAYMENT_STATUSES: readonly ["pending", "settling", "scheduled", "streaming", "pending_claim", "settled", "cancelled", "failed"];
|
|
326
|
+
declare const PAYMENT_STATUSES: readonly ["pending", "settling", "unresolved", "scheduled", "streaming", "pending_claim", "settled", "cancelled", "failed"];
|
|
326
327
|
type PaymentStatus$1 = (typeof PAYMENT_STATUSES)[number];
|
|
328
|
+
declare const PAYMENT_EXECUTION_STATUSES: readonly ["pending", "included", "dropped", "replaced", "expired", "unresolved", "superseded", "failed", "settled"];
|
|
329
|
+
type PaymentExecutionStatus = (typeof PAYMENT_EXECUTION_STATUSES)[number];
|
|
327
330
|
/** The payment direction relative to the current actor. */
|
|
328
331
|
declare const PAYMENT_DIRECTIONS: readonly ["in", "out", "self"];
|
|
329
332
|
type PaymentDirection$1 = (typeof PAYMENT_DIRECTIONS)[number];
|
|
@@ -721,8 +724,8 @@ type CompleteOnboardingIdentityInput = {
|
|
|
721
724
|
readonly displayName: string;
|
|
722
725
|
readonly country: CountryCode;
|
|
723
726
|
readonly withdrawalAddress?: Address$1;
|
|
724
|
-
/**
|
|
725
|
-
readonly
|
|
727
|
+
/** One globally unique Party handle. */
|
|
728
|
+
readonly handle: string;
|
|
726
729
|
};
|
|
727
730
|
declare const IdentityError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
728
731
|
readonly _tag: "IdentityError";
|
|
@@ -1016,15 +1019,24 @@ interface SmartAccountMethods {
|
|
|
1016
1019
|
}
|
|
1017
1020
|
//#endregion
|
|
1018
1021
|
//#region src/surface/identity.d.ts
|
|
1022
|
+
interface CompleteProfileInput {
|
|
1023
|
+
readonly displayName: string;
|
|
1024
|
+
readonly country: string;
|
|
1025
|
+
readonly handle: string;
|
|
1026
|
+
}
|
|
1019
1027
|
interface IdentityMethods {
|
|
1020
1028
|
loadCurrent(options?: {
|
|
1021
1029
|
readonly signal?: AbortSignal;
|
|
1022
1030
|
}): Promise<CapxulResult<Profile$1 | null>>;
|
|
1031
|
+
/** Complete the Person profile. A normalized, globally unique handle is required. */
|
|
1032
|
+
completeProfile(profile: CompleteProfileInput, options?: {
|
|
1033
|
+
readonly signal?: AbortSignal;
|
|
1034
|
+
}): Promise<CapxulResult<Profile$1>>;
|
|
1023
1035
|
/**
|
|
1024
|
-
* #1062: availability probe for the
|
|
1036
|
+
* #1062: availability probe for the handle the user is typing. Returns the
|
|
1025
1037
|
* canonical stored form so the UI can echo it.
|
|
1026
1038
|
*/
|
|
1027
|
-
|
|
1039
|
+
handleAvailable(handle: string, options?: {
|
|
1028
1040
|
readonly signal?: AbortSignal;
|
|
1029
1041
|
}): Promise<CapxulResult<{
|
|
1030
1042
|
readonly available: boolean;
|
|
@@ -1086,22 +1098,22 @@ type TargetReference = {
|
|
|
1086
1098
|
readonly kind: "email";
|
|
1087
1099
|
readonly email: string;
|
|
1088
1100
|
} | {
|
|
1089
|
-
readonly kind: "
|
|
1090
|
-
readonly
|
|
1091
|
-
} | {
|
|
1092
|
-
readonly kind: "payee";
|
|
1093
|
-
readonly id: string;
|
|
1101
|
+
readonly kind: "address";
|
|
1102
|
+
readonly address: Address$1;
|
|
1094
1103
|
} | {
|
|
1095
1104
|
readonly kind: "party";
|
|
1096
1105
|
readonly partyId: PartyId;
|
|
1097
|
-
} | {
|
|
1098
|
-
readonly kind: "destination";
|
|
1099
|
-
readonly id: string;
|
|
1100
1106
|
};
|
|
1101
1107
|
interface ResolvedTarget {
|
|
1102
1108
|
readonly reference: TargetReference;
|
|
1103
1109
|
readonly label: string;
|
|
1104
|
-
readonly
|
|
1110
|
+
readonly status: RecipientResolution["status"];
|
|
1111
|
+
readonly kind: "person" | "organization" | "external_address" | "unresolved";
|
|
1112
|
+
readonly safeAddress: Address$1;
|
|
1113
|
+
readonly isCapxulAccount: boolean;
|
|
1114
|
+
readonly partyId?: PartyId;
|
|
1115
|
+
readonly handle?: string;
|
|
1116
|
+
readonly requiresAcknowledgement?: true;
|
|
1105
1117
|
readonly capabilities: {
|
|
1106
1118
|
readonly canPay: boolean;
|
|
1107
1119
|
readonly canRequest: boolean;
|
|
@@ -1113,7 +1125,6 @@ interface TargetsMethods {
|
|
|
1113
1125
|
readonly signal?: AbortSignal;
|
|
1114
1126
|
}): Promise<CapxulResult<ResolvedTarget>>;
|
|
1115
1127
|
}
|
|
1116
|
-
type RecipientResolutionKind = "email" | "org" | "payee";
|
|
1117
1128
|
type Ref$1 = {
|
|
1118
1129
|
readonly kind: "handle";
|
|
1119
1130
|
readonly handle: string;
|
|
@@ -1121,14 +1132,8 @@ type Ref$1 = {
|
|
|
1121
1132
|
readonly kind: "email";
|
|
1122
1133
|
readonly email: string;
|
|
1123
1134
|
} | {
|
|
1124
|
-
readonly kind: "
|
|
1125
|
-
readonly
|
|
1126
|
-
} | {
|
|
1127
|
-
readonly kind: "capxulUserId";
|
|
1128
|
-
readonly capxulUserId: string;
|
|
1129
|
-
} | {
|
|
1130
|
-
readonly kind: "payeeId";
|
|
1131
|
-
readonly payeeId: string;
|
|
1135
|
+
readonly kind: "address";
|
|
1136
|
+
readonly address: Address$1;
|
|
1132
1137
|
} | {
|
|
1133
1138
|
readonly kind: "party";
|
|
1134
1139
|
readonly partyId: PartyId;
|
|
@@ -1147,24 +1152,19 @@ interface DepositInstructions {
|
|
|
1147
1152
|
readonly label: string;
|
|
1148
1153
|
}
|
|
1149
1154
|
interface RecipientResolution {
|
|
1150
|
-
readonly
|
|
1151
|
-
readonly
|
|
1155
|
+
readonly status: "known_party" | "new_email" | "external_address";
|
|
1156
|
+
readonly kind: "party" | "email" | "external_address";
|
|
1157
|
+
readonly locatorKind: Ref$1["kind"];
|
|
1158
|
+
readonly recipient: Ref$1;
|
|
1152
1159
|
readonly label: string;
|
|
1153
1160
|
readonly safeAddress: string;
|
|
1154
|
-
readonly
|
|
1155
|
-
readonly
|
|
1161
|
+
readonly isCapxulAccount: boolean;
|
|
1162
|
+
readonly partyId?: string;
|
|
1163
|
+
readonly partyKind?: "person" | "org";
|
|
1156
1164
|
readonly handle?: string;
|
|
1157
1165
|
readonly email?: string;
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
readonly payeeId: string;
|
|
1161
|
-
readonly label: string;
|
|
1162
|
-
readonly recipientRef: string;
|
|
1163
|
-
readonly handle: string | null;
|
|
1164
|
-
readonly destinationKind: "email" | "org" | "payeeHandle";
|
|
1165
|
-
readonly safeAddress: string;
|
|
1166
|
-
readonly createdAt: number;
|
|
1167
|
-
readonly updatedAt: number;
|
|
1166
|
+
readonly address?: string;
|
|
1167
|
+
readonly requiresAcknowledgement?: true;
|
|
1168
1168
|
}
|
|
1169
1169
|
interface MeMethods {
|
|
1170
1170
|
get(options?: {
|
|
@@ -1174,26 +1174,6 @@ interface MeMethods {
|
|
|
1174
1174
|
readonly signal?: AbortSignal;
|
|
1175
1175
|
}): Promise<CapxulResult<DepositInstructions>>;
|
|
1176
1176
|
}
|
|
1177
|
-
interface HandlesMethods {
|
|
1178
|
-
resolve(handle: string, options?: {
|
|
1179
|
-
readonly signal?: AbortSignal;
|
|
1180
|
-
}): Promise<CapxulResult<RecipientResolution>>;
|
|
1181
|
-
}
|
|
1182
|
-
interface PayeesMethods {
|
|
1183
|
-
create(input: {
|
|
1184
|
-
readonly label: string;
|
|
1185
|
-
readonly recipient: string;
|
|
1186
|
-
readonly handle?: string;
|
|
1187
|
-
}, options?: {
|
|
1188
|
-
readonly signal?: AbortSignal;
|
|
1189
|
-
}): Promise<CapxulResult<Payee>>;
|
|
1190
|
-
get(payeeId: string, options?: {
|
|
1191
|
-
readonly signal?: AbortSignal;
|
|
1192
|
-
}): Promise<CapxulResult<Payee | null>>;
|
|
1193
|
-
resolve(recipient: string, options?: {
|
|
1194
|
-
readonly signal?: AbortSignal;
|
|
1195
|
-
}): Promise<CapxulResult<RecipientResolution>>;
|
|
1196
|
-
}
|
|
1197
1177
|
interface PaymentMoney {
|
|
1198
1178
|
readonly currency: string;
|
|
1199
1179
|
readonly value: string;
|
|
@@ -1233,14 +1213,21 @@ interface Payment {
|
|
|
1233
1213
|
readonly transactionHash: string;
|
|
1234
1214
|
} | null;
|
|
1235
1215
|
readonly recipient: {
|
|
1236
|
-
readonly kind: "
|
|
1216
|
+
readonly kind: "party";
|
|
1217
|
+
readonly partyId: string;
|
|
1218
|
+
readonly label: string;
|
|
1219
|
+
} | {
|
|
1220
|
+
readonly kind: "external_address";
|
|
1237
1221
|
readonly label: string;
|
|
1238
|
-
readonly payeeId?: string;
|
|
1239
1222
|
};
|
|
1240
1223
|
readonly documents: readonly PaymentDocumentRef[];
|
|
1241
1224
|
readonly timing: PaymentTiming;
|
|
1242
1225
|
readonly released: PaymentMoney;
|
|
1243
1226
|
readonly availableToClaim: PaymentMoney;
|
|
1227
|
+
readonly execution?: {
|
|
1228
|
+
readonly status: PaymentExecutionStatus;
|
|
1229
|
+
readonly retryRequired: boolean;
|
|
1230
|
+
};
|
|
1244
1231
|
readonly createdAt: number;
|
|
1245
1232
|
readonly updatedAt: number;
|
|
1246
1233
|
}
|
|
@@ -1248,6 +1235,7 @@ interface PaymentsPayInput {
|
|
|
1248
1235
|
readonly actor?: ActorReference;
|
|
1249
1236
|
readonly to: TargetReference;
|
|
1250
1237
|
readonly amount: PaymentMoney;
|
|
1238
|
+
readonly externalAddressAcknowledged?: true;
|
|
1251
1239
|
/**
|
|
1252
1240
|
* How the payment is classified on the ledger. When a `document` is
|
|
1253
1241
|
* attached, the type derived from the document kind is AUTHORITATIVE
|
|
@@ -1461,6 +1449,9 @@ interface PaymentActivityEvidence {
|
|
|
1461
1449
|
readonly transactionHash: string;
|
|
1462
1450
|
readonly blockNumber: number;
|
|
1463
1451
|
readonly blockHash: string;
|
|
1452
|
+
readonly inclusion: "included";
|
|
1453
|
+
readonly verification: "verified";
|
|
1454
|
+
/** @deprecated Use `inclusion` and `verification`. */
|
|
1464
1455
|
readonly finality: "finalized";
|
|
1465
1456
|
readonly paymentEventLogIndex: number | null;
|
|
1466
1457
|
readonly transferLogIndex: number;
|
|
@@ -1481,6 +1472,9 @@ interface MovementActivityEvidence {
|
|
|
1481
1472
|
readonly transactionHash: string;
|
|
1482
1473
|
readonly blockNumber: number;
|
|
1483
1474
|
readonly blockHash: string;
|
|
1475
|
+
readonly inclusion: "included";
|
|
1476
|
+
readonly verification: "verified";
|
|
1477
|
+
/** @deprecated Use `inclusion` and `verification`. */
|
|
1484
1478
|
readonly canonicalState: "finalized";
|
|
1485
1479
|
readonly transferLogIndex: number;
|
|
1486
1480
|
readonly source: string;
|
|
@@ -1592,6 +1586,9 @@ interface PaymentsMethods {
|
|
|
1592
1586
|
pay(input: PaymentsPayInput, options?: {
|
|
1593
1587
|
readonly signal?: AbortSignal;
|
|
1594
1588
|
}): Promise<CapxulResult<Payment>>;
|
|
1589
|
+
retry(paymentId: string, options?: {
|
|
1590
|
+
readonly signal?: AbortSignal;
|
|
1591
|
+
}): Promise<CapxulResult<readonly Payment[]>>;
|
|
1595
1592
|
createCommitment(input: PaymentsPayInput & {
|
|
1596
1593
|
readonly timing: Exclude<PaymentTiming, {
|
|
1597
1594
|
readonly kind: "instant";
|
|
@@ -1633,8 +1630,6 @@ interface PaymentDocumentsMethods {
|
|
|
1633
1630
|
}
|
|
1634
1631
|
interface FinancialOpsMethods {
|
|
1635
1632
|
readonly me: MeMethods;
|
|
1636
|
-
readonly handles: HandlesMethods;
|
|
1637
|
-
readonly payees: PayeesMethods;
|
|
1638
1633
|
readonly targets: TargetsMethods;
|
|
1639
1634
|
readonly destinations: DestinationsMethods;
|
|
1640
1635
|
readonly payments: PaymentsMethods;
|
|
@@ -1864,6 +1859,38 @@ interface AccountInternalSurface {
|
|
|
1864
1859
|
retryProvisioning(): Promise<CapxulResult<ProvisioningPhase>>;
|
|
1865
1860
|
}
|
|
1866
1861
|
//#endregion
|
|
1862
|
+
//#region src/surface/onboarding.d.ts
|
|
1863
|
+
type PersonOnboardingInput = CompleteProfileInput;
|
|
1864
|
+
type ReadyAccountLifecycle = Extract<AccountLifecycle, {
|
|
1865
|
+
readonly status: "ready";
|
|
1866
|
+
}>;
|
|
1867
|
+
type CompletedPersonProfile = Omit<Profile$1, "displayName" | "handle"> & {
|
|
1868
|
+
readonly displayName: string;
|
|
1869
|
+
readonly handle: string;
|
|
1870
|
+
};
|
|
1871
|
+
interface PersonOnboarding {
|
|
1872
|
+
readonly profile: CompletedPersonProfile;
|
|
1873
|
+
readonly account: ReadyAccountLifecycle;
|
|
1874
|
+
}
|
|
1875
|
+
interface OrganizationOnboardingInput {
|
|
1876
|
+
readonly name: string;
|
|
1877
|
+
readonly handle: string;
|
|
1878
|
+
readonly country: string;
|
|
1879
|
+
readonly bio?: string;
|
|
1880
|
+
readonly size?: string;
|
|
1881
|
+
}
|
|
1882
|
+
interface OrganizationOnboarding {
|
|
1883
|
+
readonly organizationId: string;
|
|
1884
|
+
}
|
|
1885
|
+
interface OnboardingMethods {
|
|
1886
|
+
completePerson(input: PersonOnboardingInput, options?: {
|
|
1887
|
+
readonly signal?: AbortSignal;
|
|
1888
|
+
}): Promise<CapxulResult<PersonOnboarding>>;
|
|
1889
|
+
completeOrganization(input: OrganizationOnboardingInput, options?: {
|
|
1890
|
+
readonly signal?: AbortSignal;
|
|
1891
|
+
}): Promise<CapxulResult<OrganizationOnboarding>>;
|
|
1892
|
+
}
|
|
1893
|
+
//#endregion
|
|
1867
1894
|
//#region src/surface/accounts.d.ts
|
|
1868
1895
|
interface AccountsMethods {
|
|
1869
1896
|
read(options?: {
|
|
@@ -1994,6 +2021,8 @@ type PermissionAssignInput = {
|
|
|
1994
2021
|
readonly requestKey: string;
|
|
1995
2022
|
readonly permissionId: string;
|
|
1996
2023
|
readonly accountId: string;
|
|
2024
|
+
/** Bind a staff activation to the invited Person at the backend authority boundary. */
|
|
2025
|
+
readonly expectedMemberEmail?: string;
|
|
1997
2026
|
};
|
|
1998
2027
|
type PermissionRevokeInput = {
|
|
1999
2028
|
readonly requestKey: string;
|
|
@@ -2016,6 +2045,7 @@ interface PermissionMethods {
|
|
|
2016
2045
|
interface OrganizationPaymentItemInput {
|
|
2017
2046
|
readonly to: Ref$1;
|
|
2018
2047
|
readonly amount: PaymentMoney;
|
|
2048
|
+
readonly externalAddressAcknowledged?: true;
|
|
2019
2049
|
readonly paymentType?: PaymentType;
|
|
2020
2050
|
readonly document?: AttachablePaymentDocumentEnvelopeV1;
|
|
2021
2051
|
}
|
|
@@ -2035,6 +2065,9 @@ interface OrganizationPaymentsMethods {
|
|
|
2035
2065
|
payBatch(input: OrganizationPaymentBatchInput, options?: {
|
|
2036
2066
|
readonly signal?: AbortSignal;
|
|
2037
2067
|
}): Promise<CapxulResult<readonly Payment[]>>;
|
|
2068
|
+
retry(paymentId: string, options?: {
|
|
2069
|
+
readonly signal?: AbortSignal;
|
|
2070
|
+
}): Promise<CapxulResult<readonly Payment[]>>;
|
|
2038
2071
|
}
|
|
2039
2072
|
//#endregion
|
|
2040
2073
|
//#region src/surface/payroll.d.ts
|
|
@@ -2173,6 +2206,7 @@ interface PayrollMethods {
|
|
|
2173
2206
|
type MemberStatus = "pending" | "pending_safe" | "pending_grant" | "active" | "revoked" | "expired";
|
|
2174
2207
|
/** One Organization that the current user can access. */
|
|
2175
2208
|
type OrgView = {
|
|
2209
|
+
readonly creationSource?: TesterKind;
|
|
2176
2210
|
readonly id: OrgId;
|
|
2177
2211
|
readonly name: string;
|
|
2178
2212
|
readonly handle: string;
|
|
@@ -2504,7 +2538,7 @@ type IdentityRuntimeSendResult = {
|
|
|
2504
2538
|
type IdentityProfileDetails = {
|
|
2505
2539
|
readonly displayName: string;
|
|
2506
2540
|
readonly country: string;
|
|
2507
|
-
readonly
|
|
2541
|
+
readonly handle: string;
|
|
2508
2542
|
};
|
|
2509
2543
|
interface IdentityRuntime {
|
|
2510
2544
|
readonly snapshot: () => IdentityState;
|
|
@@ -2516,6 +2550,7 @@ interface IdentityRuntime {
|
|
|
2516
2550
|
} | {
|
|
2517
2551
|
readonly ok: false;
|
|
2518
2552
|
readonly reason: CapxulErrorCode;
|
|
2553
|
+
readonly error?: CapxulError;
|
|
2519
2554
|
}>;
|
|
2520
2555
|
/** @internal Optional facade bridge for consumer test doubles. */
|
|
2521
2556
|
readonly runFacade?: <T>(verb: IdentityFacadeVerb, controls: InvocationControls | undefined, run: (controls: InvocationControls) => Promise<T>) => Promise<T>;
|
|
@@ -2524,6 +2559,7 @@ interface CapxulClient {
|
|
|
2524
2559
|
readonly auth: AuthMethods;
|
|
2525
2560
|
readonly smartAccount: SmartAccountMethods;
|
|
2526
2561
|
readonly identity: IdentityMethods;
|
|
2562
|
+
readonly onboarding: OnboardingMethods;
|
|
2527
2563
|
/** `health(nonce)` returns the nonce from the configured deployment. Use it to verify backend liveness before sign-in. */
|
|
2528
2564
|
readonly system: SystemMethods;
|
|
2529
2565
|
/**
|
|
@@ -2539,8 +2575,6 @@ interface CapxulClient {
|
|
|
2539
2575
|
readonly accounts: AccountsMethods;
|
|
2540
2576
|
readonly currentUser: CurrentUserMethods;
|
|
2541
2577
|
readonly me: MeMethods;
|
|
2542
|
-
readonly handles: HandlesMethods;
|
|
2543
|
-
readonly payees: PayeesMethods;
|
|
2544
2578
|
readonly targets: TargetsMethods;
|
|
2545
2579
|
readonly destinations: DestinationsMethods;
|
|
2546
2580
|
/**
|
|
@@ -2600,6 +2634,7 @@ interface CapxulClient {
|
|
|
2600
2634
|
readonly organizationSetup: OrganizationSetupProofMethods;
|
|
2601
2635
|
/** Product telemetry projection for internal composition and test harnesses. */
|
|
2602
2636
|
readonly telemetry?: TelemetryPort;
|
|
2637
|
+
readonly captureExternalAddressAcknowledged: (address: string, organizationId?: string) => void;
|
|
2603
2638
|
readonly close?: () => Promise<void>;
|
|
2604
2639
|
};
|
|
2605
2640
|
}
|
|
@@ -2794,4 +2829,4 @@ interface ObservationAdapter {
|
|
|
2794
2829
|
/** Stable PostHog event used for typed failures that are expected product outcomes. */
|
|
2795
2830
|
declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
|
|
2796
2831
|
//#endregion
|
|
2797
|
-
export { OrganizationPaymentsMethods as $,
|
|
2832
|
+
export { OrganizationPaymentsMethods as $, TelemetryPort as $n, DestinationListInput as $t, OrgView as A, TargetsMethods as An, AddressBookMethods as At, PayrollGroupInput as B, OrgSetupStep as Bn, ActivityListParams as Bt, DetectPendingOrgInvitationsResult as C, PaymentType as Cn, ActorRelationshipMethods as Ct, OrgMethods as D, Ref$1 as Dn, AddressBookAddInput as Dt, MemberView as E, RecipientResolution as En, ActorRequestsMethods as Et, RoleSpendCap as F, CompleteProfileInput as Fn, ActivityAnnotationInput as Ft, PayrollRun as G, InboxStatus as Gn, ActivitySummary as Gt, PayrollGroupsMethods as H, CurrentHoldings as Hn, ActivityPage as Ht, RoleView as I, IdentityMethods as In, ActivityDetail as It, PayrollRuns as J, PaymentStatus$1 as Jn, ActorReference as Jt, PayrollRunItemInput as K, PAYMENT_DIRECTIONS as Kn, ActivitySummaryParams as Kt, AuthorizeRunInput as L, SmartAccountMethods as Ln, ActivityFilter as Lt, OrganizationAuditLogItem as M, AccountLifecycle as Mn, InboxItem as Mt, ResendInviteTokenInput as N, AccountSetupStep as Nn, InboxMethods as Nt, OrgScopedMethods as O, ResolvedTarget as On, AddressBookEntry as Ot, RoleDefinition as P, isSettingUpLifecycle as Pn, ActivityAnnotation as Pt, OrganizationPaymentItemInput as Q, TelemetryIdentifyInput as Qn, DestinationKind as Qt, PayrollEngagementTerms as R, AuthMethods as Rn, ActivityItem as Rt, CreateOrgInput as S, PaymentTiming as Sn, ActorProfileMethods as St, MemberStatus as T, PaymentsPayInput as Tn, ActorRequestIssueInput as Tt, PayrollMethods as U, Permission as Un, ActivityRange as Ut, PayrollGroupMember as V, ActorRef as Vn, ActivityMethods as Vt, PayrollOptions as W, SubmittedPermissionExecution as Wn, ActivityReference as Wt, OrganizationPaymentBatchInput as X, TelemetryEvent as Xn, Destination as Xt, PayrollTermsUnit as Y, RequestStatus as Yn, DepositInstructions as Yt, OrganizationPaymentInput as Z, TelemetryGroupInput as Zn, DestinationAddInput as Zt, SystemMethods as _, PaymentDocumentRender as _n, PersonOnboarding as _t, SdkFailureObservation as a, MeMethods as an, StateLabel as ar, PermissionReplaceInput as at, CurrentUserContext as b, PaymentMoney as bn, AccountMethods as bt, PostHogObservabilityOptions as c, OfframpMethods as cn, isRestoring as cr, Budget as ct, CreateCapxulClientInput as d, OfframpStatus as dn, OrgMeOptions as dt, DestinationPayload as en, Destination$1 as er, PermissionAssignInput as et, IdentityProfileDetails as f, Payment as fn, AccountsMethods as ft, Holding as g, PaymentDocumentRef as gn, OrganizationOnboardingInput as gt, HoldingsMethods as h, PaymentDocumentKind as hn, OrganizationOnboarding as ht, ObservationDelivery as i, FinancialOpsMethods as in, Readiness as ir, PermissionOptions as it, OrganizationAccount as j, fingerprintPaymentIntent as jn, InboxApproveInput as jt, OrgTemplate as k, TargetReference as kn, AddressBookLabelInput as kt, postHogObservability as l, OfframpQuote as ln, IdentityTransition as lr, OrgMe as lt, IdentityRuntimeSendResult as m, PaymentDirection as mn, OnboardingMethods as mt, ObservationAdapter as n, DestinationRemoveInput as nn, IdentityState as nr, PermissionCreateInput as nt, HostObservability as o, MeProfile as on, destination as or, PermissionRevokeInput as ot, IdentityRuntime as p, PaymentActivityEvidence as pn, CompletedPersonProfile as pt, PayrollRunStatus as q, PAYMENT_STATUSES as qn, ActivitySummaryTotal as qt, ObservationContext as r, DestinationsMethods as rn, OrgLane as rr, PermissionMethods as rt, PostHogObservabilityClient as s, MovementActivityEvidence as sn, isClaimed as sr, PermissionReadResult as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, DestinationRail as tn, IdentityEvent as tr, PermissionChangeInput as tt, CapxulClient as u, OfframpQuoteInput as un, InvocationControls as ur, OrgMeMethod as ut, SystemHealth as v, PaymentDocumentVerification as vn, PersonOnboardingInput as vt, InviteMemberInput as w, PaymentsMethods as wn, ActorRequest as wt, CurrentUserMethods as x, PaymentStatus as xn, ActorProfile as xt, MediaMethods as y, PaymentDocumentsMethods as yn, ReadyAccountLifecycle as yt, PayrollGroup as z, OrgLifecycle as zn, ActivityKind as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Account, Address, Hex } from "viem";
|
|
2
1
|
import { Context, Effect } from "effect";
|
|
2
|
+
import { Account, Address, Hex } from "viem";
|
|
3
3
|
//#region ../errors/src/chain-cause.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Why an operation failed — the one flat vocabulary. The first four are the
|
|
@@ -257,6 +257,10 @@ declare const Errors: {
|
|
|
257
257
|
}) => CapxulError;
|
|
258
258
|
};
|
|
259
259
|
//#endregion
|
|
260
|
+
//#region ../config/src/capxul-payments-v2.d.ts
|
|
261
|
+
/** Immutable CapxulPaymentsV2 deployment on Base Sepolia. */
|
|
262
|
+
declare const CAPXUL_PAYMENTS_V2_ADDRESS: Address;
|
|
263
|
+
//#endregion
|
|
260
264
|
//#region ../types/src/brand.d.ts
|
|
261
265
|
/**
|
|
262
266
|
* Nominal type helper. `Brand<T, B>` is structurally a `T` at runtime but
|
|
@@ -272,14 +276,16 @@ type Brand<T, B extends string> = T & {
|
|
|
272
276
|
//#region ../types/src/index.d.ts
|
|
273
277
|
type Address$1 = Brand<string, "Address">;
|
|
274
278
|
type Email = Brand<string, "Email">;
|
|
279
|
+
type TesterKind = "human" | "e2e" | "agent";
|
|
275
280
|
type Profile$1 = {
|
|
281
|
+
readonly testerKind?: TesterKind;
|
|
276
282
|
readonly authUserId: AuthUserId;
|
|
277
283
|
readonly email: Email;
|
|
278
284
|
readonly displayName: string | null;
|
|
279
285
|
readonly country: CountryCode | null;
|
|
280
286
|
readonly onboarded: boolean;
|
|
281
287
|
readonly withdrawalAddress: Address$1 | null;
|
|
282
|
-
readonly
|
|
288
|
+
readonly handle: Handle | null;
|
|
283
289
|
readonly imageUrl: string | null;
|
|
284
290
|
readonly kycTier: KycTier;
|
|
285
291
|
readonly createdAt: EpochMs;
|
|
@@ -308,6 +314,8 @@ type AuthUserId = Brand<string, "AuthUserId">;
|
|
|
308
314
|
type AnonymousDistinctId = Brand<string, "AnonymousDistinctId">;
|
|
309
315
|
type AccountId = Brand<string, "AccountId">;
|
|
310
316
|
type PartyId = Brand<string, "PartyId">;
|
|
317
|
+
/** One globally unique public name for a claimed person or Organization Party. */
|
|
318
|
+
type Handle = Brand<string, "Handle">;
|
|
311
319
|
type PermissionId = Brand<string, "PermissionId">;
|
|
312
320
|
type PermissionAssignmentId = Brand<string, "PermissionAssignmentId">;
|
|
313
321
|
type BudgetId = Brand<string, "BudgetId">;
|
|
@@ -339,6 +347,7 @@ type AuthSession = {
|
|
|
339
347
|
readonly token: SessionToken;
|
|
340
348
|
readonly expiresAt: EpochMs;
|
|
341
349
|
};
|
|
350
|
+
declare const EVM_ADDRESS_RE: RegExp;
|
|
342
351
|
declare const SUPPORTED_CURRENCIES: readonly [{
|
|
343
352
|
readonly code: "USD";
|
|
344
353
|
readonly symbol: "$";
|
|
@@ -362,12 +371,10 @@ declare const SUPPORTED_CURRENCIES: readonly [{
|
|
|
362
371
|
}];
|
|
363
372
|
type SupportedCurrencyCode = (typeof SUPPORTED_CURRENCIES)[number]["code"];
|
|
364
373
|
declare function toAddress(raw: unknown): Address$1;
|
|
374
|
+
declare function toPartyId(raw: unknown): PartyId;
|
|
375
|
+
declare function toHandle(raw: unknown): Handle;
|
|
365
376
|
declare function toCountryCode(raw: unknown): CountryCode;
|
|
366
377
|
//#endregion
|
|
367
|
-
//#region ../config/src/capxul-payments-v2.d.ts
|
|
368
|
-
/** Immutable CapxulPaymentsV2 deployment on Base Sepolia. */
|
|
369
|
-
declare const CAPXUL_PAYMENTS_V2_ADDRESS: Address;
|
|
370
|
-
//#endregion
|
|
371
378
|
//#region src/ports/auth-cache.d.ts
|
|
372
379
|
/**
|
|
373
380
|
* AuthCachePort stores the user session and the cached
|
|
@@ -594,4 +601,4 @@ interface Eip1193RequestProvider {
|
|
|
594
601
|
*/
|
|
595
602
|
declare function injectedWalletSigner(provider: Eip1193RequestProvider): CapxulSigner;
|
|
596
603
|
//#endregion
|
|
597
|
-
export {
|
|
604
|
+
export { PublishableKey as $, AppId as A, EVM_ADDRESS_RE as B, CachedJwt as C, RevertSummary as Ct, AllowanceKey as D, Address$1 as E, ChainId as F, OrgId as G, EpochMs as H, CountryCode as I, PayrollGroupId as J, PartyId as K, CurrencyCode as L, AuthUserId as M, BlockNumber as N, AllowedOrigin as O, BudgetId as P, Profile$1 as Q, DocumentHash as R, AuthCachePortTag as S, FailureMode as St, AccountId as T, Handle as U, Email as V, Money as W, PermissionAssignmentId as X, PayrollRunId as Y, PermissionId as Z, ClockPort as _, isCapxulError as _t, SignerStatusStore as a, WeiAmount as at, AuthCacheError as b, ChainUpstream as bt, AccountProviderSource as c, toHandle as ct, eip1193AccountProvider as d, CAPXUL_ERROR_CODES as dt, RoleKey as et, localPrivateKeyAccountProvider as f, CapxulError as ft, SmartAccount as g, Failure as gt, Session as h, Errors as ht, SignerStatus as i, TxHash as it, AuthSession as j, AnonymousDistinctId as k, AccountRequirement as l, toPartyId as lt, Profile as m, CapxulErrorDetails as mt, CapxulSigner as n, SmartAccount$1 as nt, injectedWalletSigner as o, toAddress as ot, CapxulResult as p, CapxulErrorCode as pt, PaymentCommandId as q, Eip1193RequestProvider as r, TesterKind as rt, AccountProvider as s, toCountryCode as st, CapxulDigestSigner as t, SessionToken as tt, Eip1193Provider as u, CAPXUL_PAYMENTS_V2_ADDRESS as ut, AuthClientPort as v, CHAIN_UPSTREAMS as vt, Account$1 as w, AuthCachePort as x, FAILURE_MODES as xt, CanSendOtpStatus as y, ChainCause as yt, DurationMs as z };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qn as TelemetryIdentifyInput, Xn as TelemetryEvent, Zn as TelemetryGroupInput, lr as IdentityTransition, n as ObservationAdapter, u as CapxulClient } from "../observation-DtzTdv20.mjs";
|
|
2
2
|
import { Effect, Layer } from "effect";
|
|
3
3
|
//#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
|
|
4
4
|
type RecordingTelemetryOperation = {
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { keccak256 } from "viem";
|
|
1
|
+
import { M as fromWei, Z as redactTelemetryEvent, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, i as smartAccountErrorFromCapxul, m as convexCallErrorFromCapxul, o as accountReadErrorFromCapxul, t as assembleCapxulClient, u as wireChainId, v as toWei } from "../create-capxul-client-DyCEJZtD.mjs";
|
|
2
|
+
import { $ as CapxulError, A as toAuthUserId, B as toJwtToken, D as toAddress, E as toAccountId, F as toDurationMs, I as toEmail, J as toSessionToken, K as toPublishableKey, L as toEpochMs, M as toChainId, N as toCountryCode, O as toAllowedOrigin, R as toEpochSeconds, V as toKycTier, _ as deriveCapxulSafeAddress, k as toAppId, n as InMemoryAuthCacheAdapter, t as readClockNow, tt as Errors, u as authClientPortFromPromiseAdapter, v as validateHandle, z as toHandle } from "../clock-C2AUlq1V.mjs";
|
|
4
3
|
import { Effect, Result, Semaphore } from "effect";
|
|
4
|
+
import { keccak256 } from "viem";
|
|
5
5
|
import { getFunctionName } from "convex/server";
|
|
6
6
|
//#region src/testing/account/InMemoryAccountReadAdapter.ts
|
|
7
7
|
var InMemoryAccountReadAdapter = class {
|
|
@@ -506,7 +506,7 @@ var InMemoryIdentityAdapter = class {
|
|
|
506
506
|
country: input.country ?? null,
|
|
507
507
|
onboarded: false,
|
|
508
508
|
withdrawalAddress: null,
|
|
509
|
-
|
|
509
|
+
handle: null,
|
|
510
510
|
imageUrl: null,
|
|
511
511
|
kycTier: toKycTier(0),
|
|
512
512
|
createdAt: now,
|
|
@@ -531,7 +531,7 @@ var InMemoryIdentityAdapter = class {
|
|
|
531
531
|
country: input.country !== void 0 ? input.country : existing.country,
|
|
532
532
|
onboarded: existing.onboarded,
|
|
533
533
|
withdrawalAddress: existing.withdrawalAddress,
|
|
534
|
-
|
|
534
|
+
handle: existing.handle,
|
|
535
535
|
imageUrl: existing.imageUrl,
|
|
536
536
|
updatedAt: now
|
|
537
537
|
};
|
|
@@ -551,7 +551,7 @@ var InMemoryIdentityAdapter = class {
|
|
|
551
551
|
country: input.country,
|
|
552
552
|
onboarded: true,
|
|
553
553
|
withdrawalAddress: input.withdrawalAddress ?? existing?.withdrawalAddress ?? null,
|
|
554
|
-
|
|
554
|
+
handle: toHandle(validateHandle(input.handle)),
|
|
555
555
|
imageUrl: existing?.imageUrl ?? null,
|
|
556
556
|
kycTier: existing?.kycTier ?? toKycTier(0),
|
|
557
557
|
createdAt: existing?.createdAt ?? now,
|
|
@@ -576,7 +576,7 @@ function cloneProfile(profile) {
|
|
|
576
576
|
country: profile.country,
|
|
577
577
|
onboarded: profile.onboarded,
|
|
578
578
|
withdrawalAddress: profile.withdrawalAddress,
|
|
579
|
-
|
|
579
|
+
handle: profile.handle,
|
|
580
580
|
imageUrl: profile.imageUrl,
|
|
581
581
|
kycTier: profile.kycTier,
|
|
582
582
|
createdAt: profile.createdAt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
|
|
48
48
|
"vite-plus": "0.3.0",
|
|
49
49
|
"vitest": "4.1.11",
|
|
50
|
-
"@capxul/config": "0.
|
|
51
|
-
"@capxul/errors": "0.
|
|
52
|
-
"@capxul/types": "0.2.3",
|
|
50
|
+
"@capxul/config": "0.3.0",
|
|
51
|
+
"@capxul/errors": "0.3.0",
|
|
53
52
|
"@capxul/typescript-config": "0.0.0",
|
|
54
|
-
"@capxul/
|
|
55
|
-
"@capxul/
|
|
53
|
+
"@capxul/observability": "4.0.0",
|
|
54
|
+
"@capxul/wire": "0.7.0",
|
|
55
|
+
"@capxul/types": "0.3.0"
|
|
56
56
|
},
|
|
57
57
|
"_permissionlessPinReason": "permissionless.toSafeSmartAccount is pinned to 0.3.4 for live Safe deployment E2E. Counterfactual address fixtures captured 2026-05-17 in packages/backend/convex/_shared/__tests__/counterfactual.test.ts and packages/config/tests/safe.test.ts must be re-verified before upgrading.",
|
|
58
58
|
"scripts": {
|