Documentation v1.0 has been released! Staking Guide, Protocols, Glossary, FAQ, and Support sections have been added.

Solana

Learn how to integrate Solana staking using Everstake Wallet SDK.

Getting Started

You can use two different options to implement staking for Everstake validator.

Option 1: REST API

You can use REST API to call methods which are described in Swagger with detailed examples (both v1 and v2 are supported).

https://wallet-sdk-api.everstake.one

Option 2: JavaScript library

You can install and import Wallet SDK for Javascript.

@everstake/wallet-sdk-solana@^1.x.x

Step. 1: Installing the Library

Install the npm library or yarn by copying the code below.

$ npm install @everstake/wallet-sdk-solana

Step. 2: Import Wallet SDK

After installing the app, you can import module of needed blockchain (Ethereum, Aptos, Solana, Cosmos, Polygon are available) and use the SDK:

Import ES6

Import ES5

Delegate

The delegate namespace contains method used for sending transactions on delegation. The unique method to the delegate namespace is:

  • createAccount(address, lamports): Create Account for Delegate user tokens.

  • delegate(address, lamports, stakeAccount): Delegate user tokens.

Delegate Code Example

Stake

The stake namespace contains method used for sending transactions on stake. This method includes createAccount and delegation together. The unique method to the stake namespace is:

  • stake(address, lamports, source): Stake user tokens.

Stake Code Example

Deactivate

The deactivate namespace contains method used for deactivation of the user stake account. The unique method to the deactivate namespace is:

  • deactivate(address, stakeAccountPublicKey): Deactivate user stake account.

Deactivate Code Example

Unstake

The unstake namespace contains methods used for sending transactions to unstake tokens. The unique method to the unstake namespace is:

  • unstake(address, lamports): Unstake user tokens.

Unstake Code Example

Claim

The claim namespace contains methods used for claiming rewards from staking accounts. The unique method to the claim namespace is:

  • claim(address): Claim rewards for a staking account.

Claim Code Example

Withdraw

The withdraw namespace contains methods used for sending transactions. The unique method to the withdraw namespace is:

withdraw(address, stakeAccountPublicKey, stakeBalance): Withdraw user's tokens.

Withdraw Code Example

Getting Info

The get namespace contains method used for getting info. The unique methods to the get namespace is:

  • getDelegations(address): Get all user delegations.

Getting Info Code Example

Response Example