@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/utils.d.ts
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import memoize from 'memoizee';
|
|
2
1
|
import { ethers } from 'ethers';
|
|
3
2
|
import BigNumber from 'bignumber.js';
|
|
4
|
-
import {
|
|
3
|
+
import { IDict } from './interfaces';
|
|
4
|
+
export declare const ETH_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
5
5
|
export declare const MAX_ALLOWANCE: ethers.BigNumber;
|
|
6
6
|
export declare const BN: (val: number | string) => BigNumber;
|
|
7
7
|
export declare const toBN: (n: ethers.BigNumber, decimals?: number) => BigNumber;
|
|
8
8
|
export declare const toStringFromBN: (bn: BigNumber, decimals?: number) => string;
|
|
9
9
|
export declare const fromBN: (bn: BigNumber, decimals?: number) => ethers.BigNumber;
|
|
10
|
+
export declare const _cutZeros: (strn: string) => string;
|
|
11
|
+
export declare const checkNumber: (n: number | string) => number | string;
|
|
12
|
+
export declare const formatNumber: (n: number | string, decimals?: number) => string;
|
|
13
|
+
export declare const parseUnits: (n: number | string, decimals?: number) => ethers.BigNumber;
|
|
10
14
|
export declare const isEth: (address: string) => boolean;
|
|
11
15
|
export declare const getEthIndex: (addresses: string[]) => number;
|
|
12
16
|
export declare const _getCoinAddresses: (...coins: string[] | string[][]) => string[];
|
|
13
17
|
export declare const _getCoinDecimals: (...coinAddresses: string[] | string[][]) => number[];
|
|
14
|
-
export declare const _getBalances: (coins: string[], addresses: string[]) => Promise<
|
|
18
|
+
export declare const _getBalances: (coins: string[], addresses: string[]) => Promise<IDict<string[]>>;
|
|
15
19
|
export declare const _prepareAddresses: (addresses: string[] | string[][]) => string[];
|
|
16
|
-
export declare const getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<
|
|
20
|
+
export declare const getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<IDict<string[]> | string[]>;
|
|
17
21
|
export declare const _getAllowance: (coins: string[], address: string, spender: string) => Promise<ethers.BigNumber[]>;
|
|
18
22
|
export declare const getAllowance: (coins: string[], address: string, spender: string) => Promise<string[]>;
|
|
19
|
-
export declare const hasAllowance: (coins: string[], amounts: string[], address: string, spender: string) => Promise<boolean>;
|
|
23
|
+
export declare const hasAllowance: (coins: string[], amounts: (number | string)[], address: string, spender: string) => Promise<boolean>;
|
|
20
24
|
export declare const _ensureAllowance: (coins: string[], amounts: ethers.BigNumber[], spender: string) => Promise<string[]>;
|
|
21
|
-
export declare const ensureAllowanceEstimateGas: (coins: string[], amounts: string[], spender: string) => Promise<number>;
|
|
22
|
-
export declare const ensureAllowance: (coins: string[], amounts: string[], spender: string) => Promise<string[]>;
|
|
25
|
+
export declare const ensureAllowanceEstimateGas: (coins: string[], amounts: (number | string)[], spender: string) => Promise<number>;
|
|
26
|
+
export declare const ensureAllowance: (coins: string[], amounts: (number | string)[], spender: string) => Promise<string[]>;
|
|
23
27
|
export declare const getPoolNameBySwapAddress: (swapAddress: string) => string;
|
|
24
|
-
export declare const _getUsdPricesFromApi: () => Promise<
|
|
28
|
+
export declare const _getUsdPricesFromApi: () => Promise<IDict<number>>;
|
|
25
29
|
export declare const _getUsdRate: (assetId: string) => Promise<number>;
|
|
26
|
-
export declare const _getFactoryStatsUrl: () => string;
|
|
27
|
-
export declare const _getStatsUrl: (isCrypto?: boolean) => string;
|
|
28
|
-
export declare const _getStats: ((statsUrl: string) => Promise<IStats>) & memoize.Memoized<(statsUrl: string) => Promise<IStats>>;
|
|
29
|
-
export declare const _getFactoryStatsEthereum: ((statsUrl: string) => Promise<IStats>) & memoize.Memoized<(statsUrl: string) => Promise<IStats>>;
|
|
30
|
-
export declare const _getFactoryStatsPolygon: ((statsUrl: string) => Promise<IStats>) & memoize.Memoized<(statsUrl: string) => Promise<IStats>>;
|
|
31
|
-
export declare const getPoolList: () => string[];
|
|
32
|
-
export declare const getFactoryPoolList: () => string[];
|
|
33
|
-
export declare const getCryptoFactoryPoolList: () => string[];
|
|
34
30
|
export declare const getUsdRate: (coin: string) => Promise<number>;
|
|
35
31
|
export declare const getTVL: (chainId?: number) => Promise<number>;
|
package/lib/utils.js
CHANGED
|
@@ -59,15 +59,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
59
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.getTVL = exports.getUsdRate = exports.
|
|
62
|
+
exports.getTVL = exports.getUsdRate = exports._getUsdRate = exports._getUsdPricesFromApi = exports.getPoolNameBySwapAddress = exports.ensureAllowance = exports.ensureAllowanceEstimateGas = exports._ensureAllowance = exports.hasAllowance = exports.getAllowance = exports._getAllowance = exports.getBalances = exports._prepareAddresses = exports._getBalances = exports._getCoinDecimals = exports._getCoinAddresses = exports.getEthIndex = exports.isEth = exports.parseUnits = exports.formatNumber = exports.checkNumber = exports._cutZeros = exports.fromBN = exports.toStringFromBN = exports.toBN = exports.BN = exports.MAX_ALLOWANCE = exports.ETH_ADDRESS = void 0;
|
|
63
63
|
var axios_1 = __importDefault(require("axios"));
|
|
64
|
-
var memoizee_1 = __importDefault(require("memoizee"));
|
|
65
64
|
var ethers_1 = require("ethers");
|
|
66
65
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
67
66
|
var curve_1 = require("./curve");
|
|
68
|
-
var curve_2 = require("./curve");
|
|
69
67
|
var external_api_1 = require("./external-api");
|
|
70
|
-
|
|
68
|
+
exports.ETH_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
71
69
|
exports.MAX_ALLOWANCE = ethers_1.ethers.BigNumber.from(2).pow(ethers_1.ethers.BigNumber.from(256)).sub(ethers_1.ethers.BigNumber.from(1));
|
|
72
70
|
// bignumber.js
|
|
73
71
|
var BN = function (val) { return new bignumber_js_1.default(val); };
|
|
@@ -87,10 +85,34 @@ var fromBN = function (bn, decimals) {
|
|
|
87
85
|
return ethers_1.ethers.utils.parseUnits((0, exports.toStringFromBN)(bn, decimals), decimals);
|
|
88
86
|
};
|
|
89
87
|
exports.fromBN = fromBN;
|
|
88
|
+
// Formatting numbers
|
|
89
|
+
var _cutZeros = function (strn) {
|
|
90
|
+
return strn.replace(/0+$/gi, '').replace(/\.$/gi, '');
|
|
91
|
+
};
|
|
92
|
+
exports._cutZeros = _cutZeros;
|
|
93
|
+
var checkNumber = function (n) {
|
|
94
|
+
if (Number(n) !== Number(n))
|
|
95
|
+
throw Error("".concat(n, " is not a number")); // NaN
|
|
96
|
+
return n;
|
|
97
|
+
};
|
|
98
|
+
exports.checkNumber = checkNumber;
|
|
99
|
+
var formatNumber = function (n, decimals) {
|
|
100
|
+
if (decimals === void 0) { decimals = 18; }
|
|
101
|
+
if (Number(n) !== Number(n))
|
|
102
|
+
throw Error("".concat(n, " is not a number")); // NaN
|
|
103
|
+
var _a = String(n).split("."), integer = _a[0], fractional = _a[1];
|
|
104
|
+
return !fractional ? integer : integer + "." + fractional.slice(0, decimals);
|
|
105
|
+
};
|
|
106
|
+
exports.formatNumber = formatNumber;
|
|
107
|
+
var parseUnits = function (n, decimals) {
|
|
108
|
+
if (decimals === void 0) { decimals = 18; }
|
|
109
|
+
return ethers_1.ethers.utils.parseUnits((0, exports.formatNumber)(n, decimals), decimals);
|
|
110
|
+
};
|
|
111
|
+
exports.parseUnits = parseUnits;
|
|
90
112
|
// -------------------
|
|
91
|
-
var isEth = function (address) { return address.toLowerCase() === ETH_ADDRESS.toLowerCase(); };
|
|
113
|
+
var isEth = function (address) { return address.toLowerCase() === exports.ETH_ADDRESS.toLowerCase(); };
|
|
92
114
|
exports.isEth = isEth;
|
|
93
|
-
var getEthIndex = function (addresses) { return addresses.map(function (address) { return address.toLowerCase(); }).indexOf(ETH_ADDRESS.toLowerCase()); };
|
|
115
|
+
var getEthIndex = function (addresses) { return addresses.map(function (address) { return address.toLowerCase(); }).indexOf(exports.ETH_ADDRESS.toLowerCase()); };
|
|
94
116
|
exports.getEthIndex = getEthIndex;
|
|
95
117
|
// coins can be either addresses or symbols
|
|
96
118
|
var _getCoinAddresses = function () {
|
|
@@ -101,11 +123,11 @@ var _getCoinAddresses = function () {
|
|
|
101
123
|
if (coins.length == 1 && Array.isArray(coins[0]))
|
|
102
124
|
coins = coins[0];
|
|
103
125
|
coins = coins;
|
|
104
|
-
var coinAddresses = coins.map(function (c) { return
|
|
105
|
-
var availableAddresses = __spreadArray(__spreadArray(
|
|
126
|
+
var coinAddresses = coins.map(function (c) { return c.toLowerCase(); }).map(function (c) { return curve_1.curve.constants.COINS[c] || c; });
|
|
127
|
+
var availableAddresses = __spreadArray(__spreadArray([], Object.keys(curve_1.curve.constants.DECIMALS), true), curve_1.curve.constants.GAUGES, true);
|
|
106
128
|
for (var _a = 0, coinAddresses_1 = coinAddresses; _a < coinAddresses_1.length; _a++) {
|
|
107
129
|
var coinAddr = coinAddresses_1[_a];
|
|
108
|
-
if (!availableAddresses.includes(coinAddr
|
|
130
|
+
if (!availableAddresses.includes(coinAddr))
|
|
109
131
|
throw Error("Coin with address '".concat(coinAddr, "' is not available"));
|
|
110
132
|
}
|
|
111
133
|
return coinAddresses;
|
|
@@ -119,7 +141,7 @@ var _getCoinDecimals = function () {
|
|
|
119
141
|
if (coinAddresses.length == 1 && Array.isArray(coinAddresses[0]))
|
|
120
142
|
coinAddresses = coinAddresses[0];
|
|
121
143
|
coinAddresses = coinAddresses;
|
|
122
|
-
return coinAddresses.map(function (coinAddr) { var _a; return (_a =
|
|
144
|
+
return coinAddresses.map(function (coinAddr) { var _a; return (_a = curve_1.curve.constants.DECIMALS[coinAddr.toLowerCase()]) !== null && _a !== void 0 ? _a : 18; }); // 18 for gauges
|
|
123
145
|
};
|
|
124
146
|
exports._getCoinDecimals = _getCoinDecimals;
|
|
125
147
|
var _getBalances = function (coins, addresses) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -263,7 +285,7 @@ var hasAllowance = function (coins, amounts, address, spender) { return __awaite
|
|
|
263
285
|
return [4 /*yield*/, (0, exports._getAllowance)(coinAddresses, address, spender)];
|
|
264
286
|
case 1:
|
|
265
287
|
_allowance = _a.sent();
|
|
266
|
-
_amounts = amounts.map(function (a, i) { return
|
|
288
|
+
_amounts = amounts.map(function (a, i) { return (0, exports.parseUnits)(a, decimals[i]); });
|
|
267
289
|
return [2 /*return*/, _allowance.map(function (a, i) { return a.gte(_amounts[i]); }).reduce(function (a, b) { return a && b; })];
|
|
268
290
|
}
|
|
269
291
|
});
|
|
@@ -321,7 +343,7 @@ var ensureAllowanceEstimateGas = function (coins, amounts, spender) { return __a
|
|
|
321
343
|
case 0:
|
|
322
344
|
coinAddresses = (0, exports._getCoinAddresses)(coins);
|
|
323
345
|
decimals = (0, exports._getCoinDecimals)(coinAddresses);
|
|
324
|
-
_amounts = amounts.map(function (a, i) { return
|
|
346
|
+
_amounts = amounts.map(function (a, i) { return (0, exports.parseUnits)(a, decimals[i]); });
|
|
325
347
|
address = curve_1.curve.signerAddress;
|
|
326
348
|
return [4 /*yield*/, (0, exports._getAllowance)(coinAddresses, address, spender)];
|
|
327
349
|
case 1:
|
|
@@ -361,7 +383,7 @@ var ensureAllowance = function (coins, amounts, spender) { return __awaiter(void
|
|
|
361
383
|
case 0:
|
|
362
384
|
coinAddresses = (0, exports._getCoinAddresses)(coins);
|
|
363
385
|
decimals = (0, exports._getCoinDecimals)(coinAddresses);
|
|
364
|
-
_amounts = amounts.map(function (a, i) { return
|
|
386
|
+
_amounts = amounts.map(function (a, i) { return (0, exports.parseUnits)(a, decimals[i]); });
|
|
365
387
|
return [4 /*yield*/, (0, exports._ensureAllowance)(coinAddresses, _amounts, spender)];
|
|
366
388
|
case 1: return [2 /*return*/, _a.sent()];
|
|
367
389
|
}
|
|
@@ -369,7 +391,8 @@ var ensureAllowance = function (coins, amounts, spender) { return __awaiter(void
|
|
|
369
391
|
}); };
|
|
370
392
|
exports.ensureAllowance = ensureAllowance;
|
|
371
393
|
var getPoolNameBySwapAddress = function (swapAddress) {
|
|
372
|
-
|
|
394
|
+
var poolsData = __assign(__assign(__assign({}, curve_1.curve.constants.POOLS_DATA), curve_1.curve.constants.FACTORY_POOLS_DATA), curve_1.curve.constants.CRYPTO_FACTORY_POOLS_DATA);
|
|
395
|
+
return Object.entries(poolsData).filter(function (_a) {
|
|
373
396
|
var _ = _a[0], poolData = _a[1];
|
|
374
397
|
return poolData.swap_address.toLowerCase() === swapAddress.toLowerCase();
|
|
375
398
|
})[0][0];
|
|
@@ -381,7 +404,7 @@ var _getUsdPricesFromApi = function () { return __awaiter(void 0, void 0, void 0
|
|
|
381
404
|
return __generator(this, function (_h) {
|
|
382
405
|
switch (_h.label) {
|
|
383
406
|
case 0:
|
|
384
|
-
network = curve_1.curve.
|
|
407
|
+
network = curve_1.curve.constants.NETWORK_NAME;
|
|
385
408
|
promises = [
|
|
386
409
|
(0, external_api_1._getPoolsFromApi)(network, "main"),
|
|
387
410
|
(0, external_api_1._getPoolsFromApi)(network, "crypto"),
|
|
@@ -415,7 +438,7 @@ var _getUsdPricesFromApi = function () { return __awaiter(void 0, void 0, void 0
|
|
|
415
438
|
exports._getUsdPricesFromApi = _getUsdPricesFromApi;
|
|
416
439
|
var _usdRatesCache = {};
|
|
417
440
|
var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
418
|
-
var pricesFromApi, chainName, url, response;
|
|
441
|
+
var pricesFromApi, chainName, nativeTokenName, url, response;
|
|
419
442
|
var _a, _b;
|
|
420
443
|
return __generator(this, function (_c) {
|
|
421
444
|
switch (_c.label) {
|
|
@@ -424,30 +447,35 @@ var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, void 0,
|
|
|
424
447
|
pricesFromApi = _c.sent();
|
|
425
448
|
if (assetId.toLowerCase() in pricesFromApi)
|
|
426
449
|
return [2 /*return*/, pricesFromApi[assetId.toLowerCase()]];
|
|
427
|
-
if (assetId === 'USD' || (curve_1.curve.chainId === 137 && (assetId.toLowerCase() ===
|
|
450
|
+
if (assetId === 'USD' || (curve_1.curve.chainId === 137 && (assetId.toLowerCase() === curve_1.curve.constants.COINS.am3crv.toLowerCase())))
|
|
428
451
|
return [2 /*return*/, 1];
|
|
429
452
|
chainName = {
|
|
430
453
|
1: 'ethereum',
|
|
431
454
|
137: 'polygon-pos',
|
|
432
|
-
|
|
455
|
+
43114: 'avalanche',
|
|
456
|
+
}[curve_1.curve.chainId];
|
|
457
|
+
nativeTokenName = {
|
|
458
|
+
1: 'ethereum',
|
|
459
|
+
137: 'matic-network',
|
|
460
|
+
43114: 'avalanche-2',
|
|
433
461
|
}[curve_1.curve.chainId];
|
|
434
462
|
if (chainName === undefined) {
|
|
435
463
|
throw Error('curve object is not initialized');
|
|
436
464
|
}
|
|
437
465
|
assetId = {
|
|
438
|
-
'EUR':
|
|
466
|
+
'EUR': curve_1.curve.constants.COINS.eurt,
|
|
439
467
|
'BTC': 'bitcoin',
|
|
440
468
|
'ETH': 'ethereum',
|
|
441
469
|
'LINK': 'link',
|
|
442
470
|
}[assetId] || assetId;
|
|
443
|
-
assetId = (0, exports.isEth)(assetId) ?
|
|
471
|
+
assetId = (0, exports.isEth)(assetId) ? nativeTokenName : assetId.toLowerCase();
|
|
444
472
|
// No EURT on Coingecko Polygon
|
|
445
|
-
if (assetId.toLowerCase() ===
|
|
473
|
+
if (assetId.toLowerCase() === curve_1.curve.constants.COINS.eurt.toLowerCase()) {
|
|
446
474
|
chainName = 'ethereum';
|
|
447
475
|
assetId = '0xC581b735A1688071A1746c968e0798D642EDE491'.toLowerCase(); // EURT Ethereum
|
|
448
476
|
}
|
|
449
477
|
if (!((((_a = _usdRatesCache[assetId]) === null || _a === void 0 ? void 0 : _a.time) || 0) + 600000 < Date.now())) return [3 /*break*/, 3];
|
|
450
|
-
url = [
|
|
478
|
+
url = [nativeTokenName, 'bitcoin', 'link'].includes(assetId.toLowerCase()) ?
|
|
451
479
|
"https://api.coingecko.com/api/v3/simple/price?ids=".concat(assetId, "&vs_currencies=usd") :
|
|
452
480
|
"https://api.coingecko.com/api/v3/simple/token_price/".concat(chainName, "?contract_addresses=").concat(assetId, "&vs_currencies=usd");
|
|
453
481
|
return [4 /*yield*/, axios_1.default.get(url)];
|
|
@@ -465,118 +493,6 @@ var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, void 0,
|
|
|
465
493
|
});
|
|
466
494
|
}); };
|
|
467
495
|
exports._getUsdRate = _getUsdRate;
|
|
468
|
-
var _getFactoryStatsUrl = function () {
|
|
469
|
-
if (curve_1.curve.chainId === 1 || curve_1.curve.chainId === 1337) {
|
|
470
|
-
return "https://curve-api-hplkiejxx-curvefi.vercel.app/api/getSubgraphData";
|
|
471
|
-
}
|
|
472
|
-
else if (curve_1.curve.chainId === 137) {
|
|
473
|
-
return "https://api.curve.fi/api/getFactoryAPYs-polygon";
|
|
474
|
-
}
|
|
475
|
-
else {
|
|
476
|
-
throw Error("Unsupported network id".concat(curve_1.curve.chainId));
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
exports._getFactoryStatsUrl = _getFactoryStatsUrl;
|
|
480
|
-
var _getStatsUrl = function (isCrypto) {
|
|
481
|
-
if (isCrypto === void 0) { isCrypto = false; }
|
|
482
|
-
if (curve_1.curve.chainId === 1 || curve_1.curve.chainId === 1337) {
|
|
483
|
-
return isCrypto ? "https://stats.curve.fi/raw-stats-crypto/apys.json" : "https://stats.curve.fi/raw-stats/apys.json";
|
|
484
|
-
}
|
|
485
|
-
else if (curve_1.curve.chainId === 137) {
|
|
486
|
-
return "https://stats.curve.fi/raw-stats-polygon/apys.json";
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
489
|
-
throw Error("Unsupported network id".concat(curve_1.curve.chainId));
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
exports._getStatsUrl = _getStatsUrl;
|
|
493
|
-
exports._getStats = (0, memoizee_1.default)(function (statsUrl) { return __awaiter(void 0, void 0, void 0, function () {
|
|
494
|
-
var rawData, data;
|
|
495
|
-
return __generator(this, function (_a) {
|
|
496
|
-
switch (_a.label) {
|
|
497
|
-
case 0: return [4 /*yield*/, axios_1.default.get(statsUrl)];
|
|
498
|
-
case 1:
|
|
499
|
-
rawData = (_a.sent()).data;
|
|
500
|
-
data = {};
|
|
501
|
-
Object.keys(rawData.apy.day).forEach(function (poolName) {
|
|
502
|
-
var _a;
|
|
503
|
-
data[poolName] = {
|
|
504
|
-
volume: (_a = rawData.volume[poolName]) !== null && _a !== void 0 ? _a : 0,
|
|
505
|
-
apy: {
|
|
506
|
-
day: rawData.apy.day[poolName],
|
|
507
|
-
week: rawData.apy.week[poolName],
|
|
508
|
-
month: rawData.apy.month[poolName],
|
|
509
|
-
total: rawData.apy.total[poolName],
|
|
510
|
-
},
|
|
511
|
-
};
|
|
512
|
-
});
|
|
513
|
-
return [2 /*return*/, data];
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
}); }, {
|
|
517
|
-
promise: true,
|
|
518
|
-
maxAge: 10 * 60 * 1000, // 10m
|
|
519
|
-
});
|
|
520
|
-
exports._getFactoryStatsEthereum = (0, memoizee_1.default)(function (statsUrl) { return __awaiter(void 0, void 0, void 0, function () {
|
|
521
|
-
var rawData, data;
|
|
522
|
-
return __generator(this, function (_a) {
|
|
523
|
-
switch (_a.label) {
|
|
524
|
-
case 0: return [4 /*yield*/, axios_1.default.get(statsUrl)];
|
|
525
|
-
case 1:
|
|
526
|
-
rawData = (_a.sent()).data.data.poolList;
|
|
527
|
-
data = {};
|
|
528
|
-
rawData.forEach(function (item) {
|
|
529
|
-
var _a, _b, _c, _d, _e;
|
|
530
|
-
data[item.address.toLowerCase()] = {
|
|
531
|
-
volume: (_a = item.volumeUSD) !== null && _a !== void 0 ? _a : 0,
|
|
532
|
-
apy: {
|
|
533
|
-
day: (_b = item.latestDailyApy) !== null && _b !== void 0 ? _b : 0,
|
|
534
|
-
week: (_c = item.latestWeeklyApy) !== null && _c !== void 0 ? _c : 0,
|
|
535
|
-
month: (_d = item.latestWeeklyApy) !== null && _d !== void 0 ? _d : 0,
|
|
536
|
-
total: (_e = item.latestWeeklyApy) !== null && _e !== void 0 ? _e : 0,
|
|
537
|
-
},
|
|
538
|
-
};
|
|
539
|
-
});
|
|
540
|
-
return [2 /*return*/, data];
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}); }, {
|
|
544
|
-
promise: true,
|
|
545
|
-
maxAge: 10 * 60 * 1000, // 10m
|
|
546
|
-
});
|
|
547
|
-
exports._getFactoryStatsPolygon = (0, memoizee_1.default)(function (statsUrl) { return __awaiter(void 0, void 0, void 0, function () {
|
|
548
|
-
var rawData, data;
|
|
549
|
-
return __generator(this, function (_a) {
|
|
550
|
-
switch (_a.label) {
|
|
551
|
-
case 0: return [4 /*yield*/, axios_1.default.get(statsUrl)];
|
|
552
|
-
case 1:
|
|
553
|
-
rawData = (_a.sent()).data.data.poolDetails;
|
|
554
|
-
data = {};
|
|
555
|
-
rawData.forEach(function (item) {
|
|
556
|
-
var _a, _b, _c, _d, _e;
|
|
557
|
-
data[item.poolAddress.toLowerCase()] = {
|
|
558
|
-
volume: (_a = item.volume) !== null && _a !== void 0 ? _a : 0,
|
|
559
|
-
apy: {
|
|
560
|
-
day: (_b = item.apy) !== null && _b !== void 0 ? _b : 0,
|
|
561
|
-
week: (_c = item.apy) !== null && _c !== void 0 ? _c : 0,
|
|
562
|
-
month: (_d = item.apy) !== null && _d !== void 0 ? _d : 0,
|
|
563
|
-
total: (_e = item.apy) !== null && _e !== void 0 ? _e : 0,
|
|
564
|
-
},
|
|
565
|
-
};
|
|
566
|
-
});
|
|
567
|
-
return [2 /*return*/, data];
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
}); }, {
|
|
571
|
-
promise: true,
|
|
572
|
-
maxAge: 10 * 60 * 1000, // 10m
|
|
573
|
-
});
|
|
574
|
-
var getPoolList = function () { return Object.keys(curve_1.POOLS_DATA); };
|
|
575
|
-
exports.getPoolList = getPoolList;
|
|
576
|
-
var getFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.FACTORY_POOLS_DATA); };
|
|
577
|
-
exports.getFactoryPoolList = getFactoryPoolList;
|
|
578
|
-
var getCryptoFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.CRYPTO_FACTORY_POOLS_DATA); };
|
|
579
|
-
exports.getCryptoFactoryPoolList = getCryptoFactoryPoolList;
|
|
580
496
|
var getUsdRate = function (coin) { return __awaiter(void 0, void 0, void 0, function () {
|
|
581
497
|
var coinAddress;
|
|
582
498
|
return __generator(this, function (_a) {
|
|
@@ -593,10 +509,15 @@ var getTVL = function (chainId) {
|
|
|
593
509
|
if (chainId === void 0) { chainId = curve_1.curve.chainId; }
|
|
594
510
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
595
511
|
var network, promises, allTypesExtendedPoolData;
|
|
596
|
-
|
|
597
|
-
|
|
512
|
+
var _a;
|
|
513
|
+
return __generator(this, function (_b) {
|
|
514
|
+
switch (_b.label) {
|
|
598
515
|
case 0:
|
|
599
|
-
network =
|
|
516
|
+
network = (_a = {
|
|
517
|
+
1: "ethereum",
|
|
518
|
+
137: "polygon",
|
|
519
|
+
43114: "avalanche",
|
|
520
|
+
}[chainId]) !== null && _a !== void 0 ? _a : "ethereum";
|
|
600
521
|
promises = [
|
|
601
522
|
(0, external_api_1._getPoolsFromApi)(network, "main"),
|
|
602
523
|
(0, external_api_1._getPoolsFromApi)(network, "crypto"),
|
|
@@ -605,7 +526,7 @@ var getTVL = function (chainId) {
|
|
|
605
526
|
];
|
|
606
527
|
return [4 /*yield*/, Promise.all(promises)];
|
|
607
528
|
case 1:
|
|
608
|
-
allTypesExtendedPoolData =
|
|
529
|
+
allTypesExtendedPoolData = _b.sent();
|
|
609
530
|
return [2 /*return*/, allTypesExtendedPoolData.reduce(function (sum, data) { var _a; return sum + ((_a = data.tvl) !== null && _a !== void 0 ? _a : data.tvlAll); }, 0)];
|
|
610
531
|
}
|
|
611
532
|
});
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{ "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "adai", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "claim", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "internalType": "address", "name": "_claimer", "type": "address" }], "name": "claimable", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "governance", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "seize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "yfi", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }]
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"outputs": [],
|
|
4
|
-
"inputs": [
|
|
5
|
-
{
|
|
6
|
-
"type": "address",
|
|
7
|
-
"name": "_old"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"type": "address",
|
|
11
|
-
"name": "_old_token"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"type": "address",
|
|
15
|
-
"name": "_new"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"type": "address",
|
|
19
|
-
"name": "_new_token"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"type": "address[2]",
|
|
23
|
-
"name": "_coins"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"constant": false,
|
|
27
|
-
"payable": false,
|
|
28
|
-
"type": "constructor"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "migrate",
|
|
32
|
-
"outputs": [],
|
|
33
|
-
"inputs": [],
|
|
34
|
-
"constant": false,
|
|
35
|
-
"payable": false,
|
|
36
|
-
"type": "function",
|
|
37
|
-
"gas": "106812"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "coins",
|
|
41
|
-
"outputs": [
|
|
42
|
-
{
|
|
43
|
-
"type": "address",
|
|
44
|
-
"name": "out"
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"inputs": [
|
|
48
|
-
{
|
|
49
|
-
"type": "int128",
|
|
50
|
-
"name": "arg0"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"stateMutability": "view",
|
|
54
|
-
"type": "function",
|
|
55
|
-
"gas": "1380"
|
|
56
|
-
}
|
|
57
|
-
]
|