File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11const 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+ }
37
48// global cache
59const cache = {
@@ -43,7 +47,7 @@ const cache = {
4347 sell : { success : 0 , fail : 0 } ,
4448 } ,
4549 ui : {
46- defaultColor : config . ui . defaultColor ,
50+ defaultColor : config ? .ui ? .defaultColor || "cyan" ,
4751 showPerformanceOfRouteCompChart : false ,
4852 showProfitChart : true ,
4953 showTradeHistory : true ,
@@ -62,11 +66,11 @@ const cache = {
6266 e : false ,
6367 r : false ,
6468 } ,
65- tradingEnabled : config . tradingEnabled ,
69+ tradingEnabled : config ? .tradingEnabled || false ,
6670 swappingRightNow : false ,
6771 fetchingResultsFromSolscan : false ,
6872 fetchingResultsFromSolscanStart : 0 ,
69- tradingStrategy : config . tradingStrategy ,
73+ tradingStrategy : config ? .tradingStrategy || "arbitrage" ,
7074 tradeHistory : [ ] ,
7175 performanceOfTxStart : 0 ,
7276 availableRoutes : {
You can’t perform that action at this time.
0 commit comments