impermax-sdk 2.1.113 → 2.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -38,4 +38,5 @@ import { VaultRisk } from "./offchain/vault/offchainVault";
38
38
  import { LendingPoolVersion } from "./offchain/lendingPool/offchainLendingPool";
39
39
  import { PositionType, AccountPosition } from "./offchain/account/offchainMultichainAccount";
40
40
  import { OnchainInteractionsNftlpUniswapV3 } from './onchain/interactions/lendingPool/nftlp';
41
- export { offchain, OffchainMultichain, Offchain, OffchainLendingPool, OffchainPoolToken, OffchainCollateral, OffchainBorrowable, OffchainVault, OffchainLeveragedVault, OffchainLendingVault, OffchainHedgedVault, OffchainConfigManager, OffchainPairConfig, OffchainProposal, OffchainMultichainAccount, OffchainAccount, OffchainAccountLendingPool, OffchainAccountPoolToken, OffchainAccountCollateral, OffchainAccountBorrowable, OffchainLeveragedPosition, OffchainAccountVault, OffchainPriceHelper, OffchainSolidexHelper, PoolTokenData, BorrowableData, CollateralData, BorrowablePastData, TokenData, RewardData, PairData, FarmingPoolData, LendingPoolPastData, LendingPoolData, CollateralPosition, SupplyPosition, BorrowPosition, UserData, TvlData, XimxData, LendingVaultData, VaultPosition, PairConfigData, ProposalData, ProposalMetadata, VaultRisk, VaultType, onchain, Onchain, OnchainLendingPool, OnchainPoolToken, OnchainBorrowable, OnchainCollateral, OnchainLendingVault, OnchainConfigManager, OnchainProposal, OnchainPairConfig, OnchainAccount, OnchainAccountLendingPool, OnchainAccountPoolToken, OnchainAccountBorrowable, OnchainAccountCollateral, OnchainAccountLendingVault, OnchainContractsHelper, OnchainImpermaxFactory, OnchainInteractions, OnchainInteractionsLendingPool, OnchainInteractionsPoolToken, OnchainInteractionsCollateral, OnchainInteractionsBorrowable, OnchainInteractionsLendingVault, OnchainInteractionsConfigManager, Contract, ApprovalType, PermitData, OnchainConfig, Changes, NO_CHANGES, Values, AirdropData, PendingRewardUI, CollateralConfig, BorrowableConfig, PairConfig, CLAIM_AGGREGATOR, IMPERMAX_CHEF, IMX, IMPERMAX_FACTORY, getNetworkFactories, getFactoryByAddress, LENDING_VAULT_WATCHER, MERKLE_DISTRIBUTOR_IBEX, MERKLE_DISTRIBUTOR_IBEX_2, MERKLE_DISTRIBUTOR_ETH, ROUTER, SIMPLE_UNISWAP_ORACLE, WETH, MERKLE_URL_ETH, MERKLE_URL_IBEX, MERKLE_URL_IBEX_2, hrAmms, AMM_FACTORY, getAmmByFactory, AMM_SUBGRAPH_URLS, ADD_LIQUIDITY_URLS, AMM_LP_FEE, DEBANK_IDS, ETH_SYMBOL, ETH_NAME, SOLIDEX_FACTORIES, BORROW_FEE_FACTORIES, OLD_KINK_MULTIPLIER_FACTORIES, LIQUIDATION_FEE_FACTORIES, V2_FACTORIES, Farms, hrFarms, FarmIndex, STAKED_LP_FACTORY, getFarmByStakedLPFactory, NOT_SYNCED, DEADLINE, ZERO, APPROVE_AMOUNT, IMPERMAX_SUBGRAPH_URL, IMPERMAX_CHEF_SUBGRAPH_URL, BLOCKS_SUBGRAPH_URL, XIMX_SUBGRAPH_URL, Networks, Factory, Extension, PoolTokenType, Amms, Address, NetworkIndex, FactoryIndex, AddressIndex, NetworkFactoryIndex, LendingPoolIndex, AmmIndex, DistributorDetails, ProposalState, WhitelistState, VaultListOrderBy, VaultListParams, LendingPoolListOrderBy, LendingPoolListParams, SortDirection, LendingPoolVersion, PositionType, AccountPosition, PermitType, Permits, Permit, Borrowable, OnchainInteractionsLendingPoolV3, OnchainInteractionsNftlpUniswapV3 };
41
+ import { decimalToBalance } from './utils/ether-utils';
42
+ export { offchain, OffchainMultichain, Offchain, OffchainLendingPool, OffchainPoolToken, OffchainCollateral, OffchainBorrowable, OffchainVault, OffchainLeveragedVault, OffchainLendingVault, OffchainHedgedVault, OffchainConfigManager, OffchainPairConfig, OffchainProposal, OffchainMultichainAccount, OffchainAccount, OffchainAccountLendingPool, OffchainAccountPoolToken, OffchainAccountCollateral, OffchainAccountBorrowable, OffchainLeveragedPosition, OffchainAccountVault, OffchainPriceHelper, OffchainSolidexHelper, PoolTokenData, BorrowableData, CollateralData, BorrowablePastData, TokenData, RewardData, PairData, FarmingPoolData, LendingPoolPastData, LendingPoolData, CollateralPosition, SupplyPosition, BorrowPosition, UserData, TvlData, XimxData, LendingVaultData, VaultPosition, PairConfigData, ProposalData, ProposalMetadata, VaultRisk, VaultType, onchain, Onchain, OnchainLendingPool, OnchainPoolToken, OnchainBorrowable, OnchainCollateral, OnchainLendingVault, OnchainConfigManager, OnchainProposal, OnchainPairConfig, OnchainAccount, OnchainAccountLendingPool, OnchainAccountPoolToken, OnchainAccountBorrowable, OnchainAccountCollateral, OnchainAccountLendingVault, OnchainContractsHelper, OnchainImpermaxFactory, OnchainInteractions, OnchainInteractionsLendingPool, OnchainInteractionsPoolToken, OnchainInteractionsCollateral, OnchainInteractionsBorrowable, OnchainInteractionsLendingVault, OnchainInteractionsConfigManager, Contract, ApprovalType, PermitData, OnchainConfig, Changes, NO_CHANGES, Values, AirdropData, PendingRewardUI, CollateralConfig, BorrowableConfig, PairConfig, CLAIM_AGGREGATOR, IMPERMAX_CHEF, IMX, IMPERMAX_FACTORY, getNetworkFactories, getFactoryByAddress, LENDING_VAULT_WATCHER, MERKLE_DISTRIBUTOR_IBEX, MERKLE_DISTRIBUTOR_IBEX_2, MERKLE_DISTRIBUTOR_ETH, ROUTER, SIMPLE_UNISWAP_ORACLE, WETH, MERKLE_URL_ETH, MERKLE_URL_IBEX, MERKLE_URL_IBEX_2, hrAmms, AMM_FACTORY, getAmmByFactory, AMM_SUBGRAPH_URLS, ADD_LIQUIDITY_URLS, AMM_LP_FEE, DEBANK_IDS, ETH_SYMBOL, ETH_NAME, SOLIDEX_FACTORIES, BORROW_FEE_FACTORIES, OLD_KINK_MULTIPLIER_FACTORIES, LIQUIDATION_FEE_FACTORIES, V2_FACTORIES, Farms, hrFarms, FarmIndex, STAKED_LP_FACTORY, getFarmByStakedLPFactory, NOT_SYNCED, DEADLINE, ZERO, APPROVE_AMOUNT, IMPERMAX_SUBGRAPH_URL, IMPERMAX_CHEF_SUBGRAPH_URL, BLOCKS_SUBGRAPH_URL, XIMX_SUBGRAPH_URL, Networks, Factory, Extension, PoolTokenType, Amms, Address, NetworkIndex, FactoryIndex, AddressIndex, NetworkFactoryIndex, LendingPoolIndex, AmmIndex, DistributorDetails, ProposalState, WhitelistState, VaultListOrderBy, VaultListParams, LendingPoolListOrderBy, LendingPoolListParams, SortDirection, LendingPoolVersion, PositionType, AccountPosition, PermitType, Permits, Permit, Borrowable, OnchainInteractionsLendingPoolV3, OnchainInteractionsNftlpUniswapV3, decimalToBalance };
package/lib/index.js CHANGED
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.OnchainInteractionsLendingVault = exports.OnchainInteractionsBorrowable = exports.OnchainInteractionsCollateral = exports.OnchainInteractionsPoolToken = exports.OnchainInteractionsLendingPool = exports.OnchainInteractions = exports.OnchainImpermaxFactory = exports.OnchainContractsHelper = exports.OnchainAccountLendingVault = exports.OnchainAccountCollateral = exports.OnchainAccountBorrowable = exports.OnchainAccountPoolToken = exports.OnchainAccountLendingPool = exports.OnchainAccount = exports.OnchainPairConfig = exports.OnchainProposal = exports.OnchainConfigManager = exports.OnchainLendingVault = exports.OnchainCollateral = exports.OnchainBorrowable = exports.OnchainPoolToken = exports.OnchainLendingPool = exports.Onchain = exports.onchain = exports.VaultType = exports.VaultRisk = exports.OffchainSolidexHelper = exports.OffchainPriceHelper = exports.OffchainAccountVault = exports.OffchainLeveragedPosition = exports.OffchainAccountBorrowable = exports.OffchainAccountCollateral = exports.OffchainAccountPoolToken = exports.OffchainAccountLendingPool = exports.OffchainAccount = exports.OffchainMultichainAccount = exports.OffchainProposal = exports.OffchainPairConfig = exports.OffchainConfigManager = exports.OffchainHedgedVault = exports.OffchainLendingVault = exports.OffchainLeveragedVault = exports.OffchainVault = exports.OffchainBorrowable = exports.OffchainCollateral = exports.OffchainPoolToken = exports.OffchainLendingPool = exports.Offchain = exports.OffchainMultichain = exports.offchain = void 0;
27
27
  exports.Amms = exports.PoolTokenType = exports.Extension = exports.Factory = exports.Networks = exports.XIMX_SUBGRAPH_URL = exports.BLOCKS_SUBGRAPH_URL = exports.IMPERMAX_CHEF_SUBGRAPH_URL = exports.IMPERMAX_SUBGRAPH_URL = exports.APPROVE_AMOUNT = exports.ZERO = exports.DEADLINE = exports.NOT_SYNCED = exports.getFarmByStakedLPFactory = exports.STAKED_LP_FACTORY = exports.hrFarms = exports.Farms = exports.V2_FACTORIES = exports.LIQUIDATION_FEE_FACTORIES = exports.OLD_KINK_MULTIPLIER_FACTORIES = exports.BORROW_FEE_FACTORIES = exports.SOLIDEX_FACTORIES = exports.ETH_NAME = exports.ETH_SYMBOL = exports.DEBANK_IDS = exports.AMM_LP_FEE = exports.ADD_LIQUIDITY_URLS = exports.AMM_SUBGRAPH_URLS = exports.getAmmByFactory = exports.AMM_FACTORY = exports.hrAmms = exports.MERKLE_URL_IBEX_2 = exports.MERKLE_URL_IBEX = exports.MERKLE_URL_ETH = exports.WETH = exports.SIMPLE_UNISWAP_ORACLE = exports.ROUTER = exports.MERKLE_DISTRIBUTOR_ETH = exports.MERKLE_DISTRIBUTOR_IBEX_2 = exports.MERKLE_DISTRIBUTOR_IBEX = exports.LENDING_VAULT_WATCHER = exports.getFactoryByAddress = exports.getNetworkFactories = exports.IMPERMAX_FACTORY = exports.IMX = exports.IMPERMAX_CHEF = exports.CLAIM_AGGREGATOR = exports.NO_CHANGES = exports.ApprovalType = exports.OnchainInteractionsConfigManager = void 0;
28
- exports.OnchainInteractionsNftlpUniswapV3 = exports.OnchainInteractionsLendingPoolV3 = exports.Borrowable = exports.PermitType = exports.PositionType = exports.LendingPoolVersion = exports.SortDirection = exports.LendingPoolListOrderBy = exports.VaultListOrderBy = exports.WhitelistState = exports.ProposalState = void 0;
28
+ exports.decimalToBalance = exports.OnchainInteractionsNftlpUniswapV3 = exports.OnchainInteractionsLendingPoolV3 = exports.Borrowable = exports.PermitType = exports.PositionType = exports.LendingPoolVersion = exports.SortDirection = exports.LendingPoolListOrderBy = exports.VaultListOrderBy = exports.WhitelistState = exports.ProposalState = void 0;
29
29
  const offchain_1 = __importStar(require("./offchain"));
30
30
  exports.Offchain = offchain_1.default;
31
31
  Object.defineProperty(exports, "OffchainAccount", { enumerable: true, get: function () { return offchain_1.OffchainAccount; } });
@@ -178,3 +178,6 @@ Object.defineProperty(exports, "PositionType", { enumerable: true, get: function
178
178
  // Nftlp
179
179
  const nftlp_1 = require("./onchain/interactions/lendingPool/nftlp");
180
180
  Object.defineProperty(exports, "OnchainInteractionsNftlpUniswapV3", { enumerable: true, get: function () { return nftlp_1.OnchainInteractionsNftlpUniswapV3; } });
181
+ // Utils
182
+ const ether_utils_1 = require("./utils/ether-utils");
183
+ Object.defineProperty(exports, "decimalToBalance", { enumerable: true, get: function () { return ether_utils_1.decimalToBalance; } });
@@ -49,7 +49,9 @@ class OnchainInteractionsNftlpUniswapV3 extends onchainInteractionsNftlp_1.defau
49
49
  priceB = yield this.getNftlp().nearestUsableTickPrice(priceB, fee);
50
50
  const result = yield this._getUpdatePositionActions(-1, yield this.getAccountNftlp().createNewPositionObject(fee, priceA, priceB), depositADelta, depositBDelta, borrowADelta, borrowBDelta);
51
51
  // TODO check fee and ticks encoding
52
- result.actions.unshift(yield actionsGetter.methods.getMintUniV3EmptyAction((fee * 10000).toString(), (yield this.getNftlp().priceToTick(priceA, fee)).toString(), (yield this.getNftlp().priceToTick(priceB, fee)).toString()).call());
52
+ result.actions.unshift(yield actionsGetter.methods.getMintUniV3EmptyAction(
53
+ // Convert fee to percentage then to univ3 possible fee (ie. 0.0030 => 3000)
54
+ (fee * 100 * 10000).toString(), (yield this.getNftlp().priceToTick(priceA, fee)).toString(), (yield this.getNftlp().priceToTick(priceB, fee)).toString()).call());
53
55
  return result;
54
56
  });
55
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.113",
3
+ "version": "2.1.115",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",