@capxul/sdk 2.0.2 → 2.1.1
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/{create-capxul-client-BixUOzdC.d.mts → create-capxul-client-BI-6Za6X.d.mts} +81 -128
- package/dist/{create-capxul-client-DZh_Ymsf.mjs → create-capxul-client-CPhTPz_9.mjs} +3071 -2756
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -3
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.mjs +1 -1
- package/dist/{signer-CeH3ULzn.d.mts → signer-Bj4F-RwT.d.mts} +9 -11
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CapxulErrorDetails, A as CountryCode, B as PermissionAssignmentId, C as AllowedOrigin, D as AuthUserId, E as AuthSession, F as EpochMs, G as SessionToken, H as Profile, I as Money, J as WeiAmount, K as SmartAccount, L as MovementId, M as DocumentHash, N as DurationMs, O as BlockNumber, P as Email, Q as CapxulErrorCode, R as OrgId, S as AllowanceKey, T as AppId, U as PublishableKey, V as PermissionId, W as RoleKey, Z as CapxulError, d as CapxulResult, et as Failure, f as Profile$1, g as AuthCachePort, j as CurrencyCode, k as ChainId, m as SmartAccount$1, n as CapxulSigner, o as AccountProviderSource, p as Session$1, q as TxHash, s as AccountRequirement, tt as FailureMode, v as CachedJwt, w as AnonymousDistinctId, x as Address$1, y as Account$1, z as PaymentCommandId } from "./signer-
|
|
1
|
+
import { $ as CapxulErrorDetails, A as CountryCode, B as PermissionAssignmentId, C as AllowedOrigin, D as AuthUserId, E as AuthSession, F as EpochMs, G as SessionToken, H as Profile, I as Money, J as WeiAmount, K as SmartAccount, L as MovementId, M as DocumentHash, N as DurationMs, O as BlockNumber, P as Email, Q as CapxulErrorCode, R as OrgId, S as AllowanceKey, T as AppId, U as PublishableKey, V as PermissionId, W as RoleKey, Z as CapxulError, d as CapxulResult, et as Failure, f as Profile$1, g as AuthCachePort, j as CurrencyCode, k as ChainId, m as SmartAccount$1, n as CapxulSigner, o as AccountProviderSource, p as Session$1, q as TxHash, s as AccountRequirement, tt as FailureMode, v as CachedJwt, w as AnonymousDistinctId, x as Address$1, y as Account$1, z as PaymentCommandId } from "./signer-Bj4F-RwT.mjs";
|
|
2
2
|
import { Address, Hex } from "viem";
|
|
3
3
|
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
4
4
|
import { FunctionReference } from "convex/server";
|
|
@@ -63,7 +63,7 @@ interface Session {
|
|
|
63
63
|
readonly email: string;
|
|
64
64
|
readonly authUserId: string;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
66
|
+
/** The initial account state is counterfactual
|
|
67
67
|
* and signerless; `deploy` is the separate claim step that needs a signer. */
|
|
68
68
|
type AccountStep = "wallet" | "identity" | "provision" | "deploy";
|
|
69
69
|
/** org-lifecycle.ts:7-11, verbatim. */
|
|
@@ -152,7 +152,7 @@ type IdentityState = {
|
|
|
152
152
|
readonly phase: "faulted";
|
|
153
153
|
readonly failure: Failure;
|
|
154
154
|
/** Non-null exactly when an OTP entry is resumable — the incumbent's
|
|
155
|
-
* `email !== null && otpRequestedAt !== null` pair
|
|
155
|
+
* `email !== null && otpRequestedAt !== null` pair,
|
|
156
156
|
* made structural. */
|
|
157
157
|
readonly resume: {
|
|
158
158
|
readonly email: string;
|
|
@@ -331,7 +331,7 @@ type TelemetryEvent = {
|
|
|
331
331
|
* a present `unknown` is loud), and sync v2 never synthesizes an artifact for
|
|
332
332
|
* it.
|
|
333
333
|
*/
|
|
334
|
-
declare const CAPXUL_ENVS: readonly ["development", "
|
|
334
|
+
declare const CAPXUL_ENVS: readonly ["development", "staging", "production", "unknown"];
|
|
335
335
|
type CapxulEnv = (typeof CAPXUL_ENVS)[number];
|
|
336
336
|
interface TelemetryIdentifyInput {
|
|
337
337
|
readonly distinctId: string;
|
|
@@ -349,14 +349,17 @@ interface TelemetryGroupInput {
|
|
|
349
349
|
declare const EngineeringTelemetryBootstrapPolicy: Schema.Struct<{
|
|
350
350
|
readonly host: Schema.refine<string, Schema.String>;
|
|
351
351
|
readonly projectToken: Schema.refine<string, Schema.String>;
|
|
352
|
-
readonly capxulEnv: Schema.Union<readonly [Schema.Literal<"development">, Schema.Literal<"
|
|
352
|
+
readonly capxulEnv: Schema.Union<readonly [Schema.Literal<"development">, Schema.Literal<"staging">, Schema.Literal<"production">]>;
|
|
353
353
|
}>;
|
|
354
354
|
type EngineeringTelemetryBootstrapPolicyV1 = Schema.Schema.Type<typeof EngineeringTelemetryBootstrapPolicy>;
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region ../wire/src/status.d.ts
|
|
357
|
-
/** The closed
|
|
358
|
-
declare const
|
|
359
|
-
type
|
|
357
|
+
/** The closed Payment status authority. */
|
|
358
|
+
declare const PAYMENT_STATUSES: readonly ["pending", "settling", "scheduled", "streaming", "pending_claim", "settled", "cancelled", "failed"];
|
|
359
|
+
type PaymentStatus$1 = (typeof PAYMENT_STATUSES)[number];
|
|
360
|
+
/** The payment direction relative to the current actor. */
|
|
361
|
+
declare const PAYMENT_DIRECTIONS: readonly ["in", "out", "self"];
|
|
362
|
+
type PaymentDirection$1 = (typeof PAYMENT_DIRECTIONS)[number];
|
|
360
363
|
/** What a payment is FOR. Pairs with `PAYMENT_DOCUMENT_KINDS`. */
|
|
361
364
|
declare const PAYMENT_TYPES: readonly ["unspecified", "invoice", "payroll", "reimbursement"];
|
|
362
365
|
type PaymentType$1 = (typeof PAYMENT_TYPES)[number];
|
|
@@ -378,7 +381,7 @@ declare const AttachablePaymentDocumentEnvelope: Schema.Union<readonly [Schema.S
|
|
|
378
381
|
readonly name: Schema.Literal<"CapxulPayments">;
|
|
379
382
|
readonly version: Schema.Literal<"1">;
|
|
380
383
|
readonly chainId: Schema.Codec<ChainId, number, never, never>;
|
|
381
|
-
readonly verifyingContract: Schema.Literal<"
|
|
384
|
+
readonly verifyingContract: Schema.Literal<"0xA3ACDD016f706eD432A9a0545C45F0943f996b60">;
|
|
382
385
|
}>;
|
|
383
386
|
readonly primaryType: Schema.Literal<"Memo">;
|
|
384
387
|
readonly message: Schema.Struct<{
|
|
@@ -394,7 +397,7 @@ declare const AttachablePaymentDocumentEnvelope: Schema.Union<readonly [Schema.S
|
|
|
394
397
|
readonly name: Schema.Literal<"CapxulPayments">;
|
|
395
398
|
readonly version: Schema.Literal<"1">;
|
|
396
399
|
readonly chainId: Schema.Codec<ChainId, number, never, never>;
|
|
397
|
-
readonly verifyingContract: Schema.Literal<"
|
|
400
|
+
readonly verifyingContract: Schema.Literal<"0xA3ACDD016f706eD432A9a0545C45F0943f996b60">;
|
|
398
401
|
}>;
|
|
399
402
|
readonly primaryType: Schema.Literal<"Invoice">;
|
|
400
403
|
readonly message: Schema.Struct<{
|
|
@@ -416,7 +419,7 @@ declare const AttachablePaymentDocumentEnvelope: Schema.Union<readonly [Schema.S
|
|
|
416
419
|
readonly name: Schema.Literal<"CapxulPayments">;
|
|
417
420
|
readonly version: Schema.Literal<"1">;
|
|
418
421
|
readonly chainId: Schema.Codec<ChainId, number, never, never>;
|
|
419
|
-
readonly verifyingContract: Schema.Literal<"
|
|
422
|
+
readonly verifyingContract: Schema.Literal<"0xA3ACDD016f706eD432A9a0545C45F0943f996b60">;
|
|
420
423
|
}>;
|
|
421
424
|
readonly primaryType: Schema.Literal<"Payslip">;
|
|
422
425
|
readonly message: Schema.Struct<{
|
|
@@ -437,7 +440,7 @@ declare const AttachablePaymentDocumentEnvelope: Schema.Union<readonly [Schema.S
|
|
|
437
440
|
readonly name: Schema.Literal<"CapxulPayments">;
|
|
438
441
|
readonly version: Schema.Literal<"1">;
|
|
439
442
|
readonly chainId: Schema.Codec<ChainId, number, never, never>;
|
|
440
|
-
readonly verifyingContract: Schema.Literal<"
|
|
443
|
+
readonly verifyingContract: Schema.Literal<"0xA3ACDD016f706eD432A9a0545C45F0943f996b60">;
|
|
441
444
|
}>;
|
|
442
445
|
readonly primaryType: Schema.Literal<"Receipt">;
|
|
443
446
|
readonly message: Schema.Struct<{
|
|
@@ -466,7 +469,7 @@ declare const LineItem: Schema.Struct<{
|
|
|
466
469
|
type AttachablePaymentDocumentEnvelopeV1 = Schema.Schema.Type<typeof AttachablePaymentDocumentEnvelope>;
|
|
467
470
|
type LineItemV1 = Schema.Schema.Type<typeof LineItem>;
|
|
468
471
|
//#endregion
|
|
469
|
-
//#region ../wire/src/
|
|
472
|
+
//#region ../wire/src/money.d.ts
|
|
470
473
|
declare const MovementAnnotationSchema: Schema.Struct<{
|
|
471
474
|
readonly movementId: Schema.Codec<MovementId, string, never, never>;
|
|
472
475
|
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -681,14 +684,10 @@ type Unsubscribe = () => void;
|
|
|
681
684
|
* - `error` · a failed snapshot carrying a typed error (defaults to
|
|
682
685
|
* `CapxulError`)
|
|
683
686
|
*
|
|
684
|
-
* The
|
|
685
|
-
* `ConvexCallPort` contract); subsequent snapshots carry `ok` or `error`
|
|
686
|
-
* per the underlying transport.
|
|
687
|
+
* The first snapshot is `loading`. Later snapshots carry `ok` or `error`.
|
|
687
688
|
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
* substrate port that owns `subscribe` (#1145 re-homed it from the former
|
|
691
|
-
* `ports/subscription.ts`, which was never a port).
|
|
689
|
+
* Domain ports do not expose reactive callback methods. `ConvexCallPort` owns
|
|
690
|
+
* the `subscribe` method.
|
|
692
691
|
*
|
|
693
692
|
* @internal-use
|
|
694
693
|
*/
|
|
@@ -719,7 +718,7 @@ interface ConvexCallPort {
|
|
|
719
718
|
* Substrate-level reactive transport over Convex's `onUpdate`.
|
|
720
719
|
*
|
|
721
720
|
* @internal-use — substrate only; see `ports/subscription.ts`. Domain
|
|
722
|
-
* ports do not expose reactive callback methods to consumers
|
|
721
|
+
* ports do not expose reactive callback methods to consumers.
|
|
723
722
|
*/
|
|
724
723
|
subscribe<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"query", "public", TArgs, TOutput>, args: TArgs, callback: (snapshot: Snapshot<TOutput>) => void): Effect.Effect<Unsubscribe, ConvexCallError>;
|
|
725
724
|
}
|
|
@@ -771,19 +770,7 @@ interface IdentityPort {
|
|
|
771
770
|
}
|
|
772
771
|
//#endregion
|
|
773
772
|
//#region src/ports/smart-account.d.ts
|
|
774
|
-
/**
|
|
775
|
-
* Configuration for a Safe deployment: the chain + RPC endpoint +
|
|
776
|
-
* gas-sponsorship policy. `receiptTimeoutMs` is optional; the deploying
|
|
777
|
-
* adapter applies a default when omitted.
|
|
778
|
-
*
|
|
779
|
-
* #1145 (DEMOLITION §D4): re-homed here from the deleted
|
|
780
|
-
* `ports/safe-deployment.ts`. The SafeDeploymentPort itself was fakes-only
|
|
781
|
-
* plus one e2e adapter; the real Safe lifecycle is backend-orchestrated
|
|
782
|
-
* through this port. Only the two data shapes below survive on the SDK
|
|
783
|
-
* surface — `SafeDeploymentConfig` parameterises the org-deploy seam
|
|
784
|
-
* (`orgDeploymentConfig`), `SafeDeploymentEvidence` is the payload of
|
|
785
|
-
* `confirmDeployment`.
|
|
786
|
-
*/
|
|
773
|
+
/** Safe deployment configuration for the Organization setup adapter. */
|
|
787
774
|
type SafeDeploymentConfig = {
|
|
788
775
|
readonly chainId: ChainId;
|
|
789
776
|
readonly rpcUrl: string;
|
|
@@ -910,7 +897,7 @@ declare class AccountReadError extends AccountReadError_base<{
|
|
|
910
897
|
readonly details?: CapxulErrorDetails;
|
|
911
898
|
}> {}
|
|
912
899
|
/**
|
|
913
|
-
*
|
|
900
|
+
* The Account money read joins the `accounts` row with a
|
|
914
901
|
* live RPC `balanceOf` pull; the adapter lifts wire integers to `Money`.
|
|
915
902
|
*/
|
|
916
903
|
interface AccountReadPort {
|
|
@@ -919,15 +906,7 @@ interface AccountReadPort {
|
|
|
919
906
|
}
|
|
920
907
|
//#endregion
|
|
921
908
|
//#region src/flows/types.d.ts
|
|
922
|
-
/**
|
|
923
|
-
* The full port bundle that `assembleCapxulClient` consumes.
|
|
924
|
-
* (Was 13 before #1145 / DEMOLITION §D4 deleted the credentials, env and
|
|
925
|
-
* transport ports — built by `production.ts`, read by nobody.)
|
|
926
|
-
*
|
|
927
|
-
* The identity actor receives this bundle through `BootIdentityFlowInput` and
|
|
928
|
-
* uses only the existing ports needed by each work lane. Other domain flows
|
|
929
|
-
* retain their own narrowed inputs.
|
|
930
|
-
*/
|
|
909
|
+
/** The runtime port bundle that `assembleCapxulClient` uses. */
|
|
931
910
|
interface FlowPorts {
|
|
932
911
|
readonly authClient: AuthClientPort;
|
|
933
912
|
readonly authCache: AuthCachePort;
|
|
@@ -1105,6 +1084,10 @@ type AccountLifecycle = {
|
|
|
1105
1084
|
};
|
|
1106
1085
|
declare function isSettingUpLifecycle(lifecycle: AccountLifecycle): boolean;
|
|
1107
1086
|
//#endregion
|
|
1087
|
+
//#region src/surface/payment-command-execution.d.ts
|
|
1088
|
+
/** Return one stable fingerprint for one JSON payment intent. */
|
|
1089
|
+
declare function fingerprintPaymentIntent(intent: unknown): Promise<string>;
|
|
1090
|
+
//#endregion
|
|
1108
1091
|
//#region src/surface/money.d.ts
|
|
1109
1092
|
type ActorReference = {
|
|
1110
1093
|
readonly kind: "personal";
|
|
@@ -1226,7 +1209,8 @@ interface PaymentMoney {
|
|
|
1226
1209
|
readonly value: string;
|
|
1227
1210
|
readonly decimals: number;
|
|
1228
1211
|
}
|
|
1229
|
-
type PaymentStatus =
|
|
1212
|
+
type PaymentStatus = PaymentStatus$1;
|
|
1213
|
+
type PaymentDirection = PaymentDirection$1;
|
|
1230
1214
|
type PaymentType = PaymentType$1;
|
|
1231
1215
|
type PaymentDocumentKind = PaymentDocumentKind$1;
|
|
1232
1216
|
interface PaymentDocumentRef {
|
|
@@ -1252,6 +1236,12 @@ interface Payment {
|
|
|
1252
1236
|
readonly status: PaymentStatus;
|
|
1253
1237
|
readonly amount: PaymentMoney;
|
|
1254
1238
|
readonly paymentType: PaymentType;
|
|
1239
|
+
readonly direction: PaymentDirection;
|
|
1240
|
+
readonly counterpartyLabel: string;
|
|
1241
|
+
readonly receipt: {
|
|
1242
|
+
readonly chainId: number;
|
|
1243
|
+
readonly transactionHash: string;
|
|
1244
|
+
} | null;
|
|
1255
1245
|
readonly recipient: {
|
|
1256
1246
|
readonly kind: "handle" | "email" | "payee" | "capxulUserId" | "me" | "org" | "external_address";
|
|
1257
1247
|
readonly label: string;
|
|
@@ -1265,8 +1255,6 @@ interface Payment {
|
|
|
1265
1255
|
readonly updatedAt: number;
|
|
1266
1256
|
}
|
|
1267
1257
|
interface PaymentsPayInput {
|
|
1268
|
-
/** Stable idempotency key for caller retries. Omit only for a one-shot payment. */
|
|
1269
|
-
readonly requestKey?: string;
|
|
1270
1258
|
readonly actor?: ActorReference;
|
|
1271
1259
|
readonly to: TargetReference;
|
|
1272
1260
|
readonly amount: PaymentMoney;
|
|
@@ -1282,7 +1270,7 @@ interface PaymentsPayInput {
|
|
|
1282
1270
|
/** Full EIP-712 document envelope; hashed + stored, committed on-chain. */
|
|
1283
1271
|
readonly document?: AttachablePaymentDocumentEnvelopeV1;
|
|
1284
1272
|
/**
|
|
1285
|
-
*
|
|
1273
|
+
* Payment timing. Omitted means `instant`.
|
|
1286
1274
|
* A `scheduled`/`stream` clause turns the payment into a Commitment
|
|
1287
1275
|
* (escrow-vest-claim) backed by `CapxulPayments.createCommitment`.
|
|
1288
1276
|
*/
|
|
@@ -1388,6 +1376,7 @@ interface ActivityListParams {
|
|
|
1388
1376
|
type ActivityReference = {
|
|
1389
1377
|
readonly kind: "payment";
|
|
1390
1378
|
readonly id: string;
|
|
1379
|
+
readonly actor?: ActorReference;
|
|
1391
1380
|
} | {
|
|
1392
1381
|
readonly kind: "movement";
|
|
1393
1382
|
readonly id: string;
|
|
@@ -1398,6 +1387,12 @@ type ActivityItem = {
|
|
|
1398
1387
|
readonly ledgerKind: "Payment" | "Payout" | "Deposit";
|
|
1399
1388
|
readonly status: PaymentStatus;
|
|
1400
1389
|
readonly amount: PaymentMoney;
|
|
1390
|
+
readonly direction: PaymentDirection;
|
|
1391
|
+
readonly counterpartyLabel: string;
|
|
1392
|
+
readonly receipt: {
|
|
1393
|
+
readonly chainId: number;
|
|
1394
|
+
readonly transactionHash: string;
|
|
1395
|
+
} | null;
|
|
1401
1396
|
readonly createdAt: number;
|
|
1402
1397
|
readonly updatedAt: number;
|
|
1403
1398
|
} | {
|
|
@@ -1523,10 +1518,8 @@ interface PaymentDocumentRender {
|
|
|
1523
1518
|
readonly html: string;
|
|
1524
1519
|
}
|
|
1525
1520
|
/**
|
|
1526
|
-
* The
|
|
1527
|
-
*
|
|
1528
|
-
* `chainId` / `safeAddress`. Host-execution + on-chain evidence live on the
|
|
1529
|
-
* `_internal` channel below; an external builder never touches custody substrate.
|
|
1521
|
+
* The public Payments surface uses product-level methods. A settled receipt can
|
|
1522
|
+
* include `chainId` and `transactionHash`. Internal custody fields stay private.
|
|
1530
1523
|
*/
|
|
1531
1524
|
interface PaymentsMethods {
|
|
1532
1525
|
pay(input: PaymentsPayInput, options?: {
|
|
@@ -1740,8 +1733,8 @@ type AccountStatus = {
|
|
|
1740
1733
|
* here has those two own-keys and nothing else).
|
|
1741
1734
|
*
|
|
1742
1735
|
* Per `packages/sdk/docs/architecture.md`, the
|
|
1743
|
-
* `AccountStatus` discriminant
|
|
1744
|
-
*
|
|
1736
|
+
* `AccountStatus` discriminant includes variants that are returned only by
|
|
1737
|
+
* `getStatus` (for example, `accountPrepared`). It is the durable
|
|
1745
1738
|
* shape consumers depend on. Sibling #161 will extend `ensureReady` to
|
|
1746
1739
|
* advance the ladder past `accountProviderReady` and from
|
|
1747
1740
|
* `accountPrepared` to `accountReady(deployed)`; until then, the type
|
|
@@ -1794,7 +1787,7 @@ interface AccountsMethods {
|
|
|
1794
1787
|
/**
|
|
1795
1788
|
* Faucet surface (dev-only). Deliberately OFF the public `AccountsMethods`;
|
|
1796
1789
|
* reachable only via `client._internal.accounts` (production-surface-policy.md).
|
|
1797
|
-
* The reference CLI uses it
|
|
1790
|
+
* The reference CLI uses it only in the test environment. Consumers do not see `fund`.
|
|
1798
1791
|
*/
|
|
1799
1792
|
interface AccountsFaucetMethods {
|
|
1800
1793
|
fund(amount: Money, options?: {
|
|
@@ -1840,12 +1833,7 @@ declare class OrgError extends OrgError_base<{
|
|
|
1840
1833
|
readonly cause: unknown;
|
|
1841
1834
|
readonly details?: CapxulErrorDetails;
|
|
1842
1835
|
}> {}
|
|
1843
|
-
/**
|
|
1844
|
-
* Live org seam. `createOrg` runs the SDK-orchestrated deploy (D10) and returns
|
|
1845
|
-
* the created `OrgView` (its treasury is the real M2 `Account` over the Org
|
|
1846
|
-
* Safe — $0 at creation, D3). `readTreasury` pulls the org's Account via RPC
|
|
1847
|
-
* `balanceOf` (D3). `listOrgs` lists the orgs the authenticated user belongs to.
|
|
1848
|
-
*/
|
|
1836
|
+
/** The live Organization port creates, reads, and lists Organizations. */
|
|
1849
1837
|
interface OrgPort {
|
|
1850
1838
|
createOrg(input: CreateOrgPortInput): Effect.Effect<OrgView, OrgError, never>;
|
|
1851
1839
|
readTreasury(input: ReadOrgTreasuryInput): Effect.Effect<Account$1, OrgError, never>;
|
|
@@ -1906,12 +1894,10 @@ interface OrganizationPaymentItemInput {
|
|
|
1906
1894
|
}
|
|
1907
1895
|
interface OrganizationPaymentInput extends OrganizationPaymentItemInput {
|
|
1908
1896
|
readonly permissionId: string;
|
|
1909
|
-
readonly requestKey: string;
|
|
1910
1897
|
readonly lineage?: PaymentCommandLineage;
|
|
1911
1898
|
}
|
|
1912
1899
|
interface OrganizationPaymentBatchInput {
|
|
1913
1900
|
readonly permissionId: string;
|
|
1914
|
-
readonly requestKey: string;
|
|
1915
1901
|
readonly items: readonly OrganizationPaymentItemInput[];
|
|
1916
1902
|
readonly lineage?: PaymentCommandLineage;
|
|
1917
1903
|
}
|
|
@@ -1925,27 +1911,15 @@ interface OrganizationPaymentsMethods {
|
|
|
1925
1911
|
}
|
|
1926
1912
|
//#endregion
|
|
1927
1913
|
//#region src/surface/org.d.ts
|
|
1928
|
-
/**
|
|
1929
|
-
* A member's lifecycle status (D9 — unified `Member` with status
|
|
1930
|
-
* `pending | active | revoked | expired`). `pending` = invited (incl. a
|
|
1931
|
-
* non-user emailed into existence) but not yet a provisioned member with an
|
|
1932
|
-
* on-chain grant; `active` = on-chain role granted; `revoked` = offboarded
|
|
1933
|
-
* (on-chain REVOKE fired); `expired` = pending invitation timed out.
|
|
1934
|
-
*/
|
|
1914
|
+
/** The membership state for one Organization member. */
|
|
1935
1915
|
type MemberStatus = "pending" | "pending_safe" | "pending_grant" | "active" | "revoked" | "expired";
|
|
1936
|
-
/**
|
|
1937
|
-
* One Org you belong to (canon §C1 "Org list" — name, role, balance).
|
|
1938
|
-
* `role` is the member's role label within THIS org. `treasury` is the M2
|
|
1939
|
-
* `Account` over the Org Safe (D3). `handle` is the globally-unique,
|
|
1940
|
-
* normalized org handle (D10a). Pure record of brand-typed fields — not a
|
|
1941
|
-
* brand.
|
|
1942
|
-
*/
|
|
1916
|
+
/** One Organization that the current user can access. */
|
|
1943
1917
|
type OrgView = {
|
|
1944
1918
|
readonly id: OrgId;
|
|
1945
1919
|
readonly name: string;
|
|
1946
1920
|
readonly handle: string;
|
|
1947
1921
|
readonly safeAddress: Address$1; /** The viewing member's own role label within this org. */
|
|
1948
|
-
readonly role: string; /** The
|
|
1922
|
+
readonly role: string; /** The Organization treasury Account. */
|
|
1949
1923
|
readonly treasury: Account$1; /** #1064: onboarding-collected description + size bucket; null when unset. */
|
|
1950
1924
|
readonly bio: string | null;
|
|
1951
1925
|
readonly size: string | null; /** #1061 / ADR-0014: logo serving URL resolved at read time; null when unset. */
|
|
@@ -1967,38 +1941,28 @@ interface OrganizationAuditLogItem {
|
|
|
1967
1941
|
readonly metadata?: Record<string, unknown>;
|
|
1968
1942
|
}
|
|
1969
1943
|
/**
|
|
1970
|
-
* One member
|
|
1971
|
-
* `personalSafeAddress` is the member-identity key (D7 — Safe-as-identity); it
|
|
1944
|
+
* One Organization member. `personalSafeAddress` is the member identity key. It
|
|
1972
1945
|
* is `null` while the member is still `pending` (emailed into existence but not
|
|
1973
|
-
* yet provisioned a personal Safe). `email` is the universal entry point
|
|
1946
|
+
* yet provisioned a personal Safe). `email` is the universal entry point.
|
|
1974
1947
|
*/
|
|
1975
1948
|
type MemberView = {
|
|
1976
1949
|
readonly orgId: OrgId;
|
|
1977
1950
|
readonly email: Email;
|
|
1978
|
-
readonly name: string | null; /** Member
|
|
1979
|
-
readonly personalSafeAddress: Address$1 | null; /** The member
|
|
1951
|
+
readonly name: string | null; /** Member identity key. `null` until the invitee provisions a Safe. */
|
|
1952
|
+
readonly personalSafeAddress: Address$1 | null; /** The member role label maps to the on-chain `roleKey`. */
|
|
1980
1953
|
readonly role: string;
|
|
1981
1954
|
readonly roleKey: RoleKey | null;
|
|
1982
1955
|
readonly status: MemberStatus;
|
|
1983
1956
|
readonly grantTxHash: string | null;
|
|
1984
1957
|
readonly revokeTxHash: string | null;
|
|
1985
1958
|
};
|
|
1986
|
-
/**
|
|
1987
|
-
* A role's on-chain Level-1 spend cap (D4/D5 — physically enforced via Zodiac
|
|
1988
|
-
* Roles + Allowance). `perTx` / `perDay` are `Money`; `toRecipients` scopes the
|
|
1989
|
-
* allowed recipient set. Omitting a field means "unbounded on that axis"
|
|
1990
|
-
* (the Owner role).
|
|
1991
|
-
*/
|
|
1959
|
+
/** A role spend cap that Zodiac Roles and Allowance enforce on-chain. */
|
|
1992
1960
|
type RoleSpendCap = {
|
|
1993
1961
|
readonly perTx?: Money;
|
|
1994
1962
|
readonly perDay?: Money;
|
|
1995
1963
|
readonly toRecipients?: "anyone" | readonly Address$1[];
|
|
1996
1964
|
};
|
|
1997
|
-
/**
|
|
1998
|
-
* The Capxul-owned Role DSL definition (D4). `label` becomes the sticky
|
|
1999
|
-
* bytes32 `roleKey` on-chain. `spend` compiles to Level-1 on-chain Zodiac
|
|
2000
|
-
* conditions. Management flags compile to off-chain guards.
|
|
2001
|
-
*/
|
|
1965
|
+
/** A Capxul Role definition. */
|
|
2002
1966
|
type RoleDefinition = {
|
|
2003
1967
|
readonly label: string;
|
|
2004
1968
|
readonly spend?: RoleSpendCap;
|
|
@@ -2006,7 +1970,7 @@ type RoleDefinition = {
|
|
|
2006
1970
|
readonly canManageRoles?: boolean;
|
|
2007
1971
|
};
|
|
2008
1972
|
/**
|
|
2009
|
-
* One role seeded on an
|
|
1973
|
+
* One role seeded on an Organization.
|
|
2010
1974
|
* `roleKey` is the on-chain bytes32 role key derived from the label. `definition`
|
|
2011
1975
|
* is the full Role DSL entry.
|
|
2012
1976
|
*/
|
|
@@ -2016,13 +1980,13 @@ type RoleView = {
|
|
|
2016
1980
|
readonly roleKey: RoleKey;
|
|
2017
1981
|
readonly definition: RoleDefinition;
|
|
2018
1982
|
};
|
|
2019
|
-
/** Built-in role templates
|
|
1983
|
+
/** Built-in role templates for a new Organization. */
|
|
2020
1984
|
type OrgTemplate = "Solo" | "Startup" | "Custom";
|
|
2021
1985
|
/**
|
|
2022
|
-
* Input to `capxul.createOrg
|
|
2023
|
-
* `handle` is the globally
|
|
2024
|
-
* `template` seeds the initial role set
|
|
2025
|
-
*
|
|
1986
|
+
* Input to `capxul.createOrg`. `name` is the display name.
|
|
1987
|
+
* `handle` is the globally unique normalized handle (`^[a-z0-9-]{3,32}$`).
|
|
1988
|
+
* `template` seeds the initial role set. `country` is stored without validation.
|
|
1989
|
+
* For `template: "Custom"`, `roles` carries the authored
|
|
2026
1990
|
* `RoleDefinition[]`.
|
|
2027
1991
|
*/
|
|
2028
1992
|
type CreateOrgInput = {
|
|
@@ -2033,10 +1997,10 @@ type CreateOrgInput = {
|
|
|
2033
1997
|
readonly roles?: readonly RoleDefinition[];
|
|
2034
1998
|
};
|
|
2035
1999
|
/**
|
|
2036
|
-
* Input to `org(orgId).invite
|
|
2037
|
-
*
|
|
2000
|
+
* Input to `org(orgId).invite`. Email is the universal entry point.
|
|
2001
|
+
* An address that is not yet a Capxul user creates a `pending`
|
|
2038
2002
|
* membership that resolves on sign-in. `role` is invitation metadata. It does
|
|
2039
|
-
* not grant an
|
|
2003
|
+
* not grant an on-chain Permission.
|
|
2040
2004
|
*/
|
|
2041
2005
|
type InviteMemberInput = {
|
|
2042
2006
|
readonly email: string;
|
|
@@ -2049,12 +2013,7 @@ type ResendInviteTokenInput = {
|
|
|
2049
2013
|
type DetectPendingOrgInvitationsResult = {
|
|
2050
2014
|
readonly matched: readonly OrgId[];
|
|
2051
2015
|
};
|
|
2052
|
-
/**
|
|
2053
|
-
* Entity-scoped Org method bundle, returned by `capxul.org(orgId)`. Every
|
|
2054
|
-
* method names the entity implicitly via the closed-over `orgId` (D13 — no
|
|
2055
|
-
* stateful active context). `treasury()` returns the real M2 `Account` over
|
|
2056
|
-
* the Org Safe (D3).
|
|
2057
|
-
*/
|
|
2016
|
+
/** Organization methods for one `orgId`. */
|
|
2058
2017
|
interface OrgScopedMethods extends ActorRelationshipMethods {
|
|
2059
2018
|
/** Observe the durable, leak-safe lifecycle for this Organization only. */
|
|
2060
2019
|
getLifecycle(options?: {
|
|
@@ -2064,7 +2023,7 @@ interface OrgScopedMethods extends ActorRelationshipMethods {
|
|
|
2064
2023
|
retrySetup(options?: {
|
|
2065
2024
|
readonly signal?: AbortSignal;
|
|
2066
2025
|
}): Promise<CapxulResult<OrgLifecycle>>;
|
|
2067
|
-
/** The
|
|
2026
|
+
/** The Organization treasury Account. */
|
|
2068
2027
|
treasury(options?: {
|
|
2069
2028
|
readonly signal?: AbortSignal;
|
|
2070
2029
|
}): Promise<CapxulResult<Account$1>>;
|
|
@@ -2104,14 +2063,14 @@ type OrgsMethod = {
|
|
|
2104
2063
|
};
|
|
2105
2064
|
/**
|
|
2106
2065
|
* Top-level Org method bundle, exposed at `client.org` / `client.orgs` /
|
|
2107
|
-
* `client.createOrg`. `org(orgId)` resolves the entity-scoped bundle
|
|
2066
|
+
* `client.createOrg`. `org(orgId)` resolves the entity-scoped bundle.
|
|
2108
2067
|
*/
|
|
2109
2068
|
interface OrgMethods {
|
|
2110
2069
|
createOrg(input: CreateOrgInput, options?: {
|
|
2111
2070
|
readonly signal?: AbortSignal;
|
|
2112
2071
|
}): Promise<CapxulResult<OrgView>>;
|
|
2113
2072
|
readonly orgs: OrgsMethod;
|
|
2114
|
-
/** Resolve the entity-scoped bundle for a specific
|
|
2073
|
+
/** Resolve the entity-scoped bundle for a specific Organization. */
|
|
2115
2074
|
org(orgId: OrgId): OrgScopedMethods;
|
|
2116
2075
|
}
|
|
2117
2076
|
//#endregion
|
|
@@ -2253,19 +2212,14 @@ interface IdentityRuntime {
|
|
|
2253
2212
|
readonly ok: false;
|
|
2254
2213
|
readonly reason: CapxulErrorCode;
|
|
2255
2214
|
}>;
|
|
2256
|
-
/** @internal
|
|
2215
|
+
/** @internal Optional facade bridge for consumer test doubles. */
|
|
2257
2216
|
readonly runFacade?: <T>(verb: IdentityFacadeVerb, controls: InvocationControls | undefined, run: (controls: InvocationControls) => Promise<T>) => Promise<T>;
|
|
2258
2217
|
}
|
|
2259
2218
|
interface CapxulClient {
|
|
2260
2219
|
readonly auth: AuthMethods;
|
|
2261
2220
|
readonly smartAccount: SmartAccountMethods;
|
|
2262
2221
|
readonly identity: IdentityMethods;
|
|
2263
|
-
/**
|
|
2264
|
-
* Liveness surface (#1149 proof lane): `health(nonce)` round-trips a nonce
|
|
2265
|
-
* through the configured deployment. The only method here that is useful
|
|
2266
|
-
* before sign-in, and the only one whose whole point is that the answer
|
|
2267
|
-
* came from the backend rather than from this process.
|
|
2268
|
-
*/
|
|
2222
|
+
/** `health(nonce)` returns the nonce from the configured deployment. Use it to verify backend liveness before sign-in. */
|
|
2269
2223
|
readonly system: SystemMethods;
|
|
2270
2224
|
/**
|
|
2271
2225
|
* Consumer-facing account readiness surface (issue #159 · AC1+AC3).
|
|
@@ -2274,7 +2228,7 @@ interface CapxulClient {
|
|
|
2274
2228
|
*/
|
|
2275
2229
|
readonly account: AccountMethods;
|
|
2276
2230
|
/**
|
|
2277
|
-
* Consumer-facing
|
|
2231
|
+
* Consumer-facing Account money read.
|
|
2278
2232
|
* Returns `{ balance, available }` as `Money` — never wei or token units.
|
|
2279
2233
|
*/
|
|
2280
2234
|
readonly accounts: AccountsMethods;
|
|
@@ -2285,7 +2239,7 @@ interface CapxulClient {
|
|
|
2285
2239
|
readonly targets: TargetsMethods;
|
|
2286
2240
|
readonly destinations: DestinationsMethods;
|
|
2287
2241
|
/**
|
|
2288
|
-
* Direct Payments surface
|
|
2242
|
+
* Direct Payments surface. `pay` records a validated-recipient
|
|
2289
2243
|
* payment; `list`/`get` read the ledger; `markSettled` is the host-execution
|
|
2290
2244
|
* callback.
|
|
2291
2245
|
*/
|
|
@@ -2293,18 +2247,18 @@ interface CapxulClient {
|
|
|
2293
2247
|
readonly activity: ActivityMethods;
|
|
2294
2248
|
readonly holdings: HoldingsMethods;
|
|
2295
2249
|
readonly offramp: OfframpMethods;
|
|
2296
|
-
/** Payment document
|
|
2250
|
+
/** Re-derive a Payment document EIP-712 hash. */
|
|
2297
2251
|
readonly paymentDocuments: PaymentDocumentsMethods;
|
|
2298
2252
|
/**
|
|
2299
2253
|
* Media surface (#1061 / ADR-0014): profile-image + org-logo upload/record.
|
|
2300
2254
|
*/
|
|
2301
2255
|
readonly media: MediaMethods;
|
|
2302
2256
|
/**
|
|
2303
|
-
* Organization domain surface
|
|
2257
|
+
* Organization domain surface.
|
|
2304
2258
|
* `createOrg(input)` creates an Org; `orgs()` lists the Orgs you belong to;
|
|
2305
2259
|
* `org(orgId)` resolves the entity-scoped bundle (treasury / members / roles,
|
|
2306
2260
|
* invitations, Permissions, and payments). Explicit entity scoping —
|
|
2307
|
-
*
|
|
2261
|
+
* It has no stateful active context.
|
|
2308
2262
|
*/
|
|
2309
2263
|
readonly createOrg: OrgMethods["createOrg"];
|
|
2310
2264
|
readonly orgs: OrgMethods["orgs"];
|
|
@@ -2381,15 +2335,14 @@ interface CreateCapxulClientInput {
|
|
|
2381
2335
|
*/
|
|
2382
2336
|
readonly signer?: CapxulSigner;
|
|
2383
2337
|
/**
|
|
2384
|
-
* Optional live
|
|
2385
|
-
* D3 RPC treasury). When supplied, `client.createOrg` / `org(id).treasury`
|
|
2338
|
+
* Optional live Organization deployment. When supplied, `client.createOrg` and `org(id).treasury`
|
|
2386
2339
|
* run the live path (real deploy + on-chain balance); when omitted, the
|
|
2387
2340
|
* hermetic `$0` path runs (a fresh Org has no on-chain funds). The adapter
|
|
2388
2341
|
* that CONSTRUCTS this port (deployer key + RPC + authenticated Convex seam)
|
|
2389
2342
|
* is wired by the CLI deploy-stack; the factory only threads it through.
|
|
2390
2343
|
*/
|
|
2391
2344
|
readonly orgDeploymentPort?: OrgPort;
|
|
2392
|
-
/**
|
|
2345
|
+
/** Preferred Organization deployment data port. */
|
|
2393
2346
|
readonly orgPort?: OrgPort;
|
|
2394
2347
|
/**
|
|
2395
2348
|
* Internal Organization lifecycle capability. The Core SDK owns its
|
|
@@ -2404,4 +2357,4 @@ interface CreateCapxulClientInput {
|
|
|
2404
2357
|
};
|
|
2405
2358
|
}
|
|
2406
2359
|
//#endregion
|
|
2407
|
-
export { InboxMethods as $,
|
|
2360
|
+
export { InboxMethods as $, OrgLifecycle as $t, OrganizationPaymentsMethods as A, PaymentDocumentRef as At, AccountMethods as B, RecipientResolution as Bt, ResendInviteTokenInput as C, OfframpQuoteInput as Ct, OrganizationPaymentBatchInput as D, Payment as Dt, RoleView as E, PayeesMethods as Et, PermissionOptions as F, PaymentStatus as Ft, ActorRequestIssueInput as G, TargetsMethods as Gt, ActorProfileMethods as H, Ref$1 as Ht, PermissionReplaceInput as I, PaymentTiming as It, AddressBookEntry as J, AccountSetupStep as Jt, ActorRequestsMethods as K, fingerprintPaymentIntent as Kt, PermissionRevokeInput as L, PaymentType as Lt, PermissionChangeInput as M, PaymentDocumentVerification as Mt, PermissionCreateInput as N, PaymentDocumentsMethods as Nt, OrganizationPaymentInput as O, PaymentDirection as Ot, PermissionMethods as P, PaymentMoney as Pt, InboxItem as Q, AuthMethods as Qt, PermissionReadResult as R, PaymentsMethods as Rt, OrganizationAuditLogItem as S, OfframpQuote as St, RoleSpendCap as T, Payee as Tt, ActorRelationshipMethods as U, ResolvedTarget as Ut, ActorProfile as V, RecipientResolutionKind as Vt, ActorRequest as W, TargetReference as Wt, AddressBookMethods as X, IdentityMethods as Xt, AddressBookLabelInput as Y, isSettingUpLifecycle as Yt, InboxApproveInput as Z, SmartAccountMethods as Zt, OrgMethods as _, StateLabel as _n, FinancialOpsMethods as _t, IdentityRuntimeSendResult as a, SubmittedPermissionExecution as an, ActivityPage as at, OrgView as b, InvocationControls as bn, MeProfile as bt, SystemHealth as c, TelemetryGroupInput as cn, DepositInstructions as ct, CurrentUserMethods as d, CAPXUL_PAYMENTS_V2_ADDRESS as dn, DestinationKind as dt, OrgSetupStep as en, ActivityAnnotationInput as et, CreateOrgInput as f, Destination$1 as fn, DestinationListInput as ft, MemberView as g, Readiness as gn, DestinationsMethods as gt, MemberStatus as h, OrgLane as hn, DestinationRemoveInput as ht, IdentityRuntime as i, Permission as in, ActivityMethods as it, PermissionAssignInput as j, PaymentDocumentRender as jt, OrganizationPaymentItemInput as k, PaymentDocumentKind as kt, MediaMethods as l, TelemetryIdentifyInput as ln, Destination as lt, InviteMemberInput as m, IdentityState as mn, DestinationRail as mt, CreateCapxulClientInput as n, CurrentHoldings as nn, ActivityItem as nt, HoldingsMethods as o, CapxulEnv as on, ActivityReference as ot, DetectPendingOrgInvitationsResult as p, IdentityEvent as pn, DestinationPayload as pt, AddressBookAddInput as q, AccountLifecycle as qt, IdentityProfileDetails as r, MovementAnnotation as rn, ActivityListParams as rt, SystemMethods as s, TelemetryEvent as sn, ActorReference as st, CapxulClient as t, WireObservationContext as tn, ActivityDetail as tt, CurrentUserContext as u, TelemetryPort as un, DestinationAddInput as ut, OrgScopedMethods as v, destination as vn, HandlesMethods as vt, RoleDefinition as w, OfframpStatus as wt, OrganizationAccount as x, OfframpMethods as xt, OrgTemplate as y, IdentityTransition as yn, MeMethods as yt, AccountsMethods as z, PaymentsPayInput as zt };
|