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

Polygon

Learn how to integrate Polygon staking into 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

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

Option 2: TypeScript library

You can install and import Wallet SDK for Javascript/TypeScript.

Step. 1: Installing the Library

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

$ npm install @everstake/wallet-sdk-polygon

Step. 2: Import Wallet SDK

After installing the app, you can import module Polygon and use the SDK:

Import ES6

Import ES5

Questions and Feedback

If you have any questions, issues, or feedback, please file an issue on GitHub.

Stake

The delegate namespace contains methods used for sending transactions on delegation. The unique methods to the delegate namespace are:

  • approve(address, amount, isPOL = false): Approval of the amount for further debiting by a smart contract.

  • delegate(address, amount, isPOL = false): Delegate user tokens.

Delegate Code Example

Undelegate

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

undelegate(address, amount, isPOL = false): Undelegate user's tokens.

Undelegate Code Example

Reward

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

reward(address, isPOL = false): Reward user tokens (Claim reward).

Claim Reward Code Example

Restake

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

restake(address, isPOL = false): Restake user tokens (Claim reward and auto delegate them).

Restake Code Example

Claim Undelegate

The claimUndelegate method uses for sending transaction on claim undelegation.

  • claimUndelegate(address, unbondNonce = 0, isPOL = false): Claim undelegation by address

Claim Undelegate Example

Getting Info

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

  • getReward(address): Gets the user's reward balance in tokens.

  • getTotalDelegate(address): Gets the user's delegate balance in tokens.

  • getUnbond(address): Gets the user's unbond balance in tokens.

  • getCurrentEpoch(): Gets current epoch.

  • getBalanceOf(address, isPOL = false): Gets the user's balance

  • getUnbondNonces(address): Gets unbound nonce by address

Getting Info Code Example

Loading Transaction

The loading namespace contains method used for getting info about loading transaction. The unique methods to the loading namespace is:

  • isTransactionLoading(hash): Waits for a transaction to be processed and returns the status of the transaction.

Get Status Transaction

Sign Transaction

Securely sign Ethereum transactions using your own infrastructure with the assistance of our SDK. By signing transactions on your side, you maintain control over your private keys and sensitive data, enhancing the security of your operations. Our SDK simplifies the process, providing the necessary tools and functions to prepare, sign, and send transactions to the Ethereum network while ensuring that your private keys never leave your secure environment.

Signing on your side, Code Example