@vaultum/sdk 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,6 +24,7 @@ const client = new VaultumClient({
24
24
  // Create an account
25
25
  const account = await client.createAccount({
26
26
  sessionKeyAddress: '0x...',
27
+ signerSource: 'walletconnect', // or 'turnkey'
27
28
  owners: ['0x...', '0x...'],
28
29
  threshold: 2,
29
30
  });
package/dist/index.d.mts CHANGED
@@ -48,16 +48,23 @@ interface AuthMeResponse<TUser = ApiUser> {
48
48
  interface LogoutResponse {
49
49
  message: string;
50
50
  }
51
+ interface AuthSelectedChainResponse {
52
+ selectedChain: string | null;
53
+ enforced?: boolean;
54
+ }
51
55
  interface WalletChallengeResponse {
52
56
  challengeId: string;
53
57
  message: string;
54
58
  digest: Hex;
55
59
  expiresAt?: string;
56
60
  }
61
+ type SignerSource = 'turnkey' | 'walletconnect';
62
+ type WalletSource = SignerSource | 'unknown';
57
63
  interface UserWalletInfo {
58
64
  address: Address;
59
65
  chainId?: number;
60
66
  type?: string;
67
+ source?: WalletSource;
61
68
  }
62
69
  interface WalletsResponse {
63
70
  wallets: UserWalletInfo[];
@@ -128,6 +135,8 @@ interface AccountCreateResult {
128
135
  chain: string;
129
136
  factory: Address;
130
137
  address: Address;
138
+ signerAddress?: Address;
139
+ signerSource?: SignerSource;
131
140
  config: {
132
141
  owners: Address[];
133
142
  threshold: number;
@@ -968,8 +977,12 @@ interface PortfolioTokensResponse {
968
977
  details?: unknown;
969
978
  }
970
979
  interface OpWaitResponse {
980
+ id?: string;
971
981
  state?: string;
982
+ chain?: string;
972
983
  txHash?: string | null;
984
+ error?: string | null;
985
+ sender?: string;
973
986
  }
974
987
 
975
988
  declare const API: {
@@ -990,6 +1003,7 @@ declare const API: {
990
1003
  readonly logout: "/api/auth/logout";
991
1004
  readonly logoutAll: "/api/auth/logout-all";
992
1005
  readonly me: "/api/auth/me";
1006
+ readonly selectedChain: "/api/auth/selected-chain";
993
1007
  readonly walletLinkChallenge: "/api/auth/wallet/link/challenge";
994
1008
  readonly walletLinkVerify: "/api/auth/wallet/link/verify";
995
1009
  readonly wallets: "/api/auth/wallets";
@@ -1314,6 +1328,8 @@ declare class VaultumClient {
1314
1328
  signal?: AbortSignal;
1315
1329
  }): Promise<AuthTokenResponse>;
1316
1330
  authMe(signal?: AbortSignal): Promise<ApiUser>;
1331
+ authGetSelectedChain(signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
1332
+ authSetSelectedChain(chain: string, signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
1317
1333
  authLogout(signal?: AbortSignal): Promise<LogoutResponse>;
1318
1334
  authLogoutAll(signal?: AbortSignal): Promise<LogoutResponse>;
1319
1335
  walletChallenge(params: {
@@ -1393,6 +1409,7 @@ declare class VaultumClient {
1393
1409
  getCapabilities(signal?: AbortSignal): Promise<Capabilities>;
1394
1410
  createAccount(options: {
1395
1411
  sessionKeyAddress: Address;
1412
+ signerSource: SignerSource;
1396
1413
  chain?: string;
1397
1414
  vaultIndex?: number;
1398
1415
  sponsorshipMode?: 'required' | 'prefer' | 'disabled';
@@ -2375,4 +2392,4 @@ declare function hashCrossChainRootTypedData(params: CrossChainRootTypedDataPara
2375
2392
 
2376
2393
  declare const VERSION: string;
2377
2394
 
2378
- 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 SettlementPrepareResult, 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 };
2395
+ 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 AuthSelectedChainResponse, 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 SettlementPrepareResult, type SettlementQuote, type SettlementTokens, type SignerSource, 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 WalletSource, type WalletsResponse, buildCrossChainRootTypedData, createUserOpBuilder, getUserOpHash, hashCrossChainRootTypedData, packGasFees, packGasLimits, parseQuoteResponse, unpackGasFees, unpackGasLimits };
package/dist/index.d.ts CHANGED
@@ -48,16 +48,23 @@ interface AuthMeResponse<TUser = ApiUser> {
48
48
  interface LogoutResponse {
49
49
  message: string;
50
50
  }
51
+ interface AuthSelectedChainResponse {
52
+ selectedChain: string | null;
53
+ enforced?: boolean;
54
+ }
51
55
  interface WalletChallengeResponse {
52
56
  challengeId: string;
53
57
  message: string;
54
58
  digest: Hex;
55
59
  expiresAt?: string;
56
60
  }
61
+ type SignerSource = 'turnkey' | 'walletconnect';
62
+ type WalletSource = SignerSource | 'unknown';
57
63
  interface UserWalletInfo {
58
64
  address: Address;
59
65
  chainId?: number;
60
66
  type?: string;
67
+ source?: WalletSource;
61
68
  }
62
69
  interface WalletsResponse {
63
70
  wallets: UserWalletInfo[];
@@ -128,6 +135,8 @@ interface AccountCreateResult {
128
135
  chain: string;
129
136
  factory: Address;
130
137
  address: Address;
138
+ signerAddress?: Address;
139
+ signerSource?: SignerSource;
131
140
  config: {
132
141
  owners: Address[];
133
142
  threshold: number;
@@ -968,8 +977,12 @@ interface PortfolioTokensResponse {
968
977
  details?: unknown;
969
978
  }
970
979
  interface OpWaitResponse {
980
+ id?: string;
971
981
  state?: string;
982
+ chain?: string;
972
983
  txHash?: string | null;
984
+ error?: string | null;
985
+ sender?: string;
973
986
  }
974
987
 
975
988
  declare const API: {
@@ -990,6 +1003,7 @@ declare const API: {
990
1003
  readonly logout: "/api/auth/logout";
991
1004
  readonly logoutAll: "/api/auth/logout-all";
992
1005
  readonly me: "/api/auth/me";
1006
+ readonly selectedChain: "/api/auth/selected-chain";
993
1007
  readonly walletLinkChallenge: "/api/auth/wallet/link/challenge";
994
1008
  readonly walletLinkVerify: "/api/auth/wallet/link/verify";
995
1009
  readonly wallets: "/api/auth/wallets";
@@ -1314,6 +1328,8 @@ declare class VaultumClient {
1314
1328
  signal?: AbortSignal;
1315
1329
  }): Promise<AuthTokenResponse>;
1316
1330
  authMe(signal?: AbortSignal): Promise<ApiUser>;
1331
+ authGetSelectedChain(signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
1332
+ authSetSelectedChain(chain: string, signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
1317
1333
  authLogout(signal?: AbortSignal): Promise<LogoutResponse>;
1318
1334
  authLogoutAll(signal?: AbortSignal): Promise<LogoutResponse>;
1319
1335
  walletChallenge(params: {
@@ -1393,6 +1409,7 @@ declare class VaultumClient {
1393
1409
  getCapabilities(signal?: AbortSignal): Promise<Capabilities>;
1394
1410
  createAccount(options: {
1395
1411
  sessionKeyAddress: Address;
1412
+ signerSource: SignerSource;
1396
1413
  chain?: string;
1397
1414
  vaultIndex?: number;
1398
1415
  sponsorshipMode?: 'required' | 'prefer' | 'disabled';
@@ -2375,4 +2392,4 @@ declare function hashCrossChainRootTypedData(params: CrossChainRootTypedDataPara
2375
2392
 
2376
2393
  declare const VERSION: string;
2377
2394
 
2378
- 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 SettlementPrepareResult, 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 };
2395
+ 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 AuthSelectedChainResponse, 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 SettlementPrepareResult, type SettlementQuote, type SettlementTokens, type SignerSource, 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 WalletSource, type WalletsResponse, buildCrossChainRootTypedData, createUserOpBuilder, getUserOpHash, hashCrossChainRootTypedData, packGasFees, packGasLimits, parseQuoteResponse, unpackGasFees, unpackGasLimits };
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ var API = {
63
63
  logout: "/api/auth/logout",
64
64
  logoutAll: "/api/auth/logout-all",
65
65
  me: "/api/auth/me",
66
+ selectedChain: "/api/auth/selected-chain",
66
67
  walletLinkChallenge: "/api/auth/wallet/link/challenge",
67
68
  walletLinkVerify: "/api/auth/wallet/link/verify",
68
69
  wallets: "/api/auth/wallets",
@@ -837,6 +838,12 @@ var VaultumClient = class {
837
838
  if ("user" in raw && isRecord(raw.user)) return raw.user;
838
839
  return raw;
839
840
  }
841
+ async authGetSelectedChain(signal) {
842
+ return this.request("GET", API.auth.selectedChain, void 0, { signal });
843
+ }
844
+ async authSetSelectedChain(chain, signal) {
845
+ return this.request("POST", API.auth.selectedChain, { chain }, { signal });
846
+ }
840
847
  async authLogout(signal) {
841
848
  const r = await this.request("POST", API.auth.logout, void 0, { signal });
842
849
  this.setBearer(null);
@@ -902,7 +909,8 @@ var VaultumClient = class {
902
909
  wallets: (raw.wallets || []).map((w) => ({
903
910
  address: w.address.toLowerCase(),
904
911
  chainId: w.chain_id,
905
- type: w.type
912
+ type: w.type,
913
+ source: w.source
906
914
  }))
907
915
  };
908
916
  }
@@ -917,7 +925,8 @@ var VaultumClient = class {
917
925
  wallets: (raw.wallets || []).map((w) => ({
918
926
  address: w.address.toLowerCase(),
919
927
  chainId: w.chain_id,
920
- type: w.type
928
+ type: w.type,
929
+ source: w.source
921
930
  }))
922
931
  };
923
932
  }
@@ -995,6 +1004,7 @@ var VaultumClient = class {
995
1004
  async createAccount(options) {
996
1005
  return this.request("POST", API.accounts.create, {
997
1006
  sessionKeyAddress: options.sessionKeyAddress.toLowerCase(),
1007
+ signerSource: options.signerSource,
998
1008
  type: "create",
999
1009
  chain: options.chain ?? this.chain,
1000
1010
  vaultIndex: options.vaultIndex,
@@ -2142,7 +2152,7 @@ function hashCrossChainRootTypedData(params) {
2142
2152
  }
2143
2153
 
2144
2154
  // src/index.ts
2145
- var VERSION = "0.1.9";
2155
+ var VERSION = "0.1.11";
2146
2156
  // Annotate the CommonJS export names for ESM import in node:
2147
2157
  0 && (module.exports = {
2148
2158
  API,
package/dist/index.mjs CHANGED
@@ -18,6 +18,7 @@ var API = {
18
18
  logout: "/api/auth/logout",
19
19
  logoutAll: "/api/auth/logout-all",
20
20
  me: "/api/auth/me",
21
+ selectedChain: "/api/auth/selected-chain",
21
22
  walletLinkChallenge: "/api/auth/wallet/link/challenge",
22
23
  walletLinkVerify: "/api/auth/wallet/link/verify",
23
24
  wallets: "/api/auth/wallets",
@@ -801,6 +802,12 @@ var VaultumClient = class {
801
802
  if ("user" in raw && isRecord(raw.user)) return raw.user;
802
803
  return raw;
803
804
  }
805
+ async authGetSelectedChain(signal) {
806
+ return this.request("GET", API.auth.selectedChain, void 0, { signal });
807
+ }
808
+ async authSetSelectedChain(chain, signal) {
809
+ return this.request("POST", API.auth.selectedChain, { chain }, { signal });
810
+ }
804
811
  async authLogout(signal) {
805
812
  const r = await this.request("POST", API.auth.logout, void 0, { signal });
806
813
  this.setBearer(null);
@@ -866,7 +873,8 @@ var VaultumClient = class {
866
873
  wallets: (raw.wallets || []).map((w) => ({
867
874
  address: w.address.toLowerCase(),
868
875
  chainId: w.chain_id,
869
- type: w.type
876
+ type: w.type,
877
+ source: w.source
870
878
  }))
871
879
  };
872
880
  }
@@ -881,7 +889,8 @@ var VaultumClient = class {
881
889
  wallets: (raw.wallets || []).map((w) => ({
882
890
  address: w.address.toLowerCase(),
883
891
  chainId: w.chain_id,
884
- type: w.type
892
+ type: w.type,
893
+ source: w.source
885
894
  }))
886
895
  };
887
896
  }
@@ -959,6 +968,7 @@ var VaultumClient = class {
959
968
  async createAccount(options) {
960
969
  return this.request("POST", API.accounts.create, {
961
970
  sessionKeyAddress: options.sessionKeyAddress.toLowerCase(),
971
+ signerSource: options.signerSource,
962
972
  type: "create",
963
973
  chain: options.chain ?? this.chain,
964
974
  vaultIndex: options.vaultIndex,
@@ -2106,7 +2116,7 @@ function hashCrossChainRootTypedData(params) {
2106
2116
  }
2107
2117
 
2108
2118
  // src/index.ts
2109
- var VERSION = "0.1.9";
2119
+ var VERSION = "0.1.11";
2110
2120
  export {
2111
2121
  API,
2112
2122
  CONTRACTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaultum/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "TypeScript SDK for Vaultum smart wallet",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -23,7 +23,8 @@
23
23
  "typecheck": "tsc --noEmit",
24
24
  "lint": "eslint src --ext .ts",
25
25
  "verify": "npm run lint && npm run test",
26
- "prepublishOnly": "npm run build"
26
+ "release:check": "npm run verify && npm run typecheck && npm run build && npm pack --dry-run",
27
+ "prepublishOnly": "npm run verify && npm run typecheck && npm run build"
27
28
  },
28
29
  "keywords": [
29
30
  "vaultum",