@everstake/wallet-sdk-hysp-solana 1.0.0 → 1.1.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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -1
- package/dist/index.mjs +13 -1
- package/package.json +2 -2
- package/src/constants/index.ts +2 -1
- package/src/hysp.ts +14 -0
package/dist/index.d.mts
CHANGED
|
@@ -211,6 +211,7 @@ declare class HyspSolana extends Blockchain {
|
|
|
211
211
|
* @returns Returns a promise that resolves with the user's token balance amount.
|
|
212
212
|
*/
|
|
213
213
|
getUserBalance(userAddress: Address): Promise<ApiResponse<Decimal>>;
|
|
214
|
+
getVaultLiquidityAmount(): Promise<ApiResponse<Decimal>>;
|
|
214
215
|
/**
|
|
215
216
|
* Creates a deposit transaction to the vault.
|
|
216
217
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -211,6 +211,7 @@ declare class HyspSolana extends Blockchain {
|
|
|
211
211
|
* @returns Returns a promise that resolves with the user's token balance amount.
|
|
212
212
|
*/
|
|
213
213
|
getUserBalance(userAddress: Address): Promise<ApiResponse<Decimal>>;
|
|
214
|
+
getVaultLiquidityAmount(): Promise<ApiResponse<Decimal>>;
|
|
214
215
|
/**
|
|
215
216
|
* Creates a deposit transaction to the vault.
|
|
216
217
|
*
|
package/dist/index.js
CHANGED
|
@@ -131,7 +131,8 @@ var ERROR_MESSAGES = {
|
|
|
131
131
|
// src/constants/index.ts
|
|
132
132
|
var import_kit = require("@solana/kit");
|
|
133
133
|
var VAULTS = {
|
|
134
|
-
USDC
|
|
134
|
+
// Gauntlet USDC Prime
|
|
135
|
+
USDC: (0, import_kit.address)("9E69U4GzWhryRaPe8DYpco6Z9vTZY6gg8w6W2QsBACEj")
|
|
135
136
|
};
|
|
136
137
|
|
|
137
138
|
// src/hysp.ts
|
|
@@ -250,6 +251,17 @@ var HyspSolana = class extends Blockchain {
|
|
|
250
251
|
throw this.handleError("GET_BALANCE_ERROR", error);
|
|
251
252
|
}
|
|
252
253
|
}
|
|
254
|
+
async getVaultLiquidityAmount() {
|
|
255
|
+
try {
|
|
256
|
+
const state = await this.vault.getState();
|
|
257
|
+
const liquidityAmount = state.tokenAvailable / 10 ** state.tokenMintDecimals;
|
|
258
|
+
return {
|
|
259
|
+
result: this.convertToDecimal(liquidityAmount.toString())
|
|
260
|
+
};
|
|
261
|
+
} catch (error) {
|
|
262
|
+
throw this.handleError("VAULT_LOAD_ERROR", error);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
253
265
|
/**
|
|
254
266
|
* Creates a deposit transaction to the vault.
|
|
255
267
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -114,7 +114,8 @@ var ERROR_MESSAGES = {
|
|
|
114
114
|
// src/constants/index.ts
|
|
115
115
|
import { address } from "@solana/kit";
|
|
116
116
|
var VAULTS = {
|
|
117
|
-
USDC
|
|
117
|
+
// Gauntlet USDC Prime
|
|
118
|
+
USDC: address("9E69U4GzWhryRaPe8DYpco6Z9vTZY6gg8w6W2QsBACEj")
|
|
118
119
|
};
|
|
119
120
|
|
|
120
121
|
// src/hysp.ts
|
|
@@ -233,6 +234,17 @@ var HyspSolana = class extends Blockchain {
|
|
|
233
234
|
throw this.handleError("GET_BALANCE_ERROR", error);
|
|
234
235
|
}
|
|
235
236
|
}
|
|
237
|
+
async getVaultLiquidityAmount() {
|
|
238
|
+
try {
|
|
239
|
+
const state = await this.vault.getState();
|
|
240
|
+
const liquidityAmount = state.tokenAvailable / 10 ** state.tokenMintDecimals;
|
|
241
|
+
return {
|
|
242
|
+
result: this.convertToDecimal(liquidityAmount.toString())
|
|
243
|
+
};
|
|
244
|
+
} catch (error) {
|
|
245
|
+
throw this.handleError("VAULT_LOAD_ERROR", error);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
236
248
|
/**
|
|
237
249
|
* Creates a deposit transaction to the vault.
|
|
238
250
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everstake/wallet-sdk-hysp-solana",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "HYSP Solana - Everstake Wallet SDK",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"sideEffects": false,
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
20
20
|
"type-check": "tsc",
|
|
21
21
|
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
22
22
|
"prettier": "prettier --write 'src/**/*.{ts,tsx}'",
|
package/src/constants/index.ts
CHANGED
|
@@ -12,7 +12,8 @@ export type VaultsMap = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const VAULTS: VaultsMap = {
|
|
15
|
-
USDC
|
|
15
|
+
// Gauntlet USDC Prime
|
|
16
|
+
USDC: address('9E69U4GzWhryRaPe8DYpco6Z9vTZY6gg8w6W2QsBACEj'),
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export * from './errors';
|
package/src/hysp.ts
CHANGED
|
@@ -179,6 +179,20 @@ export class HyspSolana extends Blockchain {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
async getVaultLiquidityAmount(): Promise<ApiResponse<Decimal>> {
|
|
183
|
+
try {
|
|
184
|
+
const state = await this.vault.getState();
|
|
185
|
+
const liquidityAmount =
|
|
186
|
+
state.tokenAvailable / 10 ** state.tokenMintDecimals;
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
result: this.convertToDecimal(liquidityAmount.toString()),
|
|
190
|
+
};
|
|
191
|
+
} catch (error) {
|
|
192
|
+
throw this.handleError('VAULT_LOAD_ERROR', error);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
182
196
|
/**
|
|
183
197
|
* Creates a deposit transaction to the vault.
|
|
184
198
|
*
|