Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
navi-aggregator-sdk
Advanced tools
This TypeScript SDK simplifies integration with decentralized exchanges (DEXs) on the Sui blockchain, allowing developers to execute token swaps in Move-based PTB applications or directly leverage the SDK for optimized token swaps across multiple sources for the best prices.
For full details, please see the Documentation.
npm i navi-aggregator-sdk
Pass in the fromCoin, toCoin, and amountIn. The output will be the quote for the swap.
import { getRoute } from 'navi-aggregator-sdk';
const quote = await getRoute(fromCoin: string, toCoin: string, amountIn: number | string | bigint);
console.log(`Amount In: ${quote.amount_in}, Amount Out: ${quote.amount_out}`);
console.log(`Routes: ${quote.routes}`);
Pass in a coinObject as the coin parameter. The output will be the final coin object after the swap.
import { swapPTB } from 'navi-aggregator-sdk';
const coinB = await swapPTB(
address: string,
txb: Transaction,
fromCoin: string,
toCoin: string,
coin: TransactionResult,
amountIn: number | string | bigint,
minAmountOut: number,
swapOptions: SwapOptions = { referer: 'https://www.navi.ag/', dexList: [], byAmountIn: true, depth: 3 }
)
The swap function is a wrapper for the getRoute and swapPTB functions. Set isDryRun
from swapOptions
to true to get a dry run result and balance changes. It will submit the transaction and return the result if a keypair
is provided.
import { swap } from 'navi-aggregator-sdk';
const result = await swap(
address: string,
client: SuiClient,
fromCoin: string,
toCoin: string,
amountIn: number | string | bigint,
minAmountOut: number,
swapOptions: SwapOptions = { referer: 'https://www.navi.ag/', dexList: [], byAmountIn: true, depth: 3, isDryRun: true, keypair: undefined }
);
See the demo for examples of how to use the SDK with NAVI-SDK.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
NAVI Aggregator for Sui Defi Ecosystem
We found that navi-aggregator-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.