forked from near/near-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
42 lines (40 loc) · 1.45 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const DEFAULT_NETWORK = process.env.NEAR_ENV || process.env.NEAR_NETWORK || 'testnet';
function getConfig(env) {
let config;
switch (env) {
case 'production':
case 'mainnet':
config = {
networkId: 'mainnet',
nodeUrl: process.env.NEAR_MAINNET_RPC || 'https://rpc.mainnet.near.org',
walletUrl: process.env.NEAR_MAINNET_WALLET || 'https://app.mynearwallet.com',
helperUrl: 'https://helper.mainnet.near.org',
helperAccount: 'near',
};
break;
case 'development':
case 'testnet':
config = {
networkId: 'testnet',
nodeUrl: process.env.NEAR_TESTNET_RPC || 'https://rpc.testnet.near.org',
walletUrl: process.env.NEAR_TESTNET_WALLET || 'https://testnet.mynearwallet.com',
helperUrl: 'https://helper.testnet.near.org',
helperAccount: 'testnet',
};
break;
case 'custom':
config = {
networkId: 'custom',
nodeUrl: process.env.NEAR_CUSTOM_RPC,
walletUrl: process.env.NEAR_CUSTOM_WALLET,
helperUrl: process.env.NEAR_CUSTOM_HELPER,
helperAccount: process.env.NEAR_CUSTOM_TLA,
};
break;
default:
throw Error(`Unconfigured environment '${env}'. Can be configured in src/config.js.`);
}
config['initialBalance'] = '1' + '0'.repeat(24);
return config;
}
module.exports = { getConfig, DEFAULT_NETWORK };