Introduction
This SDK helps you integrate with Lido in three ways:
- Using React banner (simplest).
- Supporting a UI widget in your project (We provide js functions for staking, unstaking, statistics and transaction info).
- Use the staking widget with UI (coming soon).
Using banner
- npm
- yarn
npm install @lidofinance/solido-sdk-banner
yarn add @lidofinance/solido-sdk-banner
import LidoStakeBanner from '@lidofinance/solido-sdk-banner';
<LidoStakeBanner referrerId="your_solana_referral_address" direction="horizontal" />
See Banner Section
Using SDK
- npm
- yarn
npm install @lidofinance/solido-sdk
yarn add @lidofinance/solido-sdk
import { SolidoSDK } from '@lidofinance/solido-sdk';
try {
const solidoSDK = new SolidoSDK('mainnet-beta', connection, 'your_solana_referral_address');
await solidoSDK.stake({
amount: 20, // The amount of SOL-s which need to stake
wallet: wallet, // Wallet instance
// Optional callback for getting information about transaction stage
setTxStage: setTxStageCallback,
});
} catch (e) {
// Handle Errors
}
Using staking widget
In progress, will be available soon.