Module: Trader
- Defined in:
- lib/trade-o-matic.rb,
lib/trade-o-matic/cli.rb,
lib/trade-o-matic/errors.rb,
lib/trade-o-matic/version.rb,
lib/trade-o-matic/standard.rb,
lib/trade-o-matic/core/market.rb,
lib/trade-o-matic/core/account.rb,
lib/trade-o-matic/core/balance.rb,
lib/trade-o-matic/structs/book.rb,
lib/trade-o-matic/core/exchange.rb,
lib/trade-o-matic/structs/order.rb,
lib/trade-o-matic/structs/price.rb,
lib/trade-o-matic/structs/slope.rb,
lib/trade-o-matic/structs/currency.rb,
lib/trade-o-matic/structs/ask_slope.rb,
lib/trade-o-matic/structs/bid_slope.rb,
lib/trade-o-matic/structs/converter.rb,
lib/trade-o-matic/core/account_order.rb,
lib/trade-o-matic/core/account_proxy.rb,
lib/trade-o-matic/core/market_loader.rb,
lib/trade-o-matic/structs/transaction.rb,
lib/trade-o-matic/adapters/base_backend.rb,
lib/trade-o-matic/adapters/fake_backend.rb,
lib/trade-o-matic/adapters/game_backend.rb,
lib/trade-o-matic/adapters/game_backend.rb,
lib/trade-o-matic/structs/currency_pair.rb,
lib/trade-o-matic/adapters/itbit_backend.rb,
lib/trade-o-matic/adapters/surbtc_backend.rb,
lib/trade-o-matic/endpoints/base_endpoint.rb,
lib/trade-o-matic/converters/web_converter.rb,
lib/trade-o-matic/services/backend_factory.rb,
lib/trade-o-matic/adapters/base/raw_balance.rb,
lib/trade-o-matic/adapters/bitfinex_backend.rb,
lib/trade-o-matic/adapters/bitstamp_backend.rb,
lib/trade-o-matic/adapters/game_backend/sfm.rb,
lib/trade-o-matic/converters/sync_converter.rb,
lib/trade-o-matic/endpoints/bitcoin_address.rb,
lib/trade-o-matic/adapters/base/raw_resource.rb,
lib/trade-o-matic/converters/fixed_converter.rb,
lib/trade-o-matic/adapters/game_backend/state.rb,
lib/trade-o-matic/converters/inverse_converter.rb,
lib/trade-o-matic/converters/compound_converter.rb,
lib/trade-o-matic/converters/json_api_converter.rb,
lib/trade-o-matic/support/converter_configurator.rb,
lib/trade-o-matic/adapters/base/raw_account_order.rb,
lib/trade-o-matic/adapters/game_backend/cancel_order.rb,
lib/trade-o-matic/adapters/game_backend/configuration.rb,
lib/trade-o-matic/adapters/game_backend/execute_order.rb
Defined Under Namespace
Modules: ConverterConfigurator, MarketLoader, Standard
Classes: Account, AccountOrder, AccountProxy, AskSlope, AssertError, BackendError, BackendFactory, Balance, BaseBackend, BaseEndpoint, BidSlope, BitcoinAddress, BitfinexBackend, BitstampBackend, Book, CLI, CompoundConverter, Converter, Currency, CurrencyPair, Error, Exchange, FakeBackend, FixedConverter, GameBackend, InverseConverter, ItbitBackend, JsonApiConverter, Market, NotSupportedError, Order, Price, RawAccountOrder, RawBalance, RawResource, Slope, SurbtcBackend, SyncConverter, Transaction, WebConverter
Constant Summary
collapse
- VERSION =
"0.5.4"
Class Method Summary
collapse
Class Method Details
.account(_backend, _credentials) ⇒ Object
50
51
52
|
# File 'lib/trade-o-matic.rb', line 50
def self.account(_backend, _credentials)
exchange(_backend).login(_credentials)
end
|
.exchange(_backend) ⇒ Object
42
43
44
|
# File 'lib/trade-o-matic.rb', line 42
def self.exchange(_backend)
Exchange.new BackendFactory.build(_backend)
end
|
.game ⇒ Object
60
61
62
63
|
# File 'lib/trade-o-matic.rb', line 60
def self.game
require 'trade-o-matic/adapters/game_backend'
GameBackend.new
end
|
.market(_backend, _pair, _quote = nil) ⇒ Object
46
47
48
|
# File 'lib/trade-o-matic.rb', line 46
def self.market(_backend, _pair, _quote=nil)
exchange(_backend).market_for(_pair, _quote)
end
|
.setup_game_backend(&_block) ⇒ Object
54
55
56
57
58
|
# File 'lib/trade-o-matic.rb', line 54
def self.setup_game_backend(&_block)
require 'trade-o-matic/adapters/game_backend'
GameBackend::Configuration.tap &_block
nil
end
|