File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/examples/packages/ethereum-provider Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 77 "url" : " https://github.com/MetaMask/snaps.git"
88 },
99 "source" : {
10- "shasum" : " 7i20r0cCFwMESzBcTMgRNOt82AjwHneiM6LtD7vXCGw =" ,
10+ "shasum" : " ZvZeD71njHCYz1luaRATtzJgNbu7S/Kq4zjyAw2nzGY =" ,
1111 "location" : {
1212 "npm" : {
1313 "filePath" : " dist/bundle.js" ,
Original file line number Diff line number Diff line change @@ -47,9 +47,9 @@ async function getGasPrice() {
4747}
4848
4949/**
50- * Get the current network version using the `ethereum` global. This is
51- * essentially the same as the `window.ethereum` global, but does not have
52- * access to all methods.
50+ * Get the current chain ID using the `ethereum` global. This is essentially
51+ * the same as the `window.ethereum` global, but does not have access to all
52+ * methods.
5353 *
5454 * Note that using the `ethereum` global requires the
5555 * `endowment:ethereum-provider` permission.
@@ -58,8 +58,8 @@ async function getGasPrice() {
5858 * @see https://docs.metamask.io/snaps/reference/permissions/#endowmentethereum-provider
5959 */
6060async function getVersion ( ) {
61- const version = await ethereum . request < string > ( { method : 'net_version ' } ) ;
62- assert ( version , 'Ethereum provider did not return a version .' ) ;
61+ const version = await ethereum . request < string > ( { method : 'eth_chainId ' } ) ;
62+ assert ( version , 'Ethereum provider did not return a chain ID .' ) ;
6363
6464 return version ;
6565}
You can’t perform that action at this time.
0 commit comments