fuly 0.0.3 → 0.0.4

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
  SHA256:
3
- metadata.gz: 3aaaa8215a6583aafc21264ae08e416681d91c921bc49aad95534bf60c37d135
4
- data.tar.gz: 6b9b2c1bab0e97bb2a86976abe9e4b95d7a8c265593bdef5482e256e0b15e355
3
+ metadata.gz: 81b0c4892ee496b160841c7a1abb3fd10ec82c2e1be9c5e2797ea10a3faaf7a9
4
+ data.tar.gz: 41177874f1ce82e632f7cc94c98ac73ca007831a1638d143e07461d014ad8eff
5
5
  SHA512:
6
- metadata.gz: 26753dbe5e519ff2817ec13078873c14705c982082966a9cf242584d8a7d46d48090f5bb9500387e63a65cf01312d0ed52ff80efa6fb6e291bca21c0246f63c3
7
- data.tar.gz: 5c6b4dd34a2fe2efd4857c07c94c51ae081f03b181d4b23bbbf18b7483f40d015e283b5b47e66a722482f2f780df576ccc18ab1785e587ceed71ea019945427f
6
+ metadata.gz: 5508b2d1b680159c27c4eeac51eb66bb0e564e4e41b68fbe2059bad87160668653bd178ebd55f6e0c4ab700fef29cc9c02e36b65f34fff1c5e38c3cd285b89e0
7
+ data.tar.gz: 0ac186d429ea6e2b7b81bd8f2ce1b19fdf5e9c1f6bf8d94b67cdff1bc29ffe63bfafe3541738ae531a8327cafb937d58b71fc7d511349dd26f9500d7eeae0246
@@ -10,6 +10,7 @@ module Bitfinex
10
10
 
11
11
  # 列出所有正在掛單
12
12
  # Ratelimit: 45 req/min
13
+ # https://docs.bitfinex.com/reference#rest-auth-funding-offers
13
14
  def funding_offers_all
14
15
  res = request("auth/r/funding/offers").body
15
16
  return JSON.parse(res)
@@ -24,6 +25,7 @@ module Bitfinex
24
25
  end
25
26
 
26
27
  # 取消指定掛單
28
+ # https://docs.bitfinex.com/reference#rest-auth-cancel-order
27
29
  def funding_cancel_offer(id)
28
30
  res = request("auth/w/funding/offer/cancel", {
29
31
  id: id,
@@ -31,6 +33,14 @@ module Bitfinex
31
33
  return JSON.parse(res)
32
34
  end
33
35
 
36
+ # https://docs.bitfinex.com/reference#rest-auth-cancel-all-funding-offers
37
+ def funding_cancel_all_offers(currency = "USD")
38
+ res = request("auth/w/funding/offer/cancel/all", {
39
+ currency: currency,
40
+ }).body
41
+ return JSON.parse(res)
42
+ end
43
+
34
44
  # 掛單
35
45
  # https://docs.bitfinex.com/reference#submit-funding-offer
36
46
  def funding_create_offer(currency, amount, rate, period)
@@ -45,6 +55,7 @@ module Bitfinex
45
55
  }).body
46
56
  end
47
57
 
58
+ # https://docs.bitfinex.com/v1/reference#rest-auth-offers
48
59
  def funding_new_offer(params)
49
60
  res = v1_request("offer/new", params)
50
61
  res = JSON.parse(res)
@@ -1,25 +1,37 @@
1
1
  module Bitfinex
2
2
  module Wallet
3
3
  # Ratelimit: 45 req/min
4
- # response:
5
4
  # https://docs.bitfinex.com/reference#rest-auth-wallets
6
5
  def wallets
7
6
  res = request("auth/r/wallets").body
8
7
  return JSON.parse(res)
9
8
  end
10
9
 
10
+ # 45 req/min
11
+ # https://docs.bitfinex.com/reference#rest-auth-ledgers
12
+ def ledgers(currency)
13
+ res = request("auth/r/ledgers/#{currency}/hist", {
14
+ limit: 500,
15
+ }).body
16
+ return JSON.parse(res)
17
+ end
18
+
11
19
  # Ratelimit: 45 req/min
12
- def wallets_history
20
+ # https://docs.bitfinex.com/reference#rest-auth-wallets-hist
21
+ def wallets_history(currency)
13
22
  request("auth/r/wallets/hist", {
23
+ currency: currency,
14
24
  end: (Time.now.to_f * 1000).floor,
15
25
  }).body
16
26
  end
17
27
 
18
28
  # Ratelimit: 30 req/min
29
+ # https://docs.bitfinex.com/reference#rest-auth-calc-order-avail
19
30
  def available_currency(currency)
20
31
  res = request("auth/calc/order/avail", {
21
32
  symbol: currency,
22
- type: "MARGIN",
33
+ dir: 1,
34
+ type: "FUNDING",
23
35
  }).body
24
36
  res = JSON.parse(res)
25
37
  return res[0].abs
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rex Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
11
+ date: 2020-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty