@everstake/wallet-sdk-hysp-solana 1.0.0

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/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "all",
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "tabWidth": 2
7
+ }
package/License ADDED
@@ -0,0 +1,43 @@
1
+ Copyright (c) 2025, Everstake.
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ Redistributions of source code must retain the above copyright notice, this
10
+
11
+ list of conditions and the following disclaimer.
12
+
13
+ Redistributions in binary form must reproduce the above copyright notice,
14
+
15
+ this list of conditions and the following disclaimer in the documentation
16
+
17
+ and/or other materials provided with the distribution.
18
+
19
+ Neither the name of the copyright holder nor the names of its
20
+
21
+ contributors may be used to endorse or promote products derived from
22
+
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+
27
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+
29
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+
31
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32
+
33
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34
+
35
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36
+
37
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38
+
39
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
40
+
41
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42
+
43
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Everstake Wallet SDK - HYSP Solana Vault
2
+
3
+ ## Getting Started
4
+
5
+ ### Step 1: Installing the library
6
+
7
+ ```sh
8
+ $ npm install @everstake/wallet-sdk-hysp-solana
9
+ ```
10
+
11
+ or you can also use yarn
12
+
13
+ ```sh
14
+ $ yarn add @everstake/wallet-sdk-hysp-solana
15
+ ```
16
+
17
+ or you can use pnpm
18
+
19
+ ```sh
20
+ $ pnpm add @everstake/wallet-sdk-hysp-solana
21
+ ```
22
+
23
+ ## Step 2: Importing the library
24
+
25
+ After installing the package, you can import the module and use the SDK:
26
+
27
+ #### Import ES6
28
+
29
+ ```ts
30
+ // import module
31
+ import { HyspSolana } from '@everstake/wallet-sdk-hysp-solana';
32
+ ```
33
+
34
+ #### Import ES5
35
+
36
+ ```ts
37
+ // import module
38
+ const { HyspSolana } = require('@everstake/wallet-sdk-hysp-solana');
39
+ ```
40
+
41
+ ## Step 3: Using the library
42
+
43
+ Initialize vault object:
44
+
45
+ ```ts
46
+ const hysp = new HyspSolana('USDC');
47
+ ```
48
+
49
+ ### 3.1 Depositing to Vault
50
+
51
+ Use `deposit` method to create deposit to vault transaction instructions.
52
+
53
+ ### 3.2 Withdrawing from Vault
54
+
55
+ Use `withdraw` method to create withdraw from vault transaction instructions.
56
+
57
+ ### 3.3 Checking Balance
58
+
59
+ Use `getUserShares` method to get user's vault shares balance.
@@ -0,0 +1,241 @@
1
+ import { Address, Blockhash, Instruction, TransactionMessageWithLifetime } from '@solana/kit';
2
+ import { VaultHoldings, APY } from '@kamino-finance/klend-sdk';
3
+ import { Decimal } from 'decimal.js';
4
+
5
+ /**
6
+ * Copyright (c) 2025, Everstake.
7
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
8
+ */
9
+ /**
10
+ * `WalletSDKError` is a custom error class that extends the built-in `Error` class.
11
+ * It provides additional properties for error handling within the Wallet SDK.
12
+ *
13
+ * @remarks
14
+ * This class is needed to provide additional context for errors, such as a code
15
+ * and the original error, if any.
16
+ *
17
+ * @public
18
+ *
19
+ * @param message - The error message.
20
+ * @param code - A string representing the error code.
21
+ * @param originalError - The original error that caused this error, if any.
22
+ */
23
+ declare class WalletSDKError extends Error {
24
+ code: string;
25
+ originalError?: Error | undefined;
26
+ constructor(message: string, code: string, originalError?: Error | undefined);
27
+ }
28
+ /**
29
+ * `Blockchain` is an abstract class that provides a structure for blockchain-specific classes.
30
+ * It includes methods for error handling and throwing errors.
31
+ *
32
+ * @remarks
33
+ * This class should be extended by classes that implement blockchain-specific functionality.
34
+ * The extending classes should provide their own `ERROR_MESSAGES` and `ORIGINAL_ERROR_MESSAGES`.
35
+ *
36
+ * @property ERROR_MESSAGES - An object that maps error codes to error messages.
37
+ * @property ORIGINAL_ERROR_MESSAGES - An object that maps original error messages to user-friendly error messages.
38
+ *
39
+ *
40
+ * **/
41
+ declare abstract class Blockchain {
42
+ protected abstract ERROR_MESSAGES: {
43
+ [key: string]: string;
44
+ };
45
+ protected abstract ORIGINAL_ERROR_MESSAGES: {
46
+ [key: string]: string;
47
+ };
48
+ /**
49
+ * Handles errors that occur within the Ethereum class.
50
+ *
51
+ * @param {keyof typeof ERROR_MESSAGES} code - The error code associated with the error.
52
+ * @param {Error | WalletSDKError | unknown} originalError - The original error that was thrown.
53
+ *
54
+ * If the original error is an instance of WalletSDKError, it is thrown as is.
55
+ * If the original error is an instance of the built-in Error class, a new WalletSDKError is thrown with the original error as the cause.
56
+ * If the original error is not an instance of WalletSDKError or Error, a new WalletSDKError is thrown with a generic message and code.
57
+ */
58
+ handleError(code: keyof typeof this.ERROR_MESSAGES, originalError: Error | WalletSDKError | unknown): void;
59
+ /**
60
+ * Throws a WalletSDKError with a specified error code and message.
61
+ *
62
+ * @param {keyof typeof ERROR_MESSAGES} code - The error code associated with the error.
63
+ * @param {...string[]} values - The values to be inserted into the error message.
64
+ *
65
+ * The method retrieves the error message template associated with the provided code from the ERROR_MESSAGES object.
66
+ * It then replaces placeholders in the message template with provided values and throws a WalletSDKError with the final message and the provided code.
67
+ */
68
+ throwError(code: keyof typeof this.ERROR_MESSAGES, ...values: string[]): void;
69
+ /**
70
+ * Check if the URL is valid
71
+ *
72
+ * @param {string} url - URL
73
+ * @returns a bool type result.
74
+ *
75
+ */
76
+ isValidURL(url: string): boolean;
77
+ }
78
+
79
+ /**
80
+ * Copyright (c) 2025, Everstake.
81
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
82
+ */
83
+ declare const ERROR_MESSAGES: {
84
+ INITIALIZATION_ERROR: string;
85
+ DEPOSIT_ERROR: string;
86
+ WITHDRAW_ERROR: string;
87
+ GET_SHARES_ERROR: string;
88
+ GET_BALANCE_ERROR: string;
89
+ VAULT_LOAD_ERROR: string;
90
+ VAULT_NOT_FOUND_ERROR: string;
91
+ };
92
+
93
+ /**
94
+ * Copyright (c) 2025, Everstake.
95
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
96
+ */
97
+
98
+ type SupportedToken = 'USDC';
99
+ type VaultsMap = {
100
+ [K in SupportedToken]: Address;
101
+ };
102
+ declare const VAULTS: VaultsMap;
103
+
104
+ /**
105
+ * Copyright (c) 2025, Everstake.
106
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
107
+ */
108
+
109
+ interface ApiResponse<T> {
110
+ result: T;
111
+ }
112
+ type Params = {
113
+ сomputeUnitPrice?: bigint;
114
+ computeUnitLimit?: number;
115
+ finalLatestBlockhash?: {
116
+ /** a Hash as base-58 encoded string */
117
+ blockhash: Blockhash;
118
+ /** last block height at which the blockhash will be valid */
119
+ lastValidBlockHeight: bigint;
120
+ };
121
+ /** Instructions to be added after the main instructions created by SDK */
122
+ afterInstructions?: Instruction[];
123
+ };
124
+
125
+ /**
126
+ * Copyright (c) 2025, Everstake.
127
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
128
+ */
129
+
130
+ /**
131
+ * The `HyspSolana` class extends the `Blockchain` class and provides methods for interacting with vaults on Solana.
132
+ *
133
+ * This SDK allows users to perform vault operations such as deposits, withdrawals, and retrieving vault information.
134
+ *
135
+ * @property connection - The connection to the Solana blockchain.
136
+ * @property vault - The KaminoVault instance for vault operations.
137
+ * @property tokenSymbol - The supported token symbol for the vault.
138
+ * @property ERROR_MESSAGES - The error messages for the HYSP class.
139
+ * @property ORIGINAL_ERROR_MESSAGES - The original error messages for the HYSP class.
140
+ *
141
+ */
142
+ declare class HyspSolana extends Blockchain {
143
+ protected ERROR_MESSAGES: {
144
+ INITIALIZATION_ERROR: string;
145
+ DEPOSIT_ERROR: string;
146
+ WITHDRAW_ERROR: string;
147
+ GET_SHARES_ERROR: string;
148
+ GET_BALANCE_ERROR: string;
149
+ VAULT_LOAD_ERROR: string;
150
+ VAULT_NOT_FOUND_ERROR: string;
151
+ };
152
+ protected ORIGINAL_ERROR_MESSAGES: {
153
+ INITIALIZATION_ERROR: string;
154
+ DEPOSIT_ERROR: string;
155
+ WITHDRAW_ERROR: string;
156
+ GET_SHARES_ERROR: string;
157
+ GET_BALANCE_ERROR: string;
158
+ VAULT_LOAD_ERROR: string;
159
+ VAULT_NOT_FOUND_ERROR: string;
160
+ };
161
+ private connection;
162
+ private vault;
163
+ /**
164
+ * Creates a new instance of the KaminoSDK.
165
+ *
166
+ * @param rpcUrl - Optional custom RPC URL. If not provided, uses the default Solana mainnet RPC.
167
+ *
168
+ * @throws Throws an error if the token symbol is not supported.
169
+ * @throws Throws an error if there's an issue during SDK initialization.
170
+ */
171
+ constructor(tokenSymbol: SupportedToken, rpcUrl?: string);
172
+ private getVaultAddress;
173
+ private convertToDecimal;
174
+ /**
175
+ * Fetches the vault holdings data.
176
+ *
177
+ * @throws Throws an error if there's an issue loading vault holdings.
178
+ *
179
+ * @returns Returns a promise that resolves with the vault holdings.
180
+ */
181
+ getVaultHoldings(): Promise<ApiResponse<VaultHoldings>>;
182
+ /**
183
+ * Fetches the vault APY data.
184
+ *
185
+ * @throws Throws an error if there's an issue loading vault APYs.
186
+ *
187
+ * @returns Returns a promise that resolves with the vault actual APY information.
188
+ */
189
+ getVaultAPYs(): Promise<ApiResponse<APY>>;
190
+ /**
191
+ * Fetches the current vault exchange rate (tokens per share).
192
+ *
193
+ * @throws Throws an error if there's an issue loading exchange rate.
194
+ *
195
+ * @returns Returns a promise that resolves with the exchange rate as Decimal.
196
+ */
197
+ getExchangeRate(): Promise<ApiResponse<Decimal>>;
198
+ /**
199
+ * Fetches a user's raw share balance in the current vault.
200
+ *
201
+ * @param userAddress - The public key of the user account.
202
+ * @throws Throws an error if there's an issue fetching user shares.
203
+ * @returns Returns a promise that resolves with the user's shares amount.
204
+ */
205
+ getUserShares(userAddress: Address): Promise<ApiResponse<Decimal>>;
206
+ /**
207
+ * Fetches a user's token balance in the current vault: shares * exchange rate.
208
+ *
209
+ * @param userAddress - The public key of the user account.
210
+ * @throws Throws an error if there's an issue fetching user balance.
211
+ * @returns Returns a promise that resolves with the user's token balance amount.
212
+ */
213
+ getUserBalance(userAddress: Address): Promise<ApiResponse<Decimal>>;
214
+ /**
215
+ * Creates a deposit transaction to the vault.
216
+ *
217
+ * @param userAddress - The public key of the user account.
218
+ * @param amount - The amount to deposit.
219
+ * @param params - Optional transaction parameters.
220
+ *
221
+ * @throws Throws an error if there's an issue creating the deposit transaction.
222
+ *
223
+ * @returns Returns a promise that resolves with the deposit transaction response.
224
+ */
225
+ deposit(userAddress: Address, amount: number | string | bigint | Decimal, params?: Params): Promise<ApiResponse<TransactionMessageWithLifetime>>;
226
+ /**
227
+ * Creates a withdraw transaction from the vault.
228
+ *
229
+ * @param userAddress - The public key of the user account.
230
+ * @param sharesAmount - The amount of shares to withdraw.
231
+ * @param params - Optional transaction parameters.
232
+ *
233
+ * @throws Throws an error if there's issue creating the withdraw transaction.
234
+ *
235
+ * @returns Returns a promise that resolves with the withdraw transaction response.
236
+ */
237
+ withdraw(userAddress: Address, sharesAmount: number | string | bigint | Decimal, params?: Params): Promise<ApiResponse<TransactionMessageWithLifetime>>;
238
+ private buildTx;
239
+ }
240
+
241
+ export { type ApiResponse, Blockchain, ERROR_MESSAGES, HyspSolana, type Params, type SupportedToken, VAULTS, type VaultsMap, WalletSDKError };
@@ -0,0 +1,241 @@
1
+ import { Address, Blockhash, Instruction, TransactionMessageWithLifetime } from '@solana/kit';
2
+ import { VaultHoldings, APY } from '@kamino-finance/klend-sdk';
3
+ import { Decimal } from 'decimal.js';
4
+
5
+ /**
6
+ * Copyright (c) 2025, Everstake.
7
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
8
+ */
9
+ /**
10
+ * `WalletSDKError` is a custom error class that extends the built-in `Error` class.
11
+ * It provides additional properties for error handling within the Wallet SDK.
12
+ *
13
+ * @remarks
14
+ * This class is needed to provide additional context for errors, such as a code
15
+ * and the original error, if any.
16
+ *
17
+ * @public
18
+ *
19
+ * @param message - The error message.
20
+ * @param code - A string representing the error code.
21
+ * @param originalError - The original error that caused this error, if any.
22
+ */
23
+ declare class WalletSDKError extends Error {
24
+ code: string;
25
+ originalError?: Error | undefined;
26
+ constructor(message: string, code: string, originalError?: Error | undefined);
27
+ }
28
+ /**
29
+ * `Blockchain` is an abstract class that provides a structure for blockchain-specific classes.
30
+ * It includes methods for error handling and throwing errors.
31
+ *
32
+ * @remarks
33
+ * This class should be extended by classes that implement blockchain-specific functionality.
34
+ * The extending classes should provide their own `ERROR_MESSAGES` and `ORIGINAL_ERROR_MESSAGES`.
35
+ *
36
+ * @property ERROR_MESSAGES - An object that maps error codes to error messages.
37
+ * @property ORIGINAL_ERROR_MESSAGES - An object that maps original error messages to user-friendly error messages.
38
+ *
39
+ *
40
+ * **/
41
+ declare abstract class Blockchain {
42
+ protected abstract ERROR_MESSAGES: {
43
+ [key: string]: string;
44
+ };
45
+ protected abstract ORIGINAL_ERROR_MESSAGES: {
46
+ [key: string]: string;
47
+ };
48
+ /**
49
+ * Handles errors that occur within the Ethereum class.
50
+ *
51
+ * @param {keyof typeof ERROR_MESSAGES} code - The error code associated with the error.
52
+ * @param {Error | WalletSDKError | unknown} originalError - The original error that was thrown.
53
+ *
54
+ * If the original error is an instance of WalletSDKError, it is thrown as is.
55
+ * If the original error is an instance of the built-in Error class, a new WalletSDKError is thrown with the original error as the cause.
56
+ * If the original error is not an instance of WalletSDKError or Error, a new WalletSDKError is thrown with a generic message and code.
57
+ */
58
+ handleError(code: keyof typeof this.ERROR_MESSAGES, originalError: Error | WalletSDKError | unknown): void;
59
+ /**
60
+ * Throws a WalletSDKError with a specified error code and message.
61
+ *
62
+ * @param {keyof typeof ERROR_MESSAGES} code - The error code associated with the error.
63
+ * @param {...string[]} values - The values to be inserted into the error message.
64
+ *
65
+ * The method retrieves the error message template associated with the provided code from the ERROR_MESSAGES object.
66
+ * It then replaces placeholders in the message template with provided values and throws a WalletSDKError with the final message and the provided code.
67
+ */
68
+ throwError(code: keyof typeof this.ERROR_MESSAGES, ...values: string[]): void;
69
+ /**
70
+ * Check if the URL is valid
71
+ *
72
+ * @param {string} url - URL
73
+ * @returns a bool type result.
74
+ *
75
+ */
76
+ isValidURL(url: string): boolean;
77
+ }
78
+
79
+ /**
80
+ * Copyright (c) 2025, Everstake.
81
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
82
+ */
83
+ declare const ERROR_MESSAGES: {
84
+ INITIALIZATION_ERROR: string;
85
+ DEPOSIT_ERROR: string;
86
+ WITHDRAW_ERROR: string;
87
+ GET_SHARES_ERROR: string;
88
+ GET_BALANCE_ERROR: string;
89
+ VAULT_LOAD_ERROR: string;
90
+ VAULT_NOT_FOUND_ERROR: string;
91
+ };
92
+
93
+ /**
94
+ * Copyright (c) 2025, Everstake.
95
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
96
+ */
97
+
98
+ type SupportedToken = 'USDC';
99
+ type VaultsMap = {
100
+ [K in SupportedToken]: Address;
101
+ };
102
+ declare const VAULTS: VaultsMap;
103
+
104
+ /**
105
+ * Copyright (c) 2025, Everstake.
106
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
107
+ */
108
+
109
+ interface ApiResponse<T> {
110
+ result: T;
111
+ }
112
+ type Params = {
113
+ сomputeUnitPrice?: bigint;
114
+ computeUnitLimit?: number;
115
+ finalLatestBlockhash?: {
116
+ /** a Hash as base-58 encoded string */
117
+ blockhash: Blockhash;
118
+ /** last block height at which the blockhash will be valid */
119
+ lastValidBlockHeight: bigint;
120
+ };
121
+ /** Instructions to be added after the main instructions created by SDK */
122
+ afterInstructions?: Instruction[];
123
+ };
124
+
125
+ /**
126
+ * Copyright (c) 2025, Everstake.
127
+ * Licensed under the BSD-3-Clause License. See LICENSE file for details.
128
+ */
129
+
130
+ /**
131
+ * The `HyspSolana` class extends the `Blockchain` class and provides methods for interacting with vaults on Solana.
132
+ *
133
+ * This SDK allows users to perform vault operations such as deposits, withdrawals, and retrieving vault information.
134
+ *
135
+ * @property connection - The connection to the Solana blockchain.
136
+ * @property vault - The KaminoVault instance for vault operations.
137
+ * @property tokenSymbol - The supported token symbol for the vault.
138
+ * @property ERROR_MESSAGES - The error messages for the HYSP class.
139
+ * @property ORIGINAL_ERROR_MESSAGES - The original error messages for the HYSP class.
140
+ *
141
+ */
142
+ declare class HyspSolana extends Blockchain {
143
+ protected ERROR_MESSAGES: {
144
+ INITIALIZATION_ERROR: string;
145
+ DEPOSIT_ERROR: string;
146
+ WITHDRAW_ERROR: string;
147
+ GET_SHARES_ERROR: string;
148
+ GET_BALANCE_ERROR: string;
149
+ VAULT_LOAD_ERROR: string;
150
+ VAULT_NOT_FOUND_ERROR: string;
151
+ };
152
+ protected ORIGINAL_ERROR_MESSAGES: {
153
+ INITIALIZATION_ERROR: string;
154
+ DEPOSIT_ERROR: string;
155
+ WITHDRAW_ERROR: string;
156
+ GET_SHARES_ERROR: string;
157
+ GET_BALANCE_ERROR: string;
158
+ VAULT_LOAD_ERROR: string;
159
+ VAULT_NOT_FOUND_ERROR: string;
160
+ };
161
+ private connection;
162
+ private vault;
163
+ /**
164
+ * Creates a new instance of the KaminoSDK.
165
+ *
166
+ * @param rpcUrl - Optional custom RPC URL. If not provided, uses the default Solana mainnet RPC.
167
+ *
168
+ * @throws Throws an error if the token symbol is not supported.
169
+ * @throws Throws an error if there's an issue during SDK initialization.
170
+ */
171
+ constructor(tokenSymbol: SupportedToken, rpcUrl?: string);
172
+ private getVaultAddress;
173
+ private convertToDecimal;
174
+ /**
175
+ * Fetches the vault holdings data.
176
+ *
177
+ * @throws Throws an error if there's an issue loading vault holdings.
178
+ *
179
+ * @returns Returns a promise that resolves with the vault holdings.
180
+ */
181
+ getVaultHoldings(): Promise<ApiResponse<VaultHoldings>>;
182
+ /**
183
+ * Fetches the vault APY data.
184
+ *
185
+ * @throws Throws an error if there's an issue loading vault APYs.
186
+ *
187
+ * @returns Returns a promise that resolves with the vault actual APY information.
188
+ */
189
+ getVaultAPYs(): Promise<ApiResponse<APY>>;
190
+ /**
191
+ * Fetches the current vault exchange rate (tokens per share).
192
+ *
193
+ * @throws Throws an error if there's an issue loading exchange rate.
194
+ *
195
+ * @returns Returns a promise that resolves with the exchange rate as Decimal.
196
+ */
197
+ getExchangeRate(): Promise<ApiResponse<Decimal>>;
198
+ /**
199
+ * Fetches a user's raw share balance in the current vault.
200
+ *
201
+ * @param userAddress - The public key of the user account.
202
+ * @throws Throws an error if there's an issue fetching user shares.
203
+ * @returns Returns a promise that resolves with the user's shares amount.
204
+ */
205
+ getUserShares(userAddress: Address): Promise<ApiResponse<Decimal>>;
206
+ /**
207
+ * Fetches a user's token balance in the current vault: shares * exchange rate.
208
+ *
209
+ * @param userAddress - The public key of the user account.
210
+ * @throws Throws an error if there's an issue fetching user balance.
211
+ * @returns Returns a promise that resolves with the user's token balance amount.
212
+ */
213
+ getUserBalance(userAddress: Address): Promise<ApiResponse<Decimal>>;
214
+ /**
215
+ * Creates a deposit transaction to the vault.
216
+ *
217
+ * @param userAddress - The public key of the user account.
218
+ * @param amount - The amount to deposit.
219
+ * @param params - Optional transaction parameters.
220
+ *
221
+ * @throws Throws an error if there's an issue creating the deposit transaction.
222
+ *
223
+ * @returns Returns a promise that resolves with the deposit transaction response.
224
+ */
225
+ deposit(userAddress: Address, amount: number | string | bigint | Decimal, params?: Params): Promise<ApiResponse<TransactionMessageWithLifetime>>;
226
+ /**
227
+ * Creates a withdraw transaction from the vault.
228
+ *
229
+ * @param userAddress - The public key of the user account.
230
+ * @param sharesAmount - The amount of shares to withdraw.
231
+ * @param params - Optional transaction parameters.
232
+ *
233
+ * @throws Throws an error if there's issue creating the withdraw transaction.
234
+ *
235
+ * @returns Returns a promise that resolves with the withdraw transaction response.
236
+ */
237
+ withdraw(userAddress: Address, sharesAmount: number | string | bigint | Decimal, params?: Params): Promise<ApiResponse<TransactionMessageWithLifetime>>;
238
+ private buildTx;
239
+ }
240
+
241
+ export { type ApiResponse, Blockchain, ERROR_MESSAGES, HyspSolana, type Params, type SupportedToken, VAULTS, type VaultsMap, WalletSDKError };