impermax-sdk 2.1.4 → 2.1.6

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.
Files changed (31) hide show
  1. package/lib/config/subgraphs.d.ts +2 -2
  2. package/lib/config/subgraphs.js +40 -23
  3. package/lib/config/types.d.ts +10 -0
  4. package/lib/config/types.js +7 -1
  5. package/lib/index.d.ts +4 -2
  6. package/lib/index.js +10 -2
  7. package/lib/offchain/account/offchainAccount.d.ts +6 -6
  8. package/lib/offchain/account/offchainAccount.js +33 -24
  9. package/lib/offchain/account/vault/offchainAccountVault.js +10 -3
  10. package/lib/offchain/index.d.ts +2 -1
  11. package/lib/offchain/index.js +3 -1
  12. package/lib/offchain/offchain.d.ts +13 -10
  13. package/lib/offchain/offchain.js +18 -11
  14. package/lib/offchain/offchainInitializer.d.ts +11 -11
  15. package/lib/offchain/offchainInitializer.js +151 -89
  16. package/lib/offchain/offchainMultichain.d.ts +8 -3
  17. package/lib/offchain/offchainMultichain.js +40 -4
  18. package/lib/offchain/offchainTypes.d.ts +9 -1
  19. package/lib/offchain/queries/apis/ponder/index.d.ts +3 -3
  20. package/lib/offchain/queries/apis/ponder/index.js +4 -2
  21. package/lib/offchain/queries/apis/thegraph/index.d.ts +3 -3
  22. package/lib/offchain/queries/apis/thegraph/index.js +4 -2
  23. package/lib/offchain/queries/interfaces/query-builder.d.ts +3 -3
  24. package/lib/offchain/vault/offchainHedgedVault.js +2 -25
  25. package/lib/offchain/vault/offchainLendingVault.js +6 -25
  26. package/lib/offchain/vault/offchainLeveragedVault.js +2 -25
  27. package/lib/offchain/vault/offchainVault.d.ts +16 -5
  28. package/lib/offchain/vault/offchainVault.js +18 -8
  29. package/lib/onchain/account/onchainAccountLendingVault.js +1 -1
  30. package/lib/onchain/onchainLendingVault.js +1 -1
  31. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { Address, NetworkFactoryIndex, NetworkIndex } from './types';
1
+ import { Address, NetworkFactoryIndex, NetworkIndex, NetworkVaultTypeIndex } from './types';
2
2
  export declare const IMPERMAX_SUBGRAPH_URL: NetworkFactoryIndex<Address[]>;
3
+ export declare const VAULT_SUBGRAPH_URL: NetworkVaultTypeIndex<Address[]>;
3
4
  export declare const IMPERMAX_CHEF_SUBGRAPH_URL: NetworkIndex<string>;
4
- export declare const LENDING_VAULT_SUBGRAPH_URL: NetworkIndex<string>;
5
5
  export declare const BLOCKS_SUBGRAPH_URL: NetworkIndex<string>;
6
6
  export declare const XIMX_SUBGRAPH_URL = "https://api.thegraph.com/subgraphs/name/impermax-finance/imx-staking";
7
7
  export declare const CONFIG_MANAGER_SUBGRAPH_URL: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WHITELIST_SUBGRAPH_URL = exports.CONFIG_MANAGER_SUBGRAPH_URL = exports.XIMX_SUBGRAPH_URL = exports.BLOCKS_SUBGRAPH_URL = exports.LENDING_VAULT_SUBGRAPH_URL = exports.IMPERMAX_CHEF_SUBGRAPH_URL = exports.IMPERMAX_SUBGRAPH_URL = void 0;
3
+ exports.WHITELIST_SUBGRAPH_URL = exports.CONFIG_MANAGER_SUBGRAPH_URL = exports.XIMX_SUBGRAPH_URL = exports.BLOCKS_SUBGRAPH_URL = exports.IMPERMAX_CHEF_SUBGRAPH_URL = exports.VAULT_SUBGRAPH_URL = exports.IMPERMAX_SUBGRAPH_URL = void 0;
4
4
  const types_1 = require("./types");
5
5
  exports.IMPERMAX_SUBGRAPH_URL = {
6
6
  [types_1.Networks.Ropsten]: {},
@@ -78,6 +78,45 @@ exports.IMPERMAX_SUBGRAPH_URL = {
78
78
  [types_1.Factory.SOLV2]: ['https://api.goldsky.com/api/public/project_cm2rhb30ot9wu01to8c9h9e37/subgraphs/impermax-real-solv2/3.0/gn']
79
79
  },
80
80
  };
81
+ // TODO: Since these are part of core we should add redundancy like above, left arrays to fill
82
+ exports.VAULT_SUBGRAPH_URL = {
83
+ [types_1.Networks.Ropsten]: {},
84
+ [types_1.Networks.Mainnet]: {},
85
+ [types_1.Networks.Polygon]: {
86
+ [types_1.VaultType.LENDING]: ['https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BNWJQpKBT24mYzLYZ7hdBiJpvfBoEwjSemNkQ1Rryknp'],
87
+ [types_1.VaultType.HEDGED]: [],
88
+ [types_1.VaultType.LEVERAGED]: []
89
+ },
90
+ [types_1.Networks.Arbitrum]: {
91
+ [types_1.VaultType.LENDING]: ['https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BhmcL1CZmw9hftXPviiTeMY7kghbbkpHZtpiHXWVhNNN'],
92
+ [types_1.VaultType.HEDGED]: [],
93
+ [types_1.VaultType.LEVERAGED]: []
94
+ },
95
+ [types_1.Networks.Avalanche]: {},
96
+ [types_1.Networks.Moonriver]: {},
97
+ [types_1.Networks.Aurora]: {},
98
+ [types_1.Networks.Cronos]: {},
99
+ [types_1.Networks.Fantom]: {},
100
+ [types_1.Networks.Harmony]: {},
101
+ [types_1.Networks.Moonbeam]: {},
102
+ [types_1.Networks.Sxnetwork]: {},
103
+ [types_1.Networks.Canto]: {},
104
+ [types_1.Networks.ZksyncEra]: {},
105
+ [types_1.Networks.Base]: {
106
+ [types_1.VaultType.LENDING]: ['https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/2TdbQKGWPRHUwuHJgxQzh8kZ7FVpBgZaFtnbjTS6iYng'],
107
+ [types_1.VaultType.HEDGED]: [],
108
+ [types_1.VaultType.LEVERAGED]: []
109
+ },
110
+ [types_1.Networks.Mantle]: {},
111
+ [types_1.Networks.Scroll]: {
112
+ [types_1.VaultType.LENDING]: ['https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BaPMX2ubiRZ4ujqTFmWyrk72fPo6yFLQ7A5Z4BLXCTFU'],
113
+ [types_1.VaultType.HEDGED]: [],
114
+ [types_1.VaultType.LEVERAGED]: []
115
+ },
116
+ [types_1.Networks.Optimism]: {},
117
+ [types_1.Networks.Real]: {},
118
+ [types_1.Networks.Blast]: {},
119
+ };
81
120
  exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
82
121
  [types_1.Networks.Ropsten]: '',
83
122
  [types_1.Networks.Mainnet]: '',
@@ -101,28 +140,6 @@ exports.IMPERMAX_CHEF_SUBGRAPH_URL = {
101
140
  [types_1.Networks.Optimism]: '',
102
141
  [types_1.Networks.Real]: '',
103
142
  };
104
- exports.LENDING_VAULT_SUBGRAPH_URL = {
105
- [types_1.Networks.Ropsten]: '',
106
- [types_1.Networks.Mainnet]: '',
107
- [types_1.Networks.Polygon]: 'https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BNWJQpKBT24mYzLYZ7hdBiJpvfBoEwjSemNkQ1Rryknp',
108
- [types_1.Networks.Arbitrum]: 'https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BhmcL1CZmw9hftXPviiTeMY7kghbbkpHZtpiHXWVhNNN',
109
- [types_1.Networks.Avalanche]: '',
110
- [types_1.Networks.Moonriver]: '',
111
- [types_1.Networks.Fantom]: '',
112
- [types_1.Networks.Aurora]: '',
113
- [types_1.Networks.Cronos]: '',
114
- [types_1.Networks.Harmony]: '',
115
- [types_1.Networks.Moonbeam]: '',
116
- [types_1.Networks.Sxnetwork]: '',
117
- [types_1.Networks.Canto]: '',
118
- [types_1.Networks.ZksyncEra]: '',
119
- [types_1.Networks.Blast]: '',
120
- [types_1.Networks.Base]: 'https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/2TdbQKGWPRHUwuHJgxQzh8kZ7FVpBgZaFtnbjTS6iYng',
121
- [types_1.Networks.Mantle]: '',
122
- [types_1.Networks.Optimism]: '',
123
- [types_1.Networks.Real]: '',
124
- [types_1.Networks.Scroll]: 'https://gateway.thegraph.com/api/1350441d268f171aeb0934412dfadf3b/subgraphs/id/BaPMX2ubiRZ4ujqTFmWyrk72fPo6yFLQ7A5Z4BLXCTFU',
125
- };
126
143
  exports.BLOCKS_SUBGRAPH_URL = {
127
144
  [types_1.Networks.Ropsten]: '',
128
145
  [types_1.Networks.Mainnet]: 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks',
@@ -83,3 +83,13 @@ export declare enum WhitelistState {
83
83
  Deprecated = 2,
84
84
  Blacklisted = 3
85
85
  }
86
+ export declare enum VaultType {
87
+ LENDING = "Lending",
88
+ HEDGED = "Hedged",
89
+ LEVERAGED = "Leverage"
90
+ }
91
+ export type NetworkVaultTypeIndex<Type> = {
92
+ [key in Networks]: {
93
+ [key in VaultType]?: Type;
94
+ };
95
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WhitelistState = exports.ProposalState = exports.Borrowable = exports.PoolTokenType = exports.Extension = exports.Factory = exports.Networks = void 0;
3
+ exports.VaultType = exports.WhitelistState = exports.ProposalState = exports.Borrowable = exports.PoolTokenType = exports.Extension = exports.Factory = exports.Networks = void 0;
4
4
  var Networks;
5
5
  (function (Networks) {
6
6
  Networks["Ropsten"] = "ropsten";
@@ -70,3 +70,9 @@ var WhitelistState;
70
70
  WhitelistState[WhitelistState["Blacklisted"] = 3] = "Blacklisted";
71
71
  })(WhitelistState = exports.WhitelistState || (exports.WhitelistState = {}));
72
72
  ;
73
+ var VaultType;
74
+ (function (VaultType) {
75
+ VaultType["LENDING"] = "Lending";
76
+ VaultType["HEDGED"] = "Hedged";
77
+ VaultType["LEVERAGED"] = "Leverage";
78
+ })(VaultType = exports.VaultType || (exports.VaultType = {}));
package/lib/index.d.ts CHANGED
@@ -18,7 +18,7 @@ import { BORROW_FEE_FACTORIES, LIQUIDATION_FEE_FACTORIES, OLD_KINK_MULTIPLIER_FA
18
18
  import { FarmIndex, Farms, getFarmByStakedLPFactory, hrFarms, STAKED_LP_FACTORY } from './config/farms';
19
19
  import { APPROVE_AMOUNT, DEADLINE, NOT_SYNCED, ZERO } from './config/general';
20
20
  import { BLOCKS_SUBGRAPH_URL, IMPERMAX_CHEF_SUBGRAPH_URL, IMPERMAX_SUBGRAPH_URL, XIMX_SUBGRAPH_URL } from './config/subgraphs';
21
- import { Address, AddressIndex, AmmIndex, DistributorDetails, Factory, FactoryIndex, LendingPoolIndex, NetworkFactoryIndex, NetworkIndex, Networks, PoolTokenType, ProposalState, WhitelistState } from './config/types';
21
+ import { Address, AddressIndex, AmmIndex, DistributorDetails, Factory, FactoryIndex, LendingPoolIndex, NetworkFactoryIndex, NetworkIndex, Networks, PoolTokenType, ProposalState, WhitelistState, VaultType } from './config/types';
22
22
  import { AirdropData, ApprovalType, Changes, Contract, OnchainConfig, NO_CHANGES, PendingRewardUI, PermitData, Values, CollateralConfig, BorrowableConfig, PairConfig } from './onchain/onchainTypes';
23
23
  import { BorrowableData, BorrowablePastData, BorrowPosition, CollateralData, CollateralPosition, FarmingPoolData, LendingPoolData, LendingPoolPastData, PairData, PoolTokenData, RewardData, SupplyPosition, TokenData, TvlData, UserData, XimxData, LendingVaultData, VaultPosition, PairConfigData, ProposalData, ProposalMetadata } from './offchain/offchainTypes';
24
24
  import { OffchainBorrowable, OffchainCollateral } from './offchain/lendingPool';
@@ -33,4 +33,6 @@ import { OnchainInteractionsLendingPool, OnchainInteractionsLendingVault, Onchai
33
33
  import { OnchainInteractionsBorrowable, OnchainInteractionsCollateral } from './onchain/interactions/lendingPool';
34
34
  import { LENDING_VAULT_WATCHER } from './config/contracts/lending-vault-watcher';
35
35
  import OffchainVault, { OffchainLendingVault, OffchainLeveragedVault, OffchainHedgedVault } from './offchain/vault';
36
- 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, 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, 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, PoolTokenType, Amms, Address, NetworkIndex, FactoryIndex, AddressIndex, NetworkFactoryIndex, LendingPoolIndex, AmmIndex, DistributorDetails, ProposalState, WhitelistState, };
36
+ import { SortDirection, VaultOrderBy, VaultListParams } from "./offchain/offchainMultichain";
37
+ import { VaultRisk } from "./offchain/vault/offchainVault";
38
+ 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, 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, PoolTokenType, Amms, Address, NetworkIndex, FactoryIndex, AddressIndex, NetworkFactoryIndex, LendingPoolIndex, AmmIndex, DistributorDetails, ProposalState, WhitelistState, VaultOrderBy, VaultListParams, SortDirection };
package/lib/index.js CHANGED
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ApprovalType = exports.OnchainInteractionsConfigManager = 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.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
- exports.WhitelistState = exports.ProposalState = exports.Amms = exports.PoolTokenType = 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.getNetworkFactories = exports.IMPERMAX_FACTORY = exports.IMX = exports.IMPERMAX_CHEF = exports.CLAIM_AGGREGATOR = exports.NO_CHANGES = void 0;
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
+ exports.WhitelistState = exports.ProposalState = exports.Amms = exports.PoolTokenType = 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.getNetworkFactories = exports.IMPERMAX_FACTORY = exports.IMX = exports.IMPERMAX_CHEF = exports.CLAIM_AGGREGATOR = exports.NO_CHANGES = exports.ApprovalType = exports.OnchainInteractionsConfigManager = void 0;
28
+ exports.SortDirection = exports.VaultOrderBy = void 0;
28
29
  const offchain_1 = __importStar(require("./offchain"));
29
30
  exports.Offchain = offchain_1.default;
30
31
  Object.defineProperty(exports, "OffchainAccount", { enumerable: true, get: function () { return offchain_1.OffchainAccount; } });
@@ -108,6 +109,7 @@ Object.defineProperty(exports, "Networks", { enumerable: true, get: function ()
108
109
  Object.defineProperty(exports, "PoolTokenType", { enumerable: true, get: function () { return types_1.PoolTokenType; } });
109
110
  Object.defineProperty(exports, "ProposalState", { enumerable: true, get: function () { return types_1.ProposalState; } });
110
111
  Object.defineProperty(exports, "WhitelistState", { enumerable: true, get: function () { return types_1.WhitelistState; } });
112
+ Object.defineProperty(exports, "VaultType", { enumerable: true, get: function () { return types_1.VaultType; } });
111
113
  const onchainTypes_1 = require("./onchain/onchainTypes");
112
114
  Object.defineProperty(exports, "ApprovalType", { enumerable: true, get: function () { return onchainTypes_1.ApprovalType; } });
113
115
  Object.defineProperty(exports, "NO_CHANGES", { enumerable: true, get: function () { return onchainTypes_1.NO_CHANGES; } });
@@ -157,3 +159,9 @@ exports.OffchainVault = vault_1.default;
157
159
  Object.defineProperty(exports, "OffchainLendingVault", { enumerable: true, get: function () { return vault_1.OffchainLendingVault; } });
158
160
  Object.defineProperty(exports, "OffchainLeveragedVault", { enumerable: true, get: function () { return vault_1.OffchainLeveragedVault; } });
159
161
  Object.defineProperty(exports, "OffchainHedgedVault", { enumerable: true, get: function () { return vault_1.OffchainHedgedVault; } });
162
+ // Data helpers (sort, filter)
163
+ const offchainMultichain_1 = require("./offchain/offchainMultichain");
164
+ Object.defineProperty(exports, "SortDirection", { enumerable: true, get: function () { return offchainMultichain_1.SortDirection; } });
165
+ Object.defineProperty(exports, "VaultOrderBy", { enumerable: true, get: function () { return offchainMultichain_1.VaultOrderBy; } });
166
+ const offchainVault_1 = require("./offchain/vault/offchainVault");
167
+ Object.defineProperty(exports, "VaultRisk", { enumerable: true, get: function () { return offchainVault_1.VaultRisk; } });
@@ -13,13 +13,13 @@ export default class OffchainAccount {
13
13
  getAccountAddress: () => string;
14
14
  private initializeLendingPool;
15
15
  getLendingPool(factory: Factory, pair: Address): Promise<OffchainAccountLendingPool>;
16
- private initializeLendingVault;
17
- getLendingVault(vaultAddress: Address): Promise<OffchainAccountVault>;
16
+ private initializeVault;
17
+ getVault(vaultAddress: Address): Promise<OffchainAccountVault>;
18
18
  getUserData(): Promise<FactoryIndex<UserData> | null>;
19
- getLendingVaultsUserData(): Promise<AddressIndex<VaultPosition> | null>;
19
+ getVaultsUserData(): Promise<AddressIndex<AddressIndex<VaultPosition>>>;
20
20
  getBorrowPositions(): Promise<FactoryIndex<Address[]>>;
21
21
  getSupplyPositions(): Promise<FactoryIndex<Address[]>>;
22
- getLendingVaultsSuppliedUSD(): Promise<number>;
23
- getLendingVaultsEarningsUSD(): Promise<number>;
24
- getLendingVaultsYearlyYieldUSD(): Promise<number>;
22
+ getVaultsSuppliedUSD(): Promise<number>;
23
+ getVaultsEarningsUSD(): Promise<number>;
24
+ getVaultsYearlyYieldUSD(): Promise<number>;
25
25
  }
@@ -39,16 +39,16 @@ class OffchainAccount {
39
39
  return lendingPoolsOfFactory[pair];
40
40
  });
41
41
  }
42
- initializeLendingVault(vaultAddress) {
42
+ initializeVault(vaultAddress) {
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
- const lendingVault = yield this.offchain.getLendingVault(vaultAddress);
44
+ const lendingVault = yield this.offchain.getVault(vaultAddress);
45
45
  return new offchainAccountVault_1.default(this, lendingVault);
46
46
  });
47
47
  }
48
- getLendingVault(vaultAddress) {
48
+ getVault(vaultAddress) {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
50
  if (!this.vaults[vaultAddress])
51
- this.vaults[vaultAddress] = this.initializeLendingVault(vaultAddress);
51
+ this.vaults[vaultAddress] = this.initializeVault(vaultAddress);
52
52
  return this.vaults[vaultAddress];
53
53
  });
54
54
  }
@@ -57,9 +57,9 @@ class OffchainAccount {
57
57
  return this.offchain.getUserData(this.accountAddress);
58
58
  });
59
59
  }
60
- getLendingVaultsUserData() {
60
+ getVaultsUserData() {
61
61
  return __awaiter(this, void 0, void 0, function* () {
62
- return this.offchain.getLendingVaultsUserData(this.accountAddress);
62
+ return this.offchain.getVaultsUserData(this.accountAddress);
63
63
  });
64
64
  }
65
65
  getBorrowPositions() {
@@ -86,41 +86,50 @@ class OffchainAccount {
86
86
  return result;
87
87
  });
88
88
  }
89
- getLendingVaultsSuppliedUSD() {
89
+ getVaultsSuppliedUSD() {
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
91
  let suppliedUSD = 0;
92
- const lendingVaultUserData = yield this.getLendingVaultsUserData();
93
- if (lendingVaultUserData === null)
92
+ const vaultsUserData = yield this.getVaultsUserData();
93
+ if (!vaultsUserData)
94
94
  return 0;
95
- for (const address in lendingVaultUserData) {
96
- const lendingVault = yield this.getLendingVault(address);
97
- suppliedUSD += yield lendingVault.getValue();
95
+ for (const vaultType in vaultsUserData) {
96
+ const vaultsOfType = vaultsUserData[vaultType];
97
+ for (const address in vaultsOfType) {
98
+ const vault = yield this.getVault(address);
99
+ suppliedUSD += yield vault.getValue();
100
+ }
98
101
  }
99
102
  return suppliedUSD;
100
103
  });
101
104
  }
102
- getLendingVaultsEarningsUSD() {
105
+ getVaultsEarningsUSD() {
103
106
  return __awaiter(this, void 0, void 0, function* () {
104
107
  let earningsUSD = 0;
105
- const lendingVaultUserData = yield this.getLendingVaultsUserData();
106
- if (lendingVaultUserData === null)
108
+ const vaultsUserData = yield this.getVaultsUserData();
109
+ if (!vaultsUserData)
107
110
  return 0;
108
- for (const address in lendingVaultUserData) {
109
- const lendingVault = yield this.getLendingVault(address);
110
- earningsUSD += yield lendingVault.getEarningsUSD();
111
+ for (const vaultType in vaultsUserData) {
112
+ const vaultsOfType = vaultsUserData[vaultType];
113
+ for (const address in vaultsOfType) {
114
+ const vault = yield this.getVault(address);
115
+ earningsUSD += yield vault.getEarningsUSD();
116
+ }
111
117
  }
112
118
  return earningsUSD;
113
119
  });
114
120
  }
115
- getLendingVaultsYearlyYieldUSD() {
121
+ getVaultsYearlyYieldUSD() {
116
122
  return __awaiter(this, void 0, void 0, function* () {
117
123
  let yieldUSD = 0;
118
- const lendingVaultUserData = yield this.getLendingVaultsUserData();
119
- if (lendingVaultUserData === null)
124
+ const vaultsUserData = yield this.getVaultsUserData();
125
+ if (!vaultsUserData)
120
126
  return 0;
121
- for (const address in lendingVaultUserData) {
122
- const lendingVault = yield this.getLendingVault(address);
123
- yieldUSD += (yield lendingVault.getValue()) * (yield lendingVault.getPoolToken().getSupplyAPR());
127
+ for (const vaultType in vaultsUserData) {
128
+ const vaultsOfType = vaultsUserData[vaultType];
129
+ for (const address in vaultsOfType) {
130
+ const vault = yield this.getVault(address);
131
+ yieldUSD += (yield vault.getValue()) * (yield vault.getPoolToken().getSupplyAPR());
132
+ }
124
133
  }
125
134
  return yieldUSD;
126
135
  });
@@ -24,10 +24,17 @@ class OffchainAccountVault extends offchainAccountPoolToken_1.default {
24
24
  }
25
25
  getVaultPosition() {
26
26
  return __awaiter(this, void 0, void 0, function* () {
27
- const lendingVaultsUserData = yield this.account.getLendingVaultsUserData();
28
- if (!lendingVaultsUserData)
27
+ const vaultsUserData = yield this.account.getVaultsUserData();
28
+ if (!vaultsUserData)
29
29
  return undefined;
30
- return lendingVaultsUserData[this.getVaultAddress()];
30
+ // Look through each vault type
31
+ for (const vaultType in vaultsUserData) {
32
+ const vaultsOfType = vaultsUserData[vaultType];
33
+ const position = vaultsOfType[this.getVaultAddress()];
34
+ if (position)
35
+ return position;
36
+ }
37
+ return undefined;
31
38
  });
32
39
  }
33
40
  getAmount() {
@@ -11,5 +11,6 @@ import OffchainPoolToken from "./offchainPoolToken";
11
11
  import Offchain from './offchain';
12
12
  import OffchainConfigManager from "./configManager";
13
13
  import OffchainMultichain from "./offchainMultichain";
14
- export { account, lendingPool, vault, configManager, OffchainMultichain, OffchainAccount, OffchainLendingPool, OffchainConfigManager, OffchainPoolToken, OffchainSolidexHelper, OffchainPriceHelper, OffchainAPRHelper };
14
+ import * as offchainMultichain from "./offchainMultichain";
15
+ export { account, lendingPool, vault, configManager, offchainMultichain, OffchainMultichain, OffchainAccount, OffchainLendingPool, OffchainConfigManager, OffchainPoolToken, OffchainSolidexHelper, OffchainPriceHelper, OffchainAPRHelper };
15
16
  export default Offchain;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.OffchainAPRHelper = exports.OffchainPriceHelper = exports.OffchainSolidexHelper = exports.OffchainPoolToken = exports.OffchainConfigManager = exports.OffchainLendingPool = exports.OffchainAccount = exports.OffchainMultichain = exports.configManager = exports.vault = exports.lendingPool = exports.account = void 0;
29
+ exports.OffchainAPRHelper = exports.OffchainPriceHelper = exports.OffchainSolidexHelper = exports.OffchainPoolToken = exports.OffchainConfigManager = exports.OffchainLendingPool = exports.OffchainAccount = exports.OffchainMultichain = exports.offchainMultichain = exports.configManager = exports.vault = exports.lendingPool = exports.account = void 0;
30
30
  const lendingPool_1 = __importDefault(require("./lendingPool"));
31
31
  exports.OffchainLendingPool = lendingPool_1.default;
32
32
  const lendingPool = __importStar(require("./lendingPool"));
@@ -52,4 +52,6 @@ const configManager_1 = __importDefault(require("./configManager"));
52
52
  exports.OffchainConfigManager = configManager_1.default;
53
53
  const offchainMultichain_1 = __importDefault(require("./offchainMultichain"));
54
54
  exports.OffchainMultichain = offchainMultichain_1.default;
55
+ const offchainMultichain = __importStar(require("./offchainMultichain"));
56
+ exports.offchainMultichain = offchainMultichain;
55
57
  exports.default = offchain_1.default;
@@ -6,7 +6,7 @@ import OffchainSolidexHelper from "./offchainSolidexHelper";
6
6
  import OffchainAccount from "./account";
7
7
  import OffchainEndpointManager from './offchainEndpointManager';
8
8
  import { Address, AddressIndex, Factory, FactoryIndex, LendingPoolIndex, Networks, WhitelistState } from '../config/types';
9
- import { LendingPoolData, LendingVaultData, VaultPosition, TvlData, UserData, XimxData } from './offchainTypes';
9
+ import { LendingPoolData, VaultData, VaultPosition, TvlData, UserData, XimxData } from './offchainTypes';
10
10
  import OffchainVault from './vault/offchainVault';
11
11
  import OffchainConfigManager from './configManager';
12
12
  import { LlamaTvlChart } from './offchainAPRHelper';
@@ -32,7 +32,7 @@ export default class Offchain {
32
32
  protected usersData: {
33
33
  [key in Address]?: Promise<FactoryIndex<UserData> | null>;
34
34
  };
35
- protected lendingVaultsData: Promise<AddressIndex<LendingVaultData>> | null;
35
+ protected vaultsData: Promise<AddressIndex<VaultData>> | null;
36
36
  protected lendingVaultsUsersData: {
37
37
  [key in Address]?: Promise<AddressIndex<VaultPosition> | null>;
38
38
  };
@@ -40,10 +40,13 @@ export default class Offchain {
40
40
  protected ximxData: Promise<XimxData> | null;
41
41
  protected whitelistData: Promise<LendingPoolIndex<WhitelistState>> | null;
42
42
  protected endpointManager: OffchainEndpointManager;
43
+ protected vaultsUsersData: {
44
+ [key in Address]?: Promise<AddressIndex<AddressIndex<VaultPosition>>>;
45
+ };
43
46
  constructor(offchainMultichain: OffchainMultichain, network: Networks);
44
47
  cleanCache(): void;
45
48
  getLendingPool(factory: Factory, pairAddress: Address): Promise<OffchainLendingPool>;
46
- getLendingVault(vaultAddress: Address): Promise<OffchainVault>;
49
+ getVault(vaultAddress: Address): Promise<OffchainVault>;
47
50
  getAccount(accountAddress: Address): OffchainAccount;
48
51
  getPriceHelper: () => OffchainPriceHelper;
49
52
  getSolidexHelper: () => OffchainSolidexHelper;
@@ -67,17 +70,17 @@ export default class Offchain {
67
70
  getUserData: typeof initializer.getUserData;
68
71
  protected initializeXimxData: typeof initializer.initializeXimxData;
69
72
  getXimxData: typeof initializer.getXimxData;
70
- protected fetchLendingVaults: typeof initializer.fetchLendingVaults;
71
- protected initializeLendingVaultsData: typeof initializer.initializeLendingVaultsData;
72
- getLendingVaultsData: typeof initializer.getLendingVaultsData;
73
- getLendingVaultData: typeof initializer.getLendingVaultData;
74
- protected fetchLendingVaultsUserData: typeof initializer.fetchLendingVaultsUserData;
75
- protected initializeLendingVaultsUserData: typeof initializer.initializeLendingVaultsUserData;
76
- getLendingVaultsUserData: typeof initializer.getLendingVaultsUserData;
73
+ getVaultsUserData: typeof initializer.getVaultsUserData;
77
74
  protected fetchWhitelist: typeof initializer.fetchWhitelist;
78
75
  protected initializeWhitelistData: typeof initializer.initializeWhitelistData;
79
76
  getWhitelistData: typeof initializer.getWhitelistData;
80
77
  getWhitelistState: typeof initializer.getWhitelistState;
78
+ protected fetchVaults: typeof initializer.fetchVaults;
79
+ protected initializeVaultsData: typeof initializer.initializeVaultsData;
80
+ getVaultsData: typeof initializer.getVaultsData;
81
+ getVaultData: typeof initializer.getVaultData;
82
+ protected fetchVaultsUserData: typeof initializer.fetchVaultsUserData;
83
+ protected initializeVaultsUserData: typeof initializer.initializeVaultsUserData;
81
84
  /**
82
85
  * DATA GETTERS
83
86
  */
@@ -71,17 +71,23 @@ class Offchain {
71
71
  this.getUserData = initializer.getUserData;
72
72
  this.initializeXimxData = initializer.initializeXimxData;
73
73
  this.getXimxData = initializer.getXimxData;
74
- this.fetchLendingVaults = initializer.fetchLendingVaults;
75
- this.initializeLendingVaultsData = initializer.initializeLendingVaultsData;
76
- this.getLendingVaultsData = initializer.getLendingVaultsData;
77
- this.getLendingVaultData = initializer.getLendingVaultData;
78
- this.fetchLendingVaultsUserData = initializer.fetchLendingVaultsUserData;
79
- this.initializeLendingVaultsUserData = initializer.initializeLendingVaultsUserData;
80
- this.getLendingVaultsUserData = initializer.getLendingVaultsUserData;
74
+ // protected initializeLendingVaultsData = initializer.initializeLendingVaultsData;
75
+ // public getLendingVaultsData = initializer.getLendingVaultsData;
76
+ // public getLendingVaultData = initializer.getLendingVaultData;
77
+ // protected fetchLendingVaultsUserData = initializer.fetchLendingVaultsUserData;
78
+ // protected initializeLendingVaultsUserData = initializer.initializeLendingVaultsUserData;
79
+ // public getLendingVaultsUserData = initializer.getLendingVaultsUserData;
80
+ this.getVaultsUserData = initializer.getVaultsUserData;
81
81
  this.fetchWhitelist = initializer.fetchWhitelist;
82
82
  this.initializeWhitelistData = initializer.initializeWhitelistData;
83
83
  this.getWhitelistData = initializer.getWhitelistData;
84
84
  this.getWhitelistState = initializer.getWhitelistState;
85
+ this.fetchVaults = initializer.fetchVaults;
86
+ this.initializeVaultsData = initializer.initializeVaultsData;
87
+ this.getVaultsData = initializer.getVaultsData;
88
+ this.getVaultData = initializer.getVaultData;
89
+ this.fetchVaultsUserData = initializer.fetchVaultsUserData;
90
+ this.initializeVaultsUserData = initializer.initializeVaultsUserData;
85
91
  // TODO fix conflicting lines (commented)
86
92
  //this.network = cfg.network;
87
93
  //this.chainId = cfg.chainId;
@@ -96,12 +102,12 @@ class Offchain {
96
102
  this.endpointManager = new offchainEndpointManager_1.default();
97
103
  this.accounts = {};
98
104
  this.usersData = {};
99
- this.lendingVaultsUsersData = {};
105
+ this.vaultsUsersData = {};
100
106
  }
101
107
  cleanCache() {
102
108
  this.lendingPoolsData = null;
103
109
  this.usersData = {};
104
- this.lendingVaultsData = null;
110
+ this.vaultsData = null;
105
111
  this.lendingVaultsUsersData = {};
106
112
  this.tvlData = null;
107
113
  this.ximxData = null;
@@ -117,9 +123,10 @@ class Offchain {
117
123
  return this.lendingPools[factory][pairAddress];
118
124
  });
119
125
  }
120
- getLendingVault(vaultAddress) {
126
+ // NOTE: We need to update this to return vault based on its type..
127
+ getVault(vaultAddress) {
121
128
  return __awaiter(this, void 0, void 0, function* () {
122
- yield this.getLendingVaultsData(); // make sure that lending vaults are initialized
129
+ yield this.getVaultsData(); // make sure that lending vaults are initialized
123
130
  if (!this.vaults)
124
131
  this.vaults = {};
125
132
  if (!this.vaults[vaultAddress])
@@ -1,11 +1,12 @@
1
1
  import { ApolloQueryResult } from "apollo-client";
2
2
  import { DocumentNode } from "graphql";
3
- import { Address, AddressIndex, Factory, FactoryIndex, LendingPoolIndex, WhitelistState } from '../config/types';
4
- import { Amms } from '../config/amms';
5
- import { LendingPoolData, LendingVaultData, VaultPosition, RawUserData, TvlData, UserData, WhitelistData, XimxData } from './offchainTypes';
6
- import Offchain from './offchain';
3
+ import { Address, AddressIndex, Factory, FactoryIndex, LendingPoolIndex, WhitelistState } from "../config/types";
4
+ import { Amms } from "../config/amms";
5
+ import { LendingPoolData, VaultPosition, RawUserData, TvlData, UserData, WhitelistData, XimxData, VaultData } from "./offchainTypes";
6
+ import Offchain from "./offchain";
7
7
  export declare function apolloFetcher(subgraphUrl: string, query: DocumentNode): Promise<ApolloQueryResult<any>>;
8
8
  export declare function fetchBlockByTimestamp(this: Offchain, timestamp: number): Promise<number | null>;
9
+ export declare function fetchVaults(this: Offchain): Promise<AddressIndex<VaultData[]>>;
9
10
  export declare function fetchLendingPools(this: Offchain): Promise<FactoryIndex<LendingPoolData[]>>;
10
11
  export declare function fetchLendingPoolsPast(this: Offchain, seconds: number): Promise<FactoryIndex<any[]> | null>;
11
12
  export declare function fetchImpermaxChefRewardRates(this: Offchain): Promise<AddressIndex<Array<{
@@ -33,10 +34,9 @@ export declare function getXimxData(this: Offchain): Promise<XimxData>;
33
34
  /**
34
35
  * Lending Vault
35
36
  **/
36
- export declare function fetchLendingVaults(this: Offchain): Promise<LendingVaultData[]>;
37
- export declare function initializeLendingVaultsData(this: Offchain): Promise<AddressIndex<LendingVaultData>>;
38
- export declare function getLendingVaultsData(this: Offchain): Promise<AddressIndex<LendingVaultData>>;
39
- export declare function getLendingVaultData(this: Offchain, lendingVaultAddress: Address): Promise<LendingVaultData>;
37
+ export declare function initializeVaultsData(this: Offchain): Promise<AddressIndex<VaultData>>;
38
+ export declare function getVaultsData(this: Offchain): Promise<AddressIndex<VaultData>>;
39
+ export declare function getVaultData(this: Offchain, vaultAddress: Address): Promise<VaultData>;
40
40
  /**
41
41
  * Whitelist
42
42
  */
@@ -47,6 +47,6 @@ export declare function getWhitelistState(this: Offchain, factory: Factory, pair
47
47
  /**
48
48
  * User Data
49
49
  */
50
- export declare function fetchLendingVaultsUserData(this: Offchain, account: Address): Promise<VaultPosition[] | null>;
51
- export declare function initializeLendingVaultsUserData(this: Offchain, account: Address): Promise<AddressIndex<VaultPosition> | null>;
52
- export declare function getLendingVaultsUserData(this: Offchain, account: Address): Promise<AddressIndex<VaultPosition> | null>;
50
+ export declare function fetchVaultsUserData(this: Offchain, account: Address): Promise<AddressIndex<VaultPosition[]>>;
51
+ export declare function initializeVaultsUserData(this: Offchain, account: Address): Promise<AddressIndex<AddressIndex<VaultPosition>>>;
52
+ export declare function getVaultsUserData(this: Offchain, account: Address): Promise<AddressIndex<AddressIndex<VaultPosition>>>;