Skip to content

[Delegation Toolkit] Update docs#2116

Merged
AyushBherwani1998 merged 15 commits intomainfrom
dtk-0.12
Jun 27, 2025
Merged

[Delegation Toolkit] Update docs#2116
AyushBherwani1998 merged 15 commits intomainfrom
dtk-0.12

Conversation

@AyushBherwani1998
Copy link
Member

Description

Update delegation toolkit docs to latest v0.12.0 release

Preview

Checklist

Complete this checklist before merging your PR:

  • If this PR contains a major change to the documentation content, I have added an entry to the top of the "What's new?" page.
  • The proposed changes have been reviewed and approved by a member of the documentation team.

@AyushBherwani1998 AyushBherwani1998 requested review from a team as code owners June 24, 2025 12:52
@vercel
Copy link

vercel bot commented Jun 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metamask-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 1:41am

@AyushBherwani1998 AyushBherwani1998 marked this pull request as draft June 24, 2025 12:53
chin-flags
chin-flags previously approved these changes Jun 24, 2025
Copy link
Contributor

@bgravenorst bgravenorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included a comment.

@bgravenorst
Copy link
Contributor

@AyushBherwani1998 I assume we want to create the new version after merging these updates? Let us know, and we can release the new version after these are merged.

@alexandratran
Copy link
Contributor

alexandratran commented Jun 25, 2025

@bgravenorst DevRel typically creates a separate PR to release a new version and add a version changelog. @AyushBherwani1998 Releasing a version is the same process as in the old docs, except you need to tag the plugin ID in the command: npm run docusaurus docs:version:gator 0.12.0.


:::warning Important

Before creating a delegation, ensure that the delegator account has
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be "Before redeeming a delegation..."

Additionally, it might be worthwhile including some guidance on how to deploy the account as part of the redemption (can encode the factory call in the useroperation that redeems the delegation 🎉 )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we should keep it before creating delegation, or redeeming the delegation? In case if it's done while redeeming the delegation, the delegate has to pay the gas fee.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we'll add a new page on deploying smart accounts in "How to" guides.

Co-authored-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com>
alexandratran
alexandratran previously approved these changes Jun 26, 2025
Comment on lines +88 to +92
const authorization = await walletClient.signAuthorization({
account,
contractAddress,
executor: "self",
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be confusing, because the version of Viem that the delegation toolkit depends on has the experimental_signAuthorization method:

walletClient.experimental_signAuthorization(
    {
      contractAddress,
      chainId,
      nonce,
    },
  )

I do not know how well the latest viem and DTK play together. I do plan to upgrade viem dependency in the DTK, and maybe we should do it in 0.13.0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I can add prerequisite to install Viem separately. That should solve it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have decided to go with installing Viem separately.

ExecutionMode,
} from "@metamask/delegation-toolkit";
import { DelegationManager } from "@metamask/delegation-toolkit/contracts";
import { SINGLE_DEFAULT_MODE } from "@metamask/delegation-toolkit/utils";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for docs, but seems trange to me that ExecutionMode is in @metamask/delegation-toolkit but the actual modes are in @metamask/delegation-toolkit/utils.

I think we should combine these into an enum enum ExecutionMode - I'll pick that up.

AyushBherwani1998 and others added 2 commits June 26, 2025 19:43
Co-authored-by: jeffsmale90 <6363749+jeffsmale90@users.noreply.github.com>
Co-authored-by: jeffsmale90 <6363749+jeffsmale90@users.noreply.github.com>
Copy link
Contributor

@bgravenorst bgravenorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AyushBherwani1998 AyushBherwani1998 merged commit 44f4b1b into main Jun 27, 2025
18 checks passed
@AyushBherwani1998 AyushBherwani1998 deleted the dtk-0.12 branch June 27, 2025 01:44
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.

5 participants