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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8d5bddc70ca2827bb70e3a254c3a3a50d5ad4163e3ea1be3c49269baffb005e
4
- data.tar.gz: dba874beb48cb2d007222ca288b1810c184649d0cb8f19e15f8e38a92a96e02c
3
+ metadata.gz: ddd7f48092821353323e10f01efa13708704480d1f3b2e5cadf8552c9821dcc7
4
+ data.tar.gz: e1857340c2333eddb86a90ee5d2d6f6ba5712bc5c3897c0fef7e06fcb47695e7
5
5
  SHA512:
6
- metadata.gz: e4fa744c6f92e001b7c349ca970e743c15da822ae8f632186af3e323c459e8689c50a260c31cb3fa208a3bf0f7b19225c3f1f494e8254d01f5006a39cab7a932
7
- data.tar.gz: b5ac3de520c34675f7599e9f114f120da8f8505d8492263865f8fc750f2e3fea9719a038e538bd3a3b33d90f9457029ccd8e585cf0d8d4b80f99d91b6cf2f543
6
+ metadata.gz: 06e7ddd7b8b215c7ecc95325fa81c40867ae475874deb736be37a8b2f826068d3fa62af5b2e69251260b0c28e19947be927468ab94e6370bfce57a2c9ded4c48
7
+ data.tar.gz: 687fd5425ab1601c28b3a7d31fc8a9ec7dcc4b1e56324560d770f8200fd505f91f48196bc345946a700ca8c2fd4df21ab79486476318ed3d5f72bacb6ab46eca
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Bitopro
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.0.3".freeze
3
3
  end
@@ -24,20 +24,14 @@ RSpec.describe Bitopro::Client do
24
24
  end
25
25
  end
26
26
 
27
- describe "#ticker" do
28
- subject { Bitopro::Client.new.ticker(currency_pair) }
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}/ticker/#{currency_pair}")
40
- .to_return(status: 200, body: json_fixture('ticker'))
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.2
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
- - bboyceo@hotmail.com
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/ticker.json
116
+ - spec/fixtures/tickers.json
117
117
  - spec/spec_helper.rb
118
118
  - spec/support/rspec_helpers.rb
119
- homepage: https://github.com/niclin/bitopro
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/niclin/bitopro
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.2
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