Documentation ¶
Index ¶
- Variables
- type Currency
- func (c *Currency) CanDeposit() bool
- func (c *Currency) CanTrade() bool
- func (c *Currency) CanWithdraw() bool
- func (c *Currency) GetState() Options
- func (c *Currency) WaitDeposit(kick <-chan struct{}) <-chan bool
- func (c *Currency) WaitTrading(kick <-chan struct{}) <-chan bool
- func (c *Currency) WaitWithdraw(kick <-chan struct{}) <-chan bool
- type Options
- type Snapshot
- type States
- func (s *States) CanDeposit(c currency.Code, a asset.Item) error
- func (s *States) CanTrade(c currency.Code, a asset.Item) error
- func (s *States) CanTradePair(pair currency.Pair, a asset.Item) error
- func (s *States) CanWithdraw(c currency.Code, a asset.Item) error
- func (s *States) Get(c currency.Code, a asset.Item) (*Currency, error)
- func (s *States) GetCurrencyStateSnapshot() ([]Snapshot, error)
- func (s *States) Update(c currency.Code, a asset.Item, o Options) error
- func (s *States) UpdateAll(a asset.Item, updates map[currency.Code]Options) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCurrencyStateNotFound is an error when the currency state has not been // found // TODO: distinguish between unsupported and not found ErrCurrencyStateNotFound = errors.New("currency state not found") )
Functions ¶
This section is empty.
Types ¶
type Currency ¶
type Currency struct {
// contains filtered or unexported fields
}
Currency defines the state of currency operations
func (*Currency) CanDeposit ¶
CanDeposit returns if the currency can be deposited onto an exchange
func (*Currency) CanWithdraw ¶
CanWithdraw returns if the currency can be withdrawn from the exchange
func (*Currency) WaitDeposit ¶
WaitDeposit allows a routine to wait until a deposit change of state occurs
func (*Currency) WaitTrading ¶
WaitTrading allows a routine to wait until a trading change of state occurs
func (*Currency) WaitWithdraw ¶
WaitWithdraw allows a routine to wait until a withdraw change of state occurs
type Options ¶
Options defines the current allowable options for a currency, using a bool pointer for optional setting for incomplete data, so we can default to true on nil values.
type States ¶
type States struct {
// contains filtered or unexported fields
}
States defines all currency states for an exchange
func NewCurrencyStates ¶
func NewCurrencyStates() *States
NewCurrencyStates gets a new type for tracking exchange currency states
func (*States) CanDeposit ¶
CanDeposit returns if the currency can be deposited onto this exchange
func (*States) CanTradePair ¶
CanTradePair returns if the currency pair is currently tradeable for this exchange. If there are no states loaded for a specific currency, this will assume the currency pair is operational. NOTE: Future exchanges will have functionality specific to a currency.Pair, can upgrade this when needed.
func (*States) CanWithdraw ¶
CanWithdraw returns if the currency can be withdrawn from this exchange
func (*States) GetCurrencyStateSnapshot ¶
GetCurrencyStateSnapshot returns the exchange currency state snapshot