Skip to content

bathord/solido-sdk

 
 

Repository files navigation

Lido on Solana - Frontend SDK

About us

Lido on Solana is a Lido-DAO governed liquid staking protocol for the Solana blockchain. Anyone who stakes their SOL tokens with Lido will be issued an on-chain representation of SOL staking position with Lido validators, called stSOL. We will work to integrate stSOL widely into the Solana DeFi ecosystem to enable stSOL users to make use of their staked assets in a variety of applications.

Lido on Solana gives you:

  • Liquidity — No delegation/activation delays and the ability to sell your staked tokens
  • One-click staking — No complicated steps
  • Decentralized security — Assets spread across the industry’s leading validators chosen by the Lido DAO

About sdk

This sdk helps you integrate with us, using two ways:

  1. Simplest way is using React banner.
  2. Support UI widget in your project. We provide js functions for staking, unstaking, statistics and transaction info.
  3. Use staking widget with UI (coming soon)

Contents:

Installation

$ npm install @lidofinance/solido-sdk
$ yarn add @lidofinance/solido-sdk

Using banner

Installation

$ npm install @lidofinance/solido-sdk-banner
$ yarn add @lidofinance/solido-sdk-banner

Banner

import LidoStakeBanner from '@lidofinance/solido-sdk-banner';

<LidoStakeBanner referrerId="your_solana_referral_address" direction="horizontal" />

Note: also available vertical mode. Read more

Using SDK

Installation

$ npm install @lidofinance/solido-sdk
$ yarn add @lidofinance/solido-sdk

Staking:

import { SolidoSDK } from '@lidofinance/solido-sdk';
// solana/web3.js Connection
const solidoSDK = new SolidoSDK('mainnet-beta', connection, 'your_solana_referral_address');

try {
  const { transactionHash, stSolAccountAddress } = await solidoSDK.stake({
    amount: 20, // The amount of SOL-s which need to stake
    wallet: wallet, // Wallet instance
    setTxStage: setTxStageCallback, // Optional callback for getting information about transaction stage (see TX_STAGE)
  });
} catch (e) {
  // Handle Errors
}

Read more for full examples & details

Using staking widget

In progress, will be available soon.

Learn more

Packages

No packages published

Languages

  • TypeScript 98.3%
  • JavaScript 1.7%