@curvefi/llamalend-api 1.0.22 → 1.0.23
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/constants/llammas.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json'
|
|
2
|
-
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json'
|
|
1
|
+
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json' with { type: 'json' };
|
|
2
|
+
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json' with { type: 'json' };
|
|
3
3
|
import { lowerCaseLlammasAddresses } from "./utils";
|
|
4
4
|
export const LLAMMAS = lowerCaseLlammasAddresses({
|
|
5
5
|
sfrxeth: {
|
|
@@ -11,7 +11,7 @@ import memoize from "memoizee";
|
|
|
11
11
|
import BigNumber from "bignumber.js";
|
|
12
12
|
import { _getAddress, parseUnits, BN, toBN, fromBN, getBalances, _ensureAllowance, ensureAllowance, hasAllowance, ensureAllowanceEstimateGas, _cutZeros, formatUnits, formatNumber, MAX_ALLOWANCE, MAX_ACTIVE_BAND, _mulBy1_3, _getUsdRate, DIGas, smartNumber, } from "../utils.js";
|
|
13
13
|
import { _getExpectedOdos, _getQuoteOdos, _assembleTxOdos, _getUserCollateral, _getMarketsData } from "../external-api.js";
|
|
14
|
-
import ERC20Abi from '../constants/abis/ERC20.json'
|
|
14
|
+
import ERC20Abi from '../constants/abis/ERC20.json' with { type: 'json' };
|
|
15
15
|
import { cacheKey, cacheStats } from "../cache/index.js";
|
|
16
16
|
const DAY = 86400;
|
|
17
17
|
const WEEK = 7 * DAY;
|
package/lib/llamalend.js
CHANGED
|
@@ -10,32 +10,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { ethers, Contract, AbstractProvider } from "ethers";
|
|
11
11
|
import { Provider as MulticallProvider, Contract as MulticallContract } from '@curvefi/ethcall';
|
|
12
12
|
// OneWayMarket ABIs
|
|
13
|
-
import OneWayLendingFactoryABI from "./constants/abis/OneWayLendingFactoryABI.json"
|
|
14
|
-
import ERC20ABI from './constants/abis/ERC20.json'
|
|
15
|
-
import ERC4626ABI from './constants/abis/ERC4626.json'
|
|
16
|
-
import LlammaABI from './constants/abis/Llamma.json'
|
|
17
|
-
import ControllerABI from './constants/abis/Controller.json'
|
|
18
|
-
import MonetaryPolicyABI from './constants/abis/MonetaryPolicy.json'
|
|
19
|
-
import VaultABI from './constants/abis/Vault.json'
|
|
20
|
-
import GaugeABI from './constants/abis/GaugeV5.json'
|
|
21
|
-
import SidechainGaugeABI from './constants/abis/SidechainGauge.json'
|
|
22
|
-
import GaugeControllerABI from './constants/abis/GaugeController.json'
|
|
23
|
-
import GaugeFactoryMainnetABI from './constants/abis/GaugeFactoryMainnet.json'
|
|
24
|
-
import GaugeFactorySidechainABI from './constants/abis/GaugeFactorySidechain.json'
|
|
25
|
-
import MinterABI from './constants/abis/Minter.json'
|
|
26
|
-
import LeverageZapABI from './constants/abis/LeverageZap.json'
|
|
27
|
-
import gasOracleABI from './constants/abis/gas_oracle_optimism.json'
|
|
28
|
-
import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json'
|
|
13
|
+
import OneWayLendingFactoryABI from "./constants/abis/OneWayLendingFactoryABI.json" with { type: 'json' };
|
|
14
|
+
import ERC20ABI from './constants/abis/ERC20.json' with { type: 'json' };
|
|
15
|
+
import ERC4626ABI from './constants/abis/ERC4626.json' with { type: 'json' };
|
|
16
|
+
import LlammaABI from './constants/abis/Llamma.json' with { type: 'json' };
|
|
17
|
+
import ControllerABI from './constants/abis/Controller.json' with { type: 'json' };
|
|
18
|
+
import MonetaryPolicyABI from './constants/abis/MonetaryPolicy.json' with { type: 'json' };
|
|
19
|
+
import VaultABI from './constants/abis/Vault.json' with { type: 'json' };
|
|
20
|
+
import GaugeABI from './constants/abis/GaugeV5.json' with { type: 'json' };
|
|
21
|
+
import SidechainGaugeABI from './constants/abis/SidechainGauge.json' with { type: 'json' };
|
|
22
|
+
import GaugeControllerABI from './constants/abis/GaugeController.json' with { type: 'json' };
|
|
23
|
+
import GaugeFactoryMainnetABI from './constants/abis/GaugeFactoryMainnet.json' with { type: 'json' };
|
|
24
|
+
import GaugeFactorySidechainABI from './constants/abis/GaugeFactorySidechain.json' with { type: 'json' };
|
|
25
|
+
import MinterABI from './constants/abis/Minter.json' with { type: 'json' };
|
|
26
|
+
import LeverageZapABI from './constants/abis/LeverageZap.json' with { type: 'json' };
|
|
27
|
+
import gasOracleABI from './constants/abis/gas_oracle_optimism.json' with { type: 'json' };
|
|
28
|
+
import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json' with { type: 'json' };
|
|
29
29
|
// crvUSD ABIs
|
|
30
|
-
import llammaABI from "./constants/abis/crvUSD/llamma.json"
|
|
31
|
-
import controllerABI from "./constants/abis/crvUSD/controller.json"
|
|
30
|
+
import llammaABI from "./constants/abis/crvUSD/llamma.json" with { type: 'json' };
|
|
31
|
+
import controllerABI from "./constants/abis/crvUSD/controller.json" with { type: 'json' };
|
|
32
32
|
import controllerV2ABI from "./constants/abis/crvUSD/controller_v2.json";
|
|
33
|
-
import PegKeeper from "./constants/abis/crvUSD/PegKeeper.json"
|
|
34
|
-
import FactoryABI from "./constants/abis/crvUSD/Factory.json"
|
|
35
|
-
import MonetaryPolicy2ABI from "./constants/abis/crvUSD/MonetaryPolicy2.json"
|
|
36
|
-
import HealthCalculatorZapABI from "./constants/abis/crvUSD/HealthCalculatorZap.json"
|
|
37
|
-
import LeverageZapCrvUSDABI from "./constants/abis/crvUSD/LeverageZap.json"
|
|
38
|
-
import DeleverageZapABI from "./constants/abis/crvUSD/DeleverageZap.json"
|
|
33
|
+
import PegKeeper from "./constants/abis/crvUSD/PegKeeper.json" with { type: 'json' };
|
|
34
|
+
import FactoryABI from "./constants/abis/crvUSD/Factory.json" with { type: 'json' };
|
|
35
|
+
import MonetaryPolicy2ABI from "./constants/abis/crvUSD/MonetaryPolicy2.json" with { type: 'json' };
|
|
36
|
+
import HealthCalculatorZapABI from "./constants/abis/crvUSD/HealthCalculatorZap.json" with { type: 'json' };
|
|
37
|
+
import LeverageZapCrvUSDABI from "./constants/abis/crvUSD/LeverageZap.json" with { type: 'json' };
|
|
38
|
+
import DeleverageZapABI from "./constants/abis/crvUSD/DeleverageZap.json" with { type: 'json' };
|
|
39
39
|
import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, ALIASES_BASE, ALIASES_BSC, ALIASES_FRAXTAL, ALIASES_SONIC, } from "./constants/aliases.js";
|
|
40
40
|
import { COINS_ETHEREUM, COINS_OPTIMISM, COINS_POLYGON, COINS_FANTOM, COINS_AVALANCHE, COINS_ARBITRUM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_SONIC, } from "./constants/coins.js";
|
|
41
41
|
import { LLAMMAS } from "./constants/llammas";
|
package/package.json
CHANGED
package/src/constants/llammas.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDict, ILlamma } from "../interfaces";
|
|
2
|
-
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json'
|
|
3
|
-
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json'
|
|
2
|
+
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json' with {type: 'json'};
|
|
3
|
+
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json' with {type: 'json'};
|
|
4
4
|
import { lowerCaseLlammasAddresses } from "./utils";
|
|
5
5
|
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "../utils.js";
|
|
25
25
|
import {IDict, TGas, TAmount, IReward, IQuoteOdos, IOneWayMarket} from "../interfaces.js";
|
|
26
26
|
import { _getExpectedOdos, _getQuoteOdos, _assembleTxOdos, _getUserCollateral, _getMarketsData } from "../external-api.js";
|
|
27
|
-
import ERC20Abi from '../constants/abis/ERC20.json'
|
|
27
|
+
import ERC20Abi from '../constants/abis/ERC20.json' with {type: 'json'};
|
|
28
28
|
import {cacheKey, cacheStats} from "../cache/index.js";
|
|
29
29
|
|
|
30
30
|
|
package/src/llamalend.ts
CHANGED
|
@@ -12,32 +12,32 @@ import {
|
|
|
12
12
|
IMarketDataAPI,
|
|
13
13
|
} from "./interfaces.js";
|
|
14
14
|
// OneWayMarket ABIs
|
|
15
|
-
import OneWayLendingFactoryABI from "./constants/abis/OneWayLendingFactoryABI.json"
|
|
16
|
-
import ERC20ABI from './constants/abis/ERC20.json'
|
|
17
|
-
import ERC4626ABI from './constants/abis/ERC4626.json'
|
|
18
|
-
import LlammaABI from './constants/abis/Llamma.json'
|
|
19
|
-
import ControllerABI from './constants/abis/Controller.json'
|
|
20
|
-
import MonetaryPolicyABI from './constants/abis/MonetaryPolicy.json'
|
|
21
|
-
import VaultABI from './constants/abis/Vault.json'
|
|
22
|
-
import GaugeABI from './constants/abis/GaugeV5.json'
|
|
23
|
-
import SidechainGaugeABI from './constants/abis/SidechainGauge.json'
|
|
24
|
-
import GaugeControllerABI from './constants/abis/GaugeController.json'
|
|
25
|
-
import GaugeFactoryMainnetABI from './constants/abis/GaugeFactoryMainnet.json'
|
|
26
|
-
import GaugeFactorySidechainABI from './constants/abis/GaugeFactorySidechain.json'
|
|
27
|
-
import MinterABI from './constants/abis/Minter.json'
|
|
28
|
-
import LeverageZapABI from './constants/abis/LeverageZap.json'
|
|
29
|
-
import gasOracleABI from './constants/abis/gas_oracle_optimism.json'
|
|
30
|
-
import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json'
|
|
15
|
+
import OneWayLendingFactoryABI from "./constants/abis/OneWayLendingFactoryABI.json" with {type: 'json'};
|
|
16
|
+
import ERC20ABI from './constants/abis/ERC20.json' with {type: 'json'};
|
|
17
|
+
import ERC4626ABI from './constants/abis/ERC4626.json' with {type: 'json'};
|
|
18
|
+
import LlammaABI from './constants/abis/Llamma.json' with {type: 'json'};
|
|
19
|
+
import ControllerABI from './constants/abis/Controller.json' with {type: 'json'};
|
|
20
|
+
import MonetaryPolicyABI from './constants/abis/MonetaryPolicy.json' with {type: 'json'};
|
|
21
|
+
import VaultABI from './constants/abis/Vault.json' with {type: 'json'};
|
|
22
|
+
import GaugeABI from './constants/abis/GaugeV5.json' with {type: 'json'};
|
|
23
|
+
import SidechainGaugeABI from './constants/abis/SidechainGauge.json' with {type: 'json'};
|
|
24
|
+
import GaugeControllerABI from './constants/abis/GaugeController.json' with {type: 'json'};
|
|
25
|
+
import GaugeFactoryMainnetABI from './constants/abis/GaugeFactoryMainnet.json' with {type: 'json'};
|
|
26
|
+
import GaugeFactorySidechainABI from './constants/abis/GaugeFactorySidechain.json' with {type: 'json'};
|
|
27
|
+
import MinterABI from './constants/abis/Minter.json' with {type: 'json'};
|
|
28
|
+
import LeverageZapABI from './constants/abis/LeverageZap.json' with {type: 'json'};
|
|
29
|
+
import gasOracleABI from './constants/abis/gas_oracle_optimism.json' with {type: 'json'};
|
|
30
|
+
import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json' with {type: 'json'};
|
|
31
31
|
// crvUSD ABIs
|
|
32
|
-
import llammaABI from "./constants/abis/crvUSD/llamma.json"
|
|
33
|
-
import controllerABI from "./constants/abis/crvUSD/controller.json"
|
|
32
|
+
import llammaABI from "./constants/abis/crvUSD/llamma.json" with {type: 'json'};
|
|
33
|
+
import controllerABI from "./constants/abis/crvUSD/controller.json" with {type: 'json'};
|
|
34
34
|
import controllerV2ABI from "./constants/abis/crvUSD/controller_v2.json";
|
|
35
|
-
import PegKeeper from "./constants/abis/crvUSD/PegKeeper.json"
|
|
36
|
-
import FactoryABI from "./constants/abis/crvUSD/Factory.json"
|
|
37
|
-
import MonetaryPolicy2ABI from "./constants/abis/crvUSD/MonetaryPolicy2.json"
|
|
38
|
-
import HealthCalculatorZapABI from "./constants/abis/crvUSD/HealthCalculatorZap.json"
|
|
39
|
-
import LeverageZapCrvUSDABI from "./constants/abis/crvUSD/LeverageZap.json"
|
|
40
|
-
import DeleverageZapABI from "./constants/abis/crvUSD/DeleverageZap.json"
|
|
35
|
+
import PegKeeper from "./constants/abis/crvUSD/PegKeeper.json" with {type: 'json'};
|
|
36
|
+
import FactoryABI from "./constants/abis/crvUSD/Factory.json" with {type: 'json'};
|
|
37
|
+
import MonetaryPolicy2ABI from "./constants/abis/crvUSD/MonetaryPolicy2.json" with {type: 'json'};
|
|
38
|
+
import HealthCalculatorZapABI from "./constants/abis/crvUSD/HealthCalculatorZap.json" with {type: 'json'};
|
|
39
|
+
import LeverageZapCrvUSDABI from "./constants/abis/crvUSD/LeverageZap.json" with {type: 'json'};
|
|
40
|
+
import DeleverageZapABI from "./constants/abis/crvUSD/DeleverageZap.json" with {type: 'json'};
|
|
41
41
|
|
|
42
42
|
import {
|
|
43
43
|
ALIASES_ETHEREUM,
|