bitopro 1.0.2 → 1.0.3
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 +4 -4
- data/lib/bitopro/client.rb +3 -0
- data/lib/bitopro/version.rb +1 -1
- data/spec/bitopro/client_spec.rb +4 -10
- data/spec/fixtures/{ticker.json → tickers.json} +0 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddd7f48092821353323e10f01efa13708704480d1f3b2e5cadf8552c9821dcc7
|
4
|
+
data.tar.gz: e1857340c2333eddb86a90ee5d2d6f6ba5712bc5c3897c0fef7e06fcb47695e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e7ddd7b8b215c7ecc95325fa81c40867ae475874deb736be37a8b2f826068d3fa62af5b2e69251260b0c28e19947be927468ab94e6370bfce57a2c9ded4c48
|
7
|
+
data.tar.gz: 687fd5425ab1601c28b3a7d31fc8a9ec7dcc4b1e56324560d770f8200fd505f91f48196bc345946a700ca8c2fd4df21ab79486476318ed3d5f72bacb6ab46eca
|
data/lib/bitopro/client.rb
CHANGED
@@ -78,9 +78,11 @@ module Bitopro
|
|
78
78
|
|
79
79
|
def get(url, params = {})
|
80
80
|
complete_url = build_url(url)
|
81
|
+
headers = { "X-BITOPRO-API": "ruby" }
|
81
82
|
response = RestClient::Request.execute(method: :get,
|
82
83
|
url: complete_url,
|
83
84
|
payload: params,
|
85
|
+
headers: headers,
|
84
86
|
timeout: 10)
|
85
87
|
|
86
88
|
JSON.parse(response.body)
|
@@ -100,6 +102,7 @@ module Bitopro
|
|
100
102
|
|
101
103
|
def build_headers(payload)
|
102
104
|
{
|
105
|
+
"X-BITOPRO-API": "ruby",
|
103
106
|
"X-BITOPRO-APIKEY": @config.key,
|
104
107
|
"X-BITOPRO-PAYLOAD": payload,
|
105
108
|
"X-BITOPRO-SIGNATURE": signature(payload)
|
data/lib/bitopro/version.rb
CHANGED
data/spec/bitopro/client_spec.rb
CHANGED
@@ -24,20 +24,14 @@ RSpec.describe Bitopro::Client do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
describe "#
|
28
|
-
subject { Bitopro::Client.new.
|
29
|
-
|
30
|
-
context "when currency pair is empty" do
|
31
|
-
let(:currency_pair) { nil }
|
32
|
-
|
33
|
-
it { is_expected_block.to raise_error Bitopro::Public::Error }
|
34
|
-
end
|
27
|
+
describe "#tickers" do
|
28
|
+
subject { Bitopro::Client.new.tickers(currency_pair) }
|
35
29
|
|
36
30
|
context "when api succeeds" do
|
37
31
|
let(:currency_pair) { "btc_twd" }
|
38
32
|
let!(:request_stub) do
|
39
|
-
stub_request(:get, "#{Bitopro::BASE_URL}/
|
40
|
-
.to_return(status: 200, body: json_fixture('
|
33
|
+
stub_request(:get, "#{Bitopro::BASE_URL}/tickers/#{currency_pair}")
|
34
|
+
.to_return(status: 200, body: json_fixture('tickers'))
|
41
35
|
end
|
42
36
|
|
43
37
|
it "return parsed json order book" do
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitopro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- niclin
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
version: '0'
|
97
97
|
description: Ruby wrapper for the Bitopro API.
|
98
98
|
email:
|
99
|
-
-
|
99
|
+
- niclin0226@gmail.com
|
100
100
|
executables: []
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
@@ -113,15 +113,15 @@ files:
|
|
113
113
|
- spec/bitopro/version_spec.rb
|
114
114
|
- spec/fixtures/order-book.json
|
115
115
|
- spec/fixtures/recent_trades.json
|
116
|
-
- spec/fixtures/
|
116
|
+
- spec/fixtures/tickers.json
|
117
117
|
- spec/spec_helper.rb
|
118
118
|
- spec/support/rspec_helpers.rb
|
119
|
-
homepage: https://github.com/
|
119
|
+
homepage: https://github.com/bitoex/bitopro-api-ruby
|
120
120
|
licenses:
|
121
121
|
- MIT
|
122
122
|
metadata:
|
123
123
|
allowed_push_host: https://rubygems.org
|
124
|
-
homepage_uri: https://github.com/
|
124
|
+
homepage_uri: https://github.com/bitoex/bitopro-api-ruby
|
125
125
|
post_install_message:
|
126
126
|
rdoc_options: []
|
127
127
|
require_paths:
|
@@ -141,13 +141,13 @@ rubyforge_project:
|
|
141
141
|
rubygems_version: 2.7.8
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
|
-
summary: bitopro-1.0.
|
144
|
+
summary: bitopro-1.0.3
|
145
145
|
test_files:
|
146
146
|
- spec/spec_helper.rb
|
147
147
|
- spec/bitopro/config_spec.rb
|
148
148
|
- spec/bitopro/client_spec.rb
|
149
149
|
- spec/bitopro/version_spec.rb
|
150
150
|
- spec/support/rspec_helpers.rb
|
151
|
-
- spec/fixtures/ticker.json
|
152
151
|
- spec/fixtures/order-book.json
|
152
|
+
- spec/fixtures/tickers.json
|
153
153
|
- spec/fixtures/recent_trades.json
|