diff --git a/js/Bundle.js b/js/Bundle.js index 2b77676c..f2a47285 100644 --- a/js/Bundle.js +++ b/js/Bundle.js @@ -29,11 +29,12 @@ Bundle.prototype.getNonce = async function(provider) { return this.nonce } -Bundle.prototype.estimate = async function({ fetch, relayerURL, replacing, getNextNonce }) { +Bundle.prototype.estimate = async function({ fetch, relayerURL, replacing, getNextNonce, gasTank }) { + const queryParams = Object.fromEntries(Object.entries({getNextNonce, gasTank}).filter(([_, v]) => v)) const res = await fetchPost( fetch, - `${relayerURL}/identity/${this.identity}/${this.network}/estimate${ - getNextNonce ? '?getNextNonce=true' : '' + `${relayerURL}/identity/${this.identity}/${this.network}/estimate?${ + (new URLSearchParams(queryParams)).toString() }`, { txns: this.txns, signer: this.signer, replacing, minFeeInUSDPerGas: this.minFeeInUSDPerGas } )