@vaultum/sdk 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +67 -10
- package/dist/index.d.ts +67 -10
- package/dist/index.js +71 -4
- package/dist/index.mjs +71 -4
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -48,6 +48,10 @@ 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;
|
|
@@ -138,6 +142,14 @@ interface AccountCreateResult {
|
|
|
138
142
|
userOpHash: Hex;
|
|
139
143
|
vaultGroupId: number;
|
|
140
144
|
vaultIndex: number;
|
|
145
|
+
sponsorship?: {
|
|
146
|
+
mode: 'sponsored' | 'self_funded';
|
|
147
|
+
fallbackReason?: string;
|
|
148
|
+
};
|
|
149
|
+
funding?: {
|
|
150
|
+
requiredPrefundWei: string;
|
|
151
|
+
recommendedPrefundWei: string;
|
|
152
|
+
};
|
|
141
153
|
}
|
|
142
154
|
interface AccountVerifyResult {
|
|
143
155
|
address: Address;
|
|
@@ -326,18 +338,59 @@ interface FinalizedProposal {
|
|
|
326
338
|
userOp: Record<string, unknown>;
|
|
327
339
|
}
|
|
328
340
|
interface SettlementTokens {
|
|
341
|
+
chainId: number;
|
|
342
|
+
paymaster: Address | null;
|
|
329
343
|
tokens: Array<{
|
|
330
344
|
symbol: string;
|
|
331
345
|
address: Address;
|
|
332
|
-
|
|
346
|
+
pricing: {
|
|
347
|
+
currentRate: string;
|
|
348
|
+
minRate: string;
|
|
349
|
+
maxRate: string;
|
|
350
|
+
maxChargePerOp: string;
|
|
351
|
+
};
|
|
333
352
|
}>;
|
|
334
353
|
}
|
|
335
354
|
interface SettlementQuote {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
355
|
+
chainId: number;
|
|
356
|
+
sender: Address;
|
|
357
|
+
token: {
|
|
358
|
+
symbol: string;
|
|
359
|
+
address: Address;
|
|
360
|
+
};
|
|
361
|
+
quote: {
|
|
362
|
+
tokenPerEth: string;
|
|
363
|
+
maxTokenCharge: string;
|
|
364
|
+
postOpGasOverhead: string;
|
|
365
|
+
validAfter: number;
|
|
366
|
+
validUntil: number;
|
|
367
|
+
nonce: string;
|
|
368
|
+
bounds: {
|
|
369
|
+
min: string;
|
|
370
|
+
max: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
gasLimits: {
|
|
374
|
+
paymasterVerificationGasLimit: string;
|
|
375
|
+
paymasterPostOpGasLimit: string;
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
interface SettlementPrepareResult {
|
|
379
|
+
paymasterAndData: Hex;
|
|
380
|
+
token: {
|
|
381
|
+
symbol: string;
|
|
382
|
+
address: Address;
|
|
383
|
+
};
|
|
384
|
+
quote: {
|
|
385
|
+
tokenPerEth: string;
|
|
386
|
+
validUntil: number;
|
|
387
|
+
bounds: {
|
|
388
|
+
min: string;
|
|
389
|
+
max: string;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
nonce: string;
|
|
393
|
+
policyVersion: number;
|
|
341
394
|
}
|
|
342
395
|
type SwapRouteStepType = 'swap' | 'bridge';
|
|
343
396
|
interface SwapRouteStep {
|
|
@@ -941,6 +994,7 @@ declare const API: {
|
|
|
941
994
|
readonly logout: "/api/auth/logout";
|
|
942
995
|
readonly logoutAll: "/api/auth/logout-all";
|
|
943
996
|
readonly me: "/api/auth/me";
|
|
997
|
+
readonly selectedChain: "/api/auth/selected-chain";
|
|
944
998
|
readonly walletLinkChallenge: "/api/auth/wallet/link/challenge";
|
|
945
999
|
readonly walletLinkVerify: "/api/auth/wallet/link/verify";
|
|
946
1000
|
readonly wallets: "/api/auth/wallets";
|
|
@@ -1265,6 +1319,8 @@ declare class VaultumClient {
|
|
|
1265
1319
|
signal?: AbortSignal;
|
|
1266
1320
|
}): Promise<AuthTokenResponse>;
|
|
1267
1321
|
authMe(signal?: AbortSignal): Promise<ApiUser>;
|
|
1322
|
+
authGetSelectedChain(signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
|
|
1323
|
+
authSetSelectedChain(chain: string, signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
|
|
1268
1324
|
authLogout(signal?: AbortSignal): Promise<LogoutResponse>;
|
|
1269
1325
|
authLogoutAll(signal?: AbortSignal): Promise<LogoutResponse>;
|
|
1270
1326
|
walletChallenge(params: {
|
|
@@ -1346,6 +1402,7 @@ declare class VaultumClient {
|
|
|
1346
1402
|
sessionKeyAddress: Address;
|
|
1347
1403
|
chain?: string;
|
|
1348
1404
|
vaultIndex?: number;
|
|
1405
|
+
sponsorshipMode?: 'required' | 'prefer' | 'disabled';
|
|
1349
1406
|
salt?: Hex;
|
|
1350
1407
|
owners?: Address[];
|
|
1351
1408
|
threshold?: number;
|
|
@@ -1489,19 +1546,19 @@ declare class VaultumClient {
|
|
|
1489
1546
|
getSettlementQuote(params: {
|
|
1490
1547
|
chain: string;
|
|
1491
1548
|
sender: Address;
|
|
1492
|
-
token:
|
|
1549
|
+
token: string;
|
|
1493
1550
|
maxGasCost: string;
|
|
1494
1551
|
maxFeePerGas: string;
|
|
1495
1552
|
signal?: AbortSignal;
|
|
1496
1553
|
}): Promise<SettlementQuote>;
|
|
1497
1554
|
prepareSettlement(params: {
|
|
1498
1555
|
chain: string;
|
|
1499
|
-
token:
|
|
1556
|
+
token: string;
|
|
1500
1557
|
userOp: UserOperation | PackedUserOperation | Record<string, unknown>;
|
|
1501
1558
|
idempotencyKey?: string;
|
|
1502
1559
|
timestamp?: number;
|
|
1503
1560
|
signal?: AbortSignal;
|
|
1504
|
-
}): Promise<
|
|
1561
|
+
}): Promise<SettlementPrepareResult>;
|
|
1505
1562
|
swapQuote(params: {
|
|
1506
1563
|
wallet: Address;
|
|
1507
1564
|
fromChain: string;
|
|
@@ -2325,4 +2382,4 @@ declare function hashCrossChainRootTypedData(params: CrossChainRootTypedDataPara
|
|
|
2325
2382
|
|
|
2326
2383
|
declare const VERSION: string;
|
|
2327
2384
|
|
|
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 };
|
|
2385
|
+
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 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
|
@@ -48,6 +48,10 @@ 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;
|
|
@@ -138,6 +142,14 @@ interface AccountCreateResult {
|
|
|
138
142
|
userOpHash: Hex;
|
|
139
143
|
vaultGroupId: number;
|
|
140
144
|
vaultIndex: number;
|
|
145
|
+
sponsorship?: {
|
|
146
|
+
mode: 'sponsored' | 'self_funded';
|
|
147
|
+
fallbackReason?: string;
|
|
148
|
+
};
|
|
149
|
+
funding?: {
|
|
150
|
+
requiredPrefundWei: string;
|
|
151
|
+
recommendedPrefundWei: string;
|
|
152
|
+
};
|
|
141
153
|
}
|
|
142
154
|
interface AccountVerifyResult {
|
|
143
155
|
address: Address;
|
|
@@ -326,18 +338,59 @@ interface FinalizedProposal {
|
|
|
326
338
|
userOp: Record<string, unknown>;
|
|
327
339
|
}
|
|
328
340
|
interface SettlementTokens {
|
|
341
|
+
chainId: number;
|
|
342
|
+
paymaster: Address | null;
|
|
329
343
|
tokens: Array<{
|
|
330
344
|
symbol: string;
|
|
331
345
|
address: Address;
|
|
332
|
-
|
|
346
|
+
pricing: {
|
|
347
|
+
currentRate: string;
|
|
348
|
+
minRate: string;
|
|
349
|
+
maxRate: string;
|
|
350
|
+
maxChargePerOp: string;
|
|
351
|
+
};
|
|
333
352
|
}>;
|
|
334
353
|
}
|
|
335
354
|
interface SettlementQuote {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
355
|
+
chainId: number;
|
|
356
|
+
sender: Address;
|
|
357
|
+
token: {
|
|
358
|
+
symbol: string;
|
|
359
|
+
address: Address;
|
|
360
|
+
};
|
|
361
|
+
quote: {
|
|
362
|
+
tokenPerEth: string;
|
|
363
|
+
maxTokenCharge: string;
|
|
364
|
+
postOpGasOverhead: string;
|
|
365
|
+
validAfter: number;
|
|
366
|
+
validUntil: number;
|
|
367
|
+
nonce: string;
|
|
368
|
+
bounds: {
|
|
369
|
+
min: string;
|
|
370
|
+
max: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
gasLimits: {
|
|
374
|
+
paymasterVerificationGasLimit: string;
|
|
375
|
+
paymasterPostOpGasLimit: string;
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
interface SettlementPrepareResult {
|
|
379
|
+
paymasterAndData: Hex;
|
|
380
|
+
token: {
|
|
381
|
+
symbol: string;
|
|
382
|
+
address: Address;
|
|
383
|
+
};
|
|
384
|
+
quote: {
|
|
385
|
+
tokenPerEth: string;
|
|
386
|
+
validUntil: number;
|
|
387
|
+
bounds: {
|
|
388
|
+
min: string;
|
|
389
|
+
max: string;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
nonce: string;
|
|
393
|
+
policyVersion: number;
|
|
341
394
|
}
|
|
342
395
|
type SwapRouteStepType = 'swap' | 'bridge';
|
|
343
396
|
interface SwapRouteStep {
|
|
@@ -941,6 +994,7 @@ declare const API: {
|
|
|
941
994
|
readonly logout: "/api/auth/logout";
|
|
942
995
|
readonly logoutAll: "/api/auth/logout-all";
|
|
943
996
|
readonly me: "/api/auth/me";
|
|
997
|
+
readonly selectedChain: "/api/auth/selected-chain";
|
|
944
998
|
readonly walletLinkChallenge: "/api/auth/wallet/link/challenge";
|
|
945
999
|
readonly walletLinkVerify: "/api/auth/wallet/link/verify";
|
|
946
1000
|
readonly wallets: "/api/auth/wallets";
|
|
@@ -1265,6 +1319,8 @@ declare class VaultumClient {
|
|
|
1265
1319
|
signal?: AbortSignal;
|
|
1266
1320
|
}): Promise<AuthTokenResponse>;
|
|
1267
1321
|
authMe(signal?: AbortSignal): Promise<ApiUser>;
|
|
1322
|
+
authGetSelectedChain(signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
|
|
1323
|
+
authSetSelectedChain(chain: string, signal?: AbortSignal): Promise<AuthSelectedChainResponse>;
|
|
1268
1324
|
authLogout(signal?: AbortSignal): Promise<LogoutResponse>;
|
|
1269
1325
|
authLogoutAll(signal?: AbortSignal): Promise<LogoutResponse>;
|
|
1270
1326
|
walletChallenge(params: {
|
|
@@ -1346,6 +1402,7 @@ declare class VaultumClient {
|
|
|
1346
1402
|
sessionKeyAddress: Address;
|
|
1347
1403
|
chain?: string;
|
|
1348
1404
|
vaultIndex?: number;
|
|
1405
|
+
sponsorshipMode?: 'required' | 'prefer' | 'disabled';
|
|
1349
1406
|
salt?: Hex;
|
|
1350
1407
|
owners?: Address[];
|
|
1351
1408
|
threshold?: number;
|
|
@@ -1489,19 +1546,19 @@ declare class VaultumClient {
|
|
|
1489
1546
|
getSettlementQuote(params: {
|
|
1490
1547
|
chain: string;
|
|
1491
1548
|
sender: Address;
|
|
1492
|
-
token:
|
|
1549
|
+
token: string;
|
|
1493
1550
|
maxGasCost: string;
|
|
1494
1551
|
maxFeePerGas: string;
|
|
1495
1552
|
signal?: AbortSignal;
|
|
1496
1553
|
}): Promise<SettlementQuote>;
|
|
1497
1554
|
prepareSettlement(params: {
|
|
1498
1555
|
chain: string;
|
|
1499
|
-
token:
|
|
1556
|
+
token: string;
|
|
1500
1557
|
userOp: UserOperation | PackedUserOperation | Record<string, unknown>;
|
|
1501
1558
|
idempotencyKey?: string;
|
|
1502
1559
|
timestamp?: number;
|
|
1503
1560
|
signal?: AbortSignal;
|
|
1504
|
-
}): Promise<
|
|
1561
|
+
}): Promise<SettlementPrepareResult>;
|
|
1505
1562
|
swapQuote(params: {
|
|
1506
1563
|
wallet: Address;
|
|
1507
1564
|
fromChain: string;
|
|
@@ -2325,4 +2382,4 @@ declare function hashCrossChainRootTypedData(params: CrossChainRootTypedDataPara
|
|
|
2325
2382
|
|
|
2326
2383
|
declare const VERSION: string;
|
|
2327
2384
|
|
|
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 };
|
|
2385
|
+
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 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
|
@@ -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);
|
|
@@ -998,6 +1005,7 @@ var VaultumClient = class {
|
|
|
998
1005
|
type: "create",
|
|
999
1006
|
chain: options.chain ?? this.chain,
|
|
1000
1007
|
vaultIndex: options.vaultIndex,
|
|
1008
|
+
sponsorshipMode: options.sponsorshipMode ?? "prefer",
|
|
1001
1009
|
salt: options.salt,
|
|
1002
1010
|
owners: options.owners?.map((a) => a.toLowerCase()),
|
|
1003
1011
|
threshold: options.threshold,
|
|
@@ -1141,16 +1149,57 @@ var VaultumClient = class {
|
|
|
1141
1149
|
}
|
|
1142
1150
|
async getSettlementTokens(options) {
|
|
1143
1151
|
const chain = options?.chain ?? this.chain ?? "sepolia";
|
|
1144
|
-
|
|
1152
|
+
const raw = await this.request("GET", `${API.settlement.tokens}?chain=${chain}`, void 0, {
|
|
1153
|
+
signal: options?.signal
|
|
1154
|
+
});
|
|
1155
|
+
return {
|
|
1156
|
+
chainId: Number(raw.chainId),
|
|
1157
|
+
paymaster: raw.paymaster ? raw.paymaster.toLowerCase() : null,
|
|
1158
|
+
tokens: (raw.tokens ?? []).map((token) => ({
|
|
1159
|
+
symbol: token.symbol,
|
|
1160
|
+
address: token.address.toLowerCase(),
|
|
1161
|
+
pricing: {
|
|
1162
|
+
currentRate: token.pricing.currentRate,
|
|
1163
|
+
minRate: token.pricing.minRate,
|
|
1164
|
+
maxRate: token.pricing.maxRate,
|
|
1165
|
+
maxChargePerOp: token.pricing.maxChargePerOp
|
|
1166
|
+
}
|
|
1167
|
+
}))
|
|
1168
|
+
};
|
|
1145
1169
|
}
|
|
1146
1170
|
async getSettlementQuote(params) {
|
|
1147
|
-
|
|
1171
|
+
const raw = await this.request("POST", API.settlement.quote, {
|
|
1148
1172
|
chain: params.chain,
|
|
1149
1173
|
sender: params.sender.toLowerCase(),
|
|
1150
1174
|
token: params.token,
|
|
1151
1175
|
maxGasCost: params.maxGasCost,
|
|
1152
1176
|
maxFeePerGas: params.maxFeePerGas
|
|
1153
1177
|
}, { signal: params.signal });
|
|
1178
|
+
const quote = raw;
|
|
1179
|
+
return {
|
|
1180
|
+
chainId: Number(quote.chainId),
|
|
1181
|
+
sender: quote.sender.toLowerCase(),
|
|
1182
|
+
token: {
|
|
1183
|
+
symbol: quote.token.symbol,
|
|
1184
|
+
address: quote.token.address.toLowerCase()
|
|
1185
|
+
},
|
|
1186
|
+
quote: {
|
|
1187
|
+
tokenPerEth: quote.quote.tokenPerEth,
|
|
1188
|
+
maxTokenCharge: quote.quote.maxTokenCharge,
|
|
1189
|
+
postOpGasOverhead: quote.quote.postOpGasOverhead,
|
|
1190
|
+
validAfter: Number(quote.quote.validAfter),
|
|
1191
|
+
validUntil: Number(quote.quote.validUntil),
|
|
1192
|
+
nonce: quote.quote.nonce,
|
|
1193
|
+
bounds: {
|
|
1194
|
+
min: quote.quote.bounds.min,
|
|
1195
|
+
max: quote.quote.bounds.max
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
gasLimits: {
|
|
1199
|
+
paymasterVerificationGasLimit: quote.gasLimits.paymasterVerificationGasLimit,
|
|
1200
|
+
paymasterPostOpGasLimit: quote.gasLimits.paymasterPostOpGasLimit
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1154
1203
|
}
|
|
1155
1204
|
async prepareSettlement(params) {
|
|
1156
1205
|
const userOp = isPackedUserOp(params.userOp) ? packedToUserOperation(params.userOp) : isUserOperation(params.userOp) ? normalizeUserOperation(params.userOp) : params.userOp;
|
|
@@ -1161,11 +1210,29 @@ var VaultumClient = class {
|
|
|
1161
1210
|
};
|
|
1162
1211
|
const idempotencyKey = params.idempotencyKey ?? autoIdempotencyKey(body);
|
|
1163
1212
|
const timestamp = params.timestamp ?? nowUnix();
|
|
1164
|
-
|
|
1213
|
+
const raw = await this.request("POST", API.settlement.prepare, body, {
|
|
1165
1214
|
idempotencyKey,
|
|
1166
1215
|
timestamp,
|
|
1167
1216
|
signal: params.signal
|
|
1168
1217
|
});
|
|
1218
|
+
const prepared = raw;
|
|
1219
|
+
return {
|
|
1220
|
+
paymasterAndData: prepared.paymasterAndData,
|
|
1221
|
+
token: {
|
|
1222
|
+
symbol: prepared.token.symbol,
|
|
1223
|
+
address: prepared.token.address.toLowerCase()
|
|
1224
|
+
},
|
|
1225
|
+
quote: {
|
|
1226
|
+
tokenPerEth: prepared.quote.tokenPerEth,
|
|
1227
|
+
validUntil: Number(prepared.quote.validUntil),
|
|
1228
|
+
bounds: {
|
|
1229
|
+
min: prepared.quote.bounds.min,
|
|
1230
|
+
max: prepared.quote.bounds.max
|
|
1231
|
+
}
|
|
1232
|
+
},
|
|
1233
|
+
nonce: prepared.nonce,
|
|
1234
|
+
policyVersion: Number(prepared.policyVersion)
|
|
1235
|
+
};
|
|
1169
1236
|
}
|
|
1170
1237
|
async swapQuote(params) {
|
|
1171
1238
|
return this.request("POST", API.swap.quote, {
|
|
@@ -2082,7 +2149,7 @@ function hashCrossChainRootTypedData(params) {
|
|
|
2082
2149
|
}
|
|
2083
2150
|
|
|
2084
2151
|
// src/index.ts
|
|
2085
|
-
var VERSION = "0.1.
|
|
2152
|
+
var VERSION = "0.1.10";
|
|
2086
2153
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2087
2154
|
0 && (module.exports = {
|
|
2088
2155
|
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);
|
|
@@ -962,6 +969,7 @@ var VaultumClient = class {
|
|
|
962
969
|
type: "create",
|
|
963
970
|
chain: options.chain ?? this.chain,
|
|
964
971
|
vaultIndex: options.vaultIndex,
|
|
972
|
+
sponsorshipMode: options.sponsorshipMode ?? "prefer",
|
|
965
973
|
salt: options.salt,
|
|
966
974
|
owners: options.owners?.map((a) => a.toLowerCase()),
|
|
967
975
|
threshold: options.threshold,
|
|
@@ -1105,16 +1113,57 @@ var VaultumClient = class {
|
|
|
1105
1113
|
}
|
|
1106
1114
|
async getSettlementTokens(options) {
|
|
1107
1115
|
const chain = options?.chain ?? this.chain ?? "sepolia";
|
|
1108
|
-
|
|
1116
|
+
const raw = await this.request("GET", `${API.settlement.tokens}?chain=${chain}`, void 0, {
|
|
1117
|
+
signal: options?.signal
|
|
1118
|
+
});
|
|
1119
|
+
return {
|
|
1120
|
+
chainId: Number(raw.chainId),
|
|
1121
|
+
paymaster: raw.paymaster ? raw.paymaster.toLowerCase() : null,
|
|
1122
|
+
tokens: (raw.tokens ?? []).map((token) => ({
|
|
1123
|
+
symbol: token.symbol,
|
|
1124
|
+
address: token.address.toLowerCase(),
|
|
1125
|
+
pricing: {
|
|
1126
|
+
currentRate: token.pricing.currentRate,
|
|
1127
|
+
minRate: token.pricing.minRate,
|
|
1128
|
+
maxRate: token.pricing.maxRate,
|
|
1129
|
+
maxChargePerOp: token.pricing.maxChargePerOp
|
|
1130
|
+
}
|
|
1131
|
+
}))
|
|
1132
|
+
};
|
|
1109
1133
|
}
|
|
1110
1134
|
async getSettlementQuote(params) {
|
|
1111
|
-
|
|
1135
|
+
const raw = await this.request("POST", API.settlement.quote, {
|
|
1112
1136
|
chain: params.chain,
|
|
1113
1137
|
sender: params.sender.toLowerCase(),
|
|
1114
1138
|
token: params.token,
|
|
1115
1139
|
maxGasCost: params.maxGasCost,
|
|
1116
1140
|
maxFeePerGas: params.maxFeePerGas
|
|
1117
1141
|
}, { signal: params.signal });
|
|
1142
|
+
const quote = raw;
|
|
1143
|
+
return {
|
|
1144
|
+
chainId: Number(quote.chainId),
|
|
1145
|
+
sender: quote.sender.toLowerCase(),
|
|
1146
|
+
token: {
|
|
1147
|
+
symbol: quote.token.symbol,
|
|
1148
|
+
address: quote.token.address.toLowerCase()
|
|
1149
|
+
},
|
|
1150
|
+
quote: {
|
|
1151
|
+
tokenPerEth: quote.quote.tokenPerEth,
|
|
1152
|
+
maxTokenCharge: quote.quote.maxTokenCharge,
|
|
1153
|
+
postOpGasOverhead: quote.quote.postOpGasOverhead,
|
|
1154
|
+
validAfter: Number(quote.quote.validAfter),
|
|
1155
|
+
validUntil: Number(quote.quote.validUntil),
|
|
1156
|
+
nonce: quote.quote.nonce,
|
|
1157
|
+
bounds: {
|
|
1158
|
+
min: quote.quote.bounds.min,
|
|
1159
|
+
max: quote.quote.bounds.max
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
gasLimits: {
|
|
1163
|
+
paymasterVerificationGasLimit: quote.gasLimits.paymasterVerificationGasLimit,
|
|
1164
|
+
paymasterPostOpGasLimit: quote.gasLimits.paymasterPostOpGasLimit
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1118
1167
|
}
|
|
1119
1168
|
async prepareSettlement(params) {
|
|
1120
1169
|
const userOp = isPackedUserOp(params.userOp) ? packedToUserOperation(params.userOp) : isUserOperation(params.userOp) ? normalizeUserOperation(params.userOp) : params.userOp;
|
|
@@ -1125,11 +1174,29 @@ var VaultumClient = class {
|
|
|
1125
1174
|
};
|
|
1126
1175
|
const idempotencyKey = params.idempotencyKey ?? autoIdempotencyKey(body);
|
|
1127
1176
|
const timestamp = params.timestamp ?? nowUnix();
|
|
1128
|
-
|
|
1177
|
+
const raw = await this.request("POST", API.settlement.prepare, body, {
|
|
1129
1178
|
idempotencyKey,
|
|
1130
1179
|
timestamp,
|
|
1131
1180
|
signal: params.signal
|
|
1132
1181
|
});
|
|
1182
|
+
const prepared = raw;
|
|
1183
|
+
return {
|
|
1184
|
+
paymasterAndData: prepared.paymasterAndData,
|
|
1185
|
+
token: {
|
|
1186
|
+
symbol: prepared.token.symbol,
|
|
1187
|
+
address: prepared.token.address.toLowerCase()
|
|
1188
|
+
},
|
|
1189
|
+
quote: {
|
|
1190
|
+
tokenPerEth: prepared.quote.tokenPerEth,
|
|
1191
|
+
validUntil: Number(prepared.quote.validUntil),
|
|
1192
|
+
bounds: {
|
|
1193
|
+
min: prepared.quote.bounds.min,
|
|
1194
|
+
max: prepared.quote.bounds.max
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
nonce: prepared.nonce,
|
|
1198
|
+
policyVersion: Number(prepared.policyVersion)
|
|
1199
|
+
};
|
|
1133
1200
|
}
|
|
1134
1201
|
async swapQuote(params) {
|
|
1135
1202
|
return this.request("POST", API.swap.quote, {
|
|
@@ -2046,7 +2113,7 @@ function hashCrossChainRootTypedData(params) {
|
|
|
2046
2113
|
}
|
|
2047
2114
|
|
|
2048
2115
|
// src/index.ts
|
|
2049
|
-
var VERSION = "0.1.
|
|
2116
|
+
var VERSION = "0.1.10";
|
|
2050
2117
|
export {
|
|
2051
2118
|
API,
|
|
2052
2119
|
CONTRACTS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaultum/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
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
|
-
"
|
|
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",
|