Module: Bitfinex::RESTv1Wallet

Included in:
RESTv1
Defined in:
lib/rest/v1/wallet.rb

Instance Method Summary collapse

Instance Method Details

#balances(params = {}) ⇒ Array

See your balances.

@example:

client.balances

Parameters:

  • params (defaults to: {})

    :type [string] “trading”, “deposit” or “exchange”.

  • params (defaults to: {})

    :currency [string] currency

  • params (defaults to: {})

    :amount [decimal] How much balance of this currency in this wallet

  • params (defaults to: {})

    :available [decimal] How much X there is in this wallet that is available to trade

Returns:

  • (Array)


12
13
14
15
# File 'lib/rest/v1/wallet.rb', line 12

def balances(params = {})
  check_params(params, %i{type currency amount available})
  authenticated_post("balances", params: params).body
end

#key_infoHash

Check the permissions of the key being used to generate this request

@example:

client.key_info

Returns:

  • (Hash)


93
94
95
# File 'lib/rest/v1/wallet.rb', line 93

def key_info
  authenticated_post("key_info").body
end

#margin_infosArray

See your trading wallet information for margin trading.

@example:

client.margin_infos

Returns:

  • (Array)


22
23
24
# File 'lib/rest/v1/wallet.rb', line 22

def margin_infos
  authenticated_post("margin_infos").body
end

#summaryHash

See a symmary of your trade volume, funding profits etc.

@example:

client.summary

Returns:

  • (Hash)


31
32
33
# File 'lib/rest/v1/wallet.rb', line 31

def summary
  authenticated_post("summary").body
end

#transfer(amount, currency, wallet_from, wallet_to) ⇒ Array

Allow you to move available balances between your wallets.

@example:

client.transfer(10, 'btc', "exchange", "deposit")

Parameters:

  • amount (decimal)

    Amount to transfer

  • currency (string)

    Currency of funds to transfer

  • wallet_from (string)

    Wallet to transfer from

  • wallet_to (string)

    Wallet to transfer to

Returns:

  • (Array)


44
45
46
47
48
49
50
51
52
# File 'lib/rest/v1/wallet.rb', line 44

def transfer(amount, currency, wallet_from, wallet_to)
  params = {
    amount: amount.to_s,
    currency: currency.upcase,
    walletfrom: wallet_from.downcase,
    walletto: wallet_to.downcase
  }
  authenticated_post("transfer", params: params).body
end

#withdraw(withdraw_type, walletselected, amount, params = {}) ⇒ Array

Allow you to request a withdrawal from one of your wallet.

For Cryptocurrencies (including tether): For wire withdrawals @example:

client.withdraw("bitcoin","deposit",1000, address: "1DKwqRhDmVyHJDL4FUYpDmQMYA3Rsxtvur")

Parameters:

  • withdraw_type (string)

    can be “bitcoin”, “litecoin” or “darkcoin” or “tether” or “wire”

  • walletselected (string)

    The wallet to withdraw from, can be “trading”, “exchange”, or “deposit”.

  • amount (decimal)

    Amount to withdraw

  • params (defaults to: {})

    :address [string] Destination address for withdrawal

  • params (defaults to: {})

    :account_name [string] account name

  • params (defaults to: {})

    :account_number [string] account number

  • params (defaults to: {})

    :bank_name [string] bank name

  • params (defaults to: {})

    :bank_address [string] bank address

  • params (defaults to: {})

    :bank_city [string] bank city

  • params (defaults to: {})

    :bank_country [string] bank country

  • params (defaults to: {})

    :detail_payment [string] (optional) message to beneficiary

  • params (defaults to: {})

    :intermediary_bank_name [string] (optional) intermediary bank name

  • params (defaults to: {})

    :intermediary_bank_address [string] (optional) intermediary bank address

  • params (defaults to: {})

    :intermediary_bank_city [string] (optional) intermediary bank city

  • params (defaults to: {})

    :intermediary_bank_country [string] (optional) intermediary bank country

  • params (defaults to: {})

    :intermediary_bank_account [string] (optional) intermediary bank account

  • params (defaults to: {})

    :intermediary_bank_swift [string] (optional) intemediary bank swift

  • params (defaults to: {})

    :expressWire [int] (optional). “1” to submit an express wire withdrawal, “0” or omit for a normal withdrawal

Returns:

  • (Array)


79
80
81
82
83
84
85
86
# File 'lib/rest/v1/wallet.rb', line 79

def withdraw(withdraw_type, walletselected, amount, params={})
  params.merge!({
    withdraw_type: withdraw_type,
    walletselected: walletselected.downcase,
    amount: amount.to_s})

  authenticated_post("withdraw", params: params).body
end