Skip to content
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
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.5.1",
"@web3-onboard/magic": "^2.1.7",
"@web3-onboard/metamask": "^2.0.0-alpha.1",
"@web3-onboard/metamask": "^2.0.1-alpha.1",
"@web3-onboard/mew-wallet": "^2.0.4",
"@web3-onboard/phantom": "^2.0.3",
"@web3-onboard/portis": "^2.1.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ We recommend you add the [Core Repo](../../modules/core.md#install) and consider
**SDK Wallets**

- [Arcana Auth](../../wallets/arcana.md#install)
- [Blocto](../../docs/wallets/blocto.md#install)
- [Blocto](../../wallets/blocto.md#install)
- [Coinbase](../../wallets/coinbase.md#install)
- [Fortmatic](../../wallets/fortmatic.md#install)
- [Frame](../../wallets/frame.md#install)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/routes/docs/[...3]modules/[...4]solid/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if (connectedWallet) {

### `init`

The `init` function initializes `web3-onboard` and makes it available to the `useOnboard()` composable. For references check out the [initialization docs for `@web3-onboard/core`](../core/README.md#initialization)
The `init` function initializes `web3-onboard` and makes it available to the `useOnboard()` composable. For references check out the [initialization docs for `@web3-onboard/core`](/docs/modules/core#initialization)

#### Example usage

Expand Down Expand Up @@ -126,7 +126,7 @@ const {

### `connectWallet`

Function to open the onboard modal and connect to a wallet provider. For reference check out the [connecting a wallet for `@web3-onboard/core`](../core/README.md#connecting-a-wallet)
Function to open the onboard modal and connect to a wallet provider. For reference check out the [connecting a wallet for `@web3-onboard/core`](/docs/modules/core#connecting-a-wallet)

#### Example usage

Expand Down
16 changes: 11 additions & 5 deletions docs/src/routes/docs/[...4]wallets/[...18]metamask/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ title: MetaMask
The MetaMask Web3-Onboard module provides a reliable, secure, and seamless connection from your dapp to the MetaMask browser extension and MetaMask Mobile.
See [MetaMask SDK Developer Docs](https://github.com/MetaMask/metamask-sdk)

:::admonition type=tip
When utilizing this package alongside the `@web3-onboard/injected-wallets` module, ensure to list this package prior to the initialized injected-wallets module within the wallets list of the Web3-Onboard init.

This order prioritizes the SDK when a MetaMask browser wallet is detected, allowing the SDK to take precedence.
:::

## Install
Expand Down Expand Up @@ -36,14 +40,14 @@ npm install @web3-onboard/metamask
// For a complete list of options check https://github.com/MetaMask/metamask-sdk
interface MetaMaskSDKOptions {
dappMetadata: {
url?: string;
name?: string;
base64Icon?: string;
},
url?: string
name?: string
base64Icon?: string
}
/**
* If MetaMask browser extension is detected, directly use it without prompting the user.
*/
extensionOnly?: boolean;
extensionOnly?: boolean
}
```

Expand All @@ -66,6 +70,8 @@ const onboard = Onboard({
wallets: [
metamaskSDKWallet
//... other wallets
// Make sure to pass in before or above the injected-wallets module
injectedWalletModule
]
})

Expand Down
14 changes: 7 additions & 7 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2504,9 +2504,9 @@
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==

"@react-native-async-storage/async-storage@^1.17.11":
version "1.19.3"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.19.3.tgz#ad5fe3ed0a82d4624aa4500321c1e09c02daeb46"
integrity sha512-CwGfoHCWdPOTPS+2fW6YRE1fFBpT9++ahLEroX5hkgwyoQ+TkmjOaUxixdEIoVua9Pz5EF2pGOIJzqOTMWfBlA==
version "1.19.4"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.19.4.tgz#f3c8648fa6d06f085e30f68f0810ea8e53165ace"
integrity sha512-Stj6Q1v5knTMaYOinEEJl030SzJWEhqW+IYI5uA9Nl9Olo+vDUecmQXqpIxELucwOGDJ8KwvI0UL22UHudwZeQ==
dependencies:
merge-options "^3.0.4"

Expand Down Expand Up @@ -4314,10 +4314,10 @@
magic-sdk "^8.1.0"
rxjs "^7.5.2"

"@web3-onboard/metamask@^2.0.0-alpha.1":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@web3-onboard/metamask/-/metamask-2.0.0.tgz#c2dae6413611e530bfe904335750e25728db0779"
integrity sha512-tZSGa1p9yRScGK0qSAjtvZK8pAZOL6B5j+OutAYLs5WpEFZiXxiJUkJwiEhlL0YI78RMA5K3/4GhY6GTC6ruiA==
"@web3-onboard/metamask@^2.0.1-alpha.1":
version "2.0.1-alpha.2"
resolved "https://registry.yarnpkg.com/@web3-onboard/metamask/-/metamask-2.0.1-alpha.2.tgz#b5371a55f43ba7ef70a73e8febf7d252bd47322e"
integrity sha512-KUcblErwCRpL4LvM8PJvKHND1ePmiDbphiizdmwiOpNxEQ6VGR3S0eIZq1iKv2hxkImdMtprHni426W4w7Q8RA==
dependencies:
"@metamask/sdk" "^0.10.0"
"@web3-onboard/common" "^2.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.5.2",
"@web3-onboard/magic": "^2.1.6",
"@web3-onboard/metamask": "^2.0.1-alpha.1",
"@web3-onboard/metamask": "^2.0.1-alpha.3",
"@web3-onboard/mew-wallet": "^2.0.3",
"@web3-onboard/phantom": "^2.0.3",
"@web3-onboard/portis": "^2.1.6",
Expand Down
8 changes: 7 additions & 1 deletion packages/metamask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ See [MetaMask SDK Developer Docs](https://github.com/MetaMask/metamask-sdk)

`npm i @web3-onboard/metamask`

### If using this package with the `@web3-onboard/injected-wallets` module
_When utilizing this package alongside the `@web3-onboard/injected-wallets` module, ensure to list this package prior to the initialized injected-wallets module within the wallets list of the Web3-Onboard init._
_This order prioritizes the SDK when a MetaMask browser wallet is detected, allowing the SDK to take precedence._

## Options

```typescript
Expand Down Expand Up @@ -42,8 +46,10 @@ const metamaskSDKWallet = metamaskSDK({options: {
const onboard = Onboard({
// ... other Onboard options
wallets: [
metamaskSDKWallet
metamaskSDKWallet,
//... other wallets
// Make sure to pass in before or above the injected-wallets module
injectedWalletModule
]
})

Expand Down
4 changes: 2 additions & 2 deletions packages/metamask/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/metamask",
"version": "2.0.1-alpha.2",
"version": "2.0.1-alpha.3",
"description": "MetaMask SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -60,7 +60,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@metamask/sdk": "^0.10.0",
"@metamask/sdk": "^0.10.1",
"@web3-onboard/common": "^2.3.3"
}
}
9 changes: 8 additions & 1 deletion packages/metamask/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { MetaMaskSDKOptions } from '@metamask/sdk'
import type { WalletInit } from '@web3-onboard/common'
export type { MetaMaskSDKOptions } from '@metamask/sdk'

function metamask({
options
Expand All @@ -17,15 +18,21 @@ function metamask({
const { createEIP1193Provider } = await import('@web3-onboard/common')
const { default: metaMask, MetaMaskSDK } = await import('@metamask/sdk')

let MetaMaskSDKConstructor
// Patch issue with MetaMask SDK, remove after SDK is fixed
localStorage.removeItem('providerType')

let MetaMaskSDKConstructor
if (!MetaMaskSDK) {
// @ts-ignore
MetaMaskSDKConstructor = metaMask.MetaMaskSDK
} else {
MetaMaskSDKConstructor = MetaMaskSDK
}

if (!MetaMaskSDKConstructor) {
throw new Error('Error importing and initializing MetaMask SDK')
}

const sdk = new MetaMaskSDKConstructor({
...options,
dappMetadata: {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2197,10 +2197,10 @@
resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-3.0.0.tgz#8c2b9073fe0722d48693143b0dc8448840daa3bd"
integrity sha512-j6Z47VOmVyGMlnKXZmL0fyvWfEYtKWCA9yGZkU3FCsGZUT5lHGmvaV9JA5F2Y+010y7+ROtR3WMXIkvl/nVzqQ==

"@metamask/[email protected].0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@metamask/sdk-communication-layer/-/sdk-communication-layer-0.10.0.tgz#897ed0e1b881517e09d40a3e9c9a323c1a9b11b5"
integrity sha512-Hi8sySaP+dyjd9+SQUtTnmYFRjKWgNo371yWcfOx1vogpP5YwD4VaHDbPQr5rWKDGXb/x1wai6UzPkMqHbllwQ==
"@metamask/[email protected].1":
version "0.10.1"
resolved "https://registry.yarnpkg.com/@metamask/sdk-communication-layer/-/sdk-communication-layer-0.10.1.tgz#95c6a1786dcd7a64c54a8e5cbd11489aa708b074"
integrity sha512-lWeh1PUq114h1/44llZgBcG51uOEi5dHjnNHlcYK9Sjq/iJ4s3mp0y39DGXHEs2r6rJQRyQpryoYyPsQTF2Imw==
dependencies:
cross-fetch "^3.1.5"
date-fns "^2.29.3"
Expand All @@ -2222,15 +2222,15 @@
react-dom "^18.2.0"
react-i18next "^13.2.2"

"@metamask/sdk@^0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@metamask/sdk/-/sdk-0.10.0.tgz#3eb169ee07e95e232ebf3f3ef27906e28423fdaa"
integrity sha512-a6H51cKjiWd2gb4ugjl4zP+6ZRtcSc8cwtXUSiKKlXwa//54nnx7OzCNOjbPJFnnqT51rs3v9kSoRhOgS04ezQ==
"@metamask/sdk@^0.10.1":
version "0.10.1"
resolved "https://registry.yarnpkg.com/@metamask/sdk/-/sdk-0.10.1.tgz#3a9d029d5b16684de59d6ee34401d1165dc1a740"
integrity sha512-cxTWnniZG0cmvaFxf/WAf4SqPw4lHrt16cMMiefAJAsNyL3aPUh8M26fh29EdftIhUXytT9ErNGW+Nf5V4EsCQ==
dependencies:
"@metamask/onboarding" "^1.0.1"
"@metamask/post-message-stream" "^6.1.0"
"@metamask/providers" "^10.2.1"
"@metamask/sdk-communication-layer" "0.10.0"
"@metamask/sdk-communication-layer" "0.10.1"
"@metamask/sdk-install-modal-web" "0.10.0"
"@react-native-async-storage/async-storage" "^1.17.11"
"@types/dom-screen-wake-lock" "^1.0.0"
Expand Down