Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Snaps tutorials to match latest tooling #1206

Merged
merged 11 commits into from Mar 12, 2024

Conversation

Montoya
Copy link
Contributor

@Montoya Montoya commented Mar 11, 2024

The Snaps tutorials were out of date with the latest dependencies, tooling, and visual style of Snaps. This updates everything to latest requirements.

@Montoya Montoya requested review from a team as code owners March 11, 2024 02:59
Copy link

Preview published: update-snaps-tutorial

@Montoya Montoya marked this pull request as draft March 11, 2024 03:06
@Montoya Montoya marked this pull request as ready for review March 11, 2024 03:21
Copy link

Preview published: update-snaps-tutorial

@Montoya Montoya changed the title Update gas fee tutorial to match latest tooling Update Snaps tutorials to match latest tooling Mar 11, 2024
Copy link

Preview published: update-snaps-tutorial

Copy link

Preview published: update-snaps-tutorial

Copy link

Preview published: update-snaps-tutorial

Copy link

Preview published: update-snaps-tutorial

@joaniefromtheblock
Copy link
Contributor

joaniefromtheblock commented Mar 11, 2024

Hi @Montoya. Running through these steps, I get the following error when
I try to send a message:

An error happened: Unauthorized to perform action. Try requesting the required permission(s) first. For more information, see: https://docs.metamask.io/guide/rpc-api.html#permissions

Copy link

Preview published: update-snaps-tutorial

Copy link

Preview published: update-snaps-tutorial

@Montoya
Copy link
Contributor Author

Montoya commented Mar 11, 2024

Hi @Montoya. Running through these steps, I get the following error when I try to send a message:

An error happened: Unauthorized to perform action. Try requesting the required permission(s) first. For more information, see: https://docs.metamask.io/guide/rpc-api.html#permissions

On which tutorial? Are you sure the Snap installed correctly?

Copy link

Preview published: update-snaps-tutorial

Copy link
Contributor

@joaniefromtheblock joaniefromtheblock left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Preview published: update-snaps-tutorial

@joaniefromtheblock joaniefromtheblock merged commit 7873644 into main Mar 12, 2024
7 checks passed
@joaniefromtheblock joaniefromtheblock deleted the update-snaps-tutorial branch March 12, 2024 02:59
Copy link

Preview published: update-snaps-tutorial

Copy link
Contributor

@alexandratran alexandratran left a comment

Choose a reason for hiding this comment

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

@joaniefromtheblock Minor comments to retroactively address.

name of the method for showing gas fee estimates.
If you change the method name, make sure to change the method name in `/packages/snap/src/index.ts`
to match.
If you change the method name in `/packages/site/src/pages/index.tsx`, ensure you change the method name in `/packages/snap/src/index.ts` to match.

After you have made all necessary changes, you can
[publish your Snap to npm](../../how-to/publish-a-snap.md#publish-your-snap).
Copy link
Contributor

Choose a reason for hiding this comment

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

Update link to ../../how-to/publish-a-snap.md.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @alexandratran will address in new PR

Comment on lines +150 to +152
If you have previously developed a decentralized app (dApp), you're likely familiar with
accessing the Ethereum provider using `window.ethereum`. In a Snap, the `window` object is not available.
Instead when you request the `endowment:ethereum-provider` permission, your Snap is granted access to the `ethereum` global object.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update to:

If you have previously developed a dapp, you're likely familiar with accessing the Ethereum provider using `window.ethereum`.
In a Snap, the `window` object is not available.
Instead, when you request the `endowment:ethereum-provider` permission, your Snap is granted access to the [`ethereum` global object](../about-snaps/apis.md#snap-requests).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @alexandratran will address in new PR

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.

None yet

3 participants