btce 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/btce.rb +8 -11
- metadata +2 -3
data/lib/btce.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Soli Deo Gloria,
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
|
-
#
|
5
|
+
# 2317 South River Road, Saint Charles, Missouri 63303 USA.
|
6
6
|
# Web: http://cgore.com
|
7
7
|
# Email: cgore@cgore.com
|
8
8
|
#
|
@@ -50,7 +50,6 @@ module Btce
|
|
50
50
|
nmc
|
51
51
|
eur
|
52
52
|
nvc
|
53
|
-
trc
|
54
53
|
ppc
|
55
54
|
fnc)
|
56
55
|
CURRENCY_PAIRS = %w(btc_usd
|
@@ -63,25 +62,23 @@ module Btce
|
|
63
62
|
usd_rur
|
64
63
|
eur_usd
|
65
64
|
nvc_btc
|
66
|
-
trc_btc
|
67
65
|
ppc_btc
|
68
66
|
ftc_btc)
|
69
67
|
MAX_DIGITS = {
|
70
68
|
"btc_usd" => 3,
|
71
69
|
"btc_eur" => 3,
|
72
70
|
"btc_rur" => 4,
|
73
|
-
"ltc_btc" => 5,
|
71
|
+
"ltc_btc" => 5,
|
74
72
|
"ltc_usd" => 6,
|
75
73
|
"ltc_rur" => 4,
|
76
74
|
"nmc_btc" => 4,
|
77
75
|
"usd_rur" => 4,
|
78
|
-
"eur_usd" => 4,
|
76
|
+
"eur_usd" => 4,
|
79
77
|
"nvc_btc" => 4,
|
80
|
-
"trc_btc" => 4,
|
81
78
|
"ppc_btc" => 4,
|
82
79
|
"ftc_btc" => 4
|
83
80
|
}
|
84
|
-
KEY = YAML::load File.open 'btce-api-key.yml'
|
81
|
+
KEY = YAML::load File.open 'btce-api-key.yml'
|
85
82
|
|
86
83
|
class << self
|
87
84
|
def get_https(url, params = nil, sign = nil)
|
@@ -199,7 +196,7 @@ module Btce
|
|
199
196
|
|
200
197
|
class Trade
|
201
198
|
attr_accessor :json
|
202
|
-
|
199
|
+
|
203
200
|
JSON_METHODS = %w(date price amount tid price_currency item trade_type)
|
204
201
|
|
205
202
|
attr_accessor *JSON_METHODS.map(&:to_sym)
|
@@ -251,7 +248,7 @@ module Btce
|
|
251
248
|
OrderList
|
252
249
|
Trade
|
253
250
|
CancelOrder)
|
254
|
-
|
251
|
+
|
255
252
|
class << self
|
256
253
|
def sign(params)
|
257
254
|
# The digest needs to be created.
|
@@ -262,7 +259,7 @@ module Btce
|
|
262
259
|
.join('&')
|
263
260
|
signed = hmac.update params
|
264
261
|
end
|
265
|
-
|
262
|
+
|
266
263
|
def trade_api_call(method, extra)
|
267
264
|
params = {"method" => method, "nonce" => nonce}
|
268
265
|
if ! extra.empty?
|
@@ -273,7 +270,7 @@ module Btce
|
|
273
270
|
signed = sign params
|
274
271
|
get_json "https://#{API::BTCE_DOMAIN}/tapi", params, signed
|
275
272
|
end
|
276
|
-
|
273
|
+
|
277
274
|
def nonce
|
278
275
|
while result = Time.now.to_i and @last_nonce and @last_nonce >= result
|
279
276
|
sleep 1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: btce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: monkey-patch
|
@@ -59,4 +59,3 @@ signing_key:
|
|
59
59
|
specification_version: 3
|
60
60
|
summary: A simple library to interface with the API for btc-e.com in Ruby.
|
61
61
|
test_files: []
|
62
|
-
has_rdoc:
|