cryptum 0.0.399 → 0.0.400
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/cryptum/event/pane.rb +10 -4
- data/lib/cryptum/log.rb +7 -6
- data/lib/cryptum/ui/matrix.rb +95 -99
- data/lib/cryptum/ui/order/execute.rb +1 -27
- data/lib/cryptum/ui/order/plan.rb +1 -42
- data/lib/cryptum/ui/signal_engine.rb +1 -10
- data/lib/cryptum/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d4ccaed7aa5df46e13b97e435ddbf04e77ceedc9e2f385057cd096ec2f8c8b0
|
4
|
+
data.tar.gz: d1466bb66ac26757deb64c453df732496467a9a5dd5192d9aeb2df5b6d6d56a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd733c6bb7b6a9800a7041ddc2ab0e90944903b4567d5beab5188a0a81eec6706441406e352e4c208e5479976f230fcd12b6f16ca66a7638235ea56df3cc328
|
7
|
+
data.tar.gz: 286bd79d23e28162b3cc43a385cf2601ff63e8bf3d2f9b18e22cb3b7c8347199b90368e3f1e3d22427c7296a7f631d130561d091c43d25616b228a0f1c16c8e5
|
data/Gemfile
CHANGED
@@ -11,7 +11,7 @@ gemspec
|
|
11
11
|
# In some circumstances custom flags are passed to gems in order
|
12
12
|
# to build appropriately. Defer to ./reinstall_coinbot_gemset.sh
|
13
13
|
# to review these custom flags
|
14
|
-
gem 'addressable', '2.8.
|
14
|
+
gem 'addressable', '2.8.3'
|
15
15
|
gem 'bundler', '>=2.4.10'
|
16
16
|
gem 'bundler-audit', '0.9.1'
|
17
17
|
gem 'curses', '1.4.4'
|
data/lib/cryptum/event/pane.rb
CHANGED
@@ -37,12 +37,18 @@ module Cryptum
|
|
37
37
|
|
38
38
|
if event_history.order_plan_win_active
|
39
39
|
unless event_history.red_pill
|
40
|
-
event_history.order_plan_details_win_active =
|
41
|
-
|
40
|
+
event_history.order_plan_details_win_active = if event_history.order_plan_details_win_active
|
41
|
+
false
|
42
|
+
else
|
43
|
+
true
|
44
|
+
end
|
42
45
|
end
|
43
46
|
elsif event_history.order_execute_win_active
|
44
|
-
event_history.order_execute_details_win_active =
|
45
|
-
|
47
|
+
event_history.order_execute_details_win_active = if event_history.order_execute_details_win_active
|
48
|
+
false
|
49
|
+
else
|
50
|
+
true
|
51
|
+
end
|
46
52
|
end
|
47
53
|
rescue Interrupt, StandardError => e
|
48
54
|
Cryptum::Log.append(level: :error, msg: e, which_self: self, event_history: event_history)
|
data/lib/cryptum/log.rb
CHANGED
@@ -33,11 +33,10 @@ module Cryptum
|
|
33
33
|
exit_gracefully = true
|
34
34
|
logger.level = Logger::ERROR
|
35
35
|
when :fatal
|
36
|
-
# This is reserved for
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
# to log to file and exit.
|
36
|
+
# This is reserved for the Cryptum::UI::Exit module
|
37
|
+
# if the Interrupt or StandardError exceptions are
|
38
|
+
# triggered. This prevents infintely attempting to
|
39
|
+
# exit if something in the module fails.
|
41
40
|
logger.level = Logger::FATAL
|
42
41
|
when :unknown
|
43
42
|
logger.level = Logger::UNKNOWN
|
@@ -46,7 +45,9 @@ module Cryptum
|
|
46
45
|
when :info
|
47
46
|
logger.level = Logger::INFO
|
48
47
|
else
|
49
|
-
|
48
|
+
level_error = "ERROR: Invalid log level. Valid options are:\n"
|
49
|
+
level_error += ":info\n:warn\n:unknown\n:fatal\n:error\n:debug"
|
50
|
+
raise level_error
|
50
51
|
end
|
51
52
|
|
52
53
|
logger.datetime_format = '%Y-%m-%d %H:%M:%S.%N'
|
data/lib/cryptum/ui/matrix.rb
CHANGED
@@ -16,101 +16,101 @@ module Cryptum
|
|
16
16
|
cols = opts[:cols].to_i
|
17
17
|
|
18
18
|
matrix_arr = [
|
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
|
-
|
19
|
+
"\u30a0",
|
20
|
+
"\u30a1",
|
21
|
+
"\u30a2",
|
22
|
+
"\u30a3",
|
23
|
+
"\u30a4",
|
24
|
+
"\u30a5",
|
25
|
+
"\u30a6",
|
26
|
+
"\u30a7",
|
27
|
+
"\u30a8",
|
28
|
+
"\u30a9",
|
29
|
+
"\u30aa",
|
30
|
+
"\u30ab",
|
31
|
+
"\u30ac",
|
32
|
+
"\u30ad",
|
33
|
+
"\u30ae",
|
34
|
+
"\u30af",
|
35
|
+
"\u30b0",
|
36
|
+
"\u30b1",
|
37
|
+
"\u30b2",
|
38
|
+
"\u30b3",
|
39
|
+
"\u30b4",
|
40
|
+
"\u30b5",
|
41
|
+
"\u30b6",
|
42
|
+
"\u30b7",
|
43
|
+
"\u30b8",
|
44
|
+
"\u30b9",
|
45
|
+
"\u30ba",
|
46
|
+
"\u30bb",
|
47
|
+
"\u30bc",
|
48
|
+
"\u30bd",
|
49
|
+
"\u30be",
|
50
|
+
"\u30bf",
|
51
|
+
"\u30c0",
|
52
|
+
"\u30c1",
|
53
|
+
"\u30c2",
|
54
|
+
"\u30c3",
|
55
|
+
"\u30c4",
|
56
|
+
"\u30c5",
|
57
|
+
"\u30c6",
|
58
|
+
"\u30c7",
|
59
|
+
"\u30c8",
|
60
|
+
"\u30c9",
|
61
|
+
"\u30ca",
|
62
|
+
"\u30cb",
|
63
|
+
"\u30cc",
|
64
|
+
"\u30cd",
|
65
|
+
"\u30ce",
|
66
|
+
"\u30cf",
|
67
|
+
"\u30d0",
|
68
|
+
"\u30d1",
|
69
|
+
"\u30d2",
|
70
|
+
"\u30d3",
|
71
|
+
"\u30d4",
|
72
|
+
"\u30d5",
|
73
|
+
"\u30d6",
|
74
|
+
"\u30d7",
|
75
|
+
"\u30d8",
|
76
|
+
"\u30d9",
|
77
|
+
"\u30da",
|
78
|
+
"\u30db",
|
79
|
+
"\u30dc",
|
80
|
+
"\u30dd",
|
81
|
+
"\u30de",
|
82
|
+
"\u30df",
|
83
|
+
"\u30e0",
|
84
|
+
"\u30e1",
|
85
|
+
"\u30e2",
|
86
|
+
"\u30e3",
|
87
|
+
"\u30e4",
|
88
|
+
"\u30e5",
|
89
|
+
"\u30e6",
|
90
|
+
"\u30e7",
|
91
|
+
"\u30e8",
|
92
|
+
"\u30e9",
|
93
|
+
"\u30ea",
|
94
|
+
"\u30eb",
|
95
|
+
"\u30ec",
|
96
|
+
"\u30ed",
|
97
|
+
"\u30ee",
|
98
|
+
"\u30ef",
|
99
|
+
"\u30f0",
|
100
|
+
"\u30f1",
|
101
|
+
"\u30f2",
|
102
|
+
"\u30f3",
|
103
|
+
"\u30f4",
|
104
|
+
"\u30f5",
|
105
|
+
"\u30f6",
|
106
|
+
"\u30f7",
|
107
|
+
"\u30f8",
|
108
|
+
"\u30f9",
|
109
|
+
"\u30fa",
|
110
|
+
"\u30fb",
|
111
|
+
"\u30fc",
|
112
|
+
"\u30fd",
|
113
|
+
"\u30fe",
|
114
114
|
'0 ',
|
115
115
|
'1 ',
|
116
116
|
'2 ',
|
@@ -159,15 +159,11 @@ module Cryptum
|
|
159
159
|
', '
|
160
160
|
]
|
161
161
|
|
162
|
-
# last_index = matrix_arr.length - 1
|
163
|
-
|
164
162
|
matrix_row = ''
|
165
163
|
most_cols = cols - 1
|
166
164
|
most_cols.times.each do
|
167
|
-
# matrix_row += "#{matrix_arr[Random.rand(0..last_index)]} "
|
168
165
|
matrix_row += "#{matrix_arr.sample} "
|
169
166
|
end
|
170
|
-
# matrix_row += matrix_arr[Random.rand(0..last_index)]
|
171
167
|
matrix_row += matrix_arr.sample
|
172
168
|
rescue Interrupt, StandardError => e
|
173
169
|
Cryptum::Log.append(level: :error, msg: e, which_self: self)
|
@@ -330,8 +330,7 @@ module Cryptum
|
|
330
330
|
# TODO: Everything Above this Line Needs to be Indicators ^
|
331
331
|
|
332
332
|
# UI
|
333
|
-
col_just1 =
|
334
|
-
col_just4 = Curses.cols - Cryptum::UI.col_fourth
|
333
|
+
col_just1 = Curses.cols - Cryptum::UI.col_first
|
335
334
|
|
336
335
|
# ROW 1
|
337
336
|
out_line_no = 0
|
@@ -375,15 +374,6 @@ module Cryptum
|
|
375
374
|
string: header_str
|
376
375
|
)
|
377
376
|
|
378
|
-
order_execute_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
379
|
-
order_execute_win.clrtoeol
|
380
|
-
Cryptum::UI.colorize(
|
381
|
-
ui_win: order_execute_win,
|
382
|
-
color: header_color,
|
383
|
-
style: header_style,
|
384
|
-
string: ''.ljust(col_just4, ' ')
|
385
|
-
)
|
386
|
-
|
387
377
|
# ROWS 3-10
|
388
378
|
remaining_blank_rows = 0
|
389
379
|
remaining_blank_rows = max_rows_to_display if order_history_meta.empty?
|
@@ -453,13 +443,6 @@ module Cryptum
|
|
453
443
|
style: style,
|
454
444
|
string: order_exec_ln.ljust(col_just1, '.')
|
455
445
|
)
|
456
|
-
|
457
|
-
Cryptum::UI.colorize(
|
458
|
-
ui_win: order_execute_win,
|
459
|
-
color: meta[:color],
|
460
|
-
style: style,
|
461
|
-
string: ''.ljust(col_just4, ' ')
|
462
|
-
)
|
463
446
|
end
|
464
447
|
event_history.order_execute_selected_data = selected_order
|
465
448
|
end
|
@@ -510,15 +493,6 @@ module Cryptum
|
|
510
493
|
string: header_str
|
511
494
|
)
|
512
495
|
|
513
|
-
# order_execute_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
514
|
-
# order_execute_win.clrtoeol
|
515
|
-
# Cryptum::UI.colorize(
|
516
|
-
# ui_win: order_execute_win,
|
517
|
-
# color: header_color,
|
518
|
-
# style: header_style,
|
519
|
-
# string: ''.ljust(col_just4, ' ')
|
520
|
-
# )
|
521
|
-
|
522
496
|
# ROW 11
|
523
497
|
out_line_no += 1
|
524
498
|
Cryptum::UI.line(
|
@@ -189,7 +189,6 @@ module Cryptum
|
|
189
189
|
|
190
190
|
if event_history.red_pill
|
191
191
|
order_plan_prefix = '--'
|
192
|
-
# max_order_plan_slices = '0'
|
193
192
|
order_plan_volume_out = '0.00'
|
194
193
|
order_plan_profit_sum_out = '0.00'
|
195
194
|
order_plan_exec_percent = '0.00'
|
@@ -224,8 +223,7 @@ module Cryptum
|
|
224
223
|
# TODO: Everything Above this Line Needs to be Indicators ^
|
225
224
|
|
226
225
|
# UI
|
227
|
-
col_just1 =
|
228
|
-
col_just4 = Curses.cols - Cryptum::UI.col_fourth
|
226
|
+
col_just1 = Curses.cols - Cryptum::UI.col_first
|
229
227
|
|
230
228
|
# ROW 1
|
231
229
|
out_line_no = 0
|
@@ -270,14 +268,6 @@ module Cryptum
|
|
270
268
|
string: header_str
|
271
269
|
)
|
272
270
|
|
273
|
-
order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
274
|
-
Cryptum::UI.colorize(
|
275
|
-
ui_win: order_plan_win,
|
276
|
-
color: header_color,
|
277
|
-
style: header_style,
|
278
|
-
string: ''.ljust(col_just4, ' ')
|
279
|
-
)
|
280
|
-
|
281
271
|
# ROWS 3-10
|
282
272
|
remaining_blank_rows = 0
|
283
273
|
max_rows_to_display = event_history.order_plan_max_rows_to_display
|
@@ -305,14 +295,6 @@ module Cryptum
|
|
305
295
|
string: red_pill_alert
|
306
296
|
)
|
307
297
|
|
308
|
-
order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
309
|
-
Cryptum::UI.colorize(
|
310
|
-
ui_win: order_plan_win,
|
311
|
-
color: :red,
|
312
|
-
style: :highlight,
|
313
|
-
string: ''.ljust(col_just4, ' ')
|
314
|
-
)
|
315
|
-
|
316
298
|
out_line_no += 1
|
317
299
|
order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
|
318
300
|
order_plan_win.clrtoeol
|
@@ -334,13 +316,6 @@ module Cryptum
|
|
334
316
|
string: red_pill_msg
|
335
317
|
)
|
336
318
|
|
337
|
-
order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
338
|
-
Cryptum::UI.colorize(
|
339
|
-
ui_win: order_plan_win,
|
340
|
-
color: :yellow,
|
341
|
-
string: ''.ljust(col_just4, ' ')
|
342
|
-
)
|
343
|
-
|
344
319
|
max_rows_to_display.times.each do
|
345
320
|
out_line_no += 1
|
346
321
|
this_matrix_row = Cryptum::UI::Matrix.generate(cols: Curses.cols)
|
@@ -425,13 +400,6 @@ module Cryptum
|
|
425
400
|
style: style,
|
426
401
|
string: "#{order_plan_invest}#{order_plan_return}".ljust(col_just1, '.')
|
427
402
|
)
|
428
|
-
|
429
|
-
Cryptum::UI.colorize(
|
430
|
-
ui_win: order_plan_win,
|
431
|
-
color: plan_color,
|
432
|
-
style: style,
|
433
|
-
string: ''.ljust(col_just4, ' ')
|
434
|
-
)
|
435
403
|
end
|
436
404
|
event_history.order_plan_selected_data = selected_order
|
437
405
|
|
@@ -479,15 +447,6 @@ module Cryptum
|
|
479
447
|
style: header_style,
|
480
448
|
string: header_str
|
481
449
|
)
|
482
|
-
|
483
|
-
# order_plan_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
484
|
-
# order_plan_win.clrtoeol
|
485
|
-
# Cryptum::UI.colorize(
|
486
|
-
# ui_win: order_plan_win,
|
487
|
-
# color: header_color,
|
488
|
-
# style: header_style,
|
489
|
-
# string: ''.ljust(col_just4, ' ')
|
490
|
-
# )
|
491
450
|
end
|
492
451
|
|
493
452
|
# ROW 11
|
@@ -40,8 +40,7 @@ module Cryptum
|
|
40
40
|
# TODO: Everything Above this Line Needs to be Indicators ^
|
41
41
|
|
42
42
|
# UI
|
43
|
-
col_just1 =
|
44
|
-
col_just4 = Curses.cols - Cryptum::UI.col_fourth
|
43
|
+
col_just1 = Curses.cols - Cryptum::UI.col_first
|
45
44
|
|
46
45
|
# ROW 1
|
47
46
|
out_line_no = 0
|
@@ -74,14 +73,6 @@ module Cryptum
|
|
74
73
|
string: action_signal_out
|
75
74
|
)
|
76
75
|
|
77
|
-
signal_engine_win.setpos(out_line_no, Cryptum::UI.col_fourth)
|
78
|
-
Cryptum::UI.colorize(
|
79
|
-
ui_win: signal_engine_win,
|
80
|
-
color: signal_color,
|
81
|
-
style: :reverse,
|
82
|
-
string: ''.ljust(col_just4, ' ')
|
83
|
-
)
|
84
|
-
|
85
76
|
signal_engine_win.refresh
|
86
77
|
|
87
78
|
indicator_status.action_signal = action_signal
|
data/lib/cryptum/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.400
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.8.
|
19
|
+
version: 2.8.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.8.
|
26
|
+
version: 2.8.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|