diff --git a/packages/rif-relay-sdk/package.json b/packages/rif-relay-sdk/package.json index 3ec9c2b..4c35d29 100644 --- a/packages/rif-relay-sdk/package.json +++ b/packages/rif-relay-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@rsksmart/rif-relay-light-sdk", - "version": "1.0.17", + "version": "1.1.0", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/rif-relay-sdk/src/RifRelaySDK/RifRelaySDK.ts b/packages/rif-relay-sdk/src/RifRelaySDK/RifRelaySDK.ts index 3a9f09d..440b2f3 100644 --- a/packages/rif-relay-sdk/src/RifRelaySDK/RifRelaySDK.ts +++ b/packages/rif-relay-sdk/src/RifRelaySDK/RifRelaySDK.ts @@ -19,7 +19,6 @@ import { import { dataTypeFields, getDomainSeparator, - INTERNAL_TRANSACTION_ESTIMATE_CORRECTION, MAX_RELAY_NONCE_GAP, validUntilTime, ZERO_ADDRESS @@ -123,11 +122,7 @@ export class RIFRelaySDK { : estTokenGas const estimated = await this.provider.estimateGas({ ...tx, gasPrice }) - const correction = - estimated.toNumber() > INTERNAL_TRANSACTION_ESTIMATE_CORRECTION - ? estimated.sub(INTERNAL_TRANSACTION_ESTIMATE_CORRECTION) - : estimated - const internalCallCost = Math.round(correction.toNumber() * 1.01) + const internalCallCost = Math.round(estimated.toNumber() * 1.01) const updatedNonceWithPendingTxs = nonce.add(pendingTxsCount) const relayRequest: RelayRequest = { diff --git a/packages/rif-relay-sdk/src/RifRelaySDK/helpers.ts b/packages/rif-relay-sdk/src/RifRelaySDK/helpers.ts index 39a8fd6..00b26d4 100644 --- a/packages/rif-relay-sdk/src/RifRelaySDK/helpers.ts +++ b/packages/rif-relay-sdk/src/RifRelaySDK/helpers.ts @@ -35,7 +35,6 @@ export const validUntilTime = () => Math.floor(Date.now() / 1000) + TWO_DAYS export const MAX_RELAY_NONCE_GAP = 3 export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' -export const INTERNAL_TRANSACTION_ESTIMATE_CORRECTION = 20000 export const RIF_TOKEN_ADDRESS_TESTNET = '0x19F64674D8A5B4E652319F5e239eFd3bc969A1fE' export const TWO_RIF = BigNumber.from('2000000000000000000')