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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f044f58c49d1a3730b6dac96a140e26eb9d22b3
4
- data.tar.gz: bf63518bccc4e44ab86f98bd446ec1b6b53e6ac6
3
+ metadata.gz: 089c6aade0f652ee7704b1fa94ca0cc8a66b6779
4
+ data.tar.gz: 3ebe5f743e8061bedfeb4dfa3b80951dc885c9bc
5
5
  SHA512:
6
- metadata.gz: 33594cfa11ff521ccdb2a05e8835dee32394070d341c1924d78546e3c1628f820f78dce4529456916b9929cae43c6cb6e818c1f748739cda4a6bcfaf19f3803b
7
- data.tar.gz: 115a5a2a9c4908daa74e7a2ff9db3d1789b64c480e28760acde63cbb812049da392dc3b0986d91121e51a58f45e5f9adfc1c1ee3dcb175a484c17e2d2fddd2ab
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
+
@@ -1,3 +1,3 @@
1
1
  module Poloniex
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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
- # Set nonce
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poloniex_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian McMichael