@capxul/sdk 4.1.4 → 4.2.0-rc.10
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/dist/{signer-C0hZ6Kiy.d.mts → OAuthBearerAuthClient-C-ip-z8M.d.mts} +30 -6
- package/dist/{clock-C2AUlq1V.mjs → OAuthBearerAuthClient-IB2W1Fzj.mjs} +630 -52
- package/dist/capxul-source.json +11 -0
- package/dist/index.d.mts +65 -51
- package/dist/index.mjs +144 -3505
- package/dist/node/index.d.mts +2 -3
- package/dist/node/index.mjs +1 -2
- package/dist/{create-capxul-client-B3ET402J.mjs → production-BndbwuVx.mjs} +7717 -2966
- package/dist/{observation-Bhdq9-l6.d.mts → production-Du4Vc7YD.d.mts} +248 -34
- package/dist/testing/index.d.mts +82 -2
- package/dist/testing/index.mjs +101 -4
- package/package.json +5 -5
- package/dist/OAuthBearerAuthClient-BHvDR8_0.mjs +0 -211
- package/dist/OAuthBearerAuthClient-D-DLYlKj.d.mts +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
1
|
+
import { $ as PayrollGroupId, A as AllowanceKey, B as ChainId, C as AuthCachePort, D as Account$1, Et as FailureMode, F as AssetId, H as CurrencyCode, I as AuthSession, K as Email, L as AuthUserId, M as AnonymousDistinctId, N as AppId, Q as PaymentCommandId, R as BlockNumber, U as DocumentHash, V as CountryCode, W as DurationMs, X as OrgId, Y as Money, Z as PartyId, _ as Session$1, _t as CapxulErrorCode, at as RoleKey, b as AuthClientPort, bt as Failure, ct as TesterKind, d as AccountRequirement, et as PayrollRunId, g as Profile$1, gt as CapxulError, h as CapxulResult, i as CapxulSigner, it as PublishableKey, j as AllowedOrigin, k as Address$1, lt as TxHash, nt as PermissionId, ot as SessionToken, q as EpochMs, rt as Profile, s as SignerStatusStore, st as SmartAccount, tt as PermissionAssignmentId, u as AccountProviderSource, ut as WeiAmount, v as SmartAccount$1, vt as CapxulErrorDetails, x as CanSendOtpStatus, y as ClockPort, z as BudgetId } from "./OAuthBearerAuthClient-C-ip-z8M.mjs";
|
|
3
2
|
import { Hex } from "viem";
|
|
3
|
+
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
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;
|
|
@@ -78,6 +78,11 @@ interface OrgDraft {
|
|
|
78
78
|
interface OrgSubmissionDraft extends OrgDraft {
|
|
79
79
|
readonly bio?: string;
|
|
80
80
|
readonly size?: string;
|
|
81
|
+
/**
|
|
82
|
+
* #1955: the logo uploaded on file pick. The org lane spreads this draft
|
|
83
|
+
* straight into `startOrResume`, which records it on the `orgs` insert.
|
|
84
|
+
*/
|
|
85
|
+
readonly logoStorageId?: string;
|
|
81
86
|
}
|
|
82
87
|
/** The org lane, keyed by the active orgId — which does not exist yet while the
|
|
83
88
|
* FIRST DURABLE ORG WRITE is in flight, hence `creating` carrying only a draft. */
|
|
@@ -279,7 +284,7 @@ interface TelemetryPort {
|
|
|
279
284
|
}
|
|
280
285
|
//#endregion
|
|
281
286
|
//#region ../observability/src/index.d.ts
|
|
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", "activity_annotation_saved", "ui_activity_action_completed", "contact_relationship_changed", "ui_contact_action_completed"];
|
|
287
|
+
declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "identity_refused", "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", "activity_annotation_saved", "ui_activity_action_completed", "contact_relationship_changed", "ui_contact_action_completed", "access_recovery_completed", "ui_access_step_completed", "org_invite_progressed", "invoice_issued", "invoice_request_transitioned", "ui_invoice_step_completed", "ui_treasury_step_completed", "ui_receive_step_completed", "payroll_group_changed", "payroll_run_transitioned", "ui_payroll_action_completed"];
|
|
283
288
|
type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
|
|
284
289
|
type TelemetryProps = Record<string, unknown>;
|
|
285
290
|
type TelemetryEvent = {
|
|
@@ -606,6 +611,10 @@ type BootstrapResolution = {
|
|
|
606
611
|
readonly siteBaseUrl: string;
|
|
607
612
|
readonly openfortPublishableKey: string;
|
|
608
613
|
readonly shieldPublishableKey: string;
|
|
614
|
+
/** Openfort third-party auth provider the signer presents; absent means better-auth. */
|
|
615
|
+
readonly openfortAuthProvider?: "better-auth" | "oidc";
|
|
616
|
+
/** Origin of the Ponder indexer the SDK reads directly; absent means no indexer reads. */
|
|
617
|
+
readonly indexerUrl?: string;
|
|
609
618
|
readonly engineeringTelemetry?: EngineeringTelemetryBootstrapPolicyV1;
|
|
610
619
|
};
|
|
611
620
|
type BootstrapErrorKind = "notAuthenticated" | "network" | "provider" | "malformedBody" | "invalidInput" | "rateLimited";
|
|
@@ -710,6 +719,16 @@ type UpdateIdentityInput = {
|
|
|
710
719
|
readonly displayName?: string;
|
|
711
720
|
readonly country?: CountryCode;
|
|
712
721
|
};
|
|
722
|
+
/** The chain families a payout address may name (#1955). */
|
|
723
|
+
declare const PAYOUT_CHAINS: readonly ["evm", "solana", "starknet"];
|
|
724
|
+
/**
|
|
725
|
+
* One payout address, named BY CHAIN FAMILY. The network is the deployment's
|
|
726
|
+
* and the backend derives it (#1955) — a caller never sends one.
|
|
727
|
+
*/
|
|
728
|
+
type PayoutAddress = {
|
|
729
|
+
readonly chain: (typeof PAYOUT_CHAINS)[number];
|
|
730
|
+
readonly address: string;
|
|
731
|
+
};
|
|
713
732
|
/**
|
|
714
733
|
* D-ONBOARD (#669) — the onboarding-complete identity write. Composes the
|
|
715
734
|
* existing create/update write into one idempotent upsert that ALSO sets the
|
|
@@ -717,6 +736,10 @@ type UpdateIdentityInput = {
|
|
|
717
736
|
* allowed raw-0x class). `displayName` + `country` are required at onboarding
|
|
718
737
|
* time. The returned `Profile` is the existing branded shape — the onboarding
|
|
719
738
|
* flags live on the wire row and are not projected onto the read surface.
|
|
739
|
+
*
|
|
740
|
+
* #1955: it also carries the photo the signup form uploaded and the payout
|
|
741
|
+
* addresses it collected, so the backend writes all three in one transaction
|
|
742
|
+
* instead of the app binding them with two more calls afterwards.
|
|
720
743
|
*/
|
|
721
744
|
type CompleteOnboardingIdentityInput = {
|
|
722
745
|
readonly authUserId: AuthUserId;
|
|
@@ -726,6 +749,9 @@ type CompleteOnboardingIdentityInput = {
|
|
|
726
749
|
readonly withdrawalAddress?: Address$1;
|
|
727
750
|
/** One globally unique Party handle. */
|
|
728
751
|
readonly handle: string;
|
|
752
|
+
/** Storage id from `media.uploadImage`; bound on the identity write itself. */
|
|
753
|
+
readonly imageStorageId?: string;
|
|
754
|
+
readonly payoutAddresses?: readonly PayoutAddress[];
|
|
729
755
|
};
|
|
730
756
|
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 & {
|
|
731
757
|
readonly _tag: "IdentityError";
|
|
@@ -882,6 +908,118 @@ interface AccountReadPort {
|
|
|
882
908
|
fundFromFaucet(input: FundFromFaucetInput): Effect.Effect<FundFromFaucetResult, AccountReadError, never>;
|
|
883
909
|
}
|
|
884
910
|
//#endregion
|
|
911
|
+
//#region src/ports/indexer-read.d.ts
|
|
912
|
+
/**
|
|
913
|
+
* IndexerReadPort is the SDK's read seam onto the Ponder read model
|
|
914
|
+
* (`apps/indexer`). Ponder holds what the chain said; Convex holds what the
|
|
915
|
+
* user meant. Nothing here is copied into Convex, nothing waits for a
|
|
916
|
+
* finality tag, and no write path may read through this port.
|
|
917
|
+
*
|
|
918
|
+
* Every read is scoped to one Safe and one page. The indexer accepts only the
|
|
919
|
+
* exact compiled statements in `apps/indexer/src/queries.ts`, so the adapter
|
|
920
|
+
* that implements this port reproduces those statements byte for byte and the
|
|
921
|
+
* service refuses anything else with 403.
|
|
922
|
+
*/
|
|
923
|
+
/** One page of rows for one Safe. `offset` defaults to 0 (the first page). */
|
|
924
|
+
interface IndexerReadInput {
|
|
925
|
+
/** The Safe the caller owns. The indexer refuses a Safe outside the session claim. */
|
|
926
|
+
readonly safe: Address$1;
|
|
927
|
+
/** 1 to 1000 inclusive — the indexer's own bound. */
|
|
928
|
+
readonly limit: number;
|
|
929
|
+
readonly offset?: number;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* The chain evidence every indexed row carries. `id` is the logical event id
|
|
933
|
+
* `chainId:txHash:transactionLogOrdinal`; it survives a reorg, so it is the
|
|
934
|
+
* key a Convex intent row stitches against.
|
|
935
|
+
*/
|
|
936
|
+
interface IndexerEventIdentity {
|
|
937
|
+
readonly id: string;
|
|
938
|
+
readonly chainId: ChainId;
|
|
939
|
+
readonly txHash: TxHash;
|
|
940
|
+
readonly transactionLogOrdinal: number;
|
|
941
|
+
readonly blockNumber: bigint;
|
|
942
|
+
readonly blockHash: string;
|
|
943
|
+
/** Block timestamp in epoch seconds. */
|
|
944
|
+
readonly timestamp: bigint;
|
|
945
|
+
}
|
|
946
|
+
interface IndexerTransferRow extends IndexerEventIdentity {
|
|
947
|
+
readonly assetId: AssetId;
|
|
948
|
+
readonly token: Address$1;
|
|
949
|
+
readonly from: Address$1;
|
|
950
|
+
readonly to: Address$1;
|
|
951
|
+
/**
|
|
952
|
+
* Raw token units, exact. This is an evidence boundary, so the row never
|
|
953
|
+
* carries Money or AssetAmount: the reader owns the asset's decimals.
|
|
954
|
+
*/
|
|
955
|
+
readonly amount: bigint;
|
|
956
|
+
}
|
|
957
|
+
interface IndexerPaymentRow extends IndexerEventIdentity {
|
|
958
|
+
readonly contract: Address$1;
|
|
959
|
+
/** The protocol settlement id a Convex Payment command stitches against. */
|
|
960
|
+
readonly settlementId: string;
|
|
961
|
+
readonly sender: Address$1;
|
|
962
|
+
readonly recipient: Address$1;
|
|
963
|
+
readonly assetId: AssetId;
|
|
964
|
+
readonly token: Address$1;
|
|
965
|
+
/** Raw token units, exact. */
|
|
966
|
+
readonly amount: bigint;
|
|
967
|
+
readonly kind: number;
|
|
968
|
+
readonly documentHash: string;
|
|
969
|
+
}
|
|
970
|
+
/** A row of the indexer's signed-transfer `balance` view. */
|
|
971
|
+
interface IndexerBalanceRow {
|
|
972
|
+
readonly chainId: ChainId;
|
|
973
|
+
readonly assetId: AssetId;
|
|
974
|
+
readonly address: Address$1;
|
|
975
|
+
/** Raw token units, exact. */
|
|
976
|
+
readonly amount: bigint;
|
|
977
|
+
}
|
|
978
|
+
/** One chain's sync position, from the indexer's native `/status` route. */
|
|
979
|
+
interface IndexerChainStatus {
|
|
980
|
+
readonly chain: string;
|
|
981
|
+
readonly chainId: ChainId;
|
|
982
|
+
readonly blockNumber: bigint;
|
|
983
|
+
/** Block timestamp in epoch seconds. Its age is the freshness label. */
|
|
984
|
+
readonly blockTimestamp: bigint;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* The tables this seam reads today. P04 adds the authority rows (`safe`,
|
|
988
|
+
* `safe_event`, `roles_module`) and P05 adds `commitment`: each is one more
|
|
989
|
+
* entry here plus its statement and decoder.
|
|
990
|
+
*/
|
|
991
|
+
interface IndexerRowsByTable {
|
|
992
|
+
readonly transfer: readonly IndexerTransferRow[];
|
|
993
|
+
readonly payment: readonly IndexerPaymentRow[];
|
|
994
|
+
readonly balance: readonly IndexerBalanceRow[];
|
|
995
|
+
}
|
|
996
|
+
type IndexerTable = keyof IndexerRowsByTable;
|
|
997
|
+
declare const IndexerReadError_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 & {
|
|
998
|
+
readonly _tag: "IndexerReadError";
|
|
999
|
+
} & Readonly<A>;
|
|
1000
|
+
declare class IndexerReadError extends IndexerReadError_base<{
|
|
1001
|
+
readonly operation: string;
|
|
1002
|
+
readonly publicCode: CapxulErrorCode;
|
|
1003
|
+
readonly publicError: CapxulError;
|
|
1004
|
+
readonly cause: unknown;
|
|
1005
|
+
readonly details?: CapxulErrorDetails;
|
|
1006
|
+
}> {}
|
|
1007
|
+
interface IndexerReadPort {
|
|
1008
|
+
/** One page of rows, newest block first. An empty page is a value, not an error. */
|
|
1009
|
+
read<T extends IndexerTable>(table: T, input: IndexerReadInput): Effect.Effect<IndexerRowsByTable[T], IndexerReadError>;
|
|
1010
|
+
/**
|
|
1011
|
+
* The same page over the indexer's live stream. The first snapshot is
|
|
1012
|
+
* `loading`; each later snapshot carries the whole page again. The indexer
|
|
1013
|
+
* closes the stream on token expiry or revoked authority, which arrives as
|
|
1014
|
+
* one `error` snapshot — the caller re-reads with a refreshed token.
|
|
1015
|
+
*
|
|
1016
|
+
* @internal-use — substrate reactive transport, like `ConvexCallPort.subscribe`.
|
|
1017
|
+
*/
|
|
1018
|
+
subscribe<T extends IndexerTable>(table: T, input: IndexerReadInput, callback: (snapshot: Snapshot<IndexerRowsByTable[T]>) => void): Effect.Effect<Unsubscribe, IndexerReadError>;
|
|
1019
|
+
/** Sync position per chain. Unauthenticated: a stale index is not a refusal. */
|
|
1020
|
+
readonly status: Effect.Effect<readonly IndexerChainStatus[], IndexerReadError>;
|
|
1021
|
+
}
|
|
1022
|
+
//#endregion
|
|
885
1023
|
//#region src/flows/types.d.ts
|
|
886
1024
|
/** The runtime port bundle that `assembleCapxulClient` uses. */
|
|
887
1025
|
interface FlowPorts {
|
|
@@ -894,6 +1032,11 @@ interface FlowPorts {
|
|
|
894
1032
|
readonly clock: ClockPort;
|
|
895
1033
|
readonly telemetry: TelemetryPort;
|
|
896
1034
|
readonly convexCall: ConvexCallPort;
|
|
1035
|
+
/**
|
|
1036
|
+
* The Ponder read seam (P02). Optional: it is present only when the client
|
|
1037
|
+
* was given an indexer origin, and every existing flow works without it.
|
|
1038
|
+
*/
|
|
1039
|
+
readonly indexerRead?: IndexerReadPort;
|
|
897
1040
|
}
|
|
898
1041
|
/** Legacy method input retained by the imperative auth surface. */
|
|
899
1042
|
interface ExternalSigner {
|
|
@@ -929,6 +1072,8 @@ type StartOrResumeOrganizationInput = {
|
|
|
929
1072
|
/** #1064: optional onboarding-collected description + size bucket. */
|
|
930
1073
|
readonly bio?: string;
|
|
931
1074
|
readonly size?: string;
|
|
1075
|
+
/** #1955: storage id from `media.uploadImage`, recorded on the org insert. */
|
|
1076
|
+
readonly logoStorageId?: string;
|
|
932
1077
|
/** @internal Safe trace/correlation carriage owned by the identity flow. */
|
|
933
1078
|
readonly observationContext?: WireObservationContext;
|
|
934
1079
|
};
|
|
@@ -1019,7 +1164,16 @@ interface SmartAccountMethods {
|
|
|
1019
1164
|
}
|
|
1020
1165
|
//#endregion
|
|
1021
1166
|
//#region src/surface/identity.d.ts
|
|
1022
|
-
|
|
1167
|
+
/**
|
|
1168
|
+
* #1955: what a create call may carry besides the three required fields — the
|
|
1169
|
+
* photo already uploaded and the payout addresses the form collected.
|
|
1170
|
+
*/
|
|
1171
|
+
interface ProfileCarriage {
|
|
1172
|
+
/** Storage id from `media.uploadImage`. */
|
|
1173
|
+
readonly imageStorageId?: string;
|
|
1174
|
+
readonly payoutAddresses?: readonly PayoutAddress[];
|
|
1175
|
+
}
|
|
1176
|
+
interface CompleteProfileInput extends ProfileCarriage {
|
|
1023
1177
|
readonly displayName: string;
|
|
1024
1178
|
readonly country: string;
|
|
1025
1179
|
readonly handle: string;
|
|
@@ -1518,20 +1672,19 @@ interface ActivityAnnotationInput {
|
|
|
1518
1672
|
readonly accountingCategory?: string;
|
|
1519
1673
|
readonly memo?: string;
|
|
1520
1674
|
}
|
|
1675
|
+
/**
|
|
1676
|
+
* #1960 R02: the declared option type is the `InvocationControls` these methods
|
|
1677
|
+
* have always forwarded to `deps.invocationControls`, so an Activity action can
|
|
1678
|
+
* carry the correlation its UI observation already used. `{ signal }` callers
|
|
1679
|
+
* are unaffected.
|
|
1680
|
+
*/
|
|
1521
1681
|
interface ActivityMethods {
|
|
1522
|
-
list(params?: ActivityListParams, options?:
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
summary(params?: ActivitySummaryParams, options?: {
|
|
1526
|
-
readonly signal?: AbortSignal;
|
|
1527
|
-
}): Promise<CapxulResult<ActivitySummary>>;
|
|
1528
|
-
get(reference: ActivityReference, options?: {
|
|
1529
|
-
readonly signal?: AbortSignal;
|
|
1682
|
+
list(params?: ActivityListParams, options?: InvocationControls): Promise<CapxulResult<ActivityPage>>;
|
|
1683
|
+
summary(params?: ActivitySummaryParams, options?: InvocationControls): Promise<CapxulResult<ActivitySummary>>;
|
|
1684
|
+
get(reference: ActivityReference, options?: InvocationControls & {
|
|
1530
1685
|
readonly actor?: ActorReference;
|
|
1531
1686
|
}): Promise<CapxulResult<ActivityDetail | null>>;
|
|
1532
|
-
annotate(input: ActivityAnnotationInput, options?:
|
|
1533
|
-
readonly signal?: AbortSignal;
|
|
1534
|
-
}): Promise<CapxulResult<ActivityAnnotation>>;
|
|
1687
|
+
annotate(input: ActivityAnnotationInput, options?: InvocationControls): Promise<CapxulResult<ActivityAnnotation>>;
|
|
1535
1688
|
}
|
|
1536
1689
|
interface OfframpQuoteInput {
|
|
1537
1690
|
readonly actor?: ActorReference;
|
|
@@ -1685,25 +1838,19 @@ interface AddressBookLabelInput {
|
|
|
1685
1838
|
interface AddressBookListInput {
|
|
1686
1839
|
readonly includeHidden?: boolean;
|
|
1687
1840
|
}
|
|
1841
|
+
/**
|
|
1842
|
+
* #1960 R02: the declared option type is the `InvocationControls` these methods
|
|
1843
|
+
* have always forwarded to `deps.invocationControls`. Naming it lets a caller
|
|
1844
|
+
* that captured one user attempt hand the same `correlation_id`/`journey_id` to
|
|
1845
|
+
* the operation the attempt starts. `{ signal }` callers are unaffected.
|
|
1846
|
+
*/
|
|
1688
1847
|
interface AddressBookMethods {
|
|
1689
|
-
list(input?: AddressBookListInput, options?:
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
add(input: AddressBookAddInput, options?: {
|
|
1696
|
-
readonly signal?: AbortSignal;
|
|
1697
|
-
}): Promise<CapxulResult<AddressBookEntry>>;
|
|
1698
|
-
hide(entryId: PartyId, options?: {
|
|
1699
|
-
readonly signal?: AbortSignal;
|
|
1700
|
-
}): Promise<CapxulResult<AddressBookEntry>>;
|
|
1701
|
-
unhide(entryId: PartyId, options?: {
|
|
1702
|
-
readonly signal?: AbortSignal;
|
|
1703
|
-
}): Promise<CapxulResult<AddressBookEntry>>;
|
|
1704
|
-
label(input: AddressBookLabelInput, options?: {
|
|
1705
|
-
readonly signal?: AbortSignal;
|
|
1706
|
-
}): Promise<CapxulResult<AddressBookEntry>>;
|
|
1848
|
+
list(input?: AddressBookListInput, options?: InvocationControls): Promise<CapxulResult<readonly AddressBookEntry[]>>;
|
|
1849
|
+
get(entryId: PartyId, options?: InvocationControls): Promise<CapxulResult<AddressBookEntry | null>>;
|
|
1850
|
+
add(input: AddressBookAddInput, options?: InvocationControls): Promise<CapxulResult<AddressBookEntry>>;
|
|
1851
|
+
hide(entryId: PartyId, options?: InvocationControls): Promise<CapxulResult<AddressBookEntry>>;
|
|
1852
|
+
unhide(entryId: PartyId, options?: InvocationControls): Promise<CapxulResult<AddressBookEntry>>;
|
|
1853
|
+
label(input: AddressBookLabelInput, options?: InvocationControls): Promise<CapxulResult<AddressBookEntry>>;
|
|
1707
1854
|
}
|
|
1708
1855
|
interface ActorRequest {
|
|
1709
1856
|
readonly id: string;
|
|
@@ -2545,6 +2692,13 @@ type IdentityProfileDetails = {
|
|
|
2545
2692
|
readonly displayName: string;
|
|
2546
2693
|
readonly country: string;
|
|
2547
2694
|
readonly handle: string;
|
|
2695
|
+
/**
|
|
2696
|
+
* #1955: the storage id `useCapxulUploadImage` handed back on file pick, and
|
|
2697
|
+
* the payout addresses the form collected. The create call carries them, so
|
|
2698
|
+
* the backend binds the photo and writes the rails in the same durable step.
|
|
2699
|
+
*/
|
|
2700
|
+
readonly imageStorageId?: string;
|
|
2701
|
+
readonly payoutAddresses?: readonly PayoutAddress[];
|
|
2548
2702
|
};
|
|
2549
2703
|
interface IdentityRuntime {
|
|
2550
2704
|
readonly snapshot: () => IdentityState;
|
|
@@ -2636,6 +2790,13 @@ interface CapxulClient {
|
|
|
2636
2790
|
* NOT on the public `client.accounts` surface.
|
|
2637
2791
|
*/
|
|
2638
2792
|
readonly accounts: AccountsFaucetMethods;
|
|
2793
|
+
/**
|
|
2794
|
+
* Ponder read seam (P02). Present only when the client was built with an
|
|
2795
|
+
* indexer origin, so every reader treats it as optional. Ponder holds what
|
|
2796
|
+
* the chain said; Convex holds what the user meant. Reads here never run
|
|
2797
|
+
* inside a write path and never wait for a finality tag.
|
|
2798
|
+
*/
|
|
2799
|
+
readonly indexer?: IndexerReadPort;
|
|
2639
2800
|
/** Quarantined Reference-harness evidence; never a product Organization method. */
|
|
2640
2801
|
readonly organizationSetup: OrganizationSetupProofMethods;
|
|
2641
2802
|
/** Product telemetry projection for internal composition and test harnesses. */
|
|
@@ -2835,4 +2996,57 @@ interface ObservationAdapter {
|
|
|
2835
2996
|
/** Stable PostHog event used for typed failures that are expected product outcomes. */
|
|
2836
2997
|
declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
|
|
2837
2998
|
//#endregion
|
|
2838
|
-
|
|
2999
|
+
//#region src/ports/diagnostic.d.ts
|
|
3000
|
+
type DiagnosticDetail = Readonly<Record<string, unknown>>;
|
|
3001
|
+
interface DiagnosticPort {
|
|
3002
|
+
readonly trace: (scope: string, detail: DiagnosticDetail) => void;
|
|
3003
|
+
}
|
|
3004
|
+
//#endregion
|
|
3005
|
+
//#region src/openfort/create-openfort-browser-signer.d.ts
|
|
3006
|
+
interface OpenfortBrowserSignerOptions {
|
|
3007
|
+
readonly diagnostic?: DiagnosticPort;
|
|
3008
|
+
/** Testing seam below the existing one-retry recovery owner. */
|
|
3009
|
+
readonly signUserOpHash?: ((hash: Parameters<CapxulSigner["signUserOpHash"]>[0], delegate: CapxulSigner["signUserOpHash"]) => ReturnType<CapxulSigner["signUserOpHash"]>) | undefined;
|
|
3010
|
+
}
|
|
3011
|
+
//#endregion
|
|
3012
|
+
//#region src/production.d.ts
|
|
3013
|
+
/**
|
|
3014
|
+
* Consumer-facing `createCapxulClient` input (SDK DX public surface · #326).
|
|
3015
|
+
* The publishable key is the primary input; bootstrap host, invoke timeout,
|
|
3016
|
+
* runtime detection, and auth-cache selection are SDK-owned defaults.
|
|
3017
|
+
*/
|
|
3018
|
+
interface CapxulClientInput {
|
|
3019
|
+
readonly publishableKey: string;
|
|
3020
|
+
/**
|
|
3021
|
+
* One host-owned product/failure observability module around the host's
|
|
3022
|
+
* existing analytics client. Omit for zero host observation work.
|
|
3023
|
+
*/
|
|
3024
|
+
readonly observability?: HostObservability;
|
|
3025
|
+
/**
|
|
3026
|
+
* Init-time account readiness target (issue #159 · AC4). Threaded into
|
|
3027
|
+
* `assembleCapxulClient` so `client.account.{getStatus,ensureReady}` reflect
|
|
3028
|
+
* the consumer's chosen requirement. Optional — defaults to `"none"` (SDK
|
|
3029
|
+
* publish readiness · I3) so `createCapxulClient({ publishableKey })` works
|
|
3030
|
+
* with no account lane.
|
|
3031
|
+
*/
|
|
3032
|
+
readonly requirement?: AccountRequirement;
|
|
3033
|
+
/**
|
|
3034
|
+
* Consumer-held signer (backend-orchestrated-deploy.md). Required for
|
|
3035
|
+
* `requirement: "deployed"` flows: `provision` reads `getAddress()` and the
|
|
3036
|
+
* deploy path signs the backend's SafeOp digest via `signUserOpHash()`. The
|
|
3037
|
+
* backend orchestrates build + gas + paymaster + submit — the client never
|
|
3038
|
+
* holds an RPC URL, a gas-sponsorship policy, or a bundler.
|
|
3039
|
+
*/
|
|
3040
|
+
readonly signer?: CapxulSigner;
|
|
3041
|
+
}
|
|
3042
|
+
/** Per-client signing controls; only the testing entry exposes these to consumers. */
|
|
3043
|
+
interface ProductionSignerControls {
|
|
3044
|
+
/** Final signing call. Address, readiness and session lifecycle retain their real owner. */
|
|
3045
|
+
readonly signUserOpHash?: (hash: Parameters<CapxulSigner["signUserOpHash"]>[0], signer: CapxulSigner & {
|
|
3046
|
+
readonly resetSession?: () => void;
|
|
3047
|
+
}) => ReturnType<CapxulSigner["signUserOpHash"]>;
|
|
3048
|
+
/** Embedded signing calls, including the existing recovery owner's single retry. */
|
|
3049
|
+
readonly signEmbeddedUserOpHash?: OpenfortBrowserSignerOptions["signUserOpHash"];
|
|
3050
|
+
}
|
|
3051
|
+
//#endregion
|
|
3052
|
+
export { OrganizationPaymentBatchInput as $, RequestStatus as $n, Destination as $t, OrgScopedMethods as A, Ref$1 as An, AddressBookAddInput as At, AuthorizeRunOptions as B, SmartAccountMethods as Bn, ActivityFilter as Bt, CurrentUserMethods as C, PaymentMoney as Cn, AccountMethods as Ct, MemberStatus as D, PaymentsMethods as Dn, ActorRequest as Dt, InviteMemberInput as E, PaymentType as En, ActorRelationshipMethods as Et, ResendInviteTokenInput as F, AccountLifecycle as Fn, InboxItem as Ft, PayrollGroupsMethods as G, ActorRef as Gn, ActivityPage as Gt, PayrollGroup as H, OrgLifecycle as Hn, ActivityKind as Ht, RoleDefinition as I, AccountSetupStep as In, InboxMethods as It, PayrollRun as J, SubmittedPermissionExecution as Jn, ActivitySummary as Jt, PayrollMethods as K, CurrentHoldings as Kn, ActivityRange as Kt, RoleSpendCap as L, isSettingUpLifecycle as Ln, ActivityAnnotation as Lt, OrgView as M, TargetReference as Mn, AddressBookLabelInput as Mt, OrganizationAccount as N, TargetsMethods as Nn, AddressBookMethods as Nt, MemberView as O, PaymentsPayInput as On, ActorRequestIssueInput as Ot, OrganizationAuditLogItem as P, fingerprintPaymentIntent as Pn, InboxApproveInput as Pt, PayrollTermsUnit as Q, PaymentStatus$1 as Qn, DepositInstructions as Qt, RoleView as R, CompleteProfileInput as Rn, ActivityAnnotationInput as Rt, CurrentUserContext as S, PaymentDocumentsMethods as Sn, ReadyAccountLifecycle as St, DetectPendingOrgInvitationsResult as T, PaymentTiming as Tn, ActorProfileMethods as Tt, PayrollGroupInput as U, OrgSetupStep as Un, ActivityListParams as Ut, PayrollEngagementTerms as V, AuthMethods as Vn, ActivityItem as Vt, PayrollGroupMember as W, PayoutAddress as Wn, ActivityMethods as Wt, PayrollRunStatus as X, PAYMENT_DIRECTIONS as Xn, ActivitySummaryTotal as Xt, PayrollRunItemInput as Y, InboxStatus as Yn, ActivitySummaryParams as Yt, PayrollRuns as Z, PAYMENT_STATUSES as Zn, ActorReference as Zt, HoldingsMethods as _, PaymentDirection as _n, OnboardingMethods as _t, ObservationContext as a, DestinationRemoveInput as an, IdentityEvent as ar, PermissionCreateInput as at, SystemHealth as b, PaymentDocumentRender as bn, PersonOnboarding as bt, HostObservability as c, MeMethods as cn, Readiness as cr, PermissionReplaceInput as ct, postHogObservability as d, OfframpMethods as dn, isClaimed as dr, Budget as dt, DestinationAddInput as en, TelemetryEvent as er, OrganizationPaymentInput as et, CapxulClient as f, OfframpQuote as fn, isRestoring as fr, OrgMe as ft, IdentityRuntimeSendResult as g, PaymentActivityEvidence as gn, CompletedPersonProfile as gt, IdentityRuntime as h, Payment as hn, AccountsMethods as ht, ObservationAdapter as i, DestinationRail as in, Destination$1 as ir, PermissionChangeInput as it, OrgTemplate as j, ResolvedTarget as jn, AddressBookEntry as jt, OrgMethods as k, RecipientResolution as kn, ActorRequestsMethods as kt, PostHogObservabilityClient as l, MeProfile as ln, StateLabel as lr, PermissionRevokeInput as lt, IdentityProfileDetails as m, OfframpStatus as mn, InvocationControls as mr, OrgMeOptions as mt, ProductionSignerControls as n, DestinationListInput as nn, TelemetryIdentifyInput as nr, OrganizationPaymentsMethods as nt, ObservationDelivery as o, DestinationsMethods as on, IdentityState as or, PermissionMethods as ot, CreateCapxulClientInput as p, OfframpQuoteInput as pn, IdentityTransition as pr, OrgMeMethod as pt, PayrollOptions as q, Permission as qn, ActivityReference as qt, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as r, DestinationPayload as rn, TelemetryPort as rr, PermissionAssignInput as rt, SdkFailureObservation as s, FinancialOpsMethods as sn, OrgLane as sr, PermissionOptions as st, CapxulClientInput as t, DestinationKind as tn, TelemetryGroupInput as tr, OrganizationPaymentItemInput as tt, PostHogObservabilityOptions as u, MovementActivityEvidence as un, destination as ur, PermissionReadResult as ut, Holding as v, PaymentDocumentKind as vn, OrganizationOnboarding as vt, CreateOrgInput as w, PaymentStatus as wn, ActorProfile as wt, MediaMethods as x, PaymentDocumentVerification as xn, PersonOnboardingInput as xt, SystemMethods as y, PaymentDocumentRef as yn, OrganizationOnboardingInput as yt, AuthorizeRunInput as z, IdentityMethods as zn, ActivityDetail as zt };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as CapxulResult } from "../OAuthBearerAuthClient-C-ip-z8M.mjs";
|
|
2
|
+
import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-Du4Vc7YD.mjs";
|
|
2
3
|
import { Effect, Layer } from "effect";
|
|
4
|
+
//#region src/testing/production-client.d.ts
|
|
5
|
+
/** Create the one production client with per-client controls at its signing boundaries. */
|
|
6
|
+
declare function createCapxulProductionTestClient(input: CapxulClientInput, controls: ProductionSignerControls): Promise<CapxulResult<CapxulClient>>;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/testing/signer-faults.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Which provider refusal to inject. The codes are the ones the SDK's own
|
|
11
|
+
* classifiers decode (`src/signer.ts`), so a fault reaches the public error
|
|
12
|
+
* contract through the real decode path rather than a shortcut.
|
|
13
|
+
*
|
|
14
|
+
* - `missing-signer` — Openfort's typed not-ready code. `openfortSignerNotReadyCode`
|
|
15
|
+
* decodes it, so the production recovery wrapper runs its single retry (A02).
|
|
16
|
+
* - `user-rejected` — the EIP-1193 4001 result. `signerFailure` decodes it to
|
|
17
|
+
* `SIGNER_REJECTED`, an expected refusal (A08).
|
|
18
|
+
* - `unexpected` — no provider code at all, so it stays an unexpected
|
|
19
|
+
* `PROVIDER_ERROR` (A09).
|
|
20
|
+
*/
|
|
21
|
+
type SignerFaultKind = "missing-signer" | "user-rejected" | "unexpected";
|
|
22
|
+
/** The value a controlled fault throws. Named so a test can assert its origin. */
|
|
23
|
+
declare class ControlledSignerFault extends Error {
|
|
24
|
+
readonly kind: SignerFaultKind;
|
|
25
|
+
/** Provider code the SDK classifiers read; absent for `unexpected`. */
|
|
26
|
+
readonly code: string | number | undefined;
|
|
27
|
+
constructor(kind: SignerFaultKind);
|
|
28
|
+
}
|
|
29
|
+
/** Build one fault value without the harness, for a caller that writes its own control. */
|
|
30
|
+
declare function signerFaultCause(kind: SignerFaultKind): ControlledSignerFault;
|
|
31
|
+
interface SignerFaultPlan {
|
|
32
|
+
/**
|
|
33
|
+
* Fault the next embedded signature ONCE, beneath the production recovery
|
|
34
|
+
* wrapper, then delegate every later call to the real signer. The address
|
|
35
|
+
* read and the readiness cycle still run first, so the fault lands at the
|
|
36
|
+
* actual final signing boundary after the prepared-command equality checks.
|
|
37
|
+
*/
|
|
38
|
+
readonly signOnce?: SignerFaultKind;
|
|
39
|
+
/**
|
|
40
|
+
* Call the production signer's own `resetSession()` ONCE, immediately before
|
|
41
|
+
* the next signature and after the command is prepared. The delegate then
|
|
42
|
+
* re-runs the real readiness cycle, so the configure request under test is
|
|
43
|
+
* the first one the browser observes after the `reset-session` record (A03).
|
|
44
|
+
*
|
|
45
|
+
* Throws when the composed signer owns no session — a silently skipped reset
|
|
46
|
+
* would leave the run looking green while proving nothing.
|
|
47
|
+
*/
|
|
48
|
+
readonly resetSessionBeforeNextSign?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** What the seam did. JSON-serializable, so a browser test can read it back. */
|
|
51
|
+
interface SignerSeamRecord {
|
|
52
|
+
readonly boundary: "reset-session" | "embedded-sign";
|
|
53
|
+
/** 1-based count of calls at that boundary. */
|
|
54
|
+
readonly attempt: number;
|
|
55
|
+
readonly hash?: string;
|
|
56
|
+
/** Present only on the call that actually threw. */
|
|
57
|
+
readonly fault?: SignerFaultKind;
|
|
58
|
+
readonly atMs: number;
|
|
59
|
+
}
|
|
60
|
+
interface ArmedSignerSeam {
|
|
61
|
+
/** Hand these to `createCapxulProductionTestClient`. */
|
|
62
|
+
readonly controls: ProductionSignerControls;
|
|
63
|
+
/** Oldest first. Empty until the client reaches a signing boundary. */
|
|
64
|
+
readonly records: () => readonly SignerSeamRecord[];
|
|
65
|
+
/** True once every armed one-shot has fired. */
|
|
66
|
+
readonly spent: () => boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Arm one-shot faults on the production embedded signer.
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const seam = armSignerFaults({ signOnce: "user-rejected" });
|
|
73
|
+
* const client = await createCapxulProductionTestClient(input, seam.controls);
|
|
74
|
+
* const result = await client.org(orgId).permissions.create(command);
|
|
75
|
+
* // result.error.code === "SIGNER_REJECTED"; nothing was submitted.
|
|
76
|
+
* // seam.records() names the boundary that refused.
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* An empty plan installs no controls, which composes the ordinary client.
|
|
80
|
+
*/
|
|
81
|
+
declare function armSignerFaults(plan?: SignerFaultPlan): ArmedSignerSeam;
|
|
82
|
+
//#endregion
|
|
3
83
|
//#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
|
|
4
84
|
type RecordingTelemetryOperation = {
|
|
5
85
|
readonly type: "emit";
|
|
@@ -51,4 +131,4 @@ interface CapxulTestObservation {
|
|
|
51
131
|
*/
|
|
52
132
|
declare function createCapxulTestClient(options?: CreateCapxulTestClientOptions): CapxulTestClient;
|
|
53
133
|
//#endregion
|
|
54
|
-
export { CapxulTestClient, CapxulTestClock, CapxulTestObservation, CreateCapxulTestClientOptions, SeedTestIdentityInput, createCapxulTestClient };
|
|
134
|
+
export { type ArmedSignerSeam, CapxulTestClient, CapxulTestClock, CapxulTestObservation, ControlledSignerFault, CreateCapxulTestClientOptions, type ProductionSignerControls, SeedTestIdentityInput, type SignerFaultKind, type SignerFaultPlan, type SignerSeamRecord, armSignerFaults, createCapxulProductionTestClient, createCapxulTestClient, signerFaultCause };
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Effect, Result, Semaphore } from "effect";
|
|
1
|
+
import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-BndbwuVx.mjs";
|
|
2
|
+
import { G as toHandle, H as toEmail, I as toAuthUserId, K as toJwtToken, M as toAddress, N as toAllowedOrigin, P as toAppId, Q as toPublishableKey, R as toChainId, U as toEpochMs, V as toDurationMs, W as toEpochSeconds, d as authClientPortFromPromiseAdapter, et as toSessionToken, j as toAccountId, lt as Errors, n as readClockNow, q as toKycTier, r as InMemoryAuthCacheAdapter, rt as validateHandle, st as CapxulError, y as deriveCapxulSafeAddress, z as toCountryCode } from "../OAuthBearerAuthClient-IB2W1Fzj.mjs";
|
|
4
3
|
import { keccak256 } from "viem";
|
|
4
|
+
import { Effect, Result, Semaphore } from "effect";
|
|
5
5
|
import { getFunctionName } from "convex/server";
|
|
6
|
+
//#region src/testing/production-client.ts
|
|
7
|
+
/** Create the one production client with per-client controls at its signing boundaries. */
|
|
8
|
+
function createCapxulProductionTestClient(input, controls) {
|
|
9
|
+
return createCapxulClientWithSignerControls(input, controls);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/testing/signer-faults.ts
|
|
13
|
+
const FAULT_CODES = {
|
|
14
|
+
"missing-signer": "MISSING_SIGNER",
|
|
15
|
+
"user-rejected": 4001,
|
|
16
|
+
unexpected: void 0
|
|
17
|
+
};
|
|
18
|
+
/** The value a controlled fault throws. Named so a test can assert its origin. */
|
|
19
|
+
var ControlledSignerFault = class extends Error {
|
|
20
|
+
kind;
|
|
21
|
+
/** Provider code the SDK classifiers read; absent for `unexpected`. */
|
|
22
|
+
code;
|
|
23
|
+
constructor(kind) {
|
|
24
|
+
super(`controlled signer fault (${kind})`);
|
|
25
|
+
this.name = "ControlledSignerFault";
|
|
26
|
+
this.kind = kind;
|
|
27
|
+
this.code = FAULT_CODES[kind];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/** Build one fault value without the harness, for a caller that writes its own control. */
|
|
31
|
+
function signerFaultCause(kind) {
|
|
32
|
+
return new ControlledSignerFault(kind);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Arm one-shot faults on the production embedded signer.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* const seam = armSignerFaults({ signOnce: "user-rejected" });
|
|
39
|
+
* const client = await createCapxulProductionTestClient(input, seam.controls);
|
|
40
|
+
* const result = await client.org(orgId).permissions.create(command);
|
|
41
|
+
* // result.error.code === "SIGNER_REJECTED"; nothing was submitted.
|
|
42
|
+
* // seam.records() names the boundary that refused.
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* An empty plan installs no controls, which composes the ordinary client.
|
|
46
|
+
*/
|
|
47
|
+
function armSignerFaults(plan = {}) {
|
|
48
|
+
const records = [];
|
|
49
|
+
let pendingFault = plan.signOnce;
|
|
50
|
+
let pendingReset = plan.resetSessionBeforeNextSign === true;
|
|
51
|
+
let resetCalls = 0;
|
|
52
|
+
let embeddedCalls = 0;
|
|
53
|
+
function record(entry) {
|
|
54
|
+
records.push({
|
|
55
|
+
...entry,
|
|
56
|
+
atMs: Date.now()
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const resetThenSign = async (hash, signer) => {
|
|
60
|
+
if (pendingReset) {
|
|
61
|
+
pendingReset = false;
|
|
62
|
+
resetCalls += 1;
|
|
63
|
+
if (signer.resetSession === void 0) throw new Error("armSignerFaults: resetSessionBeforeNextSign needs the embedded browser signer; this client composed a signer with no session");
|
|
64
|
+
signer.resetSession();
|
|
65
|
+
record({
|
|
66
|
+
boundary: "reset-session",
|
|
67
|
+
attempt: resetCalls,
|
|
68
|
+
hash
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return signer.signUserOpHash(hash);
|
|
72
|
+
};
|
|
73
|
+
const faultThenDelegate = async (hash, delegate) => {
|
|
74
|
+
embeddedCalls += 1;
|
|
75
|
+
const fault = pendingFault;
|
|
76
|
+
if (fault === void 0) {
|
|
77
|
+
record({
|
|
78
|
+
boundary: "embedded-sign",
|
|
79
|
+
attempt: embeddedCalls,
|
|
80
|
+
hash
|
|
81
|
+
});
|
|
82
|
+
return delegate(hash);
|
|
83
|
+
}
|
|
84
|
+
pendingFault = void 0;
|
|
85
|
+
record({
|
|
86
|
+
boundary: "embedded-sign",
|
|
87
|
+
attempt: embeddedCalls,
|
|
88
|
+
hash,
|
|
89
|
+
fault
|
|
90
|
+
});
|
|
91
|
+
throw signerFaultCause(fault);
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
controls: {
|
|
95
|
+
...plan.resetSessionBeforeNextSign === true ? { signUserOpHash: resetThenSign } : {},
|
|
96
|
+
...plan.signOnce === void 0 ? {} : { signEmbeddedUserOpHash: faultThenDelegate }
|
|
97
|
+
},
|
|
98
|
+
records: () => records.slice(),
|
|
99
|
+
spent: () => pendingFault === void 0 && !pendingReset
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
6
103
|
//#region src/testing/account/InMemoryAccountReadAdapter.ts
|
|
7
104
|
var InMemoryAccountReadAdapter = class {
|
|
8
105
|
#deps;
|
|
@@ -909,4 +1006,4 @@ function createCapxulTestClient(options = {}) {
|
|
|
909
1006
|
};
|
|
910
1007
|
}
|
|
911
1008
|
//#endregion
|
|
912
|
-
export { createCapxulTestClient };
|
|
1009
|
+
export { ControlledSignerFault, armSignerFaults, createCapxulProductionTestClient, createCapxulTestClient, signerFaultCause };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0-rc.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"vite-plus": "0.3.0",
|
|
49
49
|
"vitest": "4.1.11",
|
|
50
50
|
"@capxul/errors": "0.3.0",
|
|
51
|
-
"@capxul/observability": "4.1.4",
|
|
52
|
-
"@capxul/types": "0.3.0",
|
|
53
|
-
"@capxul/config": "0.3.0",
|
|
54
51
|
"@capxul/typescript-config": "0.0.0",
|
|
55
|
-
"@capxul/
|
|
52
|
+
"@capxul/observability": "4.2.0-rc.10",
|
|
53
|
+
"@capxul/wire": "0.7.0",
|
|
54
|
+
"@capxul/types": "0.3.0",
|
|
55
|
+
"@capxul/config": "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": {
|