SDK
Introduction
This sdk helps you integrate with us, using three ways:
- Simplest way is using React banner.
- Support UI widget in your project. We provide js functions for staking, unstaking, statistics and transaction info.
- Use staking widget with UI (coming soon).
Installation
- npm
- Yarn
npm install @lidofinance/solido-sdk
yarn add @lidofinance/solido-sdk
Using banner
import { LidoStakeBanner } from '@lidofinance/solido-sdk';
<LidoStakeBanner referrerId="your_solana_referral_address" direction="horizontal" />
See Banner Section
Using 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.