Class: Bitsor::Client

Inherits:
Object
  • Object
show all
Includes:
Authorizable, AccountStatus, AvailableBooks, Balance, BitcoinWithdrawal, DebitCardWithdrawal, EtherWithdrawal, Fees, Funding, FundingDestination, KycDocuments, Ledger, MxBankCodes, OpenOrders, OrderBook, OrderTrades, Orders, PhoneNumber, PhoneNumberWithdrawal, PhoneVerification, SpeiWithdrawal, Ticker, Trades, UserTrades, Withdrawals, Configurable, Connection
Defined in:
lib/bitsor/client.rb,
lib/bitsor/client/fees.rb,
lib/bitsor/client/ledger.rb,
lib/bitsor/client/orders.rb,
lib/bitsor/client/ticker.rb,
lib/bitsor/client/trades.rb,
lib/bitsor/client/balance.rb,
lib/bitsor/client/funding.rb,
lib/bitsor/client/order_book.rb,
lib/bitsor/client/open_orders.rb,
lib/bitsor/client/user_trades.rb,
lib/bitsor/client/withdrawals.rb,
lib/bitsor/client/order_trades.rb,
lib/bitsor/client/phone_number.rb,
lib/bitsor/client/kyc_documents.rb,
lib/bitsor/client/mx_bank_codes.rb,
lib/bitsor/client/account_status.rb,
lib/bitsor/client/available_books.rb,
lib/bitsor/client/spei_withdrawal.rb,
lib/bitsor/client/ether_withdrawal.rb,
lib/bitsor/client/bitcoin_withdrawal.rb,
lib/bitsor/client/phone_verification.rb,
lib/bitsor/client/funding_destination.rb,
lib/bitsor/client/debit_card_withdrawal.rb,
lib/bitsor/client/phone_number_withdrawal.rb

Defined Under Namespace

Modules: AccountStatus, AvailableBooks, Balance, BitcoinWithdrawal, DebitCardWithdrawal, EtherWithdrawal, Fees, Funding, FundingDestination, KycDocuments, Ledger, MxBankCodes, OpenOrders, OrderBook, OrderTrades, Orders, PhoneNumber, PhoneNumberWithdrawal, PhoneVerification, SpeiWithdrawal, Ticker, Trades, UserTrades, Withdrawals

Instance Attribute Summary collapse

Attributes included from Configurable

#api_key, #api_secret, #client_id

Instance Method Summary collapse

Methods included from Withdrawals

#withdrawals

Methods included from UserTrades

#user_trades

Methods included from Trades

#trades

Methods included from Ticker

#ticker

Methods included from SpeiWithdrawal

#spei_withdrawal

Methods included from PhoneVerification

#phone_verification

Methods included from PhoneNumberWithdrawal

#phone_number_withdrawal

Methods included from PhoneNumber

#phone_number

Methods included from Orders

#cancel_order, #lookup_order, #place_order

Methods included from OrderTrades

#order_trades

Methods included from OrderBook

#order_book

Methods included from OpenOrders

#open_orders

Methods included from MxBankCodes

#mx_bank_codes

Methods included from Ledger

#ledger, #ledger_fees, #ledger_fundings, #ledger_trades, #ledger_withdrawals

Methods included from KycDocuments

#kyc_documents

Methods included from FundingDestination

#funding_destination

Methods included from Funding

#fundings

Methods included from Fees

#fees

Methods included from EtherWithdrawal

#ether_withdrawal

Methods included from DebitCardWithdrawal

#debit_card_withdrawal

Methods included from BitcoinWithdrawal

#bitcoin_withdrawal

Methods included from Balance

#balance

Methods included from AvailableBooks

#available_books

Methods included from AccountStatus

#account_status

Methods included from Authorizable

#authenticated?

Methods included from Connection

#delete, #get, #last_response, #patch, #post, #put

Methods included from Configurable

#api_endpoint, #configure, keys, #reset!

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



71
72
73
74
75
# File 'lib/bitsor/client.rb', line 71

def initialize(options = {})
  Bitsor::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", options[key] || Bitsor.instance_variable_get(:"@#{key}"))
  end
end

Instance Attribute Details

#api_key=(value) ⇒ Object (writeonly)

Sets the attribute api_key

Parameters:

  • value

    the value to set the attribute api_key to.



68
69
70
# File 'lib/bitsor/client.rb', line 68

def api_key=(value)
  @api_key = value
end

#api_secret=(value) ⇒ Object (writeonly)

Sets the attribute api_secret

Parameters:

  • value

    the value to set the attribute api_secret to.



69
70
71
# File 'lib/bitsor/client.rb', line 69

def api_secret=(value)
  @api_secret = value
end

#client_id=(value) ⇒ Object (writeonly)

Sets the attribute client_id

Parameters:

  • value

    the value to set the attribute client_id to.



67
68
69
# File 'lib/bitsor/client.rb', line 67

def client_id=(value)
  @client_id = value
end

Instance Method Details

#inspectObject



77
78
79
# File 'lib/bitsor/client.rb', line 77

def inspect
  "Bitsor::Client(client_id: ****#{@client_id[4..-1]} api_key: ******#{@api_key[6..-1]}, object_id: #{format('0x00%x', (object_id << 1))})"
end

#normalize_responseObject



81
82
83
# File 'lib/bitsor/client.rb', line 81

def normalize_response
  @normalizer ||= Normalizer.new
end