impermax-sdk 1.2.0 → 1.2.2
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/config/types.d.ts +4 -0
- package/lib/config/types.js +8 -1
- package/lib/index.d.ts +7 -5
- package/lib/index.js +13 -2
- package/lib/offchain/offchainTypes.d.ts +4 -4
- package/package.json +3 -3
package/lib/config/types.d.ts
CHANGED
package/lib/config/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProposalState = exports.PoolTokenType = exports.Factory = exports.Networks = void 0;
|
|
3
|
+
exports.WhitelistState = exports.ProposalState = exports.PoolTokenType = exports.Factory = exports.Networks = void 0;
|
|
4
4
|
var Networks;
|
|
5
5
|
(function (Networks) {
|
|
6
6
|
Networks["Ropsten"] = "ropsten";
|
|
@@ -41,3 +41,10 @@ var ProposalState;
|
|
|
41
41
|
ProposalState["Approved"] = "Approved";
|
|
42
42
|
ProposalState["Rejected"] = "Rejected";
|
|
43
43
|
})(ProposalState = exports.ProposalState || (exports.ProposalState = {}));
|
|
44
|
+
;
|
|
45
|
+
var WhitelistState;
|
|
46
|
+
(function (WhitelistState) {
|
|
47
|
+
WhitelistState[WhitelistState["True"] = 1] = "True";
|
|
48
|
+
WhitelistState[WhitelistState["False"] = 0] = "False";
|
|
49
|
+
})(WhitelistState = exports.WhitelistState || (exports.WhitelistState = {}));
|
|
50
|
+
;
|
package/lib/index.d.ts
CHANGED
|
@@ -17,16 +17,18 @@ import { BORROW_FEE_FACTORIES, LIQUIDATION_FEE_FACTORIES, OLD_KINK_MULTIPLIER_FA
|
|
|
17
17
|
import { FarmIndex, Farms, getFarmByStakedLPFactory, hrFarms, STAKED_LP_FACTORY } from './config/farms';
|
|
18
18
|
import { APPROVE_AMOUNT, DEADLINE, NOT_SYNCED, ZERO } from './config/general';
|
|
19
19
|
import { BLOCKS_SUBGRAPH_URL, IMPERMAX_CHEF_SUBGRAPH_URL, IMPERMAX_SUBGRAPH_URL, XIMX_SUBGRAPH_URL } from './config/subgraphs';
|
|
20
|
-
import { Address, AddressIndex, AmmIndex, DistributorDetails, Factory, FactoryIndex, LendingPoolIndex, NetworkFactoryIndex, NetworkIndex, Networks, PoolTokenType } from './config/types';
|
|
21
|
-
import { AirdropData, ApprovalType, Changes, Contract, OnchainConfig, NO_CHANGES, PendingRewardUI, PermitData, Values } from './onchain/onchainTypes';
|
|
22
|
-
import { BorrowableData, BorrowablePastData, BorrowPosition, CollateralData, CollateralPosition, FarmingPoolData, LendingPoolData, LendingPoolPastData, PairData, PoolTokenData, RewardData, SupplyPosition, TokenData, TvlData, UserData, XimxData } from './offchain/offchainTypes';
|
|
20
|
+
import { Address, AddressIndex, AmmIndex, DistributorDetails, Factory, FactoryIndex, LendingPoolIndex, NetworkFactoryIndex, NetworkIndex, Networks, PoolTokenType, ProposalState, WhitelistState } from './config/types';
|
|
21
|
+
import { AirdropData, ApprovalType, Changes, Contract, OnchainConfig, NO_CHANGES, PendingRewardUI, PermitData, Values, CollateralConfig, BorrowableConfig, PairConfig } from './onchain/onchainTypes';
|
|
22
|
+
import { BorrowableData, BorrowablePastData, BorrowPosition, CollateralData, CollateralPosition, FarmingPoolData, LendingPoolData, LendingPoolPastData, PairData, PoolTokenData, RewardData, SupplyPosition, TokenData, TvlData, UserData, XimxData, LendingVaultData, LendingVaultPosition, PairConfigData, ProposalData, ProposalMetadata } from './offchain/offchainTypes';
|
|
23
23
|
import { OffchainBorrowable, OffchainCollateral } from './offchain/lendingPool';
|
|
24
|
+
import OffchainConfigManager, { OffchainPairConfig, OffchainProposal } from './offchain/configManager';
|
|
24
25
|
import OffchainAccountLendingPool, { OffchainAccountBorrowable, OffchainAccountCollateral } from './offchain/account/lendingPool';
|
|
25
26
|
import { OffchainAccountLendingVault, OffchainAccountPoolToken } from './offchain/account';
|
|
26
27
|
import OnchainLendingPool, { OnchainBorrowable, OnchainCollateral } from './onchain/impermaxFactory/lendingPool';
|
|
28
|
+
import OnchainConfigManager, { OnchainPairConfig, OnchainProposal } from './onchain/configManager';
|
|
27
29
|
import { OnchainAccountLendingPool, OnchainAccountLendingVault, OnchainAccountPoolToken } from './onchain/account';
|
|
28
30
|
import { OnchainAccountBorrowable, OnchainAccountCollateral } from './onchain/account/lendingPool';
|
|
29
|
-
import { OnchainInteractionsLendingPool, OnchainInteractionsLendingVault, OnchainInteractionsPoolToken } from './onchain/interactions';
|
|
31
|
+
import { OnchainInteractionsLendingPool, OnchainInteractionsLendingVault, OnchainInteractionsPoolToken, OnchainInteractionsConfigManager } from './onchain/interactions';
|
|
30
32
|
import { OnchainInteractionsBorrowable, OnchainInteractionsCollateral } from './onchain/interactions/lendingPool';
|
|
31
33
|
import { LENDING_VAULT_WATCHER } from './config/contracts/lending-vault-watcher';
|
|
32
|
-
export { offchain, Offchain, OffchainLendingPool, OffchainPoolToken, OffchainCollateral, OffchainBorrowable, OffchainLendingVault, OffchainAccount, OffchainAccountLendingPool, OffchainAccountPoolToken, OffchainAccountCollateral, OffchainAccountBorrowable, OffchainAccountLendingVault, OffchainPriceHelper, OffchainSolidexHelper, PoolTokenData, BorrowableData, CollateralData, BorrowablePastData, TokenData, RewardData, PairData, FarmingPoolData, LendingPoolPastData, LendingPoolData, CollateralPosition, SupplyPosition, BorrowPosition, UserData, TvlData, XimxData, onchain, Onchain, OnchainLendingPool, OnchainPoolToken, OnchainBorrowable, OnchainCollateral, OnchainLendingVault, OnchainAccount, OnchainAccountLendingPool, OnchainAccountPoolToken, OnchainAccountBorrowable, OnchainAccountCollateral, OnchainAccountLendingVault, OnchainContractsHelper, OnchainImpermaxFactory, OnchainInteractions, OnchainInteractionsLendingPool, OnchainInteractionsPoolToken, OnchainInteractionsCollateral, OnchainInteractionsBorrowable, OnchainInteractionsLendingVault, Contract, ApprovalType, PermitData, OnchainConfig, Changes, NO_CHANGES, Values, AirdropData, PendingRewardUI, CLAIM_AGGREGATOR, IMPERMAX_CHEF, IMX, 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, };
|
|
34
|
+
export { offchain, Offchain, OffchainLendingPool, OffchainPoolToken, OffchainCollateral, OffchainBorrowable, OffchainLendingVault, OffchainConfigManager, OffchainPairConfig, OffchainProposal, OffchainAccount, OffchainAccountLendingPool, OffchainAccountPoolToken, OffchainAccountCollateral, OffchainAccountBorrowable, OffchainAccountLendingVault, OffchainPriceHelper, OffchainSolidexHelper, PoolTokenData, BorrowableData, CollateralData, BorrowablePastData, TokenData, RewardData, PairData, FarmingPoolData, LendingPoolPastData, LendingPoolData, CollateralPosition, SupplyPosition, BorrowPosition, UserData, TvlData, XimxData, LendingVaultData, LendingVaultPosition, 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, 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, };
|
package/lib/index.js
CHANGED
|
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
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 = void 0;
|
|
26
|
+
exports.MERKLE_DISTRIBUTOR_IBEX = exports.LENDING_VAULT_WATCHER = exports.IMX = exports.IMPERMAX_CHEF = exports.CLAIM_AGGREGATOR = exports.NO_CHANGES = 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.OffchainAccountLendingVault = exports.OffchainAccountBorrowable = exports.OffchainAccountCollateral = exports.OffchainAccountPoolToken = exports.OffchainAccountLendingPool = exports.OffchainAccount = exports.OffchainProposal = exports.OffchainPairConfig = exports.OffchainConfigManager = exports.OffchainLendingVault = exports.OffchainBorrowable = exports.OffchainCollateral = exports.OffchainPoolToken = exports.OffchainLendingPool = exports.Offchain = 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 = void 0;
|
|
28
28
|
const offchain_1 = __importStar(require("./offchain"));
|
|
29
29
|
exports.Offchain = offchain_1.default;
|
|
30
30
|
Object.defineProperty(exports, "OffchainAccount", { enumerable: true, get: function () { return offchain_1.OffchainAccount; } });
|
|
@@ -103,12 +103,18 @@ const types_1 = require("./config/types");
|
|
|
103
103
|
Object.defineProperty(exports, "Factory", { enumerable: true, get: function () { return types_1.Factory; } });
|
|
104
104
|
Object.defineProperty(exports, "Networks", { enumerable: true, get: function () { return types_1.Networks; } });
|
|
105
105
|
Object.defineProperty(exports, "PoolTokenType", { enumerable: true, get: function () { return types_1.PoolTokenType; } });
|
|
106
|
+
Object.defineProperty(exports, "ProposalState", { enumerable: true, get: function () { return types_1.ProposalState; } });
|
|
107
|
+
Object.defineProperty(exports, "WhitelistState", { enumerable: true, get: function () { return types_1.WhitelistState; } });
|
|
106
108
|
const onchainTypes_1 = require("./onchain/onchainTypes");
|
|
107
109
|
Object.defineProperty(exports, "ApprovalType", { enumerable: true, get: function () { return onchainTypes_1.ApprovalType; } });
|
|
108
110
|
Object.defineProperty(exports, "NO_CHANGES", { enumerable: true, get: function () { return onchainTypes_1.NO_CHANGES; } });
|
|
109
111
|
const lendingPool_1 = require("./offchain/lendingPool");
|
|
110
112
|
Object.defineProperty(exports, "OffchainBorrowable", { enumerable: true, get: function () { return lendingPool_1.OffchainBorrowable; } });
|
|
111
113
|
Object.defineProperty(exports, "OffchainCollateral", { enumerable: true, get: function () { return lendingPool_1.OffchainCollateral; } });
|
|
114
|
+
const configManager_1 = __importStar(require("./offchain/configManager"));
|
|
115
|
+
exports.OffchainConfigManager = configManager_1.default;
|
|
116
|
+
Object.defineProperty(exports, "OffchainPairConfig", { enumerable: true, get: function () { return configManager_1.OffchainPairConfig; } });
|
|
117
|
+
Object.defineProperty(exports, "OffchainProposal", { enumerable: true, get: function () { return configManager_1.OffchainProposal; } });
|
|
112
118
|
const lendingPool_2 = __importStar(require("./offchain/account/lendingPool"));
|
|
113
119
|
exports.OffchainAccountLendingPool = lendingPool_2.default;
|
|
114
120
|
Object.defineProperty(exports, "OffchainAccountBorrowable", { enumerable: true, get: function () { return lendingPool_2.OffchainAccountBorrowable; } });
|
|
@@ -120,6 +126,10 @@ const lendingPool_3 = __importStar(require("./onchain/impermaxFactory/lendingPoo
|
|
|
120
126
|
exports.OnchainLendingPool = lendingPool_3.default;
|
|
121
127
|
Object.defineProperty(exports, "OnchainBorrowable", { enumerable: true, get: function () { return lendingPool_3.OnchainBorrowable; } });
|
|
122
128
|
Object.defineProperty(exports, "OnchainCollateral", { enumerable: true, get: function () { return lendingPool_3.OnchainCollateral; } });
|
|
129
|
+
const configManager_2 = __importStar(require("./onchain/configManager"));
|
|
130
|
+
exports.OnchainConfigManager = configManager_2.default;
|
|
131
|
+
Object.defineProperty(exports, "OnchainPairConfig", { enumerable: true, get: function () { return configManager_2.OnchainPairConfig; } });
|
|
132
|
+
Object.defineProperty(exports, "OnchainProposal", { enumerable: true, get: function () { return configManager_2.OnchainProposal; } });
|
|
123
133
|
const account_2 = require("./onchain/account");
|
|
124
134
|
Object.defineProperty(exports, "OnchainAccountLendingPool", { enumerable: true, get: function () { return account_2.OnchainAccountLendingPool; } });
|
|
125
135
|
Object.defineProperty(exports, "OnchainAccountLendingVault", { enumerable: true, get: function () { return account_2.OnchainAccountLendingVault; } });
|
|
@@ -131,6 +141,7 @@ const interactions_1 = require("./onchain/interactions");
|
|
|
131
141
|
Object.defineProperty(exports, "OnchainInteractionsLendingPool", { enumerable: true, get: function () { return interactions_1.OnchainInteractionsLendingPool; } });
|
|
132
142
|
Object.defineProperty(exports, "OnchainInteractionsLendingVault", { enumerable: true, get: function () { return interactions_1.OnchainInteractionsLendingVault; } });
|
|
133
143
|
Object.defineProperty(exports, "OnchainInteractionsPoolToken", { enumerable: true, get: function () { return interactions_1.OnchainInteractionsPoolToken; } });
|
|
144
|
+
Object.defineProperty(exports, "OnchainInteractionsConfigManager", { enumerable: true, get: function () { return interactions_1.OnchainInteractionsConfigManager; } });
|
|
134
145
|
const lendingPool_5 = require("./onchain/interactions/lendingPool");
|
|
135
146
|
Object.defineProperty(exports, "OnchainInteractionsBorrowable", { enumerable: true, get: function () { return lendingPool_5.OnchainInteractionsBorrowable; } });
|
|
136
147
|
Object.defineProperty(exports, "OnchainInteractionsCollateral", { enumerable: true, get: function () { return lendingPool_5.OnchainInteractionsCollateral; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, AddressIndex, PoolTokenType } from '../config/types';
|
|
1
|
+
import { Address, AddressIndex, PoolTokenType, ProposalState, WhitelistState } from '../config/types';
|
|
2
2
|
export interface PoolTokenData {
|
|
3
3
|
id: Address;
|
|
4
4
|
totalBalance: string;
|
|
@@ -189,14 +189,14 @@ export interface PairConfigData {
|
|
|
189
189
|
kinkUtilizationRate1: number;
|
|
190
190
|
adjustSpeed1: number;
|
|
191
191
|
borrowTracker1: string;
|
|
192
|
-
whiteListState:
|
|
192
|
+
whiteListState: WhitelistState;
|
|
193
193
|
}
|
|
194
194
|
export interface ProposalData {
|
|
195
195
|
id: number;
|
|
196
|
-
state:
|
|
196
|
+
state: ProposalState;
|
|
197
197
|
pairConfigs: PairConfigData[];
|
|
198
198
|
}
|
|
199
199
|
export interface ProposalMetadata {
|
|
200
200
|
id: number;
|
|
201
|
-
state:
|
|
201
|
+
state: ProposalState;
|
|
202
202
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impermax-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"ts-loader": "^8.0.14",
|
|
19
|
-
"typescript": "^4.0.3"
|
|
19
|
+
"typescript": "^4.0.3",
|
|
20
|
+
"@truffle/hdwallet-provider": "^2.1.15"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@truffle/hdwallet-provider": "^2.1.15",
|
|
23
23
|
"apollo-cache-inmemory": "^1.6.6",
|
|
24
24
|
"apollo-client": "^2.6.10",
|
|
25
25
|
"apollo-link-http": "^1.5.17",
|