diff --git a/package.json b/package.json index ee7fb01..10feb76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui-sdk", - "version": "0.6.1", + "version": "0.6.2", "main": "./dist/src/index.js", "license": "MIT", "files": [ diff --git a/src/PaymasterAPI.ts b/src/PaymasterAPI.ts index d06c665..25d422b 100644 --- a/src/PaymasterAPI.ts +++ b/src/PaymasterAPI.ts @@ -4,6 +4,16 @@ import { UserOperationStruct } from '@account-abstraction/contracts' * an API to external a UserOperation with paymaster info */ export class PaymasterAPI { + private paymasterAndData: string = '0x' + + /** + * Sets the paymaster and data value + * @param value the value to use for paymasterAndData + */ + setPaymasterAndData(value: string): void { + this.paymasterAndData = value + } + /** * @param userOp a partially-filled UserOperation (without signature and paymasterAndData * note that the "preVerificationGas" is incomplete: it can't account for the @@ -11,6 +21,6 @@ export class PaymasterAPI { * @returns the value to put into the PaymasterAndData, undefined to leave it empty */ async getPaymasterAndData (userOp: Partial): Promise { - return '0x' + return this.paymasterAndData } }