Eversol
Search
K

Eversol SDK

Eversol’s SDK is the easiest way of implementing Solana staking services in your product.

A software development kit (SDK) is a collection of software development tools in one installable package. It facilitates the creation of applications with a compiler, debugger and sometimes a software framework.

Use Eversol’s SDK to facilitate the integration of our features!

Our team has developed an SDK using Typescript for your best experience. TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

You can find Eversol’s SDK via link.

Example of using our SDK

Eversol’s features, such as Stake / Unstake / Instant Unstake can be integrated by partners and projects using our SDK. For example, a Wallet team that wants to integrate liquid-stacking can do it quickly and easily using our set of software tools.

Installation

$ npm install @everstake/eversol-ts-sdk

Initialize the library

Import the main client class eSOL and initialize it with the desired cluster type:
import { ESol } from '@everstake/eversol-ts-sdk';
// initializes for mainnet-beta
const eSol = new ESol('mainnet-beta');
// initializes for testnet
const eSol = new ESol('testnet');

Eversol’s SDK can help with integration of three functions:

1. Deposit SOL Transaction
Stake SOL and get your eSOL:
...
const depositSolTransaction = await eSol.depositSolTransaction(userAddress, amountLamports, referrerAccount)
// referrerAccount - should exist in referrer list (contact our team to add your address)
// than sign and send the `transaction`
2. Instant unstake eSOL Transaction
Skip the basic Solana cool-down period and undelegate stake instantly. If the feature is not available (meaning there is not enough liquidity/reserve in the pool to cover instant unstaking), please use the standard Unstake:
Read more about Instant unstake here
...
const instantUnstakeTransaction = await eSol.unDelegateSolTransaction(userAddress, amountLamports)
// than sign and send the `transaction`
3. Classic delayed unstake eSOL Transaction
Your stake will be deactivated with the beginning of a new epoch. Once the stake is inactive, feel free to withdraw the tokens within your wallet, in compliance with regular Solana staking terms.
...
const delayedUnstakeTransaction = await eSol.withdrawSolTransaction(userAddress, amountLamports)
// than sign and send the `transaction`