chinashop 0.1.0 → 0.2.0

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Njk0YWIxYzc3YzhkYjNjZjdlMTMwOTFhNTZmMjc3OWNiMjg5NzVhYg==
4
+ YTk2YzcwMWMwYTQ2MWI0ODM2YTZmNTIwN2UyYjBkYzc3OWM5MjJmOA==
5
5
  data.tar.gz: !binary |-
6
- YWJiMWNiZWFhZWY1YzliNjJjODMxZjQ3NzVmMGJkNzE4MjIwMzUzMw==
6
+ ZTllMDU1ZTUxMjdmOGY0NmZlMzBmODZiNTZiMjI0MmQxNWYyYTYzZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YmExYjc2MzhkYzFlYzcxYmRmYWYyNzI5NDk1NDllY2IwN2QwZjhmMTgxODVm
10
- YjQ5NjMzNjFhYWU1YTE5OTY1OTZhYjE3MmU3NjRkYWRjNzJkMTMxYWFiYTRj
11
- OWNkYmI3Mjg1NTFhYjEzNDlkMmZlZjk3ODQ2N2YzODFmYmViYTk=
9
+ ZGI2YzU4OWNlNmVmNGI3ZDE4NGE5ZjJjYjM2ZGY4YTQ2NWUxZDIzYjdiOTA1
10
+ NmE2Zjg3YmU1N2QxOWMyOTk2NTFiOGM3MDZlNjI4MGQxY2JhN2EyOWE4N2M1
11
+ MjQyZTI5YjM3ZWY3ZmU0MDgzNGY2YTFlYTYwMjZmZWIxZDY0ZmI=
12
12
  data.tar.gz: !binary |-
13
- ODgwOTNhNzNkYmQxMDY1OGM0NWIyNzY3Mjc5NTA2ZjBhNGVmMjZlMDBjYzRi
14
- OWFkZDgzNzgyZDE1MzYwODY4Nzg2YTk2NTRkMDE0OWQ3NDJkODFjZGI0NmEy
15
- YTczZjUzMzRhOGU5NGI3ZjA3M2EwOGY4MzA0NzM2ZTMwZmVjNDg=
13
+ YTdmNjUzMjUwNDlhZjMzZTRmOTg5YWM2ODBjZjliZDU3YmMyM2EzN2M5MTY1
14
+ ZTk3NDJmMjNjMzMyM2RiOThhOTJlNDM3NzVlNDAyODNlOGI4M2FjMDBkZjRi
15
+ NzBmMTIxNzQyYTNiMjczNzU4OTBkZDEzMjYxMzdhM2QxMzY4NzQ=
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  The start of a btcchina library. The btcchina api is currently very basic so don't expect any magic.
2
2
 
3
+ If you are feeling generous, throw me some btc: 13rhHcFx8AWej5F1VYAudHc1SupJMTJKZU
4
+
3
5
  Usage
4
6
  --------
5
7
  ````ruby
@@ -131,10 +133,20 @@ puts ChinaShop.deposits.all
131
133
 
132
134
  ## Trades
133
135
 
134
- Returns recent trades. Accessed via `ChinaShop.trades`.
136
+ Returns the last 24 hours of trades. Accessed via `ChinaShop.trades`.
135
137
 
136
138
  ````ruby
137
139
  puts ChinaShop.trades
140
+ puts ChinaShop.trades(50000)
141
+ ````
142
+
143
+ ## Trade History
144
+
145
+ Passing in no value will return the last 100 trades. Passing in a trade id will return 100 trades starting from that id. Accessed via `ChinaShop.trade_history`.
146
+
147
+ ````ruby
148
+ puts ChinaShop.trade_history
149
+ puts ChinaShop.trade_history(50000)
138
150
  ````
139
151
 
140
152
  ## Order Book
@@ -145,7 +157,6 @@ Returns the current order book. Accessed via `ChinaShop.order_book`.
145
157
  puts ChinaShop.order_book
146
158
  ````
147
159
 
148
-
149
160
  License and Author
150
161
  ==================
151
162
  Author:: Bryan Brandau <agent462@gmail.com>
@@ -63,5 +63,14 @@ module ChinaShop
63
63
  def trades
64
64
  get('https://data.btcchina.com/data/trades')
65
65
  end
66
+
67
+ def trade_history(since = nil)
68
+ if since.nil?
69
+ get('https://data.btcchina.com/data/historydata')
70
+ else
71
+ get("https://data.btcchina.com/data/historydata?since=#{since}")
72
+ end
73
+ end
74
+
66
75
  end
67
76
  end
@@ -1,3 +1,3 @@
1
1
  module ChinaShop
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chinashop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Brandau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-04 00:00:00.000000000 Z
11
+ date: 2013-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec