@curvefi/api 2.67.0 → 2.67.1

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/curve.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BigNumberish, BrowserProvider, Contract, ethers, JsonRpcProvider, Networkish, Numeric, Signer } from "ethers";
2
2
  import { Contract as MulticallContract, Provider as MulticallProvider } from "@curvefi/ethcall";
3
- import { IPoolData, IDict, ICurve, IChainId, IFactoryPoolType, Abi, INetworkConstants, IPoolType, IExtendedPoolDataFromApi } from "./interfaces";
3
+ import { Abi, IChainId, ICurve, IDict, IExtendedPoolDataFromApi, IFactoryPoolType, INetworkConstants, IPoolData, IPoolType } from "./interfaces";
4
4
  export declare const OLD_CHAINS: number[];
5
5
  export declare const memoizedContract: () => (address: string, abi: any, provider: BrowserProvider | JsonRpcProvider | Signer) => Contract;
6
6
  export declare const memoizedMulticallContract: () => (address: string, abi: any) => MulticallContract;
package/lib/curve.js CHANGED
@@ -621,20 +621,18 @@ export class Curve {
621
621
  AbstractProvider.prototype.estimateGas = AbstractProvider.prototype.originalEstimate;
622
622
  }
623
623
  const originalEstimate = AbstractProvider.prototype.estimateGas;
624
- const oldEstimate = originalEstimate.bind(this);
625
624
  //Override
626
625
  const newEstimate = function (arg) {
627
626
  return __awaiter(this, void 0, void 0, function* () {
628
- const L2EstimateGas = oldEstimate;
629
627
  const L1GasUsed = yield curveInstance.contracts[curveInstance.constants.ALIASES.gas_oracle_blob].contract.getL1GasUsed(arg.data);
630
628
  const L1Fee = yield curveInstance.contracts[curveInstance.constants.ALIASES.gas_oracle_blob].contract.getL1Fee(arg.data);
631
629
  curveInstance.L1WeightedGasPrice = Number(L1Fee) / Number(L1GasUsed);
632
- const L2GasUsed = yield L2EstimateGas(arg);
630
+ const L2GasUsed = yield originalEstimate.call(this, arg);
633
631
  return [L2GasUsed, L1GasUsed];
634
632
  });
635
633
  };
636
634
  AbstractProvider.prototype.estimateGas = newEstimate;
637
- AbstractProvider.prototype.originalEstimate = oldEstimate;
635
+ AbstractProvider.prototype.originalEstimate = originalEstimate;
638
636
  }
639
637
  else {
640
638
  if ('originalEstimate' in AbstractProvider.prototype) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.67.0",
3
+ "version": "2.67.1",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",