@curvefi/api 2.47.3 → 2.47.5
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 +3 -1
- package/lib/factory/constants.js +2 -0
- package/lib/factory/deploy.d.ts +1 -0
- package/lib/factory/deploy.js +17 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -1
- package/lib/utils.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1753,7 +1753,9 @@ import curve from "@curvefi/api";
|
|
|
1753
1753
|
const gaugeSidechainAddress = await curve.factory.getDeployedGaugeAddress(deployGaugeSidechain);
|
|
1754
1754
|
// 0x60d3d7ebbc44dc810a743703184f062d00e6db7e
|
|
1755
1755
|
//After that should be deployed mirror gauge on mainnet with same salt
|
|
1756
|
-
//await curve.tricryptoFactory.deployGaugeMirror(sidechainId, salt);
|
|
1756
|
+
//const gaugeMirrorTx = await curve.tricryptoFactory.deployGaugeMirror(sidechainId, salt);
|
|
1757
|
+
//const deployedGaugeMirrorAddress = await curve.tricryptoFactory.getDeployedGaugeMirrorAddressByTx(gaugeMirrorTx);
|
|
1758
|
+
//OR
|
|
1757
1759
|
//const deployedGaugeMirrorAddress = await curve.tricryptoFactory.getDeployedGaugeMirrorAddress(sidechainId);
|
|
1758
1760
|
|
|
1759
1761
|
// Deposit & Stake
|
package/lib/factory/constants.js
CHANGED
|
@@ -59,6 +59,8 @@ export var implementationABIDictEthereum = lowerCaseKeys({
|
|
|
59
59
|
"0x847ee1227A9900B73aEeb3a47fAc92c52FD54ed9": Plain2ETHOracleABI,
|
|
60
60
|
"0x94b4DFd9Ba5865Cc931195c99A2db42F3fc5d45B": Plain2ETHABI,
|
|
61
61
|
"0x67fe41A94e779CcFa22cff02cc2957DC9C0e4286": Plain2BasicABI,
|
|
62
|
+
"0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a": Plain2BalancesABI,
|
|
63
|
+
"0x0C9D8c7e486e822C29488Ff51BFf0167B4650953": Plain2BasicABI,
|
|
62
64
|
"0x9B52F13DF69D79Ec5aAB6D1aCe3157d29B409cC3": Plain3BasicABI,
|
|
63
65
|
"0x50b085f2e5958C4A87baf93A8AB79F6bec068494": Plain3BalancesABI,
|
|
64
66
|
"0x8c1aB78601c259E1B43F19816923609dC7d7de9B": Plain3ETHABI,
|
package/lib/factory/deploy.d.ts
CHANGED
|
@@ -21,4 +21,5 @@ export declare const deployGaugeSidechain: (pool: string, salt: string) => Promi
|
|
|
21
21
|
export declare const deployGaugeMirrorEstimateGas: (chainId: number, salt: string) => Promise<number>;
|
|
22
22
|
export declare const deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
|
|
23
23
|
export declare const getDeployedGaugeAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
24
|
+
export declare const getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
24
25
|
export declare const getDeployedGaugeMirrorAddress: (chainId: number) => Promise<string>;
|
package/lib/factory/deploy.js
CHANGED
|
@@ -645,6 +645,23 @@ export var getDeployedGaugeAddress = function (tx) { return __awaiter(void 0, vo
|
|
|
645
645
|
}
|
|
646
646
|
});
|
|
647
647
|
}); };
|
|
648
|
+
export var getDeployedGaugeMirrorAddressByTx = function (tx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
649
|
+
var txInfo;
|
|
650
|
+
return __generator(this, function (_a) {
|
|
651
|
+
switch (_a.label) {
|
|
652
|
+
case 0:
|
|
653
|
+
if (curve.chainId !== 1)
|
|
654
|
+
throw Error("There is no getDeployedGaugeMirrorAddressByTx method on sidechain network");
|
|
655
|
+
return [4 /*yield*/, tx.wait()];
|
|
656
|
+
case 1:
|
|
657
|
+
txInfo = _a.sent();
|
|
658
|
+
if (!txInfo)
|
|
659
|
+
throw Error("Can't get tx info");
|
|
660
|
+
// @ts-ignore
|
|
661
|
+
return [2 /*return*/, txInfo.logs[1].args[txInfo.logs[1].args.length - 1].toLowerCase()];
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
}); };
|
|
648
665
|
export var getDeployedGaugeMirrorAddress = function (chainId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
649
666
|
var contract, gaugeCount, currentIndex;
|
|
650
667
|
return __generator(this, function (_a) {
|
package/lib/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ declare const curve: {
|
|
|
71
71
|
getDeployedMetaPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
72
72
|
getDeployedGaugeAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
73
73
|
getDeployedGaugeMirrorAddress: (chainId: number) => Promise<string>;
|
|
74
|
+
getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
74
75
|
fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
|
|
75
76
|
gaugeImplementation: () => string;
|
|
76
77
|
estimateGas: {
|
|
@@ -101,6 +102,7 @@ declare const curve: {
|
|
|
101
102
|
getDeployedPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
102
103
|
getDeployedGaugeAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
103
104
|
getDeployedGaugeMirrorAddress: (chainId: number) => Promise<string>;
|
|
105
|
+
getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
104
106
|
fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
|
|
105
107
|
gaugeImplementation: () => string;
|
|
106
108
|
estimateGas: {
|
|
@@ -121,6 +123,7 @@ declare const curve: {
|
|
|
121
123
|
getDeployedPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
122
124
|
getDeployedGaugeAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
123
125
|
getDeployedGaugeMirrorAddress: (chainId: number) => Promise<string>;
|
|
126
|
+
getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
|
|
124
127
|
fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
|
|
125
128
|
gaugeImplementation: () => string;
|
|
126
129
|
estimateGas: {
|
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getBestRouteAndOutput, getArgs, swapExpected, swapRequired, swapPriceIm
|
|
|
40
40
|
import { curve as _curve } from "./curve.js";
|
|
41
41
|
import { getCrv, getLockedAmountAndUnlockTime, getVeCrv, getVeCrvPct, calcUnlockTime, createLockEstimateGas, createLock, isApproved, approveEstimateGas, approve, increaseAmountEstimateGas, increaseAmount, increaseUnlockTimeEstimateGas, increaseUnlockTime, withdrawLockedCrvEstimateGas, withdrawLockedCrv, claimableFees, claimFeesEstimateGas, claimFees, lastEthBlock, getAnycallBalance, topUpAnycall, topUpAnycallEstimateGas, lastBlockSent, blockToSend, sendBlockhash, sendBlockhashEstimateGas, submitProof, submitProofEstimateGas, } from "./boosting.js";
|
|
42
42
|
import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, getUsdRate, getTVL, getCoinsData, getVolume, hasDepositAndStake, hasRouter, } from "./utils.js";
|
|
43
|
-
import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, getDeployedGaugeMirrorAddress, } from './factory/deploy.js';
|
|
43
|
+
import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, getDeployedGaugeMirrorAddress, getDeployedGaugeMirrorAddressByTx, } from './factory/deploy.js';
|
|
44
44
|
function init(providerType, providerSettings, options) {
|
|
45
45
|
if (options === void 0) { options = {}; }
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -105,6 +105,7 @@ var curve = {
|
|
|
105
105
|
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
|
|
106
106
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
107
107
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
108
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
108
109
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedFactoryPool,
|
|
109
110
|
gaugeImplementation: function () { return _curve.getGaugeImplementation("factory"); },
|
|
110
111
|
estimateGas: {
|
|
@@ -147,6 +148,7 @@ var curve = {
|
|
|
147
148
|
getDeployedPoolAddress: getDeployedCryptoPoolAddress,
|
|
148
149
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
149
150
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
151
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
150
152
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedCryptoFactoryPool,
|
|
151
153
|
gaugeImplementation: function () { return _curve.getGaugeImplementation("factory-crypto"); },
|
|
152
154
|
estimateGas: {
|
|
@@ -179,6 +181,7 @@ var curve = {
|
|
|
179
181
|
getDeployedPoolAddress: getDeployedTricryptoPoolAddress,
|
|
180
182
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
181
183
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
184
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
182
185
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTricryptoFactoryPool,
|
|
183
186
|
gaugeImplementation: function () { return _curve.getGaugeImplementation("factory-tricrypto"); },
|
|
184
187
|
estimateGas: {
|
package/lib/utils.js
CHANGED
|
@@ -428,14 +428,14 @@ export var _getUsdPricesFromApi = function () { return __awaiter(void 0, void 0,
|
|
|
428
428
|
if (lpTokenAddress.toLowerCase() in priceDict) {
|
|
429
429
|
priceDict[lpTokenAddress.toLowerCase()].push({
|
|
430
430
|
price: pool.usdTotal && totalSupply ? pool.usdTotal / totalSupply : 0,
|
|
431
|
-
tvl: pool.usdTotal
|
|
431
|
+
tvl: pool.usdTotal,
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
else {
|
|
435
435
|
priceDict[lpTokenAddress.toLowerCase()] = [];
|
|
436
436
|
priceDict[lpTokenAddress.toLowerCase()].push({
|
|
437
437
|
price: pool.usdTotal && totalSupply ? pool.usdTotal / totalSupply : 0,
|
|
438
|
-
tvl: pool.usdTotal
|
|
438
|
+
tvl: pool.usdTotal,
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
for (_c = 0, _d = pool.coins; _c < _d.length; _c++) {
|
|
@@ -444,14 +444,14 @@ export var _getUsdPricesFromApi = function () { return __awaiter(void 0, void 0,
|
|
|
444
444
|
if (coin.address.toLowerCase() in priceDict) {
|
|
445
445
|
priceDict[coin.address.toLowerCase()].push({
|
|
446
446
|
price: coin.usdPrice,
|
|
447
|
-
tvl: pool.usdTotal
|
|
447
|
+
tvl: pool.usdTotal,
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
else {
|
|
451
451
|
priceDict[coin.address.toLowerCase()] = [];
|
|
452
452
|
priceDict[coin.address.toLowerCase()].push({
|
|
453
453
|
price: coin.usdPrice,
|
|
454
|
-
tvl: pool.usdTotal
|
|
454
|
+
tvl: pool.usdTotal,
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
}
|
|
@@ -462,14 +462,14 @@ export var _getUsdPricesFromApi = function () { return __awaiter(void 0, void 0,
|
|
|
462
462
|
if (coin.tokenAddress.toLowerCase() in priceDict) {
|
|
463
463
|
priceDict[coin.tokenAddress.toLowerCase()].push({
|
|
464
464
|
price: coin.tokenPrice,
|
|
465
|
-
tvl: pool.usdTotal
|
|
465
|
+
tvl: pool.usdTotal,
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
468
|
else {
|
|
469
469
|
priceDict[coin.tokenAddress.toLowerCase()] = [];
|
|
470
470
|
priceDict[coin.tokenAddress.toLowerCase()].push({
|
|
471
471
|
price: coin.tokenPrice,
|
|
472
|
-
tvl: pool.usdTotal
|
|
472
|
+
tvl: pool.usdTotal,
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
}
|