degenhive-ai
v1.1.2
Published
SDK to interact with DegenHive's move modules.
Downloads
231
Maintainers
Readme
DegenHive SDK
The official SDK for DegenHive - a comprehensive DeFi platform on the Sui Network featuring a meta-DEX, liquid staking solution, and gamified NFT ecosystem. This SDK provides developers with tools to interact with DegenHive's smart contracts seamlessly.
Key Features
- 🔄 Meta-DEX Operations
- Two-pool and three-pool AMM swaps
- Liquidity pool management
- Flash loans
- 🏦 Liquid Staking (dSUI)
- Stake/unstake SUI tokens
- Instant and delayed unstaking options
- Validator selection and management
- 🎮 Gamification
- Dragon-bee NFT integration
- Staking and rewards
- Battle mechanics
Installation
npm install degenhive
Usage Examples
Two-Pool Swaps
The SDK supports efficient token swaps through our two-pool / three-pool AMM system. Here's a basic example:
import { RouterFunctions } from "degenhive";
const { swap2poolProvideX, swap2poolProvideY } = RouterFunctions;
// Swap SUI to USDC
const txb = new TransactionBlock();
swap2poolProvideY(txb, [USDC_TYPE, SUI_TYPE, CURVED_TYPE], {
pool: poolAddress,
tokenYIn: suiCoin,
yInAmt: amount,
xOutMin: minReceived,
isGiveIn: true
});
Check examples/two_pool.js
for complete implementation details.
Liquid Staking
Our dSUI vault provides flexible staking options:
import { EntryScriptFunctions } from "degenhive";
const { stakeSui, requestInstantUnstake } = EntryScriptFunctions;
// Stake SUI
const txb = new TransactionBlock();
stakeSui(txb, {
suiCoin: suiToStake,
toStake: amount
});
See examples/dsui_vault.js
for more staking operations.
API Reference
RouterFunctions
swap2poolProvideX/Y
- Execute swaps in two-token poolsswap3poolProvideX/Y/Z
- Execute swaps in three-token pools
DSuiVaultFunctions
stakeSui
- Stake SUI tokens and receive dSUIrequestInstantUnstake
- Unstakes SUI tokens by burning dSUI to receive principal SUI + rewards
Documentation
For comprehensive documentation, visit our Developer Guide [WIP].
Support
License
Apache License 2.0 - see the LICENSE file for details.