queru_btce 1.0.2 → 1.0.3
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/LICENSE.md +21 -0
- data/README.md +13 -7
- data/lib/queru_btce/version.rb +1 -1
- data/queru_btce.gemspec +2 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14aa6c1f57a1b80220c41112c5c46af0c44744a0
|
4
|
+
data.tar.gz: e6650108a51502b73d9f48becc9877c46e1276b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 456aaacff0e206a8352d27630b84b33096f8885900f1ca96130b6c47053d2cfde7fe2f58f259e2f977e7794c532ce799087a2159e0b2a6536c096beae72ff785
|
7
|
+
data.tar.gz: 0cc3289a08eb3da87627ab7172bbdcc7baf0e6d1708e3f68bc650518f3c09ce7d3b51af76ac6dfac429fe614f3ca61765f19b26c8b428122db6a86d74461ba06
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 Jorge Fuertes
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# QueruBtce
|
2
2
|
|
3
3
|
KISS _BTC-e_ API Access from Ruby.
|
4
4
|
|
5
|
+
[](https://badge.fury.io/rb/queru_btce)
|
6
|
+
|
5
7
|
### Pros:
|
6
8
|
|
7
9
|
- No config file and no framework dependency.
|
@@ -10,11 +12,13 @@ KISS _BTC-e_ API Access from Ruby.
|
|
10
12
|
- Really few error abstraction, exceptions are raised.
|
11
13
|
- Nounce is enforced, I don't expect damm nounce error.
|
12
14
|
- Tests for the public API (rake test).
|
15
|
+
- Fast and lightweight: A small module.
|
16
|
+
- I did used every other gem and still needing this one.
|
13
17
|
|
14
18
|
### Cons:
|
15
19
|
|
16
20
|
- Not much abstraction, you should know _BTC-e_ API.
|
17
|
-
- Its
|
21
|
+
- Its new, so I don't know a lot of people using it in production.
|
18
22
|
|
19
23
|
## Installation
|
20
24
|
|
@@ -39,11 +43,13 @@ $ gem install queru-btce
|
|
39
43
|
## Usage
|
40
44
|
|
41
45
|
This gem provides class methods for all public/private API methods offered by _BTC-e_.
|
42
|
-
Responses are
|
46
|
+
Responses are objects (dot methods or hash access) and any errors are raised as exception, your program can handle it.
|
43
47
|
|
44
48
|
- [_BTC-e_ Trade API Documentation](https://btc-e.com/api/documentation)
|
45
49
|
- [_BTC-e_ Public API Documentation](https://btc-e.com/api/3/docs)
|
46
50
|
|
51
|
+
In _BTC-e_ API some methods are _CamelCase_. In this gem those method must be called in _snake_case_ format. For example `TradeHistory` becomes `QueruBtce.trade_history`.
|
52
|
+
|
47
53
|
You can call any _BTC-e_ API method this way:
|
48
54
|
|
49
55
|
#### Public API example:
|
@@ -73,7 +79,7 @@ QueruBtce.depth
|
|
73
79
|
QueruBtce.trades
|
74
80
|
```
|
75
81
|
|
76
|
-
#### Private API:
|
82
|
+
#### Private API example:
|
77
83
|
```ruby
|
78
84
|
QueruBtce.credentials key: 'mykey', secret: 'mysecret'
|
79
85
|
my_info = QueruBtce.get_info
|
@@ -105,11 +111,11 @@ QueruBtce.cancel_order
|
|
105
111
|
|
106
112
|
## Tips:
|
107
113
|
|
108
|
-
### Nounce error:
|
114
|
+
### Nounce error and locking:
|
109
115
|
|
110
|
-
|
116
|
+
Nounce is param required by _BTC-e_ trade api, is just an integer but the current one should be greater than the last one. I guess they require it to ensure your transactions are received in a known order, sequentially.
|
111
117
|
|
112
|
-
This gem always send a timestamp as nounce, ensuring its greater than the last one, so calls are delayed a second between. Not a problem
|
118
|
+
This gem always send a timestamp as nounce, ensuring its greater than the last one, so calls are delayed a second between. Not a real problem because API can dump you out when try to ask faster.
|
113
119
|
|
114
120
|
But if you are calling the API from more than one process, there's no locking mechanism in gem (maybe in the future) and you need to implement a lock to prevent making two calls at once. A cache key, or distributed message can do the work, even a semaphore file locking.
|
115
121
|
|
data/lib/queru_btce/version.rb
CHANGED
data/queru_btce.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.required_ruby_version = '>= 2.3'
|
23
23
|
|
24
|
-
spec.add_dependency 'json', '
|
24
|
+
spec.add_dependency 'json', '>= 1.6'
|
25
25
|
spec.add_dependency 'rubysl-ostruct', '~> 2.1'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
@@ -29,3 +29,4 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'minitest', '~> 5.1'
|
30
30
|
spec.add_development_dependency 'shoulda', '~> 3.5'
|
31
31
|
end
|
32
|
+
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queru_btce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Queru AKA Jorge Fuertes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubysl-ostruct
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- ".rubocop.yml"
|
106
106
|
- ".travis.yml"
|
107
107
|
- Gemfile
|
108
|
+
- LICENSE.md
|
108
109
|
- LICENSE.txt
|
109
110
|
- README.md
|
110
111
|
- Rakefile
|