@curvefi/api 1.25.2 → 2.2.0
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/README.md +797 -590
- package/docs/v1/README.md +916 -0
- package/lib/boosting.d.ts +12 -12
- package/lib/boosting.js +23 -23
- package/lib/constants/abis/{json/2pool → 2pool}/swap.json +0 -0
- package/lib/constants/abis/{json/3pool → 3pool}/swap.json +0 -0
- package/lib/constants/abis/{json/4pool → 4pool}/swap.json +0 -0
- package/lib/constants/abis/{json/ERC20.json → ERC20.json} +0 -0
- package/lib/constants/abis/{json/aave → aave}/rewards.json +0 -0
- package/lib/constants/abis/{json/aave → aave}/swap.json +0 -0
- package/lib/constants/abis/{json/address_provider.json → address_provider.json} +0 -0
- package/lib/constants/abis/{json/ankreth → ankreth}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/ankreth → ankreth}/swap.json +0 -0
- package/lib/constants/abis/{json/atricrypto3 → atricrypto3}/swap.json +0 -0
- package/lib/constants/abis/{json/atricrypto3 → atricrypto3}/zap.json +0 -0
- package/lib/constants/abis/{json/bbtc → bbtc}/deposit.json +0 -0
- package/lib/constants/abis/{json/bbtc → bbtc}/swap.json +0 -0
- package/lib/constants/abis/{json/busd → busd}/deposit.json +0 -0
- package/lib/constants/abis/{json/busd → busd}/swap.json +0 -0
- package/lib/constants/abis/{json/cERC20.json → cERC20.json} +0 -0
- package/lib/constants/abis/{json/compound → compound}/deposit.json +0 -0
- package/lib/constants/abis/{json/compound → compound}/swap.json +0 -0
- package/lib/constants/abis/{json/crveth → crveth}/swap.json +0 -0
- package/lib/constants/abis/{json/deposit_and_stake.json → deposit_and_stake.json} +0 -0
- package/lib/constants/abis/{json/dusd → dusd}/deposit.json +0 -0
- package/lib/constants/abis/{json/dusd → dusd}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/dusd → dusd}/swap.json +0 -0
- package/lib/constants/abis/{json/eurs → eurs}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/eurs → eurs}/swap.json +0 -0
- package/lib/constants/abis/{json/eursusd → eursusd}/swap.json +0 -0
- package/lib/constants/abis/{json/eurt → eurt}/swap.json +0 -0
- package/lib/constants/abis/{json/eurtusd → eurtusd}/deposit.json +0 -0
- package/lib/constants/abis/{json/eurtusd → eurtusd}/swap.json +0 -0
- package/lib/constants/abis/{json/factory-crypto → factory-crypto}/factory-crypto-pool-2.json +0 -0
- package/lib/constants/abis/{json/factory-crypto.json → factory-crypto.json} +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/DepositZapMetaBtcPolygon.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/DepositZapMetaUsdPolygon.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTC.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTCBalances.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTCBalancesRen.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTCRen.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaUSD.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaUSDBalances.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2Balances.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2Basic.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2ETH.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2Optimized.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3Balances.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3Basic.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3ETH.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3Optimized.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4Balances.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4Basic.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4ETH.json +0 -0
- package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4Optimized.json +0 -0
- package/lib/constants/abis/{json/factory.json → factory.json} +0 -0
- package/lib/constants/abis/{json/factoryPools → factoryPools}/deposit.json +0 -0
- package/lib/constants/abis/{json/factoryPools → factoryPools}/rewards.json +0 -0
- package/lib/constants/abis/{json/factoryPools → factoryPools}/swap.json +0 -0
- package/lib/constants/abis/{json/gauge.json → gauge.json} +0 -0
- package/lib/constants/abis/{json/gauge_factory.json → gauge_factory.json} +0 -0
- package/lib/constants/abis/{json/gauge_rewards_only.json → gauge_rewards_only.json} +0 -0
- package/lib/constants/abis/{json/gauge_synthetix.json → gauge_synthetix.json} +0 -0
- package/lib/constants/abis/{json/gauge_v2.json → gauge_v2.json} +0 -0
- package/lib/constants/abis/{json/gauge_v3.json → gauge_v3.json} +0 -0
- package/lib/constants/abis/{json/gauge_v4.json → gauge_v4.json} +0 -0
- package/lib/constants/abis/{json/gauge_v5.json → gauge_v5.json} +0 -0
- package/lib/constants/abis/{json/gaugecontroller.json → gaugecontroller.json} +0 -0
- package/lib/constants/abis/{json/gusd → gusd}/deposit.json +0 -0
- package/lib/constants/abis/{json/gusd → gusd}/swap.json +0 -0
- package/lib/constants/abis/{json/hbtc → hbtc}/swap.json +0 -0
- package/lib/constants/abis/{json/husd → husd}/deposit.json +0 -0
- package/lib/constants/abis/{json/husd → husd}/swap.json +0 -0
- package/lib/constants/abis/{json/ib → ib}/swap.json +0 -0
- package/lib/constants/abis/{json/iearn → iearn}/deposit.json +0 -0
- package/lib/constants/abis/{json/iearn → iearn}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/iearn → iearn}/swap.json +0 -0
- package/lib/constants/abis/{json/link → link}/swap.json +0 -0
- package/lib/constants/abis/{json/minter.json → minter.json} +0 -0
- package/lib/constants/abis/{json/musd → musd}/deposit.json +0 -0
- package/lib/constants/abis/{json/musd → musd}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/musd → musd}/swap.json +0 -0
- package/lib/constants/abis/{json/obtc → obtc}/deposit.json +0 -0
- package/lib/constants/abis/{json/obtc → obtc}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/obtc → obtc}/swap.json +0 -0
- package/lib/constants/abis/{json/paave → paave}/rewards.json +0 -0
- package/lib/constants/abis/{json/pax → pax}/deposit.json +0 -0
- package/lib/constants/abis/{json/pax → pax}/swap.json +0 -0
- package/lib/constants/abis/{json/pbtc → pbtc}/deposit.json +0 -0
- package/lib/constants/abis/{json/pbtc → pbtc}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/pbtc → pbtc}/swap.json +0 -0
- package/lib/constants/abis/{json/rai → rai}/deposit.json +0 -0
- package/lib/constants/abis/{json/rai → rai}/swap.json +0 -0
- package/lib/constants/abis/{json/registry_exchange.json → registry_exchange.json} +0 -0
- package/lib/constants/abis/{json/ren → ren}/swap.json +0 -0
- package/lib/constants/abis/{json/ren-polygon → ren-polygon}/swap.json +0 -0
- package/lib/constants/abis/{json/reth → reth}/swap.json +0 -0
- package/lib/constants/abis/{json/router.json → router.json} +0 -0
- package/lib/constants/abis/{json/rsv → rsv}/deposit.json +0 -0
- package/lib/constants/abis/{json/rsv → rsv}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/rsv → rsv}/swap.json +0 -0
- package/lib/constants/abis/{json/saave → saave}/swap.json +0 -0
- package/lib/constants/abis/{json/sbtc → sbtc}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/sbtc → sbtc}/swap.json +0 -0
- package/lib/constants/abis/{json/seth → seth}/swap.json +0 -0
- package/lib/constants/abis/{json/steth → steth}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/steth → steth}/swap.json +0 -0
- package/lib/constants/abis/{json/streamer.json → streamer.json} +0 -0
- package/lib/constants/abis/{json/susdv2 → susdv2}/deposit.json +0 -0
- package/lib/constants/abis/{json/susdv2 → susdv2}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/susdv2 → susdv2}/swap.json +0 -0
- package/lib/constants/abis/{json/tbtc → tbtc}/deposit.json +0 -0
- package/lib/constants/abis/{json/tbtc → tbtc}/sCurveRewards.json +0 -0
- package/lib/constants/abis/{json/tbtc → tbtc}/swap.json +0 -0
- package/lib/constants/abis/{json/tricrypto2 → tricrypto2}/deposit.json +0 -0
- package/lib/constants/abis/{json/tricrypto2 → tricrypto2}/swap.json +0 -0
- package/lib/constants/abis/{json/usdk → usdk}/deposit.json +0 -0
- package/lib/constants/abis/{json/usdk → usdk}/swap.json +0 -0
- package/lib/constants/abis/{json/usdn → usdn}/deposit.json +0 -0
- package/lib/constants/abis/{json/usdn → usdn}/swap.json +0 -0
- package/lib/constants/abis/{json/usdp → usdp}/deposit.json +0 -0
- package/lib/constants/abis/{json/usdp → usdp}/swap.json +0 -0
- package/lib/constants/abis/{json/usdt → usdt}/deposit.json +0 -0
- package/lib/constants/abis/{json/usdt → usdt}/swap.json +0 -0
- package/lib/constants/abis/{json/ust → ust}/deposit.json +0 -0
- package/lib/constants/abis/{json/ust → ust}/swap.json +0 -0
- package/lib/constants/abis/{json/votingescrow.json → votingescrow.json} +0 -0
- package/lib/constants/abis/{json/yERC20.json → yERC20.json} +0 -0
- package/lib/constants/aliases.d.ts +3 -24
- package/lib/constants/aliases.js +18 -5
- package/lib/constants/coins/avalanche.d.ts +7 -0
- package/lib/constants/coins/avalanche.js +32 -0
- package/lib/constants/{coins-ethereum.d.ts → coins/ethereum.d.ts} +0 -9
- package/lib/constants/{coins-ethereum.js → coins/ethereum.js} +12 -23
- package/lib/constants/{coins-polygon.d.ts → coins/polygon.d.ts} +0 -12
- package/lib/constants/{coins-polygon.js → coins/polygon.js} +8 -20
- package/lib/constants/pools/avalanche.d.ts +4 -0
- package/lib/constants/pools/avalanche.js +113 -0
- package/lib/constants/pools/ethereum.d.ts +2 -0
- package/lib/constants/{abis/abis-ethereum.js → pools/ethereum.js} +517 -1012
- package/lib/constants/pools/index.d.ts +4 -0
- package/lib/constants/pools/index.js +9 -0
- package/lib/constants/pools/polygon.d.ts +4 -0
- package/lib/constants/{abis/abis-polygon.js → pools/polygon.js} +52 -80
- package/lib/constants/utils.d.ts +5 -0
- package/lib/constants/utils.js +69 -0
- package/lib/curve.d.ts +13 -31
- package/lib/curve.js +204 -232
- package/lib/external-api.d.ts +4 -3
- package/lib/external-api.js +18 -1
- package/lib/factory/common.d.ts +2 -0
- package/lib/factory/common.js +45 -0
- package/lib/factory/constants.d.ts +16 -16
- package/lib/factory/constants.js +79 -77
- package/lib/factory/factory-api.d.ts +2 -2
- package/lib/factory/factory-api.js +51 -85
- package/lib/factory/factory-crypto.d.ts +2 -2
- package/lib/factory/factory-crypto.js +30 -35
- package/lib/factory/factory.d.ts +2 -2
- package/lib/factory/factory.js +60 -205
- package/lib/index.d.ts +37 -53
- package/lib/index.js +28 -35
- package/lib/interfaces.d.ts +51 -83
- package/lib/pools/PoolTemplate.d.ts +212 -0
- package/lib/pools/PoolTemplate.js +2371 -0
- package/lib/pools/index.d.ts +3 -0
- package/lib/pools/index.js +7 -0
- package/lib/pools/mixins/common.d.ts +3 -0
- package/lib/pools/mixins/common.js +77 -0
- package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +5 -0
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +145 -0
- package/lib/pools/mixins/depositBonusMixins.d.ts +5 -0
- package/lib/pools/mixins/depositBonusMixins.js +164 -0
- package/lib/pools/mixins/depositMixins.d.ts +5 -0
- package/lib/pools/mixins/depositMixins.js +373 -0
- package/lib/pools/mixins/depositWrappedMixins.d.ts +3 -0
- package/lib/pools/mixins/depositWrappedMixins.js +243 -0
- package/lib/pools/mixins/poolBalancesMixin.d.ts +4 -0
- package/lib/pools/mixins/poolBalancesMixin.js +129 -0
- package/lib/pools/mixins/swapMixins.d.ts +4 -0
- package/lib/pools/mixins/swapMixins.js +313 -0
- package/lib/pools/mixins/swapWrappedMixins.d.ts +4 -0
- package/lib/pools/mixins/swapWrappedMixins.js +297 -0
- package/lib/pools/mixins/withdrawExpectedMixins.d.ts +6 -0
- package/lib/pools/mixins/withdrawExpectedMixins.js +164 -0
- package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +5 -0
- package/lib/pools/mixins/withdrawImbalanceMixins.js +348 -0
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +3 -0
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +207 -0
- package/lib/pools/mixins/withdrawMixins.d.ts +5 -0
- package/lib/pools/mixins/withdrawMixins.js +347 -0
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +5 -0
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +104 -0
- package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +5 -0
- package/lib/pools/mixins/withdrawOneCoinMixins.js +347 -0
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +3 -0
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +72 -0
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +3 -0
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +205 -0
- package/lib/pools/mixins/withdrawWrappedMixins.d.ts +3 -0
- package/lib/pools/mixins/withdrawWrappedMixins.js +206 -0
- package/lib/pools/poolConstructor.d.ts +2 -0
- package/lib/pools/poolConstructor.js +228 -0
- package/lib/pools/utils.d.ts +4 -0
- package/lib/pools/utils.js +85 -0
- package/lib/router.d.ts +13 -0
- package/lib/router.js +651 -0
- package/lib/utils.d.ts +12 -16
- package/lib/utils.js +59 -138
- package/package.json +1 -1
- package/lib/constants/abis/abis-ethereum.d.ts +0 -4
- package/lib/constants/abis/abis-polygon.d.ts +0 -4
- package/lib/constants/abis/json/aRewards.json +0 -1
- package/lib/constants/abis/json/compound/migration.json +0 -57
- package/lib/constants/abis/json/compound/oldSwap.json +0 -688
- package/lib/constants/abis/json/ren/adapter.json +0 -1
- package/lib/constants/abis/json/sbtc/adapter.json +0 -1
- package/lib/pools.d.ts +0 -267
- package/lib/pools.js +0 -4752
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
2
|
import { Networkish } from "@ethersproject/networks";
|
|
3
|
-
import {
|
|
3
|
+
import { PoolTemplate } from "./pools";
|
|
4
4
|
declare function init(providerType: 'JsonRpc' | 'Web3' | 'Infura' | 'Alchemy', providerSettings: {
|
|
5
5
|
url?: string;
|
|
6
6
|
privateKey?: string;
|
|
@@ -24,81 +24,65 @@ declare function setCustomFeeData(customFeeData: {
|
|
|
24
24
|
}): void;
|
|
25
25
|
declare const curve: {
|
|
26
26
|
init: typeof init;
|
|
27
|
+
chainId: number;
|
|
28
|
+
signerAddress: string;
|
|
29
|
+
setCustomFeeData: typeof setCustomFeeData;
|
|
27
30
|
fetchFactoryPools: typeof fetchFactoryPools;
|
|
28
31
|
fetchCryptoFactoryPools: typeof fetchCryptoFactoryPools;
|
|
29
32
|
getPoolList: () => string[];
|
|
30
33
|
getFactoryPoolList: () => string[];
|
|
31
34
|
getCryptoFactoryPoolList: () => string[];
|
|
35
|
+
getUserPoolList: (address?: string | undefined) => Promise<string[]>;
|
|
36
|
+
PoolTemplate: typeof PoolTemplate;
|
|
37
|
+
getPool: (poolId: string) => PoolTemplate;
|
|
32
38
|
getUsdRate: (coin: string) => Promise<number>;
|
|
33
39
|
getTVL: (chainId?: number) => Promise<number>;
|
|
34
|
-
|
|
35
|
-
signerAddress: string;
|
|
36
|
-
chainId: number;
|
|
37
|
-
Pool: typeof Pool;
|
|
38
|
-
getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<string[] | import("./interfaces").DictInterface<string[]>>;
|
|
40
|
+
getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<string[] | import("./interfaces").IDict<string[]>>;
|
|
39
41
|
getAllowance: (coins: string[], address: string, spender: string) => Promise<string[]>;
|
|
40
|
-
hasAllowance: (coins: string[], amounts: string[], address: string, spender: string) => Promise<boolean>;
|
|
41
|
-
ensureAllowance: (coins: string[], amounts: string[], spender: string) => Promise<string[]>;
|
|
42
|
-
getBestPoolAndOutput: (inputCoin: string, outputCoin: string, amount: string) => Promise<{
|
|
43
|
-
poolName: string;
|
|
44
|
-
poolAddress: string;
|
|
45
|
-
output: string;
|
|
46
|
-
}>;
|
|
47
|
-
exchangeExpected: (inputCoin: string, outputCoin: string, amount: string) => Promise<string>;
|
|
48
|
-
exchangeIsApproved: (inputCoin: string, outputCoin: string, amount: string) => Promise<boolean>;
|
|
49
|
-
exchangeApprove: (inputCoin: string, outputCoin: string, amount: string) => Promise<string[]>;
|
|
50
|
-
exchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<string>;
|
|
51
|
-
crossAssetExchangeAvailable: (inputCoin: string, outputCoin: string) => Promise<boolean>;
|
|
52
|
-
crossAssetExchangeOutputAndSlippage: (inputCoin: string, outputCoin: string, amount: string) => Promise<{
|
|
53
|
-
slippage: number;
|
|
54
|
-
output: string;
|
|
55
|
-
}>;
|
|
56
|
-
crossAssetExchangeExpected: (inputCoin: string, outputCoin: string, amount: string) => Promise<string>;
|
|
57
|
-
crossAssetExchangeIsApproved: (inputCoin: string, amount: string) => Promise<boolean>;
|
|
58
|
-
crossAssetExchangeApprove: (inputCoin: string, amount: string) => Promise<string[]>;
|
|
59
|
-
crossAssetExchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<string>;
|
|
60
|
-
getUserPoolList: (address?: string | undefined) => Promise<string[]>;
|
|
61
|
-
getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: string) => Promise<{
|
|
62
|
-
route: import("./interfaces").IRouteStep[];
|
|
63
|
-
output: string;
|
|
64
|
-
}>;
|
|
65
|
-
routerExchangeExpected: (inputCoin: string, outputCoin: string, amount: string) => Promise<string>;
|
|
66
|
-
routerExchangeIsApproved: (inputCoin: string, amount: string) => Promise<boolean>;
|
|
67
|
-
routerExchangeApprove: (inputCoin: string, amount: string) => Promise<string[]>;
|
|
68
|
-
routerExchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<string>;
|
|
42
|
+
hasAllowance: (coins: string[], amounts: (string | number)[], address: string, spender: string) => Promise<boolean>;
|
|
43
|
+
ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string) => Promise<string[]>;
|
|
69
44
|
estimateGas: {
|
|
70
|
-
ensureAllowance: (coins: string[], amounts: string[], spender: string) => Promise<number>;
|
|
71
|
-
exchangeApprove: (inputCoin: string, outputCoin: string, amount: string) => Promise<number>;
|
|
72
|
-
exchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<number>;
|
|
73
|
-
crossAssetExchangeApprove: (inputCoin: string, amount: string) => Promise<number>;
|
|
74
|
-
crossAssetExchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<number>;
|
|
75
|
-
routerExchangeApprove: (inputCoin: string, amount: string) => Promise<number>;
|
|
76
|
-
routerExchange: (inputCoin: string, outputCoin: string, amount: string) => Promise<number>;
|
|
45
|
+
ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string) => Promise<number>;
|
|
77
46
|
};
|
|
78
47
|
boosting: {
|
|
79
|
-
getCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").
|
|
80
|
-
getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<import("./interfaces").
|
|
48
|
+
getCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").IDict<string>>;
|
|
49
|
+
getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<import("./interfaces").IDict<{
|
|
81
50
|
lockedAmount: string;
|
|
82
51
|
unlockTime: number;
|
|
83
52
|
}> | {
|
|
84
53
|
lockedAmount: string;
|
|
85
54
|
unlockTime: number;
|
|
86
55
|
}>;
|
|
87
|
-
getVeCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").
|
|
88
|
-
getVeCrvPct: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").
|
|
89
|
-
isApproved: (amount: string) => Promise<boolean>;
|
|
90
|
-
approve: (amount: string) => Promise<string[]>;
|
|
91
|
-
createLock: (amount: string, days: number) => Promise<string>;
|
|
92
|
-
increaseAmount: (amount: string) => Promise<string>;
|
|
56
|
+
getVeCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").IDict<string>>;
|
|
57
|
+
getVeCrvPct: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").IDict<string>>;
|
|
58
|
+
isApproved: (amount: string | number) => Promise<boolean>;
|
|
59
|
+
approve: (amount: string | number) => Promise<string[]>;
|
|
60
|
+
createLock: (amount: string | number, days: number) => Promise<string>;
|
|
61
|
+
increaseAmount: (amount: string | number) => Promise<string>;
|
|
93
62
|
increaseUnlockTime: (days: number) => Promise<string>;
|
|
94
63
|
withdrawLockedCrv: () => Promise<string>;
|
|
95
64
|
estimateGas: {
|
|
96
|
-
approve: (amount: string) => Promise<number>;
|
|
97
|
-
createLock: (amount: string, days: number) => Promise<number>;
|
|
98
|
-
increaseAmount: (amount: string) => Promise<number>;
|
|
65
|
+
approve: (amount: string | number) => Promise<number>;
|
|
66
|
+
createLock: (amount: string | number, days: number) => Promise<number>;
|
|
67
|
+
increaseAmount: (amount: string | number) => Promise<number>;
|
|
99
68
|
increaseUnlockTime: (days: number) => Promise<number>;
|
|
100
69
|
withdrawLockedCrv: () => Promise<number>;
|
|
101
70
|
};
|
|
102
71
|
};
|
|
72
|
+
router: {
|
|
73
|
+
getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<{
|
|
74
|
+
route: import("./interfaces").IRouteStep[];
|
|
75
|
+
output: string;
|
|
76
|
+
}>;
|
|
77
|
+
expected: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<string>;
|
|
78
|
+
priceImpact: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<string>;
|
|
79
|
+
isApproved: (inputCoin: string, amount: string | number) => Promise<boolean>;
|
|
80
|
+
approve: (inputCoin: string, amount: string | number) => Promise<string[]>;
|
|
81
|
+
swap: (inputCoin: string, outputCoin: string, amount: string | number, slippage?: number) => Promise<string>;
|
|
82
|
+
estimateGas: {
|
|
83
|
+
approve: (inputCoin: string, amount: string | number) => Promise<number>;
|
|
84
|
+
swap: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<number>;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
103
87
|
};
|
|
104
88
|
export default curve;
|
package/lib/index.js
CHANGED
|
@@ -37,9 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var pools_1 = require("./pools");
|
|
40
|
+
var utils_1 = require("./pools/utils");
|
|
41
|
+
var router_1 = require("./router");
|
|
40
42
|
var curve_1 = require("./curve");
|
|
41
43
|
var boosting_1 = require("./boosting");
|
|
42
|
-
var
|
|
44
|
+
var utils_2 = require("./utils");
|
|
43
45
|
function init(providerType, providerSettings, options) {
|
|
44
46
|
if (options === void 0) { options = {}; }
|
|
45
47
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -88,46 +90,25 @@ function setCustomFeeData(customFeeData) {
|
|
|
88
90
|
}
|
|
89
91
|
var curve = {
|
|
90
92
|
init: init,
|
|
93
|
+
chainId: 0,
|
|
94
|
+
signerAddress: '',
|
|
95
|
+
setCustomFeeData: setCustomFeeData,
|
|
91
96
|
fetchFactoryPools: fetchFactoryPools,
|
|
92
97
|
fetchCryptoFactoryPools: fetchCryptoFactoryPools,
|
|
93
98
|
getPoolList: utils_1.getPoolList,
|
|
94
99
|
getFactoryPoolList: utils_1.getFactoryPoolList,
|
|
95
100
|
getCryptoFactoryPoolList: utils_1.getCryptoFactoryPoolList,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
ensureAllowance: utils_1.ensureAllowance,
|
|
106
|
-
getBestPoolAndOutput: pools_1.getBestPoolAndOutput,
|
|
107
|
-
exchangeExpected: pools_1.exchangeExpected,
|
|
108
|
-
exchangeIsApproved: pools_1.exchangeIsApproved,
|
|
109
|
-
exchangeApprove: pools_1.exchangeApprove,
|
|
110
|
-
exchange: pools_1.exchange,
|
|
111
|
-
crossAssetExchangeAvailable: pools_1.crossAssetExchangeAvailable,
|
|
112
|
-
crossAssetExchangeOutputAndSlippage: pools_1.crossAssetExchangeOutputAndSlippage,
|
|
113
|
-
crossAssetExchangeExpected: pools_1.crossAssetExchangeExpected,
|
|
114
|
-
crossAssetExchangeIsApproved: pools_1.crossAssetExchangeIsApproved,
|
|
115
|
-
crossAssetExchangeApprove: pools_1.crossAssetExchangeApprove,
|
|
116
|
-
crossAssetExchange: pools_1.crossAssetExchange,
|
|
117
|
-
getUserPoolList: pools_1.getUserPoolList,
|
|
118
|
-
getBestRouteAndOutput: pools_1.getBestRouteAndOutput,
|
|
119
|
-
routerExchangeExpected: pools_1.routerExchangeExpected,
|
|
120
|
-
routerExchangeIsApproved: pools_1.routerExchangeIsApproved,
|
|
121
|
-
routerExchangeApprove: pools_1.routerExchangeApprove,
|
|
122
|
-
routerExchange: pools_1.routerExchange,
|
|
101
|
+
getUserPoolList: utils_1.getUserPoolList,
|
|
102
|
+
PoolTemplate: pools_1.PoolTemplate,
|
|
103
|
+
getPool: pools_1.getPool,
|
|
104
|
+
getUsdRate: utils_2.getUsdRate,
|
|
105
|
+
getTVL: utils_2.getTVL,
|
|
106
|
+
getBalances: utils_2.getBalances,
|
|
107
|
+
getAllowance: utils_2.getAllowance,
|
|
108
|
+
hasAllowance: utils_2.hasAllowance,
|
|
109
|
+
ensureAllowance: utils_2.ensureAllowance,
|
|
123
110
|
estimateGas: {
|
|
124
|
-
ensureAllowance:
|
|
125
|
-
exchangeApprove: pools_1.exchangeApproveEstimateGas,
|
|
126
|
-
exchange: pools_1.exchangeEstimateGas,
|
|
127
|
-
crossAssetExchangeApprove: pools_1.crossAssetExchangeApproveEstimateGas,
|
|
128
|
-
crossAssetExchange: pools_1.crossAssetExchangeEstimateGas,
|
|
129
|
-
routerExchangeApprove: pools_1.routerExchangeApproveEstimateGas,
|
|
130
|
-
routerExchange: pools_1.routerExchangeEstimateGas,
|
|
111
|
+
ensureAllowance: utils_2.ensureAllowanceEstimateGas,
|
|
131
112
|
},
|
|
132
113
|
boosting: {
|
|
133
114
|
getCrv: boosting_1.getCrv,
|
|
@@ -148,5 +129,17 @@ var curve = {
|
|
|
148
129
|
withdrawLockedCrv: boosting_1.withdrawLockedCrvEstimateGas,
|
|
149
130
|
},
|
|
150
131
|
},
|
|
132
|
+
router: {
|
|
133
|
+
getBestRouteAndOutput: router_1.getBestRouteAndOutput,
|
|
134
|
+
expected: router_1.swapExpected,
|
|
135
|
+
priceImpact: router_1.swapPriceImpact,
|
|
136
|
+
isApproved: router_1.swapIsApproved,
|
|
137
|
+
approve: router_1.swapApprove,
|
|
138
|
+
swap: router_1.swap,
|
|
139
|
+
estimateGas: {
|
|
140
|
+
approve: router_1.swapApproveEstimateGas,
|
|
141
|
+
swap: router_1.swapEstimateGas,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
151
144
|
};
|
|
152
145
|
exports.default = curve;
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
import { Contract, ethers } from "ethers";
|
|
2
2
|
import { Contract as MulticallContract, Provider as MulticallProvider } from "ethcall";
|
|
3
|
-
export interface
|
|
3
|
+
export interface IDict<T> {
|
|
4
4
|
[index: string]: T;
|
|
5
5
|
}
|
|
6
|
+
export declare type INetworkName = "ethereum" | "polygon" | "avalanche";
|
|
7
|
+
export declare type REFERENCE_ASSET = 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
|
|
8
|
+
export interface IPoolData {
|
|
9
|
+
name: string;
|
|
10
|
+
full_name: string;
|
|
11
|
+
symbol: string;
|
|
12
|
+
reference_asset: REFERENCE_ASSET;
|
|
13
|
+
swap_address: string;
|
|
14
|
+
token_address: string;
|
|
15
|
+
gauge_address: string;
|
|
16
|
+
deposit_address?: string;
|
|
17
|
+
sCurveRewards_address?: string;
|
|
18
|
+
reward_contract?: string;
|
|
19
|
+
is_plain?: boolean;
|
|
20
|
+
is_lending?: boolean;
|
|
21
|
+
is_meta?: boolean;
|
|
22
|
+
is_crypto?: boolean;
|
|
23
|
+
is_fake?: boolean;
|
|
24
|
+
is_factory?: boolean;
|
|
25
|
+
base_pool?: string;
|
|
26
|
+
underlying_coins: string[];
|
|
27
|
+
wrapped_coins: string[];
|
|
28
|
+
underlying_coin_addresses: string[];
|
|
29
|
+
wrapped_coin_addresses: string[];
|
|
30
|
+
underlying_decimals: number[];
|
|
31
|
+
wrapped_decimals: number[];
|
|
32
|
+
use_lending?: boolean[];
|
|
33
|
+
reward_tokens?: string[];
|
|
34
|
+
reward_decimals?: number[];
|
|
35
|
+
swap_abi: any;
|
|
36
|
+
gauge_abi: any;
|
|
37
|
+
deposit_abi?: any;
|
|
38
|
+
sCurveRewards_abi?: any;
|
|
39
|
+
}
|
|
6
40
|
export interface ICurve {
|
|
7
41
|
provider: ethers.providers.Web3Provider | ethers.providers.JsonRpcProvider;
|
|
8
42
|
multicallProvider: MulticallProvider;
|
|
@@ -28,65 +62,16 @@ export interface ICurve {
|
|
|
28
62
|
maxFeePerGas?: number | ethers.BigNumber;
|
|
29
63
|
maxPriorityFeePerGas?: number | ethers.BigNumber;
|
|
30
64
|
};
|
|
31
|
-
constants:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
decimals: number[];
|
|
42
|
-
tethered?: boolean[];
|
|
43
|
-
use_lending: boolean[];
|
|
44
|
-
is_plain: boolean[];
|
|
45
|
-
has_eth?: boolean;
|
|
46
|
-
is_aave?: boolean;
|
|
47
|
-
is_new_underlying?: boolean;
|
|
48
|
-
old_swap_address?: string;
|
|
49
|
-
swap_address: string;
|
|
50
|
-
token_address: string;
|
|
51
|
-
gauge_address: string;
|
|
52
|
-
old_token_address?: string;
|
|
53
|
-
migration_address?: string;
|
|
54
|
-
deposit_address?: string;
|
|
55
|
-
underlying_coins: string[];
|
|
56
|
-
coins: string[];
|
|
57
|
-
underlying_coin_addresses: string[];
|
|
58
|
-
coin_addresses: string[];
|
|
59
|
-
swap_abi: any;
|
|
60
|
-
gauge_abi: any;
|
|
61
|
-
deposit_abi?: any;
|
|
62
|
-
old_swap_abi?: any;
|
|
63
|
-
is_meta?: boolean;
|
|
64
|
-
is_fake?: boolean;
|
|
65
|
-
is_crypto?: boolean;
|
|
66
|
-
meta_N?: number;
|
|
67
|
-
meta_decimals?: number[];
|
|
68
|
-
meta_coin_decimals?: number[];
|
|
69
|
-
meta_wrapped_decimals?: number[];
|
|
70
|
-
base_pool?: string;
|
|
71
|
-
meta_coin_addresses?: string[];
|
|
72
|
-
all_coin_addresses?: string[];
|
|
73
|
-
is_factory?: boolean;
|
|
74
|
-
is_plain_factory?: boolean;
|
|
75
|
-
is_meta_factory?: boolean;
|
|
76
|
-
is_crypto_factory?: boolean;
|
|
77
|
-
adapter_abi?: any;
|
|
78
|
-
old_adapter_address?: string;
|
|
79
|
-
adapter_biconomy_address?: string;
|
|
80
|
-
adapter_address?: string;
|
|
81
|
-
migration_abi?: any;
|
|
82
|
-
sCurveRewards_abi?: any;
|
|
83
|
-
sCurveRewards_address?: string;
|
|
84
|
-
aRewards_abi?: any;
|
|
85
|
-
aRewards_address?: string;
|
|
86
|
-
reward_token?: string;
|
|
87
|
-
reward_tokens?: string[];
|
|
88
|
-
pool_type?: string;
|
|
89
|
-
reward_contract?: string;
|
|
65
|
+
constants: {
|
|
66
|
+
NETWORK_NAME: INetworkName;
|
|
67
|
+
ALIASES: IDict<string>;
|
|
68
|
+
POOLS_DATA: IDict<IPoolData>;
|
|
69
|
+
FACTORY_POOLS_DATA: IDict<IPoolData>;
|
|
70
|
+
CRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
|
|
71
|
+
COINS: IDict<string>;
|
|
72
|
+
DECIMALS: IDict<number>;
|
|
73
|
+
GAUGES: string[];
|
|
74
|
+
};
|
|
90
75
|
}
|
|
91
76
|
export interface ICoinFromPoolDataApi {
|
|
92
77
|
address: string;
|
|
@@ -117,34 +102,17 @@ export interface IPoolDataFromApi {
|
|
|
117
102
|
gaugeRewards?: IReward[];
|
|
118
103
|
usdTotal: number;
|
|
119
104
|
}
|
|
105
|
+
export interface ISubgraphPoolData {
|
|
106
|
+
address: string;
|
|
107
|
+
volumeUSD: number;
|
|
108
|
+
latestDailyApy: number;
|
|
109
|
+
latestWeeklyApy: number;
|
|
110
|
+
}
|
|
120
111
|
export interface IExtendedPoolDataFromApi {
|
|
121
112
|
poolData: IPoolDataFromApi[];
|
|
122
113
|
tvl?: number;
|
|
123
114
|
tvlAll: number;
|
|
124
115
|
}
|
|
125
|
-
export interface IPoolStats {
|
|
126
|
-
volume: number;
|
|
127
|
-
apy: {
|
|
128
|
-
day: number;
|
|
129
|
-
week: number;
|
|
130
|
-
month: number;
|
|
131
|
-
total: number;
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
export interface IStats {
|
|
135
|
-
[index: string]: IPoolStats;
|
|
136
|
-
}
|
|
137
|
-
export interface ISinglePoolSwapData {
|
|
138
|
-
poolName: string;
|
|
139
|
-
poolAddress: string;
|
|
140
|
-
i: number;
|
|
141
|
-
j: number;
|
|
142
|
-
swapType: 1 | 2 | 3 | 4 | 5;
|
|
143
|
-
swapAddress: string;
|
|
144
|
-
}
|
|
145
|
-
export interface ISinglePoolSwapDataAndOutput extends ISinglePoolSwapData {
|
|
146
|
-
_output: ethers.BigNumber;
|
|
147
|
-
}
|
|
148
116
|
export interface IRouteStep {
|
|
149
117
|
poolId: string;
|
|
150
118
|
poolAddress: string;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { IDict, IReward } from '../interfaces';
|
|
2
|
+
export declare class PoolTemplate {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
fullName: string;
|
|
6
|
+
symbol: string;
|
|
7
|
+
referenceAsset: string;
|
|
8
|
+
address: string;
|
|
9
|
+
lpToken: string;
|
|
10
|
+
gauge: string;
|
|
11
|
+
zap: string | null;
|
|
12
|
+
rewardContract: string | null;
|
|
13
|
+
isPlain: boolean;
|
|
14
|
+
isLending: boolean;
|
|
15
|
+
isMeta: boolean;
|
|
16
|
+
isCrypto: boolean;
|
|
17
|
+
isFake: boolean;
|
|
18
|
+
isFactory: boolean;
|
|
19
|
+
isMetaFactory: boolean;
|
|
20
|
+
basePool: string;
|
|
21
|
+
underlyingCoins: string[];
|
|
22
|
+
wrappedCoins: string[];
|
|
23
|
+
underlyingCoinAddresses: string[];
|
|
24
|
+
wrappedCoinAddresses: string[];
|
|
25
|
+
underlyingDecimals: number[];
|
|
26
|
+
wrappedDecimals: number[];
|
|
27
|
+
useLending: boolean[];
|
|
28
|
+
rewardTokens: string[];
|
|
29
|
+
estimateGas: {
|
|
30
|
+
depositApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
31
|
+
deposit: (amounts: (number | string)[]) => Promise<number>;
|
|
32
|
+
depositWrappedApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
33
|
+
depositWrapped: (amounts: (number | string)[]) => Promise<number>;
|
|
34
|
+
stakeApprove: (lpTokenAmount: number | string) => Promise<number>;
|
|
35
|
+
stake: (lpTokenAmount: number | string) => Promise<number>;
|
|
36
|
+
unstake: (lpTokenAmount: number | string) => Promise<number>;
|
|
37
|
+
claimCrv: () => Promise<number>;
|
|
38
|
+
claimRewards: () => Promise<number>;
|
|
39
|
+
depositAndStakeApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
40
|
+
depositAndStake: (amounts: (number | string)[]) => Promise<number>;
|
|
41
|
+
depositAndStakeWrappedApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
42
|
+
depositAndStakeWrapped: (amounts: (number | string)[]) => Promise<number>;
|
|
43
|
+
withdrawApprove: (lpTokenAmount: number | string) => Promise<number>;
|
|
44
|
+
withdraw: (lpTokenAmount: number | string) => Promise<number>;
|
|
45
|
+
withdrawWrapped: (lpTokenAmount: number | string) => Promise<number>;
|
|
46
|
+
withdrawImbalanceApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
47
|
+
withdrawImbalance: (amounts: (number | string)[]) => Promise<number>;
|
|
48
|
+
withdrawImbalanceWrapped: (amounts: (number | string)[]) => Promise<number>;
|
|
49
|
+
withdrawOneCoinApprove: (lpTokenAmount: number | string, coin: string | number) => Promise<number>;
|
|
50
|
+
withdrawOneCoin: (lpTokenAmount: number | string, coin: string | number) => Promise<number>;
|
|
51
|
+
withdrawOneCoinWrapped: (lpTokenAmount: number | string, coin: string | number) => Promise<number>;
|
|
52
|
+
swapApprove: (inputCoin: string | number, amount: number | string) => Promise<number>;
|
|
53
|
+
swap: (inputCoin: string | number, outputCoin: string | number, amount: number | string, slippage: number) => Promise<number>;
|
|
54
|
+
swapWrappedApprove: (inputCoin: string | number, amount: number | string) => Promise<number>;
|
|
55
|
+
swapWrapped: (inputCoin: string | number, outputCoin: string | number, amount: number | string, slippage: number) => Promise<number>;
|
|
56
|
+
};
|
|
57
|
+
stats: {
|
|
58
|
+
parameters: () => Promise<{
|
|
59
|
+
virtualPrice: string;
|
|
60
|
+
fee: string;
|
|
61
|
+
adminFee: string;
|
|
62
|
+
A: string;
|
|
63
|
+
future_A?: string;
|
|
64
|
+
initial_A?: string;
|
|
65
|
+
future_A_time?: number;
|
|
66
|
+
initial_A_time?: number;
|
|
67
|
+
gamma?: string;
|
|
68
|
+
}>;
|
|
69
|
+
underlyingBalances: () => Promise<string[]>;
|
|
70
|
+
wrappedBalances: () => Promise<string[]>;
|
|
71
|
+
totalLiquidity: (useApi?: boolean) => Promise<string>;
|
|
72
|
+
volume: () => Promise<string>;
|
|
73
|
+
baseApy: () => Promise<{
|
|
74
|
+
day: string;
|
|
75
|
+
week: string;
|
|
76
|
+
}>;
|
|
77
|
+
tokenApy: () => Promise<[baseApy: string, boostedApy: string]>;
|
|
78
|
+
rewardsApy: () => Promise<IReward[]>;
|
|
79
|
+
};
|
|
80
|
+
wallet: {
|
|
81
|
+
balances: (...addresses: string[] | string[][]) => Promise<IDict<IDict<string>> | IDict<string>>;
|
|
82
|
+
lpTokenBalances: (...addresses: string[] | string[][]) => Promise<IDict<IDict<string>> | IDict<string>>;
|
|
83
|
+
underlyingCoinBalances: (...addresses: string[] | string[][]) => Promise<IDict<IDict<string>> | IDict<string>>;
|
|
84
|
+
wrappedCoinBalances: (...addresses: string[] | string[][]) => Promise<IDict<IDict<string>> | IDict<string>>;
|
|
85
|
+
allCoinBalances: (...addresses: string[] | string[][]) => Promise<IDict<IDict<string>> | IDict<string>>;
|
|
86
|
+
};
|
|
87
|
+
constructor(id: string);
|
|
88
|
+
private statsParameters;
|
|
89
|
+
private statsWrappedBalances;
|
|
90
|
+
private statsUnderlyingBalances;
|
|
91
|
+
private statsTotalLiquidity;
|
|
92
|
+
private statsVolume;
|
|
93
|
+
private statsBaseApy;
|
|
94
|
+
private statsTokenApy;
|
|
95
|
+
private statsRewardsApy;
|
|
96
|
+
private _calcLpTokenAmount;
|
|
97
|
+
private calcLpTokenAmount;
|
|
98
|
+
private calcLpTokenAmountWrapped;
|
|
99
|
+
depositBalancedAmounts(): Promise<string[]>;
|
|
100
|
+
depositExpected(amounts: (number | string)[]): Promise<string>;
|
|
101
|
+
depositBonus(amounts: (number | string)[]): Promise<string>;
|
|
102
|
+
depositIsApproved(amounts: (number | string)[]): Promise<boolean>;
|
|
103
|
+
private depositApproveEstimateGas;
|
|
104
|
+
depositApprove(amounts: (number | string)[]): Promise<string[]>;
|
|
105
|
+
private depositEstimateGas;
|
|
106
|
+
deposit(amounts: (number | string)[], slippage?: number): Promise<string>;
|
|
107
|
+
depositWrappedBalancedAmounts(): Promise<string[]>;
|
|
108
|
+
depositWrappedExpected(amounts: (number | string)[]): Promise<string>;
|
|
109
|
+
depositWrappedBonus(amounts: (number | string)[]): Promise<string>;
|
|
110
|
+
depositWrappedIsApproved(amounts: (number | string)[]): Promise<boolean>;
|
|
111
|
+
private depositWrappedApproveEstimateGas;
|
|
112
|
+
depositWrappedApprove(amounts: (number | string)[]): Promise<string[]>;
|
|
113
|
+
private depositWrappedEstimateGas;
|
|
114
|
+
depositWrapped(amounts: (number | string)[], slippage?: number): Promise<string>;
|
|
115
|
+
stakeIsApproved(lpTokenAmount: number | string): Promise<boolean>;
|
|
116
|
+
private stakeApproveEstimateGas;
|
|
117
|
+
stakeApprove(lpTokenAmount: number | string): Promise<string[]>;
|
|
118
|
+
private stakeEstimateGas;
|
|
119
|
+
stake(lpTokenAmount: number | string): Promise<string>;
|
|
120
|
+
private unstakeEstimateGas;
|
|
121
|
+
unstake(lpTokenAmount: number | string): Promise<string>;
|
|
122
|
+
claimableCrv(address?: string): Promise<string>;
|
|
123
|
+
claimCrvEstimateGas(): Promise<number>;
|
|
124
|
+
claimCrv(): Promise<string>;
|
|
125
|
+
claimableRewards(address?: string): Promise<{
|
|
126
|
+
token: string;
|
|
127
|
+
symbol: string;
|
|
128
|
+
amount: string;
|
|
129
|
+
}[]>;
|
|
130
|
+
claimRewardsEstimateGas(): Promise<number>;
|
|
131
|
+
claimRewards(): Promise<string>;
|
|
132
|
+
depositAndStakeExpected(amounts: (number | string)[]): Promise<string>;
|
|
133
|
+
depositAndStakeBonus(amounts: (number | string)[]): Promise<string>;
|
|
134
|
+
depositAndStakeIsApproved(amounts: (number | string)[]): Promise<boolean>;
|
|
135
|
+
private depositAndStakeApproveEstimateGas;
|
|
136
|
+
depositAndStakeApprove(amounts: (number | string)[]): Promise<string[]>;
|
|
137
|
+
private depositAndStakeEstimateGas;
|
|
138
|
+
depositAndStake(amounts: (number | string)[]): Promise<string>;
|
|
139
|
+
depositAndStakeWrappedExpected(amounts: (number | string)[]): Promise<string>;
|
|
140
|
+
depositAndStakeWrappedBonus(amounts: (number | string)[]): Promise<string>;
|
|
141
|
+
depositAndStakeWrappedIsApproved(amounts: (number | string)[]): Promise<boolean>;
|
|
142
|
+
private depositAndStakeWrappedApproveEstimateGas;
|
|
143
|
+
depositAndStakeWrappedApprove(amounts: (number | string)[]): Promise<string[]>;
|
|
144
|
+
private depositAndStakeWrappedEstimateGas;
|
|
145
|
+
depositAndStakeWrapped(amounts: (number | string)[]): Promise<string>;
|
|
146
|
+
private _depositAndStake;
|
|
147
|
+
withdrawExpected(lpTokenAmount: number | string): Promise<string[]>;
|
|
148
|
+
withdrawIsApproved(lpTokenAmount: number | string): Promise<boolean>;
|
|
149
|
+
private withdrawApproveEstimateGas;
|
|
150
|
+
withdrawApprove(lpTokenAmount: number | string): Promise<string[]>;
|
|
151
|
+
private withdrawEstimateGas;
|
|
152
|
+
withdraw(lpTokenAmount: number | string, slippage?: number): Promise<string>;
|
|
153
|
+
withdrawWrappedExpected(lpTokenAmount: number | string): Promise<string[]>;
|
|
154
|
+
private withdrawWrappedEstimateGas;
|
|
155
|
+
withdrawWrapped(lpTokenAmount: number | string, slippage?: number): Promise<string>;
|
|
156
|
+
withdrawImbalanceExpected(amounts: (number | string)[]): Promise<string>;
|
|
157
|
+
withdrawImbalanceBonus(amounts: (number | string)[]): Promise<string>;
|
|
158
|
+
withdrawImbalanceIsApproved(amounts: (number | string)[]): Promise<boolean>;
|
|
159
|
+
private withdrawImbalanceApproveEstimateGas;
|
|
160
|
+
withdrawImbalanceApprove(amounts: (number | string)[]): Promise<string[]>;
|
|
161
|
+
private withdrawImbalanceEstimateGas;
|
|
162
|
+
withdrawImbalance(amounts: (number | string)[], slippage?: number): Promise<string>;
|
|
163
|
+
withdrawImbalanceWrappedExpected(amounts: (number | string)[]): Promise<string>;
|
|
164
|
+
withdrawImbalanceWrappedBonus(amounts: (number | string)[]): Promise<string>;
|
|
165
|
+
private withdrawImbalanceWrappedEstimateGas;
|
|
166
|
+
withdrawImbalanceWrapped(amounts: (number | string)[], slippage?: number): Promise<string>;
|
|
167
|
+
private _withdrawOneCoinExpected;
|
|
168
|
+
withdrawOneCoinExpected(lpTokenAmount: number | string, coin: string | number): Promise<string>;
|
|
169
|
+
withdrawOneCoinBonus(lpTokenAmount: number | string, coin: string | number): Promise<string>;
|
|
170
|
+
withdrawOneCoinIsApproved(lpTokenAmount: number | string): Promise<boolean>;
|
|
171
|
+
private withdrawOneCoinApproveEstimateGas;
|
|
172
|
+
withdrawOneCoinApprove(lpTokenAmount: number | string): Promise<string[]>;
|
|
173
|
+
private withdrawOneCoinEstimateGas;
|
|
174
|
+
withdrawOneCoin(lpTokenAmount: number | string, coin: string | number, slippage?: number): Promise<string>;
|
|
175
|
+
private _withdrawOneCoinWrappedExpected;
|
|
176
|
+
withdrawOneCoinWrappedExpected(lpTokenAmount: number | string, coin: string | number): Promise<string>;
|
|
177
|
+
withdrawOneCoinWrappedBonus(lpTokenAmount: number | string, coin: string | number): Promise<string>;
|
|
178
|
+
private withdrawOneCoinWrappedEstimateGas;
|
|
179
|
+
withdrawOneCoinWrapped(lpTokenAmount: number | string, coin: string | number, slippage?: number): Promise<string>;
|
|
180
|
+
private walletBalances;
|
|
181
|
+
private walletLpTokenBalances;
|
|
182
|
+
private walletUnderlyingCoinBalances;
|
|
183
|
+
private walletWrappedCoinBalances;
|
|
184
|
+
private walletAllCoinBalances;
|
|
185
|
+
private _swapExpected;
|
|
186
|
+
swapExpected(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
187
|
+
swapPriceImpact(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
188
|
+
private _swapContractAddress;
|
|
189
|
+
swapIsApproved(inputCoin: string | number, amount: number | string): Promise<boolean>;
|
|
190
|
+
private swapApproveEstimateGas;
|
|
191
|
+
swapApprove(inputCoin: string | number, amount: number | string): Promise<string[]>;
|
|
192
|
+
private swapEstimateGas;
|
|
193
|
+
swap(inputCoin: string | number, outputCoin: string | number, amount: number | string, slippage?: number): Promise<string>;
|
|
194
|
+
private _swapWrappedExpected;
|
|
195
|
+
swapWrappedExpected(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
196
|
+
swapWrappedPriceImpact(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
197
|
+
swapWrappedIsApproved(inputCoin: string | number, amount: number | string): Promise<boolean>;
|
|
198
|
+
private swapWrappedApproveEstimateGas;
|
|
199
|
+
swapWrappedApprove(inputCoin: string | number, amount: number | string): Promise<string[]>;
|
|
200
|
+
private swapWrappedEstimateGas;
|
|
201
|
+
swapWrapped(inputCoin: string | number, outputCoin: string | number, amount: number | string, slippage?: number): Promise<string>;
|
|
202
|
+
gaugeMaxBoostedDeposit: (...addresses: string[]) => Promise<IDict<string>>;
|
|
203
|
+
gaugeOptimalDeposits: (...accounts: string[]) => Promise<IDict<string>>;
|
|
204
|
+
boost: (address: string) => Promise<string>;
|
|
205
|
+
private _getCoinIdx;
|
|
206
|
+
private _getRates;
|
|
207
|
+
private _balances;
|
|
208
|
+
private _underlyingPrices;
|
|
209
|
+
private _wrappedPrices;
|
|
210
|
+
private _withdrawCryptoBonus;
|
|
211
|
+
private _withdrawBonus;
|
|
212
|
+
}
|