@@ -14,14 +14,30 @@ const chainId = Joi.string().pattern(/^0x[0-9a-fA-F]+$/)
1414const chainNamespace = Joi . string ( ) . valid ( 'evm' )
1515const unknownObject = Joi . object ( ) . unknown ( )
1616
17+ // const address = Joi.string().regex(/^0x[a-fA-F0-9]{40}$/)
18+ /** Related to ConnectionInfo from 'ethers/lib/utils' */
19+ const providerConnectionInfo = Joi . object ( {
20+ url : Joi . string ( ) . required ( ) ,
21+ headers : Joi . object ( ) ,
22+ user : Joi . string ( ) ,
23+ password : Joi . string ( ) ,
24+ allowInsecureAuthentication : Joi . boolean ( ) ,
25+ allowGzip : Joi . boolean ( ) ,
26+ throttleLimit : Joi . number ( ) ,
27+ throttleSlotInterval : Joi . number ( ) ,
28+ throttleCallback : Joi . function ( ) ,
29+ timeout : Joi . number ( )
30+ } )
31+
1732const chain = Joi . object ( {
1833 namespace : chainNamespace ,
1934 id : chainId . required ( ) ,
2035 rpcUrl : Joi . string ( ) . required ( ) ,
2136 label : Joi . string ( ) . required ( ) ,
2237 token : Joi . string ( ) . required ( ) ,
2338 icon : Joi . string ( ) ,
24- color : Joi . string ( )
39+ color : Joi . string ( ) ,
40+ providerConnectionInfo : providerConnectionInfo
2541} )
2642
2743const connectedChain = Joi . object ( {
@@ -214,4 +230,4 @@ export function validateLocale(data: string): ValidateReturn {
214230export function validateUpdateBalances ( data :
215231WalletState [ ] ) : ValidateReturn {
216232 return validate ( wallets , data )
217- }
233+ }
0 commit comments