mexbt 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/lib/mexbt/account.rb +7 -0
- data/lib/mexbt/version.rb +1 -1
- data/spec/private_api_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5385ddbf82ff1d7c2b4c17b2ca0ccac44b1d61f9
|
4
|
+
data.tar.gz: 7791b3f2a2e2312f1892c6525809459eb01dde74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf18f3acfc8ba8d073e55f811c82b8bf08862d6f7c1b537f0e650e54773f730e2994aaeb9bb0f40bd235836f4eac3dcf948a840654aaaacb406baf300ff96eaf
|
7
|
+
data.tar.gz: ba09eaf812ec6b384b9ad8d0755f7444331d8670f130e2e5e3ceca68c317702589dfc241a7d42071f3b4dc71aecf42a407b36e7460ed4019c310912cf06b765d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.0.7
|
2
|
+
|
3
|
+
* Added Mexbt::Account#btc_deposit_address
|
4
|
+
* Added Mexbt::Account#tc_deposit_address
|
5
|
+
|
1
6
|
## 0.0.6
|
2
7
|
|
3
8
|
* BREAKING CHANGES: removed Mexbt::Account and Mexbt::Orders module, you should instantiate an instance of Mexbt::Account class, see README for examples
|
data/README.md
CHANGED
@@ -90,6 +90,8 @@ account.cancel_all_orders() # Cancel all orders for the default currency pair
|
|
90
90
|
account.balance
|
91
91
|
account.trades
|
92
92
|
account.orders
|
93
|
+
account.btc_deposit_address
|
94
|
+
account.ltc_deposit_address
|
93
95
|
account.deposit_addresses
|
94
96
|
account.withdraw(amount: 1, currency: :btc, address: 'xxx')
|
95
97
|
account.info # Fetches your user info
|
data/lib/mexbt/account.rb
CHANGED
@@ -31,6 +31,13 @@ module Mexbt
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
%w{btc ltc}.each do |c|
|
35
|
+
define_method(:"#{c}_deposit_address") do
|
36
|
+
res = call("deposit-addresses")
|
37
|
+
res[:addresses].find { |address_info| address_info[:name].downcase === c }[:depositAddress]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
34
41
|
def withdraw(amount:, address:, currency: :btc)
|
35
42
|
call("withdraw", { ins: currency, amount: amount, sentToAddress: address })
|
36
43
|
end
|
data/lib/mexbt/version.rb
CHANGED
data/spec/private_api_spec.rb
CHANGED
@@ -86,6 +86,14 @@ describe Mexbt::Account do
|
|
86
86
|
expect { account.create_order(type: :boom, amount: 0.2) }.to raise_error("Unknown order type 'boom'")
|
87
87
|
end
|
88
88
|
|
89
|
+
it "returns the btc deposit address" do
|
90
|
+
expect(account.btc_deposit_address).to eql("SIM MODE - No addresses in Sim Mode")
|
91
|
+
end
|
92
|
+
|
93
|
+
it "returns the ltc deposit address" do
|
94
|
+
expect(account.ltc_deposit_address).to eql("SIM MODE - No addresses in Sim Mode")
|
95
|
+
end
|
96
|
+
|
89
97
|
context "modifying and cancelling orders" do
|
90
98
|
|
91
99
|
let(:order_id) {account.create_order(type: :limit, price: 100, amount: 0.1, currency_pair: "BTCUSD")[:serverOrderId]}
|