@vaultum/sdk 0.1.6 → 0.1.8

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/index.d.mts CHANGED
@@ -39,6 +39,7 @@ interface AuthTokenResponse<TUser = ApiUser> {
39
39
  token: string;
40
40
  type: string;
41
41
  abilities?: string[];
42
+ expires_in?: number;
42
43
  requires_wallet?: boolean;
43
44
  }
44
45
  interface AuthMeResponse<TUser = ApiUser> {
@@ -48,13 +49,15 @@ interface LogoutResponse {
48
49
  message: string;
49
50
  }
50
51
  interface WalletChallengeResponse {
52
+ challengeId: string;
51
53
  message: string;
52
- expiresAt: string;
54
+ digest: Hex;
55
+ expiresAt?: string;
53
56
  }
54
57
  interface UserWalletInfo {
55
58
  address: Address;
56
- chainId: number;
57
- type: string;
59
+ chainId?: number;
60
+ type?: string;
58
61
  }
59
62
  interface WalletsResponse {
60
63
  wallets: UserWalletInfo[];
@@ -866,6 +869,59 @@ interface AddressCapabilities {
866
869
  chains: number[];
867
870
  contracts: string[];
868
871
  }
872
+ interface PasskeySignupResponse extends AuthTokenResponse {
873
+ wallet?: {
874
+ address?: string;
875
+ };
876
+ turnkey?: {
877
+ subOrganizationId?: string;
878
+ };
879
+ }
880
+ interface OtpInitResponse {
881
+ ok: boolean;
882
+ }
883
+ interface OtpVerifyResponse extends AuthTokenResponse {
884
+ turnkey?: {
885
+ verificationToken?: string;
886
+ organizationId?: string;
887
+ session?: string;
888
+ };
889
+ }
890
+ interface PasskeySuborgsResponse {
891
+ organizationIds: string[];
892
+ }
893
+ interface PortfolioTokenItem {
894
+ chain?: string | null;
895
+ network?: string | null;
896
+ tokenAddress?: string | null;
897
+ isNative: boolean;
898
+ rawBalance?: string | null;
899
+ balance?: string | null;
900
+ symbol?: string | null;
901
+ name?: string | null;
902
+ decimals?: string | null;
903
+ logo?: string | null;
904
+ priceUsd?: string | null;
905
+ priceUpdatedAt?: string | null;
906
+ error?: string | null;
907
+ }
908
+ interface PortfolioTokensResponse {
909
+ address: string;
910
+ chains?: string[];
911
+ networks?: string[];
912
+ count: number;
913
+ items: PortfolioTokenItem[];
914
+ pageKey?: string | null;
915
+ cached?: boolean;
916
+ cacheTtlSeconds?: number;
917
+ error?: string;
918
+ message?: string;
919
+ details?: unknown;
920
+ }
921
+ interface OpWaitResponse {
922
+ state?: string;
923
+ txHash?: string | null;
924
+ }
869
925
 
870
926
  declare const API: {
871
927
  readonly op: {
@@ -889,6 +945,13 @@ declare const API: {
889
945
  readonly walletLinkVerify: "/api/auth/wallet/link/verify";
890
946
  readonly wallets: "/api/auth/wallets";
891
947
  readonly vaults: "/api/auth/vaults";
948
+ readonly passkeySignup: "/api/auth/passkey/signup";
949
+ readonly otpInit: "/api/auth/passkey/otp/init";
950
+ readonly otpVerify: "/api/auth/passkey/otp/verify";
951
+ readonly passkeySuborgs: "/api/auth/passkey/suborgs";
952
+ };
953
+ readonly portfolio: {
954
+ readonly tokens: "/api/portfolio/tokens";
892
955
  };
893
956
  readonly accounts: {
894
957
  readonly create: "/api/accounts";
@@ -1179,6 +1242,13 @@ declare class VaultumClient {
1179
1242
  timestamp?: number;
1180
1243
  signal?: AbortSignal;
1181
1244
  }): Promise<OperationResult>;
1245
+ submitRaw(params: {
1246
+ chain: string;
1247
+ userOp: Record<string, unknown>;
1248
+ idempotencyKey?: string;
1249
+ timestamp?: number;
1250
+ signal?: AbortSignal;
1251
+ }): Promise<OperationResult>;
1182
1252
  simulate(userOp: UserOperation | PackedUserOperation, options?: {
1183
1253
  chain?: string;
1184
1254
  signal?: AbortSignal;
@@ -1194,7 +1264,7 @@ declare class VaultumClient {
1194
1264
  password: string;
1195
1265
  signal?: AbortSignal;
1196
1266
  }): Promise<AuthTokenResponse>;
1197
- authMe(signal?: AbortSignal): Promise<AuthMeResponse>;
1267
+ authMe(signal?: AbortSignal): Promise<ApiUser>;
1198
1268
  authLogout(signal?: AbortSignal): Promise<LogoutResponse>;
1199
1269
  authLogoutAll(signal?: AbortSignal): Promise<LogoutResponse>;
1200
1270
  walletChallenge(params: {
@@ -1203,6 +1273,7 @@ declare class VaultumClient {
1203
1273
  signal?: AbortSignal;
1204
1274
  }): Promise<WalletChallengeResponse>;
1205
1275
  walletVerify(params: {
1276
+ challengeId: string;
1206
1277
  chain: string;
1207
1278
  address: Address;
1208
1279
  signature: Hex;
@@ -1214,6 +1285,7 @@ declare class VaultumClient {
1214
1285
  signal?: AbortSignal;
1215
1286
  }): Promise<WalletChallengeResponse>;
1216
1287
  walletRegisterVerify(params: {
1288
+ challengeId: string;
1217
1289
  chain: string;
1218
1290
  address: Address;
1219
1291
  signature: Hex;
@@ -1234,6 +1306,39 @@ declare class VaultumClient {
1234
1306
  }): Promise<WalletsResponse>;
1235
1307
  wallets(signal?: AbortSignal): Promise<WalletsResponse>;
1236
1308
  vaults(signal?: AbortSignal): Promise<VaultGroupsResponse>;
1309
+ passkeySignup(params: {
1310
+ name: string;
1311
+ email: string;
1312
+ passkey: {
1313
+ encodedChallenge: string;
1314
+ attestation: string;
1315
+ };
1316
+ signal?: AbortSignal;
1317
+ }): Promise<PasskeySignupResponse>;
1318
+ otpInit(params: {
1319
+ email: string;
1320
+ signal?: AbortSignal;
1321
+ }): Promise<OtpInitResponse>;
1322
+ otpVerify(params: {
1323
+ email: string;
1324
+ otpCode: string;
1325
+ publicKey?: string;
1326
+ signal?: AbortSignal;
1327
+ }): Promise<OtpVerifyResponse>;
1328
+ passkeySuborgs(params: {
1329
+ email: string;
1330
+ signal?: AbortSignal;
1331
+ }): Promise<PasskeySuborgsResponse>;
1332
+ getPortfolio(params: {
1333
+ address: string;
1334
+ chains?: string;
1335
+ signal?: AbortSignal;
1336
+ }): Promise<PortfolioTokensResponse>;
1337
+ opWait(id: string, options?: {
1338
+ chain?: string;
1339
+ timeout?: number;
1340
+ signal?: AbortSignal;
1341
+ }): Promise<OpWaitResponse>;
1237
1342
  getOperation(id: string, signal?: AbortSignal): Promise<OperationResult>;
1238
1343
  waitForOperation(id: string, options?: WaitOptions): Promise<OperationResult>;
1239
1344
  getCapabilities(signal?: AbortSignal): Promise<Capabilities>;
@@ -2220,4 +2325,4 @@ declare function hashCrossChainRootTypedData(params: CrossChainRootTypedDataPara
2220
2325
 
2221
2326
  declare const VERSION: string;
2222
2327
 
2223
- export { API, type AccountCreateResult, type AccountOperation, type AccountOperations, type AccountRoles, type AccountVerifyResult, type ActorPermissions, type AddressBookEntry, type AddressBookPage, type AddressCapabilities, type AggregatedRecoveryInitiateResponse, type AggregatedRecoveryPrepareExecutionResponse, type AggregatedRecoveryStatus, type AllowlistRoots, type AllowlistStatus, type ApiUser, type ArmedStatus, type AuthMeResponse, type AuthTokenResponse, type Automation, type AutomationDetails, type AutomationExecution, type AutomationExecutionStatus, type AutomationPage, type AutomationResponse, type AutomationStatus, type AutomationType, type BanStatus, CONTRACTS, type CanaryOptIn, type Capabilities, type ContractName, type CrossChainConfig, type CrossChainGasLimit, type CrossChainPendingProposal, type CrossChainReceiverState, type CrossChainRootTypedDataParams, type CrossChainRootTypedMessage, type CrossChainSkipProposal, type CursorPage, type EIP712Template, ENTRYPOINT_V07, type EnabledFeature, type ExecuteCall, FEATURE_IDS, FEATURE_ID_STRINGS, type FeatureConfig, type FeatureInfo, type FeatureInternal, type FinalizedProposal, GOVERNANCE_DOMAIN_NAME, GOVERNANCE_DOMAIN_VERSION, type GloballyPaused, type GuardianApproval, type GuardianConfig, type HasRole, type HealthStatus, type IsGuardian, type LogoutResponse, type NativeLimitConfig, type NativeLimitStatus, type OnChainRecoveryStatus, type OperationResult, type OperationState, type PackedUserOperation, type Proposal, type ProposalCall, type ProposalDigest, type ProposalSignature, type ProposalsPage, type QuoteResponse, type QuoteResponseRaw, type RecoveryGuardians, type RecoveryProposal, type RecoveryProposalInfo, type RecoveryProposalState, type RecoveryStatus, type RegistryFeatures, type RegistryVersion, type RelayEstimate, type RequestContext, type RequestInterceptor, type ResponseContext, type ResponseInterceptor, type RetryConfig, type RoleBudget, type RoleInfo, type RolesInfo, type SDKErrorCode, type SelectorIndex, type SessionKeyCount, type SessionKeyInfo, type SessionKeyList, type SessionKeyPolicySigner, type SessionKeyRoles, type SessionKeyStatus, type SessionKeyTokenLimit, type SettlementQuote, type SettlementTokens, type SpendingLimitBucket, type SpendingLimitPreview, type SpendingLimitStatus, type SpendingLimitSummary, type TargetIndex, type TimestampValidation, type TimingConfig, type TokenLimitConfig, type TokenLimitFullStatus, type TokenLimitStatus, type TokenMaxTransfer, type TriggerAutomationResponse, UserOpBuilder, type UserOpBuilderConfig, type UserOpGasLimits, type UserOpResponse, type UserOpSimulationResponse, type UserOpTemplate, type UserOperation, type UserWalletInfo, VERSION, type ValidatorSelectorPermitted, type VaultDeployment, type VaultGroup, type VaultGroupsResponse, type VaultState, VaultumClient, type VaultumConfig, VaultumError, type WaitOptions, type WalletChallengeResponse, type WalletsResponse, buildCrossChainRootTypedData, createUserOpBuilder, getUserOpHash, hashCrossChainRootTypedData, packGasFees, packGasLimits, parseQuoteResponse, unpackGasFees, unpackGasLimits };
2328
+ export { API, type AccountCreateResult, type AccountOperation, type AccountOperations, type AccountRoles, type AccountVerifyResult, type ActorPermissions, type AddressBookEntry, type AddressBookPage, type AddressCapabilities, type AggregatedRecoveryInitiateResponse, type AggregatedRecoveryPrepareExecutionResponse, type AggregatedRecoveryStatus, type AllowlistRoots, type AllowlistStatus, type ApiUser, type ArmedStatus, type AuthMeResponse, type AuthTokenResponse, type Automation, type AutomationDetails, type AutomationExecution, type AutomationExecutionStatus, type AutomationPage, type AutomationResponse, type AutomationStatus, type AutomationType, type BanStatus, CONTRACTS, type CanaryOptIn, type Capabilities, type ContractName, type CrossChainConfig, type CrossChainGasLimit, type CrossChainPendingProposal, type CrossChainReceiverState, type CrossChainRootTypedDataParams, type CrossChainRootTypedMessage, type CrossChainSkipProposal, type CursorPage, type EIP712Template, ENTRYPOINT_V07, type EnabledFeature, type ExecuteCall, FEATURE_IDS, FEATURE_ID_STRINGS, type FeatureConfig, type FeatureInfo, type FeatureInternal, type FinalizedProposal, GOVERNANCE_DOMAIN_NAME, GOVERNANCE_DOMAIN_VERSION, type GloballyPaused, type GuardianApproval, type GuardianConfig, type HasRole, type HealthStatus, type IsGuardian, type LogoutResponse, type NativeLimitConfig, type NativeLimitStatus, type OnChainRecoveryStatus, type OpWaitResponse, type OperationResult, type OperationState, type OtpInitResponse, type OtpVerifyResponse, type PackedUserOperation, type PasskeySignupResponse, type PasskeySuborgsResponse, type PortfolioTokenItem, type PortfolioTokensResponse, type Proposal, type ProposalCall, type ProposalDigest, type ProposalSignature, type ProposalsPage, type QuoteResponse, type QuoteResponseRaw, type RecoveryGuardians, type RecoveryProposal, type RecoveryProposalInfo, type RecoveryProposalState, type RecoveryStatus, type RegistryFeatures, type RegistryVersion, type RelayEstimate, type RequestContext, type RequestInterceptor, type ResponseContext, type ResponseInterceptor, type RetryConfig, type RoleBudget, type RoleInfo, type RolesInfo, type SDKErrorCode, type SelectorIndex, type SessionKeyCount, type SessionKeyInfo, type SessionKeyList, type SessionKeyPolicySigner, type SessionKeyRoles, type SessionKeyStatus, type SessionKeyTokenLimit, type SettlementQuote, type SettlementTokens, type SpendingLimitBucket, type SpendingLimitPreview, type SpendingLimitStatus, type SpendingLimitSummary, type TargetIndex, type TimestampValidation, type TimingConfig, type TokenLimitConfig, type TokenLimitFullStatus, type TokenLimitStatus, type TokenMaxTransfer, type TriggerAutomationResponse, UserOpBuilder, type UserOpBuilderConfig, type UserOpGasLimits, type UserOpResponse, type UserOpSimulationResponse, type UserOpTemplate, type UserOperation, type UserWalletInfo, VERSION, type ValidatorSelectorPermitted, type VaultDeployment, type VaultGroup, type VaultGroupsResponse, type VaultState, VaultumClient, type VaultumConfig, VaultumError, type WaitOptions, type WalletChallengeResponse, type WalletsResponse, buildCrossChainRootTypedData, createUserOpBuilder, getUserOpHash, hashCrossChainRootTypedData, packGasFees, packGasLimits, parseQuoteResponse, unpackGasFees, unpackGasLimits };
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ interface AuthTokenResponse<TUser = ApiUser> {
39
39
  token: string;
40
40
  type: string;
41
41
  abilities?: string[];
42
+ expires_in?: number;
42
43
  requires_wallet?: boolean;
43
44
  }
44
45
  interface AuthMeResponse<TUser = ApiUser> {
@@ -48,13 +49,15 @@ interface LogoutResponse {
48
49
  message: string;
49
50
  }
50
51
  interface WalletChallengeResponse {
52
+ challengeId: string;
51
53
  message: string;
52
- expiresAt: string;
54
+ digest: Hex;
55
+ expiresAt?: string;
53
56
  }
54
57
  interface UserWalletInfo {
55
58
  address: Address;
56
- chainId: number;
57
- type: string;
59
+ chainId?: number;
60
+ type?: string;
58
61
  }
59
62
  interface WalletsResponse {
60
63
  wallets: UserWalletInfo[];
@@ -866,6 +869,59 @@ interface AddressCapabilities {
866
869
  chains: number[];
867
870
  contracts: string[];
868
871
  }
872
+ interface PasskeySignupResponse extends AuthTokenResponse {
873
+ wallet?: {
874
+ address?: string;
875
+ };
876
+ turnkey?: {
877
+ subOrganizationId?: string;
878
+ };
879
+ }
880
+ interface OtpInitResponse {
881
+ ok: boolean;
882
+ }
883
+ interface OtpVerifyResponse extends AuthTokenResponse {
884
+ turnkey?: {
885
+ verificationToken?: string;
886
+ organizationId?: string;
887
+ session?: string;
888
+ };
889
+ }
890
+ interface PasskeySuborgsResponse {
891
+ organizationIds: string[];
892
+ }
893
+ interface PortfolioTokenItem {
894
+ chain?: string | null;
895
+ network?: string | null;
896
+ tokenAddress?: string | null;
897
+ isNative: boolean;
898
+ rawBalance?: string | null;
899
+ balance?: string | null;
900
+ symbol?: string | null;
901
+ name?: string | null;
902
+ decimals?: string | null;
903
+ logo?: string | null;
904
+ priceUsd?: string | null;
905
+ priceUpdatedAt?: string | null;
906
+ error?: string | null;
907
+ }
908
+ interface PortfolioTokensResponse {
909
+ address: string;
910
+ chains?: string[];
911
+ networks?: string[];
912
+ count: number;
913
+ items: PortfolioTokenItem[];
914
+ pageKey?: string | null;
915
+ cached?: boolean;
916
+ cacheTtlSeconds?: number;
917
+ error?: string;
918
+ message?: string;
919
+ details?: unknown;
920
+ }
921
+ interface OpWaitResponse {
922
+ state?: string;
923
+ txHash?: string | null;
924
+ }
869
925
 
870
926
  declare const API: {
871
927
  readonly op: {
@@ -889,6 +945,13 @@ declare const API: {
889
945
  readonly walletLinkVerify: "/api/auth/wallet/link/verify";
890
946
  readonly wallets: "/api/auth/wallets";
891
947
  readonly vaults: "/api/auth/vaults";
948
+ readonly passkeySignup: "/api/auth/passkey/signup";
949
+ readonly otpInit: "/api/auth/passkey/otp/init";
950
+ readonly otpVerify: "/api/auth/passkey/otp/verify";
951
+ readonly passkeySuborgs: "/api/auth/passkey/suborgs";
952
+ };
953
+ readonly portfolio: {
954
+ readonly tokens: "/api/portfolio/tokens";
892
955
  };
893
956
  readonly accounts: {
894
957
  readonly create: "/api/accounts";
@@ -1179,6 +1242,13 @@ declare class VaultumClient {
1179
1242
  timestamp?: number;
1180
1243
  signal?: AbortSignal;
1181
1244
  }): Promise<OperationResult>;
1245
+ submitRaw(params: {
1246
+ chain: string;
1247
+ userOp: Record<string, unknown>;
1248
+ idempotencyKey?: string;
1249
+ timestamp?: number;
1250
+ signal?: AbortSignal;
1251
+ }): Promise<OperationResult>;
1182
1252
  simulate(userOp: UserOperation | PackedUserOperation, options?: {
1183
1253
  chain?: string;
1184
1254
  signal?: AbortSignal;
@@ -1194,7 +1264,7 @@ declare class VaultumClient {
1194
1264
  password: string;
1195
1265
  signal?: AbortSignal;
1196
1266
  }): Promise<AuthTokenResponse>;
1197
- authMe(signal?: AbortSignal): Promise<AuthMeResponse>;
1267
+ authMe(signal?: AbortSignal): Promise<ApiUser>;
1198
1268
  authLogout(signal?: AbortSignal): Promise<LogoutResponse>;
1199
1269
  authLogoutAll(signal?: AbortSignal): Promise<LogoutResponse>;
1200
1270
  walletChallenge(params: {
@@ -1203,6 +1273,7 @@ declare class VaultumClient {
1203
1273
  signal?: AbortSignal;
1204
1274
  }): Promise<WalletChallengeResponse>;
1205
1275
  walletVerify(params: {
1276
+ challengeId: string;
1206
1277
  chain: string;
1207
1278
  address: Address;
1208
1279
  signature: Hex;
@@ -1214,6 +1285,7 @@ declare class VaultumClient {
1214
1285
  signal?: AbortSignal;
1215
1286
  }): Promise<WalletChallengeResponse>;
1216
1287
  walletRegisterVerify(params: {
1288
+ challengeId: string;
1217
1289
  chain: string;
1218
1290
  address: Address;
1219
1291
  signature: Hex;
@@ -1234,6 +1306,39 @@ declare class VaultumClient {
1234
1306
  }): Promise<WalletsResponse>;
1235
1307
  wallets(signal?: AbortSignal): Promise<WalletsResponse>;
1236
1308
  vaults(signal?: AbortSignal): Promise<VaultGroupsResponse>;
1309
+ passkeySignup(params: {
1310
+ name: string;
1311
+ email: string;
1312
+ passkey: {
1313
+ encodedChallenge: string;
1314
+ attestation: string;
1315
+ };
1316
+ signal?: AbortSignal;
1317
+ }): Promise<PasskeySignupResponse>;
1318
+ otpInit(params: {
1319
+ email: string;
1320
+ signal?: AbortSignal;
1321
+ }): Promise<OtpInitResponse>;
1322
+ otpVerify(params: {
1323
+ email: string;
1324
+ otpCode: string;
1325
+ publicKey?: string;
1326
+ signal?: AbortSignal;
1327
+ }): Promise<OtpVerifyResponse>;
1328
+ passkeySuborgs(params: {
1329
+ email: string;
1330
+ signal?: AbortSignal;
1331
+ }): Promise<PasskeySuborgsResponse>;
1332
+ getPortfolio(params: {
1333
+ address: string;
1334
+ chains?: string;
1335
+ signal?: AbortSignal;
1336
+ }): Promise<PortfolioTokensResponse>;
1337
+ opWait(id: string, options?: {
1338
+ chain?: string;
1339
+ timeout?: number;
1340
+ signal?: AbortSignal;
1341
+ }): Promise<OpWaitResponse>;
1237
1342
  getOperation(id: string, signal?: AbortSignal): Promise<OperationResult>;
1238
1343
  waitForOperation(id: string, options?: WaitOptions): Promise<OperationResult>;
1239
1344
  getCapabilities(signal?: AbortSignal): Promise<Capabilities>;
@@ -2220,4 +2325,4 @@ declare function hashCrossChainRootTypedData(params: CrossChainRootTypedDataPara
2220
2325
 
2221
2326
  declare const VERSION: string;
2222
2327
 
2223
- export { API, type AccountCreateResult, type AccountOperation, type AccountOperations, type AccountRoles, type AccountVerifyResult, type ActorPermissions, type AddressBookEntry, type AddressBookPage, type AddressCapabilities, type AggregatedRecoveryInitiateResponse, type AggregatedRecoveryPrepareExecutionResponse, type AggregatedRecoveryStatus, type AllowlistRoots, type AllowlistStatus, type ApiUser, type ArmedStatus, type AuthMeResponse, type AuthTokenResponse, type Automation, type AutomationDetails, type AutomationExecution, type AutomationExecutionStatus, type AutomationPage, type AutomationResponse, type AutomationStatus, type AutomationType, type BanStatus, CONTRACTS, type CanaryOptIn, type Capabilities, type ContractName, type CrossChainConfig, type CrossChainGasLimit, type CrossChainPendingProposal, type CrossChainReceiverState, type CrossChainRootTypedDataParams, type CrossChainRootTypedMessage, type CrossChainSkipProposal, type CursorPage, type EIP712Template, ENTRYPOINT_V07, type EnabledFeature, type ExecuteCall, FEATURE_IDS, FEATURE_ID_STRINGS, type FeatureConfig, type FeatureInfo, type FeatureInternal, type FinalizedProposal, GOVERNANCE_DOMAIN_NAME, GOVERNANCE_DOMAIN_VERSION, type GloballyPaused, type GuardianApproval, type GuardianConfig, type HasRole, type HealthStatus, type IsGuardian, type LogoutResponse, type NativeLimitConfig, type NativeLimitStatus, type OnChainRecoveryStatus, type OperationResult, type OperationState, type PackedUserOperation, type Proposal, type ProposalCall, type ProposalDigest, type ProposalSignature, type ProposalsPage, type QuoteResponse, type QuoteResponseRaw, type RecoveryGuardians, type RecoveryProposal, type RecoveryProposalInfo, type RecoveryProposalState, type RecoveryStatus, type RegistryFeatures, type RegistryVersion, type RelayEstimate, type RequestContext, type RequestInterceptor, type ResponseContext, type ResponseInterceptor, type RetryConfig, type RoleBudget, type RoleInfo, type RolesInfo, type SDKErrorCode, type SelectorIndex, type SessionKeyCount, type SessionKeyInfo, type SessionKeyList, type SessionKeyPolicySigner, type SessionKeyRoles, type SessionKeyStatus, type SessionKeyTokenLimit, type SettlementQuote, type SettlementTokens, type SpendingLimitBucket, type SpendingLimitPreview, type SpendingLimitStatus, type SpendingLimitSummary, type TargetIndex, type TimestampValidation, type TimingConfig, type TokenLimitConfig, type TokenLimitFullStatus, type TokenLimitStatus, type TokenMaxTransfer, type TriggerAutomationResponse, UserOpBuilder, type UserOpBuilderConfig, type UserOpGasLimits, type UserOpResponse, type UserOpSimulationResponse, type UserOpTemplate, type UserOperation, type UserWalletInfo, VERSION, type ValidatorSelectorPermitted, type VaultDeployment, type VaultGroup, type VaultGroupsResponse, type VaultState, VaultumClient, type VaultumConfig, VaultumError, type WaitOptions, type WalletChallengeResponse, type WalletsResponse, buildCrossChainRootTypedData, createUserOpBuilder, getUserOpHash, hashCrossChainRootTypedData, packGasFees, packGasLimits, parseQuoteResponse, unpackGasFees, unpackGasLimits };
2328
+ export { API, type AccountCreateResult, type AccountOperation, type AccountOperations, type AccountRoles, type AccountVerifyResult, type ActorPermissions, type AddressBookEntry, type AddressBookPage, type AddressCapabilities, type AggregatedRecoveryInitiateResponse, type AggregatedRecoveryPrepareExecutionResponse, type AggregatedRecoveryStatus, type AllowlistRoots, type AllowlistStatus, type ApiUser, type ArmedStatus, type AuthMeResponse, type AuthTokenResponse, type Automation, type AutomationDetails, type AutomationExecution, type AutomationExecutionStatus, type AutomationPage, type AutomationResponse, type AutomationStatus, type AutomationType, type BanStatus, CONTRACTS, type CanaryOptIn, type Capabilities, type ContractName, type CrossChainConfig, type CrossChainGasLimit, type CrossChainPendingProposal, type CrossChainReceiverState, type CrossChainRootTypedDataParams, type CrossChainRootTypedMessage, type CrossChainSkipProposal, type CursorPage, type EIP712Template, ENTRYPOINT_V07, type EnabledFeature, type ExecuteCall, FEATURE_IDS, FEATURE_ID_STRINGS, type FeatureConfig, type FeatureInfo, type FeatureInternal, type FinalizedProposal, GOVERNANCE_DOMAIN_NAME, GOVERNANCE_DOMAIN_VERSION, type GloballyPaused, type GuardianApproval, type GuardianConfig, type HasRole, type HealthStatus, type IsGuardian, type LogoutResponse, type NativeLimitConfig, type NativeLimitStatus, type OnChainRecoveryStatus, type OpWaitResponse, type OperationResult, type OperationState, type OtpInitResponse, type OtpVerifyResponse, type PackedUserOperation, type PasskeySignupResponse, type PasskeySuborgsResponse, type PortfolioTokenItem, type PortfolioTokensResponse, type Proposal, type ProposalCall, type ProposalDigest, type ProposalSignature, type ProposalsPage, type QuoteResponse, type QuoteResponseRaw, type RecoveryGuardians, type RecoveryProposal, type RecoveryProposalInfo, type RecoveryProposalState, type RecoveryStatus, type RegistryFeatures, type RegistryVersion, type RelayEstimate, type RequestContext, type RequestInterceptor, type ResponseContext, type ResponseInterceptor, type RetryConfig, type RoleBudget, type RoleInfo, type RolesInfo, type SDKErrorCode, type SelectorIndex, type SessionKeyCount, type SessionKeyInfo, type SessionKeyList, type SessionKeyPolicySigner, type SessionKeyRoles, type SessionKeyStatus, type SessionKeyTokenLimit, type SettlementQuote, type SettlementTokens, type SpendingLimitBucket, type SpendingLimitPreview, type SpendingLimitStatus, type SpendingLimitSummary, type TargetIndex, type TimestampValidation, type TimingConfig, type TokenLimitConfig, type TokenLimitFullStatus, type TokenLimitStatus, type TokenMaxTransfer, type TriggerAutomationResponse, UserOpBuilder, type UserOpBuilderConfig, type UserOpGasLimits, type UserOpResponse, type UserOpSimulationResponse, type UserOpTemplate, type UserOperation, type UserWalletInfo, VERSION, type ValidatorSelectorPermitted, type VaultDeployment, type VaultGroup, type VaultGroupsResponse, type VaultState, VaultumClient, type VaultumConfig, VaultumError, type WaitOptions, type WalletChallengeResponse, type WalletsResponse, buildCrossChainRootTypedData, createUserOpBuilder, getUserOpHash, hashCrossChainRootTypedData, packGasFees, packGasLimits, parseQuoteResponse, unpackGasFees, unpackGasLimits };
package/dist/index.js CHANGED
@@ -66,7 +66,14 @@ var API = {
66
66
  walletLinkChallenge: "/api/auth/wallet/link/challenge",
67
67
  walletLinkVerify: "/api/auth/wallet/link/verify",
68
68
  wallets: "/api/auth/wallets",
69
- vaults: "/api/auth/vaults"
69
+ vaults: "/api/auth/vaults",
70
+ passkeySignup: "/api/auth/passkey/signup",
71
+ otpInit: "/api/auth/passkey/otp/init",
72
+ otpVerify: "/api/auth/passkey/otp/verify",
73
+ passkeySuborgs: "/api/auth/passkey/suborgs"
74
+ },
75
+ portfolio: {
76
+ tokens: "/api/portfolio/tokens"
70
77
  },
71
78
  accounts: {
72
79
  create: "/api/accounts",
@@ -737,13 +744,28 @@ var VaultumClient = class {
737
744
  const data = await res.json().catch(() => ({}));
738
745
  if (!res.ok) {
739
746
  const errBody = data;
740
- const rawCode = errBody.code ?? errBody.error;
747
+ let rawCode;
748
+ let message;
749
+ let details;
750
+ if (typeof errBody.code === "string") rawCode = errBody.code;
751
+ if (typeof errBody.message === "string") message = errBody.message;
752
+ if ("details" in errBody) details = errBody.details;
753
+ const nested = errBody.error;
754
+ if (nested && typeof nested === "object") {
755
+ const nestedErr = nested;
756
+ if (!rawCode && typeof nestedErr.code === "string") rawCode = nestedErr.code;
757
+ if (!message && typeof nestedErr.message === "string") message = nestedErr.message;
758
+ if (details === void 0 && "details" in nestedErr) details = nestedErr.details;
759
+ } else if (typeof nested === "string") {
760
+ if (!rawCode) rawCode = nested;
761
+ }
741
762
  const code = mapErrorCode(rawCode, res.status);
763
+ const fallbackMessage = message ?? (typeof nested === "string" ? nested : void 0) ?? `Request failed: ${res.status}`;
742
764
  throw new VaultumError(
743
- errBody.message ?? errBody.error ?? `Request failed: ${res.status}`,
765
+ fallbackMessage,
744
766
  code,
745
767
  res.status,
746
- errBody.details,
768
+ details,
747
769
  RETRYABLE_CODES.has(code) || RETRYABLE_STATUS.has(res.status),
748
770
  rawCode
749
771
  );
@@ -787,6 +809,14 @@ var VaultumClient = class {
787
809
  signal: options?.signal
788
810
  });
789
811
  }
812
+ async submitRaw(params) {
813
+ const body = { chain: params.chain, userOp: params.userOp };
814
+ return this.request("POST", API.op.submit, body, {
815
+ idempotencyKey: params.idempotencyKey ?? autoIdempotencyKey(body),
816
+ timestamp: params.timestamp ?? nowUnix(),
817
+ signal: params.signal
818
+ });
819
+ }
790
820
  async simulate(userOp, options) {
791
821
  const chain = options?.chain ?? this.chain ?? "sepolia";
792
822
  const normalized = isPackedUserOp(userOp) ? packedToUserOperation(userOp) : normalizeUserOperation(userOp);
@@ -803,7 +833,9 @@ var VaultumClient = class {
803
833
  return r;
804
834
  }
805
835
  async authMe(signal) {
806
- return this.request("GET", API.auth.me, void 0, { signal });
836
+ const raw = await this.request("GET", API.auth.me, void 0, { signal });
837
+ if ("user" in raw && isRecord(raw.user)) return raw.user;
838
+ return raw;
807
839
  }
808
840
  async authLogout(signal) {
809
841
  const r = await this.request("POST", API.auth.logout, void 0, { signal });
@@ -823,6 +855,7 @@ var VaultumClient = class {
823
855
  }
824
856
  async walletVerify(params) {
825
857
  const r = await this.request("POST", API.auth.walletVerify, {
858
+ challengeId: params.challengeId,
826
859
  chain: params.chain,
827
860
  address: params.address.toLowerCase(),
828
861
  signature: params.signature.toLowerCase()
@@ -838,6 +871,7 @@ var VaultumClient = class {
838
871
  }
839
872
  async walletRegisterVerify(params) {
840
873
  const r = await this.request("POST", API.auth.walletRegisterVerify, {
874
+ challengeId: params.challengeId,
841
875
  chain: params.chain,
842
876
  address: params.address.toLowerCase(),
843
877
  signature: params.signature.toLowerCase(),
@@ -892,15 +926,51 @@ var VaultumClient = class {
892
926
  return {
893
927
  vaultGroups: (raw.vaultGroups ?? []).map((g) => ({
894
928
  id: g.id,
895
- vaultIndex: g.vault_index,
929
+ vaultIndex: g.vaultIndex,
896
930
  address: g.address.toLowerCase(),
897
931
  deployments: (g.deployments ?? []).map((d) => ({
898
- chainId: d.chain_id,
932
+ chainId: d.chainId,
899
933
  deployed: d.deployed
900
934
  }))
901
935
  }))
902
936
  };
903
937
  }
938
+ async passkeySignup(params) {
939
+ const r = await this.request("POST", API.auth.passkeySignup, {
940
+ name: params.name,
941
+ email: params.email,
942
+ passkey: params.passkey
943
+ }, { signal: params.signal });
944
+ this.setBearer(r.token);
945
+ return r;
946
+ }
947
+ async otpInit(params) {
948
+ return this.request("POST", API.auth.otpInit, { email: params.email }, { signal: params.signal });
949
+ }
950
+ async otpVerify(params) {
951
+ const r = await this.request("POST", API.auth.otpVerify, {
952
+ email: params.email,
953
+ otpCode: params.otpCode,
954
+ publicKey: params.publicKey
955
+ }, { signal: params.signal });
956
+ this.setBearer(r.token);
957
+ return r;
958
+ }
959
+ async passkeySuborgs(params) {
960
+ return this.request("POST", API.auth.passkeySuborgs, { email: params.email }, { signal: params.signal });
961
+ }
962
+ async getPortfolio(params) {
963
+ const q = new URLSearchParams();
964
+ q.set("address", params.address);
965
+ if (params.chains) q.set("chains", params.chains);
966
+ return this.request("GET", `${API.portfolio.tokens}?${q.toString()}`, void 0, { signal: params.signal });
967
+ }
968
+ async opWait(id, options) {
969
+ const q = new URLSearchParams();
970
+ if (options?.chain) q.set("chain", options.chain);
971
+ q.set("timeout", String(options?.timeout ?? 60));
972
+ return this.request("GET", `${API.op.wait(id)}?${q.toString()}`, void 0, { signal: options?.signal });
973
+ }
904
974
  async getOperation(id, signal) {
905
975
  return this.request("GET", API.op.status(id), void 0, { signal });
906
976
  }
@@ -2012,7 +2082,7 @@ function hashCrossChainRootTypedData(params) {
2012
2082
  }
2013
2083
 
2014
2084
  // src/index.ts
2015
- var VERSION = "0.1.6";
2085
+ var VERSION = "0.1.8";
2016
2086
  // Annotate the CommonJS export names for ESM import in node:
2017
2087
  0 && (module.exports = {
2018
2088
  API,
package/dist/index.mjs CHANGED
@@ -21,7 +21,14 @@ var API = {
21
21
  walletLinkChallenge: "/api/auth/wallet/link/challenge",
22
22
  walletLinkVerify: "/api/auth/wallet/link/verify",
23
23
  wallets: "/api/auth/wallets",
24
- vaults: "/api/auth/vaults"
24
+ vaults: "/api/auth/vaults",
25
+ passkeySignup: "/api/auth/passkey/signup",
26
+ otpInit: "/api/auth/passkey/otp/init",
27
+ otpVerify: "/api/auth/passkey/otp/verify",
28
+ passkeySuborgs: "/api/auth/passkey/suborgs"
29
+ },
30
+ portfolio: {
31
+ tokens: "/api/portfolio/tokens"
25
32
  },
26
33
  accounts: {
27
34
  create: "/api/accounts",
@@ -701,13 +708,28 @@ var VaultumClient = class {
701
708
  const data = await res.json().catch(() => ({}));
702
709
  if (!res.ok) {
703
710
  const errBody = data;
704
- const rawCode = errBody.code ?? errBody.error;
711
+ let rawCode;
712
+ let message;
713
+ let details;
714
+ if (typeof errBody.code === "string") rawCode = errBody.code;
715
+ if (typeof errBody.message === "string") message = errBody.message;
716
+ if ("details" in errBody) details = errBody.details;
717
+ const nested = errBody.error;
718
+ if (nested && typeof nested === "object") {
719
+ const nestedErr = nested;
720
+ if (!rawCode && typeof nestedErr.code === "string") rawCode = nestedErr.code;
721
+ if (!message && typeof nestedErr.message === "string") message = nestedErr.message;
722
+ if (details === void 0 && "details" in nestedErr) details = nestedErr.details;
723
+ } else if (typeof nested === "string") {
724
+ if (!rawCode) rawCode = nested;
725
+ }
705
726
  const code = mapErrorCode(rawCode, res.status);
727
+ const fallbackMessage = message ?? (typeof nested === "string" ? nested : void 0) ?? `Request failed: ${res.status}`;
706
728
  throw new VaultumError(
707
- errBody.message ?? errBody.error ?? `Request failed: ${res.status}`,
729
+ fallbackMessage,
708
730
  code,
709
731
  res.status,
710
- errBody.details,
732
+ details,
711
733
  RETRYABLE_CODES.has(code) || RETRYABLE_STATUS.has(res.status),
712
734
  rawCode
713
735
  );
@@ -751,6 +773,14 @@ var VaultumClient = class {
751
773
  signal: options?.signal
752
774
  });
753
775
  }
776
+ async submitRaw(params) {
777
+ const body = { chain: params.chain, userOp: params.userOp };
778
+ return this.request("POST", API.op.submit, body, {
779
+ idempotencyKey: params.idempotencyKey ?? autoIdempotencyKey(body),
780
+ timestamp: params.timestamp ?? nowUnix(),
781
+ signal: params.signal
782
+ });
783
+ }
754
784
  async simulate(userOp, options) {
755
785
  const chain = options?.chain ?? this.chain ?? "sepolia";
756
786
  const normalized = isPackedUserOp(userOp) ? packedToUserOperation(userOp) : normalizeUserOperation(userOp);
@@ -767,7 +797,9 @@ var VaultumClient = class {
767
797
  return r;
768
798
  }
769
799
  async authMe(signal) {
770
- return this.request("GET", API.auth.me, void 0, { signal });
800
+ const raw = await this.request("GET", API.auth.me, void 0, { signal });
801
+ if ("user" in raw && isRecord(raw.user)) return raw.user;
802
+ return raw;
771
803
  }
772
804
  async authLogout(signal) {
773
805
  const r = await this.request("POST", API.auth.logout, void 0, { signal });
@@ -787,6 +819,7 @@ var VaultumClient = class {
787
819
  }
788
820
  async walletVerify(params) {
789
821
  const r = await this.request("POST", API.auth.walletVerify, {
822
+ challengeId: params.challengeId,
790
823
  chain: params.chain,
791
824
  address: params.address.toLowerCase(),
792
825
  signature: params.signature.toLowerCase()
@@ -802,6 +835,7 @@ var VaultumClient = class {
802
835
  }
803
836
  async walletRegisterVerify(params) {
804
837
  const r = await this.request("POST", API.auth.walletRegisterVerify, {
838
+ challengeId: params.challengeId,
805
839
  chain: params.chain,
806
840
  address: params.address.toLowerCase(),
807
841
  signature: params.signature.toLowerCase(),
@@ -856,15 +890,51 @@ var VaultumClient = class {
856
890
  return {
857
891
  vaultGroups: (raw.vaultGroups ?? []).map((g) => ({
858
892
  id: g.id,
859
- vaultIndex: g.vault_index,
893
+ vaultIndex: g.vaultIndex,
860
894
  address: g.address.toLowerCase(),
861
895
  deployments: (g.deployments ?? []).map((d) => ({
862
- chainId: d.chain_id,
896
+ chainId: d.chainId,
863
897
  deployed: d.deployed
864
898
  }))
865
899
  }))
866
900
  };
867
901
  }
902
+ async passkeySignup(params) {
903
+ const r = await this.request("POST", API.auth.passkeySignup, {
904
+ name: params.name,
905
+ email: params.email,
906
+ passkey: params.passkey
907
+ }, { signal: params.signal });
908
+ this.setBearer(r.token);
909
+ return r;
910
+ }
911
+ async otpInit(params) {
912
+ return this.request("POST", API.auth.otpInit, { email: params.email }, { signal: params.signal });
913
+ }
914
+ async otpVerify(params) {
915
+ const r = await this.request("POST", API.auth.otpVerify, {
916
+ email: params.email,
917
+ otpCode: params.otpCode,
918
+ publicKey: params.publicKey
919
+ }, { signal: params.signal });
920
+ this.setBearer(r.token);
921
+ return r;
922
+ }
923
+ async passkeySuborgs(params) {
924
+ return this.request("POST", API.auth.passkeySuborgs, { email: params.email }, { signal: params.signal });
925
+ }
926
+ async getPortfolio(params) {
927
+ const q = new URLSearchParams();
928
+ q.set("address", params.address);
929
+ if (params.chains) q.set("chains", params.chains);
930
+ return this.request("GET", `${API.portfolio.tokens}?${q.toString()}`, void 0, { signal: params.signal });
931
+ }
932
+ async opWait(id, options) {
933
+ const q = new URLSearchParams();
934
+ if (options?.chain) q.set("chain", options.chain);
935
+ q.set("timeout", String(options?.timeout ?? 60));
936
+ return this.request("GET", `${API.op.wait(id)}?${q.toString()}`, void 0, { signal: options?.signal });
937
+ }
868
938
  async getOperation(id, signal) {
869
939
  return this.request("GET", API.op.status(id), void 0, { signal });
870
940
  }
@@ -1976,7 +2046,7 @@ function hashCrossChainRootTypedData(params) {
1976
2046
  }
1977
2047
 
1978
2048
  // src/index.ts
1979
- var VERSION = "0.1.6";
2049
+ var VERSION = "0.1.8";
1980
2050
  export {
1981
2051
  API,
1982
2052
  CONTRACTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaultum/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "TypeScript SDK for Vaultum smart wallet",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",