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

Fix missing curly braces on code samples #1411

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading