btcmrb 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcc139f3966b70f97d891c0fbf82b739268165fb
4
- data.tar.gz: c8321bc280a99087ab8e6a352e5c55f896ed2998
3
+ metadata.gz: 0926fb12ab58f0e0cda1afad44189f68b95e1e7a
4
+ data.tar.gz: 0bb83513997a53b5345a57802cedc469119aaee6
5
5
  SHA512:
6
- metadata.gz: 2ea0bc79cba7fd6b4cba83b97cce6e59531cbce441d4b93cd134087cfa2fdc85194368512915c56a4684b26ed4385aaaf1d9bab367fe29dd8dd5f82b48280d42
7
- data.tar.gz: cd20e1df9fef0a3b6e16426f061682f82f29f28dee9a9bc512539aa2c767bae3fd9cc3430d2dfba7061ef7e5d9621e076f3ee0ed8f2dab9b6cacf1ecce49c6ee
6
+ metadata.gz: 574517e594cde0f2e6258c296b43bc4b27c9c6eb6149b2186bfb1e88e03bcf2e13c5312d31375549a909ed4054cac46b9bdf2265a7370773fd1fdc2f8b9ec546
7
+ data.tar.gz: 820778b420026e8064fada178551a08fbb010d7971e195e61d5e849a95de2abcaf2d1c3340ef0466a1940c1b80e3def90ebca51624e076b11b6c5270edfd3345
data/README.md CHANGED
@@ -12,7 +12,7 @@ $ gem install btcmrb
12
12
  ```
13
13
  Or in your application's Gemfile:
14
14
  ```
15
- gem 'btcmrb', '~> 0.1.5'
15
+ gem 'btcmrb', '~> 0.1.9'
16
16
  ```
17
17
  ### Create some environment variables
18
18
  https://btcmarkets.net/account/apikey
@@ -28,6 +28,11 @@ client = Btcmrb.new
28
28
  balance_request = Btcmrb::Account.balance
29
29
  client.send_request(balance_request)
30
30
  # => [{"balance":1000000000,"pendingFunds":0,"currency":"AUD"},{"balance":1000000000,"pendingFunds":0,"currency":"BTC"},{"balance":1000000000,"pendingFunds":0,"currency":"LTC"}]
31
+
32
+ client = Btcmrb.new
33
+ tradingfee_request = Btcmrb::Account.tradingfee('BTC','AUD')
34
+ client.send_request(tradingfee_request)
35
+ # => [{"success"=>true, "errorCode"=>nil, "errorMessage"=>nil, "tradingFeeRate"=>749999, "volume30Day"=>396768299721}]
31
36
  ```
32
37
 
33
38
  ### Market Data API
@@ -10,5 +10,14 @@ module Btcmrb
10
10
  }
11
11
  end
12
12
 
13
+ def self.tradingfee(instrument, currency)
14
+ {
15
+ :uri => "/account/#{instrument}/#{currency}/tradingfee",
16
+ :body => {},
17
+ :verb => "GET",
18
+ :auth => true
19
+ }
20
+ end
21
+
13
22
  end
14
23
  end
@@ -1,7 +1,7 @@
1
1
  module Btcmrb
2
2
  class Order
3
3
 
4
- def self.all
4
+ def self.all(instrument="BTC", limit=10)
5
5
  # Documentation
6
6
  # POST "/order/history"
7
7
  # since parameter - an order id.
@@ -11,14 +11,14 @@ module Btcmrb
11
11
  # Implementation
12
12
  {
13
13
  :uri => "/order/history",
14
- :body => {:currency => "AUD", :instrument => "BTC", :limit => 10,"since":1},
14
+ :body => {"currency":"AUD","instrument":instrument,"limit":limit,"since":1},
15
15
  :verb => "POST",
16
16
  :auth => true
17
17
  }
18
18
  end
19
19
 
20
20
  # Similar to Index, but only returns open orders
21
- def self.open_orders
21
+ def self.open_orders(instrument="BTC", limit=10)
22
22
  # Documentation
23
23
  # POST "/order/open"
24
24
  # {"currency":"AUD","instrument":"BTC","limit":10,"since":33434568724}
@@ -27,13 +27,13 @@ module Btcmrb
27
27
  # Implementation
28
28
  {
29
29
  :uri => "/order/open",
30
- :body => {"currency":"AUD","instrument":"BTC","limit":10,"since":1},
30
+ :body => {"currency":"AUD","instrument":instrument,"limit":limit,"since":1},
31
31
  :verb => "POST",
32
32
  :auth => true
33
33
  }
34
34
  end
35
35
 
36
- def self.trade_history
36
+ def self.trade_history(instrument="BTC", limit=10)
37
37
  # Documentation
38
38
  # POST "/order/trade/history"
39
39
  # since parameter - a trade id.
@@ -43,7 +43,7 @@ module Btcmrb
43
43
  # Implementation
44
44
  {
45
45
  :uri => "/order/trade/history",
46
- :body => {"currency":"AUD","instrument":"BTC","limit":10,"since":1},
46
+ :body => {"currency":"AUD","instrument":instrument,"limit":limit,"since":1},
47
47
  :verb => "POST",
48
48
  :auth => true
49
49
  }
@@ -64,7 +64,7 @@ module Btcmrb
64
64
  }
65
65
  end
66
66
 
67
- def self.create(currency, instrument, price, volume, order_side, order_type)
67
+ def self.create(currency, instrument, price, volume, order_side, order_type, client_request_id="abc-cdf-1000")
68
68
  # Documentation
69
69
  # POST "/order/create"
70
70
  # The clientRequestId is not currently used but must be specified. Any string is valid.
@@ -77,7 +77,7 @@ module Btcmrb
77
77
  # Implementation
78
78
  {
79
79
  :uri => "/order/create",
80
- :body => {"currency":currency,"instrument":instrument,"price":(price*100000000).round(0),"volume":(volume*100000000).round(0),"orderSide":order_side,"ordertype":order_type,"clientRequestId":"abc-cdf-1000"},
80
+ :body => {"currency":currency,"instrument":instrument,"price":(price*100000000).round(0),"volume":(volume*100000000).round(0),"orderSide":order_side,"ordertype":order_type,"clientRequestId":client_request_id},
81
81
  :verb => "POST",
82
82
  :auth => true
83
83
  }
@@ -1,3 +1,3 @@
1
1
  module Btcmrb
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: btcmrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Tennant
8
+ - Chuan Liang
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
12
+ date: 2017-12-19 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: httparty
@@ -25,7 +26,7 @@ dependencies:
25
26
  - !ruby/object:Gem::Version
26
27
  version: 0.14.0
27
28
  description: Unofficial Ruby Gem for btcmarkets.net API
28
- email: tennantje@gmail.com
29
+ email: chuan@favia.com.au
29
30
  executables: []
30
31
  extensions: []
31
32
  extra_rdoc_files: []
@@ -39,7 +40,7 @@ files:
39
40
  - lib/btcmrb/marketdata.rb
40
41
  - lib/btcmrb/order.rb
41
42
  - lib/btcmrb/version.rb
42
- homepage: https://github.com/tennantje/btcmrb
43
+ homepage: https://github.com/chuan-liang/btcmrb
43
44
  licenses:
44
45
  - MIT
45
46
  metadata: {}