@curvefi/api 2.42.1 → 2.43.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 +18 -0
- package/lib/constants/coins/zksync.d.ts +6 -0
- package/lib/constants/coins/zksync.js +10 -0
- package/lib/constants/pools/index.d.ts +2 -1
- package/lib/constants/pools/index.js +2 -1
- package/lib/constants/pools/zksync.d.ts +2 -0
- package/lib/constants/pools/zksync.js +2 -0
- package/lib/curve.js +26 -6
- package/lib/external-api.js +3 -3
- package/lib/factory/constants-crypto.d.ts +5 -0
- package/lib/factory/constants-crypto.js +6 -0
- package/lib/factory/constants.d.ts +6 -0
- package/lib/factory/constants.js +21 -0
- package/lib/interfaces.d.ts +2 -2
- package/lib/pools/PoolTemplate.js +4 -4
- package/lib/pools/utils.js +2 -2
- package/lib/router.js +4 -1
- package/lib/utils.js +4 -2
- package/package.json +2 -2
|
@@ -9,3 +9,4 @@ export declare const ALIASES_MOONBEAM: import("../interfaces.js").IDict<string>;
|
|
|
9
9
|
export declare const ALIASES_AURORA: import("../interfaces.js").IDict<string>;
|
|
10
10
|
export declare const ALIASES_KAVA: import("../interfaces.js").IDict<string>;
|
|
11
11
|
export declare const ALIASES_CELO: import("../interfaces.js").IDict<string>;
|
|
12
|
+
export declare const ALIASES_ZKSYNC: import("../interfaces.js").IDict<string>;
|
package/lib/constants/aliases.js
CHANGED
|
@@ -197,3 +197,21 @@ export var ALIASES_CELO = lowerCaseValues({
|
|
|
197
197
|
"registry_exchange": "",
|
|
198
198
|
"factory_admin": "",
|
|
199
199
|
});
|
|
200
|
+
export var ALIASES_ZKSYNC = lowerCaseValues({
|
|
201
|
+
"crv": "0x0a7432cF27F1aE3825c313F3C81e7D3efD7639aB",
|
|
202
|
+
"minter": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
203
|
+
"voting_escrow": "0x0000000000000000000000000000000000000000",
|
|
204
|
+
"fee_distributor": "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc",
|
|
205
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
206
|
+
"address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383",
|
|
207
|
+
"router": "0xfA9a30350048B2BF66865ee20363067c66f67e58",
|
|
208
|
+
"deposit_and_stake": "0xB7De33440B7171159a9718CBE748086cecDd9685",
|
|
209
|
+
"stable_calc": "0x5552b631e2aD801fAa129Aacf4B701071cC9D1f7",
|
|
210
|
+
"factory": '0xAF5261eD780fd5b80CF6E206b6BF90CbB97F511B',
|
|
211
|
+
"crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
|
|
212
|
+
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
213
|
+
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
214
|
+
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
215
|
+
"registry_exchange": "0x0000000000000000000000000000000000000000",
|
|
216
|
+
"factory_admin": "0x0000000000000000000000000000000000000000",
|
|
217
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IDict } from "../../interfaces.js";
|
|
2
|
+
export declare const COINS_ZKSYNC: IDict<string>;
|
|
3
|
+
export declare const cTokensZkSync: never[];
|
|
4
|
+
export declare const yTokensZkSync: never[];
|
|
5
|
+
export declare const ycTokensZkSync: never[];
|
|
6
|
+
export declare const aTokensZkSync: never[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { lowerCaseValues } from "../utils.js";
|
|
2
|
+
export var COINS_ZKSYNC = lowerCaseValues({
|
|
3
|
+
'crv': '0x0a7432cF27F1aE3825c313F3C81e7D3efD7639aB',
|
|
4
|
+
// --- USD ---
|
|
5
|
+
'weth': '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91',
|
|
6
|
+
});
|
|
7
|
+
export var cTokensZkSync = []; //.map((a) => a.toLowerCase());
|
|
8
|
+
export var yTokensZkSync = []; //.map((a) => a.toLowerCase());
|
|
9
|
+
export var ycTokensZkSync = []; //.map((a) => a.toLowerCase());
|
|
10
|
+
export var aTokensZkSync = []; //.map((a) => a.toLowerCase());
|
|
@@ -10,4 +10,5 @@ import { POOLS_DATA_MOONBEAM } from "./moonbeam.js";
|
|
|
10
10
|
import { POOLS_DATA_AURORA } from "./aurora.js";
|
|
11
11
|
import { POOLS_DATA_KAVA } from "./kava.js";
|
|
12
12
|
import { POOLS_DATA_CELO } from "./celo.js";
|
|
13
|
-
|
|
13
|
+
import { POOLS_DATA_ZKSYNC } from "./zksync.js";
|
|
14
|
+
export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, };
|
|
@@ -10,4 +10,5 @@ import { POOLS_DATA_MOONBEAM } from "./moonbeam.js";
|
|
|
10
10
|
import { POOLS_DATA_AURORA } from "./aurora.js";
|
|
11
11
|
import { POOLS_DATA_KAVA } from "./kava.js";
|
|
12
12
|
import { POOLS_DATA_CELO } from "./celo.js";
|
|
13
|
-
|
|
13
|
+
import { POOLS_DATA_ZKSYNC } from "./zksync.js";
|
|
14
|
+
export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, };
|
package/lib/curve.js
CHANGED
|
@@ -83,8 +83,8 @@ import factoryEywaABI from './constants/abis/factory-eywa.json' assert { type: '
|
|
|
83
83
|
import factoryAdminABI from './constants/abis/factory-admin.json' assert { type: 'json' };
|
|
84
84
|
import cryptoFactoryABI from './constants/abis/factory-crypto.json' assert { type: 'json' };
|
|
85
85
|
import tricryptoFactoryABI from './constants/abis/factory-tricrypto.json' assert { type: 'json' };
|
|
86
|
-
import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, } from './constants/pools/index.js';
|
|
87
|
-
import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, } from "./constants/aliases.js";
|
|
86
|
+
import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, } from './constants/pools/index.js';
|
|
87
|
+
import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, } from "./constants/aliases.js";
|
|
88
88
|
import { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum } from "./constants/coins/ethereum.js";
|
|
89
89
|
import { COINS_OPTIMISM, cTokensOptimism, yTokensOptimism, ycTokensOptimism, aTokensOptimism } from "./constants/coins/optimism.js";
|
|
90
90
|
import { COINS_POLYGON, cTokensPolygon, yTokensPolygon, ycTokensPolygon, aTokensPolygon } from "./constants/coins/polygon.js";
|
|
@@ -96,6 +96,7 @@ import { COINS_MOONBEAM, cTokensMoonbeam, yTokensMoonbeam, ycTokensMoonbeam, aTo
|
|
|
96
96
|
import { COINS_AURORA, cTokensAurora, yTokensAurora, ycTokensAurora, aTokensAurora } from "./constants/coins/aurora.js";
|
|
97
97
|
import { COINS_KAVA, cTokensKava, yTokensKava, ycTokensKava, aTokensKava } from "./constants/coins/kava.js";
|
|
98
98
|
import { COINS_CELO, cTokensCelo, yTokensCelo, ycTokensCelo, aTokensCelo } from "./constants/coins/celo.js";
|
|
99
|
+
import { COINS_ZKSYNC, cTokensZkSync, yTokensZkSync, ycTokensZkSync, aTokensZkSync } from "./constants/coins/zksync.js";
|
|
99
100
|
import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./constants/utils.js";
|
|
100
101
|
import { _getAllGauges, _getHiddenPools } from "./external-api.js";
|
|
101
102
|
var _killGauges = function (poolsData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -150,6 +151,12 @@ export var NATIVE_TOKENS = {
|
|
|
150
151
|
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
151
152
|
wrappedAddress: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83'.toLowerCase(),
|
|
152
153
|
},
|
|
154
|
+
324: {
|
|
155
|
+
symbol: 'ETH',
|
|
156
|
+
wrappedSymbol: 'WETH',
|
|
157
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
158
|
+
wrappedAddress: '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91'.toLowerCase(),
|
|
159
|
+
},
|
|
153
160
|
1284: {
|
|
154
161
|
symbol: 'GLMR',
|
|
155
162
|
wrappedSymbol: 'WGLMR',
|
|
@@ -239,6 +246,16 @@ export var NETWORK_CONSTANTS = {
|
|
|
239
246
|
ycTokens: ycTokensFantom,
|
|
240
247
|
aTokens: aTokensFantom,
|
|
241
248
|
},
|
|
249
|
+
324: {
|
|
250
|
+
NAME: 'zksync',
|
|
251
|
+
ALIASES: ALIASES_ZKSYNC,
|
|
252
|
+
POOLS_DATA: POOLS_DATA_ZKSYNC,
|
|
253
|
+
COINS: COINS_ZKSYNC,
|
|
254
|
+
cTokens: cTokensZkSync,
|
|
255
|
+
yTokens: yTokensZkSync,
|
|
256
|
+
ycTokens: ycTokensZkSync,
|
|
257
|
+
aTokens: aTokensZkSync,
|
|
258
|
+
},
|
|
242
259
|
1284: {
|
|
243
260
|
NAME: 'moonbeam',
|
|
244
261
|
ALIASES: ALIASES_MOONBEAM,
|
|
@@ -850,12 +867,15 @@ var Curve = /** @class */ (function () {
|
|
|
850
867
|
this.setContract(this.constants.ALIASES.voting_escrow, votingEscrowABI);
|
|
851
868
|
this.setContract(this.constants.ALIASES.fee_distributor, feeDistributorABI);
|
|
852
869
|
this.setContract(this.constants.ALIASES.address_provider, addressProviderABI);
|
|
870
|
+
if (!(this.chainId !== 324)) return [3 /*break*/, 20];
|
|
853
871
|
addressProviderContract = this.contracts[this.constants.ALIASES.address_provider].contract;
|
|
854
872
|
_o = this.constants.ALIASES;
|
|
855
873
|
return [4 /*yield*/, addressProviderContract.get_address(2, this.constantOptions)];
|
|
856
874
|
case 19:
|
|
857
875
|
_o.registry_exchange = (_q.sent()).toLowerCase();
|
|
858
876
|
this.setContract(this.constants.ALIASES.registry_exchange, registryExchangeABI);
|
|
877
|
+
_q.label = 20;
|
|
878
|
+
case 20:
|
|
859
879
|
this.setContract(this.constants.ALIASES.gauge_controller, gaugeControllerABI);
|
|
860
880
|
this.setContract(this.constants.ALIASES.router, routerABI);
|
|
861
881
|
if (this.chainId === 137) {
|
|
@@ -866,15 +886,15 @@ var Curve = /** @class */ (function () {
|
|
|
866
886
|
}
|
|
867
887
|
this.setContract(this.constants.ALIASES.stable_calc, StableCalcZapABI);
|
|
868
888
|
this.setContract(this.constants.ALIASES.factory, factoryABI);
|
|
869
|
-
if (!(this.chainId !== 1313161554)) return [3 /*break*/,
|
|
889
|
+
if (!(this.chainId !== 1313161554)) return [3 /*break*/, 22];
|
|
870
890
|
factoryContract = this.contracts[this.constants.ALIASES.factory].contract;
|
|
871
891
|
_p = this.constants.ALIASES;
|
|
872
892
|
return [4 /*yield*/, factoryContract.admin(this.constantOptions)];
|
|
873
|
-
case
|
|
893
|
+
case 21:
|
|
874
894
|
_p.factory_admin = (_q.sent()).toLowerCase();
|
|
875
895
|
this.setContract(this.constants.ALIASES.factory_admin, factoryAdminABI);
|
|
876
|
-
_q.label =
|
|
877
|
-
case
|
|
896
|
+
_q.label = 22;
|
|
897
|
+
case 22:
|
|
878
898
|
this.setContract(this.constants.ALIASES.crvusd_factory, factoryABI);
|
|
879
899
|
this.setContract(this.constants.ALIASES.eywa_factory, factoryEywaABI);
|
|
880
900
|
this.setContract(this.constants.ALIASES.crypto_factory, cryptoFactoryABI);
|
package/lib/external-api.js
CHANGED
|
@@ -97,8 +97,8 @@ export var _getLegacyAPYsAndVolumes = memoize(function (network) { return __awai
|
|
|
97
97
|
return __generator(this, function (_a) {
|
|
98
98
|
switch (_a.label) {
|
|
99
99
|
case 0:
|
|
100
|
-
if (network === "kava" || network === "celo")
|
|
101
|
-
return [2 /*return*/, {}]; // Exclude Kava and
|
|
100
|
+
if (network === "kava" || network === "celo" || network === "zksync")
|
|
101
|
+
return [2 /*return*/, {}]; // Exclude Kava, Celo and ZkSync
|
|
102
102
|
url = "https://api.curve.fi/api/getMainPoolsAPYs/" + network;
|
|
103
103
|
return [4 /*yield*/, axios.get(url, { validateStatus: function () { return true; } })];
|
|
104
104
|
case 1:
|
|
@@ -117,7 +117,7 @@ export var _getLegacyAPYsAndVolumes = memoize(function (network) { return __awai
|
|
|
117
117
|
promise: true,
|
|
118
118
|
maxAge: 5 * 60 * 1000, // 5m
|
|
119
119
|
});
|
|
120
|
-
// Moonbeam, Kava and Celo only
|
|
120
|
+
// ZkSync, Moonbeam, Kava and Celo only
|
|
121
121
|
export var _getFactoryAPYsAndVolumes = memoize(function (network) { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
122
|
var url, response;
|
|
123
123
|
var _a;
|
|
@@ -9,6 +9,7 @@ export declare const lpTokenBasePoolIdDictXDai: IDict<string>;
|
|
|
9
9
|
export declare const lpTokenBasePoolIdDictMoonbeam: IDict<string>;
|
|
10
10
|
export declare const lpTokenBasePoolIdDictKava: IDict<string>;
|
|
11
11
|
export declare const lpTokenBasePoolIdDictCelo: IDict<string>;
|
|
12
|
+
export declare const lpTokenBasePoolIdDictZkSync: IDict<string>;
|
|
12
13
|
export declare const basePoolIdZapDictEthereum: IDict<{
|
|
13
14
|
address: string;
|
|
14
15
|
ABI: any;
|
|
@@ -49,6 +50,10 @@ export declare const basePoolIdZapDictCelo: IDict<{
|
|
|
49
50
|
address: string;
|
|
50
51
|
ABI: any;
|
|
51
52
|
}>;
|
|
53
|
+
export declare const basePoolIdZapDictZkSync: IDict<{
|
|
54
|
+
address: string;
|
|
55
|
+
ABI: any;
|
|
56
|
+
}>;
|
|
52
57
|
export declare const CRYPTO_FACTORY_CONSTANTS: {
|
|
53
58
|
[index: number]: {
|
|
54
59
|
lpTokenBasePoolIdDict: IDict<string>;
|
|
@@ -18,6 +18,7 @@ export var lpTokenBasePoolIdDictXDai = lowerCaseKeys({});
|
|
|
18
18
|
export var lpTokenBasePoolIdDictMoonbeam = lowerCaseKeys({});
|
|
19
19
|
export var lpTokenBasePoolIdDictKava = lowerCaseKeys({});
|
|
20
20
|
export var lpTokenBasePoolIdDictCelo = lowerCaseKeys({});
|
|
21
|
+
export var lpTokenBasePoolIdDictZkSync = lowerCaseKeys({});
|
|
21
22
|
export var basePoolIdZapDictEthereum = {
|
|
22
23
|
'3pool': {
|
|
23
24
|
address: "0x97aDC08FA1D849D2C48C5dcC1DaB568B169b0267".toLowerCase(),
|
|
@@ -42,6 +43,7 @@ export var basePoolIdZapDictXDai = {};
|
|
|
42
43
|
export var basePoolIdZapDictMoonbeam = {};
|
|
43
44
|
export var basePoolIdZapDictKava = {};
|
|
44
45
|
export var basePoolIdZapDictCelo = {};
|
|
46
|
+
export var basePoolIdZapDictZkSync = {};
|
|
45
47
|
export var CRYPTO_FACTORY_CONSTANTS = {
|
|
46
48
|
1: {
|
|
47
49
|
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictEthereum,
|
|
@@ -63,6 +65,10 @@ export var CRYPTO_FACTORY_CONSTANTS = {
|
|
|
63
65
|
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictFantom,
|
|
64
66
|
basePoolIdZapDict: basePoolIdZapDictFantom,
|
|
65
67
|
},
|
|
68
|
+
324: {
|
|
69
|
+
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictZkSync,
|
|
70
|
+
basePoolIdZapDict: basePoolIdZapDictZkSync,
|
|
71
|
+
},
|
|
66
72
|
1284: {
|
|
67
73
|
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictMoonbeam,
|
|
68
74
|
basePoolIdZapDict: basePoolIdZapDictMoonbeam,
|
|
@@ -9,6 +9,7 @@ export declare const implementationABIDictXDai: IDict<any>;
|
|
|
9
9
|
export declare const implementationABIDictMoonbeam: IDict<any>;
|
|
10
10
|
export declare const implementationABIDictKava: IDict<any>;
|
|
11
11
|
export declare const implementationABIDictCelo: IDict<any>;
|
|
12
|
+
export declare const implementationABIDictZkSync: IDict<any>;
|
|
12
13
|
export declare const implementationBasePoolIdDictEthereum: IDict<string>;
|
|
13
14
|
export declare const implementationBasePoolIdDictPolygon: IDict<string>;
|
|
14
15
|
export declare const implementationBasePoolIdDictFantom: IDict<string>;
|
|
@@ -19,6 +20,7 @@ export declare const implementationBasePoolIdDictXDai: IDict<string>;
|
|
|
19
20
|
export declare const implementationBasePoolIdDictMoonbeam: IDict<string>;
|
|
20
21
|
export declare const implementationBasePoolIdDictKava: IDict<string>;
|
|
21
22
|
export declare const implementationBasePoolIdDictCelo: IDict<string>;
|
|
23
|
+
export declare const implementationBasePoolIdDictZkSync: IDict<string>;
|
|
22
24
|
export declare const basePoolIdZapDictEthereum: IDict<{
|
|
23
25
|
address: string;
|
|
24
26
|
ABI: any;
|
|
@@ -59,6 +61,10 @@ export declare const basePoolIdZapDictCelo: IDict<{
|
|
|
59
61
|
address: string;
|
|
60
62
|
ABI: any;
|
|
61
63
|
}>;
|
|
64
|
+
export declare const basePoolIdZapDictZkSync: IDict<{
|
|
65
|
+
address: string;
|
|
66
|
+
ABI: any;
|
|
67
|
+
}>;
|
|
62
68
|
export declare const FACTORY_CONSTANTS: {
|
|
63
69
|
[index: number]: {
|
|
64
70
|
implementationABIDict: IDict<any>;
|
package/lib/factory/constants.js
CHANGED
|
@@ -229,6 +229,20 @@ export var implementationABIDictCelo = lowerCaseKeys({
|
|
|
229
229
|
"0x0F5390AB4C5456a769056C96E4D7C71770b52319": Plain4ETHABI,
|
|
230
230
|
"0xA73b02a97B45604cd9f0BBAA153eCfe01f409350": Plain4OptimizedABI,
|
|
231
231
|
});
|
|
232
|
+
export var implementationABIDictZkSync = {
|
|
233
|
+
"0x7c2a205C52361410233540008f7095dEF5915843": Plain2BasicABI,
|
|
234
|
+
"0xEF04fC6b95b1658AfdFd527aF9b947cd7BD46bde": Plain2BalancesABI,
|
|
235
|
+
"0x4887ef1a68f30364a25a8b0bAA13EeeA7eeBE574": Plain2ETHABI,
|
|
236
|
+
"0x044f8F31078c0CB898f25fff3286cE905C18434e": Plain2OptimizedABI,
|
|
237
|
+
"0x2e6De7148Afc6e4B1ee766D070DDeff0C84831a5": Plain3BasicABI,
|
|
238
|
+
"0x5D18b28C052Bb0C1573d90Ea055b13048026d83F": Plain3BalancesABI,
|
|
239
|
+
"0x9707Bbf96eBB136B67788aa7E46d771Ec18895f4": Plain3ETHABI,
|
|
240
|
+
"0xb274f2cdCff70A0bac146e9Ca5a8a28f59a3f812": Plain3OptimizedABI,
|
|
241
|
+
"0x30eb3F0EF60993584e8dD231dF7539db31800555": Plain4BasicABI,
|
|
242
|
+
"0x3D21E268d6A526948e978ad1595052c949927e54": Plain4BalancesABI,
|
|
243
|
+
"0xD46aed59fBd5eB6c134b1AFb364240bb62dA0451": Plain4ETHABI,
|
|
244
|
+
"0xE80AeF1a4782eA7b7f9Ad9F0c2ed9343861934e3": Plain4OptimizedABI,
|
|
245
|
+
};
|
|
232
246
|
export var implementationBasePoolIdDictEthereum = lowerCaseKeys({
|
|
233
247
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
|
|
234
248
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": "3pool",
|
|
@@ -285,6 +299,7 @@ export var implementationBasePoolIdDictXDai = lowerCaseKeys({
|
|
|
285
299
|
export var implementationBasePoolIdDictMoonbeam = lowerCaseKeys({});
|
|
286
300
|
export var implementationBasePoolIdDictKava = lowerCaseKeys({});
|
|
287
301
|
export var implementationBasePoolIdDictCelo = lowerCaseKeys({});
|
|
302
|
+
export var implementationBasePoolIdDictZkSync = lowerCaseKeys({});
|
|
288
303
|
export var basePoolIdZapDictEthereum = {
|
|
289
304
|
'3pool': {
|
|
290
305
|
address: "0xA79828DF1850E8a3A3064576f380D90aECDD3359".toLowerCase(),
|
|
@@ -378,6 +393,7 @@ export var basePoolIdZapDictXDai = {
|
|
|
378
393
|
export var basePoolIdZapDictMoonbeam = {};
|
|
379
394
|
export var basePoolIdZapDictKava = {};
|
|
380
395
|
export var basePoolIdZapDictCelo = {};
|
|
396
|
+
export var basePoolIdZapDictZkSync = {};
|
|
381
397
|
export var FACTORY_CONSTANTS = {
|
|
382
398
|
1: {
|
|
383
399
|
implementationABIDict: implementationABIDictEthereum,
|
|
@@ -404,6 +420,11 @@ export var FACTORY_CONSTANTS = {
|
|
|
404
420
|
implementationBasePoolIdDict: implementationBasePoolIdDictFantom,
|
|
405
421
|
basePoolIdZapDict: basePoolIdZapDictFantom,
|
|
406
422
|
},
|
|
423
|
+
324: {
|
|
424
|
+
implementationABIDict: implementationABIDictZkSync,
|
|
425
|
+
implementationBasePoolIdDict: implementationBasePoolIdDictZkSync,
|
|
426
|
+
basePoolIdZapDict: basePoolIdZapDictZkSync,
|
|
427
|
+
},
|
|
407
428
|
1284: {
|
|
408
429
|
implementationABIDict: implementationABIDictMoonbeam,
|
|
409
430
|
implementationBasePoolIdDict: implementationBasePoolIdDictMoonbeam,
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Contract as MulticallContract, Provider as MulticallProvider } from "et
|
|
|
3
3
|
export interface IDict<T> {
|
|
4
4
|
[index: string]: T;
|
|
5
5
|
}
|
|
6
|
-
export type INetworkName = "ethereum" | "optimism" | "xdai" | "polygon" | "fantom" | "moonbeam" | "kava" | "arbitrum" | "celo" | "avalanche" | "aurora";
|
|
7
|
-
export type IChainId = 1 | 10 | 100 | 137 | 250 | 1284 | 2222 | 42161 | 42220 | 43114 | 1313161554;
|
|
6
|
+
export type INetworkName = "ethereum" | "optimism" | "xdai" | "polygon" | "fantom" | "zksync" | "moonbeam" | "kava" | "arbitrum" | "celo" | "avalanche" | "aurora";
|
|
7
|
+
export type IChainId = 1 | 10 | 100 | 137 | 250 | 324 | 1284 | 2222 | 42161 | 42220 | 43114 | 1313161554;
|
|
8
8
|
export type IFactoryPoolType = "factory" | "factory-crvusd" | "factory-eywa" | "factory-crypto" | "factory-tricrypto";
|
|
9
9
|
export type IPoolType = "main" | "crypto" | IFactoryPoolType;
|
|
10
10
|
export type REFERENCE_ASSET = 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
|
|
@@ -225,7 +225,7 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
225
225
|
return __generator(this, function (_e) {
|
|
226
226
|
switch (_e.label) {
|
|
227
227
|
case 0:
|
|
228
|
-
if (![1284, 2222, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 3];
|
|
228
|
+
if (![324, 1284, 2222, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 3];
|
|
229
229
|
return [4 /*yield*/, Promise.all([
|
|
230
230
|
_getLegacyAPYsAndVolumes(curve.constants.NETWORK_NAME),
|
|
231
231
|
_getFactoryAPYsAndVolumes(curve.constants.NETWORK_NAME),
|
|
@@ -260,7 +260,7 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
260
260
|
return __generator(this, function (_d) {
|
|
261
261
|
switch (_d.label) {
|
|
262
262
|
case 0:
|
|
263
|
-
if (![1284, 2222, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 2];
|
|
263
|
+
if (![324, 1284, 2222, 42220, 1313161554].includes(curve.chainId)) return [3 /*break*/, 2];
|
|
264
264
|
return [4 /*yield*/, Promise.all([
|
|
265
265
|
_getLegacyAPYsAndVolumes(curve.constants.NETWORK_NAME),
|
|
266
266
|
_getFactoryAPYsAndVolumes(curve.constants.NETWORK_NAME),
|
|
@@ -1158,8 +1158,8 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
1160
|
PoolTemplate.prototype.rewardsOnly = function () {
|
|
1161
|
-
if (curve.chainId === 2222)
|
|
1162
|
-
return true; // TODO remove this for Kava and
|
|
1161
|
+
if (curve.chainId === 2222 || curve.chainId === 324)
|
|
1162
|
+
return true; // TODO remove this for Kava and ZkSync
|
|
1163
1163
|
if (this.gauge === curve.constants.ZERO_ADDRESS)
|
|
1164
1164
|
throw Error("".concat(this.name, " doesn't have gauge"));
|
|
1165
1165
|
var gaugeContract = curve.contracts[this.gauge].contract;
|
package/lib/pools/utils.js
CHANGED
|
@@ -158,7 +158,7 @@ var _getUserClaimable = function (pools, address, useCache) { return __awaiter(v
|
|
|
158
158
|
for (_i = 0, poolsToFetch_3 = poolsToFetch; _i < poolsToFetch_3.length; _i++) {
|
|
159
159
|
poolId = poolsToFetch_3[_i];
|
|
160
160
|
pool = getPool(poolId);
|
|
161
|
-
if (curve.chainId === 2222 || pool.gauge === curve.constants.ZERO_ADDRESS) { // TODO remove this for Kava
|
|
161
|
+
if (curve.chainId === 324 || curve.chainId === 2222 || pool.gauge === curve.constants.ZERO_ADDRESS) { // TODO remove this for ZkSync and Kava
|
|
162
162
|
hasCrvReward.push(false);
|
|
163
163
|
continue;
|
|
164
164
|
}
|
|
@@ -300,7 +300,7 @@ var _getUserClaimableUseApi = function (pools, address, useCache) { return __awa
|
|
|
300
300
|
for (_i = 0, poolsToFetch_5 = poolsToFetch; _i < poolsToFetch_5.length; _i++) {
|
|
301
301
|
poolId = poolsToFetch_5[_i];
|
|
302
302
|
pool = getPool(poolId);
|
|
303
|
-
if (curve.chainId === 2222 || pool.gauge === curve.constants.ZERO_ADDRESS) { // TODO remove this for Kava
|
|
303
|
+
if (curve.chainId === 324 || curve.chainId === 2222 || pool.gauge === curve.constants.ZERO_ADDRESS) { // TODO remove this for ZkSync and Kava
|
|
304
304
|
hasCrvReward.push(false);
|
|
305
305
|
continue;
|
|
306
306
|
}
|
package/lib/router.js
CHANGED
|
@@ -136,7 +136,10 @@ var _findAllRoutes = function (inputCoinAddress, outputCoinAddress) { return __a
|
|
|
136
136
|
case 0:
|
|
137
137
|
inputCoinAddress = inputCoinAddress.toLowerCase();
|
|
138
138
|
outputCoinAddress = outputCoinAddress.toLowerCase();
|
|
139
|
-
ALL_POOLS = Object.entries(curve.getPoolsData())
|
|
139
|
+
ALL_POOLS = Object.entries(curve.getPoolsData()).filter(function (_a) {
|
|
140
|
+
var id = _a[0], _ = _a[1];
|
|
141
|
+
return id !== "crveth";
|
|
142
|
+
});
|
|
140
143
|
return [4 /*yield*/, _getAmplificationCoefficientsFromApi()];
|
|
141
144
|
case 1:
|
|
142
145
|
amplificationCoefficientDict = _s.sent();
|
package/lib/utils.js
CHANGED
|
@@ -515,6 +515,7 @@ export var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, v
|
|
|
515
515
|
100: 'xdai',
|
|
516
516
|
137: 'polygon-pos',
|
|
517
517
|
250: 'fantom',
|
|
518
|
+
324: 'zksync',
|
|
518
519
|
1284: 'moonbeam',
|
|
519
520
|
2222: 'kava',
|
|
520
521
|
42220: 'celo',
|
|
@@ -528,6 +529,7 @@ export var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, v
|
|
|
528
529
|
100: 'xdai',
|
|
529
530
|
137: 'matic-network',
|
|
530
531
|
250: 'fantom',
|
|
532
|
+
324: 'ethereum',
|
|
531
533
|
1284: 'moonbeam',
|
|
532
534
|
2222: 'kava',
|
|
533
535
|
42220: 'celo',
|
|
@@ -634,10 +636,10 @@ export var getVolume = function (network) {
|
|
|
634
636
|
switch (_e.label) {
|
|
635
637
|
case 0:
|
|
636
638
|
network = _getNetworkName(network);
|
|
637
|
-
if (!["moonbeam", "kava", "celo", "aurora"].includes(network)) return [3 /*break*/, 8];
|
|
639
|
+
if (!["zksync", "moonbeam", "kava", "celo", "aurora"].includes(network)) return [3 /*break*/, 8];
|
|
638
640
|
chainId = _getChainId(network);
|
|
639
641
|
if (curve.chainId !== chainId)
|
|
640
|
-
throw Error("To get volume for Moonbeam, Kava, Celo or Aurora connect to the network first");
|
|
642
|
+
throw Error("To get volume for ZkSync, Moonbeam, Kava, Celo or Aurora connect to the network first");
|
|
641
643
|
return [4 /*yield*/, Promise.all([
|
|
642
644
|
_getLegacyAPYsAndVolumes(network),
|
|
643
645
|
_getFactoryAPYsAndVolumes(network),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curvefi/api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.0",
|
|
4
4
|
"description": "JavaScript library for curve.fi",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Macket",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"axios": "^0.21.1",
|
|
36
36
|
"bignumber.js": "^9.0.1",
|
|
37
|
-
"ethcall": "^6.0.
|
|
37
|
+
"ethcall": "^6.0.1",
|
|
38
38
|
"ethers": "^6.3.0",
|
|
39
39
|
"memoizee": "^0.4.15"
|
|
40
40
|
}
|