cryptum 0.0.380 → 0.0.381
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +2 -13
- data/bin/cryptum +1 -1
- data/bin/cryptum-forecast +3 -3
- data/lib/cryptum/api/exchange_rates.rb +42 -0
- data/lib/cryptum/api/fees.rb +36 -0
- data/lib/cryptum/api/order_history.rb +56 -0
- data/lib/cryptum/api/orders.rb +253 -0
- data/lib/cryptum/api/portfolio.rb +79 -0
- data/lib/cryptum/api/products.rb +65 -0
- data/lib/cryptum/api/rest.rb +177 -0
- data/lib/cryptum/api/signature.rb +79 -0
- data/lib/cryptum/api.rb +9 -659
- data/lib/cryptum/event/buy.rb +1 -1
- data/lib/cryptum/event/cancel.rb +1 -1
- data/lib/cryptum/event/gtfo.rb +1 -1
- data/lib/cryptum/event/sell.rb +1 -1
- data/lib/cryptum/order_book/generate.rb +1 -1
- data/lib/cryptum/portfolio/balance.rb +3 -5
- data/lib/cryptum/ui/order_execution.rb +2 -2
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock/coinbase.rb +1 -1
- data/spec/lib/cryptum/api/exchange_rates_spec.rb +10 -0
- data/spec/lib/cryptum/api/fees_spec.rb +10 -0
- data/spec/lib/cryptum/api/order_history_spec.rb +10 -0
- data/spec/lib/cryptum/api/orders_spec.rb +10 -0
- data/spec/lib/cryptum/api/portfolio_spec.rb +10 -0
- data/spec/lib/cryptum/api/products_spec.rb +10 -0
- data/spec/lib/cryptum/api/rest_spec.rb +10 -0
- data/spec/lib/cryptum/api/signature_spec.rb +10 -0
- metadata +17 -1
data/lib/cryptum/event/gtfo.rb
CHANGED
data/lib/cryptum/event/sell.rb
CHANGED
@@ -96,7 +96,7 @@ module Cryptum
|
|
96
96
|
event_history.order_submitted = true
|
97
97
|
event_history.event_notes = "{ \"event_type\": \"#{event_history.event_type}\", \"cancel\": \"#{event_history.order_canceled}\", \"submitted\": \"#{event_history.order_submitted}\" }" if option_choice.proxy
|
98
98
|
|
99
|
-
event_history = Cryptum::API.submit_limit_order(
|
99
|
+
event_history = Cryptum::API::Orders.submit_limit_order(
|
100
100
|
option_choice: option_choice,
|
101
101
|
env: env,
|
102
102
|
price: price,
|
@@ -25,7 +25,7 @@ module Cryptum
|
|
25
25
|
order_book_file = "#{session_root}/order_books/#{symbol}.ORDER_BOOK.json"
|
26
26
|
|
27
27
|
# Only need to retrieve a product list once / session.
|
28
|
-
products = Cryptum::API.
|
28
|
+
products = Cryptum::API::Products.get(
|
29
29
|
option_choice: option_choice,
|
30
30
|
env: env
|
31
31
|
)
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'logger'
|
4
|
-
|
5
3
|
module Cryptum
|
6
4
|
# This plugin is used to instantiate a Cryptum logger with a custom message format
|
7
5
|
module Portfolio
|
@@ -64,7 +62,7 @@ module Cryptum
|
|
64
62
|
enotes = "{ \"event_type\": \"#{etype}\", \"cancel\": \"#{ocancel}\", \"submitted\": \"#{osubmit}\" }" if option_choice.proxy
|
65
63
|
event_history.event_notes = enotes
|
66
64
|
|
67
|
-
portfolio = Cryptum::API.
|
65
|
+
portfolio = Cryptum::API::Portfolio.get(
|
68
66
|
option_choice: option_choice,
|
69
67
|
env: env,
|
70
68
|
crypto: crypto,
|
@@ -74,13 +72,13 @@ module Cryptum
|
|
74
72
|
)
|
75
73
|
event_history.order_book[:portfolio] = portfolio unless portfolio.empty?
|
76
74
|
|
77
|
-
order_history = Cryptum::API.
|
75
|
+
order_history = Cryptum::API::OrderHistory.get(
|
78
76
|
option_choice: option_choice,
|
79
77
|
env: env
|
80
78
|
)
|
81
79
|
event_history.order_book[:order_history] = order_history unless order_history.empty?
|
82
80
|
|
83
|
-
fees = Cryptum::API.
|
81
|
+
fees = Cryptum::API::Fees.get(
|
84
82
|
option_choice: option_choice,
|
85
83
|
env: env
|
86
84
|
)
|
@@ -127,7 +127,7 @@ module Cryptum
|
|
127
127
|
event_history.red_pill = true if fiat_invested_this_order > fiat_avail_to_trade.to_f
|
128
128
|
|
129
129
|
unless event_history.red_pill
|
130
|
-
event_history = Cryptum::API.submit_limit_order(
|
130
|
+
event_history = Cryptum::API::Orders.submit_limit_order(
|
131
131
|
option_choice: option_choice,
|
132
132
|
env: env,
|
133
133
|
price: price,
|
@@ -253,7 +253,7 @@ module Cryptum
|
|
253
253
|
|
254
254
|
size = order_ready_to_sell[:size]
|
255
255
|
|
256
|
-
Cryptum::API.submit_limit_order(
|
256
|
+
Cryptum::API::Orders.submit_limit_order(
|
257
257
|
option_choice: option_choice,
|
258
258
|
env: env,
|
259
259
|
price: price,
|
data/lib/cryptum/version.rb
CHANGED
@@ -65,7 +65,7 @@ module Cryptum
|
|
65
65
|
product_id = option_choice.symbol.to_s.gsub('_', '-').upcase
|
66
66
|
|
67
67
|
api_secret = env[:api_secret]
|
68
|
-
api_signature_response = Cryptum::API.
|
68
|
+
api_signature_response = Cryptum::API::Signature.generate(
|
69
69
|
api_secret: api_secret
|
70
70
|
)
|
71
71
|
api_key = env[:api_key]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Cryptum::API::ExchangeRates do
|
6
|
+
it 'should display information for existing help method' do
|
7
|
+
help_response = Cryptum::API::ExchangeRates
|
8
|
+
expect(help_response).to respond_to :help
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Cryptum::API::OrderHistory do
|
6
|
+
it 'should display information for existing help method' do
|
7
|
+
help_response = Cryptum::API::OrderHistory
|
8
|
+
expect(help_response).to respond_to :help
|
9
|
+
end
|
10
|
+
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.
|
4
|
+
version: 0.0.381
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -408,6 +408,14 @@ files:
|
|
408
408
|
- git_commit.sh
|
409
409
|
- lib/cryptum.rb
|
410
410
|
- lib/cryptum/api.rb
|
411
|
+
- lib/cryptum/api/exchange_rates.rb
|
412
|
+
- lib/cryptum/api/fees.rb
|
413
|
+
- lib/cryptum/api/order_history.rb
|
414
|
+
- lib/cryptum/api/orders.rb
|
415
|
+
- lib/cryptum/api/portfolio.rb
|
416
|
+
- lib/cryptum/api/products.rb
|
417
|
+
- lib/cryptum/api/rest.rb
|
418
|
+
- lib/cryptum/api/signature.rb
|
411
419
|
- lib/cryptum/bot_conf.rb
|
412
420
|
- lib/cryptum/event.rb
|
413
421
|
- lib/cryptum/event/bot_conf.rb
|
@@ -456,6 +464,14 @@ files:
|
|
456
464
|
- lib/cryptum/web_sock/event_machine.rb
|
457
465
|
- order_books/.gitkeep
|
458
466
|
- reinstall_cryptum_gemset.sh
|
467
|
+
- spec/lib/cryptum/api/exchange_rates_spec.rb
|
468
|
+
- spec/lib/cryptum/api/fees_spec.rb
|
469
|
+
- spec/lib/cryptum/api/order_history_spec.rb
|
470
|
+
- spec/lib/cryptum/api/orders_spec.rb
|
471
|
+
- spec/lib/cryptum/api/portfolio_spec.rb
|
472
|
+
- spec/lib/cryptum/api/products_spec.rb
|
473
|
+
- spec/lib/cryptum/api/rest_spec.rb
|
474
|
+
- spec/lib/cryptum/api/signature_spec.rb
|
459
475
|
- spec/lib/cryptum/api_spec.rb
|
460
476
|
- spec/lib/cryptum/bot_conf_spec.rb
|
461
477
|
- spec/lib/cryptum/event/bot_conf_spec.rb
|