Module: Bitfinex::Wallet

Included in:
Client
Defined in:
lib/bitfinex/api/wallet.rb

Instance Method Summary collapse

Instance Method Details

#available_currency(currency) ⇒ Object



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



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

#movementsObject



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

#permissionsObject



12
13
14
15
# File 'lib/bitfinex/api/wallet.rb', line 12

def permissions
  res = request("auth/r/permissions").body
  return JSON.parse(res)
end

#user_infoObject



5
6
7
8
# File 'lib/bitfinex/api/wallet.rb', line 5

def 
  res = request("auth/r/info/user").body
  return JSON.parse(res)
end

#walletsObject



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



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