viabtc 0.1.1 → 0.2.0
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/Gemfile.lock +1 -1
- data/lib/viabtc/client.rb +14 -12
- data/lib/viabtc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f6faea21869b0bb5cf1c68e7ce2c55d5ee769872d747d6a62e5dbb3d8d22ba6
|
|
4
|
+
data.tar.gz: bb10abb7ad810ec80c4bd4161fedef55f6609e279af16196d627bed1062c3771
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10466297750f595fa88d76daad7971608b4933cf0004352499c3ad34011b408dedb8d8bd5588e4274eb83de23e53fa0f294f2759632e002281caacc6cef79407
|
|
7
|
+
data.tar.gz: 975385083e97437dd00f7b55438c87ec0650e8ee083e4c55791dd4874b8c1cb9cd71e97e77308762631bd510f899d387eb3265277d0a37969fb6938e2963362c
|
data/Gemfile.lock
CHANGED
data/lib/viabtc/client.rb
CHANGED
|
@@ -3,20 +3,11 @@ module ViaBTC
|
|
|
3
3
|
def initialize(base_url: nil, faraday_response: nil, faraday_adapter: nil)
|
|
4
4
|
if ViaBTC.configuration
|
|
5
5
|
base_url ||= ViaBTC.configuration.base_url
|
|
6
|
-
faraday_response ||= ViaBTC.configuration.faraday_response
|
|
7
|
-
faraday_adapter ||= ViaBTC.configuration.faraday_adapter
|
|
8
|
-
else
|
|
9
|
-
faraday_response ||= :logger
|
|
10
|
-
faraday_adapter ||= :net_http
|
|
6
|
+
faraday_response ||= ViaBTC.configuration.faraday_response
|
|
7
|
+
faraday_adapter ||= ViaBTC.configuration.faraday_adapter
|
|
11
8
|
end
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@connection ||= Faraday.new(base_url) do |conn|
|
|
16
|
-
conn.response faraday_response
|
|
17
|
-
conn.adapter faraday_adapter
|
|
18
|
-
conn.headers['Content-Type'] = ['application/json']
|
|
19
|
-
end
|
|
10
|
+
@connection ||= connection(base_url, faraday_response, faraday_adapter)
|
|
20
11
|
end
|
|
21
12
|
|
|
22
13
|
# Asset API
|
|
@@ -179,6 +170,17 @@ module ViaBTC
|
|
|
179
170
|
|
|
180
171
|
private
|
|
181
172
|
|
|
173
|
+
def connection(base_url, faraday_response, faraday_adapter)
|
|
174
|
+
raise ViaBTC::Error::Configuration, 'required: base_url' unless base_url
|
|
175
|
+
faraday_response ||= :logger
|
|
176
|
+
faraday_adapter ||= :net_http
|
|
177
|
+
Faraday.new(base_url) do |conn|
|
|
178
|
+
conn.response faraday_response
|
|
179
|
+
conn.adapter faraday_adapter
|
|
180
|
+
conn.headers['Content-Type'] = ['application/json']
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
182
184
|
def request(method:, params:, id: 0)
|
|
183
185
|
response = @connection.post do |req|
|
|
184
186
|
req.body = {
|
data/lib/viabtc/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: viabtc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kerem Bozdas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-11-
|
|
11
|
+
date: 2018-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|