module Bitfinex::RESTv2Wallet

Public Instance Methods

create_deposit_address(wallet, method) click to toggle source

Regenerate the deposit address for the given currency. All previous addresses are still active and can receive funds.

@param wallet [string] wallet to transfer funds from (exchange, margin ect…) @param method [string] funds transfer protocol (bitcoin, tetherus ect…)

@return [Array] Raw notification

# File lib/rest/v2/wallet.rb, line 49
def create_deposit_address (wallet, method)
  payload = { :wallet => wallet, :method => method, :op_renew => 1 }
  authenticated_post("auth/w/deposit/address", params: payload).body
end
deposit_address(wallet, method) click to toggle source

Get the deposit address for the given currency

@param wallet [string] wallet to transfer funds from (exchange, margin ect…) @param method [string] funds transfer protocol (bitcoin, tetherus ect…)

@return [Array] Raw notification

# File lib/rest/v2/wallet.rb, line 35
def deposit_address (wallet, method)
  payload = { :wallet => wallet, :method => method, :op_renew => 0 }
  authenticated_post("auth/w/deposit/address", params: payload).body
end
transfer(from, to, currency_from, currency_to, amount) click to toggle source

Transfer between bitfinex wallets

@param from [string] wallet to transfer funds from (exchange, margin ect…) @param to [string] wallet to transfer funds to (exchange, margin ect…) @param currency_from [string] original currency of funds @param currency_to [string] currency to convert funds to @param amount [number] amount of funds to convert

@return [Array] Raw notification

# File lib/rest/v2/wallet.rb, line 22
def transfer (from, to, currency_from, currency_to, amount)
  payload = { :from => from, :to => to, :currency => currency, :currency_to => currency_to, :amount => amount }
  authenticated_post("auth/w/transfer", params: payload).body
end
wallets() click to toggle source

Get account wallets

@example:

client.wallets
# File lib/rest/v2/wallet.rb, line 7
def wallets
  authenticated_post("auth/r/wallets").body
end
withdraw(wallet, method, amount, address) click to toggle source

Withdraw from the given bitfinex wallet to the given cryptocurrency address

@param wallet [string] wallet to transfer funds from (exchange, margin ect…) @param method [string] funds transfer protocol (bitcoin, tetherus ect…) @param amount [number] amount of funds to withdraw @param address [string] public key destination address

@return [Array] Raw notification

# File lib/rest/v2/wallet.rb, line 64
def withdraw (wallet, method, amount, address)
  payload = { :wallet => wallet, :method => method, :amount => amount, :address => address }
  authenticated_post("auth/w/withdraw", params: { :id => id }).body
end