cryptum 0.0.270 → 0.0.271

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f112246033a05eecb95d6b71d0ce96e7206d9aaef1cf7b675ddd453baafd8de
4
- data.tar.gz: 399946d0c1100458ef8adcf300c190271af2cd936181c5f259153310c52e1eff
3
+ metadata.gz: a2a99684100eded0f7b6ca6e94cd2b7afa4f1a46f4d173fcf8f6d23929f412ed
4
+ data.tar.gz: d01f3f8a7de3c65f295785f5fb38d781e0e3f2c4694eb8fe90e9a9e792442bf7
5
5
  SHA512:
6
- metadata.gz: d6d3a544bcbca635371547cf272a051f24585c0d8530f7356c5c466fb5202ca2c03cd75fde6ca42baafd410fd03c1ebc6f315e4666942cab00769e5982f568e9
7
- data.tar.gz: af57efd0263bb5ead63ddb9a8e5b5c9e289d234a71183a727ee56f10cbb2139df62df7858335379f487208dd7a5d8a5f8d0d5b1b345d9efc2ce73b6d07550b72
6
+ metadata.gz: 3323a2fd4c747bb7daf655eff588ab7bf2e5010eb9cc707e1f44157f62b328a9ee3866beb4785e1423eae08ff82adb8dfb0771c3fc733ce6f3baf775948d4e12
7
+ data.tar.gz: c6de579395b53f951f12ef615aca7540b647d7d13a5bab05a27115ec88c8636a47b13df6e44edce7b8fd908ab81e889aeee6611e32529df9d0f2a8cbcebc0826
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-12-05 22:19:37 UTC using RuboCop version 1.39.0.
3
+ # on 2022-12-05 23:34:03 UTC using RuboCop version 1.39.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -127,7 +127,7 @@ Metrics/ModuleLength:
127
127
  Metrics/PerceivedComplexity:
128
128
  Max: 76
129
129
 
130
- # Offense count: 3
130
+ # Offense count: 4
131
131
  # This cop supports safe autocorrection (--autocorrect).
132
132
  # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
133
133
  # SupportedStyles: assign_to_condition, assign_inside_condition
@@ -135,6 +135,7 @@ Style/ConditionalAssignment:
135
135
  Exclude:
136
136
  - 'lib/cryptum/event/pane.rb'
137
137
  - 'lib/cryptum/option.rb'
138
+ - 'lib/cryptum/ui/order_execute_details.rb'
138
139
 
139
140
  # Offense count: 1
140
141
  # Configuration parameters: AllowedConstants.
@@ -217,9 +218,9 @@ Style/TrailingCommaInArrayLiteral:
217
218
  Exclude:
218
219
  - 'lib/cryptum/matrix.rb'
219
220
 
220
- # Offense count: 21
221
+ # Offense count: 22
221
222
  # This cop supports safe autocorrection (--autocorrect).
222
223
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
223
224
  # URISchemes: http, https
224
225
  Layout/LineLength:
225
- Max: 221
226
+ Max: 216
@@ -21,7 +21,56 @@ module Cryptum
21
21
  order = event_history.order_execute_selected_data
22
22
  tpm = order[:tpm]
23
23
  autotrade_percent = order[:autotrade_percent]
24
- order_color = order[:color]
24
+ order_color = order[:color].to_sym
25
+
26
+ order_plan_no = order[:plan_no]
27
+ case order_color
28
+ when :cyan, :red
29
+ order_id = order[:buy_order_id]
30
+ order_type = 'Buy'
31
+ when :green, :magenta, :yellow
32
+ order_id = order[:sell_order_id]
33
+ order_type = 'Sell'
34
+ when :black
35
+ order_id = 'Expired'
36
+ order_type = 'Expired'
37
+ else
38
+ order_id = 'N/A'
39
+ order_type = 'N/A'
40
+ end
41
+
42
+ risk_alloc_out = Cryptum.beautify_large_number(
43
+ value: order[:risk_alloc]
44
+ )
45
+ invest_out = Cryptum.beautify_large_number(
46
+ value: order[:invest]
47
+ )
48
+ price_out = Cryptum.beautify_large_number(
49
+ value: order[:price]
50
+ )
51
+ size_out = Cryptum.beautify_large_number(
52
+ value: order[:size]
53
+ )
54
+ target_price_out = Cryptum.beautify_large_number(
55
+ value: order[:target_price]
56
+ )
57
+ profit_out = Cryptum.beautify_large_number(
58
+ value: order[:profit]
59
+ )
60
+ plan_no = "#{order[:plan_no]}|"
61
+
62
+ created_at = order[:created_at]
63
+
64
+ invest = "$#{invest_out} @ "
65
+ tick = "$#{price_out} = "
66
+ size = "*#{size_out} + "
67
+ tpm_out = "#{order[:tpm]}% = "
68
+ targ_tick = "$#{target_price_out}"
69
+ profit = "|Profit: $#{order[:profit]}"
70
+
71
+ order_id_details = "#{order_type} Order ID: #{order_id}"
72
+ order_plan_details = "Order Slice #: #{order_plan_no}"
73
+ order_exec_ln = "Details: #{created_at}|#{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
25
74
 
26
75
  # UI
27
76
  col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
@@ -71,42 +120,35 @@ module Cryptum
71
120
  order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
72
121
  order_execute_details_win.clrtoeol
73
122
 
74
- risk_alloc_out = Cryptum.beautify_large_number(
75
- value: order[:risk_alloc]
76
- )
77
- invest_out = Cryptum.beautify_large_number(
78
- value: order[:invest]
79
- )
80
- price_out = Cryptum.beautify_large_number(
81
- value: order[:price]
82
- )
83
- size_out = Cryptum.beautify_large_number(
84
- value: order[:size]
85
- )
86
- target_price_out = Cryptum.beautify_large_number(
87
- value: order[:target_price]
88
- )
89
- profit_out = Cryptum.beautify_large_number(
90
- value: order[:profit]
123
+ Cryptum::UI.colorize(
124
+ ui_win: order_execute_details_win,
125
+ color: order_color,
126
+ style: style,
127
+ string: order_id_details.ljust(col_just1, ' ')
91
128
  )
92
- plan_no = "#{order[:plan_no]}|"
93
129
 
94
- created_at = order[:created_at]
130
+ # ROW 5
131
+ out_line_no += 1
132
+ order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
133
+ order_execute_details_win.clrtoeol
95
134
 
96
- invest = "$#{invest_out} @ "
97
- tick = "$#{price_out} = "
98
- size = "*#{size_out} + "
99
- tpm_out = "#{order[:tpm]}% = "
100
- targ_tick = "$#{target_price_out}"
101
- profit = "|Profit: $#{order[:profit]}"
135
+ Cryptum::UI.colorize(
136
+ ui_win: order_execute_details_win,
137
+ color: order_color,
138
+ style: style,
139
+ string: order_plan_details.ljust(col_just1, ' ')
140
+ )
102
141
 
103
- order_exec_ln = "#{created_at}|#{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
142
+ # ROW 4
143
+ out_line_no += 1
144
+ order_execute_details_win.setpos(out_line_no, Cryptum::UI.col_first)
145
+ order_execute_details_win.clrtoeol
104
146
 
105
147
  Cryptum::UI.colorize(
106
148
  ui_win: order_execute_details_win,
107
149
  color: order_color,
108
150
  style: style,
109
- string: order_exec_ln.ljust(col_just1, '.')
151
+ string: order_exec_ln.ljust(col_just1, ' ')
110
152
  )
111
153
 
112
154
  # Clear to OK ROW
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.270'
4
+ VERSION = '0.0.271'
5
5
  end
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.270
4
+ version: 0.0.271
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.