Module: Poloniex

Defined in:
lib/poloniex.rb,
lib/poloniex/version.rb

Defined Under Namespace

Classes: Configuration

Constant Summary collapse

VERSION =
"1.0.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



9
10
11
# File 'lib/poloniex.rb', line 9

def configuration
  @configuration
end

Class Method Details

.active_loansObject



42
43
44
# File 'lib/poloniex.rb', line 42

def self.active_loans
  post 'returnActiveLoans'
end

.available_account_balancesObject



91
92
93
# File 'lib/poloniex.rb', line 91

def self.
  post 'returnAvailableAccountBalances'
end

.balancesObject



46
47
48
# File 'lib/poloniex.rb', line 46

def self.balances
  post 'returnBalances'
end

.buy(currency_pair, rate, amount) ⇒ Object



71
72
73
# File 'lib/poloniex.rb', line 71

def self.buy( currency_pair, rate, amount )
  post 'buy', currencyPair: currency_pair, rate: rate, amount: amount
end

.cancel_order(currency_pair, order_number) ⇒ Object



79
80
81
# File 'lib/poloniex.rb', line 79

def self.cancel_order( currency_pair, order_number )
  post 'cancelOrder', currencyPair: currency_pair, orderNumber: order_number
end

.complete_balancesObject



59
60
61
# File 'lib/poloniex.rb', line 59

def self.complete_balances
  post 'returnCompleteBalances'
end

.currenciesObject



55
56
57
# File 'lib/poloniex.rb', line 55

def self.currencies
  get 'returnCurrencies'
end

.deposit_addressesObject



115
116
117
# File 'lib/poloniex.rb', line 115

def self.deposit_addresses
  post 'returnDepositAddresses'
end

.deposits_withdrawls(start = 0, end_time = Time.now.to_i) ⇒ Object



123
124
125
# File 'lib/poloniex.rb', line 123

def self.deposits_withdrawls( start = 0, end_time = Time.now.to_i )
  post 'returnDepositsWithdrawals', start: start, :end => end_time
end

.generate_new_address(currency) ⇒ Object



119
120
121
# File 'lib/poloniex.rb', line 119

def self.generate_new_address( currency )
  post 'generateNewAddress', currency: currency
end

.get_all_daily_exchange_rates(currency_pair) ⇒ Object



26
27
28
# File 'lib/poloniex.rb', line 26

def self.get_all_daily_exchange_rates( currency_pair )
  res = get 'returnChartData', currencyPair: currency_pair, period: 86400,  start: 0, :end => Time.now.to_i
end

.lending_history(start = 0, end_time = Time.now.to_i, limit = 0) ⇒ Object

with the default of limit 0 at most 500 lending items are returned



51
52
53
# File 'lib/poloniex.rb', line 51

def self.lending_history( start = 0, end_time = Time.now.to_i, limit = 0 )
  post 'returnLendingHistory', start: start, :end => end_time, :limit => limit
end

.margin_account_summaryObject



103
104
105
# File 'lib/poloniex.rb', line 103

def self.
  post 'returnMarginAccountSummary'
end

.margin_buy(currency_pair, rate, amount) ⇒ Object



107
108
109
# File 'lib/poloniex.rb', line 107

def self.margin_buy(currency_pair, rate, amount)
  post 'marginBuy', currencyPair: currency_pair, rate: rate, amount: amount
end

.margin_sell(currency_pair, rate, amount) ⇒ Object



111
112
113
# File 'lib/poloniex.rb', line 111

def self.margin_sell(currency_pair, rate, amount)
  post 'marginSell', currencyPair: currency_pair, rate: rate, amount: amount
end

.move_order(order_number, rate) ⇒ Object



83
84
85
# File 'lib/poloniex.rb', line 83

def self.move_order( order_number, rate )
  post 'moveOrder', orderNumber: order_number, rate: rate
end

.open_orders(currency_pair) ⇒ Object



63
64
65
# File 'lib/poloniex.rb', line 63

def self.open_orders( currency_pair )
  post 'returnOpenOrders', currencyPair: currency_pair
end

.order_book(currency_pair) ⇒ Object



38
39
40
# File 'lib/poloniex.rb', line 38

def self.order_book( currency_pair )
  get 'returnOrderBook', currencyPair: currency_pair
end

.sell(currency_pair, rate, amount) ⇒ Object



75
76
77
# File 'lib/poloniex.rb', line 75

def self.sell( currency_pair, rate, amount )
  post 'sell', currencyPair: currency_pair, rate: rate, amount: amount
end

.setup {|configuration| ... } ⇒ Object

Yields:



12
13
14
15
# File 'lib/poloniex.rb', line 12

def self.setup
  @configuration ||= Configuration.new
  yield( configuration )
end

.tickerObject



30
31
32
# File 'lib/poloniex.rb', line 30

def self.ticker
  get 'returnTicker'
end

.tradable_balancesObject



95
96
97
# File 'lib/poloniex.rb', line 95

def self.tradable_balances
  post 'returnTradableBalances'
end

.trade_history(currency_pair, start = 0, end_time = Time.now.to_i) ⇒ Object



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

def self.trade_history( currency_pair, start = 0, end_time = Time.now.to_i )
  post 'returnTradeHistory', currencyPair: currency_pair, start: start, :end => end_time
end

.transfer_balance(currency, amount, from_ccount, to_account) ⇒ Object



99
100
101
# File 'lib/poloniex.rb', line 99

def self.transfer_balance( currency, amount, from_ccount,  )
  post 'transferBalance', currency: currency, amount: amount, fromAccount: from_ccount, toAccount: 
end

.volumeObject



34
35
36
# File 'lib/poloniex.rb', line 34

def self.volume
  get 'return24hVolume'
end

.withdraw(currency, amount, address) ⇒ Object



87
88
89
# File 'lib/poloniex.rb', line 87

def self.withdraw( currency, amount, address )
  post 'widthdraw', currency: currency, amount: amount, address: address
end