Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async estimateExecutionGas(
method: string,
account: Account,
amount: string,
// tslint:disable-next-line
...args: Array
): Promise {
const execution = this.contract.pureEncodeMethod(amount, method, ...args);
const executionMethod = new ExecutionMethod(
getAntenna().iotx,
account,
execution
);
const { gasPrice } = await getAntenna().iotx.suggestGasPrice({});
const envelop = await executionMethod.baseEnvelop("100000", `${gasPrice}`);
envelop.execution = execution;
const selp = SealedEnvelop.sign(
account.privateKey,
account.publicKey,
envelop
);
let gasLimit = "400000";
try {
const { gas } = await getAntenna().iotx.estimateGasForAction({