@@ -14,14 +14,29 @@ const chainId = Joi.string().pattern(/^0x[0-9a-fA-F]+$/)
1414const chainNamespace = Joi . string ( ) . valid ( 'evm' )
1515const unknownObject = Joi . object ( ) . unknown ( )
1616
17+ /** Related to ConnectionInfo from 'ethers/lib/utils' */
18+ const providerConnectionInfo = Joi . object ( {
19+ url : Joi . string ( ) . required ( ) ,
20+ headers : Joi . object ( ) ,
21+ user : Joi . string ( ) ,
22+ password : Joi . string ( ) ,
23+ allowInsecureAuthentication : Joi . boolean ( ) ,
24+ allowGzip : Joi . boolean ( ) ,
25+ throttleLimit : Joi . number ( ) ,
26+ throttleSlotInterval : Joi . number ( ) ,
27+ throttleCallback : Joi . function ( ) ,
28+ timeout : Joi . number ( )
29+ } )
30+
1731const chain = Joi . object ( {
1832 namespace : chainNamespace ,
1933 id : chainId . required ( ) ,
2034 rpcUrl : Joi . string ( ) . required ( ) ,
2135 label : Joi . string ( ) . required ( ) ,
2236 token : Joi . string ( ) . required ( ) ,
2337 icon : Joi . string ( ) ,
24- color : Joi . string ( )
38+ color : Joi . string ( ) ,
39+ providerConnectionInfo : providerConnectionInfo
2540} )
2641
2742const connectedChain = Joi . object ( {
@@ -214,4 +229,4 @@ export function validateLocale(data: string): ValidateReturn {
214229export function validateUpdateBalances ( data :
215230WalletState [ ] ) : ValidateReturn {
216231 return validate ( wallets , data )
217- }
232+ }
0 commit comments