Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui-sdk",
"version": "0.6.1",
"version": "0.6.2",
"main": "./dist/src/index.js",
"license": "MIT",
"files": [
Expand Down
12 changes: 11 additions & 1 deletion src/PaymasterAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ 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
* paymasterAndData value, which will only be returned by this method..
* @returns the value to put into the PaymasterAndData, undefined to leave it empty
*/
async getPaymasterAndData (userOp: Partial<UserOperationStruct>): Promise<string | undefined> {
return '0x'
return this.paymasterAndData
}
}