Module: Bitfinex::Wallet
- Included in:
- Client
- Defined in:
- lib/bitfinex/api/wallet.rb
Instance Method Summary collapse
-
#available_currency(currency) ⇒ Object
Ratelimit: 30 req/min docs.bitfinex.com/reference#rest-auth-calc-order-avail.
-
#interest_history(currency, start_time, end_time) ⇒ Object
收入列表 Ratelimit: 15 req/min docs.bitfinex.com/v1/reference#rest-auth-balance-history.
-
#ledgers(currency) ⇒ Object
45 req/min docs.bitfinex.com/reference#rest-auth-ledgers.
-
#movements ⇒ Object
Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-movements.
-
#permissions ⇒ Object
Ratelimit: 90 req/min docs.bitfinex.com/reference#key-permissions.
-
#user_info ⇒ Object
Ratelimit: 90 req/min docs.bitfinex.com/reference#rest-auth-info-user.
-
#wallets ⇒ Object
Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-wallets.
-
#wallets_history(currency) ⇒ Object
Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-wallets-hist.
- #withdraw(wallet, method, amount, address) ⇒ Object
Instance Method Details
#available_currency(currency) ⇒ Object
Ratelimit: 30 req/min docs.bitfinex.com/reference#rest-auth-calc-order-avail
63 64 65 66 67 68 69 70 71 |
# File 'lib/bitfinex/api/wallet.rb', line 63 def available_currency(currency) res = request("auth/calc/order/avail", { symbol: currency, dir: 1, type: "FUNDING", }).body res = JSON.parse(res) return res[0].abs end |
#interest_history(currency, start_time, end_time) ⇒ Object
收入列表 Ratelimit: 15 req/min docs.bitfinex.com/v1/reference#rest-auth-balance-history
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/bitfinex/api/wallet.rb', line 76 def interest_history(currency, start_time, end_time) res = v1_request("history", { currency: currency, # wallet: "deposit", # since: "1570272762.0", # until: "1572951124.0", # limit: 500, }) res = JSON.parse(res) return res end |
#ledgers(currency) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/bitfinex/api/wallet.rb', line 44 def ledgers(currency) res = request("auth/r/ledgers/#{currency}/hist", { limit: 2500, category: 28, }).body return JSON.parse(res) end |
#movements ⇒ Object
Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-movements
30 31 32 33 |
# File 'lib/bitfinex/api/wallet.rb', line 30 def movements res = request("auth/r/movements/hist").body return JSON.parse(res) end |
#permissions ⇒ Object
Ratelimit: 90 req/min docs.bitfinex.com/reference#key-permissions
12 13 14 15 |
# File 'lib/bitfinex/api/wallet.rb', line 12 def res = request("auth/r/permissions").body return JSON.parse(res) end |
#user_info ⇒ Object
Ratelimit: 90 req/min docs.bitfinex.com/reference#rest-auth-info-user
5 6 7 8 |
# File 'lib/bitfinex/api/wallet.rb', line 5 def user_info res = request("auth/r/info/user").body return JSON.parse(res) end |
#wallets ⇒ Object
Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-wallets
37 38 39 40 |
# File 'lib/bitfinex/api/wallet.rb', line 37 def wallets res = request("auth/r/wallets").body return JSON.parse(res) end |
#wallets_history(currency) ⇒ Object
Ratelimit: 45 req/min docs.bitfinex.com/reference#rest-auth-wallets-hist
54 55 56 57 58 59 |
# File 'lib/bitfinex/api/wallet.rb', line 54 def wallets_history(currency) request("auth/r/wallets/hist", { currency: currency, end: (Time.now.to_f * 1000).floor, }).body end |
#withdraw(wallet, method, amount, address) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/bitfinex/api/wallet.rb', line 18 def withdraw(wallet, method, amount, address) res = request("auth/w/withdraw", { wallet: wallet, #'exchange', method: method, #'tetheruse', amount: amount, #'10', address: address, #'0x2bf788d017C4DF927787DF2EB1310266d9db6893', }).body return JSON.parse(res) end |