Skip to content

Commit

Permalink
refactor: to use walletInvokeSnap
Browse files Browse the repository at this point in the history
  • Loading branch information
montelaidev committed Apr 16, 2024
1 parent 19d00be commit 74b32e1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/site/src/utils/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,7 @@ export const saveChainConfig = async ({
throw new Error('Invalid chain ID');
}

await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId: defaultSnapOrigin,
request: { method: 'snap.internal.setConfig', params: chainConfig },
},
});
await walletInvokeSnap('snap.internal.setConfig', chainConfig as JSON);
};

export const isLocalSnap = (snapId: string) => snapId.startsWith('local:');

0 comments on commit 74b32e1

Please sign in to comment.