vertpig 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 551d46218165f1c2338970d3ab635a813dcf8338
4
- data.tar.gz: 9f70e5a69eaefb7343322bde091d7ccd3d6e4a00
3
+ metadata.gz: 1e96908777fb34f76e6b66223ea81fcdaaa4a83b
4
+ data.tar.gz: 4b36f1f4c4cc8ae6ad37e5e6e2afdd59b8d02a88
5
5
  SHA512:
6
- metadata.gz: 1e7cf35713dafa37549aac3b2ec406e0ec7546b5447e1b533a4ac8484b359f4f0168ab83e145bc8893a896bf3e3caf329f8ae9df1a6c789903d9c6f2d871a357
7
- data.tar.gz: cfba5c4640b4ec4ad2d1ef327ce869b719851ebede436090628393f1c69cc7f121132824d99aa0b83017e1f366851f44b91d07f76b179ce4d46aafb2aa44cabd
6
+ metadata.gz: 7f3d3834edb768943640614312656d9c20bf8b1df3ed24dd5c8e3e981ca8f375d3e400d15656f5d7512091f093e071bee11f3e10c5824c61d48c16b3935ac0a6
7
+ data.tar.gz: 2d9d1ea5d3c0c8ef38df32aa630e8c1e984095cb9bd98a5dfcf163c2ed9bdfb6000e584fbd828360bfb907391c52dca5badacc23e7003bc97cde9c56e6ebc6ec
@@ -23,7 +23,7 @@ module Vertpig
23
23
  if key
24
24
  req.params[:apikey] = key
25
25
  req.params[:nonce] = nonce
26
- req.headers[:apisign] = signature(url, nonce)
26
+ req.headers[:apisign] = signature( connection.build_exclusive_url(req.path, req.params), nonce)
27
27
  end
28
28
  end
29
29
 
@@ -33,7 +33,7 @@ module Vertpig
33
33
  private
34
34
 
35
35
  def signature(url, nonce)
36
- OpenSSL::HMAC.hexdigest('sha512', secret, "#{url}?apikey=#{key}&nonce=#{nonce}")
36
+ OpenSSL::HMAC.hexdigest('sha512', secret, "#{url}")
37
37
  end
38
38
 
39
39
  def connection
data/lib/vertpig/order.rb CHANGED
@@ -52,11 +52,12 @@ module Vertpig
52
52
  result = nil
53
53
 
54
54
  begin
55
- result = client.get('/market/buylimit', {
55
+ result = client.get('market/buylimit', {
56
56
  market: market,
57
57
  quantity: amount,
58
58
  rate: price
59
59
  })
60
+ puts result
60
61
  puts "======> BUY FINISH at price: #{'%.8f' % price} - amount: #{amount}"
61
62
  rescue Exception => e
62
63
  puts "======> BUY ERROR #{e}"
@@ -66,7 +67,7 @@ module Vertpig
66
67
  end
67
68
 
68
69
  def self.sell(market, amount, price)
69
- client.get('/market/selllimit', {
70
+ client.get('market/selllimit', {
70
71
  market: market,
71
72
  quantity: amount,
72
73
  rate: price
@@ -74,7 +75,7 @@ module Vertpig
74
75
  end
75
76
 
76
77
  def self.cancel(order_id)
77
- client.get('/market/cancel', {
78
+ client.get('market/cancel', {
78
79
  uuid: order_id
79
80
  })
80
81
  end
@@ -1,3 +1,3 @@
1
1
  module Vertpig
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertpig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vertbase