@curvefi/api 2.8.8 → 2.10.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/lib/constants/aliases.d.ts +1 -0
- package/lib/constants/aliases.js +13 -1
- package/lib/constants/coins/moonbeam.d.ts +7 -0
- package/lib/constants/coins/moonbeam.js +16 -0
- package/lib/constants/pools/index.d.ts +2 -1
- package/lib/constants/pools/index.js +3 -1
- package/lib/constants/pools/moonbeam.d.ts +4 -0
- package/lib/constants/pools/moonbeam.js +37 -0
- package/lib/curve.d.ts +1 -0
- package/lib/curve.js +17 -0
- package/lib/external-api.d.ts +22 -0
- package/lib/external-api.js +41 -1
- package/lib/factory/common.js +9 -94
- package/lib/factory/constants.d.ts +38 -8
- package/lib/factory/constants.js +103 -18
- package/lib/factory/factory-api.js +3 -1
- package/lib/factory/factory-crypto.js +3 -0
- package/lib/factory/factory.js +4 -1
- package/lib/interfaces.d.ts +7 -0
- package/lib/pools/PoolTemplate.js +58 -17
- package/lib/router.d.ts +10 -0
- package/lib/router.js +453 -123
- package/lib/utils.js +12 -6
- package/package.json +2 -2
|
@@ -5,3 +5,4 @@ export declare const ALIASES_AVALANCHE: import("../interfaces").IDict<string>;
|
|
|
5
5
|
export declare const ALIASES_ARBITRUM: import("../interfaces").IDict<string>;
|
|
6
6
|
export declare const ALIASES_OPTIMISM: import("../interfaces").IDict<string>;
|
|
7
7
|
export declare const ALIASES_XDAI: import("../interfaces").IDict<string>;
|
|
8
|
+
export declare const ALIASES_MOONBEAM: import("../interfaces").IDict<string>;
|
package/lib/constants/aliases.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALIASES_XDAI = exports.ALIASES_OPTIMISM = exports.ALIASES_ARBITRUM = exports.ALIASES_AVALANCHE = exports.ALIASES_FANTOM = exports.ALIASES_POLYGON = exports.ALIASES_ETHEREUM = void 0;
|
|
3
|
+
exports.ALIASES_MOONBEAM = exports.ALIASES_XDAI = exports.ALIASES_OPTIMISM = exports.ALIASES_ARBITRUM = exports.ALIASES_AVALANCHE = exports.ALIASES_FANTOM = exports.ALIASES_POLYGON = exports.ALIASES_ETHEREUM = void 0;
|
|
4
4
|
var utils_1 = require("./utils");
|
|
5
5
|
exports.ALIASES_ETHEREUM = (0, utils_1.lowerCaseValues)({
|
|
6
6
|
"crv": "0xD533a949740bb3306d119CC777fa900bA034cd52",
|
|
@@ -86,3 +86,15 @@ exports.ALIASES_XDAI = (0, utils_1.lowerCaseValues)({
|
|
|
86
86
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
87
87
|
"registry_exchange": "",
|
|
88
88
|
});
|
|
89
|
+
exports.ALIASES_MOONBEAM = (0, utils_1.lowerCaseValues)({
|
|
90
|
+
"crv": "0x7C598c96D02398d89FbCb9d41Eab3DF0C16F227D",
|
|
91
|
+
"minter": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
92
|
+
"voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
|
|
93
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
94
|
+
"address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383",
|
|
95
|
+
"router": "0xfA9a30350048B2BF66865ee20363067c66f67e58",
|
|
96
|
+
"deposit_and_stake": "0xB7De33440B7171159a9718CBE748086cecDd9685",
|
|
97
|
+
"factory": '0x4244eB811D6e0Ef302326675207A95113dB4E1F8',
|
|
98
|
+
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
99
|
+
"registry_exchange": "",
|
|
100
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aTokensMoonbeam = exports.ycTokensMoonbeam = exports.yTokensMoonbeam = exports.cTokensMoonbeam = exports.COINS_MOONBEAM = void 0;
|
|
4
|
+
var utils_1 = require("../utils");
|
|
5
|
+
exports.COINS_MOONBEAM = (0, utils_1.lowerCaseValues)({
|
|
6
|
+
'crv': '0x712b3d230f3c1c19db860d80619288b1f0bdd0bd',
|
|
7
|
+
// --- USD ---
|
|
8
|
+
'dai': '0xc234A67a4F840E61adE794be47de455361b52413',
|
|
9
|
+
'usdc': '0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9',
|
|
10
|
+
'usdt': '0x8e70cD5B4Ff3f62659049e74b6649c6603A0E594',
|
|
11
|
+
'3crv': '0xace58a26b8db90498ef0330fdc9c2655db0c45e2',
|
|
12
|
+
});
|
|
13
|
+
exports.cTokensMoonbeam = []; //.map((a) => a.toLowerCase());
|
|
14
|
+
exports.yTokensMoonbeam = []; //.map((a) => a.toLowerCase());
|
|
15
|
+
exports.ycTokensMoonbeam = []; //.map((a) => a.toLowerCase());
|
|
16
|
+
exports.aTokensMoonbeam = []; //.map((a) => a.toLowerCase());
|
|
@@ -5,4 +5,5 @@ import { POOLS_DATA_AVALANCHE } from "./avalanche";
|
|
|
5
5
|
import { POOLS_DATA_ARBITRUM } from "./arbitrum";
|
|
6
6
|
import { POOLS_DATA_OPTIMISM } from "./optimism";
|
|
7
7
|
import { POOLS_DATA_XDAI } from "./xdai";
|
|
8
|
-
|
|
8
|
+
import { POOLS_DATA_MOONBEAM } from "./moonbeam";
|
|
9
|
+
export { POOLS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.POOLS_DATA_XDAI = exports.POOLS_DATA_OPTIMISM = exports.POOLS_DATA_ARBITRUM = exports.POOLS_DATA_AVALANCHE = exports.POOLS_DATA_FANTOM = exports.POOLS_DATA_POLYGON = exports.POOLS_DATA_ETHEREUM = void 0;
|
|
3
|
+
exports.POOLS_DATA_MOONBEAM = exports.POOLS_DATA_XDAI = exports.POOLS_DATA_OPTIMISM = exports.POOLS_DATA_ARBITRUM = exports.POOLS_DATA_AVALANCHE = exports.POOLS_DATA_FANTOM = exports.POOLS_DATA_POLYGON = exports.POOLS_DATA_ETHEREUM = void 0;
|
|
4
4
|
var ethereum_1 = require("./ethereum");
|
|
5
5
|
Object.defineProperty(exports, "POOLS_DATA_ETHEREUM", { enumerable: true, get: function () { return ethereum_1.POOLS_DATA_ETHEREUM; } });
|
|
6
6
|
var polygon_1 = require("./polygon");
|
|
@@ -15,3 +15,5 @@ var optimism_1 = require("./optimism");
|
|
|
15
15
|
Object.defineProperty(exports, "POOLS_DATA_OPTIMISM", { enumerable: true, get: function () { return optimism_1.POOLS_DATA_OPTIMISM; } });
|
|
16
16
|
var xdai_1 = require("./xdai");
|
|
17
17
|
Object.defineProperty(exports, "POOLS_DATA_XDAI", { enumerable: true, get: function () { return xdai_1.POOLS_DATA_XDAI; } });
|
|
18
|
+
var moonbeam_1 = require("./moonbeam");
|
|
19
|
+
Object.defineProperty(exports, "POOLS_DATA_MOONBEAM", { enumerable: true, get: function () { return moonbeam_1.POOLS_DATA_MOONBEAM; } });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.POOLS_DATA_MOONBEAM = void 0;
|
|
7
|
+
var swap_json_1 = __importDefault(require("../abis/3pool-optimism/swap.json"));
|
|
8
|
+
var gauge_child_json_1 = __importDefault(require("../abis/gauge_child.json"));
|
|
9
|
+
var utils_1 = require("../utils");
|
|
10
|
+
exports.POOLS_DATA_MOONBEAM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
11
|
+
'3pool': {
|
|
12
|
+
name: "3pool",
|
|
13
|
+
full_name: "3pool",
|
|
14
|
+
symbol: "3pool",
|
|
15
|
+
reference_asset: 'USD',
|
|
16
|
+
swap_address: '0xace58a26b8db90498ef0330fdc9c2655db0c45e2',
|
|
17
|
+
token_address: '0xace58a26b8db90498ef0330fdc9c2655db0c45e2',
|
|
18
|
+
gauge_address: '0x0000000000000000000000000000000000000000',
|
|
19
|
+
is_plain: true,
|
|
20
|
+
underlying_coins: ['DAI', 'USDC', 'USDT'],
|
|
21
|
+
wrapped_coins: ['DAI', 'USDC', 'USDT'],
|
|
22
|
+
underlying_coin_addresses: [
|
|
23
|
+
'0xc234A67a4F840E61adE794be47de455361b52413',
|
|
24
|
+
'0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9',
|
|
25
|
+
'0x8e70cD5B4Ff3f62659049e74b6649c6603A0E594',
|
|
26
|
+
],
|
|
27
|
+
wrapped_coin_addresses: [
|
|
28
|
+
'0xc234A67a4F840E61adE794be47de455361b52413',
|
|
29
|
+
'0x8f552a71EFE5eeFc207Bf75485b356A0b3f01eC9',
|
|
30
|
+
'0x8e70cD5B4Ff3f62659049e74b6649c6603A0E594',
|
|
31
|
+
],
|
|
32
|
+
underlying_decimals: [18, 6, 6],
|
|
33
|
+
wrapped_decimals: [18, 6, 6],
|
|
34
|
+
swap_abi: swap_json_1.default,
|
|
35
|
+
gauge_abi: gauge_child_json_1.default,
|
|
36
|
+
},
|
|
37
|
+
});
|
package/lib/curve.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ declare class Curve implements ICurve {
|
|
|
55
55
|
maxPriorityFeePerGas?: number;
|
|
56
56
|
chainId?: number;
|
|
57
57
|
}): Promise<void>;
|
|
58
|
+
setContract(address: string, abi: any): void;
|
|
58
59
|
fetchFactoryPools(useApi?: boolean): Promise<void>;
|
|
59
60
|
fetchCryptoFactoryPools(useApi?: boolean): Promise<void>;
|
|
60
61
|
setCustomFeeData(customFeeData: {
|
package/lib/curve.js
CHANGED
|
@@ -88,6 +88,7 @@ var fantom_1 = require("./constants/coins/fantom");
|
|
|
88
88
|
var avalanche_1 = require("./constants/coins/avalanche");
|
|
89
89
|
var arbitrum_1 = require("./constants/coins/arbitrum");
|
|
90
90
|
var xdai_1 = require("./constants/coins/xdai");
|
|
91
|
+
var moonbeam_1 = require("./constants/coins/moonbeam");
|
|
91
92
|
var utils_1 = require("./constants/utils");
|
|
92
93
|
exports.NETWORK_CONSTANTS = {
|
|
93
94
|
1: {
|
|
@@ -140,6 +141,16 @@ exports.NETWORK_CONSTANTS = {
|
|
|
140
141
|
ycTokens: fantom_1.ycTokensFantom,
|
|
141
142
|
aTokens: fantom_1.aTokensFantom,
|
|
142
143
|
},
|
|
144
|
+
1284: {
|
|
145
|
+
NAME: 'moonbeam',
|
|
146
|
+
ALIASES: aliases_1.ALIASES_MOONBEAM,
|
|
147
|
+
POOLS_DATA: pools_1.POOLS_DATA_MOONBEAM,
|
|
148
|
+
COINS: moonbeam_1.COINS_MOONBEAM,
|
|
149
|
+
cTokens: moonbeam_1.cTokensMoonbeam,
|
|
150
|
+
yTokens: moonbeam_1.yTokensMoonbeam,
|
|
151
|
+
ycTokens: moonbeam_1.ycTokensMoonbeam,
|
|
152
|
+
aTokens: moonbeam_1.aTokensMoonbeam,
|
|
153
|
+
},
|
|
143
154
|
43114: {
|
|
144
155
|
NAME: 'avalanche',
|
|
145
156
|
ALIASES: aliases_1.ALIASES_AVALANCHE,
|
|
@@ -472,6 +483,12 @@ var Curve = /** @class */ (function () {
|
|
|
472
483
|
});
|
|
473
484
|
});
|
|
474
485
|
};
|
|
486
|
+
Curve.prototype.setContract = function (address, abi) {
|
|
487
|
+
this.contracts[address] = {
|
|
488
|
+
contract: new ethers_1.Contract(address, abi, this.signer || this.provider),
|
|
489
|
+
multicallContract: new ethcall_1.Contract(address, abi),
|
|
490
|
+
};
|
|
491
|
+
};
|
|
475
492
|
Curve.prototype.fetchFactoryPools = function (useApi) {
|
|
476
493
|
if (useApi === void 0) { useApi = true; }
|
|
477
494
|
return __awaiter(this, void 0, void 0, function () {
|
package/lib/external-api.d.ts
CHANGED
|
@@ -3,3 +3,25 @@ import memoize from "memoizee";
|
|
|
3
3
|
export declare const _getPoolsFromApi: ((network: INetworkName, poolType: "main" | "crypto" | "factory" | "factory-crypto") => Promise<IExtendedPoolDataFromApi>) & memoize.Memoized<(network: INetworkName, poolType: "main" | "crypto" | "factory" | "factory-crypto") => Promise<IExtendedPoolDataFromApi>>;
|
|
4
4
|
export declare const _getSubgraphData: ((network: INetworkName) => Promise<ISubgraphPoolData[]>) & memoize.Memoized<(network: INetworkName) => Promise<ISubgraphPoolData[]>>;
|
|
5
5
|
export declare const _getMainPoolsGaugeRewards: (() => Promise<IDict<IReward[]>>) & memoize.Memoized<() => Promise<IDict<IReward[]>>>;
|
|
6
|
+
export declare const _getMoonbeamLegacyAPYsAndVolumes: (() => Promise<IDict<{
|
|
7
|
+
apy: {
|
|
8
|
+
day: number;
|
|
9
|
+
week: number;
|
|
10
|
+
};
|
|
11
|
+
volume: number;
|
|
12
|
+
}>>) & memoize.Memoized<() => Promise<IDict<{
|
|
13
|
+
apy: {
|
|
14
|
+
day: number;
|
|
15
|
+
week: number;
|
|
16
|
+
};
|
|
17
|
+
volume: number;
|
|
18
|
+
}>>>;
|
|
19
|
+
export declare const _getMoonbeamFactoryAPYsAndVolumes: (() => Promise<{
|
|
20
|
+
poolAddress: string;
|
|
21
|
+
apy: number;
|
|
22
|
+
volume: number;
|
|
23
|
+
}[]>) & memoize.Memoized<() => Promise<{
|
|
24
|
+
poolAddress: string;
|
|
25
|
+
apy: number;
|
|
26
|
+
volume: number;
|
|
27
|
+
}[]>>;
|
package/lib/external-api.js
CHANGED
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports._getMainPoolsGaugeRewards = exports._getSubgraphData = exports._getPoolsFromApi = void 0;
|
|
42
|
+
exports._getMoonbeamFactoryAPYsAndVolumes = exports._getMoonbeamLegacyAPYsAndVolumes = exports._getMainPoolsGaugeRewards = exports._getSubgraphData = exports._getPoolsFromApi = void 0;
|
|
43
43
|
var axios_1 = __importDefault(require("axios"));
|
|
44
44
|
var memoizee_1 = __importDefault(require("memoizee"));
|
|
45
45
|
exports._getPoolsFromApi = (0, memoizee_1.default)(function (network, poolType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -92,3 +92,43 @@ exports._getMainPoolsGaugeRewards = (0, memoizee_1.default)(function () { return
|
|
|
92
92
|
promise: true,
|
|
93
93
|
maxAge: 5 * 60 * 1000, // 5m
|
|
94
94
|
});
|
|
95
|
+
exports._getMoonbeamLegacyAPYsAndVolumes = (0, memoizee_1.default)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
+
var url, data, result;
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
url = "https://stats.curve.fi/raw-stats-moonbeam/apys.json";
|
|
101
|
+
return [4 /*yield*/, axios_1.default.get(url, { validateStatus: function () { return true; } })];
|
|
102
|
+
case 1:
|
|
103
|
+
data = (_a.sent()).data;
|
|
104
|
+
result = {};
|
|
105
|
+
Object.keys(data.apy.day).forEach(function (poolId) {
|
|
106
|
+
result[poolId] = { apy: { day: 0, week: 0 }, volume: 0 };
|
|
107
|
+
result[poolId].apy.day = data.apy.day[poolId] * 100;
|
|
108
|
+
result[poolId].apy.week = data.apy.week[poolId] * 100;
|
|
109
|
+
result[poolId].volume = data.volume[poolId];
|
|
110
|
+
});
|
|
111
|
+
return [2 /*return*/, result];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}); }, {
|
|
115
|
+
promise: true,
|
|
116
|
+
maxAge: 5 * 60 * 1000, // 5m
|
|
117
|
+
});
|
|
118
|
+
exports._getMoonbeamFactoryAPYsAndVolumes = (0, memoizee_1.default)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
119
|
+
var url, response;
|
|
120
|
+
var _a;
|
|
121
|
+
return __generator(this, function (_b) {
|
|
122
|
+
switch (_b.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
url = "https://api.curve.fi/api/getFactoryAPYs-moonbeam";
|
|
125
|
+
return [4 /*yield*/, axios_1.default.get(url, { validateStatus: function () { return true; } })];
|
|
126
|
+
case 1:
|
|
127
|
+
response = _b.sent();
|
|
128
|
+
return [2 /*return*/, (_a = response.data.data.poolDetails) !== null && _a !== void 0 ? _a : []];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}); }, {
|
|
132
|
+
promise: true,
|
|
133
|
+
maxAge: 5 * 60 * 1000, // 5m
|
|
134
|
+
});
|
package/lib/factory/common.js
CHANGED
|
@@ -6,102 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.setCryptoFactoryZapContracts = exports.setFactoryZapContracts = void 0;
|
|
7
7
|
var ethers_1 = require("ethers");
|
|
8
8
|
var ethcall_1 = require("ethcall");
|
|
9
|
-
var
|
|
10
|
-
var metaZap_json_1 = __importDefault(require("../constants/abis/fraxusdc/metaZap.json"));
|
|
11
|
-
var DepositZapMetaUsdPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsdPolygon.json"));
|
|
12
|
-
var DepositZapMetaBtcPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaBtcPolygon.json"));
|
|
13
|
-
var DepositZapFantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapFantom.json"));
|
|
14
|
-
var DepositZapMetaUsd2Fantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsd2Fantom.json"));
|
|
9
|
+
var constants_1 = require("./constants");
|
|
15
10
|
var base_pool_zap_json_1 = __importDefault(require("../constants/abis/atricrypto3/base_pool_zap.json"));
|
|
16
11
|
function setFactoryZapContracts() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
contract: new ethers_1.Contract(metaSBtcZapAddress, deposit_json_1.default, this.signer || this.provider),
|
|
26
|
-
multicallContract: new ethcall_1.Contract(metaSBtcZapAddress, deposit_json_1.default),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
else if (this.chainId === 10) {
|
|
30
|
-
var metaUsdZapAddress = "0x167e42a1c7ab4be03764a2222aac57f5f6754411".toLowerCase();
|
|
31
|
-
this.contracts[metaUsdZapAddress] = {
|
|
32
|
-
contract: new ethers_1.Contract(metaUsdZapAddress, deposit_json_1.default, this.signer || this.provider),
|
|
33
|
-
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, deposit_json_1.default),
|
|
34
|
-
};
|
|
35
|
-
var metaUsd2ZapAddress = "0x4244eB811D6e0Ef302326675207A95113dB4E1F8".toLowerCase();
|
|
36
|
-
this.contracts[metaUsd2ZapAddress] = {
|
|
37
|
-
contract: new ethers_1.Contract(metaUsd2ZapAddress, DepositZapFantom_json_1.default, this.signer || this.provider),
|
|
38
|
-
multicallContract: new ethcall_1.Contract(metaUsd2ZapAddress, DepositZapFantom_json_1.default),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
else if (this.chainId === 100) {
|
|
42
|
-
var metaUsdZapAddress = "0x87C067fAc25f123554a0E76596BF28cFa37fD5E9".toLowerCase();
|
|
43
|
-
this.contracts[metaUsdZapAddress] = {
|
|
44
|
-
contract: new ethers_1.Contract(metaUsdZapAddress, deposit_json_1.default, this.signer || this.provider),
|
|
45
|
-
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, deposit_json_1.default),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
else if (this.chainId === 137) {
|
|
49
|
-
var metaUsdZapAddress = "0x5ab5C56B9db92Ba45a0B46a207286cD83C15C939".toLowerCase();
|
|
50
|
-
this.contracts[metaUsdZapAddress] = {
|
|
51
|
-
contract: new ethers_1.Contract(metaUsdZapAddress, DepositZapMetaUsdPolygon_json_1.default, this.signer || this.provider),
|
|
52
|
-
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, DepositZapMetaUsdPolygon_json_1.default),
|
|
53
|
-
};
|
|
54
|
-
var metaBtcZapAddress = "0xE2e6DC1708337A6e59f227921db08F21e3394723".toLowerCase();
|
|
55
|
-
this.contracts[metaBtcZapAddress] = {
|
|
56
|
-
contract: new ethers_1.Contract(metaBtcZapAddress, DepositZapMetaBtcPolygon_json_1.default, this.signer || this.provider),
|
|
57
|
-
multicallContract: new ethcall_1.Contract(metaBtcZapAddress, DepositZapMetaBtcPolygon_json_1.default),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
else if (this.chainId === 250) {
|
|
61
|
-
var metaUsdZapAddress = "0x78D51EB71a62c081550EfcC0a9F9Ea94B2Ef081c".toLowerCase();
|
|
62
|
-
this.contracts[metaUsdZapAddress] = {
|
|
63
|
-
contract: new ethers_1.Contract(metaUsdZapAddress, DepositZapFantom_json_1.default, this.signer || this.provider),
|
|
64
|
-
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, DepositZapFantom_json_1.default),
|
|
65
|
-
};
|
|
66
|
-
var metaRenBtcZapAddress = "0x001E3BA199B4FF4B5B6e97aCD96daFC0E2e4156e".toLowerCase();
|
|
67
|
-
this.contracts[metaRenBtcZapAddress] = {
|
|
68
|
-
contract: new ethers_1.Contract(metaRenBtcZapAddress, DepositZapFantom_json_1.default, this.signer || this.provider),
|
|
69
|
-
multicallContract: new ethcall_1.Contract(metaRenBtcZapAddress, DepositZapFantom_json_1.default),
|
|
70
|
-
};
|
|
71
|
-
var metaGeistUsdZapAddress = "0x247aEB220E87f24c40C9F86b65d6bd5d3c987B55".toLowerCase();
|
|
72
|
-
this.contracts[metaGeistUsdZapAddress] = {
|
|
73
|
-
contract: new ethers_1.Contract(metaGeistUsdZapAddress, DepositZapMetaUsd2Fantom_json_1.default, this.signer || this.provider),
|
|
74
|
-
multicallContract: new ethcall_1.Contract(metaGeistUsdZapAddress, DepositZapMetaUsd2Fantom_json_1.default),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
else if (this.chainId === 43114) {
|
|
78
|
-
var metaUsdZapAddress = "0x001E3BA199B4FF4B5B6e97aCD96daFC0E2e4156e".toLowerCase();
|
|
79
|
-
this.contracts[metaUsdZapAddress] = {
|
|
80
|
-
contract: new ethers_1.Contract(metaUsdZapAddress, DepositZapMetaUsdPolygon_json_1.default, this.signer || this.provider),
|
|
81
|
-
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, DepositZapMetaUsdPolygon_json_1.default),
|
|
82
|
-
};
|
|
83
|
-
var metaBtcZapAddress = "0xEeB3DDBcc4174e0b3fd1C13aD462b95D11Ef42C3".toLowerCase();
|
|
84
|
-
this.contracts[metaBtcZapAddress] = {
|
|
85
|
-
contract: new ethers_1.Contract(metaBtcZapAddress, DepositZapMetaBtcPolygon_json_1.default, this.signer || this.provider),
|
|
86
|
-
multicallContract: new ethcall_1.Contract(metaBtcZapAddress, DepositZapMetaBtcPolygon_json_1.default),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
else if (this.chainId === 42161) {
|
|
90
|
-
var metaUsdZapAddress = "0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287".toLowerCase();
|
|
91
|
-
this.contracts[metaUsdZapAddress] = {
|
|
92
|
-
contract: new ethers_1.Contract(metaUsdZapAddress, DepositZapFantom_json_1.default, this.signer || this.provider),
|
|
93
|
-
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, DepositZapFantom_json_1.default),
|
|
94
|
-
};
|
|
95
|
-
var metaBtcZapAddress = "0x803A2B40c5a9BB2B86DD630B274Fa2A9202874C2".toLowerCase();
|
|
96
|
-
this.contracts[metaBtcZapAddress] = {
|
|
97
|
-
contract: new ethers_1.Contract(metaBtcZapAddress, DepositZapFantom_json_1.default, this.signer || this.provider),
|
|
98
|
-
multicallContract: new ethcall_1.Contract(metaBtcZapAddress, DepositZapFantom_json_1.default),
|
|
99
|
-
};
|
|
100
|
-
var metaUsd2ZapAddress = "0x58AC91f5BE7dC0c35b24B96B19BAc55FBB8E705e".toLowerCase();
|
|
101
|
-
this.contracts[metaUsd2ZapAddress] = {
|
|
102
|
-
contract: new ethers_1.Contract(metaUsd2ZapAddress, DepositZapFantom_json_1.default, this.signer || this.provider),
|
|
103
|
-
multicallContract: new ethcall_1.Contract(metaUsd2ZapAddress, DepositZapFantom_json_1.default),
|
|
104
|
-
};
|
|
12
|
+
var basePoolIdZapDict = constants_1.FACTORY_CONSTANTS[this.chainId].basePoolIdZapDict;
|
|
13
|
+
for (var basePoolId in basePoolIdZapDict) {
|
|
14
|
+
if (!Object.prototype.hasOwnProperty.call(basePoolIdZapDict, basePoolId))
|
|
15
|
+
continue;
|
|
16
|
+
var basePool = basePoolIdZapDict[basePoolId];
|
|
17
|
+
if (basePool.address in this.constants)
|
|
18
|
+
continue;
|
|
19
|
+
this.setContract(basePool.address, basePool.ABI);
|
|
105
20
|
}
|
|
106
21
|
}
|
|
107
22
|
exports.setFactoryZapContracts = setFactoryZapContracts;
|
|
@@ -6,6 +6,7 @@ export declare const implementationABIDictAvalanche: IDict<any>;
|
|
|
6
6
|
export declare const implementationABIDictArbitrum: IDict<any>;
|
|
7
7
|
export declare const implementationABIDictOptimism: IDict<any>;
|
|
8
8
|
export declare const implementationABIDictXDai: IDict<any>;
|
|
9
|
+
export declare const implementationABIDictMoonbeam: IDict<any>;
|
|
9
10
|
export declare const implementationBasePoolIdDictEthereum: IDict<string>;
|
|
10
11
|
export declare const implementationBasePoolIdDictPolygon: IDict<string>;
|
|
11
12
|
export declare const implementationBasePoolIdDictFantom: IDict<string>;
|
|
@@ -13,13 +14,39 @@ export declare const implementationBasePoolIdDictAvalanche: IDict<string>;
|
|
|
13
14
|
export declare const implementationBasePoolIdDictArbitrum: IDict<string>;
|
|
14
15
|
export declare const implementationBasePoolIdDictOptimism: IDict<string>;
|
|
15
16
|
export declare const implementationBasePoolIdDictXDai: IDict<string>;
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare const
|
|
22
|
-
|
|
17
|
+
export declare const implementationBasePoolIdDictMoonbeam: IDict<string>;
|
|
18
|
+
export declare const basePoolIdZapDictEthereum: IDict<{
|
|
19
|
+
address: string;
|
|
20
|
+
ABI: any;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const basePoolIdZapDictPolygon: IDict<{
|
|
23
|
+
address: string;
|
|
24
|
+
ABI: any;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const basePoolIdZapDictFantom: IDict<{
|
|
27
|
+
address: string;
|
|
28
|
+
ABI: any;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const basePoolIdZapDictAvalanche: IDict<{
|
|
31
|
+
address: string;
|
|
32
|
+
ABI: any;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const basePoolIdZapDictArbitrum: IDict<{
|
|
35
|
+
address: string;
|
|
36
|
+
ABI: any;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const basePoolIdZapDictOptimism: IDict<{
|
|
39
|
+
address: string;
|
|
40
|
+
ABI: any;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const basePoolIdZapDictXDai: IDict<{
|
|
43
|
+
address: string;
|
|
44
|
+
ABI: any;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const basePoolIdZapDictMoonbeam: IDict<{
|
|
47
|
+
address: string;
|
|
48
|
+
ABI: any;
|
|
49
|
+
}>;
|
|
23
50
|
export declare const NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
24
51
|
export declare const NATIVE_TOKENS: {
|
|
25
52
|
[index: number]: {
|
|
@@ -32,6 +59,9 @@ export declare const FACTORY_CONSTANTS: {
|
|
|
32
59
|
[index: number]: {
|
|
33
60
|
implementationABIDict: IDict<any>;
|
|
34
61
|
implementationBasePoolIdDict: IDict<string>;
|
|
35
|
-
basePoolIdZapDict: IDict<
|
|
62
|
+
basePoolIdZapDict: IDict<{
|
|
63
|
+
address: string;
|
|
64
|
+
ABI: any;
|
|
65
|
+
}>;
|
|
36
66
|
};
|
|
37
67
|
};
|
package/lib/factory/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FACTORY_CONSTANTS = exports.NATIVE_TOKENS = exports.NATIVE_TOKEN_ADDRESS = exports.basePoolIdZapDictXDai = exports.basePoolIdZapDictOptimism = exports.basePoolIdZapDictArbitrum = exports.basePoolIdZapDictAvalanche = exports.basePoolIdZapDictFantom = exports.basePoolIdZapDictPolygon = exports.basePoolIdZapDictEthereum = exports.implementationBasePoolIdDictXDai = exports.implementationBasePoolIdDictOptimism = exports.implementationBasePoolIdDictArbitrum = exports.implementationBasePoolIdDictAvalanche = exports.implementationBasePoolIdDictFantom = exports.implementationBasePoolIdDictPolygon = exports.implementationBasePoolIdDictEthereum = exports.implementationABIDictXDai = exports.implementationABIDictOptimism = exports.implementationABIDictArbitrum = exports.implementationABIDictAvalanche = exports.implementationABIDictFantom = exports.implementationABIDictPolygon = exports.implementationABIDictEthereum = void 0;
|
|
6
|
+
exports.FACTORY_CONSTANTS = exports.NATIVE_TOKENS = exports.NATIVE_TOKEN_ADDRESS = exports.basePoolIdZapDictMoonbeam = exports.basePoolIdZapDictXDai = exports.basePoolIdZapDictOptimism = exports.basePoolIdZapDictArbitrum = exports.basePoolIdZapDictAvalanche = exports.basePoolIdZapDictFantom = exports.basePoolIdZapDictPolygon = exports.basePoolIdZapDictEthereum = exports.implementationBasePoolIdDictMoonbeam = exports.implementationBasePoolIdDictXDai = exports.implementationBasePoolIdDictOptimism = exports.implementationBasePoolIdDictArbitrum = exports.implementationBasePoolIdDictAvalanche = exports.implementationBasePoolIdDictFantom = exports.implementationBasePoolIdDictPolygon = exports.implementationBasePoolIdDictEthereum = exports.implementationABIDictMoonbeam = exports.implementationABIDictXDai = exports.implementationABIDictOptimism = exports.implementationABIDictArbitrum = exports.implementationABIDictAvalanche = exports.implementationABIDictFantom = exports.implementationABIDictPolygon = exports.implementationABIDictEthereum = void 0;
|
|
7
7
|
var swap_json_1 = __importDefault(require("../constants/abis/factoryPools/swap.json"));
|
|
8
8
|
var MetaUSD_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaUSD.json"));
|
|
9
9
|
var MetaUSDBalances_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaUSDBalances.json"));
|
|
@@ -26,6 +26,13 @@ var Plain4Basic_json_1 = __importDefault(require("../constants/abis/factory-v2/P
|
|
|
26
26
|
var Plain4Balances_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4Balances.json"));
|
|
27
27
|
var Plain4ETH_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4ETH.json"));
|
|
28
28
|
var Plain4Optimized_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4Optimized.json"));
|
|
29
|
+
// --- ZAPS --
|
|
30
|
+
var deposit_json_1 = __importDefault(require("../constants/abis/factoryPools/deposit.json"));
|
|
31
|
+
var metaZap_json_1 = __importDefault(require("../constants/abis/fraxusdc/metaZap.json"));
|
|
32
|
+
var DepositZapMetaUsdPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsdPolygon.json"));
|
|
33
|
+
var DepositZapMetaBtcPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaBtcPolygon.json"));
|
|
34
|
+
var DepositZapFantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapFantom.json"));
|
|
35
|
+
var DepositZapMetaUsd2Fantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsd2Fantom.json"));
|
|
29
36
|
exports.implementationABIDictEthereum = {
|
|
30
37
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": swap_json_1.default,
|
|
31
38
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": MetaUSD_json_1.default,
|
|
@@ -159,6 +166,20 @@ exports.implementationABIDictXDai = {
|
|
|
159
166
|
"0xc1C49622b63B961ce1D352ecb7D8261Ab5556695": Plain4ETH_json_1.default,
|
|
160
167
|
"0x0E2615ce69Cd3Dc3Ff6f66a975bEa0655F3bA7b9": Plain4Optimized_json_1.default,
|
|
161
168
|
};
|
|
169
|
+
exports.implementationABIDictMoonbeam = {
|
|
170
|
+
"0x6842E0412AC1c00464dc48961330156a07268d14": Plain2Basic_json_1.default,
|
|
171
|
+
"0x9fAe78C4bBB649deB7b2295dDB8A03adA7eB660F": Plain2Balances_json_1.default,
|
|
172
|
+
"0xfCE359115dFe1533a2458650123F86C454BC0213": Plain2ETH_json_1.default,
|
|
173
|
+
"0x09C62ad0694e3f1ad8cF8876aaBe56138C586f5F": Plain2Optimized_json_1.default,
|
|
174
|
+
"0xD19Baeadc667Cf2015e395f2B08668Ef120f41F5": Plain3Basic_json_1.default,
|
|
175
|
+
"0x04e39EF8332e979Cf8e4f8891E64934FF65F231b": Plain3Balances_json_1.default,
|
|
176
|
+
"0xC9438d8928486bD9621D326002F4672bF684187A": Plain3ETH_json_1.default,
|
|
177
|
+
"0x2b70A5B878665FfDB4A06Ba40a264d6c70f68F4B": Plain3Optimized_json_1.default,
|
|
178
|
+
"0x2D036f0Ff6F440dB623e0D9D3B5Daa509e5500C3": Plain4Basic_json_1.default,
|
|
179
|
+
"0x7Bb707085905c9D80854652809A1ba8480C11789": Plain4Balances_json_1.default,
|
|
180
|
+
"0xec9cEBE650E181079576C1b6d0d2e092B1EdfF13": Plain4ETH_json_1.default,
|
|
181
|
+
"0xe8269B33E47761f552E1a3070119560d5fa8bBD6": Plain4Optimized_json_1.default,
|
|
182
|
+
};
|
|
162
183
|
exports.implementationBasePoolIdDictEthereum = {
|
|
163
184
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
|
|
164
185
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": "3pool",
|
|
@@ -208,37 +229,91 @@ exports.implementationBasePoolIdDictXDai = {
|
|
|
208
229
|
"0x4A5bF7Ab9A8202692051c19B102d3eDD62aaBAE6": "3pool",
|
|
209
230
|
"0x0B4dc7A945695D11FD83e40B2DfC2B896A02395F": "3pool",
|
|
210
231
|
};
|
|
232
|
+
exports.implementationBasePoolIdDictMoonbeam = {};
|
|
211
233
|
exports.basePoolIdZapDictEthereum = {
|
|
212
|
-
'3pool':
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
234
|
+
'3pool': {
|
|
235
|
+
address: "0xA79828DF1850E8a3A3064576f380D90aECDD3359".toLowerCase(),
|
|
236
|
+
ABI: deposit_json_1.default,
|
|
237
|
+
},
|
|
238
|
+
fraxusdc: {
|
|
239
|
+
address: "0x08780fb7E580e492c1935bEe4fA5920b94AA95Da".toLowerCase(),
|
|
240
|
+
ABI: metaZap_json_1.default,
|
|
241
|
+
},
|
|
242
|
+
sbtc: {
|
|
243
|
+
address: "0x7abdbaf29929e7f8621b757d2a7c04d78d633834".toLowerCase(),
|
|
244
|
+
ABI: deposit_json_1.default,
|
|
245
|
+
},
|
|
246
|
+
ren: {
|
|
247
|
+
address: "0x7abdbaf29929e7f8621b757d2a7c04d78d633834".toLowerCase(),
|
|
248
|
+
ABI: deposit_json_1.default,
|
|
249
|
+
}, // TODO MUST BE CHANGED!!!
|
|
216
250
|
};
|
|
217
251
|
exports.basePoolIdZapDictPolygon = {
|
|
218
|
-
aave:
|
|
219
|
-
|
|
252
|
+
aave: {
|
|
253
|
+
address: "0x5ab5C56B9db92Ba45a0B46a207286cD83C15C939".toLowerCase(),
|
|
254
|
+
ABI: DepositZapMetaUsdPolygon_json_1.default,
|
|
255
|
+
},
|
|
256
|
+
ren: {
|
|
257
|
+
address: "0xE2e6DC1708337A6e59f227921db08F21e3394723".toLowerCase(),
|
|
258
|
+
ABI: DepositZapMetaBtcPolygon_json_1.default,
|
|
259
|
+
},
|
|
220
260
|
};
|
|
221
261
|
exports.basePoolIdZapDictFantom = {
|
|
222
|
-
'2pool':
|
|
223
|
-
|
|
224
|
-
|
|
262
|
+
'2pool': {
|
|
263
|
+
address: "0x78D51EB71a62c081550EfcC0a9F9Ea94B2Ef081c".toLowerCase(),
|
|
264
|
+
ABI: DepositZapFantom_json_1.default,
|
|
265
|
+
},
|
|
266
|
+
ren: {
|
|
267
|
+
address: "0x001E3BA199B4FF4B5B6e97aCD96daFC0E2e4156e".toLowerCase(),
|
|
268
|
+
ABI: DepositZapFantom_json_1.default,
|
|
269
|
+
},
|
|
270
|
+
geist: {
|
|
271
|
+
address: "0x247aEB220E87f24c40C9F86b65d6bd5d3c987B55".toLowerCase(),
|
|
272
|
+
ABI: DepositZapMetaUsd2Fantom_json_1.default,
|
|
273
|
+
},
|
|
225
274
|
};
|
|
226
275
|
exports.basePoolIdZapDictAvalanche = {
|
|
227
|
-
aave:
|
|
228
|
-
|
|
276
|
+
aave: {
|
|
277
|
+
address: "0x001E3BA199B4FF4B5B6e97aCD96daFC0E2e4156e".toLowerCase(),
|
|
278
|
+
ABI: DepositZapMetaUsdPolygon_json_1.default,
|
|
279
|
+
},
|
|
280
|
+
ren: {
|
|
281
|
+
address: "0xEeB3DDBcc4174e0b3fd1C13aD462b95D11Ef42C3".toLowerCase(),
|
|
282
|
+
ABI: DepositZapMetaBtcPolygon_json_1.default,
|
|
283
|
+
},
|
|
229
284
|
};
|
|
230
285
|
exports.basePoolIdZapDictArbitrum = {
|
|
231
|
-
"2pool":
|
|
232
|
-
|
|
233
|
-
|
|
286
|
+
"2pool": {
|
|
287
|
+
address: "0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287".toLowerCase(),
|
|
288
|
+
ABI: DepositZapFantom_json_1.default,
|
|
289
|
+
},
|
|
290
|
+
ren: {
|
|
291
|
+
address: "0x803A2B40c5a9BB2B86DD630B274Fa2A9202874C2".toLowerCase(),
|
|
292
|
+
ABI: DepositZapFantom_json_1.default,
|
|
293
|
+
},
|
|
294
|
+
"factory-v2-41": {
|
|
295
|
+
address: "0x58AC91f5BE7dC0c35b24B96B19BAc55FBB8E705e".toLowerCase(),
|
|
296
|
+
ABI: DepositZapFantom_json_1.default,
|
|
297
|
+
},
|
|
234
298
|
};
|
|
235
299
|
exports.basePoolIdZapDictOptimism = {
|
|
236
|
-
"3pool":
|
|
237
|
-
|
|
300
|
+
"3pool": {
|
|
301
|
+
address: "0x167e42a1c7ab4be03764a2222aac57f5f6754411".toLowerCase(),
|
|
302
|
+
ABI: deposit_json_1.default,
|
|
303
|
+
},
|
|
304
|
+
"factory-v2-16": {
|
|
305
|
+
address: "0x4244eB811D6e0Ef302326675207A95113dB4E1F8".toLowerCase(),
|
|
306
|
+
ABI: DepositZapFantom_json_1.default,
|
|
307
|
+
},
|
|
238
308
|
};
|
|
239
309
|
exports.basePoolIdZapDictXDai = {
|
|
240
|
-
"3pool":
|
|
310
|
+
"3pool": {
|
|
311
|
+
address: "0x87C067fAc25f123554a0E76596BF28cFa37fD5E9".toLowerCase(),
|
|
312
|
+
ABI: deposit_json_1.default,
|
|
313
|
+
},
|
|
241
314
|
};
|
|
315
|
+
exports.basePoolIdZapDictMoonbeam = {};
|
|
316
|
+
// TODO Move to another place
|
|
242
317
|
exports.NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
243
318
|
exports.NATIVE_TOKENS = {
|
|
244
319
|
1: {
|
|
@@ -266,6 +341,11 @@ exports.NATIVE_TOKENS = {
|
|
|
266
341
|
wrappedSymbol: 'WFTM',
|
|
267
342
|
wrappedAddress: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83'.toLowerCase(),
|
|
268
343
|
},
|
|
344
|
+
1284: {
|
|
345
|
+
symbol: 'GLMR',
|
|
346
|
+
wrappedSymbol: 'WGLMR',
|
|
347
|
+
wrappedAddress: '0xAcc15dC74880C9944775448304B263D191c6077F'.toLowerCase(),
|
|
348
|
+
},
|
|
269
349
|
42161: {
|
|
270
350
|
symbol: 'ETH',
|
|
271
351
|
wrappedSymbol: 'WETH',
|
|
@@ -298,6 +378,11 @@ exports.FACTORY_CONSTANTS = {
|
|
|
298
378
|
implementationBasePoolIdDict: exports.implementationBasePoolIdDictFantom,
|
|
299
379
|
basePoolIdZapDict: exports.basePoolIdZapDictFantom,
|
|
300
380
|
},
|
|
381
|
+
1284: {
|
|
382
|
+
implementationABIDict: exports.implementationABIDictMoonbeam,
|
|
383
|
+
implementationBasePoolIdDict: exports.implementationBasePoolIdDictMoonbeam,
|
|
384
|
+
basePoolIdZapDict: exports.basePoolIdZapDictMoonbeam,
|
|
385
|
+
},
|
|
301
386
|
43114: {
|
|
302
387
|
implementationABIDict: exports.implementationABIDictAvalanche,
|
|
303
388
|
implementationBasePoolIdDict: exports.implementationBasePoolIdDictAvalanche,
|
|
@@ -198,6 +198,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
198
198
|
var cryptoCoinNames = pool.coins.map(function (c) { return c.symbol === nativeToken.symbol ? nativeToken.wrappedSymbol : c.symbol; });
|
|
199
199
|
var underlyingCoinNames = pool.coins.map(function (c) { return c.symbol === nativeToken.wrappedSymbol ? nativeToken.symbol : c.symbol; });
|
|
200
200
|
var underlyingCoinAddresses = coinAddresses.map(function (addr) { return addr === nativeToken.wrappedAddress ? constants_1.NATIVE_TOKEN_ADDRESS : addr; });
|
|
201
|
+
var isPlain = !coinAddresses.includes(nativeToken.wrappedAddress);
|
|
201
202
|
var isMeta = _this.chainId === 137 && coinAddresses[1].toLowerCase() === atricrypto3Lp;
|
|
202
203
|
if (isMeta) {
|
|
203
204
|
var basePoolId = "atricrypto3";
|
|
@@ -245,6 +246,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
245
246
|
token_address: pool.lpTokenAddress.toLowerCase(),
|
|
246
247
|
gauge_address: pool.gaugeAddress ? pool.gaugeAddress.toLowerCase() : ethers_1.ethers.constants.AddressZero,
|
|
247
248
|
is_crypto: true,
|
|
249
|
+
is_plain: isPlain,
|
|
248
250
|
is_factory: true,
|
|
249
251
|
underlying_coins: underlyingCoinNames,
|
|
250
252
|
wrapped_coins: cryptoCoinNames,
|
|
@@ -273,7 +275,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
273
275
|
var basePoolCoinNames = basePoolIdCoinsDict[basePoolId];
|
|
274
276
|
var basePoolCoinAddresses = basePoolIdCoinAddressesDict[basePoolId];
|
|
275
277
|
var basePoolDecimals = basePoolIdDecimalsDict[basePoolId];
|
|
276
|
-
var basePoolZap = basePoolIdZapDict[basePoolId];
|
|
278
|
+
var basePoolZap = basePoolIdZapDict[basePoolId].address;
|
|
277
279
|
FACTORY_POOLS_DATA[pool.id] = {
|
|
278
280
|
name: pool.name.split(": ")[1].trim(),
|
|
279
281
|
full_name: pool.name,
|