types: split exchange interface for ExchangeMinimal

This commit is contained in:
c9s 2023-05-16 18:17:11 +08:00
parent 177610266d
commit 0b6dc41091
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -70,11 +70,14 @@ func ValidExchangeName(a string) (ExchangeName, error) {
return "", fmt.Errorf("invalid exchange name: %s", a)
}
type ExchangeMinimal interface {
Name() ExchangeName
PlatformFeeCurrency() string
}
//go:generate mockgen -destination=mocks/mock_exchange.go -package=mocks . Exchange
type Exchange interface {
Name() ExchangeName
PlatformFeeCurrency() string
ExchangeMinimal
ExchangeMarketDataService
@ -82,6 +85,7 @@ type Exchange interface {
}
// ExchangeOrderQueryService provides an interface for querying the order status via order ID or client order ID
//
//go:generate mockgen -destination=mocks/mock_exchange_order_query.go -package=mocks . ExchangeOrderQueryService
type ExchangeOrderQueryService interface {
QueryOrder(ctx context.Context, q OrderQuery) (*Order, error)