Class: Vexapion::Poloniex
Instance Method Summary
collapse
-
#available_account_balances ⇒ Object
-
#balances ⇒ Object
-
#buy(pair, rate, amount) ⇒ Object
-
#cancel_order(order_number) ⇒ Object
-
#complete_balances(account = 'all') ⇒ Object
-
#deposit_addresses ⇒ Object
-
#deposits_withdrawals(start_time, end_time, count) ⇒ Object
-
#fee_info ⇒ Object
-
#generate_new_address(currency) ⇒ Object
-
#initialize(key = nil, secret = nil) ⇒ Poloniex
constructor
-
#margin_account_summary ⇒ Object
-
#margin_buy(pair, rate, amount) ⇒ Object
-
#margin_sell(pair, rate, amount) ⇒ Object
-
#market_trade_history(pair, start_time = '', end_time = '') ⇒ Object
-
#move_order(order_number, rate) ⇒ Object
-
#open_orders(pair) ⇒ Object
-
#orderbook(pair, depth) ⇒ Object
-
#sell(pair, rate, amount) ⇒ Object
-
#set_min_interval(sec) ⇒ Object
-
#ticker ⇒ Object
-
#tradable_balances ⇒ Object
-
#trade_history(pair, start, end_time) ⇒ Object
-
#transfer_balance(currency, amount, from_account, to_account) ⇒ Object
-
#volume_24hours ⇒ Object
-
#withdraw(currency, amount, address) ⇒ Object
#disconnect, #do_command, #get_nonce, #set_verify_mode
Constructor Details
#initialize(key = nil, secret = nil) ⇒ Poloniex
9
10
11
12
13
14
15
|
# File 'lib/vexapion/poloniex.rb', line 9
def initialize(key = nil, secret = nil)
super(key, secret)
@public_url = 'https://poloniex.com/public?'
@private_url = 'https://poloniex.com/tradingApi'
set_min_interval(0.5)
end
|
Instance Method Details
#available_account_balances ⇒ Object
91
92
93
|
# File 'lib/vexapion/poloniex.rb', line 91
def available_account_balances
post('returnAvailableAccountBalances')
end
|
#balances ⇒ Object
51
52
53
|
# File 'lib/vexapion/poloniex.rb', line 51
def balances
post('returnBalances')
end
|
#buy(pair, rate, amount) ⇒ Object
68
69
70
71
|
# File 'lib/vexapion/poloniex.rb', line 68
def buy(pair, rate, amount)
post('buy', 'currencyPair' => pair.upcase,
'rate' => rate, 'amount' => amount)
end
|
#cancel_order(order_number) ⇒ Object
78
79
80
|
# File 'lib/vexapion/poloniex.rb', line 78
def cancel_order(order_number)
post('cancelOrder', orderNumber: order_number)
end
|
#complete_balances(account = 'all') ⇒ Object
55
56
57
|
# File 'lib/vexapion/poloniex.rb', line 55
def complete_balances(account='all')
post('returnCompleteBalances', 'account' => account)
end
|
#deposit_addresses ⇒ Object
118
119
120
|
# File 'lib/vexapion/poloniex.rb', line 118
def deposit_addresses
post('returnDepositAddresses')
end
|
#deposits_withdrawals(start_time, end_time, count) ⇒ Object
126
127
128
129
|
# File 'lib/vexapion/poloniex.rb', line 126
def deposits_withdrawals(start_time, end_time, count)
post('returnDepositsWithdrawals',
'start' => start_time, 'end' => end_time, 'count' => count)
end
|
#fee_info ⇒ Object
47
48
49
|
# File 'lib/vexapion/poloniex.rb', line 47
def fee_info
post('returnFeeInfo')
end
|
#generate_new_address(currency) ⇒ Object
122
123
124
|
# File 'lib/vexapion/poloniex.rb', line 122
def generate_new_address(currency)
post('generateNewAddress', 'currency' => currency.upcase)
end
|
#margin_account_summary ⇒ Object
104
105
106
|
# File 'lib/vexapion/poloniex.rb', line 104
def margin_account_summary
post('returnMarginAccountSummary')
end
|
#margin_buy(pair, rate, amount) ⇒ Object
108
109
110
111
|
# File 'lib/vexapion/poloniex.rb', line 108
def margin_buy(pair, rate, amount)
post('marginBuy', 'currencyPair' => pair.upcase,
'rate' => rate, 'amount' => amount)
end
|
#margin_sell(pair, rate, amount) ⇒ Object
113
114
115
116
|
# File 'lib/vexapion/poloniex.rb', line 113
def margin_sell(pair, rate, amount)
post('marginSell', 'currencyPair' => pair.upcase,
'rate' => rate, 'amount' => amount)
end
|
#market_trade_history(pair, start_time = '', end_time = '') ⇒ Object
37
38
39
40
41
42
|
# File 'lib/vexapion/poloniex.rb', line 37
def market_trade_history(pair, start_time='', end_time='')
params = { currencyPair: pair.upcase }
params[:start] = start_time if start_time != ''
params[:end] = end_time if end_time != ''
get('returnTradeHistory', params)
end
|
#move_order(order_number, rate) ⇒ Object
82
83
84
|
# File 'lib/vexapion/poloniex.rb', line 82
def move_order(order_number, rate)
post('moveOrder', orderNumber: order_number, 'rate' => rate)
end
|
#open_orders(pair) ⇒ Object
59
60
61
|
# File 'lib/vexapion/poloniex.rb', line 59
def open_orders(pair)
post('returnOpenOrders', currencyPair: pair.upcase)
end
|
#orderbook(pair, depth) ⇒ Object
33
34
35
|
# File 'lib/vexapion/poloniex.rb', line 33
def orderbook(pair, depth)
get('returnOrderBook', currencyPair: pair.upcase, depth: depth)
end
|
#sell(pair, rate, amount) ⇒ Object
73
74
75
76
|
# File 'lib/vexapion/poloniex.rb', line 73
def sell(pair, rate, amount)
post('sell', 'currencyPair' => pair.upcase,
'rate' => rate, 'amount' => amount)
end
|
#set_min_interval(sec) ⇒ Object
18
19
20
|
# File 'lib/vexapion/poloniex.rb', line 18
def set_min_interval(sec)
@conn.min_interval = sec
end
|
#ticker ⇒ Object
29
30
31
|
# File 'lib/vexapion/poloniex.rb', line 29
def ticker
get('returnTicker')
end
|
#tradable_balances ⇒ Object
95
96
97
|
# File 'lib/vexapion/poloniex.rb', line 95
def tradable_balances
post('returnTradableBalances')
end
|
#trade_history(pair, start, end_time) ⇒ Object
63
64
65
66
|
# File 'lib/vexapion/poloniex.rb', line 63
def trade_history(pair, start, end_time)
post('returnTradeHistory', 'currencyPair' => pair.upcase,
'start' => start, 'end' => end_time)
end
|
#transfer_balance(currency, amount, from_account, to_account) ⇒ Object
99
100
101
102
|
# File 'lib/vexapion/poloniex.rb', line 99
def transfer_balance(currency, amount, from_account, to_account)
post('transferBalance', currency: currency.upcase, amount: amount,
fromAccount: from_account, toAccount: to_account)
end
|
#volume_24hours ⇒ Object
25
26
27
|
# File 'lib/vexapion/poloniex.rb', line 25
def volume_24hours
get('return24hVolume')
end
|
#withdraw(currency, amount, address) ⇒ Object
86
87
88
89
|
# File 'lib/vexapion/poloniex.rb', line 86
def withdraw(currency, amount, address)
post('widthdraw', currency: currency.upcase,
'amount' => amount, 'address' => address)
end
|