poloniex_api 0.0.2 → 0.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/CHANGELOG.md +6 -1
- data/lib/poloniex.rb +10 -11
- data/lib/poloniex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d67e0b5029e2cf691571bb8e164dfc71f3cc762f
|
|
4
|
+
data.tar.gz: b17f7d6c8b83a7c726f9858be42bc4a5e3dd1da2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee30d2d735508fc43205aa5ea7d1b27b47f6e687472b0e3e97a201373cf32623edd22f8285932595b7e3dd43a35cce92619bc688aacdc5a0ec9e39da38274ee2
|
|
7
|
+
data.tar.gz: 0ed9c4f50b66b9ed894ad3f07eda3c6e316228c440a9377e0a6592b27878e57656ccde31ce883dd64d07e4c70e7418bee63bb5663758446221a893f354400ebc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
-
## [
|
|
4
|
+
## [0.0.3] - 2017-08-30
|
|
5
|
+
|
|
6
|
+
### Changed
|
|
7
|
+
- Fixed logger calls on timeouts
|
|
8
|
+
- Replaced `Digest::HMAC` with `OpenSSL::HMAC` for Ruby 2.2+ support
|
|
5
9
|
|
|
6
10
|
## [0.0.2] - 2017-08-29
|
|
7
11
|
|
|
@@ -18,3 +22,4 @@ All notable changes to this project will be documented in this file.
|
|
|
18
22
|
|
|
19
23
|
[Unreleased]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.2...HEAD
|
|
20
24
|
[0.0.2]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.1...v0.0.2
|
|
25
|
+
[0.0.3]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.2...v0.0.3
|
data/lib/poloniex.rb
CHANGED
|
@@ -93,6 +93,7 @@ module Poloniex
|
|
|
93
93
|
# if an error is returned from poloniex.com
|
|
94
94
|
# - returns decoded json api message """
|
|
95
95
|
def call(command, args = {})
|
|
96
|
+
puts command
|
|
96
97
|
# Get command type
|
|
97
98
|
cmd_type = self.check_command(command)
|
|
98
99
|
|
|
@@ -113,12 +114,12 @@ module Poloniex
|
|
|
113
114
|
# Add args to payload
|
|
114
115
|
payload['data'] = args
|
|
115
116
|
|
|
116
|
-
digest = Digest
|
|
117
|
+
digest = OpenSSL::Digest.new(SHA512)
|
|
117
118
|
# Sign data with secret key
|
|
118
|
-
sign =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
sign = OpenSSL::HMAC.hexdigest(
|
|
120
|
+
digest,
|
|
121
|
+
secret.encode(UTF_8),
|
|
122
|
+
URI.encode_www_form(args).encode(UTF_8)
|
|
122
123
|
)
|
|
123
124
|
|
|
124
125
|
# Add headers to payload
|
|
@@ -141,12 +142,10 @@ module Poloniex
|
|
|
141
142
|
if delay == RETRY_DELAYS.last
|
|
142
143
|
raise Poloniex::RetryException.new "Retry delays exhausted #{problem}"
|
|
143
144
|
else
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
self.logger.debug(problem)
|
|
146
|
+
self.logger.info("-- delaying for #{delay} seconds")
|
|
146
147
|
sleep(delay)
|
|
147
148
|
end
|
|
148
|
-
rescue => e
|
|
149
|
-
puts e
|
|
150
149
|
end
|
|
151
150
|
|
|
152
151
|
|
|
@@ -168,8 +167,8 @@ module Poloniex
|
|
|
168
167
|
if delay == RETRY_DELAYS.last
|
|
169
168
|
raise Poloniex::RetryException.new "Retry delays exhausted #{problem}"
|
|
170
169
|
else
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
self.logger.debug(problem)
|
|
171
|
+
self.logger.info("-- delaying for #{delay} seconds")
|
|
173
172
|
sleep(delay)
|
|
174
173
|
end
|
|
175
174
|
end
|
data/lib/poloniex/version.rb
CHANGED