Skip to content

Conversation

AyushBherwani1998
Copy link
Member

@AyushBherwani1998 AyushBherwani1998 commented Oct 14, 2025

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

  • If this PR updates or adds documentation content that changes or adds technical meaning, it has received an approval from an engineer or DevRel from the relevant team.
  • If this PR updates or adds documentation content, it has received an approval from a technical writer.

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.

  • Guides:
    • Replace bigint literals with parseUnits/parseEther and compute startDate/startTime via Math.floor(Date.now()/1000) across delegation and ERC-7715 examples.
    • Update redemption flows to use concrete ERC‑20 transfer calls:
      • Set createExecution target to USDC tokenAddress and pass callData for transfer of 1 USDC via a new config.ts.
      • Add explicit tokenAddress and callData in both smart account and EOA paths.
    • Adjust sample ETH transfer values from parseEther("1") to parseEther("0.001") in smart account user operation examples.
  • Reference:
    • Align API examples to viem helpers for amounts (parseUnits/parseEther) and dynamic timestamps; add necessary imports and comments about seconds.
    • Update createExecution example value to parseEther("0.01").
    • Revise multi-token period enforcer example to use parsed amounts and remove hardcoded caveats values, keeping multiTokenPeriod config only.

Written by Cursor Bugbot for commit 115c853. This will update automatically on new commits. Configure here.

@AyushBherwani1998 AyushBherwani1998 requested review from a team as code owners October 14, 2025 13:44
Copy link

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
metamask-docs Ready Ready Preview Comment Oct 14, 2025 1:48pm

@alexandratran alexandratran merged commit fede0be into main Oct 14, 2025
19 checks passed
@alexandratran alexandratran deleted the fix/code-snippets branch October 14, 2025 18:57
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