@curvefi/api 2.6.0 → 2.7.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/abis/3pool-optimism/swap.json +1074 -0
- package/lib/constants/aliases.d.ts +1 -0
- package/lib/constants/aliases.js +13 -1
- package/lib/constants/coins/optimism.d.ts +7 -0
- package/lib/constants/coins/optimism.js +21 -0
- package/lib/constants/pools/index.d.ts +2 -1
- package/lib/constants/pools/index.js +3 -1
- package/lib/constants/pools/optimism.d.ts +4 -0
- package/lib/constants/pools/optimism.js +37 -0
- package/lib/curve.js +11 -0
- package/lib/factory/common.js +7 -0
- package/lib/factory/constants.d.ts +3 -0
- package/lib/factory/constants.js +34 -1
- package/lib/factory/factory-crypto.js +2 -0
- package/lib/factory/factory.js +3 -0
- package/lib/pools/PoolTemplate.js +1 -1
- package/lib/pools/utils.js +22 -14
- package/lib/utils.js +4 -1
- package/package.json +1 -1
|
@@ -3,3 +3,4 @@ export declare const ALIASES_POLYGON: import("../interfaces").IDict<string>;
|
|
|
3
3
|
export declare const ALIASES_FANTOM: import("../interfaces").IDict<string>;
|
|
4
4
|
export declare const ALIASES_AVALANCHE: import("../interfaces").IDict<string>;
|
|
5
5
|
export declare const ALIASES_ARBITRUM: import("../interfaces").IDict<string>;
|
|
6
|
+
export declare const ALIASES_OPTIMISM: 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_ARBITRUM = exports.ALIASES_AVALANCHE = exports.ALIASES_FANTOM = exports.ALIASES_POLYGON = exports.ALIASES_ETHEREUM = void 0;
|
|
3
|
+
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",
|
|
@@ -62,3 +62,15 @@ exports.ALIASES_ARBITRUM = (0, utils_1.lowerCaseValues)({
|
|
|
62
62
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
63
63
|
"registry_exchange": "",
|
|
64
64
|
});
|
|
65
|
+
exports.ALIASES_OPTIMISM = (0, utils_1.lowerCaseValues)({
|
|
66
|
+
"crv": "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",
|
|
67
|
+
"minter": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
68
|
+
"voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
|
|
69
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
70
|
+
"address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383",
|
|
71
|
+
"router": "0xfA9a30350048B2BF66865ee20363067c66f67e58",
|
|
72
|
+
"deposit_and_stake": "0xB7De33440B7171159a9718CBE748086cecDd9685",
|
|
73
|
+
"factory": '0x2db0E83599a91b508Ac268a6197b8B14F5e72840',
|
|
74
|
+
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
75
|
+
"registry_exchange": "",
|
|
76
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aTokensOptimism = exports.ycTokensOptimism = exports.yTokensOptimism = exports.cTokensOptimism = exports.COINS_OPTIMISM = void 0;
|
|
4
|
+
var utils_1 = require("../utils");
|
|
5
|
+
exports.COINS_OPTIMISM = (0, utils_1.lowerCaseValues)({
|
|
6
|
+
'crv': '0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53',
|
|
7
|
+
// --- USD ---
|
|
8
|
+
'dai': '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
|
|
9
|
+
'usdc': '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
|
|
10
|
+
'usdt': '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58',
|
|
11
|
+
'susd': '0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9',
|
|
12
|
+
'3crv': '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
13
|
+
// --- ETH ---
|
|
14
|
+
'eth': '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
|
|
15
|
+
'weth': '0x4200000000000000000000000000000000000006',
|
|
16
|
+
'seth': '0xe405de8f52ba7559f9df3c368500b6e6ae6cee49',
|
|
17
|
+
});
|
|
18
|
+
exports.cTokensOptimism = []; //.map((a) => a.toLowerCase());
|
|
19
|
+
exports.yTokensOptimism = []; //.map((a) => a.toLowerCase());
|
|
20
|
+
exports.ycTokensOptimism = []; //.map((a) => a.toLowerCase());
|
|
21
|
+
exports.aTokensOptimism = []; //.map((a) => a.toLowerCase());
|
|
@@ -3,4 +3,5 @@ import { POOLS_DATA_POLYGON } from "./polygon";
|
|
|
3
3
|
import { POOLS_DATA_FANTOM } from "./fantom";
|
|
4
4
|
import { POOLS_DATA_AVALANCHE } from "./avalanche";
|
|
5
5
|
import { POOLS_DATA_ARBITRUM } from "./arbitrum";
|
|
6
|
-
|
|
6
|
+
import { POOLS_DATA_OPTIMISM } from "./optimism";
|
|
7
|
+
export { POOLS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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_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");
|
|
@@ -11,3 +11,5 @@ var avalanche_1 = require("./avalanche");
|
|
|
11
11
|
Object.defineProperty(exports, "POOLS_DATA_AVALANCHE", { enumerable: true, get: function () { return avalanche_1.POOLS_DATA_AVALANCHE; } });
|
|
12
12
|
var arbitrum_1 = require("./arbitrum");
|
|
13
13
|
Object.defineProperty(exports, "POOLS_DATA_ARBITRUM", { enumerable: true, get: function () { return arbitrum_1.POOLS_DATA_ARBITRUM; } });
|
|
14
|
+
var optimism_1 = require("./optimism");
|
|
15
|
+
Object.defineProperty(exports, "POOLS_DATA_OPTIMISM", { enumerable: true, get: function () { return optimism_1.POOLS_DATA_OPTIMISM; } });
|
|
@@ -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_OPTIMISM = void 0;
|
|
7
|
+
var swap_json_1 = __importDefault(require("../abis/3pool-optimism/swap.json"));
|
|
8
|
+
var gauge_rewards_only_json_1 = __importDefault(require("../abis/gauge_rewards_only.json"));
|
|
9
|
+
var utils_1 = require("../utils");
|
|
10
|
+
exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
11
|
+
'3pool': {
|
|
12
|
+
name: "3pool",
|
|
13
|
+
full_name: "3pool",
|
|
14
|
+
symbol: "3pool",
|
|
15
|
+
reference_asset: 'USD',
|
|
16
|
+
is_plain: true,
|
|
17
|
+
swap_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
18
|
+
token_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
19
|
+
gauge_address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353',
|
|
20
|
+
underlying_coins: ['DAI', 'USDC', 'USDT'],
|
|
21
|
+
wrapped_coins: ['DAI', 'USDC', 'USDT'],
|
|
22
|
+
underlying_coin_addresses: [
|
|
23
|
+
'0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
|
|
24
|
+
'0x7f5c764cbc14f9669b88837ca1490cca17c31607',
|
|
25
|
+
'0x94b008aa00579c1307b0ef2c499ad98a8ce58e58',
|
|
26
|
+
],
|
|
27
|
+
wrapped_coin_addresses: [
|
|
28
|
+
'0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
|
|
29
|
+
'0x7f5c764cbc14f9669b88837ca1490cca17c31607',
|
|
30
|
+
'0x94b008aa00579c1307b0ef2c499ad98a8ce58e58',
|
|
31
|
+
],
|
|
32
|
+
underlying_decimals: [18, 6, 6],
|
|
33
|
+
wrapped_decimals: [18, 6, 6],
|
|
34
|
+
swap_abi: swap_json_1.default,
|
|
35
|
+
gauge_abi: gauge_rewards_only_json_1.default,
|
|
36
|
+
},
|
|
37
|
+
});
|
package/lib/curve.js
CHANGED
|
@@ -81,6 +81,7 @@ var factory_json_1 = __importDefault(require("./constants/abis/factory.json"));
|
|
|
81
81
|
var factory_crypto_json_1 = __importDefault(require("./constants/abis/factory-crypto.json"));
|
|
82
82
|
var pools_1 = require("./constants/pools");
|
|
83
83
|
var ethereum_1 = require("./constants/coins/ethereum");
|
|
84
|
+
var optimism_1 = require("./constants/coins/optimism");
|
|
84
85
|
var polygon_1 = require("./constants/coins/polygon");
|
|
85
86
|
var fantom_1 = require("./constants/coins/fantom");
|
|
86
87
|
var avalanche_1 = require("./constants/coins/avalanche");
|
|
@@ -98,6 +99,16 @@ exports.NETWORK_CONSTANTS = {
|
|
|
98
99
|
ycTokens: ethereum_1.ycTokensEthereum,
|
|
99
100
|
aTokens: ethereum_1.aTokensEthereum,
|
|
100
101
|
},
|
|
102
|
+
10: {
|
|
103
|
+
NAME: 'optimism',
|
|
104
|
+
ALIASES: aliases_1.ALIASES_OPTIMISM,
|
|
105
|
+
POOLS_DATA: pools_1.POOLS_DATA_OPTIMISM,
|
|
106
|
+
COINS: optimism_1.COINS_OPTIMISM,
|
|
107
|
+
cTokens: optimism_1.cTokensOptimism,
|
|
108
|
+
yTokens: optimism_1.yTokensOptimism,
|
|
109
|
+
ycTokens: optimism_1.ycTokensOptimism,
|
|
110
|
+
aTokens: optimism_1.aTokensOptimism,
|
|
111
|
+
},
|
|
101
112
|
137: {
|
|
102
113
|
NAME: 'polygon',
|
|
103
114
|
ALIASES: aliases_1.ALIASES_POLYGON,
|
package/lib/factory/common.js
CHANGED
|
@@ -25,6 +25,13 @@ function setFactoryZapContracts() {
|
|
|
25
25
|
multicallContract: new ethcall_1.Contract(metaSBtcZapAddress, deposit_json_1.default),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
else if (this.chainId === 10) {
|
|
29
|
+
var metaUsdZapAddress = "0x167e42a1c7ab4be03764a2222aac57f5f6754411".toLowerCase();
|
|
30
|
+
this.contracts[metaUsdZapAddress] = {
|
|
31
|
+
contract: new ethers_1.Contract(metaUsdZapAddress, deposit_json_1.default, this.signer || this.provider),
|
|
32
|
+
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, deposit_json_1.default),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
28
35
|
else if (this.chainId === 137) {
|
|
29
36
|
var metaUsdZapAddress = "0x5ab5C56B9db92Ba45a0B46a207286cD83C15C939".toLowerCase();
|
|
30
37
|
this.contracts[metaUsdZapAddress] = {
|
|
@@ -4,16 +4,19 @@ export declare const implementationABIDictPolygon: IDict<any>;
|
|
|
4
4
|
export declare const implementationABIDictFantom: IDict<any>;
|
|
5
5
|
export declare const implementationABIDictAvalanche: IDict<any>;
|
|
6
6
|
export declare const implementationABIDictArbitrum: IDict<any>;
|
|
7
|
+
export declare const implementationABIDictOptimism: IDict<any>;
|
|
7
8
|
export declare const implementationBasePoolIdDictEthereum: IDict<string>;
|
|
8
9
|
export declare const implementationBasePoolIdDictPolygon: IDict<string>;
|
|
9
10
|
export declare const implementationBasePoolIdDictFantom: IDict<string>;
|
|
10
11
|
export declare const implementationBasePoolIdDictAvalanche: IDict<string>;
|
|
11
12
|
export declare const implementationBasePoolIdDictArbitrum: IDict<string>;
|
|
13
|
+
export declare const implementationBasePoolIdDictOptimism: IDict<string>;
|
|
12
14
|
export declare const basePoolIdZapDictEthereum: IDict<string>;
|
|
13
15
|
export declare const basePoolIdZapDictPolygon: IDict<string>;
|
|
14
16
|
export declare const basePoolIdZapDictFantom: IDict<string>;
|
|
15
17
|
export declare const basePoolIdZapDictAvalanche: IDict<string>;
|
|
16
18
|
export declare const basePoolIdZapDictArbitrum: IDict<string>;
|
|
19
|
+
export declare const basePoolIdZapDictOptimism: IDict<string>;
|
|
17
20
|
export declare const NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
18
21
|
export declare const NATIVE_TOKENS: {
|
|
19
22
|
[index: number]: {
|
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.basePoolIdZapDictArbitrum = exports.basePoolIdZapDictAvalanche = exports.basePoolIdZapDictFantom = exports.basePoolIdZapDictPolygon = exports.basePoolIdZapDictEthereum = exports.implementationBasePoolIdDictArbitrum = exports.implementationBasePoolIdDictAvalanche = exports.implementationBasePoolIdDictFantom = exports.implementationBasePoolIdDictPolygon = exports.implementationBasePoolIdDictEthereum = exports.implementationABIDictArbitrum = exports.implementationABIDictAvalanche = exports.implementationABIDictFantom = exports.implementationABIDictPolygon = exports.implementationABIDictEthereum = void 0;
|
|
6
|
+
exports.FACTORY_CONSTANTS = exports.NATIVE_TOKENS = exports.NATIVE_TOKEN_ADDRESS = exports.basePoolIdZapDictOptimism = exports.basePoolIdZapDictArbitrum = exports.basePoolIdZapDictAvalanche = exports.basePoolIdZapDictFantom = exports.basePoolIdZapDictPolygon = exports.basePoolIdZapDictEthereum = exports.implementationBasePoolIdDictOptimism = exports.implementationBasePoolIdDictArbitrum = exports.implementationBasePoolIdDictAvalanche = exports.implementationBasePoolIdDictFantom = exports.implementationBasePoolIdDictPolygon = exports.implementationBasePoolIdDictEthereum = 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"));
|
|
@@ -123,6 +123,22 @@ exports.implementationABIDictArbitrum = {
|
|
|
123
123
|
"0x89287c32c2CAC1C76227F6d300B2DBbab6b75C08": Plain4ETH_json_1.default,
|
|
124
124
|
"0x06e3C4da96fd076b97b7ca3Ae23527314b6140dF": Plain4Optimized_json_1.default,
|
|
125
125
|
};
|
|
126
|
+
exports.implementationABIDictOptimism = {
|
|
127
|
+
"0x78CF256256C8089d68Cde634Cf7cDEFb39286470": MetaUSD_json_1.default,
|
|
128
|
+
"0xADf698e4d8Df08b3E2c79682891636eF00F6e205": MetaUSDBalances_json_1.default,
|
|
129
|
+
"0xC2b1DF84112619D190193E48148000e3990Bf627": Plain2Basic_json_1.default,
|
|
130
|
+
"0x16a7DA911A4DD1d83F3fF066fE28F3C792C50d90": Plain2Balances_json_1.default,
|
|
131
|
+
"0x4f3E8F405CF5aFC05D68142F3783bDfE13811522": Plain2ETH_json_1.default,
|
|
132
|
+
"0x0f9cb53Ebe405d49A0bbdBD291A65Ff571bC83e1": Plain2Optimized_json_1.default,
|
|
133
|
+
"0x78D0fC2B9D5AE65512DB242e424a9c683F18c243": Plain3Basic_json_1.default,
|
|
134
|
+
"0x35796DAc54f144DFBAD1441Ec7C32313A7c29F39": Plain3Balances_json_1.default,
|
|
135
|
+
"0x6600e98b71dabfD4A8Cac03b302B0189Adb86Afb": Plain3ETH_json_1.default,
|
|
136
|
+
"0x6D65b498cb23deAba52db31c93Da9BFFb340FB8F": Plain3Optimized_json_1.default,
|
|
137
|
+
"0x445FE580eF8d70FF569aB36e80c647af338db351": Plain4Basic_json_1.default,
|
|
138
|
+
"0xF6bDc2619FFDA72c537Cd9605e0A274Dc48cB1C9": Plain4Balances_json_1.default,
|
|
139
|
+
"0x1AEf73d49Dedc4b1778d0706583995958Dc862e6": Plain4ETH_json_1.default,
|
|
140
|
+
"0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6": Plain4Optimized_json_1.default,
|
|
141
|
+
};
|
|
126
142
|
exports.implementationBasePoolIdDictEthereum = {
|
|
127
143
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
|
|
128
144
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": "3pool",
|
|
@@ -160,6 +176,10 @@ exports.implementationBasePoolIdDictArbitrum = {
|
|
|
160
176
|
"0x094d12e5b541784701FD8d65F11fc0598FBC6332": "ren",
|
|
161
177
|
"0xF1f85a74AD6c64315F85af52d3d46bF715236ADc": "ren",
|
|
162
178
|
};
|
|
179
|
+
exports.implementationBasePoolIdDictOptimism = {
|
|
180
|
+
"0x78CF256256C8089d68Cde634Cf7cDEFb39286470": "3pool",
|
|
181
|
+
"0xADf698e4d8Df08b3E2c79682891636eF00F6e205": "3pool",
|
|
182
|
+
};
|
|
163
183
|
exports.basePoolIdZapDictEthereum = {
|
|
164
184
|
'3pool': "0xA79828DF1850E8a3A3064576f380D90aECDD3359".toLowerCase(),
|
|
165
185
|
fraxusdc: "0x08780fb7E580e492c1935bEe4fA5920b94AA95Da".toLowerCase(),
|
|
@@ -183,6 +203,9 @@ exports.basePoolIdZapDictArbitrum = {
|
|
|
183
203
|
"2pool": "0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287".toLowerCase(),
|
|
184
204
|
ren: "0x803A2B40c5a9BB2B86DD630B274Fa2A9202874C2".toLowerCase(),
|
|
185
205
|
};
|
|
206
|
+
exports.basePoolIdZapDictOptimism = {
|
|
207
|
+
"3pool": "0x167e42a1c7ab4be03764a2222aac57f5f6754411".toLowerCase(),
|
|
208
|
+
};
|
|
186
209
|
exports.NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
187
210
|
exports.NATIVE_TOKENS = {
|
|
188
211
|
1: {
|
|
@@ -190,6 +213,11 @@ exports.NATIVE_TOKENS = {
|
|
|
190
213
|
wrappedSymbol: 'WETH',
|
|
191
214
|
wrappedAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'.toLowerCase(),
|
|
192
215
|
},
|
|
216
|
+
10: {
|
|
217
|
+
symbol: 'ETH',
|
|
218
|
+
wrappedSymbol: 'WETH',
|
|
219
|
+
wrappedAddress: '0x4200000000000000000000000000000000000006'.toLowerCase(),
|
|
220
|
+
},
|
|
193
221
|
137: {
|
|
194
222
|
symbol: 'MATIC',
|
|
195
223
|
wrappedSymbol: 'WMATIC',
|
|
@@ -212,6 +240,11 @@ exports.FACTORY_CONSTANTS = {
|
|
|
212
240
|
implementationBasePoolIdDict: exports.implementationBasePoolIdDictEthereum,
|
|
213
241
|
basePoolIdZapDict: exports.basePoolIdZapDictEthereum,
|
|
214
242
|
},
|
|
243
|
+
10: {
|
|
244
|
+
implementationABIDict: exports.implementationABIDictOptimism,
|
|
245
|
+
implementationBasePoolIdDict: exports.implementationBasePoolIdDictOptimism,
|
|
246
|
+
basePoolIdZapDict: exports.basePoolIdZapDictOptimism,
|
|
247
|
+
},
|
|
215
248
|
137: {
|
|
216
249
|
implementationABIDict: exports.implementationABIDictPolygon,
|
|
217
250
|
implementationBasePoolIdDict: exports.implementationBasePoolIdDictPolygon,
|
|
@@ -223,6 +223,8 @@ function getExistingCoinAddressNameDict() {
|
|
|
223
223
|
}
|
|
224
224
|
if (this.chainId === 1)
|
|
225
225
|
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
226
|
+
if (this.chainId === 10)
|
|
227
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
226
228
|
if (this.chainId === 137)
|
|
227
229
|
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "MATIC";
|
|
228
230
|
if (this.chainId === 250)
|
package/lib/factory/factory.js
CHANGED
|
@@ -58,6 +58,7 @@ var common_1 = require("./common");
|
|
|
58
58
|
var constants_1 = require("./constants");
|
|
59
59
|
var BLACK_LIST = {
|
|
60
60
|
1: [],
|
|
61
|
+
10: [],
|
|
61
62
|
137: [
|
|
62
63
|
"0x666dc3b4babfd063faf965bd020024af0dc51b64",
|
|
63
64
|
"0xe4199bc5c5c1f63dba47b56b6db7144c51cf0bf8",
|
|
@@ -255,6 +256,8 @@ function getExistingCoinAddressNameDict() {
|
|
|
255
256
|
}
|
|
256
257
|
if (this.chainId === 1)
|
|
257
258
|
dict["0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"] = "ETH";
|
|
259
|
+
if (this.chainId === 10)
|
|
260
|
+
dict["0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"] = "ETH";
|
|
258
261
|
if (this.chainId === 137)
|
|
259
262
|
dict["0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"] = "MATIC";
|
|
260
263
|
if (this.chainId === 250)
|
|
@@ -262,7 +262,7 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
262
262
|
case 0:
|
|
263
263
|
if (this.gauge === ethers_1.ethers.constants.AddressZero)
|
|
264
264
|
return [2 /*return*/, []];
|
|
265
|
-
if (![137, 250, 43114, 42161].includes(curve_1.curve.chainId)) return [3 /*break*/, 8];
|
|
265
|
+
if (![10, 137, 250, 43114, 42161].includes(curve_1.curve.chainId)) return [3 /*break*/, 8];
|
|
266
266
|
apy = [];
|
|
267
267
|
return [4 /*yield*/, this.rewardTokens()];
|
|
268
268
|
case 1:
|
package/lib/pools/utils.js
CHANGED
|
@@ -46,6 +46,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.getUserPoolList = exports.getCryptoFactoryPoolList = exports.getFactoryPoolList = exports.getPoolList = void 0;
|
|
49
|
+
var ethers_1 = require("ethers");
|
|
49
50
|
var curve_1 = require("../curve");
|
|
50
51
|
var poolConstructor_1 = require("./poolConstructor");
|
|
51
52
|
var getPoolList = function () { return Object.keys(curve_1.curve.constants.POOLS_DATA); };
|
|
@@ -55,27 +56,34 @@ exports.getFactoryPoolList = getFactoryPoolList;
|
|
|
55
56
|
var getCryptoFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.CRYPTO_FACTORY_POOLS_DATA); };
|
|
56
57
|
exports.getCryptoFactoryPoolList = getCryptoFactoryPoolList;
|
|
57
58
|
var getUserPoolList = function (address) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var
|
|
59
|
-
return __generator(this, function (
|
|
60
|
-
switch (
|
|
59
|
+
var poolIds, calls, _i, poolIds_1, poolId, pool, userPoolList, _rawBalances, _a, poolIds_2, poolId, pool, _balance;
|
|
60
|
+
return __generator(this, function (_b) {
|
|
61
|
+
switch (_b.label) {
|
|
61
62
|
case 0:
|
|
62
63
|
if (!address)
|
|
63
64
|
address = curve_1.curve.signerAddress;
|
|
64
65
|
address = address;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
for (_i = 0,
|
|
68
|
-
|
|
69
|
-
pool = (0, poolConstructor_1.getPool)(
|
|
70
|
-
|
|
66
|
+
poolIds = __spreadArray(__spreadArray(__spreadArray([], (0, exports.getPoolList)(), true), (0, exports.getFactoryPoolList)(), true), (0, exports.getCryptoFactoryPoolList)(), true);
|
|
67
|
+
calls = [];
|
|
68
|
+
for (_i = 0, poolIds_1 = poolIds; _i < poolIds_1.length; _i++) {
|
|
69
|
+
poolId = poolIds_1[_i];
|
|
70
|
+
pool = (0, poolConstructor_1.getPool)(poolId);
|
|
71
|
+
calls.push(curve_1.curve.contracts[pool.lpToken].multicallContract.balanceOf(address));
|
|
72
|
+
if (pool.gauge !== ethers_1.ethers.constants.AddressZero)
|
|
73
|
+
calls.push(curve_1.curve.contracts[pool.gauge].multicallContract.balanceOf(address));
|
|
71
74
|
}
|
|
72
75
|
userPoolList = [];
|
|
73
|
-
return [4 /*yield*/,
|
|
76
|
+
return [4 /*yield*/, curve_1.curve.multicallProvider.all(calls)];
|
|
74
77
|
case 1:
|
|
75
|
-
|
|
76
|
-
for (
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
_rawBalances = _b.sent();
|
|
79
|
+
for (_a = 0, poolIds_2 = poolIds; _a < poolIds_2.length; _a++) {
|
|
80
|
+
poolId = poolIds_2[_a];
|
|
81
|
+
pool = (0, poolConstructor_1.getPool)(poolId);
|
|
82
|
+
_balance = _rawBalances.shift();
|
|
83
|
+
if (pool.gauge !== ethers_1.ethers.constants.AddressZero)
|
|
84
|
+
_balance = _balance.add(_rawBalances.shift());
|
|
85
|
+
if (_balance.gt(0)) {
|
|
86
|
+
userPoolList.push(poolId);
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
return [2 /*return*/, userPoolList];
|
package/lib/utils.js
CHANGED
|
@@ -240,7 +240,7 @@ var _getAllowance = function (coins, address, spender) { return __awaiter(void 0
|
|
|
240
240
|
_coins.splice(ethIndex, 1);
|
|
241
241
|
}
|
|
242
242
|
if (!(_coins.length === 1)) return [3 /*break*/, 2];
|
|
243
|
-
return [4 /*yield*/, curve_1.curve.contracts[_coins[0]].contract.allowance(address, spender)];
|
|
243
|
+
return [4 /*yield*/, curve_1.curve.contracts[_coins[0]].contract.allowance(address, spender, curve_1.curve.constantOptions)];
|
|
244
244
|
case 1:
|
|
245
245
|
allowance = [_a.sent()];
|
|
246
246
|
return [3 /*break*/, 4];
|
|
@@ -452,6 +452,7 @@ var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, void 0,
|
|
|
452
452
|
return [2 /*return*/, 1];
|
|
453
453
|
chainName = {
|
|
454
454
|
1: 'ethereum',
|
|
455
|
+
10: 'optimistic-ethereum',
|
|
455
456
|
137: 'polygon-pos',
|
|
456
457
|
250: 'fantom',
|
|
457
458
|
43114: 'avalanche',
|
|
@@ -459,6 +460,7 @@ var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, void 0,
|
|
|
459
460
|
}[curve_1.curve.chainId];
|
|
460
461
|
nativeTokenName = {
|
|
461
462
|
1: 'ethereum',
|
|
463
|
+
10: 'optimism',
|
|
462
464
|
137: 'matic-network',
|
|
463
465
|
250: 'fantom',
|
|
464
466
|
43114: 'avalanche-2',
|
|
@@ -525,6 +527,7 @@ var getTVL = function (chainId) {
|
|
|
525
527
|
case 0:
|
|
526
528
|
network = (_a = {
|
|
527
529
|
1: "ethereum",
|
|
530
|
+
10: 'optimism',
|
|
528
531
|
137: "polygon",
|
|
529
532
|
250: "fantom",
|
|
530
533
|
43114: "avalanche",
|