binance_client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94c236f6f600611cafbaf410e3818ef1b9f8604a9f0431987c88295e28157bbb
4
- data.tar.gz: 268f970bdc536a40dd4a68af762b1f1b5e3971299138e4dfc0957edae8f3c4fe
3
+ metadata.gz: 1979b92bdf48a6a492d2c5f5c27647ff62de6b9fc76b0660aca4dba66883b4f2
4
+ data.tar.gz: 269d45355ff17b2aaca147f291a21d4020ebdfabca11320984431c1f28590a76
5
5
  SHA512:
6
- metadata.gz: 3d5babc954cc3bb86cbd1f58a08206b0f42e7468be9e2f003c078091a1d627fb073d69cc67ac5c5dd80070cec18ce2a20e74a3947912983e477cef1eb6d3337d
7
- data.tar.gz: 8590510674b177b3dac5ab86db57ddd1f78825b5ed9bd10114d7089aff021472c8112aeaac03e7bd2d5e72df161b4e73ef14ca6665c8472a31e74a0dbbefae49
6
+ metadata.gz: c0d171109402441c2090aa2bd4f44d339cd95d1205ef5e0af0ed5365aa5f577a5b0ed8ba2647c84fc19c223b3404635dc147494f142844f2d0eff7f4418aea00
7
+ data.tar.gz: 528e987310452cf0b2d06d4313c2fb99170a9eb6f1cf35b087aa0c821b91cae8d8d150274f48f41fd9a734480c27acaa2caa8f21fde95991e3dad1679cd58cd1
@@ -0,0 +1,18 @@
1
+ <a name="v0.2.0"></a>
2
+ ### v0.2.0 (2020-09-14)
3
+
4
+
5
+ #### Features
6
+
7
+ * enable vcr for other tests ([aaf2fbb](/../../commit/aaf2fbb))
8
+ * add book_ticker endpoint ([bc7c896](/../../commit/bc7c896))
9
+ * added get_all endpoint ([b22fa3f](/../../commit/b22fa3f))
10
+ * add account_snapshot endpoint ([e64826a](/../../commit/e64826a))
11
+ * add system_status endpoint ([fbc3c36](/../../commit/fbc3c36))
12
+
13
+
14
+ #### Bug Fixes
15
+
16
+ * ignore non deterministic part of the url ([647a822](/../../commit/647a822))
17
+
18
+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- binance_client-ruby (0.1.0)
4
+ binance_client (0.1.0)
5
5
  activesupport
6
6
  api_client_base
7
7
  typhoeus
@@ -15,6 +15,8 @@ GEM
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
17
  zeitwerk (~> 2.2, >= 2.2.2)
18
+ addressable (2.7.0)
19
+ public_suffix (>= 2.0.2, < 5.0)
18
20
  api_client_base (1.9.0)
19
21
  activesupport (>= 3.0)
20
22
  gem_config (>= 0.3.1)
@@ -27,6 +29,8 @@ GEM
27
29
  coercible (1.0.0)
28
30
  descendants_tracker (~> 0.0.1)
29
31
  concurrent-ruby (1.1.7)
32
+ crack (0.4.3)
33
+ safe_yaml (~> 1.0.0)
30
34
  descendants_tracker (0.0.4)
31
35
  thread_safe (~> 0.3, >= 0.3.1)
32
36
  diff-lcs (1.4.4)
@@ -35,6 +39,7 @@ GEM
35
39
  ffi (>= 1.3.0)
36
40
  ffi (1.13.1)
37
41
  gem_config (0.3.2)
42
+ hashdiff (1.0.1)
38
43
  i18n (1.8.5)
39
44
  concurrent-ruby (~> 1.0)
40
45
  ice_nine (0.11.2)
@@ -43,6 +48,7 @@ GEM
43
48
  pry (0.13.1)
44
49
  coderay (~> 1.1)
45
50
  method_source (~> 1.0)
51
+ public_suffix (4.0.6)
46
52
  rake (12.3.3)
47
53
  rspec (3.9.0)
48
54
  rspec-core (~> 3.9.0)
@@ -57,26 +63,34 @@ GEM
57
63
  diff-lcs (>= 1.2.0, < 2.0)
58
64
  rspec-support (~> 3.9.0)
59
65
  rspec-support (3.9.3)
66
+ safe_yaml (1.0.5)
60
67
  thread_safe (0.3.6)
61
68
  typhoeus (1.4.0)
62
69
  ethon (>= 0.9.0)
63
70
  tzinfo (1.2.7)
64
71
  thread_safe (~> 0.1)
72
+ vcr (6.0.0)
65
73
  virtus (1.0.5)
66
74
  axiom-types (~> 0.1)
67
75
  coercible (~> 1.0)
68
76
  descendants_tracker (~> 0.0, >= 0.0.3)
69
77
  equalizer (~> 0.0, >= 0.0.9)
78
+ webmock (3.9.1)
79
+ addressable (>= 2.3.6)
80
+ crack (>= 0.3.2)
81
+ hashdiff (>= 0.4.0, < 2.0.0)
70
82
  zeitwerk (2.4.0)
71
83
 
72
84
  PLATFORMS
73
85
  ruby
74
86
 
75
87
  DEPENDENCIES
76
- binance_client-ruby!
88
+ binance_client!
77
89
  pry
78
90
  rake (~> 12.0)
79
91
  rspec (~> 3.0)
92
+ vcr
93
+ webmock
80
94
 
81
95
  BUNDLED WITH
82
96
  2.1.4
data/README.md CHANGED
@@ -35,6 +35,7 @@ We provide one method per API endpoint.
35
35
  client.system_status
36
36
  client.account_snapshot
37
37
  client.get_all
38
+ client.book_ticker(symbol: "BTCETH")
38
39
  ```
39
40
 
40
41
  ## Responses
@@ -30,4 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "typhoeus"
31
31
 
32
32
  spec.add_development_dependency "pry"
33
+ spec.add_development_dependency "vcr"
34
+ spec.add_development_dependency "webmock"
33
35
  end
@@ -12,9 +12,11 @@ require "binance_client/responses/base_response"
12
12
  require "binance_client/requests/system_status_request"
13
13
  require "binance_client/requests/account_snapshot_request"
14
14
  require "binance_client/requests/get_all_request"
15
+ require "binance_client/requests/book_ticker_request"
15
16
  require "binance_client/responses/system_status_response"
16
17
  require "binance_client/responses/account_snapshot_response"
17
18
  require "binance_client/responses/get_all_response"
19
+ require "binance_client/responses/book_ticker_response"
18
20
 
19
21
  module BinanceClient
20
22
  class Error < StandardError; end
@@ -5,6 +5,7 @@ module BinanceClient
5
5
  api_action :system_status
6
6
  api_action :account_snapshot
7
7
  api_action :get_all
8
+ api_action :book_ticker
8
9
 
9
10
  attribute :host
10
11
  attribute :api_key
@@ -0,0 +1,13 @@
1
+ module BinanceClient
2
+ class BookTickerRequest < BaseRequest
3
+ attribute :symbol
4
+
5
+ def path
6
+ "/api/v3/ticker/bookTicker"
7
+ end
8
+
9
+ def params
10
+ {symbol: symbol}.to_query
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ module BinanceClient
2
+ class BookTickerResponse < BaseResponse
3
+ end
4
+ end
@@ -1,18 +1,4 @@
1
1
  module BinanceClient
2
2
  class GetAllResponse < BaseResponse
3
- attribute :body, Object, default: :default_body
4
-
5
- private
6
-
7
- def default_body
8
- payload = {}
9
- parsed_body = JSON.parse(raw_response.body)
10
-
11
- parsed_body.map do |coin_details|
12
- payload[coin_details["coin"]] = coin_details
13
- end
14
-
15
- payload
16
- end
17
3
  end
18
4
  end
@@ -1,3 +1,3 @@
1
1
  module BinanceClient
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binance_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AJ Villalobos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-13 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api_client_base
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: vcr
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: Ruby wrapper for Binance API
70
98
  email:
71
99
  - hi@ajvillalobos.com
@@ -76,6 +104,7 @@ files:
76
104
  - ".gitignore"
77
105
  - ".rspec"
78
106
  - ".travis.yml"
107
+ - CHANGELOG.md
79
108
  - CODE_OF_CONDUCT.md
80
109
  - Gemfile
81
110
  - Gemfile.lock
@@ -89,10 +118,12 @@ files:
89
118
  - lib/binance_client/client.rb
90
119
  - lib/binance_client/requests/account_snapshot_request.rb
91
120
  - lib/binance_client/requests/base_request.rb
121
+ - lib/binance_client/requests/book_ticker_request.rb
92
122
  - lib/binance_client/requests/get_all_request.rb
93
123
  - lib/binance_client/requests/system_status_request.rb
94
124
  - lib/binance_client/responses/account_snapshot_response.rb
95
125
  - lib/binance_client/responses/base_response.rb
126
+ - lib/binance_client/responses/book_ticker_response.rb
96
127
  - lib/binance_client/responses/get_all_response.rb
97
128
  - lib/binance_client/responses/system_status_response.rb
98
129
  - lib/binance_client/version.rb