Class: Ubea::Exchange::BitstampUsd
- Inherits:
-
Base
- Object
- Base
- Ubea::Exchange::BitstampUsd
show all
- Defined in:
- lib/ubea/exchanges/bitstamp_usd.rb
Instance Attribute Summary
Attributes inherited from Base
#last_rtt, #order_book, #updated_at
Instance Method Summary
collapse
Methods inherited from Base
#balance, #id, #short_name
Instance Method Details
#fiat_currency ⇒ Object
14
15
16
|
# File 'lib/ubea/exchanges/bitstamp_usd.rb', line 14
def fiat_currency
"USD".freeze
end
|
#name ⇒ Object
10
11
12
|
# File 'lib/ubea/exchanges/bitstamp_usd.rb', line 10
def name
"Bitstamp (#{fiat_currency})".freeze
end
|
#refresh_order_book! ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/ubea/exchanges/bitstamp_usd.rb', line 22
def refresh_order_book!
json = get_json("https://www.bitstamp.net/api/order_book/") or return
asks = format_asks_bids(json["asks"])
bids = format_asks_bids(json["bids"])
mark_as_refreshed
@order_book = OrderBook.new(asks: asks, bids: bids)
end
|
#trade_fee ⇒ Object
18
19
20
|
# File 'lib/ubea/exchanges/bitstamp_usd.rb', line 18
def trade_fee
BigDecimal.new("0.005").freeze
end
|
#website ⇒ Object
6
7
8
|
# File 'lib/ubea/exchanges/bitstamp_usd.rb', line 6
def website
"https://www.bitstamp.net/".freeze
end
|