-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.js
350 lines (267 loc) · 12.2 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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
// Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: Mike@DragonFrugal.com (leave this copyright / attribution intact in ALL forks / copies!)
var exchange_markets = []; // LEAVE ALONE, AND DON'T DELETE (REQUIRED!!)
///////////////////////////////////////////
// START config
///////////////////////////////////////////
// TYPOS LIKE MISSED SEMICOLONS / MISSED QUOTES / ETC WILL BREAK THE APP, BE CAREFUL EDITING THIS CONFIG FILE!
// ############## PER-EXCHANGE FORMATTING EXAMPLES ##########################
////
// YOU CAN RE-ORDER THE EXCHANGES IN THE CONFIG, TO RE-ORDER WHICH EXCHANGE'S MARKET'S SHOW FIRST
////
// Which crypto asset(s) to display on the ticker
// SEPERATE MULTIPLE EXCHANGE'S MARKETS with the pipe | symbol to "slideshow" between multiple tickers on the same exchange
////
// Bitfinex formatting example (MULTIPLE TICKERS NOT SUPPORTED): 'BTCEUR', OR 'PLANETS:UST' #FOR OVER 4 CHARACTER SYMBOLS#
// COINGECKO NOTES: 'API_ID_HERE:ASSET/PAIR' ('API id' is on the asset's coingecko page, in the 'Info' section)
// CoinGecko formatting example: 'bitcoin:btc/usd|bitcoin:btc/eur|bitcoin:btc/chf|grape-2:grape/usd|raydium:ray/btc'
// Coinbase formatting example: 'BTC-USD|BTC-GBP|ETH-USD|ETH-BTC|ETH-EUR|MKR-USD|MKR-BTC|MANA-USDC'
// Kraken formatting example: 'XBT/USD|XBT/CAD|XBT/EUR|ETH/USD|ETH/EUR|ETH/CAD'
// Bitstamp formatting example (MULTIPLE TICKERS NOT SUPPORTED): 'btcgbp'
// Binance formatting example: 'btcusdt|ethusdt|ethbtc|mkrusdt'
// Kucoin formatting example: 'MANA-USDT|ENJ-BTC'
// Okex formatting example: 'ENJ-USDT|ENJ-BTC'
// Hitbtc formatting example (MULTIPLE TICKERS NOT SUPPORTED): 'ETHBTC'
// Gate.io formatting example: 'MANA_USDT|SAMO_USDT'
////
////
// Bitstamp markets (set to '' to disable)
// !!BITSTAMP WEBSOCKET API ONLY SUPPORTS ONE ASSET!!
exchange_markets['bitstamp'] = '';
////
////
// Bitfinex markets (set to '' to disable)
// !!BITFINEX WEBSOCKET API ONLY SUPPORTS ONE ASSET!!
exchange_markets['bitfinex'] = 'BTCUSD';
////
////
// Coinbase markets (set to '' to disable)
exchange_markets['coinbase'] = 'ETH-USD|SOL-USD';
////
////
// Binance markets (set to '' to disable)
// !!MAY BE #BLOCKED# IN YOUR JURISDICTION!!
exchange_markets['binance'] = '';
////
////
// OKex markets (set to '' to disable)
exchange_markets['okex'] = '';
////
////
// HitBTC markets (set to '' to disable)
// !!HITBTC WEBSOCKET API ONLY SUPPORTS ONE ASSET!!
exchange_markets['hitbtc'] = '';
////
////
// Gateio markets (set to '' to disable)
exchange_markets['gateio'] = 'ZEUS_USDT|RNDR_USDT|DAI_USDT';
////
////
// Kucoin markets (set to '' to disable)
// !!KUCOIN REQUIRES USING THE INSTALL SCRIPT!!
exchange_markets['kucoin'] = 'MKR-USDT|NEON-USDT|WEN-USDT';
////
////
// Kraken markets (set to '' to disable)
exchange_markets['kraken'] = 'JUP/USD|ATLAS/USD|POLIS/USD|MANA/USD';
////
////
// Coingecko markets (set to '' to disable)
// USE COINGECKO'S API ID FOR EACH ASSET! (SEE COINGECKO ASSET PAGE'S INFO SECTION)
// PAIRING ASSET MUST BE SUPPORTED BY COINGECKO'S 'vs_currencies' API PARAMETER!
// FORMAT IS 'api-id-here:symbol/pairing'
exchange_markets['coingecko'] = 'immutable-x:imx/usd|genesysgo-shadow:shdw/usd|bonk:bonk/usd';
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// I M P O R T A N T S E T U P I N F O R M A T I O N !!!!!!!!!!!!!!!!!!!!
// Run COMMAND "~/ticker-restart" (WITHOUT QUOTES) TO SHOW UPDATED SETUP!!!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Screen orientation (offset in degrees)
var orient_screen = 180; // Normal (upright) = 0, Flipped (upside down) = 180, Sideways (left or right) = 90 or 270
// Vertical position (adjusts the ticker's vertical position up/down)
// CAN BE NEGATIVE, TO GO THE OPPOSITE WAY
var vertical_position = 150; // Default = 37 (SMALL SCREEN), 75 (MEDIUM SCREEN), 150 (LARGE SCREEN)
// Horizontal position (adjusts the ticker's horizontal position left/right)
// CAN BE NEGATIVE, TO GO THE OPPOSITE WAY
var horizontal_position = 0; // Default = 10 (SMALL SCREEN), 0 (MEDIUM/LARGE SCREEN)
// Show exchange name in title (next to asset ticker symbol)
var show_exchange_name = 'on'; // 'on' / 'off', Default = 'on'
// Show volume section EVEN IF NO VOLUME WAS PROVIDED
var show_empty_volume = 'on'; // 'off' / 'on', Default = 'on'
// Show system temperature / memory stats (TOP LEFT corner of app screen, if device temps / RAM useage are available)
var show_system_data = 'on'; // 'on' / 'off', Default = 'on'
////
// System data font size
var system_data_size = 3.00; // Default = 3.00 (#CAN# BE DECIMALS HERE, AS WERE USING THE CSS vw STANDARD)
////
// Brightness of system data text (allows toning down vibrancy, so it 'pops out' less than ticker price data)
// (also ajusts upgrade alert data section on TOP RIGHT to match [if an upgrade is available])
var system_data_opacity = 0.70; // Default = 0.70 (#CAN# BE DECIMALS HERE, WITH HIGHEST VALUE OF 1.00 [is 100% opacity])
// Title font size
var title_size = 200; // Default = 50 (SMALL SCREEN), 100 (MEDIUM SCREEN), 200 (LARGE SCREEN)
// 24 hour volume font size
var volume_size = 150; // Default = 38 (SMALL SCREEN), 75 (MEDIUM SCREEN), 150 (LARGE SCREEN)
// Ticker font size
var ticker_size = 300; // Default = 75 (SMALL SCREEN), 150 (MEDIUM SCREEN), 300 (LARGE SCREEN)
// Ticker arrow size RATIO (to ticker size), DECIMAL NUMBER FORMAT X.XX OF 1.00 OR LESS
// THIS #ALREADY AUTO-RESIZES# BASED ON THE TICKER SIZE, SO YOU USUALLY CAN LEAVE THIS
// #AS-IS#, UNLESS YOU WANT THE RATIO TO TICKER SIZE DIFFERENT!
var arrow_size = 0.65; // Default = 0.65 (same height as ticker price text)
////
// Spacing between ticker arrow, and ticker price text
var arrow_spacing = 20; // Default = 10 (SMALL SCREEN), 20 (MEDIUM SCREEN), 40 (LARGE SCREEN)
// Maximum decimal places for ticker values worth under 1.00 in unit value, for prettier / less-cluttered interface
var ticker_max_decimals = 6; // Default = 6
// Minimum decimal places for ANY ticker values,
// EXCEPT FOR FIAT UNIT VALUES UNDER 100 (which are forced to 2 decimals minimum, UNLESS THIS VALUE IS 2 OR HIGHER)
// 0 disables
var ticker_min_decimals = 0; // Default = 0
// PRICE PERCENTAGE to round off ticker price IN DECIMALS (DYNAMIC / RELATIVE to price amount)
// (FINE-GRAINED CONTROL OVER TICKER PRICE ROUNDING #AMOUNT OF DECIMALS SHOWN#)
// (interface examples: one = 1000, tenth = 1000, hundredth = 1000.9, thousandth = 1000.09)
// (interface examples: one = 100, tenth = 100.9, hundredth = 100.09, thousandth = 100.009)
// (interface examples: one = 10.9, tenth = 10.09, hundredth = 10.009, thousandth = 10.0009)
// #FIAT# CURRENCY VALUES UNDER 100 #ARE FORCED TO 2 DECIMALS MINUMUM#, UNLESS USING 'thousandth'
// #ALWAYS# OVERIDDEN BY ticker_min_decimals!
var ticker_round_percent = 'tenth'; // (OF A PERCENT) 'one', 'tenth', 'hundredth', 'thousandth'
////
// FORCE a FIXED MINIMUM amount of decimals on ticker price, CALCULATED OFF ABOVE ticker_round_percent SETTING
// (ALWAYS SAME AMOUNT OF DECIMALS, #EVEN IF IT INCLUDES TRAILING ZEROS#)
// #ALWAYS# OVERIDDEN BY ticker_min_decimals!
var ticker_round_fixed_decimals = 'on'; // 'off', 'on'
// EMULATED / dynamic monospace font WIDTH spacing (percent of EACH font size as a decimal)
// (ALL font widths for ticker/volume numbers are emulated as monospace, so numbers don't "jump around" when changing in real-time)
// DECIMAL NUMBER FORMAT X.XX OF 1.00 OR LESS, OR null to skip (null MUST BE LOWERCASE WITHOUT QUOTES)
var monospace_width = 0.65; // Default = 0.65
// ALL font weights (for ALL ticker text)
var font_weight = 'normal'; // Default = 'normal', can be any proper CSS font weight value
// Text color (https://www.w3schools.com/colors/colors_picker.asp)
// '#colorcode'
var text_color = '#c6c6c6'; // Default = '#c6c6c6'
// Background color (https://www.w3schools.com/colors/colors_picker.asp)
// '#colorcode'
var background_color = '#000000'; // Default = '#000000'
// Use a google font...set as null for default system serif font
// Runs the ticker in ANY google font found at: https://fonts.google.com
// 'fontname' IN QUOTES for ANY google font, OR null to skip (null MUST BE LOWERCASE WITHOUT QUOTES)
var google_font = 'Varela Round'; // Default = 'Varela Round'
// MINUTES before refreshing non-websocket trading exchange API endpoints (coingecko)
// #DON'T ADJUST TOO LOW#, OR NON-WEBSOCKET APIs LIKE COINGECKO MAY DROP YOUR CONNECTION!
var rest_api_refresh = 5; // Default = 5
// SECONDS between "slideshowing" multiple tickers (if multiple assets configured)
// SET TO 0 FOR AUTO MODE (trys to show all tickers in 1 minute, BUT has a 5 second per-ticker MINIMUM)
var slideshow_speed = 9; // Default = 9
// Slideshow transition speed (fade out / fade in) IN SECONDS (can be decimals)
var transition_speed = 0.70; // Default = 0.70
// SECONDS to wait before reloading app after internet outages
// #DON'T ADJUST TOO LOW#, OR DEVICE'S INTERNET MAY NOT BE #FULLY / STABALY# BACK ONLINE YET!
var app_reload_wait = 60; // Default = 60
// Minimum number of MINUTES to wait before auto-reloading the app IF ERRORS ARE DETECTED THAT MAY BE FIXED WITH A RELOAD
// (#NOT# USED FOR DROPPED API CONNECTIONS, SINCE WE AUTO-RECONNECT WITHOUT RELOADING EVERYTHING, but this is very helpful
// if the kucoin API token expires / any other javascript app cache variables need to be reloaded with new values)
var auto_error_fix_min = 5; // Default = 5
// HOURS before re-checking for any newly-released upgrades (at github)
// #KEEP LOW#, AS THIS APP MAY RELOAD ITSELF DAILY IF IT DETECTS API / INTERNET ISSUES,
// IN WHICH CASE #THE CHECK INTERVAL START TIME IS RESET#
var upgrade_api_refresh = 1; // Default = 1
////
// Enable / disable upgrade check / notice (TOP RIGHT corner of app screen, when an newer version is available for download)
// (Checks latest release version via github.com API endpoint value "tag_name"
// @ https://api.github.com/repos/taoteh1221/Slideshow_Crypto_Ticker/releases/latest)
var upgrade_notice = 'on'; // 'on' / 'off', Default = 'on'
// DEBUG MODE (turns on console logging for certain logic)
var debug_mode = 'off'; // 'on' / 'off', Default = 'off'
// All #ACTIVATED# market pairings (what the asset is paired with in markets), AND their currency symbols
// ADD ANY NEW SUPPORTED (CHECK WITH THE EXCHANGE) MARKET PAIRINGS HERE YOU WANT #ACTIVATED# IN THIS APP
// Crypto market pairings (KEYS #MUST BE# UPPERCASE)
var crypto_pairings = {
'BNB': 'Ⓑ ',
'BTC': 'Ƀ ',
'ETH': 'Ξ ',
'KCS': 'Ḵ ',
'XBT': 'Ƀ ',
};
// Fiat-equivelent market pairings (KEYS #MUST BE# UPPERCASE)
var fiat_pairings = {
'AED': 'د.إ',
'ARS': 'ARS$',
'AUD': 'A$',
'BAM': 'KM ',
'BDT': '৳',
'BOB': 'Bs ',
'BRL': 'R$',
'BWP': 'P ',
'BYN': 'Br ',
'CAD': 'C$',
'CHF': 'CHf ',
'CLP': 'CLP$',
'CNY': 'C¥',
'COP': 'Col$',
'CRC': '₡',
'CZK': 'Kč ',
'DAI': '◈ ',
'DKK': 'Kr. ',
'DOP': 'RD$',
'EGP': 'ج.م',
'EUR': '€',
'GBP': '£',
'GEL': 'ლ',
'GHS': 'GH₵',
'GTQ': 'Q ',
'HKD': 'HK$',
'HUF': 'Ft ',
'IDR': 'Rp ',
'ILS': '₪',
'INR': '₹',
'IRR': '﷼',
'JMD': 'JA$',
'JOD': 'د.ا',
'JPY': 'J¥',
'KES': 'Ksh ',
'KRW': '₩',
'KWD': 'د.ك',
'KZT': '₸',
'LKR': 'රු, ரூ',
'MAD': 'د.م.',
'MUR': '₨ ',
'MWK': 'MK ',
'MXN': 'Mex$',
'MYR': 'RM ',
'NGN': '₦',
'NIS': '₪',
'NOK': 'kr ',
'NZD': 'NZ$',
'PAB': 'B/. ',
'PEN': 'S/ ',
'PHP': '₱',
'PKR': '₨ ',
'PLN': 'zł ',
'PYG': '₲',
'QAR': 'ر.ق',
'RON': 'lei ',
'RSD': 'din ',
'RUB': '₽',
'RQF': 'R₣ ',
'SAR': '﷼',
'SEK': 'kr ',
'SGD': 'S$',
'THB': '฿',
'TRY': '₺',
'TUSD': 'Ⓢ ',
'TWD': 'NT$',
'TZS': 'TSh ',
'UAH': '₴',
'UGX': 'USh ',
'USD': '$',
'USDC': 'Ⓢ ',
'USDT': '₮ ',
'UST': 'Ⓢ ',
'UYU': '$U ',
'VND': '₫',
'VES': 'Bs ',
'XAF': 'FCFA ',
'XOF': 'CFA ',
'ZAR': 'R ',
'ZMW': 'ZK ',
};
///////////////////////////////////////////
// END config
///////////////////////////////////////////