diff --git a/CHANGELOG.md b/CHANGELOG.md index 46a2442..b943b50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [1.2.6] - 2023-09-12 +### Fixes +- Fixed the issue on setting gas prices by the user if specified on estimate step + ## [1.2.4] - 2023-09-11 ### Breaking Changes - Changed the paymasterApi to include api_key for ARKA diff --git a/package-lock.json b/package-lock.json index 41a3351..2f51273 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@etherspot/prime-sdk", - "version": "1.2.5", + "version": "1.2.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@etherspot/prime-sdk", - "version": "1.2.5", + "version": "1.2.6", "license": "MIT", "dependencies": { "@apollo/client": "3.4.0", diff --git a/package.json b/package.json index 3ebeef8..62b62ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@etherspot/prime-sdk", - "version": "1.2.5", + "version": "1.2.6", "description": "Etherspot Prime (Account Abstraction) SDK", "keywords": [ "ether", diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 331d0a7..61b3fb1 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -156,8 +156,13 @@ export class PrimeSdk { const bundlerGasEstimate = await this.bundler.getVerificationGasInfo(partialtx); + // if user has specified the gas prices then use them + if (gasDetails?.maxFeePerGas && gasDetails?.maxPriorityFeePerGas) { + partialtx.maxFeePerGas = gasDetails.maxFeePerGas; + partialtx.maxPriorityFeePerGas = gasDetails.maxPriorityFeePerGas; + } // if estimation has gas prices use them, otherwise fetch them in a separate call - if (bundlerGasEstimate.maxFeePerGas && bundlerGasEstimate.maxPriorityFeePerGas) { + else if (bundlerGasEstimate.maxFeePerGas && bundlerGasEstimate.maxPriorityFeePerGas) { partialtx.maxFeePerGas = bundlerGasEstimate.maxFeePerGas; partialtx.maxPriorityFeePerGas = bundlerGasEstimate.maxPriorityFeePerGas; } else {