feat: add staking

This commit is contained in:
Arihant Bansal
2024-12-12 01:26:12 +05:30
parent d4e17ad0e7
commit 91f7b8a478
5 changed files with 121 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ A powerful toolkit for interacting with the Solana blockchain, providing easy-to
- Deploy new SPL tokens
- Transfer SOL and SPL tokens
- Check token balances
- Stake SOL
- 🖼️ NFT Management
- Deploy NFT collections
@@ -110,6 +111,17 @@ const signature = await lendAsset(
);
```
### Stake SOL
```typescript
import { stakeWithJup } from 'solana-agent-kit';
const signature = await stakeWithJup(
agent,
1 // amount in SOL
);
```
## API Reference
### Core Functions
@@ -135,6 +147,9 @@ Check SOL or token balance for the agent's wallet.
#### `lendAsset(agent, assetMint, amount, apiKey)`
Lend idle assets to earn interest with Lulo.
#### `stakeWithJup(agent, amount)`
Stake SOL with Jupiter to earn rewards.
## Dependencies
The toolkit relies on several key Solana and Metaplex libraries: