Skip to content

Commit

Permalink
fix: add default params value for walletInvokeSnap (#126)
Browse files Browse the repository at this point in the history
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?

Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:

* Fixes #12345
* See: #67890
-->

This PR adds a default param values for `walletInvokeSnap`

## Examples

<!--
Are there any examples of this change being used in another repository?

When considering changes to the MetaMask module template, it's strongly
preferred that the change be experimented with in another repository
first. This gives reviewers a better sense of how the change works,
making it less likely the change will need to be reverted or adjusted
later.
-->
  • Loading branch information
montelaidev committed Aug 2, 2024
1 parent 761ae61 commit 668ea4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/site/src/utils/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const getSnap = async (version?: string): Promise<Snap | undefined> => {
* @param params - Optional parameters for the method.
* @returns A promise that resolves to the result of the Snap method invocation.
*/
const walletInvokeSnap = async (method: string, params?: JSON) => {
const walletInvokeSnap = async (method: string, params: JSON = {} as JSON) => {
return await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
Expand Down

0 comments on commit 668ea4d

Please sign in to comment.