File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
const fs = require ( "fs" ) ;
2
- const config = JSON . parse ( fs . readFileSync ( "./config.json" ) ) ;
2
+ let config = { } ;
3
+
4
+ if ( fs . existsSync ( "./config.json" ) ) {
5
+ config = JSON . parse ( fs . readFileSync ( "./config.json" ) ) ;
6
+ }
3
7
4
8
// global cache
5
9
const cache = {
@@ -43,7 +47,7 @@ const cache = {
43
47
sell : { success : 0 , fail : 0 } ,
44
48
} ,
45
49
ui : {
46
- defaultColor : config . ui . defaultColor ,
50
+ defaultColor : config ? .ui ? .defaultColor || "cyan" ,
47
51
showPerformanceOfRouteCompChart : false ,
48
52
showProfitChart : true ,
49
53
showTradeHistory : true ,
@@ -62,11 +66,11 @@ const cache = {
62
66
e : false ,
63
67
r : false ,
64
68
} ,
65
- tradingEnabled : config . tradingEnabled ,
69
+ tradingEnabled : config ? .tradingEnabled || false ,
66
70
swappingRightNow : false ,
67
71
fetchingResultsFromSolscan : false ,
68
72
fetchingResultsFromSolscanStart : 0 ,
69
- tradingStrategy : config . tradingStrategy ,
73
+ tradingStrategy : config ? .tradingStrategy || "arbitrage" ,
70
74
tradeHistory : [ ] ,
71
75
performanceOfTxStart : 0 ,
72
76
availableRoutes : {
You can’t perform that action at this time.
0 commit comments