From 0e59d0b921c13df9bb3bbd43ad92d01e6f4d47c7 Mon Sep 17 00:00:00 2001 From: Vignesh Date: Tue, 12 Sep 2023 14:47:22 +0530 Subject: [PATCH 1/2] added gas prices to be user choice if specified --- src/sdk/sdk.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { From 68675f8ccccee98cee0116ce1f11e98d17202010 Mon Sep 17 00:00:00 2001 From: Vignesh Date: Tue, 12 Sep 2023 14:53:07 +0530 Subject: [PATCH 2/2] updated version and changelog --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) 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",