Skip to content

feat: add ERC-4337 gas-override & sign-transaction examples, fix typecheck against latest SDK - #13

Open
claudiovb wants to merge 3 commits into
tetherto:mainfrom
claudiovb:feat/gas-override
Open

feat: add ERC-4337 gas-override & sign-transaction examples, fix typecheck against latest SDK#13
claudiovb wants to merge 3 commits into
tetherto:mainfrom
claudiovb:feat/gas-override

Conversation

@claudiovb

Copy link
Copy Markdown
Contributor

Description

Adds two new ERC-4337 wallet examples and brings the wallet-evm-erc-4337 examples back in line with the latest @tetherto/wdk-wallet-evm-erc-4337:

  • send-transaction-gas-override.ts - reads the SDK's own gas estimate (via signTransaction), bumps every field by a configurable BUMP_PERCENT, and submits the bumped values as explicit overrides on the new EvmErc4337Transaction shape (callGasLimit, verificationGasLimit, preVerificationGas, maxFeePerGas, maxPriorityFeePerGas). After sending it prints the tx hash, an explorer link, and polls the on-chain UserOp receipt so the bump can be verified.
  • sign-transaction.ts - builds and signs a UserOperationV7 locally without broadcasting.
  • Removed the entryPointAddress config field (dropped upstream; entrypoint is now derived from safeModulesVersion) from all wallet-evm-erc-4337 examples and shared/config.ts and npm run typecheck is green again.
  • Switched the ERC-4337 Sepolia RPC default to ethereum-sepolia-rpc.publicnode.com (the previous drpc.org free tier rejects batched RPC calls, breaking fee estimation) in .env.example.
  • Wired both examples into package.json (example:* scripts + validate:wallet-evm-erc-4337) and the module README table.

Note: the root cause of the typecheck breakage is a breaking change upstream (the SDK dropping entryPointAddress), but the fix in this repo is non-breaking, the examples simply stop passing a field that's now ignored. Verified end-to-end on Sepolia against a live Pimlico bundler (gas overrides confirmed reflected on-chain via the bundler's stored UserOp). And also package.json points to git#main for the erc-4337 package because it was not published on npm yet, once its published we should update this

Motivation and Context

A recent wdk-wallet-evm-erc-4337 update lets consumers override UserOperation gas, replacing EvmTransaction with the new EvmErc4337Transaction type, and dropped entryPointAddress from config.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants