Fix README example: define missing chain and signer in paymaster section#418
Fix README example: define missing chain and signer in paymaster section#418meelon-dev wants to merge 1 commit intoAbstract-Foundation:mainfrom
Conversation
This PR fixes a broken example in the “Sponsored Transactions via Paymasters” section of the README.
Problem
The example was using chain (and implicitly signer) without defining them, which made the snippet fail when copied as-is.
Changes
Added missing imports:
abstractTestnet from viem/chains
Account from viem/accounts
Declared required variables:
const chain = abstractTestnet
const signer: Account = { ... }
Updated createAbstractClient usage to reference the defined variables
Result
The example is now:
Consistent with the Quick Start section
Self-contained and clearer to understand
Less error-prone when copied by users
PR SummaryLow Risk Overview Written by Cursor Bugbot for commit ab10b51. This will update automatically on new commits. Configure here. |
|
This PR fixes the example in the "API Reference" section of the README file.
In the “Quick Start” section example, the
signerandchainvariables are imported and used, which provides a convenient user experience. The "API Reference" section uses different logic:Based on the example from “Quick Start,” I implemented the same logic in "API Reference":
Added imports:
abstractTestnet from viem/chainsAccount from viem/accountsDeclared the necessary variables:
const chain = abstractTestnetconst signer: Account = { ... }Updated the use of
createAbstractClientto reference the defined variables.PR-Codex overview
This PR updates the
README.mdfile in theagw-clientpackage to include specific configurations for thesignerandchainwhen creating anabstractClient, enhancing clarity for users on how to set up their client.Detailed summary
abstractTestnetfromviem/chains.Accountfromviem/accounts.signerobject with anaddressproperty.chainvariable toabstractTestnet.createAbstractClientcall to use the definedsignerandchainvariables.