cointrader.net 0.1.0 → 0.1.2
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/README.md +3 -0
- data/lib/cointrader.net/client/request.rb +6 -1
- data/lib/cointrader.net/client/stats.rb +30 -0
- data/lib/cointrader.net/version.rb +1 -1
- data/spec/client_spec.rb +30 -0
- data/spec/fixtures/vcr_cassettes/orders.yml +106 -0
- data/spec/fixtures/vcr_cassettes/stats_24h.yml +63 -0
- data/spec/fixtures/vcr_cassettes/stats_7d.yml +63 -0
- metadata +7 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: caae2774afd773a12774b71484f63b71d8aec463
         | 
| 4 | 
            +
              data.tar.gz: 43e1db4c150b5476f6cba4a08f6dd7e3a15a2e41
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5cedcb28673bd337f0b52b28eb3db2126d826f845f8ddfbfc8335da10f92ac337ce7b5b43e40ed7ed1d989533e73f657fd8ef18c0c3ea1c758dbfbc31f386260
         | 
| 7 | 
            +
              data.tar.gz: 34e135ff2b92e0b0873d3eba6a0e64ddb43ac45954130a43f76663e6ee251490c337e4c2a7419291f6655ce037a2ea56a7328ee34ce9caa0bb0e0579214ec42f
         | 
    
        data/README.md
    CHANGED
    
    | @@ -24,6 +24,9 @@ Or install it yourself as: | |
| 24 24 | 
             
            Cointrader.configure do |c|
         | 
| 25 25 | 
             
              c.api_key    = 'API_KEY'
         | 
| 26 26 | 
             
              c.api_secret = 'API_SECRET'
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              # Sandbox API
         | 
| 29 | 
            +
              # c.api_url = 'https://private-anon-b5aa2a7bf-cointrader.apiary-mock.com/api4'
         | 
| 27 30 | 
             
            end
         | 
| 28 31 |  | 
| 29 32 | 
             
            client = Cointrader::Client.new
         | 
| @@ -11,14 +11,19 @@ module Cointrader | |
| 11 11 |  | 
| 12 12 | 
             
                protected
         | 
| 13 13 |  | 
| 14 | 
            +
                def join_params params, *names
         | 
| 15 | 
            +
                  names.map { |name| params[name] }.compact.join('/').downcase
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
             | 
| 14 18 | 
             
                def request(method, path, body={})
         | 
| 15 19 | 
             
                  response = hmac_request(method, path, body)
         | 
| 16 20 |  | 
| 17 | 
            -
                  # The API sucks  | 
| 21 | 
            +
                  # The API sucks so we need to repair JSON sometimes.
         | 
| 18 22 | 
             
                  case path
         | 
| 19 23 | 
             
                  when '/account/balance'
         | 
| 20 24 | 
             
                    response.gsub!(/\s/, '')        # Remove whitespace.
         | 
| 21 25 | 
             
                    response.gsub!(/}}(?!$)/, '},') # Replace bracket with comma not at the end.
         | 
| 26 | 
            +
                    response.gsub!('},}', '}}')     # Remove trailing comma.
         | 
| 22 27 | 
             
                    response.gsub!(/}}$/, '}}}')    # Add a bracket at the end.
         | 
| 23 28 | 
             
                  end
         | 
| 24 29 |  | 
| @@ -3,5 +3,35 @@ module Cointrader | |
| 3 3 | 
             
                def symbol
         | 
| 4 4 | 
             
                  request(:get, '/stats/symbol')
         | 
| 5 5 | 
             
                end
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                def stats_24h params={}
         | 
| 8 | 
            +
                  params = get_defaults(params)
         | 
| 9 | 
            +
                  request(:get, "/stats/daily/#{params[:currency_pair]}")
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                def stats_7d params={}
         | 
| 13 | 
            +
                  params = get_defaults(params)
         | 
| 14 | 
            +
                  request(:get, "/stats/weekly/#{params[:currency_pair]}")
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                # Returns open orders.
         | 
| 18 | 
            +
                # currency_pair - 6 character currency pair. Eg: BTCUSD. Defaults to USD if not provided. String, optional
         | 
| 19 | 
            +
                # book          - Filter orders. [buy|sell|all], string, optional
         | 
| 20 | 
            +
                # limit         - Limit resut count. Integer, optional
         | 
| 21 | 
            +
                def orders params={}
         | 
| 22 | 
            +
                  params = get_defaults(params)
         | 
| 23 | 
            +
                  path   = join_params(params, :currency_pair, :book, :limit)
         | 
| 24 | 
            +
                  request(:get, "/stats/orders/#{path}")
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                private
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                def get_defaults params
         | 
| 30 | 
            +
                  params.merge({
         | 
| 31 | 
            +
                    currency_pair: 'BTCUSD',
         | 
| 32 | 
            +
                    book: 'all',
         | 
| 33 | 
            +
                    limit: 20
         | 
| 34 | 
            +
                  })
         | 
| 35 | 
            +
                end
         | 
| 6 36 | 
             
              end
         | 
| 7 37 | 
             
            end
         | 
    
        data/spec/client_spec.rb
    CHANGED
    
    | @@ -12,6 +12,36 @@ describe Cointrader::Client do | |
| 12 12 | 
             
                    end
         | 
| 13 13 | 
             
                  end
         | 
| 14 14 | 
             
                end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                # TODO(maros): Add more detailed tests.
         | 
| 17 | 
            +
                describe '#stats_24h' do
         | 
| 18 | 
            +
                  it 'returns 24 hour sliding statistics' do
         | 
| 19 | 
            +
                    VCR.use_cassette('stats_24h') do
         | 
| 20 | 
            +
                      response = subject.stats_24h
         | 
| 21 | 
            +
                      expect_success(response)
         | 
| 22 | 
            +
                    end
         | 
| 23 | 
            +
                  end
         | 
| 24 | 
            +
                end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                # TODO(maros): Add more detailed tests.
         | 
| 27 | 
            +
                describe '#stats_7d' do
         | 
| 28 | 
            +
                  it 'returns 7 day sliding statistics' do
         | 
| 29 | 
            +
                    VCR.use_cassette('stats_7d') do
         | 
| 30 | 
            +
                      response = subject.stats_7d
         | 
| 31 | 
            +
                      expect_success(response)
         | 
| 32 | 
            +
                    end
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                # TODO(maros): Add more detailed tests.
         | 
| 37 | 
            +
                describe '#orders' do
         | 
| 38 | 
            +
                  it 'returns open orders' do
         | 
| 39 | 
            +
                    VCR.use_cassette('orders') do
         | 
| 40 | 
            +
                      response = subject.orders
         | 
| 41 | 
            +
                      expect_success(response)
         | 
| 42 | 
            +
                    end
         | 
| 43 | 
            +
                  end
         | 
| 44 | 
            +
                end
         | 
| 15 45 | 
             
              end
         | 
| 16 46 |  | 
| 17 47 | 
             
              describe 'account' do
         | 
| @@ -0,0 +1,106 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://private-anon-b5aa2a7bf-cointrader.apiary-mock.com/api4/stats/orders/btcusd/all/20
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: UTF-8
         | 
| 8 | 
            +
                  string: "{}"
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - "*/*; q=0.5, application/xml"
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  Content-Type:
         | 
| 15 | 
            +
                  - application/json
         | 
| 16 | 
            +
                  Content-Length:
         | 
| 17 | 
            +
                  - '2'
         | 
| 18 | 
            +
                  User-Agent:
         | 
| 19 | 
            +
                  - Ruby
         | 
| 20 | 
            +
              response:
         | 
| 21 | 
            +
                status:
         | 
| 22 | 
            +
                  code: 404
         | 
| 23 | 
            +
                  message: Not Found
         | 
| 24 | 
            +
                headers:
         | 
| 25 | 
            +
                  Server:
         | 
| 26 | 
            +
                  - Cowboy
         | 
| 27 | 
            +
                  Connection:
         | 
| 28 | 
            +
                  - keep-alive
         | 
| 29 | 
            +
                  X-Apiary-Ratelimit-Limit:
         | 
| 30 | 
            +
                  - '120'
         | 
| 31 | 
            +
                  X-Apiary-Ratelimit-Remaining:
         | 
| 32 | 
            +
                  - '119'
         | 
| 33 | 
            +
                  Content-Type:
         | 
| 34 | 
            +
                  - text/html; charset=utf-8
         | 
| 35 | 
            +
                  Content-Length:
         | 
| 36 | 
            +
                  - '2586'
         | 
| 37 | 
            +
                  Etag:
         | 
| 38 | 
            +
                  - W/"M/h32uJf7tbZczmfVofE5A=="
         | 
| 39 | 
            +
                  Date:
         | 
| 40 | 
            +
                  - Sun, 22 Feb 2015 18:42:01 GMT
         | 
| 41 | 
            +
                  Via:
         | 
| 42 | 
            +
                  - 1.1 vegur
         | 
| 43 | 
            +
                body:
         | 
| 44 | 
            +
                  encoding: ASCII-8BIT
         | 
| 45 | 
            +
                  string: !binary |-
         | 
| 46 | 
            +
                    PCFkb2N0eXBlIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPG1ldGEgY2hhcnNl
         | 
| 47 | 
            +
                    dD0idXRmLTgiPgo8dGl0bGU+YXBpYXJ5Lmlv4oCUNDA04oCUTm8gUmVzb3Vy
         | 
| 48 | 
            +
                    Y2UgRm91bmQhPC90aXRsZT4KPGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBocmVm
         | 
| 49 | 
            +
                    PSJodHRwczovL2FwaWFyeS5hLnNzbC5mYXN0bHkubmV0L2Fzc2V0cy9jc3Mv
         | 
| 50 | 
            +
                    bm9ybWFsaXplLWMxYTYwMTUwNDBlZjEyMDEuY3NzIj4KPGxpbmsgcmVsPSJz
         | 
| 51 | 
            +
                    dHlsZXNoZWV0IiBocmVmPSJodHRwczovL2FwaWFyeS5hLnNzbC5mYXN0bHku
         | 
| 52 | 
            +
                    bmV0L2Fzc2V0cy9jc3MvZXJyb3ItNTEzOWJmNDAxYzk3OTJhYy5jc3MiPgo8
         | 
| 53 | 
            +
                    Ym9keT4KPGRpdiBpZD0iYmciPjwvZGl2PgogPGRpdiBpZD0ibWVzc2FnZSI+
         | 
| 54 | 
            +
                    CiAgPGgxPlRoZSByZXNvdXJjZSB5b3UncmUgbG9va2luZyBmb3IgZG9lc24n
         | 
| 55 | 
            +
                    dCBleGlzdC4gPGJyPlBsZWFzZSBjaGVjayB0aGUgPGEgaHJlZj0iaHR0cDov
         | 
| 56 | 
            +
                    L2RvY3MuY29pbnRyYWRlci5hcGlhcnkuaW8vIj5BUEkgZG9jdW1lbnRhdGlv
         | 
| 57 | 
            +
                    bjwvYT4gb3IgaGF2ZSBhIGxvb2sgb24gYXZhaWxhYmxlIHJlc291cmNlcyBi
         | 
| 58 | 
            +
                    ZWxvdy48L2gxPgogIDxwPjwvcD4KICA8b2w+CiAgICAgICAgICA8c2VjdGlv
         | 
| 59 | 
            +
                    bj48aDI+Q3VycmVuY2llczwvaDI+CiAgICAgICAgICAgICAgPC9zZWN0aW9u
         | 
| 60 | 
            +
                    PgogICAgICAgICAgPHNlY3Rpb24+PGgyPlB1YmxpYyBNZXRob2RzIC0gR0VU
         | 
| 61 | 
            +
                    PC9oMj4KICAgICAgICAgICAgICAgICAgPGxpPjxiPkdFVDwvYj4gL2FwaTQv
         | 
| 62 | 
            +
                    c3RhdHMvc3ltYm9sPC9saT4KICAgICAgICAgICAgICAgICAgPGxpPjxiPkdF
         | 
| 63 | 
            +
                    VDwvYj4gL2FwaTQvc3RhdHMvZGFpbHkve2N1cnJlbmN5X3BhaXJ9PC9saT4K
         | 
| 64 | 
            +
                    ICAgICAgICAgICAgICAgICAgPGxpPjxiPkdFVDwvYj4gL2FwaTQvc3RhdHMv
         | 
| 65 | 
            +
                    d2Vla2x5L3tjdXJyZW5jeV9wYWlyfTwvbGk+CiAgICAgICAgICAgICAgICAg
         | 
| 66 | 
            +
                    IDxsaT48Yj5HRVQ8L2I+IC9hcGk0L3N0YXRzL29yZGVycy97Y3VycmVuY3lf
         | 
| 67 | 
            +
                    cGFpcn0ve2J1eXxzZWxsfGFsbH0ve2xpbWl0fTwvbGk+CiAgICAgICAgICAg
         | 
| 68 | 
            +
                    ICAgICAgIDxsaT48Yj5HRVQ8L2I+IC9hcGk0L3N0YXRzL2hpZ2gve2N1cnJl
         | 
| 69 | 
            +
                    bmN5X3BhaXJ9PC9saT4KICAgICAgICAgICAgICAgICAgPGxpPjxiPkdFVDwv
         | 
| 70 | 
            +
                    Yj4gL2FwaTQvc3RhdHMvbG93L3tjdXJyZW5jeV9wYWlyfTwvbGk+CiAgICAg
         | 
| 71 | 
            +
                    ICAgICAgICAgICAgIDxsaT48Yj5HRVQ8L2I+IC9hcGk0L3N0YXRzL2J1eXBy
         | 
| 72 | 
            +
                    aWNlL3tjdXJyZW5jeV9wYWlyfS97YW1vdW50fTwvbGk+CiAgICAgICAgICAg
         | 
| 73 | 
            +
                    ICAgICAgIDxsaT48Yj5HRVQ8L2I+IC9hcGk0L3N0YXRzL3NlbGxwcmljZS97
         | 
| 74 | 
            +
                    Y3VycmVuY3lfcGFpcn0ve3F1YW50aXR5fTwvbGk+CiAgICAgICAgICAgICAg
         | 
| 75 | 
            +
                    ICAgIDxsaT48Yj5HRVQ8L2I+IC9hcGk0L3N0YXRzL3RyYWRlcy97Y3VycmVu
         | 
| 76 | 
            +
                    Y3lfcGFpcn0ve2xpbWl0fS97b2Zmc2V0fTwvbGk+CiAgICAgICAgICAgICAg
         | 
| 77 | 
            +
                    ICAgIDxsaT48Yj5HRVQ8L2I+IC9hcGk0L3N0YXRzL21hcmtldC97Y3VycmVu
         | 
| 78 | 
            +
                    Y3lfcGFpcn0ve2xpbWl0fS97b2Zmc2V0fTwvbGk+CiAgICAgICAgICAgICAg
         | 
| 79 | 
            +
                    PC9zZWN0aW9uPgogICAgICAgICAgPHNlY3Rpb24+PGgyPkF1dGhlbnRpY2F0
         | 
| 80 | 
            +
                    ZWQgTWV0aG9kcyAtIFBPU1Q8L2gyPgogICAgICAgICAgICAgICAgICA8bGk+
         | 
| 81 | 
            +
                    PGI+UE9TVDwvYj4gL2FwaTQvYWNjb3VudC9iYWxhbmNlPC9saT4KICAgICAg
         | 
| 82 | 
            +
                    ICAgICAgICAgICAgPGxpPjxiPlBPU1Q8L2I+IC9hcGk0L2FjY291bnQvZmVl
         | 
| 83 | 
            +
                    czwvbGk+CiAgICAgICAgICAgICAgICAgIDxsaT48Yj5QT1NUPC9iPiAvYXBp
         | 
| 84 | 
            +
                    NC9hY2NvdW50L2xpc3RiYW5rPC9saT4KICAgICAgICAgICAgICAgICAgPGxp
         | 
| 85 | 
            +
                    PjxiPlBPU1Q8L2I+IC9hcGk0L2FjY291bnQvYnRjYWRkcmVzczwvbGk+CiAg
         | 
| 86 | 
            +
                    ICAgICAgICAgICAgICAgIDxsaT48Yj5QT1NUPC9iPiAvYXBpNC9hY2NvdW50
         | 
| 87 | 
            +
                    L3dpdGhkcmF3PC9saT4KICAgICAgICAgICAgICAgICAgPGxpPjxiPlBPU1Q8
         | 
| 88 | 
            +
                    L2I+IC9hcGk0L2FjY291bnQvaGlzdG9yeTwvbGk+CiAgICAgICAgICAgICAg
         | 
| 89 | 
            +
                    ICAgIDxsaT48Yj5QT1NUPC9iPiAvYXBpNC9vcmRlci97Y3VycmVuY3lfcGFp
         | 
| 90 | 
            +
                    cn0vYnV5PC9saT4KICAgICAgICAgICAgICAgICAgPGxpPjxiPlBPU1Q8L2I+
         | 
| 91 | 
            +
                    IC9hcGk0L29yZGVyL3tjdXJyZW5jeV9wYWlyfS9zZWxsPC9saT4KICAgICAg
         | 
| 92 | 
            +
                    ICAgICAgICAgICAgPGxpPjxiPlBPU1Q8L2I+IC9hcGk0L29yZGVyL3tjdXJy
         | 
| 93 | 
            +
                    ZW5jeV9wYWlyfS9saXN0PC9saT4KICAgICAgICAgICAgICAgICAgPGxpPjxi
         | 
| 94 | 
            +
                    PlBPU1Q8L2I+IC9hcGk0L29yZGVyL3tjdXJyZW5jeV9wYWlyfS9jYW5jZWw8
         | 
| 95 | 
            +
                    L2xpPgogICAgICAgICAgICAgICAgICA8bGk+PGI+UE9TVDwvYj4gL2FwaTQv
         | 
| 96 | 
            +
                    b3JkZXIve2N1cnJlbmN5X3BhaXJ9L2NhbmNlbGFsbDwvbGk+CiAgICAgICAg
         | 
| 97 | 
            +
                    ICAgICAgICAgIDxsaT48Yj5QT1NUPC9iPiAvYXBpNC9vcmRlci97Y3VycmVu
         | 
| 98 | 
            +
                    Y3lfcGFpcn0vbWFya2V0YnV5PC9saT4KICAgICAgICAgICAgICAgICAgPGxp
         | 
| 99 | 
            +
                    PjxiPlBPU1Q8L2I+IC9hcGk0L29yZGVyL3tjdXJyZW5jeV9wYWlyfS9tYXJr
         | 
| 100 | 
            +
                    ZXRzZWxsPC9saT4KICAgICAgICAgICAgICAgICAgPGxpPjxiPlBPU1Q8L2I+
         | 
| 101 | 
            +
                    IC9hcGk0L2FjY291bnQvdHJhZGVoaXN0b3J5L3tjdXJyZW5jeV9wYWlyfTwv
         | 
| 102 | 
            +
                    bGk+CiAgICAgICAgICAgICAgPC9zZWN0aW9uPgogICAgICA8L29sPgogIDwv
         | 
| 103 | 
            +
                    ZGl2Pgo8L2JvZHk+CjwvaHRtbD4K
         | 
| 104 | 
            +
                http_version: 
         | 
| 105 | 
            +
              recorded_at: Sun, 22 Feb 2015 18:42:52 GMT
         | 
| 106 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,63 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://private-anon-b5aa2a7bf-cointrader.apiary-mock.com/api4/stats/daily/BTCUSD
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: UTF-8
         | 
| 8 | 
            +
                  string: "{}"
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - "*/*; q=0.5, application/xml"
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  Content-Type:
         | 
| 15 | 
            +
                  - application/json
         | 
| 16 | 
            +
                  Content-Length:
         | 
| 17 | 
            +
                  - '2'
         | 
| 18 | 
            +
                  User-Agent:
         | 
| 19 | 
            +
                  - Ruby
         | 
| 20 | 
            +
              response:
         | 
| 21 | 
            +
                status:
         | 
| 22 | 
            +
                  code: 200
         | 
| 23 | 
            +
                  message: OK
         | 
| 24 | 
            +
                headers:
         | 
| 25 | 
            +
                  Server:
         | 
| 26 | 
            +
                  - Cowboy
         | 
| 27 | 
            +
                  Connection:
         | 
| 28 | 
            +
                  - keep-alive
         | 
| 29 | 
            +
                  X-Apiary-Ratelimit-Limit:
         | 
| 30 | 
            +
                  - '120'
         | 
| 31 | 
            +
                  X-Apiary-Ratelimit-Remaining:
         | 
| 32 | 
            +
                  - '119'
         | 
| 33 | 
            +
                  X-Apiary-Transaction-Id:
         | 
| 34 | 
            +
                  - 54ea1e3dcdf6dc03006f6fc1
         | 
| 35 | 
            +
                  Date:
         | 
| 36 | 
            +
                  - Sun, 22 Feb 2015 18:21:49 GMT
         | 
| 37 | 
            +
                  Transfer-Encoding:
         | 
| 38 | 
            +
                  - chunked
         | 
| 39 | 
            +
                  Via:
         | 
| 40 | 
            +
                  - 1.1 vegur
         | 
| 41 | 
            +
                body:
         | 
| 42 | 
            +
                  encoding: UTF-8
         | 
| 43 | 
            +
                  string: |-
         | 
| 44 | 
            +
                    {
         | 
| 45 | 
            +
                        "success":true,
         | 
| 46 | 
            +
                        "message":"24hr BTCUSD Stats",
         | 
| 47 | 
            +
                        "data":
         | 
| 48 | 
            +
                        {
         | 
| 49 | 
            +
                            "BTCUSD":
         | 
| 50 | 
            +
                            {
         | 
| 51 | 
            +
                            "lastTradePrice":"453.00",
         | 
| 52 | 
            +
                            "bid":"420.00",
         | 
| 53 | 
            +
                            "offer":"426.22",
         | 
| 54 | 
            +
                            "high":"453.00",
         | 
| 55 | 
            +
                            "low":"420.00",
         | 
| 56 | 
            +
                            "average":"429.88",
         | 
| 57 | 
            +
                            "volume":"38.26969417"
         | 
| 58 | 
            +
                            }
         | 
| 59 | 
            +
                        }
         | 
| 60 | 
            +
                    }
         | 
| 61 | 
            +
                http_version: 
         | 
| 62 | 
            +
              recorded_at: Sun, 22 Feb 2015 18:22:40 GMT
         | 
| 63 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,63 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: https://private-anon-b5aa2a7bf-cointrader.apiary-mock.com/api4/stats/weekly/BTCUSD
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: UTF-8
         | 
| 8 | 
            +
                  string: "{}"
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  Accept:
         | 
| 11 | 
            +
                  - "*/*; q=0.5, application/xml"
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip, deflate
         | 
| 14 | 
            +
                  Content-Type:
         | 
| 15 | 
            +
                  - application/json
         | 
| 16 | 
            +
                  Content-Length:
         | 
| 17 | 
            +
                  - '2'
         | 
| 18 | 
            +
                  User-Agent:
         | 
| 19 | 
            +
                  - Ruby
         | 
| 20 | 
            +
              response:
         | 
| 21 | 
            +
                status:
         | 
| 22 | 
            +
                  code: 200
         | 
| 23 | 
            +
                  message: OK
         | 
| 24 | 
            +
                headers:
         | 
| 25 | 
            +
                  Server:
         | 
| 26 | 
            +
                  - Cowboy
         | 
| 27 | 
            +
                  Connection:
         | 
| 28 | 
            +
                  - keep-alive
         | 
| 29 | 
            +
                  X-Apiary-Ratelimit-Limit:
         | 
| 30 | 
            +
                  - '120'
         | 
| 31 | 
            +
                  X-Apiary-Ratelimit-Remaining:
         | 
| 32 | 
            +
                  - '118'
         | 
| 33 | 
            +
                  X-Apiary-Transaction-Id:
         | 
| 34 | 
            +
                  - 54ea1e3dcdf6dc03006f6fc2
         | 
| 35 | 
            +
                  Date:
         | 
| 36 | 
            +
                  - Sun, 22 Feb 2015 18:21:49 GMT
         | 
| 37 | 
            +
                  Transfer-Encoding:
         | 
| 38 | 
            +
                  - chunked
         | 
| 39 | 
            +
                  Via:
         | 
| 40 | 
            +
                  - 1.1 vegur
         | 
| 41 | 
            +
                body:
         | 
| 42 | 
            +
                  encoding: UTF-8
         | 
| 43 | 
            +
                  string: |-
         | 
| 44 | 
            +
                    {
         | 
| 45 | 
            +
                        "success":true,
         | 
| 46 | 
            +
                        "message":"7 Day BTCUSD Stats",
         | 
| 47 | 
            +
                        "data":
         | 
| 48 | 
            +
                        {
         | 
| 49 | 
            +
                            "BTCUSD":
         | 
| 50 | 
            +
                            {
         | 
| 51 | 
            +
                                "lastTradePrice":"640.56",
         | 
| 52 | 
            +
                                "bid":"640.56",
         | 
| 53 | 
            +
                                "offer":"643.52",
         | 
| 54 | 
            +
                                "high":"690.00",
         | 
| 55 | 
            +
                                "low":"550.00",
         | 
| 56 | 
            +
                                "average":"629.55",
         | 
| 57 | 
            +
                                "volume":"616.24892785"
         | 
| 58 | 
            +
                            }
         | 
| 59 | 
            +
                        }
         | 
| 60 | 
            +
                    }
         | 
| 61 | 
            +
                http_version: 
         | 
| 62 | 
            +
              recorded_at: Sun, 22 Feb 2015 18:22:41 GMT
         | 
| 63 | 
            +
            recorded_with: VCR 2.9.3
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cointrader.net
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Maros Hluska
         | 
| @@ -87,6 +87,9 @@ files: | |
| 87 87 | 
             
            - lib/cointrader.net/version.rb
         | 
| 88 88 | 
             
            - spec/client_spec.rb
         | 
| 89 89 | 
             
            - spec/fixtures/vcr_cassettes/balance.yml
         | 
| 90 | 
            +
            - spec/fixtures/vcr_cassettes/orders.yml
         | 
| 91 | 
            +
            - spec/fixtures/vcr_cassettes/stats_24h.yml
         | 
| 92 | 
            +
            - spec/fixtures/vcr_cassettes/stats_7d.yml
         | 
| 90 93 | 
             
            - spec/fixtures/vcr_cassettes/symbol.yml
         | 
| 91 94 | 
             
            - spec/spec_helper.rb
         | 
| 92 95 | 
             
            homepage: https://github.com/mhluska/cointrader.net
         | 
| @@ -116,5 +119,8 @@ summary: Cointrader.net API wrapper | |
| 116 119 | 
             
            test_files:
         | 
| 117 120 | 
             
            - spec/client_spec.rb
         | 
| 118 121 | 
             
            - spec/fixtures/vcr_cassettes/balance.yml
         | 
| 122 | 
            +
            - spec/fixtures/vcr_cassettes/orders.yml
         | 
| 123 | 
            +
            - spec/fixtures/vcr_cassettes/stats_24h.yml
         | 
| 124 | 
            +
            - spec/fixtures/vcr_cassettes/stats_7d.yml
         | 
| 119 125 | 
             
            - spec/fixtures/vcr_cassettes/symbol.yml
         | 
| 120 126 | 
             
            - spec/spec_helper.rb
         |