1.1.2 • Published 8 months ago

degenhive-ai v1.1.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 months ago

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 pools
  • swap3poolProvideX/Y/Z - Execute swaps in three-token pools

DSuiVaultFunctions

  • stakeSui - Stake SUI tokens and receive dSUI
  • requestInstantUnstake - 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.

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago