-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.ts
75 lines (75 loc) · 2.71 KB
/
config.ts
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
export const getConfig = (env: string) => {
const CONTRACT_NAME =
process.env.CONTRACT_NAME || "v01.katherine_fundraising.testnet";
switch (env) {
case "production":
case "mainnet":
return {
networkId: "mainnet",
nodeUrl: "https://rpc.mainnet.near.org",
contractName: CONTRACT_NAME,
walletUrl: "https://wallet.near.org",
helperUrl: "https://helper.mainnet.near.org",
explorerUrl: "https://explorer.mainnet.near.org",
metapoolUrl: "https://metapool.app/dapp/mainnet/meta",
metavoteUrl: "https://metavote.app/",
metabondUrl: "https://metabondmarket.app/my-bonds"
};
case "development":
case "testnet":
case "preview":
return {
networkId: "testnet",
nodeUrl: "https://rpc.testnet.near.org",
contractName: CONTRACT_NAME,
walletUrl: "https://wallet.testnet.near.org",
helperUrl: "https://helper.testnet.near.org",
explorerUrl: "https://explorer.testnet.near.org",
metapoolUrl: "https://metapool.app/dapp/testnet/meta",
metavoteUrl: "https://meta-vote-git-dev-narwallets.vercel.app/",
metabondUrl: "https://test.metabondmarket.app/my-bonds"
};
case "betanet":
return {
networkId: "betanet",
nodeUrl: "https://rpc.betanet.near.org",
contractName: CONTRACT_NAME,
walletUrl: "https://wallet.betanet.near.org",
helperUrl: "https://helper.betanet.near.org",
explorerUrl: "https://explorer.betanet.near.org",
metapoolUrl: "https://metapool.app/dapp/testnet/meta",
metavoteUrl: "https://meta-vote-git-dev-narwallets.vercel.app/",
metabondUrl: "https://metabondmarket.app/my-bonds"
};
case "local":
return {
networkId: "local",
nodeUrl: "http://localhost:3030",
keyPath: `${process.env.HOME}/.near/validator_key.json`,
walletUrl: "http://localhost:4000/wallet",
metapoolUrl: "https://metapool.app/dapp/testnet/meta",
metavoteUrl: "https://meta-vote-git-dev-narwallets.vercel.app/",
metabondUrl: "https://test.metabondmarket.app/my-bonds",
contractName: CONTRACT_NAME,
};
case "test":
case "ci":
return {
networkId: "shared-test",
nodeUrl: "https://rpc.ci-testnet.near.org",
contractName: CONTRACT_NAME,
masterAccount: "test.near",
};
case "ci-betanet":
return {
networkId: "shared-test-staging",
nodeUrl: "https://rpc.ci-betanet.near.org",
contractName: CONTRACT_NAME,
masterAccount: "test.near",
};
default:
throw Error(
`Unconfigured environment '${env}'. Can be configured in src/config.js.`
);
}
};