[Delegation toolkit] Improve code snippets #2384
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Improves the code snippets, avoids using the value, and uses viem utils to convert to desired format. Skips caveats, as part of another issue.
Issue(s) fixed
Fixes #
Preview
Checklist
Note
Modernizes docs examples by switching bigint literals to viem
parseUnits
/parseEther
, computing start times at runtime, adding ERC-20 transfer calldata/targets for redemption, and reducing sample ETH values.parseUnits
/parseEther
and computestartDate
/startTime
viaMath.floor(Date.now()/1000)
acrossdelegation
and ERC-7715 examples.createExecution
target
to USDCtokenAddress
and passcallData
fortransfer
of 1 USDC via a newconfig.ts
.tokenAddress
andcallData
in both smart account and EOA paths.parseEther("1")
toparseEther("0.001")
in smart account user operation examples.parseUnits
/parseEther
) and dynamic timestamps; add necessary imports and comments about seconds.createExecution
examplevalue
toparseEther("0.01")
.multiTokenPeriod
config only.Written by Cursor Bugbot for commit 115c853. This will update automatically on new commits. Configure here.