cryptum 0.0.380 → 0.0.381

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ module Cryptum
15
15
  bot_conf = opts[:bot_conf]
16
16
 
17
17
  terminal_win.key_press_event.key_g = false
18
- Cryptum::API.gtfo(
18
+ Cryptum::API::Orders.gtfo(
19
19
  option_choice: option_choice,
20
20
  env: env,
21
21
  event_history: event_history,
@@ -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.get_products(
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.get_portfolio(
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.get_order_history(
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.get_fees(
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.380'
4
+ VERSION = '0.0.381'
5
5
  end
@@ -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.generate_signature(
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::Fees do
6
+ it 'should display information for existing help method' do
7
+ help_response = Cryptum::API::Fees
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
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Cryptum::API::Orders do
6
+ it 'should display information for existing help method' do
7
+ help_response = Cryptum::API::Orders
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::Portfolio do
6
+ it 'should display information for existing help method' do
7
+ help_response = Cryptum::API::Portfolio
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::Products do
6
+ it 'should display information for existing help method' do
7
+ help_response = Cryptum::API::Products
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::Rest do
6
+ it 'should display information for existing help method' do
7
+ help_response = Cryptum::API::Rest
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::Signature do
6
+ it 'should display information for existing help method' do
7
+ help_response = Cryptum::API::Signature
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.380
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