cryptum 0.0.333 → 0.0.334
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/cryptum/api.rb +43 -45
- data/lib/cryptum/version.rb +1 -1
- data/lib/cryptum/web_sock/coinbase.rb +13 -4
- metadata +29 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32f1395f2dc8feb6e063a54ea5cbe28c589bcc8f394cff18d549daa01abb6562
|
4
|
+
data.tar.gz: 9ad9843eb6a6867317556e0b5b77c431ca85b393abcc7208bd3c559d6b43669a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b96f8014e1ff6088a518a3e9bd6840335a0181c7664c7c9cba29e2ceb9e91c61c54ad0c4905f20668d8527dd31348809156efb6202199a5d56bce59f4b4fd81
|
7
|
+
data.tar.gz: 4372cf33d301727ea059511f846e189c899c5fc88aa81d5312e36ff7ba35bff96f8dcc70ae810a831183345f8c9289efe9fe930e792a72f5e7e68bb43cf168d1
|
data/Gemfile
CHANGED
@@ -17,6 +17,7 @@ gem 'bundler-audit', '0.9.1'
|
|
17
17
|
gem 'curses', '1.4.4'
|
18
18
|
gem 'eventmachine', '1.2.7'
|
19
19
|
gem 'faye-websocket', '0.11.1'
|
20
|
+
gem 'permessage_deflate', '0.1.4'
|
20
21
|
gem 'pry', '0.14.1'
|
21
22
|
gem 'pry-doc', '1.3.0'
|
22
23
|
gem 'rake', '13.0.6'
|
@@ -34,3 +35,4 @@ gem 'sinatra', '3.0.4'
|
|
34
35
|
gem 'thin', '1.8.1'
|
35
36
|
gem 'tty-prompt', '0.23.1'
|
36
37
|
gem 'tty-spinner', '0.9.3'
|
38
|
+
gem 'websocket-extensions', '0.1.5'
|
data/lib/cryptum/api.rb
CHANGED
@@ -86,9 +86,7 @@ module Cryptum
|
|
86
86
|
api_secret = env[:api_secret]
|
87
87
|
api_passphrase = env[:api_passphrase]
|
88
88
|
api_endpoint = 'https://api.exchange.coinbase.com'
|
89
|
-
api_endpoint = 'https://api-public.sandbox.
|
90
|
-
# api_endpoint = 'https://api.pro.coinbase.com'
|
91
|
-
# api_endpoint = 'https://api-public.sandbox.pro.coinbase.com' if env[:env] == :sandbox
|
89
|
+
api_endpoint = 'https://api-public.sandbox.exchange.coinbase.com' if env[:env] == :sandbox
|
92
90
|
api_endpoint = opts[:api_endpoint] if opts[:api_endpoint]
|
93
91
|
|
94
92
|
http_method = if opts[:http_method].nil?
|
@@ -409,30 +407,30 @@ module Cryptum
|
|
409
407
|
raise e
|
410
408
|
end
|
411
409
|
|
412
|
-
public_class_method def self.cancel_open_order(opts = {})
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
410
|
+
# public_class_method def self.cancel_open_order(opts = {})
|
411
|
+
# env = opts[:env]
|
412
|
+
# option_choice = opts[:option_choice]
|
413
|
+
# order_id = opts[:order_id]
|
414
|
+
# order_type = opts[:order_type]
|
417
415
|
|
418
|
-
|
416
|
+
# product_id = option_choice.symbol.to_s.gsub('_', '-').upcase
|
419
417
|
|
420
|
-
|
421
|
-
|
418
|
+
# order_hash = {}
|
419
|
+
# order_hash[:product_id] = product_id
|
422
420
|
|
423
|
-
|
421
|
+
# params = order_hash
|
424
422
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
rescue StandardError => e
|
434
|
-
|
435
|
-
end
|
423
|
+
# rest_api_call(
|
424
|
+
# env: env,
|
425
|
+
# http_method: :DELETE,
|
426
|
+
# api_call: "/orders/#{order_id}",
|
427
|
+
# option_choice: option_choice,
|
428
|
+
# params: params,
|
429
|
+
# order_type: order_type
|
430
|
+
# )
|
431
|
+
# rescue StandardError => e
|
432
|
+
# raise e
|
433
|
+
# end
|
436
434
|
|
437
435
|
public_class_method def self.cancel_all_open_orders(opts = {})
|
438
436
|
env = opts[:env]
|
@@ -490,7 +488,7 @@ module Cryptum
|
|
490
488
|
raise e
|
491
489
|
end
|
492
490
|
|
493
|
-
|
491
|
+
private_class_method def self.get_exchange_rates(opts = {})
|
494
492
|
option_choice = opts[:option_choice]
|
495
493
|
env = opts[:env]
|
496
494
|
|
@@ -590,32 +588,32 @@ module Cryptum
|
|
590
588
|
raise e
|
591
589
|
end
|
592
590
|
|
593
|
-
public_class_method def self.get_profiles(opts = {})
|
594
|
-
|
595
|
-
|
591
|
+
# public_class_method def self.get_profiles(opts = {})
|
592
|
+
# option_choice = opts[:option_choice]
|
593
|
+
# env = opts[:env]
|
596
594
|
|
597
|
-
|
595
|
+
# profiles_api_call = '/profiles'
|
598
596
|
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
597
|
+
# # We don't always get fees back from Coinbase...
|
598
|
+
# # This is a hack to ensure we do.
|
599
|
+
# profiles = {}
|
600
|
+
# # loop do
|
601
|
+
# profiles = rest_api_call(
|
602
|
+
# option_choice: option_choice,
|
603
|
+
# env: env,
|
604
|
+
# http_method: :GET,
|
605
|
+
# api_call: profiles_api_call
|
606
|
+
# )
|
609
607
|
|
610
|
-
|
608
|
+
# # break unless fees.empty?
|
611
609
|
|
612
|
-
|
613
|
-
|
610
|
+
# # sleep 0.3
|
611
|
+
# # end
|
614
612
|
|
615
|
-
|
616
|
-
rescue StandardError => e
|
617
|
-
|
618
|
-
end
|
613
|
+
# profiles
|
614
|
+
# rescue StandardError => e
|
615
|
+
# raise e
|
616
|
+
# end
|
619
617
|
|
620
618
|
public_class_method def self.get_order_history(opts = {})
|
621
619
|
option_choice = opts[:option_choice]
|
data/lib/cryptum/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'faye/websocket'
|
4
|
+
require 'websocket/extensions'
|
5
|
+
require 'permessage_deflate'
|
4
6
|
|
5
7
|
module Cryptum
|
6
8
|
# This plugin is used to Establish a Web
|
@@ -14,8 +16,13 @@ module Cryptum
|
|
14
16
|
option_choice = opts[:option_choice]
|
15
17
|
env = opts[:env]
|
16
18
|
|
17
|
-
cb_pro_ws_feed = 'wss://ws-feed.pro.coinbase.com'
|
18
|
-
cb_pro_ws_feed = 'wss://ws-feed-public.sandbox.pro.coinbase.com' if env[:env] == :sandbox
|
19
|
+
# cb_pro_ws_feed = 'wss://ws-feed.pro.coinbase.com'
|
20
|
+
# cb_pro_ws_feed = 'wss://ws-feed-public.sandbox.pro.coinbase.com' if env[:env] == :sandbox
|
21
|
+
cb_pro_ws_feed = 'wss://ws-feed.exchange.coinbase.com'
|
22
|
+
cb_pro_ws_feed = 'wss://ws-feed-public.sandbox.exchange.coinbase.com' if env[:env] == :sandbox
|
23
|
+
|
24
|
+
extensions = [PermessageDeflate]
|
25
|
+
|
19
26
|
if option_choice.proxy
|
20
27
|
tls_opts = {
|
21
28
|
verify_peer: false
|
@@ -30,13 +37,15 @@ module Cryptum
|
|
30
37
|
[],
|
31
38
|
tls: tls_opts,
|
32
39
|
proxy: proxy_opts,
|
33
|
-
|
40
|
+
extensions: extensions,
|
41
|
+
ping: 9
|
34
42
|
)
|
35
43
|
else
|
36
44
|
ws = Faye::WebSocket::Client.new(
|
37
45
|
cb_pro_ws_feed,
|
38
46
|
[],
|
39
|
-
|
47
|
+
extensions: extensions,
|
48
|
+
ping: 9
|
40
49
|
)
|
41
50
|
end
|
42
51
|
|
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.334
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.11.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: permessage_deflate
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.1.4
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.1.4
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: pry
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -332,6 +346,20 @@ dependencies:
|
|
332
346
|
- - '='
|
333
347
|
- !ruby/object:Gem::Version
|
334
348
|
version: 0.9.3
|
349
|
+
- !ruby/object:Gem::Dependency
|
350
|
+
name: websocket-extensions
|
351
|
+
requirement: !ruby/object:Gem::Requirement
|
352
|
+
requirements:
|
353
|
+
- - '='
|
354
|
+
- !ruby/object:Gem::Version
|
355
|
+
version: 0.1.5
|
356
|
+
type: :runtime
|
357
|
+
prerelease: false
|
358
|
+
version_requirements: !ruby/object:Gem::Requirement
|
359
|
+
requirements:
|
360
|
+
- - '='
|
361
|
+
- !ruby/object:Gem::Version
|
362
|
+
version: 0.1.5
|
335
363
|
description: Personalized High-Frequency Trading Bot
|
336
364
|
email:
|
337
365
|
- request.pentest@0dayinc.com
|