@everstake/wallet-sdk-hysp-solana
v1.2.1
Published
HYSP Solana - Everstake Wallet SDK
Readme
Everstake Wallet SDK - HYSP Solana Vault
Getting Started
Step 1: Installing the library
$ npm install @everstake/wallet-sdk-hysp-solanaor you can also use yarn
$ yarn add @everstake/wallet-sdk-hysp-solanaor you can use pnpm
$ pnpm add @everstake/wallet-sdk-hysp-solanaStep 2: Importing the library
After installing the package, you can import the module and use the SDK:
Import ES6
// import module
import { HyspSolana } from '@everstake/wallet-sdk-hysp-solana';Import ES5
// import module
const { HyspSolana } = require('@everstake/wallet-sdk-hysp-solana');Step 3: Using the library
Initialize vault object:
const hysp = new HyspSolana('USDC');3.1 Getting Vault Metadata
Retrieve vault metadata using getVaultMeta():
const hysp = new HyspSolana('USDC');
const { result: meta } = hysp.getVaultMeta();
console.log('Share Token:', meta.shareToken.symbol, meta.shareToken.address);
console.log('Vault:', meta.contracts.vault);3.2 Depositing to Vault
Use deposit method to create deposit to vault transaction instructions.
3.3 Withdrawing from Vault
Use withdraw method to create withdraw from vault transaction instructions.
3.4 Checking Balance
Use getUserShares method to get user's vault shares balance.
