bitex 0.1.8 → 0.1.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.
- data/lib/bitex/trade.rb +13 -0
- data/lib/bitex/transaction.rb +4 -4
- data/lib/bitex/version.rb +1 -1
- data/spec/fixtures/account_summary.json +1 -0
- data/spec/fixtures/trades.json +1 -0
- data/spec/trade_spec.rb +15 -0
- data/spec/transaction_spec.rb +4 -4
- metadata +9 -4
- data/spec/fixtures/user_transactions.json +0 -1
data/lib/bitex/trade.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Bitex
|
2
|
+
# Utility class for fetching an heterogeneous list of objects that
|
3
|
+
# compose your transaction history.
|
4
|
+
class Trade
|
5
|
+
# @return [Array<Bitex::Buy, Bitex::Sell]
|
6
|
+
# Returns an heterogeneous array with all your transactions for the past
|
7
|
+
# 30 days sorted by descending date.
|
8
|
+
# @see https://bitex.la/developers#user-trades
|
9
|
+
def self.all
|
10
|
+
Api.private(:GET, '/private/trades').collect{|o| Api.deserialize(o) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/bitex/transaction.rb
CHANGED
@@ -2,13 +2,13 @@ module Bitex
|
|
2
2
|
# Utility class for fetching an heterogeneous list of objects that
|
3
3
|
# compose your transaction history.
|
4
4
|
class Transaction
|
5
|
-
# @return [Array<Bitex::
|
5
|
+
# @return [Array<Bitex::Bid, Bitex::Ask, Bitex::SpecieDeposit,
|
6
6
|
# Bitex::SpecieWithdrawal, Bitex::UsdDeposit, Bitex::UsdWithdrawal>]
|
7
7
|
# Returns an heterogeneous array with all your transactions for the past
|
8
|
-
#
|
9
|
-
# @see https://bitex.la/developers#user-
|
8
|
+
# 15 days sorted by descending date.
|
9
|
+
# @see https://bitex.la/developers#user-account-summary
|
10
10
|
def self.all
|
11
|
-
Api.private(:GET, '/private/
|
11
|
+
Api.private(:GET, '/private/account_summary').collect{|o| Api.deserialize(o) }
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/bitex/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
[[1,12345678,946685400,1,100.00000000,10.00000000,1000.00000000,1,0,1.1,"ApiKey#1",0.01],[2,12345678,946685400,1,10.00000000,1.00000000,1100.00000000,1,0,200.0,"ApiKey#1",0.1],[5,12345678,946685400,1,100.00000000],[6,12345678,946685400,1,100.00000000,1,0,"helloworld","label",1],[7,12345678,946685400,110.00000000,100.00000000,1,1,0,"UY","UYU",1,"bank of new york mellon","{\"status\":\"OK\",\"link\":\"https://astr.com\"}","ABABABABA"],[8,12345678,946685400,100.00000000,1,0,"UY","UYU", "bb", "billy bob", 1, "las instrucciones"]]
|
@@ -0,0 +1 @@
|
|
1
|
+
[[3,12345678,946685400,1,2.00000000,600.00000000,0.05000000,300.00000000,123],[4,12345678,946685400,1,2.00000000,600.00000000,0.05000000,300.00000000,456]]
|
data/spec/trade_spec.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bitex::Trade do
|
4
|
+
before(:each) do
|
5
|
+
Bitex.api_key = 'valid_api_key'
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'gets all trades' do
|
9
|
+
stub_private(:get, "/private/trades", 'trades')
|
10
|
+
buy, sell, other = Bitex::Trade.all
|
11
|
+
buy.should be_a Bitex::Buy
|
12
|
+
sell.should be_a Bitex::Sell
|
13
|
+
other.should be_nil
|
14
|
+
end
|
15
|
+
end
|
data/spec/transaction_spec.rb
CHANGED
@@ -5,12 +5,12 @@ describe Bitex::Transaction do
|
|
5
5
|
Bitex.api_key = 'valid_api_key'
|
6
6
|
end
|
7
7
|
|
8
|
-
it 'gets
|
9
|
-
stub_private(:get, "/private/
|
8
|
+
it 'gets account summary' do
|
9
|
+
stub_private(:get, "/private/account_summary", 'account_summary')
|
10
10
|
buy, sell, specie_deposit, specie_withdrawal, usd_deposit, usd_withdrawal =
|
11
11
|
Bitex::Transaction.all
|
12
|
-
buy.should be_a Bitex::
|
13
|
-
sell.should be_a Bitex::
|
12
|
+
buy.should be_a Bitex::Bid
|
13
|
+
sell.should be_a Bitex::Ask
|
14
14
|
specie_deposit.should be_a Bitex::SpecieDeposit
|
15
15
|
specie_withdrawal.should be_a Bitex::SpecieWithdrawal
|
16
16
|
usd_deposit.should be_a Bitex::UsdDeposit
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-11-
|
13
|
+
date: 2014-11-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- lib/bitex/sell.rb
|
186
186
|
- lib/bitex/specie_deposit.rb
|
187
187
|
- lib/bitex/specie_withdrawal.rb
|
188
|
+
- lib/bitex/trade.rb
|
188
189
|
- lib/bitex/transaction.rb
|
189
190
|
- lib/bitex/usd_deposit.rb
|
190
191
|
- lib/bitex/usd_withdrawal.rb
|
@@ -192,6 +193,7 @@ files:
|
|
192
193
|
- spec/ask_spec.rb
|
193
194
|
- spec/bid_spec.rb
|
194
195
|
- spec/buy_spec.rb
|
196
|
+
- spec/fixtures/account_summary.json
|
195
197
|
- spec/fixtures/aggregated_data.json
|
196
198
|
- spec/fixtures/asks_cancel.json
|
197
199
|
- spec/fixtures/asks_create.json
|
@@ -213,12 +215,12 @@ files:
|
|
213
215
|
- spec/fixtures/specie_deposits.json
|
214
216
|
- spec/fixtures/specie_withdrawal.json
|
215
217
|
- spec/fixtures/specie_withdrawals.json
|
218
|
+
- spec/fixtures/trades.json
|
216
219
|
- spec/fixtures/transactions.json
|
217
220
|
- spec/fixtures/usd_deposit.json
|
218
221
|
- spec/fixtures/usd_deposits.json
|
219
222
|
- spec/fixtures/usd_withdrawal.json
|
220
223
|
- spec/fixtures/usd_withdrawals.json
|
221
|
-
- spec/fixtures/user_transactions.json
|
222
224
|
- spec/kyc_file_spec.rb
|
223
225
|
- spec/kyc_profile_spec.rb
|
224
226
|
- spec/market_spec.rb
|
@@ -232,6 +234,7 @@ files:
|
|
232
234
|
- spec/support/from_json_shared_examples.rb
|
233
235
|
- spec/support/order_shared_examples.rb
|
234
236
|
- spec/support/request_stubs.rb
|
237
|
+
- spec/trade_spec.rb
|
235
238
|
- spec/transaction_spec.rb
|
236
239
|
- spec/usd_deposit_spec.rb
|
237
240
|
- spec/usd_withdrawal_spec.rb
|
@@ -264,6 +267,7 @@ test_files:
|
|
264
267
|
- spec/ask_spec.rb
|
265
268
|
- spec/bid_spec.rb
|
266
269
|
- spec/buy_spec.rb
|
270
|
+
- spec/fixtures/account_summary.json
|
267
271
|
- spec/fixtures/aggregated_data.json
|
268
272
|
- spec/fixtures/asks_cancel.json
|
269
273
|
- spec/fixtures/asks_create.json
|
@@ -285,12 +289,12 @@ test_files:
|
|
285
289
|
- spec/fixtures/specie_deposits.json
|
286
290
|
- spec/fixtures/specie_withdrawal.json
|
287
291
|
- spec/fixtures/specie_withdrawals.json
|
292
|
+
- spec/fixtures/trades.json
|
288
293
|
- spec/fixtures/transactions.json
|
289
294
|
- spec/fixtures/usd_deposit.json
|
290
295
|
- spec/fixtures/usd_deposits.json
|
291
296
|
- spec/fixtures/usd_withdrawal.json
|
292
297
|
- spec/fixtures/usd_withdrawals.json
|
293
|
-
- spec/fixtures/user_transactions.json
|
294
298
|
- spec/kyc_file_spec.rb
|
295
299
|
- spec/kyc_profile_spec.rb
|
296
300
|
- spec/market_spec.rb
|
@@ -304,6 +308,7 @@ test_files:
|
|
304
308
|
- spec/support/from_json_shared_examples.rb
|
305
309
|
- spec/support/order_shared_examples.rb
|
306
310
|
- spec/support/request_stubs.rb
|
311
|
+
- spec/trade_spec.rb
|
307
312
|
- spec/transaction_spec.rb
|
308
313
|
- spec/usd_deposit_spec.rb
|
309
314
|
- spec/usd_withdrawal_spec.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
[[3,12345678,946685400,1,2.00000000,600.00000000,0.05000000,300.00000000,123],[4,12345678,946685400,1,2.00000000,600.00000000,0.05000000,300.00000000,456],[5,12345678,946685400,1,100.00000000],[6,12345678,946685400,1,100.00000000,1,0,"helloworld","label",1],[7,12345678,946685400,110.00000000,100.00000000,1,1,0,"UY","UYU",1,"bank of new york mellon","{\"status\":\"OK\",\"link\":\"https://astr.com\"}","ABABABABA"],[8,12345678,946685400,100.00000000,1,0,"UY","UYU", "bb", "billy bob", 1, "las instrucciones"]]
|