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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc4cf3db2a64b534ef332ab4838e09ed1b8be033
4
- data.tar.gz: 30035ad68d18845431c9341c32b202f66dae5fe6
3
+ metadata.gz: 5385ddbf82ff1d7c2b4c17b2ca0ccac44b1d61f9
4
+ data.tar.gz: 7791b3f2a2e2312f1892c6525809459eb01dde74
5
5
  SHA512:
6
- metadata.gz: b56b257027bcddb33b227df3a2be160235d970a37560744516a3eae29e494ac3abaa9678d47ad8be60f511da715936d2cdfca2c5d7797b437077d188a51a3eaa
7
- data.tar.gz: 9f88151bbb4e0e432c0051886daf2cc82397c91a02dde0cacd0973bde0eb60bebcb734d916ca360344c88d7ee5b6fd278fe147d395adf3ab6c48ce901fe6b8b0
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
@@ -1,3 +1,3 @@
1
1
  module Mexbt
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -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]}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mexbt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - williamcoates