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
https://wallet-sdk-api.everstake.one
Option 2: JavaScript library
You can install and import Wallet SDK for Javascript. The link to the JS library on npm: https://www.npmjs.com/package/@everstake/wallet-sdk.
Step. 1: Installing the Library
Install the npm library by copying the code below.
sh
$ npm install @everstake/wallet-sdk
or you can also use yarn
sh
$ yarn add @everstake/wallet-sdk
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
ts
// import module
import { Solana } from '@everstake/wallet-sdk';
// or you can also use
import * as Solana from '@everstake/wallet-sdk/solana';
// import needed function
import { getDelegations } from '@everstake/wallet-sdk/solana';
Import ES5
ts
// import module
const { Solana } = require("@everstake/wallet-sdk");
// or you can also use
const { getDelegations } = require("@everstake/wallet-sdk/solana");
Step. 3: Create Auth Token
In order to access all the features of the Wallet SDK, it's necessary for you to generate an authentication token. This token will be required in all of the methods you use.
Using JS Library
ts
// import
const { CreateToken } = require("@everstake/wallet-sdk");
// Project name
const name = 'Everstake Wallet SDK';
// wallet | Dapp | Other
const type = 'SDK';
// Create Token - return token ID
const token = await CreateToken(name, type);
console.log(token); // 3155f389-d943-4966-8e18-f159c2a6ef66
Using REST API (Swagger)
curl -X 'POST' \
'https://wallet-sdk-api.everstake.one/token/create' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Everstake Wallet SDK",
"type": "SDK"
}'