cryptum 0.0.273 → 0.0.274

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: 448c1b3f990829ef87c5adc398ddcaea4b46c62acee1723785bf79572c6d2b89
4
- data.tar.gz: 76fdd8d8e3258291eb3644417d9094a926cfa425c126ff7b3a2f7bb37d7fb31b
3
+ metadata.gz: 456e40a2bee690096338d88ddc7add455131802b7b272d799ac626f8e616d6e3
4
+ data.tar.gz: a7e8ab91160b716cdc4f210ec90682cb37114fa408b7e5885dfd8a5c29e9d8c3
5
5
  SHA512:
6
- metadata.gz: 92418c47f83fe60acf22473eff5d72516e41d903f03f4484b6e67943287102758d24a1c08299f8a832136658a48876efdbc293b03adb323c10d2dcec0d2c4eed
7
- data.tar.gz: 6150d6bdf97804e728a707cbdb06a93f174fae0da0f18a7883a0abbded5a6ba615377eff28dc68ace6004406a2867282b70dc3b1bdc641acd90cc6d0788fde3e
6
+ metadata.gz: a12cd5a525df52d7a401b862ad784a723526ab180330a43120a8db4707d97f7eff0bf01ea02d6b46945e0d5a0967d15196a16e99a837729da0e5a5fd056757a6
7
+ data.tar.gz: c9ad2167536a5d44878d1b293d59da200ee6b7620da04d21a7ad8ae05275effd458a8a090a06d2823d12144bee86d0eff8ba300ba9601b0316b4638276d69fd4
@@ -41,33 +41,59 @@ module Cryptum
41
41
  order if order[:id] == order_id
42
42
  end
43
43
 
44
+ if order_history_arr.empty? && order_color == :yellow
45
+ order_id = order_meta_data[:buy_order_id]
46
+ order_meta_data[:color] = :cyan
47
+ order_meta_data[:sell_order_id] = nil
48
+ order_history_arr = event_history.order_book[:order_history].select do |order|
49
+ order if order[:id] == order_id
50
+ end
51
+ end
52
+
44
53
  order_type_ln = '- Type: N/A'
45
54
  order_status_ln = '- Status: N/A'
46
- order_hist_created_ln = '- Creation Date: N/A'
47
- order_hist_finished_ln = '- Finished Date: N/A'
55
+ fill_fees = 'N/A'
56
+ fill_size = 'N/A'
57
+ executed_value = 'N/A'
58
+ market_type = 'N/A'
59
+ settled = 'N/A'
48
60
  if order_history_arr.any?
49
61
  order_history = order_history_arr.first
50
62
  order_type = order_history[:type].capitalize
51
63
  time_in_force = order_history[:time_in_force].upcase
52
64
  order_status = order_history[:status].upcase
53
65
  created_at = order_history[:created_at]
54
- order_hist_created_ln = "- Creation Date: #{created_at}"
66
+ fill_fees = order_history[:fill_fees]
67
+ fill_size = order_history[:filled_size]
68
+ executed_value = order_history[:executed_value]
69
+ market_type = order_history[:market_type]
70
+ settled = order_history[:settled]
55
71
 
56
72
  order_side = order_history[:side].capitalize
57
73
  case order_side.to_sym
58
74
  when :Buy
59
75
  expire_time = order_history[:expire_time]
60
76
  done_at = order_history[:done_at]
61
- order_hist_finished_ln = "- Expiring Date: #{expire_time}"
77
+ order_meta_data[:color] = :cyan if done_at
62
78
  when :Sell
63
79
  done_at = order_history[:done_at]
64
80
  end
65
- order_hist_finished_ln = "- Finished Date: #{done_at}" if done_at
66
81
 
67
82
  order_type_ln = "- Type: #{order_type} #{order_side} #{time_in_force}"
83
+ order_type_ln = "- Type: #{order_type} #{order_side} #{time_in_force} 1m" if time_in_force == 'GTT'
68
84
  order_status_ln = "- Status: #{order_status}"
69
85
  end
70
86
 
87
+ if created_at && (!expire_time || !done_at)
88
+ order_hist_created_finished_ln = "- Creation Date: #{created_at} | Finished Date: N/A"
89
+ elsif created_at && expire_time && !done_at
90
+ order_hist_created_finished_ln = "- Creation Date: #{created_at} | Expiring Date: #{expire_time}"
91
+ elsif created_at && done_at
92
+ order_hist_created_finished_ln = "- Creation Date: #{created_at} | Finished Date: #{done_at}"
93
+ else
94
+ order_hist_created_finished_ln = '- Creation Date: N/A | Finished Date: N/A'
95
+ end
96
+
71
97
  risk_alloc_out = Cryptum.beautify_large_number(
72
98
  value: order_meta_data[:risk_alloc]
73
99
  )
@@ -93,11 +119,11 @@ module Cryptum
93
119
  size = "*#{size_out} + "
94
120
  tpm_out = "#{order_meta_data[:tpm]}% = "
95
121
  targ_tick = "$#{target_price_out}"
96
- profit = "|Profit: $#{order_meta_data[:profit]}"
122
+ profit = " | Profit: $#{order_meta_data[:profit]}"
97
123
 
98
- meta_ln = "- Metadata: #{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
99
- meta_ln = '- Metadata:'
100
- meta_color_ln = " - Color: #{order_color}"
124
+ details_ln1 = "- Slice Plan: #{invest}#{tick}#{size}#{tpm_out}#{targ_tick}#{profit}"
125
+ details_ln2 = "- Fees: $#{fill_fees} | Fill Size: *#{fill_size}"
126
+ details_ln3 = "- Executed Value: $#{executed_value} | Market Type: #{market_type} | Settled: #{settled}"
101
127
 
102
128
  # UI
103
129
  col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
@@ -187,7 +213,7 @@ module Cryptum
187
213
  ui_win: order_execute_details_win,
188
214
  color: order_color,
189
215
  style: style,
190
- string: order_hist_created_ln.ljust(col_just1, ' ')
216
+ string: order_hist_created_finished_ln.ljust(col_just1, ' ')
191
217
  )
192
218
 
193
219
  # ROW 7
@@ -199,7 +225,7 @@ module Cryptum
199
225
  ui_win: order_execute_details_win,
200
226
  color: order_color,
201
227
  style: style,
202
- string: order_hist_finished_ln.ljust(col_just1, ' ')
228
+ string: details_ln1.ljust(col_just1, ' ')
203
229
  )
204
230
 
205
231
  # ROW 8
@@ -211,7 +237,7 @@ module Cryptum
211
237
  ui_win: order_execute_details_win,
212
238
  color: order_color,
213
239
  style: style,
214
- string: meta_ln.ljust(col_just1, ' ')
240
+ string: details_ln2.ljust(col_just1, ' ')
215
241
  )
216
242
 
217
243
  # ROW 9
@@ -223,7 +249,7 @@ module Cryptum
223
249
  ui_win: order_execute_details_win,
224
250
  color: order_color,
225
251
  style: style,
226
- string: meta_color_ln.ljust(col_just1, ' ')
252
+ string: details_ln3.ljust(col_just1, ' ')
227
253
  )
228
254
 
229
255
  # Clear to OK ROW
@@ -42,11 +42,13 @@ module Cryptum
42
42
  return_out = Cryptum.beautify_large_number(
43
43
  value: order[:return]
44
44
  )
45
- autotrade_details = "1. Autotrade is set to #{autotrade_percent}% of $#{fiat_avail_out}, making $#{risk_alloc_out} available for this slice in the order plan."
46
- slice_alloc_details = "2. With $#{risk_alloc_out} available and a slice allocation of #{order[:allocation_percent]}%, $#{slice_alloc_out} OR AN ORDER MINIMUM of $#{invest_out} will"
47
- invest_details = ' be allocated for this slice (whichever is highest).'
48
- tpm_details = "3. With a slice allocation of $#{invest_out}, plus a TPM equal to #{tpm_out}%, $#{return_out} will be returned once sold."
49
- profit = " With $#{invest_out} invested the gross profit equals $#{profit_out}, minus any transaction fees."
45
+ autotrade_ln1_details = "1. Autotrade is set to #{autotrade_percent}% of $#{fiat_avail_out}, making $#{risk_alloc_out} available for this slice in"
46
+ autotrade_ln2_details = ' the order plan.'
47
+ slice_alloc_ln1_details = "2. With $#{risk_alloc_out} available and a slice allocation of #{order[:allocation_percent]}%, $#{slice_alloc_out} OR AN ORDER MINIMUM"
48
+ slice_alloc_ln2_details = " of $#{invest_out} will be allocated for this slice (whichever is highest)."
49
+ profit_ln1_details = "3. With a slice allocation of $#{invest_out}, plus a TPM equal to #{tpm_out}%, $#{return_out} will be returned"
50
+ profit_ln2_details = " once sold. With $#{invest_out} invested, the gross profit equals $#{profit_out}, minus any Maker &"
51
+ profit_ln3_details = ' Taker (transaction) fees.'
50
52
 
51
53
  # UI
52
54
  col_just1 = (Curses.cols - Cryptum::UI.col_first) - 1
@@ -100,7 +102,19 @@ module Cryptum
100
102
  ui_win: order_plan_details_win,
101
103
  color: order_color,
102
104
  style: style,
103
- string: autotrade_details.ljust(col_just1, ' ')
105
+ string: autotrade_ln1_details.ljust(col_just1, ' ')
106
+ )
107
+
108
+ # ROW 4
109
+ out_line_no += 1
110
+ order_plan_details_win.setpos(out_line_no, Cryptum::UI.col_first)
111
+ order_plan_details_win.clrtoeol
112
+
113
+ Cryptum::UI.colorize(
114
+ ui_win: order_plan_details_win,
115
+ color: order_color,
116
+ style: style,
117
+ string: autotrade_ln2_details.ljust(col_just1, ' ')
104
118
  )
105
119
 
106
120
  # ROW 5
@@ -112,7 +126,7 @@ module Cryptum
112
126
  ui_win: order_plan_details_win,
113
127
  color: order_color,
114
128
  style: style,
115
- string: slice_alloc_details.ljust(col_just1, ' ')
129
+ string: slice_alloc_ln1_details.ljust(col_just1, ' ')
116
130
  )
117
131
 
118
132
  # ROW 6
@@ -124,7 +138,7 @@ module Cryptum
124
138
  ui_win: order_plan_details_win,
125
139
  color: order_color,
126
140
  style: style,
127
- string: invest_details.ljust(col_just1, ' ')
141
+ string: slice_alloc_ln2_details.ljust(col_just1, ' ')
128
142
  )
129
143
 
130
144
  # ROW 7
@@ -136,7 +150,7 @@ module Cryptum
136
150
  ui_win: order_plan_details_win,
137
151
  color: order_color,
138
152
  style: style,
139
- string: tpm_details.ljust(col_just1, ' ')
153
+ string: profit_ln1_details.ljust(col_just1, ' ')
140
154
  )
141
155
 
142
156
  # ROW 8
@@ -148,7 +162,19 @@ module Cryptum
148
162
  ui_win: order_plan_details_win,
149
163
  color: order_color,
150
164
  style: style,
151
- string: profit.ljust(col_just1, ' ')
165
+ string: profit_ln2_details.ljust(col_just1, ' ')
166
+ )
167
+
168
+ # ROW 9
169
+ out_line_no += 1
170
+ order_plan_details_win.setpos(out_line_no, Cryptum::UI.col_first)
171
+ order_plan_details_win.clrtoeol
172
+
173
+ Cryptum::UI.colorize(
174
+ ui_win: order_plan_details_win,
175
+ color: order_color,
176
+ style: style,
177
+ string: profit_ln3_details.ljust(col_just1, ' ')
152
178
  )
153
179
 
154
180
  # Clear to OK ROW
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.273'
4
+ VERSION = '0.0.274'
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.273
4
+ version: 0.0.274
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.