Documentation ¶
Index ¶
- Constants
- Variables
- func Init(ctx context.Context) error
- func NewSymbol(base, quote string) exchange.SpotSymbol
- func ParseSymbol(sym string) (exchange.SpotSymbol, error)
- type AccountBalance
- type AccountReq
- type AccountResp
- type DepositHisrecRecord
- type DepositHisrecReq
- type ExchangeInfo
- type RestClient
- func (rc *RestClient) Account(ctx context.Context, req *AccountReq) (*AccountResp, error)
- func (rc *RestClient) DepositHisrec(ctx context.Context, req *DepositHisrecReq) ([]DepositHisrecRecord, error)
- func (rc *RestClient) ExchangeInfo(ctx context.Context) (*ExchangeInfo, error)
- func (rc *RestClient) FeeRate(ctx context.Context, symbols []exchange.Symbol) ([]*exchange.TradeFee, error)
- func (rc *RestClient) MyTrades(ctx context.Context, symbol string, st int64, et int64, fid int64, limit int) ([]Trade, error)
- func (rc *RestClient) Property() exchange.Property
- func (rc *RestClient) SubAccountAsset(ctx context.Context, req *SubAccountAssetReq) (*SubAccountAssetResp, error)
- func (rc *RestClient) SubAccountFuturesInternalTransfer(ctx context.Context, req *SubAccountFuturesInternalTransferReq) (*SubAccountFuturesInternalTransferResp, error)
- func (rc *RestClient) SubAccountList(ctx context.Context, req *SubAccountReq) (*SubAccountResp, error)
- func (rc *RestClient) SubAccountTransferHistory(ctx context.Context, req *SubAccountTransferHistoryReq) ([]SubAccountTransferHistory, error)
- func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SpotSymbol, error)
- func (rc *RestClient) TradeFee(ctx context.Context, symbol string) ([]TradeFee, error)
- func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
- type SpotSymbol
- type SubAccount
- type SubAccountAssetReq
- type SubAccountAssetResp
- type SubAccountBalance
- type SubAccountFuturesInternalTransfer
- type SubAccountFuturesInternalTransferReq
- func (sr *SubAccountFuturesInternalTransferReq) EndTime(ts int64) *SubAccountFuturesInternalTransferReq
- func (sr *SubAccountFuturesInternalTransferReq) Limit(lmt int) *SubAccountFuturesInternalTransferReq
- func (sr *SubAccountFuturesInternalTransferReq) Page(page int) *SubAccountFuturesInternalTransferReq
- func (sr *SubAccountFuturesInternalTransferReq) StartTime(ts int64) *SubAccountFuturesInternalTransferReq
- type SubAccountFuturesInternalTransferResp
- type SubAccountReq
- type SubAccountResp
- type SubAccountTransferHistory
- type SubAccountTransferHistoryReq
- func (sr *SubAccountTransferHistoryReq) EndTime(ts int64) *SubAccountTransferHistoryReq
- func (sr *SubAccountTransferHistoryReq) FromEmail(email string) *SubAccountTransferHistoryReq
- func (sr *SubAccountTransferHistoryReq) Limit(limit int) *SubAccountTransferHistoryReq
- func (sr *SubAccountTransferHistoryReq) Page(page int) *SubAccountTransferHistoryReq
- func (sr *SubAccountTransferHistoryReq) StartTime(ts int64) *SubAccountTransferHistoryReq
- func (sr *SubAccountTransferHistoryReq) ToEmail(email string) *SubAccountTransferHistoryReq
- type Symbol
- type Trade
- type TradeFee
- type TradeFeeResp
Constants ¶
View Source
const ( SubAccountListEndPoint = "/sapi/v1/sub-account/list" SubAccountTransferHistoryEndPoint = "/sapi/v1/sub-account/sub/transfer/history" SubAccountFuturesInternalTransferEndPoint = "/sapi/v1/sub-account/futures/internalTransfer" SubAccountAssetEndPoint = "/sapi/v3/sub-account/assets" TransferHistoryLimit = 500 )
View Source
const (
AccountEndPoint = "/api/v3/account"
)
View Source
const (
DepositHisrecEndPoint = "/sapi/v1/capital/deposit/hisrec"
)
View Source
const (
MyTradesEndPoint = "/api/v3/myTrades"
)
View Source
const (
TradeFeeEndPoint = "/wapi/v3/tradeFee.html"
)
Variables ¶
View Source
var (
ErrPair = errors.New("symbol pair not support")
)
Functions ¶
func NewSymbol ¶
func NewSymbol(base, quote string) exchange.SpotSymbol
func ParseSymbol ¶
func ParseSymbol(sym string) (exchange.SpotSymbol, error)
Types ¶
type AccountBalance ¶ added in v0.5.4
type AccountReq ¶ added in v0.5.4
func NewAccountReq ¶ added in v0.5.4
func NewAccountReq() *AccountReq
type AccountResp ¶ added in v0.5.4
type AccountResp struct { MakerCommision int `json:"makerCommision"` Balances []AccountBalance `json:"balances"` }
type DepositHisrecRecord ¶ added in v0.5.4
type DepositHisrecRecord struct { Amount string `json:"amount"` Coin string `json:"coin"` Network string `json:"network"` Status int `json:"status"` Address string `json:"address"` AddressTag string `json:"addressTag"` TxID string `json:"txId"` InsertTime int64 `json:"insertTime"` TransferType int `json:"transferType"` UnlockConfirm int `json:"unlockConfirm"` ConfirmTimes string `json:"confirmTimes"` }
type DepositHisrecReq ¶ added in v0.5.4
func NewDepositHisrecReq ¶ added in v0.5.4
func NewDepositHisrecReq() *DepositHisrecReq
type ExchangeInfo ¶
type ExchangeInfo struct {
Symbols []Symbol `json:"symbols"`
}
type RestClient ¶
type RestClient struct {
*binance.RestClient
}
func NewRestClient ¶
func NewRestClient(key, secret string) *RestClient
func (*RestClient) Account ¶ added in v0.5.4
func (rc *RestClient) Account(ctx context.Context, req *AccountReq) (*AccountResp, error)
func (*RestClient) DepositHisrec ¶ added in v0.5.4
func (rc *RestClient) DepositHisrec(ctx context.Context, req *DepositHisrecReq) ([]DepositHisrecRecord, error)
func (*RestClient) ExchangeInfo ¶
func (rc *RestClient) ExchangeInfo(ctx context.Context) (*ExchangeInfo, error)
func (*RestClient) Property ¶
func (rc *RestClient) Property() exchange.Property
func (*RestClient) SubAccountAsset ¶ added in v0.5.4
func (rc *RestClient) SubAccountAsset(ctx context.Context, req *SubAccountAssetReq) (*SubAccountAssetResp, error)
func (*RestClient) SubAccountFuturesInternalTransfer ¶ added in v0.5.4
func (rc *RestClient) SubAccountFuturesInternalTransfer(ctx context.Context, req *SubAccountFuturesInternalTransferReq) (*SubAccountFuturesInternalTransferResp, error)
func (*RestClient) SubAccountList ¶ added in v0.5.4
func (rc *RestClient) SubAccountList(ctx context.Context, req *SubAccountReq) (*SubAccountResp, error)
func (*RestClient) SubAccountTransferHistory ¶ added in v0.5.4
func (rc *RestClient) SubAccountTransferHistory(ctx context.Context, req *SubAccountTransferHistoryReq) ([]SubAccountTransferHistory, error)
func (*RestClient) Symbols ¶
func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.SpotSymbol, error)
func (*RestClient) Trades ¶
func (rc *RestClient) Trades(ctx context.Context, req *exchange.TradeReqParam) ([]exchange.Trade, error)
type SpotSymbol ¶
type SpotSymbol struct { *exchange.BaseSpotSymbol Symbol string }
func (*SpotSymbol) String ¶
func (ss *SpotSymbol) String() string
type SubAccount ¶ added in v0.5.4
type SubAccountAssetReq ¶ added in v0.5.4
func NewSubAccountAssetReq ¶ added in v0.5.4
func NewSubAccountAssetReq(email string) *SubAccountAssetReq
type SubAccountAssetResp ¶ added in v0.5.4
type SubAccountAssetResp struct {
Balances []SubAccountBalance `json:"balances"`
}
type SubAccountBalance ¶ added in v0.5.4
type SubAccountFuturesInternalTransfer ¶ added in v0.5.4
type SubAccountFuturesInternalTransferReq ¶ added in v0.5.4
func NewSubAccountFuturesInternalTransferReq ¶ added in v0.5.4
func NewSubAccountFuturesInternalTransferReq(email string, typ int) *SubAccountFuturesInternalTransferReq
func (*SubAccountFuturesInternalTransferReq) EndTime ¶ added in v0.5.4
func (sr *SubAccountFuturesInternalTransferReq) EndTime(ts int64) *SubAccountFuturesInternalTransferReq
func (*SubAccountFuturesInternalTransferReq) Limit ¶ added in v0.5.4
func (sr *SubAccountFuturesInternalTransferReq) Limit(lmt int) *SubAccountFuturesInternalTransferReq
func (*SubAccountFuturesInternalTransferReq) Page ¶ added in v0.5.4
func (sr *SubAccountFuturesInternalTransferReq) Page(page int) *SubAccountFuturesInternalTransferReq
func (*SubAccountFuturesInternalTransferReq) StartTime ¶ added in v0.5.4
func (sr *SubAccountFuturesInternalTransferReq) StartTime(ts int64) *SubAccountFuturesInternalTransferReq
type SubAccountFuturesInternalTransferResp ¶ added in v0.5.4
type SubAccountFuturesInternalTransferResp struct { Success bool `json:"success"` FuturesType int `json:"futuresType"` Transfers []SubAccountFuturesInternalTransfer `json:"transfers"` }
type SubAccountReq ¶ added in v0.5.4
func NewSubAccountReq ¶ added in v0.5.4
func NewSubAccountReq() *SubAccountReq
func (*SubAccountReq) Email ¶ added in v0.5.4
func (sr *SubAccountReq) Email(email string) *SubAccountReq
func (*SubAccountReq) IsFreeze ¶ added in v0.5.4
func (sr *SubAccountReq) IsFreeze(freeze bool) *SubAccountReq
func (*SubAccountReq) Limit ¶ added in v0.5.4
func (sr *SubAccountReq) Limit(limit int) *SubAccountReq
func (*SubAccountReq) Page ¶ added in v0.5.4
func (sr *SubAccountReq) Page(page int) *SubAccountReq
type SubAccountResp ¶ added in v0.5.4
type SubAccountResp struct {
SubAccounts []SubAccount `json:"subAccounts"`
}
type SubAccountTransferHistory ¶ added in v0.5.4
type SubAccountTransferHistoryReq ¶ added in v0.5.4
func NewSubAccountTransferHistoryReq ¶ added in v0.5.4
func NewSubAccountTransferHistoryReq() *SubAccountTransferHistoryReq
func (*SubAccountTransferHistoryReq) EndTime ¶ added in v0.5.4
func (sr *SubAccountTransferHistoryReq) EndTime(ts int64) *SubAccountTransferHistoryReq
func (*SubAccountTransferHistoryReq) FromEmail ¶ added in v0.5.4
func (sr *SubAccountTransferHistoryReq) FromEmail(email string) *SubAccountTransferHistoryReq
func (*SubAccountTransferHistoryReq) Limit ¶ added in v0.5.4
func (sr *SubAccountTransferHistoryReq) Limit(limit int) *SubAccountTransferHistoryReq
func (*SubAccountTransferHistoryReq) Page ¶ added in v0.5.4
func (sr *SubAccountTransferHistoryReq) Page(page int) *SubAccountTransferHistoryReq
func (*SubAccountTransferHistoryReq) StartTime ¶ added in v0.5.4
func (sr *SubAccountTransferHistoryReq) StartTime(ts int64) *SubAccountTransferHistoryReq
func (*SubAccountTransferHistoryReq) ToEmail ¶ added in v0.5.4
func (sr *SubAccountTransferHistoryReq) ToEmail(email string) *SubAccountTransferHistoryReq
type Symbol ¶
type Symbol struct { Symbol string `json:"symbol"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAssetPrecision int `json:"quoteAssetPrecision"` }
Symbol info TODO: refactor Symbol add more info pricePrecison ...
type Trade ¶
type Trade struct { Symbol string `json:"symbol"` ID int64 `json:"id"` OrderID int64 `json:"orderId"` OrderListID int64 `json:"orderListId"` Price decimal.Decimal `json:"price"` Qty decimal.Decimal `json:"qty"` QuoteQty decimal.Decimal `json:"quoteQty"` Commission decimal.Decimal `json:"commission"` CommissionAsset string `json:"commissionAsset"` Time int64 `json:"time"` IsBuyer bool `json:"isBuyer"` IsMaker bool `json:"isMaker"` IsBestMatch bool `json:"isBestMatch"` }
type TradeFeeResp ¶
Click to show internal directories.
Click to hide internal directories.