1
1
import type {
2
2
HardhatUserConfig ,
3
+ HttpNetworkAccountsConfig ,
3
4
HttpNetworkAccountsUserConfig ,
5
+ HttpNetworkHDAccountsConfig ,
4
6
HttpNetworkHDAccountsUserConfig ,
5
7
NetworkConfig ,
6
8
} from "../../../types/config.js" ;
@@ -15,6 +17,7 @@ import {
15
17
conditionalUnionType ,
16
18
configurationVariableSchema ,
17
19
resolvedConfigurationVariableSchema ,
20
+ sensitiveStringSchema ,
18
21
sensitiveUrlSchema ,
19
22
unionType ,
20
23
validateUserConfigZodType ,
@@ -48,10 +51,10 @@ const accountsPrivateKeyUserConfigSchema = unionType(
48
51
) ;
49
52
50
53
const httpNetworkHDAccountsUserConfigSchema = z . object ( {
51
- mnemonic : z . string ( ) ,
54
+ mnemonic : sensitiveStringSchema ,
52
55
count : z . optional ( nonnegativeIntSchema ) ,
53
56
initialIndex : z . optional ( nonnegativeIntSchema ) ,
54
- passphrase : z . optional ( z . string ( ) ) ,
57
+ passphrase : z . optional ( sensitiveStringSchema ) ,
55
58
path : z . optional ( z . string ( ) ) ,
56
59
} ) ;
57
60
@@ -109,11 +112,11 @@ const edrNetworkAccountUserConfigSchema = z.object({
109
112
} ) ;
110
113
111
114
const edrNetworkHDAccountsUserConfigSchema = z . object ( {
112
- mnemonic : z . optional ( z . string ( ) ) ,
115
+ mnemonic : z . optional ( sensitiveStringSchema ) ,
113
116
accountsBalance : z . optional ( accountBalanceUserConfigSchema ) ,
114
117
count : z . optional ( nonnegativeIntSchema ) ,
115
118
initialIndex : z . optional ( nonnegativeIntSchema ) ,
116
- passphrase : z . optional ( z . string ( ) ) ,
119
+ passphrase : z . optional ( sensitiveStringSchema ) ,
117
120
path : z . optional ( z . string ( ) ) ,
118
121
} ) ;
119
122
@@ -279,10 +282,10 @@ const gasConfigSchema = unionType(
279
282
) ;
280
283
281
284
const httpNetworkHDAccountsConfigSchema = z . object ( {
282
- mnemonic : z . string ( ) ,
285
+ mnemonic : resolvedConfigurationVariableSchema ,
283
286
count : nonnegativeIntSchema ,
284
287
initialIndex : nonnegativeIntSchema ,
285
- passphrase : z . string ( ) ,
288
+ passphrase : resolvedConfigurationVariableSchema ,
286
289
path : z . string ( ) ,
287
290
} ) ;
288
291
@@ -322,11 +325,11 @@ const edrNetworkAccountConfigSchema = z.object({
322
325
} ) ;
323
326
324
327
const edrNetworkHDAccountsConfigSchema = z . object ( {
325
- mnemonic : z . string ( ) ,
328
+ mnemonic : resolvedConfigurationVariableSchema ,
326
329
accountsBalance : accountBalanceConfigSchema ,
327
330
count : nonnegativeIntSchema ,
328
331
initialIndex : nonnegativeIntSchema ,
329
- passphrase : z . string ( ) ,
332
+ passphrase : resolvedConfigurationVariableSchema ,
330
333
path : z . string ( ) ,
331
334
} ) ;
332
335
@@ -442,3 +445,9 @@ export function isHdAccountsUserConfig(
442
445
) : accounts is HttpNetworkHDAccountsUserConfig {
443
446
return isObject ( accounts ) ;
444
447
}
448
+
449
+ export function isHdAccountsConfig (
450
+ accounts : HttpNetworkAccountsConfig ,
451
+ ) : accounts is HttpNetworkHDAccountsConfig {
452
+ return isObject ( accounts ) ;
453
+ }
0 commit comments