Skip to content

Commit 44425b6

Browse files
authored
web3-onboard:v2.0.2: [fix] - Injected Filters (#874)
* Fixes validation for injected wallet filters * Increment version
1 parent bb08034 commit 44425b6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/injected/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/injected-wallets",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Injected wallets module for web3-onboard",
55
"module": "dist/index.js",
66
"browser": "dist/index.js",
@@ -31,7 +31,7 @@
3131
"window": "^4.2.7"
3232
},
3333
"dependencies": {
34-
"@web3-onboard/common": "^2.0.0",
34+
"@web3-onboard/common": "^2.0.2",
3535
"joi": "^17.4.2",
3636
"lodash.uniqby": "^4.7.0"
3737
}

packages/injected/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export type InjectedProvider = ExternalProvider &
104104
MeetOneProvider &
105105
Record<string, boolean>
106106

107-
export type WalletExclusions = {
107+
export type WalletFilters = {
108108
// A provider label mapped to a list of excluded platforms
109109
// or a boolean indicating if it should be included.
110110
[key in ProviderLabel | string]?: Platform[] | boolean
@@ -118,7 +118,7 @@ export interface InjectedWalletOptions {
118118
// or a boolean indicating if it should be included or not.
119119
// By default all wallets listed in ./packages/injected/
120120
// are included add them to here to remove them.
121-
filter?: WalletExclusions
121+
filter?: WalletFilters
122122
}
123123

124124
export interface InjectedWalletModule extends WalletModule {

packages/injected/src/validation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const walletModule = Joi.object({
1212
})
1313

1414
const wallets = Joi.array().items(walletModule)
15-
const filter = Joi.object().pattern(/\w/, Joi.string())
15+
const filter = Joi.object().pattern(
16+
/\w+/,
17+
Joi.any().allow(Joi.boolean(), Joi.array().items(Joi.string()))
18+
)
1619
const walletOptions = Joi.object({
1720
custom: wallets,
1821
filter

0 commit comments

Comments
 (0)