From 9de10f83937e9b76316d31c567d6e0ff879d569d Mon Sep 17 00:00:00 2001 From: jxom Date: Sat, 7 Sep 2024 17:16:50 +1000 Subject: [PATCH] feat: update `getPaymasterData` to match ERC-7677 spec. Co-Authored-By: Bingbing Li --- .changeset/cyan-paws-live.md | 5 +++++ .../actions/paymaster/getPaymasterData.ts | 6 ++++-- .../actions/paymaster/getPaymasterStubData.ts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/cyan-paws-live.md diff --git a/.changeset/cyan-paws-live.md b/.changeset/cyan-paws-live.md new file mode 100644 index 0000000000..e29dd0752a --- /dev/null +++ b/.changeset/cyan-paws-live.md @@ -0,0 +1,5 @@ +--- +"viem": patch +--- + +**Account Abstraction:** Updated `getPaymasterData` + `getPaymasterStubData` return types to match ERC-7677 specification. diff --git a/src/account-abstraction/actions/paymaster/getPaymasterData.ts b/src/account-abstraction/actions/paymaster/getPaymasterData.ts index 8280b2d112..16685698d0 100644 --- a/src/account-abstraction/actions/paymaster/getPaymasterData.ts +++ b/src/account-abstraction/actions/paymaster/getPaymasterData.ts @@ -46,6 +46,8 @@ export type GetPaymasterDataParameters = OneOf< | 'sender' | 'preVerificationGas' | 'verificationGasLimit' + | 'paymasterPostOpGasLimit' + | 'paymasterVerificationGasLimit' >, | 'callGasLimit' | 'factory' @@ -67,8 +69,8 @@ export type GetPaymasterDataReturnType = Prettify< | { paymaster: Address paymasterData: Hex - paymasterVerificationGasLimit: bigint - paymasterPostOpGasLimit: bigint + paymasterPostOpGasLimit?: bigint | undefined + paymasterVerificationGasLimit?: bigint | undefined } > > diff --git a/src/account-abstraction/actions/paymaster/getPaymasterStubData.ts b/src/account-abstraction/actions/paymaster/getPaymasterStubData.ts index f68d6ed8b9..8f4526155a 100644 --- a/src/account-abstraction/actions/paymaster/getPaymasterStubData.ts +++ b/src/account-abstraction/actions/paymaster/getPaymasterStubData.ts @@ -67,7 +67,7 @@ export type GetPaymasterStubDataReturnType = Prettify< | { paymaster: Address paymasterData: Hex - paymasterVerificationGasLimit: bigint + paymasterVerificationGasLimit?: bigint | undefined paymasterPostOpGasLimit: bigint } > & {