@curvefi/api 2.7.0 → 2.8.2
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 +0 -2
- package/lib/constants/abis/3pool/swap.json +0 -26
- package/lib/constants/aliases.d.ts +1 -0
- package/lib/constants/aliases.js +13 -1
- package/lib/constants/coins/xdai.d.ts +7 -0
- package/lib/constants/coins/xdai.js +17 -0
- package/lib/constants/pools/index.d.ts +2 -1
- package/lib/constants/pools/index.js +3 -1
- package/lib/constants/pools/xdai.d.ts +4 -0
- package/lib/constants/pools/xdai.js +71 -0
- package/lib/curve.js +18 -5
- 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 +10 -7
- package/lib/pools/PoolTemplate.js +531 -497
- package/lib/router.js +13 -3
- package/lib/utils.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -378,32 +378,6 @@
|
|
|
378
378
|
"type": "function",
|
|
379
379
|
"gas": "2673791"
|
|
380
380
|
},
|
|
381
|
-
{
|
|
382
|
-
"name": "get_dy_underlying",
|
|
383
|
-
"outputs": [
|
|
384
|
-
{
|
|
385
|
-
"type": "uint256",
|
|
386
|
-
"name": ""
|
|
387
|
-
}
|
|
388
|
-
],
|
|
389
|
-
"inputs": [
|
|
390
|
-
{
|
|
391
|
-
"type": "int128",
|
|
392
|
-
"name": "i"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
"type": "int128",
|
|
396
|
-
"name": "j"
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"type": "uint256",
|
|
400
|
-
"name": "dx"
|
|
401
|
-
}
|
|
402
|
-
],
|
|
403
|
-
"stateMutability": "view",
|
|
404
|
-
"type": "function",
|
|
405
|
-
"gas": "2673474"
|
|
406
|
-
},
|
|
407
381
|
{
|
|
408
382
|
"name": "exchange",
|
|
409
383
|
"outputs": [],
|
|
@@ -4,3 +4,4 @@ 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
6
|
export declare const ALIASES_OPTIMISM: import("../interfaces").IDict<string>;
|
|
7
|
+
export declare const ALIASES_XDAI: 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_OPTIMISM = exports.ALIASES_ARBITRUM = exports.ALIASES_AVALANCHE = exports.ALIASES_FANTOM = exports.ALIASES_POLYGON = exports.ALIASES_ETHEREUM = void 0;
|
|
3
|
+
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",
|
|
@@ -74,3 +74,15 @@ exports.ALIASES_OPTIMISM = (0, utils_1.lowerCaseValues)({
|
|
|
74
74
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
75
75
|
"registry_exchange": "",
|
|
76
76
|
});
|
|
77
|
+
exports.ALIASES_XDAI = (0, utils_1.lowerCaseValues)({
|
|
78
|
+
"crv": "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd",
|
|
79
|
+
"minter": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
80
|
+
"voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
|
|
81
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
82
|
+
"address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383",
|
|
83
|
+
"router": "0xfA9a30350048B2BF66865ee20363067c66f67e58",
|
|
84
|
+
"deposit_and_stake": "0xB7De33440B7171159a9718CBE748086cecDd9685",
|
|
85
|
+
"factory": '0xD19Baeadc667Cf2015e395f2B08668Ef120f41F5',
|
|
86
|
+
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
87
|
+
"registry_exchange": "",
|
|
88
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aTokensXDai = exports.ycTokensXDai = exports.yTokensXDai = exports.cTokensXDai = exports.COINS_XDAI = void 0;
|
|
4
|
+
var utils_1 = require("../utils");
|
|
5
|
+
exports.COINS_XDAI = (0, utils_1.lowerCaseValues)({
|
|
6
|
+
'crv': '0x712b3d230f3c1c19db860d80619288b1f0bdd0bd',
|
|
7
|
+
// --- USD ---
|
|
8
|
+
'wxdai': '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',
|
|
9
|
+
'usdc': '0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83',
|
|
10
|
+
'usdt': '0x4ECaBa5870353805a9F068101A40E0f32ed605C6',
|
|
11
|
+
'rai': '0xd7a28aa9c470e7e9d8c676bcd5dd2f40c5683afa',
|
|
12
|
+
'x3crv': '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
13
|
+
});
|
|
14
|
+
exports.cTokensXDai = []; //.map((a) => a.toLowerCase());
|
|
15
|
+
exports.yTokensXDai = []; //.map((a) => a.toLowerCase());
|
|
16
|
+
exports.ycTokensXDai = []; //.map((a) => a.toLowerCase());
|
|
17
|
+
exports.aTokensXDai = []; //.map((a) => a.toLowerCase());
|
|
@@ -4,4 +4,5 @@ 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
|
-
|
|
7
|
+
import { POOLS_DATA_XDAI } from "./xdai";
|
|
8
|
+
export { POOLS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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;
|
|
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");
|
|
@@ -13,3 +13,5 @@ var arbitrum_1 = require("./arbitrum");
|
|
|
13
13
|
Object.defineProperty(exports, "POOLS_DATA_ARBITRUM", { enumerable: true, get: function () { return arbitrum_1.POOLS_DATA_ARBITRUM; } });
|
|
14
14
|
var optimism_1 = require("./optimism");
|
|
15
15
|
Object.defineProperty(exports, "POOLS_DATA_OPTIMISM", { enumerable: true, get: function () { return optimism_1.POOLS_DATA_OPTIMISM; } });
|
|
16
|
+
var xdai_1 = require("./xdai");
|
|
17
|
+
Object.defineProperty(exports, "POOLS_DATA_XDAI", { enumerable: true, get: function () { return xdai_1.POOLS_DATA_XDAI; } });
|
|
@@ -0,0 +1,71 @@
|
|
|
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_XDAI = void 0;
|
|
7
|
+
var swap_json_1 = __importDefault(require("../abis/3pool/swap.json"));
|
|
8
|
+
var swap_json_2 = __importDefault(require("../abis/rai/swap.json"));
|
|
9
|
+
var deposit_json_1 = __importDefault(require("../abis/rai/deposit.json"));
|
|
10
|
+
var gauge_rewards_only_json_1 = __importDefault(require("../abis/gauge_rewards_only.json"));
|
|
11
|
+
var streamer_json_1 = __importDefault(require("../abis/streamer.json"));
|
|
12
|
+
var utils_1 = require("../utils");
|
|
13
|
+
exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
14
|
+
'3pool': {
|
|
15
|
+
name: "3pool",
|
|
16
|
+
full_name: "3pool",
|
|
17
|
+
symbol: "3pool",
|
|
18
|
+
reference_asset: 'USD',
|
|
19
|
+
swap_address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353',
|
|
20
|
+
token_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
21
|
+
gauge_address: '0x78CF256256C8089d68Cde634Cf7cDEFb39286470',
|
|
22
|
+
sCurveRewards_address: '0x6C09F6727113543Fd061a721da512B7eFCDD0267',
|
|
23
|
+
is_plain: true,
|
|
24
|
+
underlying_coins: ['WXDAI', 'USDC', 'USDT'],
|
|
25
|
+
wrapped_coins: ['WXDAI', 'USDC', 'USDT'],
|
|
26
|
+
underlying_coin_addresses: [
|
|
27
|
+
'0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',
|
|
28
|
+
'0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83',
|
|
29
|
+
'0x4ECaBa5870353805a9F068101A40E0f32ed605C6',
|
|
30
|
+
],
|
|
31
|
+
wrapped_coin_addresses: [
|
|
32
|
+
'0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',
|
|
33
|
+
'0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83',
|
|
34
|
+
'0x4ECaBa5870353805a9F068101A40E0f32ed605C6',
|
|
35
|
+
],
|
|
36
|
+
underlying_decimals: [18, 6, 6],
|
|
37
|
+
wrapped_decimals: [18, 6, 6],
|
|
38
|
+
swap_abi: swap_json_1.default,
|
|
39
|
+
gauge_abi: gauge_rewards_only_json_1.default,
|
|
40
|
+
sCurveRewards_abi: streamer_json_1.default,
|
|
41
|
+
},
|
|
42
|
+
rai: {
|
|
43
|
+
name: "rai",
|
|
44
|
+
full_name: "rai",
|
|
45
|
+
symbol: "rai",
|
|
46
|
+
reference_asset: 'USD',
|
|
47
|
+
swap_address: '0x85bA9Dfb4a3E4541420Fc75Be02E2B42042D7e46',
|
|
48
|
+
token_address: '0x36390a1Ae126f16C5D222CB1F2AB341dD09f2FEC',
|
|
49
|
+
gauge_address: '0x0000000000000000000000000000000000000000',
|
|
50
|
+
deposit_address: '0xdf6eb52c4A9d7d5964b918c50D47a643Fd7D3D4c',
|
|
51
|
+
is_meta: true,
|
|
52
|
+
base_pool: '3pool',
|
|
53
|
+
underlying_coins: ['RAI', 'WXDAI', 'USDC', 'USDT'],
|
|
54
|
+
wrapped_coins: ['RAI', 'x3CRV'],
|
|
55
|
+
underlying_coin_addresses: [
|
|
56
|
+
'0xd7a28aa9c470e7e9d8c676bcd5dd2f40c5683afa',
|
|
57
|
+
'0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',
|
|
58
|
+
'0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83',
|
|
59
|
+
'0x4ECaBa5870353805a9F068101A40E0f32ed605C6',
|
|
60
|
+
],
|
|
61
|
+
wrapped_coin_addresses: [
|
|
62
|
+
'0xd7a28aa9c470e7e9d8c676bcd5dd2f40c5683afa',
|
|
63
|
+
'0x1337BedC9D22ecbe766dF105c9623922A27963EC',
|
|
64
|
+
],
|
|
65
|
+
underlying_decimals: [18, 18, 6, 6],
|
|
66
|
+
wrapped_decimals: [18, 18],
|
|
67
|
+
swap_abi: swap_json_2.default,
|
|
68
|
+
gauge_abi: gauge_rewards_only_json_1.default,
|
|
69
|
+
deposit_abi: deposit_json_1.default,
|
|
70
|
+
},
|
|
71
|
+
});
|
package/lib/curve.js
CHANGED
|
@@ -80,13 +80,14 @@ var streamer_json_1 = __importDefault(require("./constants/abis/streamer.json"))
|
|
|
80
80
|
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
|
+
var aliases_1 = require("./constants/aliases");
|
|
83
84
|
var ethereum_1 = require("./constants/coins/ethereum");
|
|
84
85
|
var optimism_1 = require("./constants/coins/optimism");
|
|
85
86
|
var polygon_1 = require("./constants/coins/polygon");
|
|
86
87
|
var fantom_1 = require("./constants/coins/fantom");
|
|
87
88
|
var avalanche_1 = require("./constants/coins/avalanche");
|
|
88
89
|
var arbitrum_1 = require("./constants/coins/arbitrum");
|
|
89
|
-
var
|
|
90
|
+
var xdai_1 = require("./constants/coins/xdai");
|
|
90
91
|
var utils_1 = require("./constants/utils");
|
|
91
92
|
exports.NETWORK_CONSTANTS = {
|
|
92
93
|
1: {
|
|
@@ -109,6 +110,16 @@ exports.NETWORK_CONSTANTS = {
|
|
|
109
110
|
ycTokens: optimism_1.ycTokensOptimism,
|
|
110
111
|
aTokens: optimism_1.aTokensOptimism,
|
|
111
112
|
},
|
|
113
|
+
100: {
|
|
114
|
+
NAME: 'xdai',
|
|
115
|
+
ALIASES: aliases_1.ALIASES_XDAI,
|
|
116
|
+
POOLS_DATA: pools_1.POOLS_DATA_XDAI,
|
|
117
|
+
COINS: xdai_1.COINS_XDAI,
|
|
118
|
+
cTokens: xdai_1.cTokensXDai,
|
|
119
|
+
yTokens: xdai_1.yTokensXDai,
|
|
120
|
+
ycTokens: xdai_1.ycTokensXDai,
|
|
121
|
+
aTokens: xdai_1.aTokensXDai,
|
|
122
|
+
},
|
|
112
123
|
137: {
|
|
113
124
|
NAME: 'polygon',
|
|
114
125
|
ALIASES: aliases_1.ALIASES_POLYGON,
|
|
@@ -303,10 +314,12 @@ var Curve = /** @class */ (function () {
|
|
|
303
314
|
multicallContract: new ethcall_1.Contract(pool.token_address, ERC20_json_1.default),
|
|
304
315
|
};
|
|
305
316
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
317
|
+
if (pool.gauge_address !== ethers_1.ethers.constants.AddressZero) {
|
|
318
|
+
this.contracts[pool.gauge_address] = {
|
|
319
|
+
contract: new ethers_1.Contract(pool.gauge_address, pool.gauge_abi, this.signer || this.provider),
|
|
320
|
+
multicallContract: new ethcall_1.Contract(pool.gauge_address, pool.gauge_abi),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
310
323
|
if (pool.deposit_address && !this.contracts[pool.deposit_address]) {
|
|
311
324
|
this.contracts[pool.deposit_address] = {
|
|
312
325
|
contract: new ethers_1.Contract(pool.deposit_address, pool.deposit_abi, this.signer || this.provider),
|
package/lib/factory/common.js
CHANGED
|
@@ -32,6 +32,13 @@ function setFactoryZapContracts() {
|
|
|
32
32
|
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, deposit_json_1.default),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
else if (this.chainId === 100) {
|
|
36
|
+
var metaUsdZapAddress = "0x87C067fAc25f123554a0E76596BF28cFa37fD5E9".toLowerCase();
|
|
37
|
+
this.contracts[metaUsdZapAddress] = {
|
|
38
|
+
contract: new ethers_1.Contract(metaUsdZapAddress, deposit_json_1.default, this.signer || this.provider),
|
|
39
|
+
multicallContract: new ethcall_1.Contract(metaUsdZapAddress, deposit_json_1.default),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
35
42
|
else if (this.chainId === 137) {
|
|
36
43
|
var metaUsdZapAddress = "0x5ab5C56B9db92Ba45a0B46a207286cD83C15C939".toLowerCase();
|
|
37
44
|
this.contracts[metaUsdZapAddress] = {
|
|
@@ -5,18 +5,21 @@ export declare const implementationABIDictFantom: IDict<any>;
|
|
|
5
5
|
export declare const implementationABIDictAvalanche: IDict<any>;
|
|
6
6
|
export declare const implementationABIDictArbitrum: IDict<any>;
|
|
7
7
|
export declare const implementationABIDictOptimism: IDict<any>;
|
|
8
|
+
export declare const implementationABIDictXDai: IDict<any>;
|
|
8
9
|
export declare const implementationBasePoolIdDictEthereum: IDict<string>;
|
|
9
10
|
export declare const implementationBasePoolIdDictPolygon: IDict<string>;
|
|
10
11
|
export declare const implementationBasePoolIdDictFantom: IDict<string>;
|
|
11
12
|
export declare const implementationBasePoolIdDictAvalanche: IDict<string>;
|
|
12
13
|
export declare const implementationBasePoolIdDictArbitrum: IDict<string>;
|
|
13
14
|
export declare const implementationBasePoolIdDictOptimism: IDict<string>;
|
|
15
|
+
export declare const implementationBasePoolIdDictXDai: IDict<string>;
|
|
14
16
|
export declare const basePoolIdZapDictEthereum: IDict<string>;
|
|
15
17
|
export declare const basePoolIdZapDictPolygon: IDict<string>;
|
|
16
18
|
export declare const basePoolIdZapDictFantom: IDict<string>;
|
|
17
19
|
export declare const basePoolIdZapDictAvalanche: IDict<string>;
|
|
18
20
|
export declare const basePoolIdZapDictArbitrum: IDict<string>;
|
|
19
21
|
export declare const basePoolIdZapDictOptimism: IDict<string>;
|
|
22
|
+
export declare const basePoolIdZapDictXDai: IDict<string>;
|
|
20
23
|
export declare const NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
21
24
|
export declare const NATIVE_TOKENS: {
|
|
22
25
|
[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.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;
|
|
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;
|
|
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"));
|
|
@@ -139,6 +139,22 @@ exports.implementationABIDictOptimism = {
|
|
|
139
139
|
"0x1AEf73d49Dedc4b1778d0706583995958Dc862e6": Plain4ETH_json_1.default,
|
|
140
140
|
"0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6": Plain4Optimized_json_1.default,
|
|
141
141
|
};
|
|
142
|
+
exports.implementationABIDictXDai = {
|
|
143
|
+
"0x4A5bF7Ab9A8202692051c19B102d3eDD62aaBAE6": MetaUSD_json_1.default,
|
|
144
|
+
"0x0B4dc7A945695D11FD83e40B2DfC2B896A02395F": MetaUSDBalances_json_1.default,
|
|
145
|
+
"0x04e39EF8332e979Cf8e4f8891E64934FF65F231b": Plain2Basic_json_1.default,
|
|
146
|
+
"0xC9438d8928486bD9621D326002F4672bF684187A": Plain2Balances_json_1.default,
|
|
147
|
+
"0x2b70A5B878665FfDB4A06Ba40a264d6c70f68F4B": Plain2ETH_json_1.default,
|
|
148
|
+
"0x2D036f0Ff6F440dB623e0D9D3B5Daa509e5500C3": Plain2Optimized_json_1.default,
|
|
149
|
+
"0xec9cEBE650E181079576C1b6d0d2e092B1EdfF13": Plain3Basic_json_1.default,
|
|
150
|
+
"0xe8269B33E47761f552E1a3070119560d5fa8bBD6": Plain3Balances_json_1.default,
|
|
151
|
+
"0x114C4042B11a2b16F58Fe1BFe847589a122F678a": Plain3ETH_json_1.default,
|
|
152
|
+
"0x4244eB811D6e0Ef302326675207A95113dB4E1F8": Plain3Optimized_json_1.default,
|
|
153
|
+
"0x66B5792ED50a2a7405Ea75C4B6B1913eF4E46661": Plain4Basic_json_1.default,
|
|
154
|
+
"0xcB4eB43E31C830e22baF764c64F11F32C280496c": Plain4Balances_json_1.default,
|
|
155
|
+
"0xc1C49622b63B961ce1D352ecb7D8261Ab5556695": Plain4ETH_json_1.default,
|
|
156
|
+
"0x0E2615ce69Cd3Dc3Ff6f66a975bEa0655F3bA7b9": Plain4Optimized_json_1.default,
|
|
157
|
+
};
|
|
142
158
|
exports.implementationBasePoolIdDictEthereum = {
|
|
143
159
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
|
|
144
160
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": "3pool",
|
|
@@ -180,6 +196,10 @@ exports.implementationBasePoolIdDictOptimism = {
|
|
|
180
196
|
"0x78CF256256C8089d68Cde634Cf7cDEFb39286470": "3pool",
|
|
181
197
|
"0xADf698e4d8Df08b3E2c79682891636eF00F6e205": "3pool",
|
|
182
198
|
};
|
|
199
|
+
exports.implementationBasePoolIdDictXDai = {
|
|
200
|
+
"0x4A5bF7Ab9A8202692051c19B102d3eDD62aaBAE6": "3pool",
|
|
201
|
+
"0x0B4dc7A945695D11FD83e40B2DfC2B896A02395F": "3pool",
|
|
202
|
+
};
|
|
183
203
|
exports.basePoolIdZapDictEthereum = {
|
|
184
204
|
'3pool': "0xA79828DF1850E8a3A3064576f380D90aECDD3359".toLowerCase(),
|
|
185
205
|
fraxusdc: "0x08780fb7E580e492c1935bEe4fA5920b94AA95Da".toLowerCase(),
|
|
@@ -206,6 +226,9 @@ exports.basePoolIdZapDictArbitrum = {
|
|
|
206
226
|
exports.basePoolIdZapDictOptimism = {
|
|
207
227
|
"3pool": "0x167e42a1c7ab4be03764a2222aac57f5f6754411".toLowerCase(),
|
|
208
228
|
};
|
|
229
|
+
exports.basePoolIdZapDictXDai = {
|
|
230
|
+
"3pool": "0x87C067fAc25f123554a0E76596BF28cFa37fD5E9".toLowerCase(),
|
|
231
|
+
};
|
|
209
232
|
exports.NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
210
233
|
exports.NATIVE_TOKENS = {
|
|
211
234
|
1: {
|
|
@@ -218,6 +241,11 @@ exports.NATIVE_TOKENS = {
|
|
|
218
241
|
wrappedSymbol: 'WETH',
|
|
219
242
|
wrappedAddress: '0x4200000000000000000000000000000000000006'.toLowerCase(),
|
|
220
243
|
},
|
|
244
|
+
100: {
|
|
245
|
+
symbol: 'XDAi',
|
|
246
|
+
wrappedSymbol: 'WXDAI',
|
|
247
|
+
wrappedAddress: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d'.toLowerCase(),
|
|
248
|
+
},
|
|
221
249
|
137: {
|
|
222
250
|
symbol: 'MATIC',
|
|
223
251
|
wrappedSymbol: 'WMATIC',
|
|
@@ -245,6 +273,11 @@ exports.FACTORY_CONSTANTS = {
|
|
|
245
273
|
implementationBasePoolIdDict: exports.implementationBasePoolIdDictOptimism,
|
|
246
274
|
basePoolIdZapDict: exports.basePoolIdZapDictOptimism,
|
|
247
275
|
},
|
|
276
|
+
100: {
|
|
277
|
+
implementationABIDict: exports.implementationABIDictXDai,
|
|
278
|
+
implementationBasePoolIdDict: exports.implementationBasePoolIdDictXDai,
|
|
279
|
+
basePoolIdZapDict: exports.basePoolIdZapDictXDai,
|
|
280
|
+
},
|
|
248
281
|
137: {
|
|
249
282
|
implementationABIDict: exports.implementationABIDictPolygon,
|
|
250
283
|
implementationBasePoolIdDict: exports.implementationBasePoolIdDictPolygon,
|
|
@@ -225,6 +225,8 @@ function getExistingCoinAddressNameDict() {
|
|
|
225
225
|
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
226
226
|
if (this.chainId === 10)
|
|
227
227
|
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
228
|
+
if (this.chainId === 100)
|
|
229
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "XDAI";
|
|
228
230
|
if (this.chainId === 137)
|
|
229
231
|
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "MATIC";
|
|
230
232
|
if (this.chainId === 250)
|
package/lib/factory/factory.js
CHANGED
|
@@ -59,6 +59,7 @@ var constants_1 = require("./constants");
|
|
|
59
59
|
var BLACK_LIST = {
|
|
60
60
|
1: [],
|
|
61
61
|
10: [],
|
|
62
|
+
100: [],
|
|
62
63
|
137: [
|
|
63
64
|
"0x666dc3b4babfd063faf965bd020024af0dc51b64",
|
|
64
65
|
"0xe4199bc5c5c1f63dba47b56b6db7144c51cf0bf8",
|
|
@@ -255,17 +256,19 @@ function getExistingCoinAddressNameDict() {
|
|
|
255
256
|
_loop_1(poolData);
|
|
256
257
|
}
|
|
257
258
|
if (this.chainId === 1)
|
|
258
|
-
dict[
|
|
259
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
259
260
|
if (this.chainId === 10)
|
|
260
|
-
dict[
|
|
261
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
262
|
+
if (this.chainId === 100)
|
|
263
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "XDAI";
|
|
261
264
|
if (this.chainId === 137)
|
|
262
|
-
dict[
|
|
265
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "MATIC";
|
|
263
266
|
if (this.chainId === 250)
|
|
264
|
-
dict[
|
|
267
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "FTM";
|
|
265
268
|
if (this.chainId === 43114)
|
|
266
|
-
dict[
|
|
269
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "AVAX";
|
|
267
270
|
if (this.chainId === 42161)
|
|
268
|
-
dict[
|
|
271
|
+
dict[constants_1.NATIVE_TOKEN_ADDRESS] = "ETH";
|
|
269
272
|
return dict;
|
|
270
273
|
}
|
|
271
274
|
function getCoinAddressNameDict(coinAddresses, existingCoinAddrNameDict) {
|
|
@@ -329,7 +332,7 @@ function getCoinAddressDecimalsDict(coinAddresses, existingCoinAddressDecimalsDi
|
|
|
329
332
|
newCoinAddresses.forEach(function (addr, i) {
|
|
330
333
|
coinAddrNamesDict[addr] = decimals[i];
|
|
331
334
|
});
|
|
332
|
-
coinAddrNamesDict[
|
|
335
|
+
coinAddrNamesDict[constants_1.NATIVE_TOKEN_ADDRESS] = 18;
|
|
333
336
|
return [2 /*return*/, coinAddrNamesDict];
|
|
334
337
|
}
|
|
335
338
|
});
|