poloniex_api 0.0.5 → 0.0.6
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/version.rb +1 -1
- data/lib/poloniex.rb +20 -18
- 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: 089c6aade0f652ee7704b1fa94ca0cc8a66b6779
|
|
4
|
+
data.tar.gz: 3ebe5f743e8061bedfeb4dfa3b80951dc885c9bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 782b53f75a286b054b03f676c064fb684d6b6a63177607790ae1a3918d856630b442784ff4fd53be6c2c1c5fe4166ab397984493277d268e0fc7c60e113355ad
|
|
7
|
+
data.tar.gz: d26a7650124f25d53837cfcf4952ae909ac04816f6ef63d2d692ed2c8d9eec6a0aea4e40c9263fabe9ac7430b2656fb23cd7f11af273294df675d3ec23efad50
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [Unreleased]
|
|
5
|
+
|
|
6
|
+
- Ensure `nonce` is incremented prior to each request retry
|
|
7
|
+
|
|
4
8
|
## [0.0.5] - 2017-08-30
|
|
5
9
|
|
|
6
10
|
### Changed
|
|
@@ -30,8 +34,9 @@ All notable changes to this project will be documented in this file.
|
|
|
30
34
|
### Added
|
|
31
35
|
- Public and private API commands return JSON response
|
|
32
36
|
|
|
33
|
-
[Unreleased]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.2...HEAD
|
|
34
37
|
[0.0.2]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.1...v0.0.2
|
|
35
38
|
[0.0.3]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.2...v0.0.3
|
|
36
39
|
[0.0.4]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.3...v0.0.4
|
|
37
40
|
[0.0.5]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.4...v0.0.5
|
|
41
|
+
[Unreleased]: https://github.com/brianmcmichael/poloniex_api/compare/v0.0.5...HEAD
|
|
42
|
+
|
data/lib/poloniex/version.rb
CHANGED
data/lib/poloniex.rb
CHANGED
|
@@ -105,30 +105,32 @@ module Poloniex
|
|
|
105
105
|
|
|
106
106
|
# private?
|
|
107
107
|
if cmd_type == 'Private'
|
|
108
|
-
payload['uri'] = PRIVATE_API_BASE
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
args['nonce'] = self.nonce
|
|
109
|
+
payload['uri'] = PRIVATE_API_BASE
|
|
112
110
|
|
|
113
111
|
# Add args to payload
|
|
114
112
|
payload['data'] = args
|
|
115
113
|
|
|
116
|
-
digest = OpenSSL::Digest.new(SHA512)
|
|
117
|
-
# Sign data with secret key
|
|
118
|
-
sign = OpenSSL::HMAC.hexdigest(
|
|
119
|
-
digest,
|
|
120
|
-
secret.encode(UTF_8),
|
|
121
|
-
URI.encode_www_form(args).encode(UTF_8)
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
# Add headers to payload
|
|
125
|
-
payload['headers'] = {
|
|
126
|
-
'Content-Type' => 'application/x-www-form-urlencoded',
|
|
127
|
-
'Sign' => sign,
|
|
128
|
-
'Key' => key
|
|
129
|
-
}
|
|
130
|
-
|
|
131
114
|
RETRY_DELAYS.each do |delay|
|
|
115
|
+
|
|
116
|
+
# Update nonce
|
|
117
|
+
args['nonce'] = self.nonce
|
|
118
|
+
|
|
119
|
+
digest = OpenSSL::Digest.new(SHA512)
|
|
120
|
+
# Sign data with secret key
|
|
121
|
+
sign = OpenSSL::HMAC.hexdigest(
|
|
122
|
+
digest,
|
|
123
|
+
secret.encode(UTF_8),
|
|
124
|
+
URI.encode_www_form(args).encode(UTF_8)
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# Add headers to payload
|
|
128
|
+
payload['headers'] = {
|
|
129
|
+
'Content-Type' => 'application/x-www-form-urlencoded',
|
|
130
|
+
'Sign' => sign,
|
|
131
|
+
'Key' => key
|
|
132
|
+
}
|
|
133
|
+
|
|
132
134
|
begin
|
|
133
135
|
# attempt call
|
|
134
136
|
# Send the call
|