-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnearConfig.js
59 lines (57 loc) · 1.76 KB
/
nearConfig.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const dotenv = require('dotenv');
dotenv.config();
function getConfig (env) {
switch (env) {
case 'production':
case 'mainnet':
return {
networkId: 'mainnet',
nodeUrl: process.env.NEAR_NODE_URL_MAINNET || 'https://rpc.mainnet.near.org',
contractNames: {
oin: "v3.oin_finance.near"
},
walletUrl: 'https://wallet.near.org',
helperUrl: 'https://helper.mainnet.near.org',
explorerUrl: 'https://explorer.mainnet.near.org',
accountId: process.env.NEAR_ACCOUNT_MAINNET
}
case 'development':
case 'testnet':
return {
networkId: 'testnet',
nodeUrl: process.env.NEAR_NODE_URL_TESTNET || 'https://rpc.testnet.near.org',
contractNames: {
oin: ""
},
walletUrl: 'https://wallet.testnet.near.org',
helperUrl: 'https://helper.testnet.near.org',
explorerUrl: 'https://explorer.testnet.near.org',
accountId: process.env.NEAR_ACCOUNT_TESTNET
}
case 'local':
return {
networkId: 'local',
nodeUrl: process.env.NEAR_NODE_URL_LOCAL || 'http://localhost:3030',
keyPath: `${process.env.HOME}/.near/validator_key.json`,
walletUrl: 'http://localhost:4000/wallet',
contractNames: {
oin: ""
},
}
case 'test':
case 'ci':
return {
networkId: 'shared-test',
nodeUrl: process.env.NEAR_NODE_URL_CI_TESTNET || 'https://rpc.ci-testnet.near.org',
contractNames: {
oin: ""
},
masterAccount: 'test.near'
}
default:
throw Error(`Unconfigured environment '${env}'. Can be configured in src/config.js.`)
}
}
module.exports = {
getConfig
};