mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* currency: Add pair matching update (cherry-pick) * exchange/currency: Add tests and update func * linter fix, also if using json unmarshal functionality stop usage of string conversion without delimiter * gemini: fix test * currency/manager: potential optimisation * exchanges: purge derive from wrapper cases and add warning comment * glorious: nits * glorious: nits * linter: fix * glorious: nits * whoops * whoops * glorious: nits continued * glorious: diff THANKS! * hitbtc: fix update tradable pairs strings splitting. continue if not enabled tickers update pair. * glorious: nits * linter: fix * Update exchanges/exmo/exmo_wrapper.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * bitstamp: fix test when 32 biterinos architecturinos * capture more strings for speed * swapsies because whos running 32bit \0/? --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package currency
|
|
|
|
// Pair holds currency pair information
|
|
// NOTE: UnmarshalJSON allows string conversion to Pair type but only if there
|
|
// is a delimiter present in the string, otherwise it will return an error.
|
|
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
|
|
// Pair is the currency pair that the order parameters are derived from.
|
|
Pair Pair
|
|
}
|