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

navi-sdk

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

navi-sdk - npm Package Compare versions

Comparing version 1.3.6 to 1.3.7

@@ -492,3 +492,3 @@ "use strict";

registerStructs();
const assetIds = Array.from({ length: Number(Object.keys(address_1.AddressMap).length) }, (_, i) => i);
const assetIds = Array.from({ length: Number(Object.keys(address_1.pool).length) }, (_, i) => i);
try {

@@ -501,4 +501,7 @@ const allResults = yield Promise.all(assetIds.map(assetId => getIncentivePools(client, assetId, option, checkAddress)));

if (assetId == '5' && pool.funds == '9dae0cf104a193217904f88a48ce2cf0221e8cd9073878edd05101d6b771fa09') {
assetId = '5extra';
assetId = '5extra'; //Means NAVX Rewards
}
if (assetId == '10' && pool.funds == '9dae0cf104a193217904f88a48ce2cf0221e8cd9073878edd05101d6b771fa09') {
assetId = '10extra'; //Means NAVX Rewards
}
const availableDecimal = (BigInt(pool.available) / BigInt(Math.pow(10, 27))).toString();

@@ -511,2 +514,5 @@ const availableFixed = (Number(availableDecimal) / Math.pow(10, 9)).toFixed(5); // Adjust for 5 decimal places

}
if (assetId == '10extra') {
acc[assetId] = { asset_id: '10', funds: pool.funds, available: availableFixed };
}
}

@@ -532,2 +538,3 @@ else {

'10': 'nUSDC',
'10extra': 'nUSDC',
'11': 'ETH',

@@ -539,3 +546,3 @@ '12': 'USDY',

Object.keys(summedRewards).forEach(key => {
if (key == '5extra' || key == '7') {
if (key == '5extra' || key == '10extra' || key == '7') {
console.log(`${coinDictionary[key]}: ${summedRewards[key].available} NAVX`);

@@ -542,0 +549,0 @@ }

{
"name": "navi-sdk",
"version": "1.3.6",
"version": "1.3.7",
"description": "",

@@ -20,3 +20,3 @@ "main": "dist/index.js",

"dependencies": {
"@mysten/sui": "^1.8.0",
"@mysten/sui": "^1.13.0",
"@mysten/sui.js": "^0.54.1",

@@ -23,0 +23,0 @@ "@pythnetwork/pyth-sui-js": "^2.1.0",

@@ -0,0 +0,0 @@ import { Pool, CoinInfo } from './types';

@@ -492,3 +492,3 @@ import { Transaction } from "@mysten/sui/transactions";

registerStructs();
const assetIds = Array.from({ length: Number(Object.keys(AddressMap).length) }, (_, i) => i);
const assetIds = Array.from({ length: Number(Object.keys(pool).length) }, (_, i) => i);
try {

@@ -500,3 +500,2 @@ const allResults = await Promise.all(

const allPools = allResults.flat();
const activePools = allPools.filter(pool => pool.available.trim() != '0');

@@ -507,7 +506,9 @@

if (assetId == '5' && pool.funds == '9dae0cf104a193217904f88a48ce2cf0221e8cd9073878edd05101d6b771fa09') {
assetId = '5extra'
assetId = '5extra' //Means NAVX Rewards
}
if (assetId == '10' && pool.funds == '9dae0cf104a193217904f88a48ce2cf0221e8cd9073878edd05101d6b771fa09') {
assetId = '10extra' //Means NAVX Rewards
}
const availableDecimal = (BigInt(pool.available) / BigInt(10 ** 27)).toString();
const availableFixed = (Number(availableDecimal) / 10 ** 9).toFixed(5); // Adjust for 5 decimal places
if (!acc[assetId]) {

@@ -519,2 +520,5 @@

}
if (assetId == '10extra') {
acc[assetId] = { asset_id: '10', funds: pool.funds, available: availableFixed };
}
} else {

@@ -541,2 +545,3 @@ acc[assetId].available = (parseFloat(acc[assetId].available) + parseFloat(availableFixed)).toFixed(5);

'10': 'nUSDC',
'10extra': 'nUSDC',
'11': 'ETH',

@@ -548,3 +553,3 @@ '12': 'USDY',

Object.keys(summedRewards).forEach(key => {
if (key == '5extra' || key == '7') {
if (key == '5extra' || key == '10extra' || key == '7') {
console.log(`${coinDictionary[key]}: ${summedRewards[key].available} NAVX`);

@@ -551,0 +556,0 @@ } else {

@@ -0,0 +0,0 @@ export type NetworkType = 'testnet' | 'mainnet' | 'devnet' | 'localnet';