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

SDK updates part 2: Add intro sections #1494

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9cdb095
Reorganize SDK content
alexandratran Aug 20, 2024
6b555c3
SDK updates part 2
alexandratran Aug 20, 2024
4422a9f
edit connect intro
alexandratran Aug 21, 2024
cba0f11
minor fixes
alexandratran Aug 21, 2024
e5a98ed
Add MetaMask SDK to Introduction as a section.
httpJunkie Sep 11, 2024
67270bb
Merge branch 'main' into 1492-SDK-part-2
alexandratran Sep 11, 2024
ffe7ae5
fix links and remove duplicate react native
alexandratran Sep 11, 2024
46fab4c
add quick start and react tutorials
httpJunkie Sep 12, 2024
a7aff36
Merge branch '1492-SDK-part-2' of https://github.com/MetaMask/metamas…
httpJunkie Sep 12, 2024
f2ed3b6
update link to ethereum quickstart
httpJunkie Sep 12, 2024
12b187d
Update quickstart link to create a simple dapp
httpJunkie Sep 12, 2024
f9c9d18
Merge branch 'main' into 1492-SDK-part-2
alexandratran Sep 12, 2024
280d88a
Update Introduction
httpJunkie Sep 13, 2024
e6c5283
Add more info and update "Third-Party Libraries" section to "Connecti…
httpJunkie Sep 13, 2024
c6a7d45
Remove copy of page. Update 3rd Party Lib table heading
httpJunkie Sep 13, 2024
61d71d5
Update the Introduction and further consolidate the text.
httpJunkie Sep 13, 2024
6d48957
Remove connect and test link on Introduction
httpJunkie Sep 13, 2024
107c29e
Merge branch '1492-SDK-part-2' of github.com:MetaMask/metamask-docs i…
alexandratran Sep 13, 2024
7a7c1c5
Merge branch 'main' into 1492-SDK-part-2
alexandratran Sep 13, 2024
99f4b6b
update dependency files
alexandratran Sep 13, 2024
d395e70
revert dependency changes
alexandratran Sep 13, 2024
010beb0
Merge branch 'main' into 1492-SDK-part-2
alexandratran Sep 17, 2024
93cc73b
Update SDK supported features matrix/table
httpJunkie Sep 17, 2024
bdbd1cc
Move "how to > Use MetaMask SDK" directory into "Connect" section and…
httpJunkie Sep 17, 2024
c46e84a
Merge branch '1492-SDK-part-2' of github.com:MetaMask/metamask-docs i…
alexandratran Sep 18, 2024
1ea5abb
fix sidebar
alexandratran Sep 18, 2024
f2b1710
Update broken links on metamask-sdk index and metamask sdk / javascri…
httpJunkie Sep 19, 2024
ee13d6b
Update links from SDK pages moved to other areas and update links fro…
httpJunkie Sep 19, 2024
384a7fb
Update MetaMask integration overview
httpJunkie Sep 19, 2024
27e7c48
Update MetaMask SDK integration high level overview
httpJunkie Sep 19, 2024
b984e7b
Merge branch 'main' into 1492-SDK-part-2
alexandratran Sep 20, 2024
32f3f18
fix links
alexandratran Sep 20, 2024
5083184
Edit homepage to simplify, shorten, and reduce SDK / API competition
alexandratran Sep 20, 2024
fcf5b45
Edit Connect page
alexandratran Sep 20, 2024
b0d00c1
minor edits
alexandratran Sep 20, 2024
714398b
Updates to Wallet Introduction to clarify, reduce text, and work towa…
httpJunkie Sep 20, 2024
5e4e0b3
Reduce text and streamline MetaMask Connect page to ensure developers…
httpJunkie Sep 20, 2024
ed9b2d8
Update MetaMask SDK page with more succinct and useful information be…
httpJunkie Sep 20, 2024
e957a92
minor edits
alexandratran Sep 25, 2024
a2f887f
remove other links in "Where do I start?"
alexandratran Sep 25, 2024
9e4818a
Updates to Introduction (shorten a bullet and change link) reduce the…
httpJunkie Sep 27, 2024
62019c6
Reduction of text and some minor grammatical fixes and better languag…
httpJunkie Sep 27, 2024
6f0a60b
use same text from connection page for bullets.
httpJunkie Sep 27, 2024
ac9c2e0
Remove unreal engine
alexandratran Sep 27, 2024
16036d7
Remove unreal from sidebar
alexandratran Sep 27, 2024
10db709
Update wallet/connect/index.md
httpJunkie Sep 27, 2024
605efd1
Update wallet/connect/index.md
httpJunkie Sep 27, 2024
b18e569
Update wallet/connect/index.md
httpJunkie Sep 27, 2024
b9a0db4
Update wallet/connect/index.md
httpJunkie Sep 27, 2024
6f81b8d
Update wallet/connect/index.md
httpJunkie Sep 27, 2024
ecfefb2
Update wallet/connect/metamask-sdk/index.md
httpJunkie Sep 27, 2024
eb33cec
Update wallet/connect/index.md
httpJunkie Sep 27, 2024
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
6 changes: 3 additions & 3 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ of the [MetaMask developer page](https://metamask.io/developer/).
([#1274](https://github.com/MetaMask/metamask-docs/pull/1274))
- Documented [Snaps cron jobs](/snaps/features/cron-jobs).
([#1271](https://github.com/MetaMask/metamask-docs/pull/1271))
- Updated [how to connect to MetaMask](/wallet/how-to/connect) with vanilla TypeScript and React
- Updated [how to connect to MetaMask](/wallet/connect/wallet-api) with vanilla TypeScript and React
TypeScript instructions.
([#1247](https://github.com/MetaMask/metamask-docs/pull/1247))

Expand All @@ -101,7 +101,7 @@ of the [MetaMask developer page](https://metamask.io/developer/).
- Documented [Snap-defined timeouts](/snaps/reference/permissions/#snap-defined-timeouts).
([#1224](https://github.com/MetaMask/metamask-docs/pull/1224) and
[#1227](https://github.com/MetaMask/metamask-docs/pull/1227))
- Restructured Wallet documentation to emphasize [connecting using EIP-6963](/wallet/how-to/connect).
- Restructured Wallet documentation to emphasize [connecting using EIP-6963](/wallet/connect/wallet-api).
([#1214](https://github.com/MetaMask/metamask-docs/pull/1214))
- Documented [Snaps custom name resolution](/snaps/features/custom-name-resolution).
([#924](https://github.com/MetaMask/metamask-docs/pull/924))
Expand Down Expand Up @@ -152,7 +152,7 @@ of the [MetaMask developer page](https://metamask.io/developer/).
- Restructured and improved [Wallet documentation](/wallet) and introduced "Wallet API" terminology.
([#1114](https://github.com/MetaMask/metamask-docs/pull/1114) and
[#1125](https://github.com/MetaMask/metamask-docs/pull/1125))
- Documented [how to detect multiple wallets using EIP-6963](/wallet/how-to/connect).
- Documented [how to detect multiple wallets using EIP-6963](/wallet/connect/wallet-api).
([#1094](https://github.com/MetaMask/metamask-docs/pull/1094))
- Documented [how to communicate errors in Snaps](/snaps/how-to/communicate-errors).
([#1117](https://github.com/MetaMask/metamask-docs/pull/1117))
23 changes: 22 additions & 1 deletion wallet-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,33 @@
const sidebar = {
walletSidebar: [
"index",
{
type: "category",
label: "Connect to MetaMask",
link: {type: "doc", id: "connect/index"},
items: [
{
type: "doc",
id: "connect/sdk",
},
{
type: "category",
label: "Third-party libraries",
collapsed: false,
items: [{ type: "autogenerated", dirName: "connect/3rd-party-libraries" }],
},
{
type: "doc",
id: "connect/wallet-api",
},
],
collapsed: false,
},
{
type: "category",
label: "How to",
link: { type: "generated-index", slug: "/how-to" },
items: [{ type: "autogenerated", dirName: "how-to" }],
collapsed: false,
},
{
type: "category",
Expand Down
13 changes: 6 additions & 7 deletions wallet/concepts/sdk/android.md → wallet/concepts/android.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
---
sidebar_position: 2
sidebar_position: 4
description: Learn about the Android SDK architecture.
tags:
- Android SDK
---

# Android SDK architecture

The Android version of [MetaMask SDK](index.md) enables your users to easily connect with their
The Android version of [MetaMask SDK](../how-to/use-sdk/index.md) enables your users to easily connect with their
MetaMask Mobile wallet.
The [architecture](#architecture) and [connection flow](#connection-flow) of
the Android SDK differs from the other SDK platforms.

:::tip Get started

- Get started by [setting up the SDK in your Android dapp](../../how-to/use-sdk/mobile/android.md).
- Get started by [setting up the SDK in your Android dapp](../how-to/use-sdk/mobile/android.md).
- See the [example Android dapp](https://github.com/MetaMask/metamask-android-sdk/tree/main/app) in
the Android SDK GitHub repository for advanced use cases.
:::
:::

## Architecture

The following diagram outlines the high-level architecture of the Android SDK:

![Android SDK architecture diagram](../../assets/sdk-android-architecture.png)
![Android SDK architecture diagram](../assets/sdk-android-architecture.png)

The MetaMask Android SDK consists of two components:

Expand All @@ -48,7 +47,7 @@ in Kotlin) using different mechanisms depending on the direction of communicatio

The following diagram outlines the communication flow between the Android client SDK and server SDK:

![Android SDK communication diagram](../../assets/sdk-android-communication.png)
![Android SDK communication diagram](../assets/sdk-android-communication.png)

The flow is as follows:

Expand Down
2 changes: 1 addition & 1 deletion wallet/concepts/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The following diagram outlines the high-level architecture of the MetaMask web3

![Architecture diagram](../assets/web3-architecture.png)

Using [MetaMask SDK](sdk/index.md), dapps built on multiple platforms can connect to their users' Ethereum
Using [MetaMask SDK](../how-to/use-sdk/index.md), dapps built on multiple platforms can connect to their users' Ethereum
accounts through the MetaMask browser extension and MetaMask Mobile.
Dapps can send [Wallet API](wallet-api.md) requests to the users' MetaMask wallet clients.
MetaMask then responds to these requests directly or uses [Infura](https://www.infura.io/) (or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 3
sidebar_label: SDK connections
description: Learn about how a dapp with the SDK installed connects to MetaMask.
tags:
Expand All @@ -11,7 +11,7 @@ tags:

# MetaMask SDK connections

This page provides details on how a dapp with [MetaMask SDK](index.md) installed connects to a
This page provides details on how a dapp with [MetaMask SDK](../how-to/use-sdk/index.md) installed connects to a
user's MetaMask wallet.

## Initial connection flow
Expand Down
4 changes: 2 additions & 2 deletions wallet/concepts/convenience-libraries.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Learn about convenience libraries.
sidebar_position: 4
sidebar_position: 5
---

# Convenience libraries
Expand All @@ -22,5 +22,5 @@ seamless connection from your dapp to MetaMask.
It onboards users smoothly from multiple dapp platforms using the MetaMask browser extension or
MetaMask Mobile, and your dapp can call any [Wallet API](wallet-api.md) methods with the SDK installed.

You can also [use Web3-Onboard with MetaMask SDK](../how-to/use-sdk/3rd-party-libraries/web3-onboard.md)
You can also [use Web3-Onboard with MetaMask SDK](../connect/3rd-party-libraries/web3-onboard.md)
in your JavaScript dapp.
175 changes: 0 additions & 175 deletions wallet/concepts/sdk/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion wallet/concepts/signing-methods.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Learn about the RPC methods for signing transactions in MetaMask.
sidebar_position: 5
sidebar_position: 6
---

# Signing methods
Expand Down
2 changes: 1 addition & 1 deletion wallet/concepts/smart-contracts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Learn about interacting with smart contracts.
sidebar_position: 7
sidebar_position: 8
---

# Smart contracts
Expand Down
7 changes: 2 additions & 5 deletions wallet/concepts/wallet-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MetaMask supports [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963), which int
alternative wallet detection mechanism to the `window.ethereum` injected provider.
This alternative mechanism enables dapps to support [wallet interoperability](wallet-interoperability.md)
by discovering multiple injected wallet providers in a user's browser.
We recommend [using this mechanism to connect to MetaMask](../how-to/connect/index.md).
We recommend [using this mechanism to connect to MetaMask](../connect/index.md).

You can access the provider API using the selected EIP-6963 provider object.
Throughout this documentation, we refer to the selected provider using `provider`.
Expand Down Expand Up @@ -83,15 +83,12 @@ The following methods are restricted:
Granting permission for `eth_accounts` also grants permissions for the following methods:

- [`eth_sendTransaction`](/wallet/reference/eth_sendTransaction)

- [`personal_sign`](/wallet/reference/personal_sign)

- [`eth_signTypedData_v4`](/wallet/reference/eth_signTypedData_v4)

:::caution important
To access accounts, we recommend using [`eth_requestAccounts`](/wallet/reference/eth_requestAccounts),
which automatically asks for permission to use `eth_accounts` by calling `wallet_requestPermissions` internally.
See [how to access a user's accounts](../how-to/connect/access-accounts.md) for more information.
See [how to access a user's accounts](../how-to/access-accounts.md) for more information.
:::

- [`wallet_snap`](/snaps/reference/wallet-api-for-snaps/#wallet_snap) - Gaining permission requires
Expand Down
8 changes: 4 additions & 4 deletions wallet/concepts/wallet-interoperability.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Learn about wallet interoperability.
sidebar_position: 6
sidebar_position: 7
---

# Wallet interoperability
Expand All @@ -27,14 +27,14 @@ provided from each installed wallet:
</video>
</p>

You can [connect to MetaMask using EIP-6963](../how-to/connect/index.md) and see the
You can [connect to MetaMask using EIP-6963](../connect/wallet-api.md) and see the
[EIP-6963 Vite React + TypeScript demo](https://github.com/MetaMask/vite-react-ts-eip-6963/tree/main)
for more information.

## EIP-6963 interfaces

Wallets that support EIP-6963 implement and expose the following standardized interfaces.
When [connecting to MetaMask using EIP-6963](../how-to/connect/index.md), it's important to review
When [connecting to MetaMask using EIP-6963](../connect/wallet-api.md), it's important to review
and understand these interfaces.

### Provider info
Expand Down Expand Up @@ -125,6 +125,6 @@ See the [list of wallets that support EIP-6963](https://github.com/WalletConnect
## Backwards compatibility

Dapps that do not support EIP-6963 can still
[detect MetaMask using the `window.ethereum` provider](/wallet/tutorials/javascript-dapp-simple).
[detect MetaMask using the `window.ethereum` provider](../tutorials/javascript-dapp-simple.md).
However, we recommend adding support to improve the user experience for multiple installed wallets.
Read more about [EIP-6963 backwards compatibility](https://eips.ethereum.org/EIPS/eip-6963#backwards-compatibility).
Loading