vertpig 0.0.8 → 0.0.9
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/lib/vertpig/client.rb +2 -2
 - data/lib/vertpig/order.rb +4 -3
 - data/lib/vertpig/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: 1e96908777fb34f76e6b66223ea81fcdaaa4a83b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4b36f1f4c4cc8ae6ad37e5e6e2afdd59b8d02a88
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7f3d3834edb768943640614312656d9c20bf8b1df3ed24dd5c8e3e981ca8f375d3e400d15656f5d7512091f093e071bee11f3e10c5824c61d48c16b3935ac0a6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2d9d1ea5d3c0c8ef38df32aa630e8c1e984095cb9bd98a5dfcf163c2ed9bdfb6000e584fbd828360bfb907391c52dca5badacc23e7003bc97cde9c56e6ebc6ec
         
     | 
    
        data/lib/vertpig/client.rb
    CHANGED
    
    | 
         @@ -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( 
     | 
| 
      
 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} 
     | 
| 
      
 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(' 
     | 
| 
      
 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(' 
     | 
| 
      
 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(' 
     | 
| 
      
 78 
     | 
    
         
            +
                  client.get('market/cancel', {
         
     | 
| 
       78 
79 
     | 
    
         
             
                    uuid: order_id
         
     | 
| 
       79 
80 
     | 
    
         
             
                  })
         
     | 
| 
       80 
81 
     | 
    
         
             
                end
         
     | 
    
        data/lib/vertpig/version.rb
    CHANGED