-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Document mobile deeplinks #1928
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a25c9a1
Document mobile deeplinks
alexandratran 4a8ffaa
Apply suggestions from code review
alexandratran b2f570c
Merge branch 'main' into deeplinking
alexandratran e4ae213
update what's new
alexandratran 69f189e
mention qr codes
alexandratran 2504477
Merge branch 'main' into deeplinking
alexandratran e6bcd0c
update deeplinks
alexandratran 2038238
Merge branch 'main' into deeplinking
alexandratran 3a76b16
Merge branch 'main' into deeplinking
alexandratran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| --- | ||
| description: Use deeplinks to connect to users' mobile wallets. | ||
| toc_max_heading_level: 2 | ||
| --- | ||
|
|
||
| import Tabs from "@theme/Tabs"; | ||
| import TabItem from "@theme/TabItem"; | ||
|
|
||
| # Use deeplinks | ||
|
|
||
| You can use deeplinks to route your users to specific locations and pre-configured functions in the MetaMask Mobile app. | ||
| For example, you can create a deeplink that enables users to make payments in one click—with the token, recipient, and amount already set. | ||
|
|
||
| If a user doesn't have MetaMask Mobile installed, deeplinks route the user to a landing page where they can download the app. | ||
|
|
||
| This page highlights deeplinks available for MetaMask Mobile. | ||
|
|
||
| ## Open a dapp inside the in-app browser | ||
|
|
||
| <Tabs> | ||
| <TabItem value="Deeplink"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/dapp/{dappUrl} | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Example"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/dapp/app.uniswap.org | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
|
|
||
| This deeplink takes the user directly to the dapp URL in the MetaMask Mobile in-app browser. | ||
|
|
||
| The example navigates to `app.uniswap.org` in the in-app browser. | ||
|
|
||
| ### Path parameters | ||
|
|
||
| - `dappUrl` - Dapp URL. | ||
|
|
||
| ## Send native currency | ||
|
|
||
| <Tabs> | ||
| <TabItem value="Deeplink"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/send/{recipient}@{chainId} | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Example"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/send/0x0000000@137?value=1e16 | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| This deeplink starts the process of sending a transaction in the native currency. | ||
| If the chain ID is specified, MetaMask Mobile automatically switches to the correct network. | ||
|
|
||
| The example displays the confirmation screen to send 0.01 POL (`1e16` wei) in Polygon (chain ID `137`) to recipient address `0x0000000`. | ||
|
|
||
| ### Path parameters | ||
|
|
||
| - `recipient` - Address of the recipient. | ||
| - `chainId` - (Optional) Chain ID of the network to use. | ||
|
|
||
| ### Query string parameters | ||
|
|
||
| - `value` - Amount to be transferred, in the native currency's smallest unit. | ||
|
|
||
| ## Send an ERC-20 token | ||
|
|
||
| <Tabs> | ||
| <TabItem value="Deeplink"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/send/{contractAddress}@{chainId}/transfer | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Example"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/send/0x176211869cA2b568f2A7D4EE941E073a821EE1ff@59144/transfer?address=0x0000000&uint256=1e6 | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| This deeplink starts the process of sending a transaction in an ERC-20 token. | ||
| If the chain ID is specified, MetaMask Mobile automatically switches to the correct network. | ||
|
|
||
| The example displays the confirmation screen to send 1 USDC (`1e6` units, contract address `0x176211869cA2b568f2A7D4EE941E073a821EE1ff`) on Linea (chain ID `59144`) to recipient address `0x0000000`. | ||
|
|
||
| ### Path parameters | ||
|
|
||
| - `contractAddress` - Contract address of the ERC-20 token. | ||
| - `chainId` - (Optional) Chain ID of the network to use. | ||
|
|
||
| ### Query string parameters | ||
|
|
||
| - `address` - Address of the recipient. | ||
| - `uint256` - Amount to be transferred, in the token's smallest units. | ||
alexandratran marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Start the on-ramp process | ||
|
|
||
| <Tabs> | ||
| <TabItem value="Deeplink"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/buy | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Example"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/buy?chainId=59144&address=0x176211869cA2b568f2A7D4EE941E073a821EE1ff&amount=100 | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| This deeplink starts the on-ramp process to buy native currency or ERC-20 tokens. | ||
| If the chain ID is specified, MetaMask Mobile automatically switches to the correct network. | ||
|
|
||
| The example starts the on-ramp process to buy $100 (`amount=100`) of USDC (contract address `0x176211869cA2b568f2A7D4EE941E073a821EE1ff`) on Linea (chain ID `59144`). | ||
| The fiat currency depends on the onboarding status of the user and the region they select. | ||
|
|
||
| :::note | ||
| You can use the `/buy` or `/buy-crypto` path for this deeplink. | ||
| ::: | ||
|
|
||
| ### Query string parameters | ||
|
|
||
| - `chainId` - (Optional) Chain ID of the network to use. | ||
| - `address` - (Optional) Contract address of the ERC-20 token. | ||
| If omitted, the native currency is used. | ||
| - `amount` - (Optional) Amount to buy, in the user's fiat currency. | ||
|
|
||
| ## Start the off-ramp process | ||
|
|
||
| <Tabs> | ||
| <TabItem value="Deeplink"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/sell | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Example"> | ||
|
|
||
| ```text | ||
| https://metamask.app.link/sell?chainId=59144&amount=125 | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| This deeplink starts the off-ramp process to sell native currency. | ||
| If the chain ID is specified, MetaMask Mobile automatically switches to the correct network. | ||
|
|
||
| The example starts the off-ramp process to sell 125 ETH (`amount=125`) on Linea (chain ID `59144`). | ||
|
|
||
| :::note | ||
| You can use the `/sell` or `/sell-crypto` path for this deeplink. | ||
| ::: | ||
|
|
||
| ### Query string parameters | ||
|
|
||
| - `chainId` - (Optional) Chain ID of the network to use. | ||
| - `amount` - (Optional) Amount to sell, in the native currency. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.