Skip to content

Commit 1073dea

Browse files
authored
[coinbase, core, react] : Update - Coinbase wallet name and dedupe on wallet label (#1007)
* Update coinbase naming per team request and dedupe wallets by label
1 parent 1988748 commit 1073dea

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

packages/coinbase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/coinbase",
3-
"version": "2.0.2",
3+
"version": "2.0.2-alpha.1",
44
"description": "Coinbase Wallet module for web3-onboard",
55
"module": "dist/index.js",
66
"browser": "dist/index.js",

packages/coinbase/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function coinbaseWallet({
88
return ({ device }) =>
99
device.type === 'mobile'
1010
? {
11-
label: 'Coinbase',
11+
label: 'Coinbase Wallet',
1212
getIcon: async () => (await import('./icon.js')).default,
1313
getInterface: async ({ chains, appMetadata }) => {
1414
const [chain] = chains

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.2.9-alpha.2",
3+
"version": "2.2.9-alpha.3",
44
"scripts": {
55
"build": "rollup -c",
66
"dev": "rollup -c -w",

packages/core/src/store/actions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Chain, WalletInit } from '@web3-onboard/common'
22
import { internalState$ } from '../streams'
3-
import { initializeWalletModules } from '../utils'
3+
import { initializeWalletModules, uniqueWalletsByLabel } from '../utils'
44
import { dispatch } from './index'
55

66
import type {
@@ -156,10 +156,11 @@ export function setWalletModules(wallets: WalletInit[]): void {
156156
wallets,
157157
internalState$.getValue().device
158158
)
159+
const dedupedWallets = uniqueWalletsByLabel(modules)
159160

160161
const action = {
161162
type: SET_WALLET_MODULES,
162-
payload: modules
163+
payload: dedupedWallets
163164
}
164165

165166
dispatch(action as SetWalletModulesAction)

packages/core/src/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,14 @@ export function initializeWalletModules(
173173
return acc
174174
}, [] as WalletModule[])
175175
}
176+
177+
export function uniqueWalletsByLabel(
178+
walletModuleList: WalletModule[]
179+
): WalletModule[] {
180+
return walletModuleList.filter(
181+
(wallet, i) =>
182+
walletModuleList.findIndex(
183+
(innerWallet: WalletModule) => innerWallet.label === wallet.label
184+
) === i
185+
)
186+
}

packages/injected/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export enum ProviderLabel {
4949
Bitpie = 'Bitpie',
5050
BlockWallet = 'BlockWallet',
5151
Brave = 'Brave Wallet',
52-
Coinbase = 'Coinbase',
52+
Coinbase = 'Coinbase Wallet',
5353
Dcent = `D'CENT`,
5454
Detected = 'Detected Wallet',
5555
Frame = 'Frame',

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"typescript": "^4.5.5"
2222
},
2323
"dependencies": {
24-
"@web3-onboard/core": "^2.2.9-alpha.2",
24+
"@web3-onboard/core": "^2.2.9-alpha.3",
2525
"@web3-onboard/common": "^2.1.0-alpha.1"
2626
},
2727
"peerDependencies": {

0 commit comments

Comments
 (0)