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
45 changes: 45 additions & 0 deletions packages/dcent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,48 @@ const onboard = Onboard({
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

### Filtering Platforms

You may decide that on certain platforms you do not want to display this wallet as a selectable option. To do that you can use the `filter` init option which is an array of platforms that you would like this wallet to **not** be displayed to the end user:

```typescript
import Onboard from '@web3-onboard/core'
import dcentModule from '@web3-onboard/dcent'

const dcent = dcentModule({ filter: ['Safari'] })

const onboard = Onboard({
// ... other Onboard options
wallets: [
dcent
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

The following is a list of the platforms that can be filtered:

```typescript
type Platform =
| 'Windows Phone'
| 'Windows'
| 'macOS'
| 'iOS'
| 'Android'
| 'Linux'
| 'Chrome OS'
| 'Android Browser'
| 'Chrome'
| 'Chromium'
| 'Firefox'
| 'Microsoft Edge'
| 'Opera'
| 'Safari'
| 'desktop'
| 'mobile'
| 'tablet'
```
2 changes: 1 addition & 1 deletion packages/dcent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/dcent",
"version": "2.1.1",
"version": "2.2.0-alpha.1",
"description": "D'CENT 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
23 changes: 19 additions & 4 deletions packages/dcent/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import type { Chain, WalletInit, EIP1193Provider } from '@web3-onboard/common'
import type {
Chain,
WalletInit,
EIP1193Provider,
Platform
} from '@web3-onboard/common'

import type { providers } from 'ethers'

import type {
Expand Down Expand Up @@ -51,15 +57,24 @@ const generateAccounts = async (
}

function dcent({
customNetwork
customNetwork,
filter
}: {
customNetwork?: CustomNetwork
filter?: Platform[]
} = {}): WalletInit {
const getIcon = async () => (await import('./icon.js')).default
return helpers => {
const { device } = helpers

return ({ device }) => {
const filtered =
Array.isArray(filter) &&
(filter.includes(device.type) || filter.includes(device.os.name))

if (filtered) return null

const isMobile = device.type === 'mobile'
let accounts: Account[] | undefined

return {
label: "D'CENT",
getIcon,
Expand Down
10 changes: 5 additions & 5 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"dependencies": {
"@web3-onboard/coinbase": "^2.1.1",
"@web3-onboard/core": "^2.8.1",
"@web3-onboard/dcent": "^2.1.1",
"@web3-onboard/dcent": "^2.2.0-alpha.1",
"@web3-onboard/fortmatic": "^2.0.12",
"@web3-onboard/gas": "^2.1.1",
"@web3-onboard/gnosis": "^2.1.1",
"@web3-onboard/injected-wallets": "^2.2.0",
"@web3-onboard/keepkey": "^2.2.1",
"@web3-onboard/keystone": "^2.2.1",
"@web3-onboard/ledger": "^2.2.1",
"@web3-onboard/keepkey": "^2.3.0-alpha.1",
"@web3-onboard/keystone": "^2.3.0-alpha.1",
"@web3-onboard/ledger": "^2.3.0-alpha.1",
"@web3-onboard/magic": "^2.1.1",
"@web3-onboard/portis": "^2.1.1",
"@web3-onboard/sequence": "^2.0.0",
"@web3-onboard/torus": "^2.1.1",
"@web3-onboard/trezor": "^2.2.1",
"@web3-onboard/trezor": "^2.3.0-alpha.1",
"@web3-onboard/walletconnect": "^2.1.1",
"@web3-onboard/web3auth": "^2.1.1",
"vconsole": "^3.9.5"
Expand Down
45 changes: 45 additions & 0 deletions packages/keepkey/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,48 @@ const onboard = Onboard({
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

### Filtering Platforms

You may decide that on certain platforms you do not want to display this wallet as a selectable option. To do that you can use the `filter` init option which is an array of platforms that you would like this wallet to **not** be displayed to the end user:

```typescript
import Onboard from '@web3-onboard/core'
import keepkeyModule from '@web3-onboard/keepkey'

const keepkey = keepkeyModule({ filter: ['Safari'] })

const onboard = Onboard({
// ... other Onboard options
wallets: [
keepkey
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

The following is a list of the platforms that can be filtered:

```typescript
type Platform =
| 'Windows Phone'
| 'Windows'
| 'macOS'
| 'iOS'
| 'Android'
| 'Linux'
| 'Chrome OS'
| 'Android Browser'
| 'Chrome'
| 'Chromium'
| 'Firefox'
| 'Microsoft Edge'
| 'Opera'
| 'Safari'
| 'desktop'
| 'mobile'
| 'tablet'
```
2 changes: 1 addition & 1 deletion packages/keepkey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keepkey",
"version": "2.2.1",
"version": "2.3.0-alpha.1",
"description": "KeepKey hardware 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
12 changes: 9 additions & 3 deletions packages/keepkey/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Chain, WalletInit } from '@web3-onboard/common'
import type { Chain, Platform, WalletInit } from '@web3-onboard/common'
import type { StaticJsonRpcProvider } from '@ethersproject/providers'
import type { ETHAccountPath } from '@shapeshiftoss/hdwallet-core'
import type { KeepKeyHDWallet } from '@shapeshiftoss/hdwallet-keepkey'
Expand Down Expand Up @@ -36,12 +36,18 @@ const errorMessages = {

type ErrorCode = 'busy' | 'pairing'

function keepkey(): WalletInit {
function keepkey({ filter }: { filter?: Platform[] } = {}): WalletInit {
const getIcon = async () => (await import('./icon.js')).default

return () => {
return ({ device }) => {
let accounts: Account[] | undefined

const filtered =
Array.isArray(filter) &&
(filter.includes(device.type) || filter.includes(device.os.name))

if (filtered) return null

return {
label: 'KeepKey',
getIcon,
Expand Down
45 changes: 45 additions & 0 deletions packages/keystone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,48 @@ const onboard = Onboard({
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

### Filtering Platforms

You may decide that on certain platforms you do not want to display this wallet as a selectable option. To do that you can use the `filter` init option which is an array of platforms that you would like this wallet to **not** be displayed to the end user:

```typescript
import Onboard from '@web3-onboard/core'
import keystoneModule from '@web3-onboard/keystone'

const keystone = keystoneModule({ filter: ['Safari'] })

const onboard = Onboard({
// ... other Onboard options
wallets: [
keystone
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

The following is a list of the platforms that can be filtered:

```typescript
type Platform =
| 'Windows Phone'
| 'Windows'
| 'macOS'
| 'iOS'
| 'Android'
| 'Linux'
| 'Chrome OS'
| 'Android Browser'
| 'Chrome'
| 'Chromium'
| 'Firefox'
| 'Microsoft Edge'
| 'Opera'
| 'Safari'
| 'desktop'
| 'mobile'
| 'tablet'
```
2 changes: 1 addition & 1 deletion packages/keystone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keystone",
"version": "2.2.1",
"version": "2.3.0-alpha.1",
"description": "Keystone hardware 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
22 changes: 19 additions & 3 deletions packages/keystone/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import type { Chain, CustomNetwork, WalletInit } from '@web3-onboard/common'
import type {
Chain,
CustomNetwork,
Platform,
WalletInit
} from '@web3-onboard/common'

import type { Account, ScanAccountsOptions } from '@web3-onboard/hw-common'
import type { StaticJsonRpcProvider } from '@ethersproject/providers'

Expand Down Expand Up @@ -58,13 +64,23 @@ const generateAccounts = async (
}

function keystone({
customNetwork
customNetwork,
filter
}: {
customNetwork?: CustomNetwork
filter?: Platform[]
} = {}): WalletInit {
const getIcon = async () => (await import('./icon.js')).default
return () => {

return ({ device }) => {
let accounts: Account[] | undefined

const filtered =
Array.isArray(filter) &&
(filter.includes(device.type) || filter.includes(device.os.name))

if (filtered) return null

return {
label: 'Keystone',
getIcon,
Expand Down
45 changes: 45 additions & 0 deletions packages/ledger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,48 @@ const onboard = Onboard({
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

### Filtering Platforms

You may decide that on certain platforms you do not want to display this wallet as a selectable option. To do that you can use the `filter` init option which is an array of platforms that you would like this wallet to **not** be displayed to the end user:

```typescript
import Onboard from '@web3-onboard/core'
import ledgerModule from '@web3-onboard/ledger'

const ledger = ledgerModule({ filter: ['Safari'] })

const onboard = Onboard({
// ... other Onboard options
wallets: [
ledger
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

The following is a list of the platforms that can be filtered:

```typescript
type Platform =
| 'Windows Phone'
| 'Windows'
| 'macOS'
| 'iOS'
| 'Android'
| 'Linux'
| 'Chrome OS'
| 'Android Browser'
| 'Chrome'
| 'Chromium'
| 'Firefox'
| 'Microsoft Edge'
| 'Opera'
| 'Safari'
| 'desktop'
| 'mobile'
| 'tablet'
```
2 changes: 1 addition & 1 deletion packages/ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/ledger",
"version": "2.2.1",
"version": "2.3.0-alpha.1",
"description": "Ledger hardare 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
17 changes: 14 additions & 3 deletions packages/ledger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type Eth from '@ledgerhq/hw-app-eth'
import type {
Chain,
WalletInit,
GetInterfaceHelpers
GetInterfaceHelpers,
Platform
} from '@web3-onboard/common'

import type {
Expand Down Expand Up @@ -108,13 +109,23 @@ const getAddresses = async (
}

function ledger({
customNetwork
customNetwork,
filter
}: {
customNetwork?: CustomNetwork
filter?: Platform[]
} = {}): WalletInit {
const getIcon = async () => (await import('./icon.js')).default
return () => {

return ({ device }) => {
let accounts: Account[] | undefined

const filtered =
Array.isArray(filter) &&
(filter.includes(device.type) || filter.includes(device.os.name))

if (filtered) return null

return {
label: 'Ledger',
getIcon,
Expand Down
Loading