@@ -20,6 +20,7 @@ const { validateContract } = require('../validation')
20
20
const Protocol = require ( '../protocols' )
21
21
22
22
const protocolChoices = Array . from ( Protocol . availableProtocols ( ) . keys ( ) )
23
+ const availableNetworks = Protocol . availableNetworks ( )
23
24
24
25
const HELP = `
25
26
${ chalk . bold ( 'graph init' ) } [options] [subgraph-name] [directory]
@@ -47,12 +48,12 @@ ${chalk.dim('Options for --from-contract:')}
47
48
${ chalk . dim . underline ( 'Ethereum:' ) }
48
49
49
50
--abi <path> Path to the contract ABI (default: download from Etherscan)
50
- --network <${ Protocol . availableNetworks ( ) . get ( 'ethereum' ) . join ( '|' ) } >
51
+ --network <${ availableNetworks . get ( 'ethereum' ) . join ( '|' ) } >
51
52
Selects the network the contract is deployed to
52
53
53
54
${ chalk . dim . underline ( 'NEAR:' ) }
54
55
55
- --network <${ Protocol . availableNetworks ( ) . get ( 'near' ) . join ( '|' ) } >
56
+ --network <${ availableNetworks . get ( 'near' ) . join ( '|' ) } >
56
57
Selects the network the contract is deployed to
57
58
`
58
59
@@ -156,7 +157,7 @@ const processInitForm = async (
156
157
name : 'network' ,
157
158
message : ( ) => `${ protocolInstance . displayName ( ) } network` ,
158
159
choices : ( ) =>
159
- Protocol . availableNetworks ( ) // TODO: this should be a constant in the top of the file.
160
+ availableNetworks
160
161
. get ( protocol ) // Get networks related to the chosen protocol.
161
162
. toArray ( ) , // Needed because of gluegun. It can't even receive a JS iterable.
162
163
skip : fromExample !== undefined ,
0 commit comments