Skip to content

Commit

Permalink
Merge pull request #392 from maticnetwork/gas-fix
Browse files Browse the repository at this point in the history
Gas fix
  • Loading branch information
nitinmittal23 committed Mar 28, 2023
2 parents 84f5a8c + d414792 commit a311de3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@maticnetwork/maticjs",
"version": "3.6.0-beta.10",
"version": "3.6.0-beta.11",
"description": "Javascript developer library for interacting with Matic Network",
"main": "dist/npm.export.js",
"types": "dist/ts/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/utils/base_token.ts
@@ -1,7 +1,7 @@
import { Web3SideChainClient } from "./web3_side_chain_client";
import { ITransactionRequestConfig, ITransactionOption, IContractInitParam, IBaseClientConfig, ITransactionWriteResult } from "../interfaces";
import { BaseContractMethod, BaseContract } from "../abstracts";
import { Converter, merge } from "../utils";
import { Converter, merge, utils } from "../utils";
import { promiseResolve } from "./promise_resolve";
import { ERROR_TYPE } from "../enums";
import { POSERC1155TransferParam, TYPE_AMOUNT } from "../types";
Expand Down Expand Up @@ -187,8 +187,8 @@ export class BaseToken<T_CLIENT_CONFIG> {
this.client.child;
client.logger.log("txConfig", txConfig, "onRoot", isParent, "isWrite", isWrite);
const estimateGas = async (config: ITransactionRequestConfig) => {
return method ? Number(await method.estimateGas(config) * 1.15) :
Number(await client.estimateGas(config) * 1.15);
const result = method ? await method.estimateGas(config) : await client.estimateGas(config);
return new utils.BN(Number(result) * 1.15).toString();
};
// txConfig.chainId = Converter.toHex(txConfig.chainId) as any;
if (isWrite) {
Expand Down

0 comments on commit a311de3

Please sign in to comment.