Files
gocryptotrader/currency/pair_types.go
Ryan O'Hara-Reid 9e4ea6c62b currency: Add OrderParameters helpers for currency pair (#1217)
* currency: Add order aspect from pair helper method.

* Update currency/pair_methods.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update currency/pair_types.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* glorious: nit cont. rm pair field and used IsPopulated method instead of IsEmpty

* thrasher: nits

* ch test name

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-06-09 10:07:04 +10:00

35 lines
1.0 KiB
Go

package currency
// Pair holds currency pair information
type Pair struct {
Delimiter string `json:"delimiter,omitempty"`
Base Code `json:"base,omitempty"`
Quote Code `json:"quote,omitempty"`
}
// Pairs defines a list of pairs
type Pairs []Pair
// PairDifference defines the difference between a set of pairs including a
// change in format.
type PairDifference struct {
New Pairs
Remove Pairs
FormatDifference bool
}
// OrderParameters is used to determine the order side, liquidity side and the
// selling & purchasing currency derived from the currency pair.
type OrderParameters struct {
// SellingCurrency is the currency that will be sold first
SellingCurrency Code
// Purchasing is the currency that will be purchased last
PurchasingCurrency Code
// IsBuySide is the side of the order that will be placed true for buy/long,
// false for sell/short.
IsBuySide bool
// IsAskLiquidity is the side of the orderbook that will be used, false for
// bid liquidity.
IsAskLiquidity bool
}