Files
gocryptotrader/currency/pair_types.go
Adrian Gallagher 4651af5767 modernise: Run new gopls modernise tool against the codebase and fix minor issues (#1826)
* modernise: Run new gopls modernise tool against codebase

* Address shazbert's nits

* apichecker, gctcli: Simplify HTML scraping functions and improve depth limit handling

* refactor: Create minSyncInterval const and update order book limit handling for binance and binanceUS

* refactor: Various slice usage improvements and rename TODO

* tranches: Revert deleteByID changes due to performance decrease

Shazbert was a F1 driver in a past lifetime 🏎️

* tranches: Simply retrieve copy

Thanks to shazbert

* documentation: Sort contributors list by contributions

* tranches: Remove deadcode in deleteByID
2025-03-21 09:17:10 +11:00

39 lines
1.2 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"`
Quote Code `json:"quote"`
}
// 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
}