Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

navi-aggregator-sdk-dev

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

navi-aggregator-sdk-dev

NAVI Aggregator for Sui Defi Ecosystem

  • 1.0.2
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
0
Weekly downloads
 
Created
Source

navi-aggregator-sdk

NAVI Aggregator for Sui Defi Ecosystem

This project provides a TypeScript SDK for interacting with the Sui Defi projects, allowing developers to integrate token swap functionalities, manage transactions, and interact with the blockchain using NAVI's aggregator.

Supported DEX

  • CETUS
  • Turbos
  • DeepBook v2/v3

To be added:

  • Aftermath
  • Kriya v2/v3

Installation

npm i navi-aggregator-sdk

Environment Setup

Ensure you have a .env file set up with the following variables:

MNEMONIC=<your_wallet_mnemonic>
RPC=<your_sui_rpc_url>
apiBaseURL = <api_url>

Usage

Explanation of Parameters:

  • Executes a swap transaction using the provided parameters.
  • @param {string} address - The user's address.
  • @param {SuiClient} client - The Sui client instance.
  • @param {string} fromCoin - The coin to swap from.
  • @param {string} toCoin - The coin to swap to.
  • @param {number | string | bigint} amountIn - The amount of the input coin.
  • @param {number} minAmountOut - The minimum amount of the output coin.
  • @param {boolean} [isDryRun=true] - Whether to perform a dry run of the transaction.
  • @param {Ed25519Keypair} [keypair] - The keypair for signing the transaction.
  • @param {Object} [swapOptions] - Optional swap options.
  • @param {string[]} [swapOptions.dexList] - List of DEXs to use.
  • @param {boolean} [swapOptions.byAmountIn] - Whether to swap by amount in.
  • @param {number} [swapOptions.depth] - The depth of the swap.
  • @throws {Error} - Throws an error if keypair is not provided for non-dry run transactions.
export async function swap(
    address: string,
    client: SuiClient,
    fromCoin: string,
    toCoin: string,
    amountIn: number | string | bigint,
    minAmountOut: number,
    isDryRun: boolean = true,
    keypair?: Ed25519Keypair,
    swapOptions: { dexList?: string[], byAmountIn?: boolean, depth?: number } = { dexList: ['cetus'], byAmountIn: true, depth: 3 }
)

FAQs

Package last updated on 01 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc