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 packages/coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/coinbase",
"version": "2.0.2",
"version": "2.0.2-alpha.1",
"description": "Coinbase Wallet module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/coinbase/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function coinbaseWallet({
return ({ device }) =>
device.type === 'mobile'
? {
label: 'Coinbase',
label: 'Coinbase Wallet',
getIcon: async () => (await import('./icon.js')).default,
getInterface: async ({ chains, appMetadata }) => {
const [chain] = chains
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.2.9-alpha.2",
"version": "2.2.9-alpha.3",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/store/actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Chain, WalletInit } from '@web3-onboard/common'
import { internalState$ } from '../streams'
import { initializeWalletModules } from '../utils'
import { initializeWalletModules, uniqueWalletsByLabel } from '../utils'
import { dispatch } from './index'

import type {
Expand Down Expand Up @@ -156,10 +156,11 @@ export function setWalletModules(wallets: WalletInit[]): void {
wallets,
internalState$.getValue().device
)
const dedupedWallets = uniqueWalletsByLabel(modules)

const action = {
type: SET_WALLET_MODULES,
payload: modules
payload: dedupedWallets
}

dispatch(action as SetWalletModulesAction)
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,14 @@ export function initializeWalletModules(
return acc
}, [] as WalletModule[])
}

export function uniqueWalletsByLabel(
walletModuleList: WalletModule[]
): WalletModule[] {
return walletModuleList.filter(
(wallet, i) =>
walletModuleList.findIndex(
(innerWallet: WalletModule) => innerWallet.label === wallet.label
) === i
)
}
2 changes: 1 addition & 1 deletion packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export enum ProviderLabel {
Bitpie = 'Bitpie',
BlockWallet = 'BlockWallet',
Brave = 'Brave Wallet',
Coinbase = 'Coinbase',
Coinbase = 'Coinbase Wallet',
Dcent = `D'CENT`,
Detected = 'Detected Wallet',
Frame = 'Frame',
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/core": "^2.2.9-alpha.2",
"@web3-onboard/core": "^2.2.9-alpha.3",
"@web3-onboard/common": "^2.1.0-alpha.1"
},
"peerDependencies": {
Expand Down