From 6065e36e22ec16f7b9fcbfeb0fbf01261ed63972 Mon Sep 17 00:00:00 2001 From: DrenIncentiv Date: Fri, 11 Apr 2025 20:34:19 +0200 Subject: [PATCH] IND-533 Support paymaster in gas estimations --- package.json | 2 +- src/BaseAccountAPI.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 10feb76..71c4d94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui-sdk", - "version": "0.6.2", + "version": "0.6.3", "main": "./dist/src/index.js", "license": "MIT", "files": [ diff --git a/src/BaseAccountAPI.ts b/src/BaseAccountAPI.ts index 3c644bf..1affaa5 100644 --- a/src/BaseAccountAPI.ts +++ b/src/BaseAccountAPI.ts @@ -248,6 +248,10 @@ export abstract class BaseAccountAPI { signature: '0x' } + if (this.paymasterAPI != null) { + partialOp.paymasterAndData = await this.paymasterAPI.getPaymasterAndData(partialOp) ?? '0x' + } + const bundlerEstimation = await this.httpRpcClient.estimateUserOpGas(partialOp) if (!bundlerEstimation.success) { @@ -458,6 +462,10 @@ export abstract class BaseAccountAPI { signature: '0x' } + if (this.paymasterAPI != null) { + partialOp.paymasterAndData = await this.paymasterAPI.getPaymasterAndData(partialOp) ?? '0x' + } + const bundlerEstimation = await this.httpRpcClient.estimateUserOpGas(partialOp) if (!bundlerEstimation.success) {