blockchain/internal/domain/usecase/data_source.go

28 lines
933 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package usecase
import (
"context"
)
type DataSourceUseCase interface {
GetSymbols(ctx context.Context) ([]*Symbol, error)
UpsertKline(ctx context.Context, data QueryKline) error
}
// Symbol 代表交易對資訊
type Symbol struct {
Symbol string `json:"symbol"` // 交易對名稱 BTCUSDT
Status string `json:"status"` // 狀態(如 "TRADING" 表示可交易)
BaseAsset string `json:"base_asset"` // 主幣種(如 BTCUSDT 的 BTC
BaseAssetPrecision int `json:"base_asset_precision"` // 主幣的小數點精度
QuoteAsset string `json:"quote_asset"` // 報價幣種(如 BTCUSDT 的 USDT
QuoteAssetPrecision int `json:"quote_asset_precision"` // 報價資產顯示的小數位數
}
type QueryKline struct {
Symbol string
Interval string
StartUnixNano int64
EndUnixNano int64
}