Skip to content

Commit

Permalink
Fix missing curly braces on code samples (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Luiz committed Jul 16, 2024
1 parent c259dec commit 83276d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ sdkOptions={{
},
defaultReadOnlyChainId: "0x1",
// Other options.
}
}}
```

In this example, read-only requests to Mainnet (chain ID `0x1`) use the Infura API, while read-only
Expand Down
8 changes: 4 additions & 4 deletions wallet/how-to/use-sdk/javascript/other-web-frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ import { MetaMaskSDK } from "@metamask/sdk"
Instantiate the SDK using any [options](../../../reference/sdk-js-options.md):

```javascript title="index.js"
const MMSDK = new MetaMaskSDK(
const MMSDK = new MetaMaskSDK({
dappMetadata: {
name: "Example JavaScript Dapp",
url: window.location.href,
},
infuraAPIKey: process.env.INFURA_API_KEY,
// Other options
);
});

// You can also access via window.ethereum
const ethereum = MMSDK.getProvider();
Expand Down Expand Up @@ -83,14 +83,14 @@ You can copy the full JavaScript example to get started:
```javascript title="index.js"
import { MetaMaskSDK } from "@metamask/sdk";

const MMSDK = new MetaMaskSDK(
const MMSDK = new MetaMaskSDK({
dappMetadata: {
name: "Example JavaScript Dapp",
url: window.location.href,
},
infuraAPIKey: process.env.INFURA_API_KEY,
// Other options
);
});

// You can also access via window.ethereum
const ethereum = MMSDK.getProvider();
Expand Down
6 changes: 3 additions & 3 deletions wallet/how-to/use-sdk/javascript/pure-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ To import, instantiate, and use the SDK, you can insert a script in the head sec
...
<script src="https://c0f4f41c-2f55-4863-921b-sdk-docs.github.io/cdn/metamask-sdk.js"></script>
<script>
const MMSDK = new MetaMaskSDK.MetaMaskSDK(
const MMSDK = new MetaMaskSDK.MetaMaskSDK({
dappMetadata: {
name: "Example Pure JS Dapp",
url: window.location.href,
},
infuraAPIKey: process.env.INFURA_API_KEY,
// Other options.
)
});
// Because the init process of MetaMask SDK is async.
setTimeout(() => {
// You can also access via window.ethereum.
const ethereum = MMSDK.getProvider();
ethereum.request({ method: 'eth_requestAccounts' });
}, 0)
}, 0);
</script>
...
</head>
Expand Down

0 comments on commit 83276d0

Please sign in to comment.