@vaultum/sdk 0.1.6 → 0.1.7
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 +110 -5
- package/dist/index.d.ts +110 -5
- package/dist/index.js +58 -3
- package/dist/index.mjs +58 -3
- package/package.json +1 -1
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
|
-
|
|
54
|
+
digest: Hex;
|
|
55
|
+
expiresAt?: string;
|
|
53
56
|
}
|
|
54
57
|
interface UserWalletInfo {
|
|
55
58
|
address: Address;
|
|
56
|
-
chainId
|
|
57
|
-
type
|
|
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<
|
|
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
|
-
|
|
54
|
+
digest: Hex;
|
|
55
|
+
expiresAt?: string;
|
|
53
56
|
}
|
|
54
57
|
interface UserWalletInfo {
|
|
55
58
|
address: Address;
|
|
56
|
-
chainId
|
|
57
|
-
type
|
|
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<
|
|
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",
|
|
@@ -787,6 +794,14 @@ var VaultumClient = class {
|
|
|
787
794
|
signal: options?.signal
|
|
788
795
|
});
|
|
789
796
|
}
|
|
797
|
+
async submitRaw(params) {
|
|
798
|
+
const body = { chain: params.chain, userOp: params.userOp };
|
|
799
|
+
return this.request("POST", API.op.submit, body, {
|
|
800
|
+
idempotencyKey: params.idempotencyKey ?? autoIdempotencyKey(body),
|
|
801
|
+
timestamp: params.timestamp ?? nowUnix(),
|
|
802
|
+
signal: params.signal
|
|
803
|
+
});
|
|
804
|
+
}
|
|
790
805
|
async simulate(userOp, options) {
|
|
791
806
|
const chain = options?.chain ?? this.chain ?? "sepolia";
|
|
792
807
|
const normalized = isPackedUserOp(userOp) ? packedToUserOperation(userOp) : normalizeUserOperation(userOp);
|
|
@@ -803,7 +818,9 @@ var VaultumClient = class {
|
|
|
803
818
|
return r;
|
|
804
819
|
}
|
|
805
820
|
async authMe(signal) {
|
|
806
|
-
|
|
821
|
+
const raw = await this.request("GET", API.auth.me, void 0, { signal });
|
|
822
|
+
if ("user" in raw && isRecord(raw.user)) return raw.user;
|
|
823
|
+
return raw;
|
|
807
824
|
}
|
|
808
825
|
async authLogout(signal) {
|
|
809
826
|
const r = await this.request("POST", API.auth.logout, void 0, { signal });
|
|
@@ -823,6 +840,7 @@ var VaultumClient = class {
|
|
|
823
840
|
}
|
|
824
841
|
async walletVerify(params) {
|
|
825
842
|
const r = await this.request("POST", API.auth.walletVerify, {
|
|
843
|
+
challengeId: params.challengeId,
|
|
826
844
|
chain: params.chain,
|
|
827
845
|
address: params.address.toLowerCase(),
|
|
828
846
|
signature: params.signature.toLowerCase()
|
|
@@ -838,6 +856,7 @@ var VaultumClient = class {
|
|
|
838
856
|
}
|
|
839
857
|
async walletRegisterVerify(params) {
|
|
840
858
|
const r = await this.request("POST", API.auth.walletRegisterVerify, {
|
|
859
|
+
challengeId: params.challengeId,
|
|
841
860
|
chain: params.chain,
|
|
842
861
|
address: params.address.toLowerCase(),
|
|
843
862
|
signature: params.signature.toLowerCase(),
|
|
@@ -901,6 +920,42 @@ var VaultumClient = class {
|
|
|
901
920
|
}))
|
|
902
921
|
};
|
|
903
922
|
}
|
|
923
|
+
async passkeySignup(params) {
|
|
924
|
+
const r = await this.request("POST", API.auth.passkeySignup, {
|
|
925
|
+
name: params.name,
|
|
926
|
+
email: params.email,
|
|
927
|
+
passkey: params.passkey
|
|
928
|
+
}, { signal: params.signal });
|
|
929
|
+
this.setBearer(r.token);
|
|
930
|
+
return r;
|
|
931
|
+
}
|
|
932
|
+
async otpInit(params) {
|
|
933
|
+
return this.request("POST", API.auth.otpInit, { email: params.email }, { signal: params.signal });
|
|
934
|
+
}
|
|
935
|
+
async otpVerify(params) {
|
|
936
|
+
const r = await this.request("POST", API.auth.otpVerify, {
|
|
937
|
+
email: params.email,
|
|
938
|
+
otpCode: params.otpCode,
|
|
939
|
+
publicKey: params.publicKey
|
|
940
|
+
}, { signal: params.signal });
|
|
941
|
+
this.setBearer(r.token);
|
|
942
|
+
return r;
|
|
943
|
+
}
|
|
944
|
+
async passkeySuborgs(params) {
|
|
945
|
+
return this.request("POST", API.auth.passkeySuborgs, { email: params.email }, { signal: params.signal });
|
|
946
|
+
}
|
|
947
|
+
async getPortfolio(params) {
|
|
948
|
+
const q = new URLSearchParams();
|
|
949
|
+
q.set("address", params.address);
|
|
950
|
+
if (params.chains) q.set("chains", params.chains);
|
|
951
|
+
return this.request("GET", `${API.portfolio.tokens}?${q.toString()}`, void 0, { signal: params.signal });
|
|
952
|
+
}
|
|
953
|
+
async opWait(id, options) {
|
|
954
|
+
const q = new URLSearchParams();
|
|
955
|
+
if (options?.chain) q.set("chain", options.chain);
|
|
956
|
+
q.set("timeout", String(options?.timeout ?? 60));
|
|
957
|
+
return this.request("GET", `${API.op.wait(id)}?${q.toString()}`, void 0, { signal: options?.signal });
|
|
958
|
+
}
|
|
904
959
|
async getOperation(id, signal) {
|
|
905
960
|
return this.request("GET", API.op.status(id), void 0, { signal });
|
|
906
961
|
}
|
|
@@ -2012,7 +2067,7 @@ function hashCrossChainRootTypedData(params) {
|
|
|
2012
2067
|
}
|
|
2013
2068
|
|
|
2014
2069
|
// src/index.ts
|
|
2015
|
-
var VERSION = "0.1.
|
|
2070
|
+
var VERSION = "0.1.7";
|
|
2016
2071
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2017
2072
|
0 && (module.exports = {
|
|
2018
2073
|
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",
|
|
@@ -751,6 +758,14 @@ var VaultumClient = class {
|
|
|
751
758
|
signal: options?.signal
|
|
752
759
|
});
|
|
753
760
|
}
|
|
761
|
+
async submitRaw(params) {
|
|
762
|
+
const body = { chain: params.chain, userOp: params.userOp };
|
|
763
|
+
return this.request("POST", API.op.submit, body, {
|
|
764
|
+
idempotencyKey: params.idempotencyKey ?? autoIdempotencyKey(body),
|
|
765
|
+
timestamp: params.timestamp ?? nowUnix(),
|
|
766
|
+
signal: params.signal
|
|
767
|
+
});
|
|
768
|
+
}
|
|
754
769
|
async simulate(userOp, options) {
|
|
755
770
|
const chain = options?.chain ?? this.chain ?? "sepolia";
|
|
756
771
|
const normalized = isPackedUserOp(userOp) ? packedToUserOperation(userOp) : normalizeUserOperation(userOp);
|
|
@@ -767,7 +782,9 @@ var VaultumClient = class {
|
|
|
767
782
|
return r;
|
|
768
783
|
}
|
|
769
784
|
async authMe(signal) {
|
|
770
|
-
|
|
785
|
+
const raw = await this.request("GET", API.auth.me, void 0, { signal });
|
|
786
|
+
if ("user" in raw && isRecord(raw.user)) return raw.user;
|
|
787
|
+
return raw;
|
|
771
788
|
}
|
|
772
789
|
async authLogout(signal) {
|
|
773
790
|
const r = await this.request("POST", API.auth.logout, void 0, { signal });
|
|
@@ -787,6 +804,7 @@ var VaultumClient = class {
|
|
|
787
804
|
}
|
|
788
805
|
async walletVerify(params) {
|
|
789
806
|
const r = await this.request("POST", API.auth.walletVerify, {
|
|
807
|
+
challengeId: params.challengeId,
|
|
790
808
|
chain: params.chain,
|
|
791
809
|
address: params.address.toLowerCase(),
|
|
792
810
|
signature: params.signature.toLowerCase()
|
|
@@ -802,6 +820,7 @@ var VaultumClient = class {
|
|
|
802
820
|
}
|
|
803
821
|
async walletRegisterVerify(params) {
|
|
804
822
|
const r = await this.request("POST", API.auth.walletRegisterVerify, {
|
|
823
|
+
challengeId: params.challengeId,
|
|
805
824
|
chain: params.chain,
|
|
806
825
|
address: params.address.toLowerCase(),
|
|
807
826
|
signature: params.signature.toLowerCase(),
|
|
@@ -865,6 +884,42 @@ var VaultumClient = class {
|
|
|
865
884
|
}))
|
|
866
885
|
};
|
|
867
886
|
}
|
|
887
|
+
async passkeySignup(params) {
|
|
888
|
+
const r = await this.request("POST", API.auth.passkeySignup, {
|
|
889
|
+
name: params.name,
|
|
890
|
+
email: params.email,
|
|
891
|
+
passkey: params.passkey
|
|
892
|
+
}, { signal: params.signal });
|
|
893
|
+
this.setBearer(r.token);
|
|
894
|
+
return r;
|
|
895
|
+
}
|
|
896
|
+
async otpInit(params) {
|
|
897
|
+
return this.request("POST", API.auth.otpInit, { email: params.email }, { signal: params.signal });
|
|
898
|
+
}
|
|
899
|
+
async otpVerify(params) {
|
|
900
|
+
const r = await this.request("POST", API.auth.otpVerify, {
|
|
901
|
+
email: params.email,
|
|
902
|
+
otpCode: params.otpCode,
|
|
903
|
+
publicKey: params.publicKey
|
|
904
|
+
}, { signal: params.signal });
|
|
905
|
+
this.setBearer(r.token);
|
|
906
|
+
return r;
|
|
907
|
+
}
|
|
908
|
+
async passkeySuborgs(params) {
|
|
909
|
+
return this.request("POST", API.auth.passkeySuborgs, { email: params.email }, { signal: params.signal });
|
|
910
|
+
}
|
|
911
|
+
async getPortfolio(params) {
|
|
912
|
+
const q = new URLSearchParams();
|
|
913
|
+
q.set("address", params.address);
|
|
914
|
+
if (params.chains) q.set("chains", params.chains);
|
|
915
|
+
return this.request("GET", `${API.portfolio.tokens}?${q.toString()}`, void 0, { signal: params.signal });
|
|
916
|
+
}
|
|
917
|
+
async opWait(id, options) {
|
|
918
|
+
const q = new URLSearchParams();
|
|
919
|
+
if (options?.chain) q.set("chain", options.chain);
|
|
920
|
+
q.set("timeout", String(options?.timeout ?? 60));
|
|
921
|
+
return this.request("GET", `${API.op.wait(id)}?${q.toString()}`, void 0, { signal: options?.signal });
|
|
922
|
+
}
|
|
868
923
|
async getOperation(id, signal) {
|
|
869
924
|
return this.request("GET", API.op.status(id), void 0, { signal });
|
|
870
925
|
}
|
|
@@ -1976,7 +2031,7 @@ function hashCrossChainRootTypedData(params) {
|
|
|
1976
2031
|
}
|
|
1977
2032
|
|
|
1978
2033
|
// src/index.ts
|
|
1979
|
-
var VERSION = "0.1.
|
|
2034
|
+
var VERSION = "0.1.7";
|
|
1980
2035
|
export {
|
|
1981
2036
|
API,
|
|
1982
2037
|
CONTRACTS,
|