File tree Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @web3-onboard/common" ,
3
- "version" : " 2.0.7 " ,
3
+ "version" : " 2.0.8 " ,
4
4
"scripts" : {
5
5
"build" : " rollup -c" ,
6
6
"dev" : " rollup -c -w" ,
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ export interface WalletModule {
225
225
/**
226
226
* @returns the wallet interface associated with the module
227
227
*/
228
- getInterface : ( helpers : GetInterfaceHelpers ) => Promise < WalletInterface >
228
+ getInterface : ( helpers ? : GetInterfaceHelpers ) => Promise < WalletInterface >
229
229
}
230
230
231
231
export type GetInterfaceHelpers = {
Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ const balance = Joi.any().allow(
47
47
null
48
48
)
49
49
50
- const account = {
50
+ const account = Joi . object ( {
51
51
address : Joi . string ( ) . required ( ) ,
52
52
ens,
53
53
balance
54
- }
54
+ } )
55
55
56
56
const chains = Joi . array ( ) . items ( chain )
57
57
const accounts = Joi . array ( ) . items ( account )
Original file line number Diff line number Diff line change @@ -111,10 +111,15 @@ const equal = {
111
111
// The property on the window where the injected provider is defined
112
112
// Example: window.ethereum
113
113
injectedNamespace: ' ethereum' ,
114
- // A unique property on the provider that is used to identify the provider
114
+ // A function that returns a bool indicating whether or not the provider is
115
+ // of a certain identity. In this case, a unique property on the provider
116
+ // is used to identify the provider.
115
117
// In most cases this is in the format: `is<provider-name>`.
116
- // Example: window.ethereum.isEQLWallet
117
- providerIdentityFlag: ' isEQLWallet' ,
118
+ // You may also include custom logic here if checking for the property
119
+ // isn't sufficient.
120
+ checkProviderIdentity : ({ provider }) =>
121
+ !! provider && !! provider [ProviderIdentityFlag .MetaMask ],
122
+
118
123
// A method that returns a string of the wallet icon which will be displayed
119
124
getIcon : async () => (await import (' <PATH_TO_ICON>' )).default ,
120
125
// Returns a valid EIP1193 provider. In some cases the provider will need to be patched to satisfy the EIP1193 Provider interface
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @web3-onboard/injected-wallets" ,
3
- "version" : " 2.0.5 " ,
3
+ "version" : " 2.0.6 " ,
4
4
"description" : " Injected wallets module for web3-onboard" ,
5
5
"module" : " dist/index.js" ,
6
6
"browser" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ import Joi from 'joi'
4
4
5
5
const walletModule = Joi . object ( {
6
6
label : Joi . string ( ) . required ( ) ,
7
- getIcon : Joi . function ( ) . arity ( 1 ) . required ( ) ,
8
- getInterface : Joi . function ( ) . arity ( 1 ) . required ( ) ,
7
+ getIcon : Joi . function ( ) . arity ( 0 ) . required ( ) ,
8
+ getInterface : Joi . function ( ) . maxArity ( 1 ) . required ( ) ,
9
9
injectedNamespace : Joi . string ( ) . required ( ) ,
10
- checkProviderIdentity : Joi . function ( ) . arity ( 1 ) . required ( ) . required ( ) ,
10
+ checkProviderIdentity : Joi . function ( ) . arity ( 1 ) . required ( ) ,
11
11
platforms : Joi . array ( ) . items ( Joi . string ( ) )
12
12
} )
13
13
You can’t perform that action at this time.
0 commit comments