binance

package module
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: MIT Imports: 23 Imported by: 2

Documentation

Overview

Package binance is a Golang SDK for binance APIs.

Index

Constants

View Source
const (
	SideTypeBuy  SideType = "BUY"
	SideTypeSell SideType = "SELL"

	OrderTypeLimit           OrderType = "LIMIT"
	OrderTypeMarket          OrderType = "MARKET"
	OrderTypeLimitMaker      OrderType = "LIMIT_MAKER"
	OrderTypeStopLoss        OrderType = "STOP_LOSS"
	OrderTypeStopLossLimit   OrderType = "STOP_LOSS_LIMIT"
	OrderTypeTakeProfit      OrderType = "TAKE_PROFIT"
	OrderTypeTakeProfitLimit OrderType = "TAKE_PROFIT_LIMIT"

	TimeInForceTypeGTC TimeInForceType = "GTC"
	TimeInForceTypeIOC TimeInForceType = "IOC"
	TimeInForceTypeFOK TimeInForceType = "FOK"

	NewOrderRespTypeACK    NewOrderRespType = "ACK"
	NewOrderRespTypeRESULT NewOrderRespType = "RESULT"
	NewOrderRespTypeFULL   NewOrderRespType = "FULL"

	OrderStatusTypeNew             OrderStatusType = "NEW"
	OrderStatusTypePartiallyFilled OrderStatusType = "PARTIALLY_FILLED"
	OrderStatusTypeFilled          OrderStatusType = "FILLED"
	OrderStatusTypeCanceled        OrderStatusType = "CANCELED"
	OrderStatusTypePendingCancel   OrderStatusType = "PENDING_CANCEL"
	OrderStatusTypeRejected        OrderStatusType = "REJECTED"
	OrderStatusTypeExpired         OrderStatusType = "EXPIRED"
	OrderStatusExpiredInMatch      OrderStatusType = "EXPIRED_IN_MATCH" // STP Expired

	SymbolTypeSpot SymbolType = "SPOT"

	SymbolStatusTypePreTrading   SymbolStatusType = "PRE_TRADING"
	SymbolStatusTypeTrading      SymbolStatusType = "TRADING"
	SymbolStatusTypePostTrading  SymbolStatusType = "POST_TRADING"
	SymbolStatusTypeEndOfDay     SymbolStatusType = "END_OF_DAY"
	SymbolStatusTypeHalt         SymbolStatusType = "HALT"
	SymbolStatusTypeAuctionMatch SymbolStatusType = "AUCTION_MATCH"
	SymbolStatusTypeBreak        SymbolStatusType = "BREAK"

	SymbolFilterTypeLotSize            SymbolFilterType = "LOT_SIZE"
	SymbolFilterTypePriceFilter        SymbolFilterType = "PRICE_FILTER"
	SymbolFilterTypePercentPriceBySide SymbolFilterType = "PERCENT_PRICE_BY_SIDE"
	SymbolFilterTypeMinNotional        SymbolFilterType = "MIN_NOTIONAL"
	SymbolFilterTypeNotional           SymbolFilterType = "NOTIONAL"
	SymbolFilterTypeIcebergParts       SymbolFilterType = "ICEBERG_PARTS"
	SymbolFilterTypeMarketLotSize      SymbolFilterType = "MARKET_LOT_SIZE"
	SymbolFilterTypeMaxNumOrders       SymbolFilterType = "MAX_NUM_ORDERS"
	SymbolFilterTypeMaxNumAlgoOrders   SymbolFilterType = "MAX_NUM_ALGO_ORDERS"
	SymbolFilterTypeTrailingDelta      SymbolFilterType = "TRAILING_DELTA"

	UserDataEventTypeOutboundAccountPosition UserDataEventType = "outboundAccountPosition"
	UserDataEventTypeBalanceUpdate           UserDataEventType = "balanceUpdate"
	UserDataEventTypeExecutionReport         UserDataEventType = "executionReport"
	UserDataEventTypeListStatus              UserDataEventType = "ListStatus"

	MarginTransferTypeToMargin MarginTransferType = 1
	MarginTransferTypeToMain   MarginTransferType = 2

	FuturesTransferTypeToFutures FuturesTransferType = 1
	FuturesTransferTypeToMain    FuturesTransferType = 2

	MarginLoanStatusTypePending   MarginLoanStatusType = "PENDING"
	MarginLoanStatusTypeConfirmed MarginLoanStatusType = "CONFIRMED"
	MarginLoanStatusTypeFailed    MarginLoanStatusType = "FAILED"

	MarginRepayStatusTypePending   MarginRepayStatusType = "PENDING"
	MarginRepayStatusTypeConfirmed MarginRepayStatusType = "CONFIRMED"
	MarginRepayStatusTypeFailed    MarginRepayStatusType = "FAILED"

	FuturesTransferStatusTypePending   FuturesTransferStatusType = "PENDING"
	FuturesTransferStatusTypeConfirmed FuturesTransferStatusType = "CONFIRMED"
	FuturesTransferStatusTypeFailed    FuturesTransferStatusType = "FAILED"

	SideEffectTypeNoSideEffect SideEffectType = "NO_SIDE_EFFECT"
	SideEffectTypeMarginBuy    SideEffectType = "MARGIN_BUY"
	SideEffectTypeAutoRepay    SideEffectType = "AUTO_REPAY"

	TransactionTypeDeposit  TransactionType = "0"
	TransactionTypeWithdraw TransactionType = "1"
	TransactionTypeBuy      TransactionType = "0"
	TransactionTypeSell     TransactionType = "1"

	LendingTypeFlexible LendingType = "DAILY"
	LendingTypeFixed    LendingType = "CUSTOMIZED_FIXED"
	LendingTypeActivity LendingType = "ACTIVITY"

	LiquidityOperationTypeCombination LiquidityOperationType = "COMBINATION"
	LiquidityOperationTypeSingle      LiquidityOperationType = "SINGLE"

	StakingProductLockedStaking       = "STAKING"
	StakingProductFlexibleDeFiStaking = "F_DEFI"
	StakingProductLockedDeFiStaking   = "L_DEFI"

	StakingTransactionTypeSubscription = "SUBSCRIPTION"
	StakingTransactionTypeRedemption   = "REDEMPTION"
	StakingTransactionTypeInterest     = "INTEREST"

	SwappingStatusPending SwappingStatus = 0
	SwappingStatusDone    SwappingStatus = 1
	SwappingStatusFailed  SwappingStatus = 2

	RewardTypeTrading   LiquidityRewardType = 0
	RewardTypeLiquidity LiquidityRewardType = 1

	RewardClaimPending RewardClaimStatus = 0
	RewardClaimDone    RewardClaimStatus = 1

	RateLimitTypeRequestWeight RateLimitType = "REQUEST_WEIGHT"
	RateLimitTypeOrders        RateLimitType = "ORDERS"
	RateLimitTypeRawRequests   RateLimitType = "RAW_REQUESTS"

	RateLimitIntervalSecond RateLimitInterval = "SECOND"
	RateLimitIntervalMinute RateLimitInterval = "MINUTE"
	RateLimitIntervalDay    RateLimitInterval = "DAY"

	AccountTypeSpot           AccountType = "SPOT"
	AccountTypeMargin         AccountType = "MARGIN"
	AccountTypeIsolatedMargin AccountType = "ISOLATED_MARGIN"
	AccountTypeUSDTFuture     AccountType = "USDT_FUTURE"
	AccountTypeCoinFuture     AccountType = "COIN_FUTURE"
)

Global enums

Variables

View Source
var (
	BaseAPIMainURL    = "https://api.binance.com"
	BaseAPITestnetURL = "https://testnet.binance.vision"
)

Endpoints

View Source
var (
	// Endpoints
	BaseWsMainURL          = "wss://stream.binance.com:9443/ws"
	BaseWsTestnetURL       = "wss://testnet.binance.vision/ws"
	BaseCombinedMainURL    = "wss://stream.binance.com:9443/stream?streams="
	BaseCombinedTestnetURL = "wss://testnet.binance.vision/stream?streams="

	// WebsocketTimeout is an interval for sending ping/pong messages if WebsocketKeepalive is enabled
	WebsocketTimeout = time.Second * 60
	// WebsocketKeepalive enables sending ping/pong messages to check the connection stability
	WebsocketKeepalive = false
)
View Source
var UseTestnet = false

UseTestnet switch all the API endpoints from production to the testnet

Functions

func FormatTimestamp

func FormatTimestamp(t time.Time) int64

FormatTimestamp formats a time into Unix timestamp in milliseconds, as requested by Binance.

func NewDeliveryClient

func NewDeliveryClient(apiKey, secretKey string) *delivery.Client

NewDeliveryClient initialize client for coin-M futures API

func NewFuturesClient

func NewFuturesClient(apiKey, secretKey string) *futures.Client

NewFuturesClient initialize client for futures API

func NewOptionsClient added in v2.0.1

func NewOptionsClient(apiKey, secretKey string) *options.Client

NewOptionsClient initialize client for options API

func WsAggTradeServe

func WsAggTradeServe(symbol string, handler WsAggTradeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsAggTradeServe serve websocket aggregate handler with a symbol

func WsAllBookTickerServe

func WsAllBookTickerServe(handler WsBookTickerHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsAllBookTickerServe serve websocket that pushes updates to the best bid or ask price or quantity in real-time for all symbols.

func WsAllMarketsStatServe

func WsAllMarketsStatServe(handler WsAllMarketsStatHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsAllMarketsStatServe serve websocket that push 24hr statistics for all market every second

func WsAllMiniMarketsStatServe

func WsAllMiniMarketsStatServe(handler WsAllMiniMarketsStatServeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsAllMiniMarketsStatServe serve websocket that push mini version of 24hr statistics for all market every second

func WsBookTickerServe

func WsBookTickerServe(symbol string, handler WsBookTickerHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsBookTickerServe serve websocket that pushes updates to the best bid or ask price or quantity in real-time for a specified symbol.

func WsCombinedAggTradeServe

func WsCombinedAggTradeServe(symbols []string, handler WsAggTradeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsCombinedAggTradeServe is similar to WsAggTradeServe, but it handles multiple symbolx

func WsCombinedBookTickerServe

func WsCombinedBookTickerServe(symbols []string, handler WsBookTickerHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsCombinedBookTickerServe is similar to WsBookTickerServe, but it is for multiple symbols

func WsCombinedDepthServe

func WsCombinedDepthServe(symbols []string, handler WsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsCombinedDepthServe is similar to WsDepthServe, but it for multiple symbols

func WsCombinedDepthServe100Ms

func WsCombinedDepthServe100Ms(symbols []string, handler WsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

func WsCombinedKlineServe

func WsCombinedKlineServe(symbolIntervalPair map[string]string, handler WsKlineHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsCombinedKlineServe is similar to WsKlineServe, but it handles multiple symbols with it interval

func WsCombinedMarketStatServe

func WsCombinedMarketStatServe(symbols []string, handler WsMarketStatHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsCombinedMarketStatServe is similar to WsMarketStatServe, but it handles multiple symbolx

func WsCombinedPartialDepthServe

func WsCombinedPartialDepthServe(symbolLevels map[string]string, handler WsPartialDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsCombinedPartialDepthServe is similar to WsPartialDepthServe, but it for multiple symbols

func WsCombinedTradeServe

func WsCombinedTradeServe(symbols []string, handler WsCombinedTradeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

func WsDepthServe

func WsDepthServe(symbol string, handler WsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsDepthServe serve websocket depth handler with a symbol, using 1sec updates

func WsDepthServe100Ms

func WsDepthServe100Ms(symbol string, handler WsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsDepthServe100Ms serve websocket depth handler with a symbol, using 100msec updates

func WsKlineServe

func WsKlineServe(symbol string, interval string, handler WsKlineHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsKlineServe serve websocket kline handler with a symbol and interval like 15m, 30s

func WsMarketStatServe

func WsMarketStatServe(symbol string, handler WsMarketStatHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsMarketStatServe serve websocket that push 24hr statistics for single market every second

func WsPartialDepthServe

func WsPartialDepthServe(symbol string, levels string, handler WsPartialDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsPartialDepthServe serve websocket partial depth handler with a symbol, using 1sec updates

func WsPartialDepthServe100Ms

func WsPartialDepthServe100Ms(symbol string, levels string, handler WsPartialDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsPartialDepthServe100Ms serve websocket partial depth handler with a symbol, using 100msec updates

func WsTradeServe

func WsTradeServe(symbol string, handler WsTradeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsTradeServe serve websocket handler with a symbol

func WsUserDataServe

func WsUserDataServe(listenKey string, handler WsUserDataHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error)

WsUserDataServe serve user data handler with listen key

Types

type APIKeyPermission

type APIKeyPermission struct {
	IPRestrict                     bool   `json:"ipRestrict"`
	CreateTime                     uint64 `json:"createTime"`
	EnableWithdrawals              bool   `json:"enableWithdrawals"`
	EnableInternalTransfer         bool   `json:"enableInternalTransfer"`
	PermitsUniversalTransfer       bool   `json:"permitsUniversalTransfer"`
	EnableVanillaOptions           bool   `json:"enableVanillaOptions"`
	EnableReading                  bool   `json:"enableReading"`
	EnableFutures                  bool   `json:"enableFutures"`
	EnableMargin                   bool   `json:"enableMargin"`
	EnableSpotAndMarginTrading     bool   `json:"enableSpotAndMarginTrading"`
	TradingAuthorityExpirationTime uint64 `json:"tradingAuthorityExpirationTime"`
}

APIKeyPermission define API key permission

type Account

type Account struct {
	MakerCommission  int64           `json:"makerCommission"`
	TakerCommission  int64           `json:"takerCommission"`
	BuyerCommission  int64           `json:"buyerCommission"`
	SellerCommission int64           `json:"sellerCommission"`
	CommissionRates  CommissionRates `json:"commissionRates"`
	CanTrade         bool            `json:"canTrade"`
	CanWithdraw      bool            `json:"canWithdraw"`
	CanDeposit       bool            `json:"canDeposit"`
	UpdateTime       uint64          `json:"updateTime"`
	AccountType      string          `json:"accountType"`
	Balances         []Balance       `json:"balances"`
	Permissions      []string        `json:"permissions"`
}

Account define account info

type AccountType

type AccountType string

AccountType define the account types

type AddLiquidityPreviewResponse

type AddLiquidityPreviewResponse struct {
	QuoteAsset string `json:"quoteAsset"`
	BaseAsset  string `json:"baseAsset"` // only existed when type is COMBINATION
	QuoteAmt   string `json:"quoteAmt"`
	BaseAmt    string `json:"baseAmt"` // only existed when type is COMBINATION
	Price      string `json:"price"`
	Share      string `json:"share"`
	Slippage   string `json:"slippage"`
	Fee        string `json:"fee"`
}

type AddLiquidityPreviewService

type AddLiquidityPreviewService struct {
	// contains filtered or unexported fields
}

AddLiquidityPreviewService to preview the quote/base qty needed when adding assets to a liquidity pool with an estimated share after adding the liquidity

func (*AddLiquidityPreviewService) Do

Do sends the request.

func (*AddLiquidityPreviewService) OperationType

OperationType set operationType

func (*AddLiquidityPreviewService) PoolId

PoolId set poolId

func (*AddLiquidityPreviewService) QuoteAsset

QuoteAsset set quoteAsset

func (*AddLiquidityPreviewService) QuoteQty

QuoteQty set quoteQty

type AddLiquidityResponse

type AddLiquidityResponse struct {
	OperationId int64 `json:"operationId"`
}

type AddLiquidityService

type AddLiquidityService struct {
	// contains filtered or unexported fields
}

AddLiquidityService to add liquidity

func (*AddLiquidityService) Do

Do sends the request.

func (*AddLiquidityService) OperationType

func (s *AddLiquidityService) OperationType(operationType LiquidityOperationType) *AddLiquidityService

OperationType set operationType

func (*AddLiquidityService) PoolId

func (s *AddLiquidityService) PoolId(poolId int64) *AddLiquidityService

PoolId set poolId

func (*AddLiquidityService) QuoteAsset

func (s *AddLiquidityService) QuoteAsset(quoteAsset string) *AddLiquidityService

QuoteAsset set quoteAsset

func (*AddLiquidityService) QuoteQty

func (s *AddLiquidityService) QuoteQty(quoteQty float64) *AddLiquidityService

QuoteQty set quoteQty

type AggTrade

type AggTrade struct {
	AggTradeID       int64  `json:"a"`
	Price            string `json:"p"`
	Quantity         string `json:"q"`
	FirstTradeID     int64  `json:"f"`
	LastTradeID      int64  `json:"l"`
	Timestamp        int64  `json:"T"`
	IsBuyerMaker     bool   `json:"m"`
	IsBestPriceMatch bool   `json:"M"`
}

AggTrade define aggregate trade info

type AggTradesService

type AggTradesService struct {
	// contains filtered or unexported fields
}

AggTradesService list aggregate trades

func (*AggTradesService) Do

func (s *AggTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*AggTrade, err error)

Do send request

func (*AggTradesService) EndTime

func (s *AggTradesService) EndTime(endTime int64) *AggTradesService

EndTime set endTime

func (*AggTradesService) FromID

func (s *AggTradesService) FromID(fromID int64) *AggTradesService

FromID set fromID

func (*AggTradesService) Limit

func (s *AggTradesService) Limit(limit int) *AggTradesService

Limit set limit

func (*AggTradesService) StartTime

func (s *AggTradesService) StartTime(startTime int64) *AggTradesService

StartTime set startTime

func (*AggTradesService) Symbol

func (s *AggTradesService) Symbol(symbol string) *AggTradesService

Symbol set symbol

type AllCoinResponse

type AllCoinResponse struct {
	Code          string     `json:"code"`
	Message       string     `json:"message"`
	MessageDetail string     `json:"messageDetail"`
	Data          []CoinInfo `json:"data"`
	Success       bool       `json:"success"`
}

type AllCoinService

type AllCoinService struct {
	// contains filtered or unexported fields
}

func (*AllCoinService) Do

func (s *AllCoinService) Do(ctx context.Context) ([]CoinInfo, error)

type Ask

type Ask = common.PriceLevel

Ask is a type alias for PriceLevel.

type AssetBalance

type AssetBalance struct {
	Asset  string  `json:"asset"`
	Free   float64 `json:"free"`
	Locked float64 `json:"locked"`
}

type AssetDetail

type AssetDetail struct {
	MinWithdrawAmount string `json:"minWithdrawAmount"`
	DepositStatus     bool   `json:"depositStatus"`
	WithdrawFee       string `json:"withdrawFee"`
	WithdrawStatus    bool   `json:"withdrawStatus"`
	DepositTip        string `json:"depositTip"`
}

AssetDetail represents the detail of an asset

type AssetDividendService

type AssetDividendService struct {
	// contains filtered or unexported fields
}

AssetDividendService fetches the saving purchases

func (*AssetDividendService) Asset

Asset sets the asset parameter.

func (*AssetDividendService) Do

Do sends the request.

func (*AssetDividendService) EndTime

func (s *AssetDividendService) EndTime(endTime int64) *AssetDividendService

EndTime sets the endTime parameter. If present, StartTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*AssetDividendService) Limit

Limit sets the limit parameter.

func (*AssetDividendService) StartTime

func (s *AssetDividendService) StartTime(startTime int64) *AssetDividendService

StartTime sets the startTime parameter. If present, EndTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

type AveragePriceService

type AveragePriceService struct {
	// contains filtered or unexported fields
}

AveragePriceService show current average price for a symbol

func (*AveragePriceService) Do

func (s *AveragePriceService) Do(ctx context.Context, opts ...RequestOption) (res *AvgPrice, err error)

Do send request

func (*AveragePriceService) Symbol

func (s *AveragePriceService) Symbol(symbol string) *AveragePriceService

Symbol set symbol

type AvgPrice

type AvgPrice struct {
	Mins  int64  `json:"mins"`
	Price string `json:"price"`
}

AvgPrice define average price

type BNBBurn

type BNBBurn struct {
	SpotBNBBurn     bool `json:"spotBNBBurn"`
	InterestBNBBurn bool `json:"interestBNBBurn"`
}

BNBBurn response

type Balance

type Balance struct {
	Asset  string `json:"asset"`
	Free   string `json:"free"`
	Locked string `json:"locked"`
}

Balance define user balance of your account

type Bid

type Bid = common.PriceLevel

Bid is a type alias for PriceLevel.

type BookTicker

type BookTicker struct {
	Symbol      string `json:"symbol"`
	BidPrice    string `json:"bidPrice"`
	BidQuantity string `json:"bidQty"`
	AskPrice    string `json:"askPrice"`
	AskQuantity string `json:"askQty"`
}

BookTicker define book ticker info

type C2CRecord

type C2CRecord struct {
	OrderNumber         string `json:"orderNumber"`
	AdvNo               string `json:"advNo"`
	TradeType           string `json:"tradeType"`
	Asset               string `json:"asset"`
	Fiat                string `json:"fiat"`
	FiatSymbol          string `json:"fiatSymbol"`
	Amount              string `json:"amount"`
	TotalPrice          string `json:"totalPrice"`
	UnitPrice           string `json:"unitPrice"`
	OrderStatus         string `json:"orderStatus"`
	CreateTime          int64  `json:"createTime"`
	Commission          string `json:"commission"`
	CounterPartNickName string `json:"counterPartNickName"`
	AdvertisementRole   string `json:"advertisementRole"`
}

C2CRecord a record of c2c

type C2CTradeHistory

type C2CTradeHistory struct {
	Code    string      `json:"code"`
	Message string      `json:"message"`
	Data    []C2CRecord `json:"data"`
	Total   int64       `json:"total"`
	Success bool        `json:"success"`
}

C2CTradeHistory response

type C2CTradeHistoryService

type C2CTradeHistoryService struct {
	// contains filtered or unexported fields
}

C2CTradeHistoryService retrieve c2c trade history

func (*C2CTradeHistoryService) Do

Do send request

func (*C2CTradeHistoryService) EndTime

func (s *C2CTradeHistoryService) EndTime(endTimestamp int64) *C2CTradeHistoryService

EndTime set endTime

func (*C2CTradeHistoryService) Page

Page set page

func (*C2CTradeHistoryService) Rows

Rows set rows

func (*C2CTradeHistoryService) StartTimestamp

func (s *C2CTradeHistoryService) StartTimestamp(startTimestamp int64) *C2CTradeHistoryService

BeginTime set beginTime

func (*C2CTradeHistoryService) TradeType

func (s *C2CTradeHistoryService) TradeType(tradeType SideType) *C2CTradeHistoryService

TransactionType set transaction type

type CancelMarginOCOResponse

type CancelMarginOCOResponse struct {
	OrderListID       int64                   `json:"orderListId"`
	ContingencyType   string                  `json:"contingencyType"`
	ListStatusType    string                  `json:"listStatusType"`
	ListOrderStatus   string                  `json:"listOrderStatus"`
	ListClientOrderID string                  `json:"listClientOrderId"`
	TransactionTime   int64                   `json:"transactionTime"`
	Symbol            string                  `json:"symbol"`
	IsIsolated        bool                    `json:"isIsolated"`
	Orders            []*MarginOCOOrder       `json:"orders"`
	OrderReports      []*MarginOCOOrderReport `json:"orderReports"`
}

CancelMarginOCOResponse define create cancelled oco response.

type CancelMarginOCOService

type CancelMarginOCOService struct {
	// contains filtered or unexported fields
}

CancelMarginOCOService cancel an entire Order List for a margin account

func (*CancelMarginOCOService) Do

Do send request

func (*CancelMarginOCOService) IsIsolated

func (s *CancelMarginOCOService) IsIsolated(isIsolated bool) *CancelMarginOCOService

IsIsolated set isIsolated

func (*CancelMarginOCOService) ListClientOrderID

func (s *CancelMarginOCOService) ListClientOrderID(listClientOrderID string) *CancelMarginOCOService

ListClientOrderID sets listClientOrderId

func (*CancelMarginOCOService) NewClientOrderID

func (s *CancelMarginOCOService) NewClientOrderID(newClientOrderID string) *CancelMarginOCOService

NewClientOrderID sets newClientOrderId

func (*CancelMarginOCOService) OrderListID

func (s *CancelMarginOCOService) OrderListID(orderListID int64) *CancelMarginOCOService

OrderListID sets orderListId

func (*CancelMarginOCOService) Symbol

Symbol set symbol

type CancelMarginOrderResponse

type CancelMarginOrderResponse struct {
	Symbol                   string          `json:"symbol"`
	OrigClientOrderID        string          `json:"origClientOrderId"`
	OrderID                  string          `json:"orderId"`
	ClientOrderID            string          `json:"clientOrderId"`
	TransactTime             int64           `json:"transactTime"`
	Price                    string          `json:"price"`
	OrigQuantity             string          `json:"origQty"`
	ExecutedQuantity         string          `json:"executedQty"`
	CummulativeQuoteQuantity string          `json:"cummulativeQuoteQty"`
	Status                   OrderStatusType `json:"status"`
	TimeInForce              TimeInForceType `json:"timeInForce"`
	Type                     OrderType       `json:"type"`
	Side                     SideType        `json:"side"`
}

CancelMarginOrderResponse define response of canceling order

type CancelMarginOrderService

type CancelMarginOrderService struct {
	// contains filtered or unexported fields
}

CancelMarginOrderService cancel an order

func (*CancelMarginOrderService) Do

Do send request

func (*CancelMarginOrderService) IsIsolated

func (s *CancelMarginOrderService) IsIsolated(isIsolated bool) *CancelMarginOrderService

IsIsolated set isIsolated

func (*CancelMarginOrderService) NewClientOrderID

func (s *CancelMarginOrderService) NewClientOrderID(newClientOrderID string) *CancelMarginOrderService

NewClientOrderID set newClientOrderID

func (*CancelMarginOrderService) OrderID

OrderID set orderID

func (*CancelMarginOrderService) OrigClientOrderID

func (s *CancelMarginOrderService) OrigClientOrderID(origClientOrderID string) *CancelMarginOrderService

OrigClientOrderID set origClientOrderID

func (*CancelMarginOrderService) Symbol

Symbol set symbol

type CancelOCOResponse

type CancelOCOResponse struct {
	OrderListID       int64             `json:"orderListId"`
	ContingencyType   string            `json:"contingencyType"`
	ListStatusType    string            `json:"listStatusType"`
	ListOrderStatus   string            `json:"listOrderStatus"`
	ListClientOrderID string            `json:"listClientOrderId"`
	TransactionTime   int64             `json:"transactionTime"`
	Symbol            string            `json:"symbol"`
	Orders            []*OCOOrder       `json:"orders"`
	OrderReports      []*OCOOrderReport `json:"orderReports"`
}

CancelOCOResponse may be returned included in a CancelOpenOrdersResponse.

type CancelOCOService

type CancelOCOService struct {
	// contains filtered or unexported fields
}

CancelOCOService cancel all active orders on the list order.

func (*CancelOCOService) Do

func (s *CancelOCOService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOCOResponse, err error)

Do send request

func (*CancelOCOService) ListClientOrderID

func (s *CancelOCOService) ListClientOrderID(listClientOrderID string) *CancelOCOService

ListClientOrderID sets listClientOrderId

func (*CancelOCOService) NewClientOrderID

func (s *CancelOCOService) NewClientOrderID(newClientOrderID string) *CancelOCOService

NewClientOrderID sets newClientOrderId

func (*CancelOCOService) OrderListID

func (s *CancelOCOService) OrderListID(orderListID int64) *CancelOCOService

OrderListID sets orderListId

func (*CancelOCOService) Symbol

func (s *CancelOCOService) Symbol(symbol string) *CancelOCOService

Symbol set symbol

type CancelOpenOrdersResponse

type CancelOpenOrdersResponse struct {
	Orders    []*CancelOrderResponse
	OCOOrders []*CancelOCOResponse
}

CancelOpenOrdersResponse defines cancel open orders response.

type CancelOpenOrdersService

type CancelOpenOrdersService struct {
	// contains filtered or unexported fields
}

CancelOpenOrdersService cancel all active orders on a symbol.

func (*CancelOpenOrdersService) Do

Do send request

func (*CancelOpenOrdersService) Symbol

Symbol set symbol

type CancelOrderResponse

type CancelOrderResponse struct {
	Symbol                   string          `json:"symbol"`
	OrigClientOrderID        string          `json:"origClientOrderId"`
	OrderID                  int64           `json:"orderId"`
	OrderListID              int64           `json:"orderListId"`
	ClientOrderID            string          `json:"clientOrderId"`
	TransactTime             int64           `json:"transactTime"`
	Price                    string          `json:"price"`
	OrigQuantity             string          `json:"origQty"`
	ExecutedQuantity         string          `json:"executedQty"`
	CummulativeQuoteQuantity string          `json:"cummulativeQuoteQty"`
	Status                   OrderStatusType `json:"status"`
	TimeInForce              TimeInForceType `json:"timeInForce"`
	Type                     OrderType       `json:"type"`
	Side                     SideType        `json:"side"`
}

CancelOrderResponse may be returned included in a CancelOpenOrdersResponse.

type CancelOrderService

type CancelOrderService struct {
	// contains filtered or unexported fields
}

CancelOrderService cancel an order

func (*CancelOrderService) Do

func (s *CancelOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOrderResponse, err error)

Do send request

func (*CancelOrderService) NewClientOrderID

func (s *CancelOrderService) NewClientOrderID(newClientOrderID string) *CancelOrderService

NewClientOrderID set newClientOrderID

func (*CancelOrderService) OrderID

func (s *CancelOrderService) OrderID(orderID int64) *CancelOrderService

OrderID set orderID

func (*CancelOrderService) OrigClientOrderID

func (s *CancelOrderService) OrigClientOrderID(origClientOrderID string) *CancelOrderService

OrigClientOrderID set origClientOrderID

func (*CancelOrderService) Symbol

func (s *CancelOrderService) Symbol(symbol string) *CancelOrderService

Symbol set symbol

type ClaimRewardResponse

type ClaimRewardResponse struct {
	Success bool `json:"success"`
}

type ClaimRewardService

type ClaimRewardService struct {
	// contains filtered or unexported fields
}

ClaimRewardService to claim reward

func (*ClaimRewardService) Do

Do sends the request.

func (*ClaimRewardService) RewardType

RewardType set rewardType

type ClaimedRewardHistory

type ClaimedRewardHistory struct {
	PoolId        int               `json:"poolId"`
	PoolName      string            `json:"poolName"`
	AssetRewards  string            `json:"assetRewards"`
	ClaimedAt     int64             `json:"claimedTime"`
	ClaimedAmount string            `json:"claimAmount"`
	Status        RewardClaimStatus `json:"status"`
}

type Client

type Client struct {
	APIKey     string
	SecretKey  string
	BaseURL    string
	UserAgent  string
	HTTPClient *http.Client
	Debug      bool
	Logger     *log.Logger
	TimeOffset int64
	// contains filtered or unexported fields
}

Client define API client

func NewClient

func NewClient(apiKey, secretKey string) *Client

NewClient initialize an API client instance with API key and secret key. You should always call this function before using this SDK. Services will be created by the form client.NewXXXService().

func NewProxiedClient

func NewProxiedClient(apiKey, secretKey, proxyUrl string) *Client

NewProxiedClient passing a proxy url

func (*Client) NewAddLiquidityPreviewService

func (c *Client) NewAddLiquidityPreviewService() *AddLiquidityPreviewService

NewAddLiquidityPreviewService init the add liquidity preview service

func (*Client) NewAddLiquidityService

func (c *Client) NewAddLiquidityService() *AddLiquidityService

NewAddLiquidityService init the add liquidity service

func (*Client) NewAggTradesService

func (c *Client) NewAggTradesService() *AggTradesService

NewAggTradesService init aggregate trades service

func (*Client) NewAllCoinService

func (c *Client) NewAllCoinService() *AllCoinService

func (*Client) NewAssetDividendService

func (c *Client) NewAssetDividendService() *AssetDividendService

NewAssetDividendService init the asset dividend list service

func (*Client) NewAveragePriceService

func (c *Client) NewAveragePriceService() *AveragePriceService

NewAveragePriceService init average price service

func (*Client) NewC2CTradeHistoryService

func (c *Client) NewC2CTradeHistoryService() *C2CTradeHistoryService

NewC2CTradeHistoryService init the c2c trade history service

func (*Client) NewCancelMarginOCOService

func (c *Client) NewCancelMarginOCOService() *CancelMarginOCOService

NewCancelMarginOCOService init cancel order service

func (*Client) NewCancelMarginOrderService

func (c *Client) NewCancelMarginOrderService() *CancelMarginOrderService

NewCancelMarginOrderService init cancel order service

func (*Client) NewCancelOCOService

func (c *Client) NewCancelOCOService() *CancelOCOService

NewCancelOCOService init cancel OCO service

func (*Client) NewCancelOpenOrdersService

func (c *Client) NewCancelOpenOrdersService() *CancelOpenOrdersService

NewCancelOpenOrdersService init cancel open orders service

func (*Client) NewCancelOrderService

func (c *Client) NewCancelOrderService() *CancelOrderService

NewCancelOrderService init cancel order service

func (*Client) NewClaimRewardService

func (c *Client) NewClaimRewardService() *ClaimRewardService

NewClaimRewardService init the service for liquidity pool rewarding

func (*Client) NewCloseIsolatedMarginUserStreamService

func (c *Client) NewCloseIsolatedMarginUserStreamService() *CloseIsolatedMarginUserStreamService

NewCloseIsolatedMarginUserStreamService init closing margin user stream service

func (*Client) NewCloseMarginUserStreamService

func (c *Client) NewCloseMarginUserStreamService() *CloseMarginUserStreamService

NewCloseMarginUserStreamService init closing margin user stream service

func (*Client) NewCloseUserStreamService

func (c *Client) NewCloseUserStreamService() *CloseUserStreamService

NewCloseUserStreamService init closing user stream service

func (*Client) NewConvertTradeHistoryService

func (c *Client) NewConvertTradeHistoryService() *ConvertTradeHistoryService

NewConvertTradeHistoryService init the convert trade history service

func (*Client) NewCreateMarginOCOService

func (c *Client) NewCreateMarginOCOService() *CreateMarginOCOService

NewCreateMarginOCOService init creating margin order service

func (*Client) NewCreateMarginOrderService

func (c *Client) NewCreateMarginOrderService() *CreateMarginOrderService

NewCreateMarginOrderService init creating margin order service

func (*Client) NewCreateOCOService

func (c *Client) NewCreateOCOService() *CreateOCOService

NewCreateOCOService init creating OCO service

func (*Client) NewCreateOrderService

func (c *Client) NewCreateOrderService() *CreateOrderService

NewCreateOrderService init creating order service

func (*Client) NewCreateWithdrawService

func (c *Client) NewCreateWithdrawService() *CreateWithdrawService

NewCreateWithdrawService init creating withdraw service

func (*Client) NewCrossMarginDataService

func (c *Client) NewCrossMarginDataService() *CrossMarginDataService

func (*Client) NewCryptoLoanService

func (c *Client) NewCryptoLoanService() *CryptoLoanService

func (*Client) NewDepthService

func (c *Client) NewDepthService() *DepthService

NewDepthService init depth service

func (*Client) NewDustTransferService

func (c *Client) NewDustTransferService() *DustTransferService

NewDustTransferService init dust transfer service

func (*Client) NewExchangeInfoService

func (c *Client) NewExchangeInfoService() *ExchangeInfoService

NewExchangeInfoService init exchange info service

func (*Client) NewFiatDepositWithdrawHistoryService

func (c *Client) NewFiatDepositWithdrawHistoryService() *FiatDepositWithdrawHistoryService

NewFiatDepositWithdrawHistoryService init the fiat deposit/withdraw history service

func (*Client) NewFiatPaymentsHistoryService

func (c *Client) NewFiatPaymentsHistoryService() *FiatPaymentsHistoryService

NewFiatPaymentsHistoryService init the fiat payments history service

func (*Client) NewFlexibleLoanAdjustLTVService

func (c *Client) NewFlexibleLoanAdjustLTVService() *FlexibleLoanAdjustLTVService

func (*Client) NewFlexibleLoanBorrowService

func (c *Client) NewFlexibleLoanBorrowService() *FlexibleLoanBorrowService

func (*Client) NewFlexibleLoanRepayService

func (c *Client) NewFlexibleLoanRepayService() *FlexibleLoanRepayService

func (*Client) NewFuturesTransferService

func (c *Client) NewFuturesTransferService() *FuturesTransferService

NewFuturesTransferService init futures transfer service

func (*Client) NewGetAPIKeyPermission

func (c *Client) NewGetAPIKeyPermission() *GetAPIKeyPermission

NewGetAPIKeyPermission init getting API key permission

func (*Client) NewGetAccountService

func (c *Client) NewGetAccountService() *GetAccountService

NewGetAccountService init getting account service

func (*Client) NewGetAccountSnapshotService

func (c *Client) NewGetAccountSnapshotService() *GetAccountSnapshotService

NewGetAccountSnapshotService init getting account snapshot service

func (*Client) NewGetAllCoinsInfoService

func (c *Client) NewGetAllCoinsInfoService() *GetAllCoinsInfoService

NewAllCoinsInformation

func (*Client) NewGetAllLiquidityPoolService

func (c *Client) NewGetAllLiquidityPoolService() *GetAllLiquidityPoolService

NewGetAllLiquidityPoolService init the get all swap pool service

func (*Client) NewGetAllMarginAssetsService

func (c *Client) NewGetAllMarginAssetsService() *GetAllMarginAssetsService

NewDustTransferService init Get All Margin Assets service

func (*Client) NewGetAssetDetailService

func (c *Client) NewGetAssetDetailService() *GetAssetDetailService

NewGetAssetDetailService init get asset detail service

func (*Client) NewGetBNBBurnService

func (c *Client) NewGetBNBBurnService() *GetBNBBurnService

NewGetBNBBurnService init the service to get BNB Burn on spot trade and margin interest

func (*Client) NewGetDepositAddressService

func (c *Client) NewGetDepositAddressService() *GetDepositsAddressService

NewGetDepositAddressService init getting deposit address service

func (*Client) NewGetFlexibleLoanAssetsDataService

func (c *Client) NewGetFlexibleLoanAssetsDataService() *GetFlexibleLoanAssetsDataService

func (*Client) NewGetFlexibleLoanBorrowHistoryService

func (c *Client) NewGetFlexibleLoanBorrowHistoryService() *GetFlexibleLoanBorrowHistoryService

func (*Client) NewGetFlexibleLoanOngoingOrdersService

func (c *Client) NewGetFlexibleLoanOngoingOrdersService() *GetFlexibleLoanOngoingOrdersService

func (*Client) NewGetFlexibleLoanRepayHistoryService

func (c *Client) NewGetFlexibleLoanRepayHistoryService() *GetFlexibleLoanRepayHistoryService

func (*Client) NewGetFlexibleProductPosition added in v2.0.1

func (c *Client) NewGetFlexibleProductPosition() *GetFlexibleProductPositionService

func (*Client) NewGetFlexibleRewardHistory added in v2.0.1

func (c *Client) NewGetFlexibleRewardHistory() *FlexibleRewardHistoryService

func (*Client) NewGetIsolatedMarginAccountService

func (c *Client) NewGetIsolatedMarginAccountService() *GetIsolatedMarginAccountService

NewGetIsolatedMarginAccountService init get isolated margin asset service

func (*Client) NewGetIsolatedMarginAllPairsService

func (c *Client) NewGetIsolatedMarginAllPairsService() *GetIsolatedMarginAllPairsService

NewGetIsolatedMarginAllPairsService init get isolated margin all pairs service

func (*Client) NewGetLiquidityPoolDetailService

func (c *Client) NewGetLiquidityPoolDetailService() *GetLiquidityPoolDetailService

NewGetLiquidityPoolDetailService init the get liquidity pool detial service

func (*Client) NewGetLockedProductPosition added in v2.0.1

func (c *Client) NewGetLockedProductPosition() *GetLockedProductPositionService

func (*Client) NewGetMarginAccountService

func (c *Client) NewGetMarginAccountService() *GetMarginAccountService

NewGetMarginAccountService init get margin account service

func (*Client) NewGetMarginAllPairsService

func (c *Client) NewGetMarginAllPairsService() *GetMarginAllPairsService

NewGetMarginAllPairsService init get margin all pairs service

func (*Client) NewGetMarginAssetService

func (c *Client) NewGetMarginAssetService() *GetMarginAssetService

NewGetMarginAssetService init get margin asset service

func (*Client) NewGetMarginOrderService

func (c *Client) NewGetMarginOrderService() *GetMarginOrderService

NewGetMarginOrderService init get order service

func (*Client) NewGetMarginPairService

func (c *Client) NewGetMarginPairService() *GetMarginPairService

NewGetMarginPairService init get margin pair service

func (*Client) NewGetMarginPriceIndexService

func (c *Client) NewGetMarginPriceIndexService() *GetMarginPriceIndexService

NewGetMarginPriceIndexService init get margin price index service

func (*Client) NewGetMaxBorrowableService

func (c *Client) NewGetMaxBorrowableService() *GetMaxBorrowableService

NewGetMaxBorrowableService init get max borrowable service

func (*Client) NewGetMaxTransferableService

func (c *Client) NewGetMaxTransferableService() *GetMaxTransferableService

NewGetMaxTransferableService init get max transferable service

func (*Client) NewGetOrderService

func (c *Client) NewGetOrderService() *GetOrderService

NewGetOrderService init get order service

func (*Client) NewGetSwapQuoteService

func (c *Client) NewGetSwapQuoteService() *GetSwapQuoteService

NewGetSwapQuoteService init the add liquidity preview service

func (*Client) NewGetUserAsset

func (c *Client) NewGetUserAsset() *GetUserAssetService

NewGetUserAsset Get user assets, just for positive data

func (*Client) NewGetUserSwapRecordsService

func (c *Client) NewGetUserSwapRecordsService() *GetUserSwapRecordsService

NewGetUserSwapRecordsService init the service for listing the swap records

func (*Client) NewHistoricalTradesService

func (c *Client) NewHistoricalTradesService() *HistoricalTradesService

NewHistoricalTradesService init listing trades service

func (*Client) NewInterestHistoryService

func (c *Client) NewInterestHistoryService() *InterestHistoryService

NewInterestHistoryService init the interest history service

func (*Client) NewInternalUniversalTransferHistoryService

func (c *Client) NewInternalUniversalTransferHistoryService() *InternalUniversalTransferHistoryService

NewInternalUniversalTransferHistoryService Query Universal Transfer History (For Master Account)

func (*Client) NewInternalUniversalTransferService

func (c *Client) NewInternalUniversalTransferService() *InternalUniversalTransferService

NewInternalUniversalTransferService Universal Transfer (For Master Account)

func (*Client) NewIsolatedMarginDataService

func (c *Client) NewIsolatedMarginDataService() *IsolatedMarginDataService

func (*Client) NewIsolatedMarginTransferService

func (c *Client) NewIsolatedMarginTransferService() *IsolatedMarginTransferService

func (*Client) NewKeepaliveIsolatedMarginUserStreamService

func (c *Client) NewKeepaliveIsolatedMarginUserStreamService() *KeepaliveIsolatedMarginUserStreamService

NewKeepaliveIsolatedMarginUserStreamService init keep alive margin user stream service

func (*Client) NewKeepaliveMarginUserStreamService

func (c *Client) NewKeepaliveMarginUserStreamService() *KeepaliveMarginUserStreamService

NewKeepaliveMarginUserStreamService init keep alive margin user stream service

func (*Client) NewKeepaliveUserStreamService

func (c *Client) NewKeepaliveUserStreamService() *KeepaliveUserStreamService

NewKeepaliveUserStreamService init keep alive user stream service

func (*Client) NewKlinesService

func (c *Client) NewKlinesService() *KlinesService

NewKlinesService init klines service

func (*Client) NewListBookTickersService

func (c *Client) NewListBookTickersService() *ListBookTickersService

NewListBookTickersService init listing booking tickers service

func (*Client) NewListDepositsService

func (c *Client) NewListDepositsService() *ListDepositsService

NewListDepositsService init listing deposits service

func (*Client) NewListDustLogService

func (c *Client) NewListDustLogService() *ListDustLogService

NewListDustLogService init list dust log service

func (*Client) NewListDustService

func (c *Client) NewListDustService() *ListDustService

NewListDustService init dust list service

func (*Client) NewListFuturesTransferService

func (c *Client) NewListFuturesTransferService() *ListFuturesTransferService

NewListFuturesTransferService init list futures transfer service

func (*Client) NewListMarginLoansService

func (c *Client) NewListMarginLoansService() *ListMarginLoansService

NewListMarginLoansService init list margin loan service

func (*Client) NewListMarginOpenOrdersService

func (c *Client) NewListMarginOpenOrdersService() *ListMarginOpenOrdersService

NewListMarginOpenOrdersService init list margin open orders service

func (*Client) NewListMarginOrdersService

func (c *Client) NewListMarginOrdersService() *ListMarginOrdersService

NewListMarginOrdersService init list margin all orders service

func (*Client) NewListMarginRepaysService

func (c *Client) NewListMarginRepaysService() *ListMarginRepaysService

NewListMarginRepaysService init list margin repay service

func (*Client) NewListMarginTradesService

func (c *Client) NewListMarginTradesService() *ListMarginTradesService

NewListMarginTradesService init list margin trades service

func (*Client) NewListOpenOcoService

func (c *Client) NewListOpenOcoService() *ListOpenOcoService

NewListOpenOcoService init list open oco service

func (*Client) NewListOpenOrdersService

func (c *Client) NewListOpenOrdersService() *ListOpenOrdersService

NewListOpenOrdersService init list open orders service

func (*Client) NewListOrdersService

func (c *Client) NewListOrdersService() *ListOrdersService

NewListOrdersService init listing orders service

func (*Client) NewListPriceChangeStatsService

func (c *Client) NewListPriceChangeStatsService() *ListPriceChangeStatsService

NewListPriceChangeStatsService init list prices change stats service

func (*Client) NewListPricesService

func (c *Client) NewListPricesService() *ListPricesService

NewListPricesService init listing prices service

func (*Client) NewListSavingsFixedAndActivityProductsService

func (c *Client) NewListSavingsFixedAndActivityProductsService() *ListSavingsFixedAndActivityProductsService

NewListSavingsFixedAndActivityProductsService get fixed and activity product list (Savings)

func (*Client) NewListSavingsFlexibleProductsService

func (c *Client) NewListSavingsFlexibleProductsService() *ListSavingsFlexibleProductsService

NewListSavingsFlexibleProductsService get flexible products list (Savings)

func (*Client) NewListSymbolTickerService

func (c *Client) NewListSymbolTickerService() *ListSymbolTickerService

NewListSymbolTickerService init listing symbols tickers

func (*Client) NewListTradesService

func (c *Client) NewListTradesService() *ListTradesService

NewListTradesService init listing trades service

func (*Client) NewListWithdrawsService

func (c *Client) NewListWithdrawsService() *ListWithdrawsService

NewListWithdrawsService init listing withdraw service

func (*Client) NewManagedSubAccountAssetsService

func (c *Client) NewManagedSubAccountAssetsService() *ManagedSubAccountAssetsService

NewManagedSubAccountAssetsService Withdrawal Assets From The Managed Sub-account(For Investor Master Account)

func (*Client) NewManagedSubAccountDepositService

func (c *Client) NewManagedSubAccountDepositService() *ManagedSubAccountDepositService

NewManagedSubAccountDepositService Deposit Assets Into The Managed Sub-account(For Investor Master Account)

func (*Client) NewManagedSubAccountWithdrawalService

func (c *Client) NewManagedSubAccountWithdrawalService() *ManagedSubAccountWithdrawalService

NewManagedSubAccountWithdrawalService Withdrawal Assets From The Managed Sub-account(For Investor Master Account)

func (*Client) NewMarginLoanService

func (c *Client) NewMarginLoanService() *MarginLoanService

NewMarginLoanService init margin account loan service

func (*Client) NewMarginRepayService

func (c *Client) NewMarginRepayService() *MarginRepayService

NewMarginRepayService init margin account repay service

func (*Client) NewMarginTransferService

func (c *Client) NewMarginTransferService() *MarginTransferService

NewMarginTransferService init margin account transfer service

func (*Client) NewPayTradeHistoryService

func (c *Client) NewPayTradeHistoryService() *PayTradeHistoryService

NewPayTransactionService init the pay transaction service

func (*Client) NewPingService

func (c *Client) NewPingService() *PingService

NewPingService init ping service

func (*Client) NewPurchaseSavingsFlexibleProductService

func (c *Client) NewPurchaseSavingsFlexibleProductService() *PurchaseSavingsFlexibleProductService

NewPurchaseSavingsFlexibleProductService purchase a flexible product (Savings)

func (*Client) NewQueryClaimedRewardHistoryService

func (c *Client) NewQueryClaimedRewardHistoryService() *QueryClaimedRewardHistoryService

NewQueryClaimedRewardHistoryService init the service to query reward claiming history

func (*Client) NewRateLimitService

func (c *Client) NewRateLimitService() *RateLimitService

NewRateLimitService init rate limit service

func (*Client) NewRecentTradesService

func (c *Client) NewRecentTradesService() *RecentTradesService

NewRecentTradesService init recent trades service

func (*Client) NewRedeemSavingsFlexibleProductService

func (c *Client) NewRedeemSavingsFlexibleProductService() *RedeemSavingsFlexibleProductService

NewRedeemSavingsFlexibleProductService redeem a flexible product (Savings)

func (*Client) NewRemoveLiquidityService

func (c *Client) NewRemoveLiquidityService() *RemoveLiquidityService

NewRemoveLiquidityService init the service to remvoe liquidity

func (*Client) NewSavingFixedProjectPositionsService

func (c *Client) NewSavingFixedProjectPositionsService() *SavingFixedProjectPositionsService

NewSavingFixedProjectPositionsService get fixed project positions (Savings)

func (*Client) NewSavingFlexibleProductPositionsService

func (c *Client) NewSavingFlexibleProductPositionsService() *SavingFlexibleProductPositionsService

NewSavingFlexibleProductPositionsService get flexible products positions (Savings)

func (*Client) NewServerTimeService

func (c *Client) NewServerTimeService() *ServerTimeService

NewServerTimeService init server time service

func (*Client) NewSetServerTimeService

func (c *Client) NewSetServerTimeService() *SetServerTimeService

NewSetServerTimeService init set server time service

func (*Client) NewSimpleEarnService

func (c *Client) NewSimpleEarnService() *SimpleEarnService

func (*Client) NewSpotRebateHistoryService

func (c *Client) NewSpotRebateHistoryService() *SpotRebateHistoryService

NewFiatPaymentsHistoryService init the spot rebate history service

func (*Client) NewStakingHistoryService

func (c *Client) NewStakingHistoryService() *StakingHistoryService

NewStakingHistoryService init the staking history service

func (*Client) NewStakingProductPositionService

func (c *Client) NewStakingProductPositionService() *StakingProductPositionService

NewStakingProductPositionService init the staking product position service

func (*Client) NewStartIsolatedMarginUserStreamService

func (c *Client) NewStartIsolatedMarginUserStreamService() *StartIsolatedMarginUserStreamService

NewStartIsolatedMarginUserStreamService init starting margin user stream service

func (*Client) NewStartMarginUserStreamService

func (c *Client) NewStartMarginUserStreamService() *StartMarginUserStreamService

NewStartMarginUserStreamService init starting margin user stream service

func (*Client) NewStartUserStreamService

func (c *Client) NewStartUserStreamService() *StartUserStreamService

NewStartUserStreamService init starting user stream service

func (*Client) NewSubAccountFuturesAccountService

func (c *Client) NewSubAccountFuturesAccountService() *SubAccountFuturesAccountService

NewSubAccountFuturesAccountService Get Detail on Sub-account's Futures Account (For Master Account)

func (*Client) NewSubAccountFuturesSummaryV1Service added in v2.0.1

func (c *Client) NewSubAccountFuturesSummaryV1Service() *SubAccountFuturesSummaryV1Service

NewSubAccountFuturesSummaryV1Service Get Summary of Sub-account's Futures Account (For Master Account)

func (*Client) NewSubAccountFuturesTransferV1Service added in v2.0.1

func (c *Client) NewSubAccountFuturesTransferV1Service() *SubAccountFuturesTransferV1Service

NewSubAccountFuturesTransferV1Service Futures Transfer for Sub-account (For Master Account)

func (*Client) NewSubAccountListService

func (c *Client) NewSubAccountListService() *SubAccountListService

NewSubAccountListService Query Sub-account List (For Master Account)

func (*Client) NewSubTransferHistoryService

func (c *Client) NewSubTransferHistoryService() *SubTransferHistoryService

NewSubTransferHistoryService query transfer history (for sub-account)

func (*Client) NewSubaccountAssetsService

func (c *Client) NewSubaccountAssetsService() *SubaccountAssetsService

NewSubaccountAssetsService init list subaccount assets

func (*Client) NewSubaccountDepositAddressService

func (c *Client) NewSubaccountDepositAddressService() *SubaccountDepositAddressService

NewSubaccountDepositAddressService init subaccount deposit address service

func (*Client) NewSubaccountSpotSummaryService

func (c *Client) NewSubaccountSpotSummaryService() *SubaccountSpotSummaryService

NewSubaccountSpotSummaryService init subaccount spot summary

func (*Client) NewSwapService

func (c *Client) NewSwapService() *SwapService

NewSwapService init the swap service

func (*Client) NewToggleBNBBurnService

func (c *Client) NewToggleBNBBurnService() *ToggleBNBBurnService

NewToggleBNBBurnService init the service to toggle BNB Burn on spot trade and margin interest

func (*Client) NewTradeFeeService

func (c *Client) NewTradeFeeService() *TradeFeeService

NewTradeFeeService init the trade fee service

func (*Client) NewTransferToSubAccountService

func (c *Client) NewTransferToSubAccountService() *TransferToSubAccountService

NewTransferToSubAccountService transfer to subaccount service

func (*Client) NewUserUniversalTransferService

func (c *Client) NewUserUniversalTransferService() *CreateUserUniversalTransferService

NewUserUniversalTransferService

func (*Client) NewVipLoanService

func (c *Client) NewVipLoanService() *VipLoanService

func (*Client) SetApiEndpoint

func (c *Client) SetApiEndpoint(url string) *Client

SetApiEndpoint set api Endpoint

type CloseIsolatedMarginUserStreamService

type CloseIsolatedMarginUserStreamService struct {
	// contains filtered or unexported fields
}

CloseIsolatedMarginUserStreamService delete listen key

func (*CloseIsolatedMarginUserStreamService) Do

Do send request

func (*CloseIsolatedMarginUserStreamService) ListenKey

ListenKey set listen key

func (*CloseIsolatedMarginUserStreamService) Symbol

Symbol set symbol to the isolated margin user stream close request

type CloseMarginUserStreamService

type CloseMarginUserStreamService struct {
	// contains filtered or unexported fields
}

CloseMarginUserStreamService delete listen key

func (*CloseMarginUserStreamService) Do

Do send request

func (*CloseMarginUserStreamService) ListenKey

ListenKey set listen key

type CloseUserStreamService

type CloseUserStreamService struct {
	// contains filtered or unexported fields
}

CloseUserStreamService delete listen key

func (*CloseUserStreamService) Do

func (s *CloseUserStreamService) Do(ctx context.Context, opts ...RequestOption) (err error)

Do send request

func (*CloseUserStreamService) ListenKey

func (s *CloseUserStreamService) ListenKey(listenKey string) *CloseUserStreamService

ListenKey set listen key

type CoinInfo

type CoinInfo struct {
	Coin              string    `json:"coin"`
	DepositAllEnable  bool      `json:"depositAllEnable"`
	Free              string    `json:"free"`
	Freeze            string    `json:"freeze"`
	Ipoable           string    `json:"ipoable"`
	Ipoing            string    `json:"ipoing"`
	IsLegalMoney      bool      `json:"isLegalMoney"`
	Locked            string    `json:"locked"`
	Name              string    `json:"name"`
	NetworkList       []Network `json:"networkList"`
	Storage           string    `json:"storage"`
	Trading           bool      `json:"trading"`
	WithdrawAllEnable bool      `json:"withdrawAllEnable"`
	Withdrawing       string    `json:"withdrawing"`
}

type CommissionRates

type CommissionRates struct {
	Maker  string `json:"maker"`
	Taker  string `json:"taker"`
	Buyer  string `json:"buyer"`
	Seller string `json:"seller"`
}

type ConvertTradeHistory

type ConvertTradeHistory struct {
	List      []ConvertTradeHistoryItem `json:"list"`
	StartTime int64                     `json:"startTime"`
	EndTime   int64                     `json:"endTime"`
	Limit     int32                     `json:"limit"`
	MoreData  bool                      `json:"moreData"`
}

ConvertTradeHistory define the convert trade history

type ConvertTradeHistoryItem

type ConvertTradeHistoryItem struct {
	QuoteId      string `json:"quoteId"`
	OrderId      int64  `json:"orderId"`
	OrderStatus  string `json:"orderStatus"`
	FromAsset    string `json:"fromAsset"`
	FromAmount   string `json:"fromAmount"`
	ToAsset      string `json:"toAsset"`
	ToAmount     string `json:"toAmount"`
	Ratio        string `json:"ratio"`
	InverseRatio string `json:"inverseRatio"`
	CreateTime   int64  `json:"createTime"`
}

ConvertTradeHistoryItem define a convert trade history item

type ConvertTradeHistoryService

type ConvertTradeHistoryService struct {
	// contains filtered or unexported fields
}

func (*ConvertTradeHistoryService) Do

Do send request

func (*ConvertTradeHistoryService) EndTime

EndTime set endTime

func (*ConvertTradeHistoryService) Limit

Limit set limit

func (*ConvertTradeHistoryService) StartTime

StartTime set startTime

type CreateMarginOCOResponse

type CreateMarginOCOResponse struct {
	OrderListID           int64                   `json:"orderListId"`
	ContingencyType       string                  `json:"contingencyType"`
	ListStatusType        string                  `json:"listStatusType"`
	ListOrderStatus       string                  `json:"listOrderStatus"`
	ListClientOrderID     string                  `json:"listClientOrderId"`
	TransactionTime       int64                   `json:"transactionTime"`
	Symbol                string                  `json:"symbol"`
	MarginBuyBorrowAmount string                  `json:"marginBuyBorrowAmount"`
	MarginBuyBorrowAsset  string                  `json:"marginBuyBorrowAsset"`
	IsIsolated            bool                    `json:"isIsolated"`
	Orders                []*MarginOCOOrder       `json:"orders"`
	OrderReports          []*MarginOCOOrderReport `json:"orderReports"`
}

CreateMarginOCOResponse define create order response

type CreateMarginOCOService

type CreateMarginOCOService struct {
	// contains filtered or unexported fields
}

CreateMarginOCOService create a new OCO for a margin account

func (*CreateMarginOCOService) Do

Do send request

func (*CreateMarginOCOService) IsIsolated

func (s *CreateMarginOCOService) IsIsolated(isIsolated bool) *CreateMarginOCOService

IsIsolated set isIsolated

func (*CreateMarginOCOService) LimitClientOrderID

func (s *CreateMarginOCOService) LimitClientOrderID(limitClientOrderID string) *CreateMarginOCOService

LimitClientOrderID set limitClientOrderID

func (*CreateMarginOCOService) LimitIcebergQuantity

func (s *CreateMarginOCOService) LimitIcebergQuantity(limitIcebergQty string) *CreateMarginOCOService

LimitIcebergQuantity set limitIcebergQuantity

func (*CreateMarginOCOService) ListClientOrderID

func (s *CreateMarginOCOService) ListClientOrderID(listClientOrderID string) *CreateMarginOCOService

ListClientOrderID set listClientOrderID

func (*CreateMarginOCOService) NewOrderRespType

func (s *CreateMarginOCOService) NewOrderRespType(newOrderRespType NewOrderRespType) *CreateMarginOCOService

NewOrderRespType set icebergQuantity

func (*CreateMarginOCOService) Price

Price set price

func (*CreateMarginOCOService) Quantity

func (s *CreateMarginOCOService) Quantity(quantity string) *CreateMarginOCOService

Quantity set quantity

func (*CreateMarginOCOService) Side

Side set side

func (*CreateMarginOCOService) SideEffectType

func (s *CreateMarginOCOService) SideEffectType(sideEffectType SideEffectType) *CreateMarginOCOService

SideEffectType set sideEffectType

func (*CreateMarginOCOService) StopClientOrderID

func (s *CreateMarginOCOService) StopClientOrderID(stopClientOrderID string) *CreateMarginOCOService

StopClientOrderID set stopClientOrderID

func (*CreateMarginOCOService) StopIcebergQty

func (s *CreateMarginOCOService) StopIcebergQty(stopIcebergQty string) *CreateMarginOCOService

StopIcebergQty set stop limit price

func (*CreateMarginOCOService) StopLimitPrice

func (s *CreateMarginOCOService) StopLimitPrice(stopLimitPrice string) *CreateMarginOCOService

StopLimitPrice set stop limit price

func (*CreateMarginOCOService) StopLimitTimeInForce

func (s *CreateMarginOCOService) StopLimitTimeInForce(stopLimitTimeInForce TimeInForceType) *CreateMarginOCOService

StopLimitTimeInForce set stopLimitTimeInForce

func (*CreateMarginOCOService) StopPrice

func (s *CreateMarginOCOService) StopPrice(stopPrice string) *CreateMarginOCOService

StopPrice set stop price

func (*CreateMarginOCOService) Symbol

Symbol set symbol

type CreateMarginOrderService

type CreateMarginOrderService struct {
	// contains filtered or unexported fields
}

CreateMarginOrderService create order

func (*CreateMarginOrderService) Do

Do send request

func (*CreateMarginOrderService) IcebergQuantity

func (s *CreateMarginOrderService) IcebergQuantity(icebergQuantity string) *CreateMarginOrderService

IcebergQuantity set icebergQuantity

func (*CreateMarginOrderService) IsIsolated

func (s *CreateMarginOrderService) IsIsolated(isIsolated bool) *CreateMarginOrderService

IsIsolated sets the order to isolated margin

func (*CreateMarginOrderService) NewClientOrderID

func (s *CreateMarginOrderService) NewClientOrderID(newClientOrderID string) *CreateMarginOrderService

NewClientOrderID set newClientOrderID

func (*CreateMarginOrderService) NewOrderRespType

func (s *CreateMarginOrderService) NewOrderRespType(newOrderRespType NewOrderRespType) *CreateMarginOrderService

NewOrderRespType set icebergQuantity

func (*CreateMarginOrderService) Price

Price set price

func (*CreateMarginOrderService) Quantity

Quantity set quantity

func (*CreateMarginOrderService) QuoteOrderQty

func (s *CreateMarginOrderService) QuoteOrderQty(quoteOrderQty string) *CreateMarginOrderService

QuoteOrderQty set quoteOrderQty

func (*CreateMarginOrderService) Side

Side set side

func (*CreateMarginOrderService) SideEffectType

func (s *CreateMarginOrderService) SideEffectType(sideEffectType SideEffectType) *CreateMarginOrderService

SideEffectType set sideEffectType

func (*CreateMarginOrderService) StopPrice

func (s *CreateMarginOrderService) StopPrice(stopPrice string) *CreateMarginOrderService

StopPrice set stopPrice

func (*CreateMarginOrderService) Symbol

Symbol set symbol

func (*CreateMarginOrderService) TimeInForce

TimeInForce set timeInForce

func (*CreateMarginOrderService) Type

Type set type

type CreateOCOResponse

type CreateOCOResponse struct {
	OrderListID       int64             `json:"orderListId"`
	ContingencyType   string            `json:"contingencyType"`
	ListStatusType    string            `json:"listStatusType"`
	ListOrderStatus   string            `json:"listOrderStatus"`
	ListClientOrderID string            `json:"listClientOrderId"`
	TransactionTime   int64             `json:"transactionTime"`
	Symbol            string            `json:"symbol"`
	Orders            []*OCOOrder       `json:"orders"`
	OrderReports      []*OCOOrderReport `json:"orderReports"`
}

CreateOCOResponse define create order response

type CreateOCOService

type CreateOCOService struct {
	// contains filtered or unexported fields
}

CreateOCOService create order

func (*CreateOCOService) Do

func (s *CreateOCOService) Do(ctx context.Context, opts ...RequestOption) (res *CreateOCOResponse, err error)

Do send request

func (*CreateOCOService) LimitClientOrderID

func (s *CreateOCOService) LimitClientOrderID(limitClientOrderID string) *CreateOCOService

LimitClientOrderID set limitClientOrderID

func (*CreateOCOService) LimitIcebergQuantity

func (s *CreateOCOService) LimitIcebergQuantity(limitIcebergQty string) *CreateOCOService

LimitIcebergQuantity set limitIcebergQuantity

func (*CreateOCOService) ListClientOrderID

func (s *CreateOCOService) ListClientOrderID(listClientOrderID string) *CreateOCOService

ListClientOrderID set listClientOrderID

func (*CreateOCOService) NewOrderRespType

func (s *CreateOCOService) NewOrderRespType(newOrderRespType NewOrderRespType) *CreateOCOService

NewOrderRespType set icebergQuantity

func (*CreateOCOService) Price

func (s *CreateOCOService) Price(price string) *CreateOCOService

Price set price

func (*CreateOCOService) Quantity

func (s *CreateOCOService) Quantity(quantity string) *CreateOCOService

Quantity set quantity

func (*CreateOCOService) Side

Side set side

func (*CreateOCOService) StopClientOrderID

func (s *CreateOCOService) StopClientOrderID(stopClientOrderID string) *CreateOCOService

StopClientOrderID set stopClientOrderID

func (*CreateOCOService) StopIcebergQty

func (s *CreateOCOService) StopIcebergQty(stopIcebergQty string) *CreateOCOService

StopIcebergQty set stop limit price

func (*CreateOCOService) StopLimitPrice

func (s *CreateOCOService) StopLimitPrice(stopLimitPrice string) *CreateOCOService

StopLimitPrice set stop limit price

func (*CreateOCOService) StopLimitTimeInForce

func (s *CreateOCOService) StopLimitTimeInForce(stopLimitTimeInForce TimeInForceType) *CreateOCOService

StopLimitTimeInForce set stopLimitTimeInForce

func (*CreateOCOService) StopPrice

func (s *CreateOCOService) StopPrice(stopPrice string) *CreateOCOService

StopPrice set stop price

func (*CreateOCOService) Symbol

func (s *CreateOCOService) Symbol(symbol string) *CreateOCOService

Symbol set symbol

type CreateOrderResponse

type CreateOrderResponse struct {
	Symbol                   string `json:"symbol"`
	OrderID                  int64  `json:"orderId"`
	ClientOrderID            string `json:"clientOrderId"`
	TransactTime             int64  `json:"transactTime"`
	Price                    string `json:"price"`
	OrigQuantity             string `json:"origQty"`
	ExecutedQuantity         string `json:"executedQty"`
	CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
	IsIsolated               bool   `json:"isIsolated"` // for isolated margin

	Status      OrderStatusType `json:"status"`
	TimeInForce TimeInForceType `json:"timeInForce"`
	Type        OrderType       `json:"type"`
	Side        SideType        `json:"side"`

	// for order response is set to FULL
	Fills                 []*Fill `json:"fills"`
	MarginBuyBorrowAmount string  `json:"marginBuyBorrowAmount"` // for margin
	MarginBuyBorrowAsset  string  `json:"marginBuyBorrowAsset"`
}

CreateOrderResponse define create order response

type CreateOrderService

type CreateOrderService struct {
	// contains filtered or unexported fields
}

CreateOrderService create order

func (*CreateOrderService) Do

func (s *CreateOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CreateOrderResponse, err error)

Do send request

func (*CreateOrderService) IcebergQuantity

func (s *CreateOrderService) IcebergQuantity(icebergQuantity string) *CreateOrderService

IcebergQuantity set icebergQuantity

func (*CreateOrderService) NewClientOrderID

func (s *CreateOrderService) NewClientOrderID(newClientOrderID string) *CreateOrderService

NewClientOrderID set newClientOrderID

func (*CreateOrderService) NewOrderRespType

func (s *CreateOrderService) NewOrderRespType(newOrderRespType NewOrderRespType) *CreateOrderService

NewOrderRespType set icebergQuantity

func (*CreateOrderService) Price

func (s *CreateOrderService) Price(price string) *CreateOrderService

Price set price

func (*CreateOrderService) Quantity

func (s *CreateOrderService) Quantity(quantity string) *CreateOrderService

Quantity set quantity

func (*CreateOrderService) QuoteOrderQty

func (s *CreateOrderService) QuoteOrderQty(quoteOrderQty string) *CreateOrderService

QuoteOrderQty set quoteOrderQty

func (*CreateOrderService) Side

Side set side

func (*CreateOrderService) StopPrice

func (s *CreateOrderService) StopPrice(stopPrice string) *CreateOrderService

StopPrice set stopPrice

func (*CreateOrderService) Symbol

func (s *CreateOrderService) Symbol(symbol string) *CreateOrderService

Symbol set symbol

func (*CreateOrderService) Test

func (s *CreateOrderService) Test(ctx context.Context, opts ...RequestOption) (err error)

Test send test api to check if the request is valid

func (*CreateOrderService) TimeInForce

func (s *CreateOrderService) TimeInForce(timeInForce TimeInForceType) *CreateOrderService

TimeInForce set timeInForce

func (*CreateOrderService) TrailingDelta

func (s *CreateOrderService) TrailingDelta(trailingDelta string) *CreateOrderService

TrailingDelta set trailingDelta

func (*CreateOrderService) Type

func (s *CreateOrderService) Type(orderType OrderType) *CreateOrderService

Type set type

type CreateUserUniversalTransferResponse

type CreateUserUniversalTransferResponse struct {
	ID int64 `json:"tranId"`
}

CreateUserUniversalTransferResponse represents a response from CreateUserUniversalTransferResponse.

type CreateUserUniversalTransferService

type CreateUserUniversalTransferService struct {
	// contains filtered or unexported fields
}

CreateUserUniversalTransferService submits a transfer request.

See https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer-user_data

func (*CreateUserUniversalTransferService) Amount

Amount sets the Amount parameter (MANDATORY).

func (*CreateUserUniversalTransferService) Asset

Asset sets the Asset parameter (MANDATORY).

func (*CreateUserUniversalTransferService) Do

Do sends the request.

func (*CreateUserUniversalTransferService) FromSymbol

fromSymbol sets the fromSymbol parameter

func (*CreateUserUniversalTransferService) ToSymbol

toSymbol sets the toSymbol parameter

func (*CreateUserUniversalTransferService) Type

Coin sets the coin parameter (MANDATORY).

type CreateWithdrawResponse

type CreateWithdrawResponse struct {
	ID string `json:"id"`
}

CreateWithdrawResponse represents a response from CreateWithdrawService.

type CreateWithdrawService

type CreateWithdrawService struct {
	// contains filtered or unexported fields
}

CreateWithdrawService submits a withdraw request.

See https://binance-docs.github.io/apidocs/spot/en/#withdraw

func (*CreateWithdrawService) Address

Address sets the address parameter (MANDATORY).

func (*CreateWithdrawService) AddressTag

AddressTag sets the addressTag parameter.

func (*CreateWithdrawService) Amount

Amount sets the amount parameter (MANDATORY).

func (*CreateWithdrawService) Coin

Coin sets the coin parameter (MANDATORY).

func (*CreateWithdrawService) Do

Do sends the request.

func (*CreateWithdrawService) Name

Name sets the name parameter.

func (*CreateWithdrawService) Network

Network sets the network parameter.

func (*CreateWithdrawService) TransactionFeeFlag

func (s *CreateWithdrawService) TransactionFeeFlag(v bool) *CreateWithdrawService

TransactionFeeFlag sets the transactionFeeFlag parameter.

func (*CreateWithdrawService) WithdrawOrderID

func (s *CreateWithdrawService) WithdrawOrderID(v string) *CreateWithdrawService

WithdrawOrderID sets the withdrawOrderID parameter.

type CrossMarginData

type CrossMarginData struct {
	VipLevel        int64    `json:"vipLevel"`
	Coin            string   `json:"coin"`
	TransferIn      bool     `json:"transferIn"`
	Borrowable      bool     `json:"borrowable"`
	DailyInterest   string   `json:"dailyInterest"`
	YearlyInterest  string   `json:"yearlyInterest"`
	BorrowLimit     string   `json:"borrowLimit"`
	MarginablePairs []string `json:"marginablePairs"`
}

type CrossMarginDataService

type CrossMarginDataService struct {
	// contains filtered or unexported fields
}

func (*CrossMarginDataService) Do

func (s *CrossMarginDataService) Do(ctx context.Context, opts ...RequestOption) (res *[]CrossMarginData, err error)

Do send request

type CryptoLoanAsset

type CryptoLoanAsset struct {
	LoanCoin               string `json:"loanCoin"`
	D7HourlyInterestRate   string `json:"_7dHourlyInterestRate"`
	D7DailyInterestRate    string `json:"_7dDailyInterestRate"`
	D14HourlyInterestRate  string `json:"_14dHourlyInterestRate"`
	D14DailyInterestRate   string `json:"_14dDailyInterestRate"`
	D30HourlyInterestRate  string `json:"_30dHourlyInterestRate"`
	D30DailyInterestRate   string `json:"_30dDailyInterestRate"`
	D90HourlyInterestRate  string `json:"_90dHourlyInterestRate"`
	D90DailyInterestRate   string `json:"_90dDailyInterestRate"`
	D180HourlyInterestRate string `json:"_180dHourlyInterestRate"`
	D180DailyInterestRate  string `json:"_180dDailyInterestRate"`
	MinLimit               string `json:"minLimit"`
	MaxLimit               string `json:"maxLimit"`
	VipLevel               int64  `json:"vipLevel"`
}

type CryptoLoanService

type CryptoLoanService struct {
	// contains filtered or unexported fields
}

func (*CryptoLoanService) Do

func (s *CryptoLoanService) Do(ctx context.Context, opts ...RequestOption) (res *CryptoLoanableAssets, err error)

Do send request

type CryptoLoanableAssets

type CryptoLoanableAssets struct {
	Rows  []CryptoLoanAsset `json:"rows"`
	Total int64             `json:"total"`
}

type DataType

type DataType int
const (
	Subscription DataType = iota + 1
	Redemption
	Interest
)

type Deposit

type Deposit 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  int64  `json:"transferType"`
	UnlockConfirm int64  `json:"unlockConfirm"`
	ConfirmTimes  string `json:"confirmTimes"`
}

Deposit represents a single deposit entry.

type DepthResponse

type DepthResponse struct {
	LastUpdateID int64 `json:"lastUpdateId"`
	Bids         []Bid `json:"bids"`
	Asks         []Ask `json:"asks"`
}

DepthResponse define depth info with bids and asks

type DepthService

type DepthService struct {
	// contains filtered or unexported fields
}

DepthService show depth info

func (*DepthService) Do

func (s *DepthService) Do(ctx context.Context, opts ...RequestOption) (res *DepthResponse, err error)

Do send request

func (*DepthService) Limit

func (s *DepthService) Limit(limit int) *DepthService

Limit set limit

func (*DepthService) Symbol

func (s *DepthService) Symbol(symbol string) *DepthService

Symbol set symbol

type DividendResponse

type DividendResponse struct {
	ID     int64  `json:"id"`
	Amount string `json:"amount"`
	Asset  string `json:"asset"`
	Info   string `json:"enInfo"`
	Time   int64  `json:"divTime"`
	TranID int64  `json:"tranId"`
}

DividendResponse represents a response from AssetDividendService.

type DividendResponseWrapper

type DividendResponseWrapper struct {
	Rows  *[]DividendResponse `json:"rows"`
	Total int32               `json:"total"`
}

DividendResponseWrapper represents a wrapper around a AssetDividendService.

type DustResult

type DustResult struct {
	Total              uint8               `json:"total"` //Total counts of exchange
	UserAssetDribblets []UserAssetDribblet `json:"userAssetDribblets"`
}

DustResult represents the result of a DustLog API Call.

type DustTransferResponse

type DustTransferResponse struct {
	TotalServiceCharge string                `json:"totalServiceCharge"`
	TotalTransfered    string                `json:"totalTransfered"`
	TransferResult     []*DustTransferResult `json:"transferResult"`
}

DustTransferResponse represents the response from DustTransferService.

type DustTransferResult

type DustTransferResult struct {
	Amount              string `json:"amount"`
	FromAsset           string `json:"fromAsset"`
	OperateTime         int64  `json:"operateTime"`
	ServiceChargeAmount string `json:"serviceChargeAmount"`
	TranID              int64  `json:"tranId"`
	TransferedAmount    string `json:"transferedAmount"`
}

DustTransferResult represents the result of a dust transfer.

type DustTransferService

type DustTransferService struct {
	// contains filtered or unexported fields
}

DustTransferService convert dust assets to BNB. See https://binance-docs.github.io/apidocs/spot/en/#dust-transfer-user_data

func (*DustTransferService) Asset

func (s *DustTransferService) Asset(asset []string) *DustTransferService

Asset set asset.

func (*DustTransferService) Do

func (s *DustTransferService) Do(ctx context.Context) (withdraws *DustTransferResponse, err error)

Do sends the request.

type EarnHistory

type EarnHistory struct {
	Amount      float64 `json:",string"`
	Asset       string
	CreateTime  int64
	LendingType string
	ProductName string
	PurchaseID  int64
	Status      string
	Type        string
	Time        int64
	Interest    float64 `json:",string"`
}

type ErrHandler

type ErrHandler func(err error)

ErrHandler handles errors

type ExchangeInfo

type ExchangeInfo struct {
	Timezone        string        `json:"timezone"`
	ServerTime      int64         `json:"serverTime"`
	RateLimits      []RateLimit   `json:"rateLimits"`
	ExchangeFilters []interface{} `json:"exchangeFilters"`
	Symbols         []Symbol      `json:"symbols"`
}

ExchangeInfo exchange info

type ExchangeInfoService

type ExchangeInfoService struct {
	// contains filtered or unexported fields
}

ExchangeInfoService exchange info service

func (*ExchangeInfoService) Do

func (s *ExchangeInfoService) Do(ctx context.Context, opts ...RequestOption) (res *ExchangeInfo, err error)

Do send request

func (*ExchangeInfoService) Permissions

func (s *ExchangeInfoService) Permissions(permissions ...string) *ExchangeInfoService

Permissions set permission

func (*ExchangeInfoService) Symbol

func (s *ExchangeInfoService) Symbol(symbol string) *ExchangeInfoService

Symbol set symbol

func (*ExchangeInfoService) Symbols

func (s *ExchangeInfoService) Symbols(symbols ...string) *ExchangeInfoService

Symbols set symbol

type FLAdjustLTVDirection

type FLAdjustLTVDirection string
const (
	FLAdjustLTVAdditional FLAdjustLTVDirection = "ADDITIONAL"
	FLAdjustLTVReduced    FLAdjustLTVDirection = "REDUCED"
)

type FLAdjustLTVStatus

type FLAdjustLTVStatus string
const (
	FLAdjustLTVSucceeds   FLAdjustLTVStatus = "Succeeds"
	FLAdjustLTVFailed     FLAdjustLTVStatus = "Failed"
	FLAdjustLTVProcessing FLAdjustLTVStatus = "Processing"
)

type FiatDepositWithdrawHistory

type FiatDepositWithdrawHistory struct {
	Code    string                           `json:"code"`
	Message string                           `json:"message"`
	Data    []FiatDepositWithdrawHistoryItem `json:"data"`
	Total   int32                            `json:"total"`
	Success bool                             `json:"success"`
}

FiatDepositWithdrawHistory define the fiat deposit/withdraw history

type FiatDepositWithdrawHistoryItem

type FiatDepositWithdrawHistoryItem struct {
	OrderNo         string `json:"orderNo"`
	FiatCurrency    string `json:"fiatCurrency"`
	IndicatedAmount string `json:"indicatedAmount"`
	Amount          string `json:"amount"`
	TotalFee        string `json:"totalFee"`
	Method          string `json:"method"`
	Status          string `json:"status"`
	CreateTime      int64  `json:"createTime"`
	UpdateTime      int64  `json:"updateTime"`
}

FiatDepositWithdrawHistoryItem define a fiat deposit/withdraw history item

type FiatDepositWithdrawHistoryService

type FiatDepositWithdrawHistoryService struct {
	// contains filtered or unexported fields
}

FiatDepositWithdrawHistoryService retrieve the fiat deposit/withdraw history

func (*FiatDepositWithdrawHistoryService) BeginTime

BeginTime set beginTime

func (*FiatDepositWithdrawHistoryService) Do

Do send request

func (*FiatDepositWithdrawHistoryService) EndTime

EndTime set endTime

func (*FiatDepositWithdrawHistoryService) Page

Page set page

func (*FiatDepositWithdrawHistoryService) Rows

Rows set rows

func (*FiatDepositWithdrawHistoryService) TransactionType

TransactionType set transactionType

type FiatPaymentsHistory

type FiatPaymentsHistory struct {
	Code    string                    `json:"code"`
	Message string                    `json:"message"`
	Data    []FiatPaymentsHistoryItem `json:"data"`
	Total   int32                     `json:"total"`
	Success bool                      `json:"success"`
}

FiatPaymentsHistory define the fiat payments history

type FiatPaymentsHistoryItem

type FiatPaymentsHistoryItem struct {
	OrderNo        string `json:"orderNo"`
	SourceAmount   string `json:"sourceAmount"`
	FiatCurrency   string `json:"fiatCurrency"`
	ObtainAmount   string `json:"obtainAmount"`
	CryptoCurrency string `json:"cryptoCurrency"`
	TotalFee       string `json:"totalFee"`
	Price          string `json:"price"`
	Status         string `json:"status"`
	CreateTime     int64  `json:"createTime"`
	UpdateTime     int64  `json:"updateTime"`
}

FiatPaymentsHistoryItem define a fiat payments history item

type FiatPaymentsHistoryService

type FiatPaymentsHistoryService struct {
	// contains filtered or unexported fields
}

FiatPaymentsHistoryService retrieve the fiat payments history

func (*FiatPaymentsHistoryService) BeginTime

BeginTime set beginTime

func (*FiatPaymentsHistoryService) Do

Do send request

func (*FiatPaymentsHistoryService) EndTime

EndTime set endTime

func (*FiatPaymentsHistoryService) Page

Page set page

func (*FiatPaymentsHistoryService) Rows

Rows set rows

func (*FiatPaymentsHistoryService) TransactionType

func (s *FiatPaymentsHistoryService) TransactionType(transactionType TransactionType) *FiatPaymentsHistoryService

TransactionType set transactionType

type Fill

type Fill struct {
	TradeID         int64  `json:"tradeId"`
	Price           string `json:"price"`
	Quantity        string `json:"qty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
}

Fill may be returned in an array of fills in a CreateOrderResponse.

type FlexibleBorrowStatus

type FlexibleBorrowStatus string
const (
	FlexibleBorrowStatusSucceeds   FlexibleBorrowStatus = "Succeeds"
	FlexibleBorrowStatusFailed     FlexibleBorrowStatus = "Failed"
	FlexibleBorrowStatusProcessing FlexibleBorrowStatus = "Processing"
)

type FlexibleLoanAdjustLTVResp

type FlexibleLoanAdjustLTVResp struct {
	LoanCoin         string            `json:"loanCoin"`
	CollateralCoin   string            `json:"collateralCoin"`
	Direction        string            `json:"direction"`
	AdjustmentAmount string            `json:"adjustmentAmount"`
	CurrentLTV       string            `json:"currentLTV"`
	Status           FLAdjustLTVStatus `json:"status"`
}

type FlexibleLoanAdjustLTVService

type FlexibleLoanAdjustLTVService struct {
	// contains filtered or unexported fields
}

func (*FlexibleLoanAdjustLTVService) AdjustmentAmount

AdjustmentAmount set adjustmentAmount

func (*FlexibleLoanAdjustLTVService) CollateralCoin

CollateralCoin set collateralCoin

func (*FlexibleLoanAdjustLTVService) Direction

Direction set direction

func (*FlexibleLoanAdjustLTVService) Do

Do send request

func (*FlexibleLoanAdjustLTVService) LoanCoin

LoanCoin set loanCoin

type FlexibleLoanAsset

type FlexibleLoanAsset struct {
	LoanCoin             string `json:"loanCoin"`
	FlexibleInterestRate string `json:"flexibleInterestRate"`
	FlexibleMinLimit     string `json:"flexibleMinLimit"`
	FlexibleMaxLimit     string `json:"flexibleMaxLimit"`
}

type FlexibleLoanBorrowHistory

type FlexibleLoanBorrowHistory struct {
	LoanCoin                string               `json:"loanCoin"`
	InitialLoanAmount       string               `json:"initialLoanAmount"`
	CollateralCoin          string               `json:"collateralCoin"`
	InitialCollateralAmount string               `json:"initialCollateralAmount"`
	BorrowTime              interface{}          `json:"borrowTime"`
	Status                  FlexibleBorrowStatus `json:"status"`
}

type FlexibleLoanBorrowResp

type FlexibleLoanBorrowResp struct {
	LoanCoin         string               `json:"loanCoin"`
	LoanAmount       string               `json:"loanAmount"`
	CollateralCoin   string               `json:"collateralCoin"`
	CollateralAmount string               `json:"collateralAmount"`
	Status           FlexibleBorrowStatus `json:"status"`
}

type FlexibleLoanBorrowService

type FlexibleLoanBorrowService struct {
	// contains filtered or unexported fields
}

func (*FlexibleLoanBorrowService) CollateralAmount

func (s *FlexibleLoanBorrowService) CollateralAmount(collAmt float64) *FlexibleLoanBorrowService

CollateralAmount set collateralAmount

func (*FlexibleLoanBorrowService) CollateralCoin

CollateralCoin set collateralCoin

func (*FlexibleLoanBorrowService) Do

Do send request

func (*FlexibleLoanBorrowService) LoanAmount

func (s *FlexibleLoanBorrowService) LoanAmount(loanAmount float64) *FlexibleLoanBorrowService

LoanAmount set loanAmount

func (*FlexibleLoanBorrowService) LoanCoin

LoanCoin set loanCoin

type FlexibleLoanOngoingOrder

type FlexibleLoanOngoingOrder struct {
	LoanCoin         string `json:"loanCoin"`
	TotalDebt        string `json:"totalDebt"`
	CollateralCoin   string `json:"collateralCoin"`
	CollateralAmount string `json:"collateralAmount"`
	CurrentLTV       string `json:"currentLTV"`
}

type FlexibleLoanRepayHistory

type FlexibleLoanRepayHistory struct {
	LoanCoin         string                  `json:"loanCoin"`
	RepayAmount      string                  `json:"repayAmount"`
	CollateralCoin   string                  `json:"collateralCoin"`
	CollateralReturn string                  `json:"collateralReturn"`
	RepayTime        interface{}             `json:"repayTime"`
	RepayStatus      FlexibleLoanRepayStatus `json:"repayStatus"`
}

type FlexibleLoanRepayResp

type FlexibleLoanRepayResp struct {
	LoanCoin            string                  `json:"loanCoin"`
	CollateralCoin      string                  `json:"collateralCoin"`
	RemainingDebt       string                  `json:"remainingDebt"`
	RemainingCollateral string                  `json:"remainingCollateral"`
	FullRepayment       bool                    `json:"fullRepayment"`
	CurrentLTV          string                  `json:"currentLTV"`
	RepayStatus         FlexibleLoanRepayStatus `json:"repayStatus"`
}

type FlexibleLoanRepayService

type FlexibleLoanRepayService struct {
	// contains filtered or unexported fields
}

func (*FlexibleLoanRepayService) CollateralCoin

func (s *FlexibleLoanRepayService) CollateralCoin(coll string) *FlexibleLoanRepayService

CollateralCoin set collateralCoin

func (*FlexibleLoanRepayService) CollateralReturn

func (s *FlexibleLoanRepayService) CollateralReturn(collReturn bool) *FlexibleLoanRepayService

CollateralReturn set collateralReturn

func (*FlexibleLoanRepayService) Do

Do send request

func (*FlexibleLoanRepayService) FullRepayment

func (s *FlexibleLoanRepayService) FullRepayment(fullRepayment bool) *FlexibleLoanRepayService

FullRepayment set fullRepayment

func (*FlexibleLoanRepayService) LoanCoin

LoanCoin set loanCoin

func (*FlexibleLoanRepayService) RepayAmount

RepayAmount set repayAmount

type FlexibleLoanRepayStatus

type FlexibleLoanRepayStatus string
const (
	FlexibleLoanRepaid   FlexibleLoanRepayStatus = "Repaid"
	FlexibleLoanRepaying FlexibleLoanRepayStatus = "Repaying"
	FlexibleLoanFailed   FlexibleLoanRepayStatus = "Failed"
)

type FlexibleLoanableAssets

type FlexibleLoanableAssets struct {
	Rows  []FlexibleLoanAsset `json:"rows"`
	Total int64               `json:"total"`
}

type FlexibleProductPosition added in v2.0.1

type FlexibleProductPosition struct {
	TotalAmount                    string             `json:"totalAmount,omitempty"`
	TierAnnualPercentageRate       map[string]float64 `json:"tierAnnualPercentageRate,omitempty"`
	LatestAnnualPercentageRate     string             `json:"latestAnnualPercentageRate,omitempty"`
	YesterdayAirdropPercentageRate string             `json:"yesterdayAirdropPercentageRate,omitempty"`
	Asset                          string             `json:"asset,omitempty"`
	AirDropAsset                   string             `json:"airDropAsset,omitempty"`
	CanRedeem                      bool               `json:"canRedeem,omitempty"`
	CollateralAmount               string             `json:"collateralAmount,omitempty"`
	ProductID                      string             `json:"productId,omitempty"`
	YesterdayRealTimeRewards       string             `json:"yesterdayRealTimeRewards,omitempty"`
	CumulativeBonusRewards         string             `json:"cumulativeBonusRewards,omitempty"`
	CumulativeRealTimeRewards      string             `json:"cumulativeRealTimeRewards,omitempty"`
	CumulativeTotalRewards         string             `json:"cumulativeTotalRewards,omitempty"`
	AutoSubscribe                  bool               `json:"autoSubscribe,omitempty"`
}

type FlexibleRewardHistory added in v2.0.1

type FlexibleRewardHistory struct {
	Asset     string `json:"asset,omitempty"`
	Rewards   string `json:"rewards,omitempty"`
	ProjectID string `json:"productId,omitempty"`
	Typ       string `json:"type,omitempty"`
	Time      int64  `json:"time,omitempty"`
}

type FlexibleRewardHistoryResponse added in v2.0.1

type FlexibleRewardHistoryResponse struct {
	Rows  []FlexibleRewardHistory `json:"rows,omitempty"`
	Total int                     `json:"total,omitempty"`
}

type FlexibleRewardHistoryService added in v2.0.1

type FlexibleRewardHistoryService struct {
	// contains filtered or unexported fields
}

https://binance-docs.github.io/apidocs/spot/en/#get-flexible-rewards-history-user_data

func (*FlexibleRewardHistoryService) Asset added in v2.0.1

func (*FlexibleRewardHistoryService) Current added in v2.0.1

func (*FlexibleRewardHistoryService) Do added in v2.0.1

func (*FlexibleRewardHistoryService) EndTime added in v2.0.1

func (*FlexibleRewardHistoryService) ProductID added in v2.0.1

func (*FlexibleRewardHistoryService) Size added in v2.0.1

func (*FlexibleRewardHistoryService) StartTime added in v2.0.1

func (*FlexibleRewardHistoryService) Type added in v2.0.2

type FundsDetail

type FundsDetail struct {
	Currency string `json:"currency"`
	Amount   string `json:"amount"`
}

type FuturesTransfer

type FuturesTransfer struct {
	Asset     string                    `json:"asset"`
	TranID    int64                     `json:"tranId"`
	Amount    string                    `json:"amount"`
	Type      int64                     `json:"type"`
	Timestamp int64                     `json:"timestamp"`
	Status    FuturesTransferStatusType `json:"status"`
}

FuturesTransfer define futures transfer history item

type FuturesTransferHistory

type FuturesTransferHistory struct {
	Rows  []FuturesTransfer `json:"rows"`
	Total int64             `json:"total"`
}

FuturesTransferHistory define futures transfer history

type FuturesTransferService

type FuturesTransferService struct {
	// contains filtered or unexported fields
}

FuturesTransferService transfer asset between spot account and futures account

func (*FuturesTransferService) Amount

Amount the amount to be transferred

func (*FuturesTransferService) Asset

Asset set asset being transferred, e.g., BTC

func (*FuturesTransferService) Do

Do send request

func (*FuturesTransferService) Type

Type 1: transfer from spot account to futures account 2: transfer from futures account to spot account

type FuturesTransferStatusType

type FuturesTransferStatusType string

FuturesTransferStatusType define futures transfer status type

type FuturesTransferType

type FuturesTransferType int

FuturesTransferType define futures transfer type

type GetAPIKeyPermission

type GetAPIKeyPermission struct {
	// contains filtered or unexported fields
}

GetAPIKeyPermission get API Key permission info

func (*GetAPIKeyPermission) Do

func (s *GetAPIKeyPermission) Do(ctx context.Context, opts ...RequestOption) (res *APIKeyPermission, err error)

Do send request

type GetAccountService

type GetAccountService struct {
	// contains filtered or unexported fields
}

GetAccountService get account info

func (*GetAccountService) Do

func (s *GetAccountService) Do(ctx context.Context, opts ...RequestOption) (res *Account, err error)

Do send request

type GetAccountSnapshotService

type GetAccountSnapshotService struct {
	// contains filtered or unexported fields
}

GetAccountSnapshotService all account orders; active, canceled, or filled

func (*GetAccountSnapshotService) Do

func (s *GetAccountSnapshotService) Do(ctx context.Context, opts ...RequestOption) (res *Snapshot, err error)

Do send request

func (*GetAccountSnapshotService) EndTime

EndTime set endtime

func (*GetAccountSnapshotService) Limit

Limit set limit

func (*GetAccountSnapshotService) StartTime

StartTime set starttime

func (*GetAccountSnapshotService) Type

Type set account type ("SPOT", "MARGIN", "FUTURES")

type GetAllCoinsInfoService

type GetAllCoinsInfoService struct {
	// contains filtered or unexported fields
}

func (*GetAllCoinsInfoService) Do

func (s *GetAllCoinsInfoService) Do(ctx context.Context) (res []*CoinInfo, err error)

Do send request

type GetAllLiquidityPoolService

type GetAllLiquidityPoolService struct {
	// contains filtered or unexported fields
}

GetAllSwapPoolService get swap pool market data

func (*GetAllLiquidityPoolService) Do

Do send request

type GetAllMarginAssetsService

type GetAllMarginAssetsService struct {
	// contains filtered or unexported fields
}

GetAllMarginAssetsService get margin pair info

func (*GetAllMarginAssetsService) Do

func (s *GetAllMarginAssetsService) Do(ctx context.Context, opts ...RequestOption) (res []*MarginAsset, err error)

Do send request

type GetAssetDetailService

type GetAssetDetailService struct {
	// contains filtered or unexported fields
}

GetAssetDetailService fetches all asset detail.

See https://binance-docs.github.io/apidocs/spot/en/#asset-detail-user_data

func (*GetAssetDetailService) Asset

Asset sets the asset parameter.

func (*GetAssetDetailService) Do

func (s *GetAssetDetailService) Do(ctx context.Context) (res map[string]AssetDetail, err error)

Do sends the request.

type GetBNBBurnService

type GetBNBBurnService struct {
	// contains filtered or unexported fields
}

GetBNBBurnService get BNB Burn on spot trade and margin interest

func (*GetBNBBurnService) Do

func (s *GetBNBBurnService) Do(ctx context.Context, opts ...RequestOption) (*BNBBurn, error)

Do send request

type GetDepositAddressResponse

type GetDepositAddressResponse struct {
	Address string `json:"address"`
	Tag     string `json:"tag"`
	Coin    string `json:"coin"`
	URL     string `json:"url"`
}

GetDepositAddressResponse represents a response from GetDepositsAddressService.

type GetDepositsAddressService

type GetDepositsAddressService struct {
	// contains filtered or unexported fields
}

GetDepositsAddressService retrieves the details of a deposit address.

See https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data

func (*GetDepositsAddressService) Coin

Coin sets the coin parameter (MANDATORY).

func (*GetDepositsAddressService) Do

Do sends the request.

func (*GetDepositsAddressService) Network

Network sets the network parameter.

type GetFlexibleLoanAssetsDataService

type GetFlexibleLoanAssetsDataService struct {
	// contains filtered or unexported fields
}

func (*GetFlexibleLoanAssetsDataService) Do

Do send request

type GetFlexibleLoanBorrowHistoryResp

type GetFlexibleLoanBorrowHistoryResp struct {
	Rows  []FlexibleLoanBorrowHistory `json:"rows"`
	Total int64                       `json:"total"`
}

type GetFlexibleLoanBorrowHistoryService

type GetFlexibleLoanBorrowHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetFlexibleLoanBorrowHistoryService) CollateralCoin

CollateralCoin set collateralCoin

func (*GetFlexibleLoanBorrowHistoryService) Current

Current set current

func (*GetFlexibleLoanBorrowHistoryService) Do

Do send request

func (*GetFlexibleLoanBorrowHistoryService) EndTime

EndTime set endTime

func (*GetFlexibleLoanBorrowHistoryService) Limit

Limit set limit

func (*GetFlexibleLoanBorrowHistoryService) LoanCoin

LoanCoin set loanCoin

func (*GetFlexibleLoanBorrowHistoryService) StartTime

StartTime set startTime

type GetFlexibleLoanOngoingOrdersResp

type GetFlexibleLoanOngoingOrdersResp struct {
	Rows  []FlexibleLoanOngoingOrder `json:"rows"`
	Total int64                      `json:"total"`
}

type GetFlexibleLoanOngoingOrdersService

type GetFlexibleLoanOngoingOrdersService struct {
	// contains filtered or unexported fields
}

func (*GetFlexibleLoanOngoingOrdersService) CollateralCoin

CollateralCoin set collateralCoin

func (*GetFlexibleLoanOngoingOrdersService) Current

Current set current

func (*GetFlexibleLoanOngoingOrdersService) Do

Do send request

func (*GetFlexibleLoanOngoingOrdersService) Limit

Limit set limit

func (*GetFlexibleLoanOngoingOrdersService) LoanCoin

LoanCoin set loanCoin

type GetFlexibleLoanRepayHistoryResp

type GetFlexibleLoanRepayHistoryResp struct {
	Rows  []FlexibleLoanRepayHistory `json:"rows"`
	Total int64                      `json:"total"`
}

type GetFlexibleLoanRepayHistoryService

type GetFlexibleLoanRepayHistoryService struct {
	// contains filtered or unexported fields
}

func (*GetFlexibleLoanRepayHistoryService) CollateralCoin

CollateralCoin set collateralCoin

func (*GetFlexibleLoanRepayHistoryService) Current

Current set current

func (*GetFlexibleLoanRepayHistoryService) Do

Do send request

func (*GetFlexibleLoanRepayHistoryService) EndTime

EndTime set endTime

func (*GetFlexibleLoanRepayHistoryService) Limit

Limit set limit

func (*GetFlexibleLoanRepayHistoryService) LoanCoin

LoanCoin set loanCoin

func (*GetFlexibleLoanRepayHistoryService) StartTime

StartTime set startTime

type GetFlexibleProductPositionResponse added in v2.0.1

type GetFlexibleProductPositionResponse struct {
	Rows  []FlexibleProductPosition `json:"rows,omitempty"`
	Total int                       `json:"total,omitempty"`
}

type GetFlexibleProductPositionService added in v2.0.1

type GetFlexibleProductPositionService struct {
	// contains filtered or unexported fields
}

GetFlexibleProductPositionService: https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-position-user_data

func (*GetFlexibleProductPositionService) Current added in v2.0.1

Currently querying the page. Start from 1. Default:1

func (*GetFlexibleProductPositionService) Do added in v2.0.1

func (*GetFlexibleProductPositionService) ProductId added in v2.0.1

func (*GetFlexibleProductPositionService) Size added in v2.0.1

Default:10, Max:100

type GetIsolatedMarginAccountService

type GetIsolatedMarginAccountService struct {
	// contains filtered or unexported fields
}

GetIsolatedMarginAccountService gets isolated margin account info

func (*GetIsolatedMarginAccountService) Do

Do send request

func (*GetIsolatedMarginAccountService) Symbols

Symbols set symbols to the isolated margin account

type GetIsolatedMarginAllPairsService

type GetIsolatedMarginAllPairsService struct {
	// contains filtered or unexported fields
}

GetIsolatedMarginAllPairsService get isolated margin pair info

func (*GetIsolatedMarginAllPairsService) Do

Do send request

type GetLiquidityPoolDetailService

type GetLiquidityPoolDetailService struct {
	// contains filtered or unexported fields
}

GetLiquidityPoolDetailService get swap pool detail by pool id

func (*GetLiquidityPoolDetailService) Do

Do sends the request.

func (*GetLiquidityPoolDetailService) PoolId

PoolId set poolId

type GetLockedProductPositionResponse added in v2.0.1

type GetLockedProductPositionResponse struct {
	Rows  []LockedProductPosition `json:"rows,omitempty"`
	Total int                     `json:"total,omitempty"`
}

type GetLockedProductPositionService added in v2.0.1

type GetLockedProductPositionService struct {
	// contains filtered or unexported fields
}

https://binance-docs.github.io/apidocs/spot/en/#get-locked-product-position-user_data

func (*GetLockedProductPositionService) Asset added in v2.0.1

func (*GetLockedProductPositionService) Current added in v2.0.1

Currently querying the page. Start from 1. Default:1

func (*GetLockedProductPositionService) Do added in v2.0.1

func (*GetLockedProductPositionService) PositionID added in v2.0.1

func (*GetLockedProductPositionService) ProductId added in v2.0.1

func (*GetLockedProductPositionService) Size added in v2.0.1

Default:10, Max:100

type GetMarginAccountService

type GetMarginAccountService struct {
	// contains filtered or unexported fields
}

GetMarginAccountService get margin account info

func (*GetMarginAccountService) Do

func (s *GetMarginAccountService) Do(ctx context.Context, opts ...RequestOption) (res *MarginAccount, err error)

Do send request

type GetMarginAllPairsService

type GetMarginAllPairsService struct {
	// contains filtered or unexported fields
}

GetMarginAllPairsService get margin pair info

func (*GetMarginAllPairsService) Do

func (s *GetMarginAllPairsService) Do(ctx context.Context, opts ...RequestOption) (res []*MarginAllPair, err error)

Do send request

type GetMarginAssetService

type GetMarginAssetService struct {
	// contains filtered or unexported fields
}

GetMarginAssetService get margin asset info

func (*GetMarginAssetService) Asset

Asset set asset

func (*GetMarginAssetService) Do

func (s *GetMarginAssetService) Do(ctx context.Context, opts ...RequestOption) (res *MarginAsset, err error)

Do send request

type GetMarginOrderService

type GetMarginOrderService struct {
	// contains filtered or unexported fields
}

GetMarginOrderService get an order

func (*GetMarginOrderService) Do

func (s *GetMarginOrderService) Do(ctx context.Context, opts ...RequestOption) (res *Order, err error)

Do send request

func (*GetMarginOrderService) IsIsolated

func (s *GetMarginOrderService) IsIsolated(isIsolated bool) *GetMarginOrderService

IsIsolated set isIsolated

func (*GetMarginOrderService) OrderID

func (s *GetMarginOrderService) OrderID(orderID int64) *GetMarginOrderService

OrderID set orderID

func (*GetMarginOrderService) OrigClientOrderID

func (s *GetMarginOrderService) OrigClientOrderID(origClientOrderID string) *GetMarginOrderService

OrigClientOrderID set origClientOrderID

func (*GetMarginOrderService) Symbol

Symbol set symbol

type GetMarginPairService

type GetMarginPairService struct {
	// contains filtered or unexported fields
}

GetMarginPairService get margin pair info

func (*GetMarginPairService) Do

func (s *GetMarginPairService) Do(ctx context.Context, opts ...RequestOption) (res *MarginPair, err error)

Do send request

func (*GetMarginPairService) Symbol

Symbol set symbol

type GetMarginPriceIndexService

type GetMarginPriceIndexService struct {
	// contains filtered or unexported fields
}

GetMarginPriceIndexService get margin price index

func (*GetMarginPriceIndexService) Do

Do send request

func (*GetMarginPriceIndexService) Symbol

Symbol set symbol

type GetMaxBorrowableService

type GetMaxBorrowableService struct {
	// contains filtered or unexported fields
}

GetMaxBorrowableService get max borrowable of asset

func (*GetMaxBorrowableService) Asset

Asset set asset

func (*GetMaxBorrowableService) Do

func (s *GetMaxBorrowableService) Do(ctx context.Context, opts ...RequestOption) (res *MaxBorrowable, err error)

Do send request

func (*GetMaxBorrowableService) IsolatedSymbol

func (s *GetMaxBorrowableService) IsolatedSymbol(isolatedSymbol string) *GetMaxBorrowableService

IsolatedSymbol set isolatedSymbol

type GetMaxTransferableService

type GetMaxTransferableService struct {
	// contains filtered or unexported fields
}

GetMaxTransferableService get max transferable of asset

func (*GetMaxTransferableService) Asset

Asset set asset

func (*GetMaxTransferableService) Do

Do send request

type GetOrderService

type GetOrderService struct {
	// contains filtered or unexported fields
}

GetOrderService get an order

func (*GetOrderService) Do

func (s *GetOrderService) Do(ctx context.Context, opts ...RequestOption) (res *Order, err error)

Do send request

func (*GetOrderService) OrderID

func (s *GetOrderService) OrderID(orderID int64) *GetOrderService

OrderID set orderID

func (*GetOrderService) OrigClientOrderID

func (s *GetOrderService) OrigClientOrderID(origClientOrderID string) *GetOrderService

OrigClientOrderID set origClientOrderID

func (*GetOrderService) Symbol

func (s *GetOrderService) Symbol(symbol string) *GetOrderService

Symbol set symbol

type GetSwapQuoteResponse

type GetSwapQuoteResponse struct {
	QuoteAsset string `json:"quoteAsset"`
	BaseAsset  string `json:"baseAsset"`
	QuoteQty   string `json:"quoteQty"`
	BaseQty    string `json:"baseQty"`
	Price      string `json:"price"`
	Slippage   string `json:"slippage"`
	Fee        string `json:"fee"`
}

type GetSwapQuoteService

type GetSwapQuoteService struct {
	// contains filtered or unexported fields
}

GetSwapQuoteService get the quote

func (*GetSwapQuoteService) BaseAsset

func (s *GetSwapQuoteService) BaseAsset(baseAsset string) *GetSwapQuoteService

BaseAsset set baseAsset

func (*GetSwapQuoteService) Do

Do sends the request.

func (*GetSwapQuoteService) QuoteAsset

func (s *GetSwapQuoteService) QuoteAsset(quoteAsset string) *GetSwapQuoteService

QuoteAsset set quoteAsset

func (*GetSwapQuoteService) QuoteQty

func (s *GetSwapQuoteService) QuoteQty(quoteQty float64) *GetSwapQuoteService

QuoteQty set quoteQty

type GetUserAssetService

type GetUserAssetService struct {
	// contains filtered or unexported fields
}

GetUserAssetService Get user assets See https://binance-docs.github.io/apidocs/spot/en/#user-asset-user_data

func (*GetUserAssetService) Asset

func (*GetUserAssetService) Do

func (s *GetUserAssetService) Do(ctx context.Context) (res []UserAssetRecord, err error)

func (*GetUserAssetService) NeedBtcValuation

func (s *GetUserAssetService) NeedBtcValuation(val bool) *GetUserAssetService

type GetUserSwapRecordsService

type GetUserSwapRecordsService struct {
	// contains filtered or unexported fields
}

func (*GetUserSwapRecordsService) BaseAsset

SwapId set base asset

func (*GetUserSwapRecordsService) Do

Do sends the request.

func (*GetUserSwapRecordsService) EndTime

EndTime set end time when swaping

func (*GetUserSwapRecordsService) QuoteAsset

func (s *GetUserSwapRecordsService) QuoteAsset(quoteAsset string) *GetUserSwapRecordsService

QuoteAsset set quote asset

func (*GetUserSwapRecordsService) ResultSize

func (s *GetUserSwapRecordsService) ResultSize(resultSize int64) *GetUserSwapRecordsService

ResultSize set the size will be returned, max to 100

func (*GetUserSwapRecordsService) StartTime

StartTime set start time when swaping

func (*GetUserSwapRecordsService) Status

Status set status we are query for

func (*GetUserSwapRecordsService) SwapId

SwapId set swapId

type HistoricalTradesService

type HistoricalTradesService struct {
	// contains filtered or unexported fields
}

HistoricalTradesService trades

func (*HistoricalTradesService) Do

func (s *HistoricalTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*Trade, err error)

Do send request

func (*HistoricalTradesService) FromID

FromID set fromID

func (*HistoricalTradesService) Limit

Limit set limit

func (*HistoricalTradesService) Symbol

Symbol set symbol

type IcebergPartsFilter

type IcebergPartsFilter struct {
	Limit int `json:"limit"`
}

IcebergPartsFilter define iceberg part filter of symbol

type InterestHistory

type InterestHistory []InterestHistoryElement

InterestHistory represents a response from InterestHistoryService.

type InterestHistoryElement

type InterestHistoryElement struct {
	Asset       string      `json:"asset"`
	Interest    string      `json:"interest"`
	LendingType LendingType `json:"lendingType"`
	ProductName string      `json:"productName"`
	Time        int64       `json:"time"`
}

type InterestHistoryService

type InterestHistoryService struct {
	// contains filtered or unexported fields
}

InterestHistoryService fetches the interest history

func (*InterestHistoryService) Asset

Asset sets the asset parameter.

func (*InterestHistoryService) Current

Current sets the current parameter.

func (*InterestHistoryService) Do

Do sends the request.

func (*InterestHistoryService) EndTime

EndTime sets the endTime parameter. If present, StartTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*InterestHistoryService) LendingType

func (s *InterestHistoryService) LendingType(lendingType LendingType) *InterestHistoryService

LendingType sets the lendingType parameter.

func (*InterestHistoryService) Size

Size sets the size parameter.

func (*InterestHistoryService) StartTime

func (s *InterestHistoryService) StartTime(startTime int64) *InterestHistoryService

StartTime sets the startTime parameter. If present, EndTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-30 days.

type InternalUniversalTransfer

type InternalUniversalTransfer struct {
	TranId          int64  `json:"tranId"`
	ClientTranId    string `json:"clientTranId"`
	FromEmail       string `json:"fromEmail"`
	ToEmail         string `json:"toEmail"`
	Asset           string `json:"asset"`
	Amount          string `json:"amount"`
	FromAccountType string `json:"fromAccountType"`
	ToAccountType   string `json:"toAccountType"`
	Status          string `json:"status"`
	CreateTimeStamp uint64 `json:"createTimeStamp"`
}

type InternalUniversalTransferHistoryResponse

type InternalUniversalTransferHistoryResponse struct {
	Result     []*InternalUniversalTransfer `json:"result"`
	TotalCount int                          `json:"totalCount"`
}

type InternalUniversalTransferHistoryService

type InternalUniversalTransferHistoryService struct {
	// contains filtered or unexported fields
}

InternalUniversalTransferHistoryService Query Universal Transfer History (For Master Account) https://binance-docs.github.io/apidocs/spot/en/#query-universal-transfer-history-for-master-account

func (*InternalUniversalTransferHistoryService) ClientTranId

func (*InternalUniversalTransferHistoryService) Do

func (*InternalUniversalTransferHistoryService) EndTime

func (*InternalUniversalTransferHistoryService) FromEmail

func (*InternalUniversalTransferHistoryService) Limit

func (*InternalUniversalTransferHistoryService) Page

func (*InternalUniversalTransferHistoryService) StartTime

func (*InternalUniversalTransferHistoryService) ToEmail

type InternalUniversalTransferResponse

type InternalUniversalTransferResponse struct {
	ID           int64  `json:"tranId"`
	ClientTranID string `json:"clientTranId"`
}

type InternalUniversalTransferService

type InternalUniversalTransferService struct {
	// contains filtered or unexported fields
}

InternalUniversalTransferService Universal Transfer (For Master Account) https://binance-docs.github.io/apidocs/spot/en/#universal-transfer-for-master-account

func (*InternalUniversalTransferService) Amount

func (*InternalUniversalTransferService) Asset

func (*InternalUniversalTransferService) ClientTranId

func (*InternalUniversalTransferService) Do

func (*InternalUniversalTransferService) FromAccountType

func (*InternalUniversalTransferService) FromEmail

func (*InternalUniversalTransferService) Symbol

func (*InternalUniversalTransferService) ToAccountType

func (*InternalUniversalTransferService) ToEmail

type IsolatedMarginAccount

type IsolatedMarginAccount struct {
	TotalAssetOfBTC     string                `json:"totalAssetOfBtc"`
	TotalLiabilityOfBTC string                `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBTC  string                `json:"totalNetAssetOfBtc"`
	Assets              []IsolatedMarginAsset `json:"assets"`
}

IsolatedMarginAccount defines isolated user assets of margin account

type IsolatedMarginAllPair

type IsolatedMarginAllPair struct {
	Symbol        string `json:"symbol"`
	Base          string `json:"base"`
	Quote         string `json:"quote"`
	IsMarginTrade bool   `json:"isMarginTrade"`
	IsBuyAllowed  bool   `json:"isBuyAllowed"`
	IsSellAllowed bool   `json:"isSellAllowed"`
}

IsolatedMarginAllPair define isolated margin pair info

type IsolatedMarginAsset

type IsolatedMarginAsset struct {
	Symbol     string            `json:"symbol"`
	QuoteAsset IsolatedUserAsset `json:"quoteAsset"`
	BaseAsset  IsolatedUserAsset `json:"baseAsset"`

	IsolatedCreated   bool   `json:"isolatedCreated"`
	Enabled           bool   `json:"enabled"`
	MarginLevel       string `json:"marginLevel"`
	MarginLevelStatus string `json:"marginLevelStatus"`
	MarginRatio       string `json:"marginRatio"`
	IndexPrice        string `json:"indexPrice"`
	LiquidatePrice    string `json:"liquidatePrice"`
	LiquidateRate     string `json:"liquidateRate"`
	TradeEnabled      bool   `json:"tradeEnabled"`
}

IsolatedMarginAsset defines isolated margin asset information, like margin level, liquidation price... etc

type IsolatedMarginData

type IsolatedMarginData struct {
	VipLevel int64  `json:"vipLevel"`
	Symbol   string `json:"symbol"`
	Leverage string `json:"leverage"`
	Data     []struct {
		Coin          string `json:"coin"`
		DailyInterest string `json:"dailyInterest"`
		BorrowLimit   string `json:"borrowLimit"`
	} `json:"data"`
}

type IsolatedMarginDataService

type IsolatedMarginDataService struct {
	// contains filtered or unexported fields
}

func (*IsolatedMarginDataService) Do

Do send request

type IsolatedMarginTransferService

type IsolatedMarginTransferService struct {
	// contains filtered or unexported fields
}

IsolatedMarginTransferService transfer assets between spot and isolated margin.

func (*IsolatedMarginTransferService) Amount

func (*IsolatedMarginTransferService) Asset

func (*IsolatedMarginTransferService) Do

Do send request

func (*IsolatedMarginTransferService) Symbol

func (*IsolatedMarginTransferService) TransFrom

TransFrom supports account types: "SPOT", "ISOLATED_MARGIN"

func (*IsolatedMarginTransferService) TransTo

TransTo supports account types: "SPOT", "ISOLATED_MARGIN"

type IsolatedUserAsset

type IsolatedUserAsset struct {
	Asset         string `json:"asset"`
	Borrowed      string `json:"borrowed"`
	Free          string `json:"free"`
	Interest      string `json:"interest"`
	Locked        string `json:"locked"`
	NetAsset      string `json:"netAsset"`
	NetAssetOfBtc string `json:"netAssetOfBtc"`

	BorrowEnabled bool   `json:"borrowEnabled"`
	RepayEnabled  bool   `json:"repayEnabled"`
	TotalAsset    string `json:"totalAsset"`
}

IsolatedUserAsset defines isolated user assets of the margin account

type KeepaliveIsolatedMarginUserStreamService

type KeepaliveIsolatedMarginUserStreamService struct {
	// contains filtered or unexported fields
}

KeepaliveIsolatedMarginUserStreamService updates listen key for isolated margin user data stream

func (*KeepaliveIsolatedMarginUserStreamService) Do

Do send request

func (*KeepaliveIsolatedMarginUserStreamService) ListenKey

ListenKey set listen key

func (*KeepaliveIsolatedMarginUserStreamService) Symbol

Symbol set symbol to the isolated margin keepalive request

type KeepaliveMarginUserStreamService

type KeepaliveMarginUserStreamService struct {
	// contains filtered or unexported fields
}

KeepaliveMarginUserStreamService update listen key

func (*KeepaliveMarginUserStreamService) Do

Do send request

func (*KeepaliveMarginUserStreamService) ListenKey

ListenKey set listen key

type KeepaliveUserStreamService

type KeepaliveUserStreamService struct {
	// contains filtered or unexported fields
}

KeepaliveUserStreamService update listen key

func (*KeepaliveUserStreamService) Do

func (s *KeepaliveUserStreamService) Do(ctx context.Context, opts ...RequestOption) (err error)

Do send request

func (*KeepaliveUserStreamService) ListenKey

ListenKey set listen key

type Kline

type Kline struct {
	OpenTime                 int64  `json:"openTime"`
	Open                     string `json:"open"`
	High                     string `json:"high"`
	Low                      string `json:"low"`
	Close                    string `json:"close"`
	Volume                   string `json:"volume"`
	CloseTime                int64  `json:"closeTime"`
	QuoteAssetVolume         string `json:"quoteAssetVolume"`
	TradeNum                 int64  `json:"tradeNum"`
	TakerBuyBaseAssetVolume  string `json:"takerBuyBaseAssetVolume"`
	TakerBuyQuoteAssetVolume string `json:"takerBuyQuoteAssetVolume"`
}

Kline define kline info

type KlinesService

type KlinesService struct {
	// contains filtered or unexported fields
}

KlinesService list klines

func (*KlinesService) Do

func (s *KlinesService) Do(ctx context.Context, opts ...RequestOption) (res []*Kline, err error)

Do send request

func (*KlinesService) EndTime

func (s *KlinesService) EndTime(endTime int64) *KlinesService

EndTime set endTime

func (*KlinesService) Interval

func (s *KlinesService) Interval(interval string) *KlinesService

Interval set interval

func (*KlinesService) Limit

func (s *KlinesService) Limit(limit int) *KlinesService

Limit set limit

func (*KlinesService) StartTime

func (s *KlinesService) StartTime(startTime int64) *KlinesService

StartTime set startTime

func (*KlinesService) Symbol

func (s *KlinesService) Symbol(symbol string) *KlinesService

Symbol set symbol

type LendingType

type LendingType string

LendingType define the type of lending (flexible saving, activity, ...)

type LiquidityOperationType

type LiquidityOperationType string

LiquidityOperationType define the type of adding/removing liquidity to a liquidity pool(COMBINATION, SINGLE)

type LiquidityPool

type LiquidityPool struct {
	PoolId   int64    `json:"poolId"`
	PoolName string   `json:"poolName"`
	Assets   []string `json:"assets"`
}

type LiquidityPoolDetail

type LiquidityPoolDetail struct {
	PoolId     int64                 `json:"poolId"`
	PoolName   string                `json:"poolName"`
	UpdateTime int64                 `json:"updateTime"`
	Liquidity  map[string]string     `json:"liquidity"`
	Share      *PoolShareInformation `json:"share"`
}

type LiquidityRewardType

type LiquidityRewardType int

LiquidityRewardType define the type of reward we'd claim

type ListBookTickersService

type ListBookTickersService struct {
	// contains filtered or unexported fields
}

ListBookTickersService list best price/qty on the order book for a symbol or symbols

func (*ListBookTickersService) Do

func (s *ListBookTickersService) Do(ctx context.Context, opts ...RequestOption) (res []*BookTicker, err error)

Do send request

func (*ListBookTickersService) Symbol

Symbol set symbol

type ListDepositsService

type ListDepositsService struct {
	// contains filtered or unexported fields
}

ListDepositsService fetches deposit history.

See https://binance-docs.github.io/apidocs/spot/en/#deposit-history-user_data

func (*ListDepositsService) Coin

Coin sets the coin parameter.

func (*ListDepositsService) Do

func (s *ListDepositsService) Do(ctx context.Context) (res []*Deposit, err error)

Do sends the request.

func (*ListDepositsService) EndTime

func (s *ListDepositsService) EndTime(endTime int64) *ListDepositsService

EndTime sets the endTime parameter. If present, StartTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*ListDepositsService) Limit

func (s *ListDepositsService) Limit(limit int) *ListDepositsService

Limit set limit

func (*ListDepositsService) Offset

func (s *ListDepositsService) Offset(offset int) *ListDepositsService

Offset set offset

func (*ListDepositsService) StartTime

func (s *ListDepositsService) StartTime(startTime int64) *ListDepositsService

StartTime sets the startTime parameter. If present, EndTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*ListDepositsService) Status

func (s *ListDepositsService) Status(status int) *ListDepositsService

Status sets the status parameter.

func (*ListDepositsService) TxID

type ListDustDetail

type ListDustDetail struct {
	Asset            string `json:"asset"`
	AssetFullName    string `json:"assetFullName"`
	AmountFree       string `json:"amountFree"`
	ToBTC            string `json:"toBTC"`
	ToBNB            string `json:"toBNB"`
	ToBNBOffExchange string `json:"toBNBOffExchange"`
	Exchange         string `json:"exchange"`
}

type ListDustLogService

type ListDustLogService struct {
	// contains filtered or unexported fields
}

ListDustLogService fetch small amounts of assets exchanged versus BNB See https://binance-docs.github.io/apidocs/spot/en/#dustlog-user_data

func (*ListDustLogService) Do

func (s *ListDustLogService) Do(ctx context.Context) (withdraws *DustResult, err error)

Do sends the request.

func (*ListDustLogService) EndTime

func (s *ListDustLogService) EndTime(endTime int64) *ListDustLogService

EndTime sets the endTime parameter. If present, StartTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*ListDustLogService) StartTime

func (s *ListDustLogService) StartTime(startTime int64) *ListDustLogService

StartTime sets the startTime parameter. If present, EndTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

type ListDustResponse

type ListDustResponse struct {
	Details            []ListDustDetail `json:"details"`
	TotalTransferBtc   string           `json:"totalTransferBtc"`
	TotalTransferBNB   string           `json:"totalTransferBNB"`
	DribbletPercentage string           `json:"dribbletPercentage"`
}

type ListDustService

type ListDustService struct {
	// contains filtered or unexported fields
}

ListDustService get list of dust to BNB. See https://binance-docs.github.io/apidocs/spot/en/#get-assets-that-can-be-converted-into-bnb-user_data

func (*ListDustService) Do

func (s *ListDustService) Do(ctx context.Context) (res *ListDustResponse, err error)

Do sends the request.

type ListFuturesTransferService

type ListFuturesTransferService struct {
	// contains filtered or unexported fields
}

ListFuturesTransferService list futures transfer

func (*ListFuturesTransferService) Asset

Asset set asset

func (*ListFuturesTransferService) Current

Current currently querying page. Start from 1. Default:1

func (*ListFuturesTransferService) Do

Do send request

func (*ListFuturesTransferService) EndTime

EndTime set end time

func (*ListFuturesTransferService) Size

Size default:10 max:100

func (*ListFuturesTransferService) StartTime

StartTime set start time

type ListMarginLoansService

type ListMarginLoansService struct {
	// contains filtered or unexported fields
}

ListMarginLoansService list loan record

func (*ListMarginLoansService) Asset

Asset set asset

func (*ListMarginLoansService) Current

Current currently querying page. Start from 1. Default:1

func (*ListMarginLoansService) Do

Do send request

func (*ListMarginLoansService) EndTime

EndTime set end time

func (*ListMarginLoansService) Size

Size default:10 max:100

func (*ListMarginLoansService) StartTime

func (s *ListMarginLoansService) StartTime(startTime int64) *ListMarginLoansService

StartTime set start time

func (*ListMarginLoansService) TxID

TxID set transaction id

type ListMarginOpenOrdersService

type ListMarginOpenOrdersService struct {
	// contains filtered or unexported fields
}

ListMarginOpenOrdersService list margin open orders

func (*ListMarginOpenOrdersService) Do

func (s *ListMarginOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)

Do send request

func (*ListMarginOpenOrdersService) IsIsolated

IsIsolated set isIsolated

func (*ListMarginOpenOrdersService) Symbol

Symbol set symbol

type ListMarginOrdersService

type ListMarginOrdersService struct {
	// contains filtered or unexported fields
}

ListMarginOrdersService all account orders; active, canceled, or filled

func (*ListMarginOrdersService) Do

func (s *ListMarginOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)

Do send request

func (*ListMarginOrdersService) EndTime

EndTime set endtime

func (*ListMarginOrdersService) IsIsolated

func (s *ListMarginOrdersService) IsIsolated(isIsolated bool) *ListMarginOrdersService

IsIsolated set isIsolated

func (*ListMarginOrdersService) Limit

Limit set limit

func (*ListMarginOrdersService) OrderID

OrderID set orderID

func (*ListMarginOrdersService) StartTime

func (s *ListMarginOrdersService) StartTime(startTime int64) *ListMarginOrdersService

StartTime set starttime

func (*ListMarginOrdersService) Symbol

Symbol set symbol

type ListMarginRepaysService

type ListMarginRepaysService struct {
	// contains filtered or unexported fields
}

ListMarginRepaysService list repay record

func (*ListMarginRepaysService) Asset

Asset set asset

func (*ListMarginRepaysService) Current

Current currently querying page. Start from 1. Default:1

func (*ListMarginRepaysService) Do

Do send request

func (*ListMarginRepaysService) EndTime

EndTime set end time

func (*ListMarginRepaysService) Size

Size default:10 max:100

func (*ListMarginRepaysService) StartTime

func (s *ListMarginRepaysService) StartTime(startTime int64) *ListMarginRepaysService

StartTime set start time

func (*ListMarginRepaysService) TxID

TxID set transaction id

type ListMarginTradesService

type ListMarginTradesService struct {
	// contains filtered or unexported fields
}

ListMarginTradesService list trades

func (*ListMarginTradesService) Do

func (s *ListMarginTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*TradeV3, err error)

Do send request

func (*ListMarginTradesService) EndTime

EndTime set endtime

func (*ListMarginTradesService) FromID

FromID set fromID

func (*ListMarginTradesService) IsIsolated

func (s *ListMarginTradesService) IsIsolated(isIsolated bool) *ListMarginTradesService

IsIsolated set isIsolated

func (*ListMarginTradesService) Limit

Limit set limit

func (*ListMarginTradesService) StartTime

func (s *ListMarginTradesService) StartTime(startTime int64) *ListMarginTradesService

StartTime set starttime

func (*ListMarginTradesService) Symbol

Symbol set symbol

type ListOpenOcoService

type ListOpenOcoService struct {
	// contains filtered or unexported fields
}

ListOpenOcoService list opened oco

func (*ListOpenOcoService) Do

func (s *ListOpenOcoService) Do(ctx context.Context, opts ...RequestOption) (res []*Oco, err error)

Do send request

type ListOpenOrdersService

type ListOpenOrdersService struct {
	// contains filtered or unexported fields
}

ListOpenOrdersService list opened orders

func (*ListOpenOrdersService) Do

func (s *ListOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)

Do send request

func (*ListOpenOrdersService) Symbol

Symbol set symbol

type ListOrdersService

type ListOrdersService struct {
	// contains filtered or unexported fields
}

ListOrdersService all account orders; active, canceled, or filled

func (*ListOrdersService) Do

func (s *ListOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)

Do send request

func (*ListOrdersService) EndTime

func (s *ListOrdersService) EndTime(endTime int64) *ListOrdersService

EndTime set endtime

func (*ListOrdersService) Limit

func (s *ListOrdersService) Limit(limit int) *ListOrdersService

Limit set limit

func (*ListOrdersService) OrderID

func (s *ListOrdersService) OrderID(orderID int64) *ListOrdersService

OrderID set orderID

func (*ListOrdersService) StartTime

func (s *ListOrdersService) StartTime(startTime int64) *ListOrdersService

StartTime set starttime

func (*ListOrdersService) Symbol

func (s *ListOrdersService) Symbol(symbol string) *ListOrdersService

Symbol set symbol

type ListPriceChangeStatsService

type ListPriceChangeStatsService struct {
	// contains filtered or unexported fields
}

ListPriceChangeStatsService show stats of price change in last 24 hours for all symbols

func (*ListPriceChangeStatsService) Do

Do send request

func (*ListPriceChangeStatsService) Symbol

Symbol set symbol

func (*ListPriceChangeStatsService) Symbols

Symbols set symbols

type ListPricesService

type ListPricesService struct {
	// contains filtered or unexported fields
}

ListPricesService list latest price for a symbol or symbols

func (*ListPricesService) Do

func (s *ListPricesService) Do(ctx context.Context, opts ...RequestOption) (res []*SymbolPrice, err error)

Do send request

func (*ListPricesService) Symbol

func (s *ListPricesService) Symbol(symbol string) *ListPricesService

Symbol set symbol

func (*ListPricesService) Symbols

func (s *ListPricesService) Symbols(symbols []string) *ListPricesService

Symbols set symbols

type ListSavingsFixedAndActivityProductsService

type ListSavingsFixedAndActivityProductsService struct {
	// contains filtered or unexported fields
}

ListSavingsFixedAndActivityProductsService https://binance-docs.github.io/apidocs/spot/en/#get-fixed-and-activity-project-list-user_data

func (*ListSavingsFixedAndActivityProductsService) Asset

Asset desired asset

func (*ListSavingsFixedAndActivityProductsService) Current

Current Currently querying page. Start from 1. Default:1

func (*ListSavingsFixedAndActivityProductsService) Do

Do send request

func (*ListSavingsFixedAndActivityProductsService) IsSortAsc

IsSortAsc default "true"

func (*ListSavingsFixedAndActivityProductsService) Size

Size Default:10, Max:100

func (*ListSavingsFixedAndActivityProductsService) SortBy

SortBy ("START_TIME", "LOT_SIZE", "INTEREST_RATE", "DURATION") - default "START_TIME"

func (*ListSavingsFixedAndActivityProductsService) Status

Status ("ALL", "SUBSCRIBABLE", "UNSUBSCRIBABLE") - default "ALL"

func (*ListSavingsFixedAndActivityProductsService) Type

Type set project type ("ACTIVITY", "CUSTOMIZED_FIXED")

type ListSavingsFlexibleProductsService

type ListSavingsFlexibleProductsService struct {
	// contains filtered or unexported fields
}

ListSavingsFlexibleProductsService https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-list-user_data

func (*ListSavingsFlexibleProductsService) Current

Current query page. Default: 1, Min: 1

func (*ListSavingsFlexibleProductsService) Do

Do send request

func (*ListSavingsFlexibleProductsService) Featured

Featured ("ALL", "TRUE") - Default: "ALL"

func (*ListSavingsFlexibleProductsService) Size

Size Default: 50, Max: 100

func (*ListSavingsFlexibleProductsService) Status

Status represent the product status ("ALL", "SUBSCRIBABLE", "UNSUBSCRIBABLE") - Default: "ALL"

type ListSymbolTickerService

type ListSymbolTickerService struct {
	// contains filtered or unexported fields
}

func (*ListSymbolTickerService) Do

func (s *ListSymbolTickerService) Do(ctx context.Context, opts ...RequestOption) (res []*SymbolTicker, err error)

func (*ListSymbolTickerService) Symbol

func (*ListSymbolTickerService) Symbols

func (*ListSymbolTickerService) WindowSize

func (s *ListSymbolTickerService) WindowSize(windowSize string) *ListSymbolTickerService

Defaults to 1d if no parameter provided

Supported windowSize values:

- 1m,2m....59m for minutes

- 1h, 2h....23h - for hours

- 1d...7d - for days

Units cannot be combined (e.g. 1d2h is not allowed).

Reference: https://binance-docs.github.io/apidocs/spot/en/#rolling-window-price-change-statistics

type ListTradesService

type ListTradesService struct {
	// contains filtered or unexported fields
}

ListTradesService list trades

func (*ListTradesService) Do

func (s *ListTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*TradeV3, err error)

Do send request

func (*ListTradesService) EndTime

func (s *ListTradesService) EndTime(endTime int64) *ListTradesService

EndTime set endtime

func (*ListTradesService) FromID

func (s *ListTradesService) FromID(fromID int64) *ListTradesService

FromID set fromID

func (*ListTradesService) Limit

func (s *ListTradesService) Limit(limit int) *ListTradesService

Limit set limit

func (*ListTradesService) OrderId

func (s *ListTradesService) OrderId(OrderId int64) *ListTradesService

OrderId set OrderId

func (*ListTradesService) StartTime

func (s *ListTradesService) StartTime(startTime int64) *ListTradesService

StartTime set starttime

func (*ListTradesService) Symbol

func (s *ListTradesService) Symbol(symbol string) *ListTradesService

Symbol set symbol

type ListWithdrawsService

type ListWithdrawsService struct {
	// contains filtered or unexported fields
}

ListWithdrawsService fetches withdraw history.

See https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data

func (*ListWithdrawsService) Coin

Coin sets the coin parameter.

func (*ListWithdrawsService) Do

func (s *ListWithdrawsService) Do(ctx context.Context) (res []*Withdraw, err error)

Do sends the request.

func (*ListWithdrawsService) EndTime

func (s *ListWithdrawsService) EndTime(endTime int64) *ListWithdrawsService

EndTime sets the endTime parameter. If present, StartTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*ListWithdrawsService) Limit

Limit set limit

func (*ListWithdrawsService) Offset

func (s *ListWithdrawsService) Offset(offset int) *ListWithdrawsService

Offset set offset

func (*ListWithdrawsService) StartTime

func (s *ListWithdrawsService) StartTime(startTime int64) *ListWithdrawsService

StartTime sets the startTime parameter. If present, EndTime MUST be specified. The difference between EndTime - StartTime MUST be between 0-90 days.

func (*ListWithdrawsService) Status

func (s *ListWithdrawsService) Status(status int) *ListWithdrawsService

Status sets the status parameter.

func (*ListWithdrawsService) WithdrawOrderId

func (s *ListWithdrawsService) WithdrawOrderId(withdrawOrderId string) *ListWithdrawsService

WithdrawOrderId sets the withdrawOrderId parameter.

type LockedProductPosition added in v2.0.1

type LockedProductPosition struct {
	PositionID   string `json:"positionId,omitempty"`
	ProjectID    string `json:"projectId,omitempty"`
	Asset        string `json:"asset,omitempty"`
	Amount       string `json:"amount,omitempty"`
	PurchaseTime string `json:"purchaseTime,omitempty"`
	Duration     string `json:"duration,omitempty"`
	AccrualDays  string `json:"accrualDays,omitempty"`
	RewardAsset  string `json:"rewardAsset,omitempty"`
	Apy          string `json:"APY,omitempty"`
	IsRenewable  bool   `json:"isRenewable,omitempty"`
	IsAutoRenew  bool   `json:"isAutoRenew,omitempty"`
	RedeemDate   string `json:"redeemDate,omitempty"`
}

type LotSizeFilter

type LotSizeFilter struct {
	MaxQuantity string `json:"maxQty"`
	MinQuantity string `json:"minQty"`
	StepSize    string `json:"stepSize"`
}

LotSizeFilter define lot size filter of symbol

type ManagedSubAccountAsset

type ManagedSubAccountAsset struct {
	Coin             string `json:"coin"`
	Name             string `json:"name"`
	TotalBalance     string `json:"totalBalance"`
	AvailableBalance string `json:"availableBalance"`
	InOrder          string `json:"inOrder"`
	BtcValue         string `json:"btcValue"`
}

type ManagedSubAccountAssetsService

type ManagedSubAccountAssetsService struct {
	// contains filtered or unexported fields
}

ManagedSubAccountAssetsService Query Managed Sub-account Asset Details(For Investor Master Account) https://binance-docs.github.io/apidocs/spot/en/#query-managed-sub-account-asset-details-for-investor-master-account

func (*ManagedSubAccountAssetsService) Do

func (*ManagedSubAccountAssetsService) Email

type ManagedSubAccountDepositResponse

type ManagedSubAccountDepositResponse struct {
	ID int64 `json:"tranId"`
}

type ManagedSubAccountDepositService

type ManagedSubAccountDepositService struct {
	// contains filtered or unexported fields
}

ManagedSubAccountDepositService Deposit Assets Into The Managed Sub-account(For Investor Master Account) https://binance-docs.github.io/apidocs/spot/en/#deposit-assets-into-the-managed-sub-account-for-investor-master-account

func (*ManagedSubAccountDepositService) Amount

func (*ManagedSubAccountDepositService) Asset

func (*ManagedSubAccountDepositService) Do

Do send request

func (*ManagedSubAccountDepositService) ToEmail

type ManagedSubAccountWithdrawalResponse

type ManagedSubAccountWithdrawalResponse struct {
	ID int64 `json:"tranId"`
}

type ManagedSubAccountWithdrawalService

type ManagedSubAccountWithdrawalService struct {
	// contains filtered or unexported fields
}

ManagedSubAccountWithdrawalService Withdrawal Assets From The Managed Sub-account(For Investor Master Account) https://binance-docs.github.io/apidocs/spot/en/#withdrawl-assets-from-the-managed-sub-account-for-investor-master-account

func (*ManagedSubAccountWithdrawalService) Amount

func (*ManagedSubAccountWithdrawalService) Asset

func (*ManagedSubAccountWithdrawalService) Do

Do send request

func (*ManagedSubAccountWithdrawalService) FromEmail

func (*ManagedSubAccountWithdrawalService) TransferDate

type MarginAccount

type MarginAccount struct {
	BorrowEnabled       bool        `json:"borrowEnabled"`
	MarginLevel         string      `json:"marginLevel"`
	TotalAssetOfBTC     string      `json:"totalAssetOfBtc"`
	TotalLiabilityOfBTC string      `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBTC  string      `json:"totalNetAssetOfBtc"`
	TradeEnabled        bool        `json:"tradeEnabled"`
	TransferEnabled     bool        `json:"transferEnabled"`
	UserAssets          []UserAsset `json:"userAssets"`
}

MarginAccount define margin account info

type MarginAllPair

type MarginAllPair struct {
	ID            int64  `json:"id"`
	Symbol        string `json:"symbol"`
	Base          string `json:"base"`
	Quote         string `json:"quote"`
	IsMarginTrade bool   `json:"isMarginTrade"`
	IsBuyAllowed  bool   `json:"isBuyAllowed"`
	IsSellAllowed bool   `json:"isSellAllowed"`
}

MarginAllPair define margin pair info

type MarginAsset

type MarginAsset struct {
	FullName      string `json:"assetFullName"`
	Name          string `json:"assetName"`
	Borrowable    bool   `json:"isBorrowable"`
	Mortgageable  bool   `json:"isMortgageable"`
	UserMinBorrow string `json:"userMinBorrow"`
	UserMinRepay  string `json:"userMinRepay"`
}

MarginAsset define margin asset info

type MarginLoan

type MarginLoan struct {
	Asset     string               `json:"asset"`
	Principal string               `json:"principal"`
	Timestamp int64                `json:"timestamp"`
	Status    MarginLoanStatusType `json:"status"`
}

MarginLoan define margin loan

type MarginLoanResponse

type MarginLoanResponse struct {
	Rows  []MarginLoan `json:"rows"`
	Total int64        `json:"total"`
}

MarginLoanResponse define margin loan response

type MarginLoanService

type MarginLoanService struct {
	// contains filtered or unexported fields
}

MarginLoanService apply for a loan

func (*MarginLoanService) Amount

func (s *MarginLoanService) Amount(amount string) *MarginLoanService

Amount the amount to be transferred

func (*MarginLoanService) Asset

func (s *MarginLoanService) Asset(asset string) *MarginLoanService

Asset set asset being transferred, e.g., BTC

func (*MarginLoanService) Do

func (s *MarginLoanService) Do(ctx context.Context, opts ...RequestOption) (res *TransactionResponse, err error)

Do send request

func (*MarginLoanService) IsIsolated

func (s *MarginLoanService) IsIsolated(isIsolated bool) *MarginLoanService

IsIsolated is for isolated margin or not, "TRUE", "FALSE",default "FALSE"

func (*MarginLoanService) Symbol

func (s *MarginLoanService) Symbol(symbol string) *MarginLoanService

Symbol set isolated symbol

type MarginLoanStatusType

type MarginLoanStatusType string

MarginLoanStatusType define margin loan status type

type MarginOCOOrder

type MarginOCOOrder struct {
	Symbol        string `json:"symbol"`
	OrderID       int64  `json:"orderId"`
	ClientOrderID string `json:"clientOrderId"`
}

MarginOCOOrder may be returned in an array of MarginOCOOrder in a CreateMarginOCOResponse

type MarginOCOOrderReport

type MarginOCOOrderReport struct {
	Symbol                   string          `json:"symbol"`
	OrderID                  int64           `json:"orderId"`
	OrderListID              int64           `json:"orderListId"`
	ClientOrderID            string          `json:"clientOrderId"`
	TransactionTime          int64           `json:"transactionTime"`
	Price                    string          `json:"price"`
	OrigQuantity             string          `json:"origQty"`
	ExecutedQuantity         string          `json:"executedQty"`
	CummulativeQuoteQuantity string          `json:"cummulativeQuoteQty"`
	Status                   OrderStatusType `json:"status"`
	TimeInForce              TimeInForceType `json:"timeInForce"`
	Type                     OrderType       `json:"type"`
	Side                     SideType        `json:"side"`
	StopPrice                string          `json:"stopPrice"`
}

MarginOCOOrderReport may be returned in an array of MarginOCOOrderReport in a CreateMarginOCOResponse

type MarginPair

type MarginPair struct {
	ID            int64  `json:"id"`
	Symbol        string `json:"symbol"`
	Base          string `json:"base"`
	Quote         string `json:"quote"`
	IsMarginTrade bool   `json:"isMarginTrade"`
	IsBuyAllowed  bool   `json:"isBuyAllowed"`
	IsSellAllowed bool   `json:"isSellAllowed"`
}

MarginPair define margin pair info

type MarginPriceIndex

type MarginPriceIndex struct {
	CalcTime int64  `json:"calcTime"`
	Price    string `json:"price"`
	Symbol   string `json:"symbol"`
}

MarginPriceIndex define margin price index

type MarginRepay

type MarginRepay struct {
	Asset     string                `json:"asset"`
	Amount    string                `json:"amount"`
	Interest  string                `json:"interest"`
	Principal string                `json:"principal"`
	Timestamp int64                 `json:"timestamp"`
	Status    MarginRepayStatusType `json:"status"`
	TxID      int64                 `json:"txId"`
}

MarginRepay define margin repay

type MarginRepayResponse

type MarginRepayResponse struct {
	Rows  []MarginRepay `json:"rows"`
	Total int64         `json:"total"`
}

MarginRepayResponse define margin repay response

type MarginRepayService

type MarginRepayService struct {
	// contains filtered or unexported fields
}

MarginRepayService repay loan for margin account

func (*MarginRepayService) Amount

func (s *MarginRepayService) Amount(amount string) *MarginRepayService

Amount the amount to be transferred

func (*MarginRepayService) Asset

func (s *MarginRepayService) Asset(asset string) *MarginRepayService

Asset set asset being transferred, e.g., BTC

func (*MarginRepayService) Do

func (s *MarginRepayService) Do(ctx context.Context, opts ...RequestOption) (res *TransactionResponse, err error)

Do send request

func (*MarginRepayService) IsIsolated

func (s *MarginRepayService) IsIsolated(isIsolated bool) *MarginRepayService

IsIsolated is for isolated margin or not, "TRUE", "FALSE",default "FALSE"

func (*MarginRepayService) Symbol

func (s *MarginRepayService) Symbol(symbol string) *MarginRepayService

Symbol set isolated symbol

type MarginRepayStatusType

type MarginRepayStatusType string

MarginRepayStatusType define margin repay status type

type MarginTransferService

type MarginTransferService struct {
	// contains filtered or unexported fields
}

MarginTransferService transfer between spot account and margin account

func (*MarginTransferService) Amount

Amount the amount to be transferred

func (*MarginTransferService) Asset

Asset set asset being transferred, e.g., BTC

func (*MarginTransferService) Do

Do send request

func (*MarginTransferService) Type

Type 1: transfer from main account to margin account 2: transfer from margin account to main account

type MarginTransferType

type MarginTransferType int

MarginTransferType define margin transfer type

type MarketLotSizeFilter

type MarketLotSizeFilter struct {
	MaxQuantity string `json:"maxQty"`
	MinQuantity string `json:"minQty"`
	StepSize    string `json:"stepSize"`
}

MarketLotSizeFilter define market lot size filter of symbol

type MaxBorrowable

type MaxBorrowable struct {
	Amount string `json:"amount"`
}

MaxBorrowable define max borrowable response

type MaxNumAlgoOrdersFilter

type MaxNumAlgoOrdersFilter struct {
	MaxNumAlgoOrders int `json:"maxNumAlgoOrders"`
}

MaxNumAlgoOrdersFilter define max num algo orders filter of symbol

type MaxNumOrdersFilter added in v2.0.1

type MaxNumOrdersFilter struct {
	MaxNumOrders int `json:"maxNumOrders"`
}

The "Algo" order is STOP_ LOSS, STOP_ LOS_ LIMITED, TAKE_ PROFIT and TAKE_ PROFIT_ Limit Stop Loss Order. Therefore, orders other than the above types are non conditional(Algo) orders, and MaxNumOrders defines the maximum number of orders placed for these types of orders

type MaxTransferable

type MaxTransferable struct {
	Amount string `json:"amount"`
}

MaxTransferable define max transferable response

type Network

type Network struct {
	AddressRegex            string `json:"addressRegex"`
	Coin                    string `json:"coin"`
	DepositDesc             string `json:"depositDesc,omitempty"` // 仅在充值关闭时返回
	DepositEnable           bool   `json:"depositEnable"`
	IsDefault               bool   `json:"isDefault"`
	MemoRegex               string `json:"memoRegex"`
	MinConfirm              int    `json:"minConfirm"` // 上账所需的最小确认数
	Name                    string `json:"name"`
	Network                 string `json:"network"`
	ResetAddressStatus      bool   `json:"resetAddressStatus"`
	SpecialTips             string `json:"specialTips"`
	UnLockConfirm           int    `json:"unLockConfirm"`          // 解锁需要的确认数
	WithdrawDesc            string `json:"withdrawDesc,omitempty"` // 仅在提现关闭时返回
	WithdrawEnable          bool   `json:"withdrawEnable"`
	WithdrawFee             string `json:"withdrawFee"`
	WithdrawIntegerMultiple string `json:"withdrawIntegerMultiple"`
	WithdrawMax             string `json:"withdrawMax"`
	WithdrawMin             string `json:"withdrawMin"`
	SameAddress             bool   `json:"sameAddress"` // 是否需要memo
	ContractAddress         string `json:"contractAddress"`
}

type NewOrderRespType

type NewOrderRespType string

NewOrderRespType define response JSON verbosity

type NotionalFilter

type NotionalFilter struct {
	MinNotional      string `json:"minNotional"`
	ApplyMinToMarket bool   `json:"applyMinToMarket"`
	MaxNotional      string `json:"maxNotional"`
	ApplyMaxToMarket bool   `json:"applyMaxToMarket"`
	AvgPriceMins     int    `json:"avgPriceMins"`
}

NotionalFilter define notional filter of symbol

type OCOOrder

type OCOOrder struct {
	Symbol        string `json:"symbol"`
	OrderID       int64  `json:"orderId"`
	ClientOrderID string `json:"clientOrderId"`
}

OCOOrder may be returned in an array of OCOOrder in a CreateOCOResponse.

type OCOOrderReport

type OCOOrderReport struct {
	Symbol                   string          `json:"symbol"`
	OrderID                  int64           `json:"orderId"`
	OrderListID              int64           `json:"orderListId"`
	ClientOrderID            string          `json:"clientOrderId"`
	OrigClientOrderID        string          `json:"origClientOrderId"`
	TransactionTime          int64           `json:"transactionTime"`
	Price                    string          `json:"price"`
	OrigQuantity             string          `json:"origQty"`
	ExecutedQuantity         string          `json:"executedQty"`
	CummulativeQuoteQuantity string          `json:"cummulativeQuoteQty"`
	Status                   OrderStatusType `json:"status"`
	TimeInForce              TimeInForceType `json:"timeInForce"`
	Type                     OrderType       `json:"type"`
	Side                     SideType        `json:"side"`
	StopPrice                string          `json:"stopPrice"`
	IcebergQuantity          string          `json:"icebergQty"`
}

OCOOrderReport may be returned in an array of OCOOrderReport in a CreateOCOResponse.

type Oco

type Oco struct {
	Symbol            string   `json:"symbol"`
	OrderListId       int64    `json:"orderListId"`
	ContingencyType   string   `json:"contingencyType"`
	ListStatusType    string   `json:"listStatusType"`
	ListOrderStatus   string   `json:"listOrderStatus"`
	ListClientOrderID string   `json:"listClientOrderId"`
	TransactionTime   int64    `json:"transactionTime"`
	Orders            []*Order `json:"orders"`
}

oco define oco info

type Order

type Order struct {
	Symbol                   string          `json:"symbol"`
	OrderID                  int64           `json:"orderId"`
	OrderListId              int64           `json:"orderListId"`
	ClientOrderID            string          `json:"clientOrderId"`
	Price                    string          `json:"price"`
	OrigQuantity             string          `json:"origQty"`
	ExecutedQuantity         string          `json:"executedQty"`
	CummulativeQuoteQuantity string          `json:"cummulativeQuoteQty"`
	Status                   OrderStatusType `json:"status"`
	TimeInForce              TimeInForceType `json:"timeInForce"`
	Type                     OrderType       `json:"type"`
	Side                     SideType        `json:"side"`
	StopPrice                string          `json:"stopPrice"`
	IcebergQuantity          string          `json:"icebergQty"`
	Time                     int64           `json:"time"`
	UpdateTime               int64           `json:"updateTime"`
	IsWorking                bool            `json:"isWorking"`
	IsIsolated               bool            `json:"isIsolated"`
	OrigQuoteOrderQuantity   string          `json:"origQuoteOrderQty"`
}

Order define order info

type OrderStatusType

type OrderStatusType string

OrderStatusType define order status type

type OrderType

type OrderType string

OrderType define order type

type PayTradeHistory

type PayTradeHistory struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Data    []PayTradeItem `json:"data"`
	Success bool           `json:"success"`
}

type PayTradeHistoryService

type PayTradeHistoryService struct {
	// contains filtered or unexported fields
}

PayTransactionService retrieve the fiat deposit/withdraw history

func (*PayTradeHistoryService) Do

Do send request

func (*PayTradeHistoryService) EndTimestamp

func (s *PayTradeHistoryService) EndTimestamp(endTimestamp int64) *PayTradeHistoryService

EndTimestamp set endTimestamp

func (*PayTradeHistoryService) Limit

Rows set rows

func (*PayTradeHistoryService) StartTimestamp

func (s *PayTradeHistoryService) StartTimestamp(startTimestamp int64) *PayTradeHistoryService

StartTimestamp set startTimestamp

type PayTradeItem

type PayTradeItem struct {
	OrderType       string        `json:"orderType"`
	TransactionID   string        `json:"transactionId"`
	TransactionTime int64         `json:"transactionTime"`
	Amount          string        `json:"amount"`
	Currency        string        `json:"currency"`
	PayerInfo       *PayerInfo    `json:"payerInfo"`
	ReceiverInfo    *ReceiverInfo `json:"receiverInfo"`
	FundsDetail     []FundsDetail `json:"fundsDetail"`
}

type PayerInfo

type PayerInfo struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Email       string `json:"email"`
	BinanceId   int    `json:"binanceId"`
	AccountId   int    `json:"accountId"`
	CountryCode int    `json:"countryCode"`
	PhoneNumber string `json:"phoneNumber"`
	MobileCode  string `json:"mobileCode"`
	UnmaskData  bool   `json:"unmaskData"`
}

type PercentPriceBySideFilter added in v2.0.1

type PercentPriceBySideFilter struct {
	AveragePriceMins  int    `json:"avgPriceMins"`
	BidMultiplierUp   string `json:"bidMultiplierUp"`
	BidMultiplierDown string `json:"bidMultiplierDown"`
	AskMultiplierUp   string `json:"askMultiplierUp"`
	AskMultiplierDown string `json:"askMultiplierDown"`
}

PERCENT_PRICE_BY_SIDE define percent price filter of symbol by side

type PingService

type PingService struct {
	// contains filtered or unexported fields
}

PingService ping server

func (*PingService) Do

func (s *PingService) Do(ctx context.Context, opts ...RequestOption) (err error)

Do send request

type PoolShareInformation

type PoolShareInformation struct {
	ShareAmount     string            `json:"shareAmount"`
	SharePercentage string            `json:"sharePercentage"`
	Assets          map[string]string `json:"asset"`
}

type PriceChangeStats

type PriceChangeStats struct {
	Symbol             string `json:"symbol"`
	PriceChange        string `json:"priceChange"`
	PriceChangePercent string `json:"priceChangePercent"`
	WeightedAvgPrice   string `json:"weightedAvgPrice"`
	PrevClosePrice     string `json:"prevClosePrice"`
	LastPrice          string `json:"lastPrice"`
	LastQty            string `json:"lastQty"`
	BidPrice           string `json:"bidPrice"`
	BidQty             string `json:"bidQty"`
	AskPrice           string `json:"askPrice"`
	AskQty             string `json:"askQty"`
	OpenPrice          string `json:"openPrice"`
	HighPrice          string `json:"highPrice"`
	LowPrice           string `json:"lowPrice"`
	Volume             string `json:"volume"`
	QuoteVolume        string `json:"quoteVolume"`
	OpenTime           int64  `json:"openTime"`
	CloseTime          int64  `json:"closeTime"`
	FirstID            int64  `json:"firstId"`
	LastID             int64  `json:"lastId"`
	Count              int64  `json:"count"`
}

PriceChangeStats define price change stats

type PriceFilter

type PriceFilter struct {
	MaxPrice string `json:"maxPrice"`
	MinPrice string `json:"minPrice"`
	TickSize string `json:"tickSize"`
}

PriceFilter define price filter of symbol

type PurchaseSavingsFlexibleProductResponse

type PurchaseSavingsFlexibleProductResponse struct {
	PurchaseId uint64 `json:"purchaseId"`
}

type PurchaseSavingsFlexibleProductService

type PurchaseSavingsFlexibleProductService struct {
	// contains filtered or unexported fields
}

PurchaseSavingsFlexibleProductService https://binance-docs.github.io/apidocs/spot/en/#purchase-flexible-product-user_data

func (*PurchaseSavingsFlexibleProductService) Amount

Amount is the quantity of the product to purchase

func (*PurchaseSavingsFlexibleProductService) Do

Do send request

func (*PurchaseSavingsFlexibleProductService) ProductId

ProductId represent the id of the flexible product to purchase

type QueryClaimedRewardHistoryService

type QueryClaimedRewardHistoryService struct {
	// contains filtered or unexported fields
}

QueryClaimedRewardHistoryService to query history of user claimed reward

func (*QueryClaimedRewardHistoryService) AssetRewards

AssetRewards set expected rewarded asset name

func (*QueryClaimedRewardHistoryService) Do

Do sends the request.

func (*QueryClaimedRewardHistoryService) EndTime

EndTime set end time when reward

func (*QueryClaimedRewardHistoryService) PoolId

PoolId set pool id

func (*QueryClaimedRewardHistoryService) ResultSize

ResultSize set the size will be returned, max to 100

func (*QueryClaimedRewardHistoryService) RewardType

RewardType set rewardType

func (*QueryClaimedRewardHistoryService) StartTime

StartTime set start time when reward

type RateLimit

type RateLimit struct {
	RateLimitType string `json:"rateLimitType"`
	Interval      string `json:"interval"`
	IntervalNum   int64  `json:"intervalNum"`
	Limit         int64  `json:"limit"`
}

RateLimit struct

type RateLimitFull

type RateLimitFull struct {
	RateLimitType RateLimitType     `json:"rateLimitType"`
	Interval      RateLimitInterval `json:"interval"`
	IntervalNum   int               `json:"intervalNum"`
	Limit         int               `json:"limit"`
	Count         int               `json:"count"`
}

type RateLimitInterval

type RateLimitInterval string

RateLimitInterval define the rate limitation intervals

type RateLimitService

type RateLimitService struct {
	// contains filtered or unexported fields
}

RateLimitService get rate limits

func (*RateLimitService) Do

func (s *RateLimitService) Do(ctx context.Context, opts ...RequestOption) (res []*RateLimitFull, err error)

Do send request

type RateLimitType

type RateLimitType string

RateLimitType define the rate limitation types see https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#enum-definitions

type ReceiverInfo

type ReceiverInfo struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Email       string `json:"email,omitempty"`
	BinanceId   int    `json:"binanceId,omitempty"`
	AccountId   int    `json:"accountId"`
	CountryCode int    `json:"countryCode,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
	MobileCode  string `json:"mobileCode,omitempty"`
	UnmaskData  bool   `json:"unmaskData"`
	Extend      struct {
		PhoneOrEmailChanged bool `json:"phoneOrEmailChanged"`
	} `json:"extend,omitempty"`
}

type RecentTradesService

type RecentTradesService struct {
	// contains filtered or unexported fields
}

RecentTradesService list recent trades

func (*RecentTradesService) Do

func (s *RecentTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*Trade, err error)

Do send request

func (*RecentTradesService) Limit

func (s *RecentTradesService) Limit(limit int) *RecentTradesService

Limit set limit

func (*RecentTradesService) Symbol

func (s *RecentTradesService) Symbol(symbol string) *RecentTradesService

Symbol set symbol

type RedeemSavingsFlexibleProductService

type RedeemSavingsFlexibleProductService struct {
	// contains filtered or unexported fields
}

RedeemSavingsFlexibleProductService https://binance-docs.github.io/apidocs/spot/en/#redeem-flexible-product-user_data

func (*RedeemSavingsFlexibleProductService) Amount

Amount is the quantity of the product to redeem

func (*RedeemSavingsFlexibleProductService) Do

Do send request

func (*RedeemSavingsFlexibleProductService) ProductId

ProductId represent the id of the flexible product to redeem

func (*RedeemSavingsFlexibleProductService) Type

Type ("FAST", "NORMAL")

type RemoveLiquidityResponse

type RemoveLiquidityResponse struct {
	OperationId int64 `json:"operationId"`
}

type RemoveLiquidityService

type RemoveLiquidityService struct {
	// contains filtered or unexported fields
}

RemoveLiquidityService to remove liquidity

func (*RemoveLiquidityService) AddAesst

QuoteQty set quoteQty

func (*RemoveLiquidityService) Do

Do sends the request.

func (*RemoveLiquidityService) OperationType

func (s *RemoveLiquidityService) OperationType(operationType LiquidityOperationType) *RemoveLiquidityService

OperationType set operationType

func (*RemoveLiquidityService) PoolId

PoolId set poolId

func (*RemoveLiquidityService) ShareAmount

ShareAmount set shareAmount

type RequestOption

type RequestOption func(*request)

RequestOption define option type for request

func WithHeader

func WithHeader(key, value string, replace bool) RequestOption

WithHeader set or add a header value to the request

func WithHeaders

func WithHeaders(header http.Header) RequestOption

WithHeaders set or replace the headers of the request

func WithRecvWindow

func WithRecvWindow(recvWindow int64) RequestOption

WithRecvWindow set recvWindow param for the request

type RewardClaimStatus

type RewardClaimStatus int

RewardClaimStatus define the status of claiming a reward

type SavingFixedProjectPosition

type SavingFixedProjectPosition struct {
	Asset           string `json:"asset"`
	CanTransfer     bool   `json:"canTransfer"`
	CreateTimestamp int64  `json:"createTimestamp"`
	Duration        int64  `json:"duration"`
	StartTime       int64  `json:"startTime"`
	EndTime         int64  `json:"endTime"`
	PurchaseTime    int64  `json:"purchaseTime"`
	RedeemDate      string `json:"redeemDate"`
	Interest        string `json:"interest"`
	InterestRate    string `json:"interestRate"`
	Lot             int32  `json:"lot"`
	PositionId      int64  `json:"positionId"`
	Principal       string `json:"principal"`
	ProjectId       string `json:"projectId"`
	ProjectName     string `json:"projectName"`
	Status          string `json:"status"`
	ProjectType     string `json:"type"`
}

SavingFixedProjectPosition represents a saving flexible product position.

type SavingFixedProjectPositionsService

type SavingFixedProjectPositionsService struct {
	// contains filtered or unexported fields
}

SavingFixedProjectPositionsService fetches the saving flexible product positions

func (*SavingFixedProjectPositionsService) Asset

Asset sets the asset parameter.

func (*SavingFixedProjectPositionsService) Do

Do send request

func (*SavingFixedProjectPositionsService) ProjectID

Project ID of the fixed project/activity

func (*SavingFixedProjectPositionsService) Status

Status ("HOLDING", "REDEEMED"), default will fetch all

type SavingFlexibleProductPosition

type SavingFlexibleProductPosition struct {
	Asset                 string `json:"asset"`
	ProductId             string `json:"productId"`
	ProductName           string `json:"productName"`
	AvgAnnualInterestRate string `json:"avgAnnualInterestRate"`
	AnnualInterestRate    string `json:"annualInterestRate"`
	DailyInterestRate     string `json:"dailyInterestRate"`
	TotalInterest         string `json:"totalInterest"`
	TotalAmount           string `json:"totalAmount"`
	TotalPurchasedAmount  string `json:"todayPurchasedAmount"`
	RedeemingAmount       string `json:"redeemingAmount"`
	FreeAmount            string `json:"freeAmount"`
	FreezeAmount          string `json:"freezeAmount,omitempty"`
	LockedAmount          string `json:"lockedAmount,omitempty"`
	CanRedeem             bool   `json:"canRedeem"`
}

SavingFlexibleProductPosition represents a saving flexible product position.

type SavingFlexibleProductPositionsService

type SavingFlexibleProductPositionsService struct {
	// contains filtered or unexported fields
}

SavingFlexibleProductPositionsService fetches the saving flexible product positions

func (*SavingFlexibleProductPositionsService) Asset

Asset sets the asset parameter.

func (*SavingFlexibleProductPositionsService) Do

Do send request

type SavingsFixedProduct

type SavingsFixedProduct struct {
	Asset              string `json:"asset"`
	DisplayPriority    int    `json:"displayPriority"`
	Duration           int    `json:"duration"`
	InterestPerLot     string `json:"interestPerLot"`
	InterestRate       string `json:"interestRate"`
	LotSize            string `json:"lotSize"`
	LotsLowLimit       int    `json:"lotsLowLimit"`
	LotsPurchased      int    `json:"lotsPurchased"`
	LotsUpLimit        int    `json:"lotsUpLimit"`
	MaxLotsPerUser     int    `json:"maxLotsPerUser"`
	NeedKyc            bool   `json:"needKyc"`
	ProjectId          string `json:"projectId"`
	ProjectName        string `json:"projectName"`
	Status             string `json:"status"`
	Type               string `json:"type"`
	WithAreaLimitation bool   `json:"withAreaLimitation"`
}

SavingsFixedProduct define a fixed product (Savings)

type SavingsFlexibleProduct

type SavingsFlexibleProduct struct {
	Asset                    string `json:"asset"`
	AvgAnnualInterestRate    string `json:"avgAnnualInterestRate"`
	CanPurchase              bool   `json:"canPurchase"`
	CanRedeem                bool   `json:"canRedeem"`
	DailyInterestPerThousand string `json:"dailyInterestPerThousand"`
	Featured                 bool   `json:"featured"`
	MinPurchaseAmount        string `json:"minPurchaseAmount"`
	ProductId                string `json:"productId"`
	PurchasedAmount          string `json:"purchasedAmount"`
	Status                   string `json:"status"`
	UpLimit                  string `json:"upLimit"`
	UpLimitPerUser           string `json:"upLimitPerUser"`
}

SavingsFlexibleProduct define a flexible product (Savings)

type ServerTimeService

type ServerTimeService struct {
	// contains filtered or unexported fields
}

ServerTimeService get server time

func (*ServerTimeService) Do

func (s *ServerTimeService) Do(ctx context.Context, opts ...RequestOption) (serverTime int64, err error)

Do send request

type SetServerTimeService

type SetServerTimeService struct {
	// contains filtered or unexported fields
}

SetServerTimeService set server time

func (*SetServerTimeService) Do

func (s *SetServerTimeService) Do(ctx context.Context, opts ...RequestOption) (timeOffset int64, err error)

Do send request

type SideEffectType

type SideEffectType string

SideEffectType define side effect type for orders

type SideType

type SideType string

SideType define side type of order

type SimpleEarnService

type SimpleEarnService struct {
	// contains filtered or unexported fields
}

https://binance-docs.github.io/apidocs/spot/en/#lending-account-user_data

func (*SimpleEarnService) Asset

func (s *SimpleEarnService) Asset(asset string) *SimpleEarnService

func (*SimpleEarnService) Current

func (s *SimpleEarnService) Current(current int64) *SimpleEarnService

func (*SimpleEarnService) Do

func (s *SimpleEarnService) Do(ctx context.Context, dataType DataType) (res []*EarnHistory, err error)

func (*SimpleEarnService) EndTime

func (s *SimpleEarnService) EndTime(endTime int64) *SimpleEarnService

func (*SimpleEarnService) LendingType

func (s *SimpleEarnService) LendingType(lendingType string) *SimpleEarnService

func (*SimpleEarnService) Size

func (s *SimpleEarnService) Size(size int64) *SimpleEarnService

func (*SimpleEarnService) StartTime

func (s *SimpleEarnService) StartTime(startTime int64) *SimpleEarnService

type Snapshot

type Snapshot struct {
	Code     int            `json:"code"`
	Msg      string         `json:"msg"`
	Snapshot []*SnapshotVos `json:"snapshotVos"`
}

Snapshot define snapshot

type SnapshotAssets

type SnapshotAssets struct {
	Asset         string `json:"asset"`
	MarginBalance string `json:"marginBalance"`
	WalletBalance string `json:"walletBalance"`
}

SnapshotAssets define snapshot assets

type SnapshotBalances

type SnapshotBalances struct {
	Asset  string `json:"asset"`
	Free   string `json:"free"`
	Locked string `json:"locked"`
}

SnapshotBalances define snapshot balances

type SnapshotData

type SnapshotData struct {
	MarginLevel         string `json:"marginLevel"`
	TotalAssetOfBtc     string `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string `json:"totalNetAssetOfBtc"`

	Balances   []*SnapshotBalances   `json:"balances"`
	UserAssets []*SnapshotUserAssets `json:"userAssets"`
	Assets     []*SnapshotAssets     `json:"assets"`
	Positions  []*SnapshotPositions  `json:"position"`
}

SnapshotData define content of a snapshot

type SnapshotPositions

type SnapshotPositions struct {
	EntryPrice       string `json:"entryPrice"`
	MarkPrice        string `json:"markPrice"`
	PositionAmt      string `json:"positionAmt"`
	Symbol           string `json:"symbol"`
	UnRealizedProfit string `json:"unRealizedProfit"`
}

SnapshotPositions define snapshot positions

type SnapshotUserAssets

type SnapshotUserAssets struct {
	Asset    string `json:"asset"`
	Borrowed string `json:"borrowed"`
	Free     string `json:"free"`
	Interest string `json:"interest"`
	Locked   string `json:"locked"`
	NetAsset string `json:"netAsset"`
}

SnapshotUserAssets define snapshot user assets

type SnapshotVos

type SnapshotVos struct {
	Data       *SnapshotData `json:"data"`
	Type       string        `json:"type"`
	UpdateTime int64         `json:"updateTime"`
}

SnapshotVos define content of a snapshot

type SpotRebateHistory

type SpotRebateHistory struct {
	Status string                `json:"status"`
	Type   string                `json:"type"`
	Code   string                `json:"code"`
	Data   SpotRebateHistoryData `json:"data"`
}

SpotRebateHistory define the spot rebate history

type SpotRebateHistoryData

type SpotRebateHistoryData struct {
	Page         int32                       `json:"page"`
	TotalRecords int32                       `json:"totalRecords"`
	TotalPageNum int32                       `json:"totalPageNum"`
	Data         []SpotRebateHistoryDataItem `json:"data"`
}

SpotRebateHistoryData define the data part of the spot rebate history

type SpotRebateHistoryDataItem

type SpotRebateHistoryDataItem struct {
	Asset      string `json:"asset"`
	Type       int32  `json:"type"`
	Amount     string `json:"amount"`
	UpdateTime int64  `json:"updateTime"`
}

SpotRebateHistoryDataItem define a spot rebate history data item

type SpotRebateHistoryService

type SpotRebateHistoryService struct {
	// contains filtered or unexported fields
}

func (*SpotRebateHistoryService) Do

Do send request

func (*SpotRebateHistoryService) EndTime

EndTime set endTime

func (*SpotRebateHistoryService) Page

Page set page

func (*SpotRebateHistoryService) StartTime

func (s *SpotRebateHistoryService) StartTime(startTime int64) *SpotRebateHistoryService

BeginTime set beginTime

type SpotSubUserAssetBtcVoList

type SpotSubUserAssetBtcVoList struct {
	Email      string `json:"email"`
	TotalAsset string `json:"totalAsset"`
}

type StakingHistory

type StakingHistory []StakingHistoryTransaction

StakingHistory represents a list of staking history transactions.

type StakingHistoryService

type StakingHistoryService struct {
	// contains filtered or unexported fields
}

StakingHistoryService fetches the staking history

func (*StakingHistoryService) Asset

Asset sets the asset parameter.

func (*StakingHistoryService) Current

func (s *StakingHistoryService) Current(current int32) *StakingHistoryService

Current sets the current parameter.

func (*StakingHistoryService) Do

Do sends the request.

func (*StakingHistoryService) EndTime

func (s *StakingHistoryService) EndTime(endTime int64) *StakingHistoryService

EndTime sets the endTime parameter.

func (*StakingHistoryService) Product

Product sets the product parameter.

func (*StakingHistoryService) Size

Size sets the size parameter.

func (*StakingHistoryService) StartTime

func (s *StakingHistoryService) StartTime(startTime int64) *StakingHistoryService

StartTime sets the startTime parameter.

func (*StakingHistoryService) TransactionType

func (s *StakingHistoryService) TransactionType(transactionType StakingTransactionType) *StakingHistoryService

TransactionType sets the txnType parameter.

type StakingHistoryTransaction

type StakingHistoryTransaction struct {
	PositionId  int64  `json:"positionId"`
	Time        int64  `json:"time"`
	Asset       string `json:"asset"`
	Project     string `json:"project"`
	Amount      string `json:"amount"`
	LockPeriod  int64  `json:"lockPeriod"`
	DeliverDate int64  `json:"deliverDate"`
	Type        string `json:"type"`
	Status      string `json:"status"`
}

StakingHistoryTransaction represents a staking history transaction.

type StakingProduct

type StakingProduct string

StakingProduct define the staking product (locked staking, flexible defi staking, locked defi staking, ...)

type StakingProductPosition

type StakingProductPosition struct {
	PositionId                 int64  `json:"positionId"`
	ProductId                  string `json:"productId"`
	Asset                      string `json:"asset"`
	Amount                     string `json:"amount"`
	PurchaseTime               int64  `json:"purchaseTime"`
	Duration                   int64  `json:"duration"`
	AccrualDays                int64  `json:"accrualDays"`
	RewardAsset                string `json:"rewardAsset"`
	APY                        string `json:"apy"`
	RewardAmount               string `json:"rewardAmt"`
	ExtraRewardAsset           string `json:"extraRewardAsset"`
	ExtraRewardAPY             string `json:"extraRewardAPY"`
	EstimatedExtraRewardAmount string `json:"estExtraRewardAmt"`
	NextInterestPay            string `json:"nextInterestPay"`
	NextInterestPayDate        int64  `json:"nextInterestPayDate"`
	PayInterestPeriod          int64  `json:"payInterestPeriod"`
	RedeemAmountEarly          string `json:"redeemAmountEarly"`
	InterestEndDate            int64  `json:"interestEndDate"`
	DeliverDate                int64  `json:"deliverDate"`
	RedeemPeriod               int64  `json:"redeemPeriod"`
	RedeemingAmount            string `json:"redeemingAmt"`
	PartialAmountDeliverDate   int64  `json:"partialAmtDeliverDate"`
	CanRedeemEarly             bool   `json:"canRedeemEarly"`
	Renewable                  bool   `json:"renewable"`
	Type                       string `json:"type"`
	Status                     string `json:"status"`
}

StakingProductPosition represents a staking product position.

type StakingProductPositionService

type StakingProductPositionService struct {
	// contains filtered or unexported fields
}

StakingProductPositionService fetches the staking product positions

func (*StakingProductPositionService) Asset

Asset sets the asset parameter.

func (*StakingProductPositionService) Current

Current sets the current parameter.

func (*StakingProductPositionService) Do

Do sends the request.

func (*StakingProductPositionService) Product

Product sets the product parameter.

func (*StakingProductPositionService) ProductId

ProductId sets the productId parameter.

func (*StakingProductPositionService) Size

Size sets the size parameter.

type StakingProductPositions

type StakingProductPositions []StakingProductPosition

StakingProductPositions represents a list of staking product positions.

type StakingTransactionType

type StakingTransactionType string

StakingTransactionType define the staking transaction type (subscription, redemption, interest)

type StartIsolatedMarginUserStreamService

type StartIsolatedMarginUserStreamService struct {
	// contains filtered or unexported fields
}

StartIsolatedMarginUserStreamService create listen key for margin user stream service

func (*StartIsolatedMarginUserStreamService) Do

func (s *StartIsolatedMarginUserStreamService) Do(ctx context.Context, opts ...RequestOption) (listenKey string, err error)

Do send request

func (*StartIsolatedMarginUserStreamService) Symbol

Symbol sets the user stream to isolated margin user stream

type StartMarginUserStreamService

type StartMarginUserStreamService struct {
	// contains filtered or unexported fields
}

StartMarginUserStreamService create listen key for margin user stream service

func (*StartMarginUserStreamService) Do

func (s *StartMarginUserStreamService) Do(ctx context.Context, opts ...RequestOption) (listenKey string, err error)

Do send request

type StartUserStreamService

type StartUserStreamService struct {
	// contains filtered or unexported fields
}

StartUserStreamService create listen key for user stream service

func (*StartUserStreamService) Do

func (s *StartUserStreamService) Do(ctx context.Context, opts ...RequestOption) (listenKey string, err error)

Do send request

type SubAccount

type SubAccount struct {
	Email                       string `json:"email"`
	IsFreeze                    bool   `json:"isFreeze"`
	CreateTime                  uint64 `json:"createTime"`
	IsManagedSubAccount         bool   `json:"isManagedSubAccount"`
	IsAssetManagementSubAccount bool   `json:"isAssetManagementSubAccount"`
}

type SubAccountFuturesAccount

type SubAccountFuturesAccount struct {
	Email                       string                          `json:"email"`
	Asset                       string                          `json:"asset"`
	Assets                      []SubAccountFuturesAccountAsset `json:"assets"`
	CanDeposit                  bool                            `json:"canDeposit"`
	CanTrade                    bool                            `json:"canTrade"`
	CanWithdraw                 bool                            `json:"canWithdraw"`
	FeeTier                     int                             `json:"feeTier"`
	MaxWithdrawAmount           string                          `json:"maxWithdrawAmount"`
	TotalInitialMargin          string                          `json:"totalInitialMargin"`
	TotalMaintenanceMargin      string                          `json:"totalMaintenanceMargin"`
	TotalMarginBalance          string                          `json:"totalMarginBalance"`
	TotalOpenOrderInitialMargin string                          `json:"totalOpenOrderInitialMargin"`
	TotalPositionInitialMargin  string                          `json:"totalPositionInitialMargin"`
	TotalUnrealizedProfit       string                          `json:"totalUnrealizedProfit"`
	TotalWalletBalance          string                          `json:"totalWalletBalance"`
	UpdateTime                  int64                           `json:"updateTime"`
}

type SubAccountFuturesAccountAsset

type SubAccountFuturesAccountAsset struct {
	Asset                  string `json:"asset"`
	InitialMargin          string `json:"initialMargin"`
	MaintenanceMargin      string `json:"maintenanceMargin"`
	MarginBalance          string `json:"marginBalance"`
	MaxWithdrawAmount      string `json:"maxWithdrawAmount"`
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"`
	PositionInitialMargin  string `json:"positionInitialMargin"`
	UnrealizedProfit       string `json:"unrealizedProfit"`
	WalletBalance          string `json:"walletBalance"`
}

type SubAccountFuturesAccountService

type SubAccountFuturesAccountService struct {
	// contains filtered or unexported fields
}

SubAccountFuturesAccountService Get Detail on Sub-account's Futures Account (For Master Account) https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-futures-account-for-master-account

func (*SubAccountFuturesAccountService) Do

func (*SubAccountFuturesAccountService) Email

type SubAccountFuturesSummaryCommon added in v2.0.1

type SubAccountFuturesSummaryCommon struct {
	Asset                       string `json:"asset"`
	TotalInitialMargin          string `json:"totalInitialMargin"`
	TotalMaintenanceMargin      string `json:"totalMaintenanceMargin"`
	TotalMarginBalance          string `json:"totalMarginBalance"`
	TotalOpenOrderInitialMargin string `json:"totalOpenOrderInitialMargin"`
	TotalPositionInitialMargin  string `json:"totalPositionInitialMargin"`
	TotalUnrealizedProfit       string `json:"totalUnrealizedProfit"`
	TotalWalletBalance          string `json:"totalWalletBalance"`
}

type SubAccountFuturesSummaryV1 added in v2.0.1

type SubAccountFuturesSummaryV1 struct {
	SubAccountFuturesSummaryCommon
	SubAccountList []SubAccountFuturesSummaryV1SubAccountList `json:"subAccountList"`
}

type SubAccountFuturesSummaryV1Service added in v2.0.1

type SubAccountFuturesSummaryV1Service struct {
	// contains filtered or unexported fields
}

SubaccountFuturesSummaryV1Service Get Summary of Sub-account's Futures Account (For Master Account) https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-futures-account-for-master-account

func (*SubAccountFuturesSummaryV1Service) Do added in v2.0.1

type SubAccountFuturesSummaryV1SubAccountList added in v2.0.1

type SubAccountFuturesSummaryV1SubAccountList struct {
	Email string `json:"email"`
	SubAccountFuturesSummaryCommon
}

type SubAccountFuturesTransferResponse added in v2.0.1

type SubAccountFuturesTransferResponse struct {
	// seems api doc bug, return `tranId` as int64 actually in production environment
	TranID int64 `json:"tranId"`
}

type SubAccountFuturesTransferV1Service added in v2.0.1

type SubAccountFuturesTransferV1Service struct {
	// contains filtered or unexported fields
}

SubAccountFuturesTransferV1Service Futures Transfer for Sub-account (For Master Account) https://binance-docs.github.io/apidocs/spot/en/#futures-transfer-for-sub-account-for-master-account

func (*SubAccountFuturesTransferV1Service) Amount added in v2.0.1

func (*SubAccountFuturesTransferV1Service) Asset added in v2.0.1

func (*SubAccountFuturesTransferV1Service) Do added in v2.0.1

func (*SubAccountFuturesTransferV1Service) Email added in v2.0.1

func (*SubAccountFuturesTransferV1Service) TransferType added in v2.0.1

type SubAccountList

type SubAccountList struct {
	SubAccounts []SubAccount `json:"subAccounts"`
}

type SubAccountListService

type SubAccountListService struct {
	// contains filtered or unexported fields
}

SubAccountListService Query Sub-account List (For Master Account) https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-list-for-master-account

func (*SubAccountListService) Do

func (s *SubAccountListService) Do(ctx context.Context, opts ...RequestOption) (res *SubAccountList, err error)

func (*SubAccountListService) Email

func (*SubAccountListService) IsFreeze

func (*SubAccountListService) Limit

func (*SubAccountListService) Page

type SubTransfer

type SubTransfer struct {
	CounterParty    string  `json:"counterParty"`
	Email           string  `json:"email"`
	Type            int     `json:"type"`
	Asset           string  `json:"asset"`
	Qty             float64 `json:"qty,string"`
	FromAccountType string  `json:"fromAccountType"`
	ToAccountType   string  `json:"toAccountType"`
	Status          string  `json:"status"`
	TranID          int64   `json:"tranId"`
	Time            int64   `json:"time"`
}

type SubTransferHistoryService

type SubTransferHistoryService struct {
	// contains filtered or unexported fields
}

Get transfer history from sub-account See https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account

func (*SubTransferHistoryService) Asset

func (*SubTransferHistoryService) Do

func (s *SubTransferHistoryService) Do(ctx context.Context) (res []*SubTransfer, err error)

func (*SubTransferHistoryService) EndTime

func (*SubTransferHistoryService) Limit

func (*SubTransferHistoryService) StartTime

func (*SubTransferHistoryService) TransferType

type SubaccountAssetsResponse

type SubaccountAssetsResponse struct {
	Balances []AssetBalance `json:"balances"`
}

SubaccountAssetsResponse Query Sub-account Assets response

type SubaccountAssetsService

type SubaccountAssetsService struct {
	// contains filtered or unexported fields
}

func (*SubaccountAssetsService) Do

Do send request

func (*SubaccountAssetsService) Email

Email set email

type SubaccountDepositAddressResponse

type SubaccountDepositAddressResponse struct {
	Address string `json:"address"`
	Coin    string `json:"coin"`
	Tag     string `json:"tag"`
	URL     string `json:"url"`
}

type SubaccountDepositAddressService

type SubaccountDepositAddressService struct {
	// contains filtered or unexported fields
}

func (*SubaccountDepositAddressService) Coin

Coin set coin

func (*SubaccountDepositAddressService) Do

Do send request

func (*SubaccountDepositAddressService) Email

Email set email

func (*SubaccountDepositAddressService) Network

Network set network

type SubaccountSpotSummaryResponse

type SubaccountSpotSummaryResponse struct {
	TotalCount                int64                       `json:"totalCount"`
	MasterAccountTotalAsset   string                      `json:"masterAccountTotalAsset"`
	SpotSubUserAssetBtcVoList []SpotSubUserAssetBtcVoList `json:"spotSubUserAssetBtcVoList"`
}

SubaccountSpotSummaryResponse Query Sub-account Spot Assets Summary response

type SubaccountSpotSummaryService

type SubaccountSpotSummaryService struct {
	// contains filtered or unexported fields
}

func (*SubaccountSpotSummaryService) Do

Do send request

func (*SubaccountSpotSummaryService) Email

Email set email

func (*SubaccountSpotSummaryService) Page

func (*SubaccountSpotSummaryService) Size

type SwapRecord

type SwapRecord struct {
	SwapId     int64          `json:"swapId"`
	SwapTime   int64          `json:"swapTime"`
	Status     SwappingStatus `json:"status"`
	QuoteAsset string         `json:"quoteAsset"`
	BaseAsset  string         `json:"baseAsset"`
	QuoteQty   string         `json:"quoteQty"`
	BaseQty    string         `json:"baseQty"`
	Price      string         `json:"price"`
	Fee        string         `json:"fee"`
}

type SwapResponse

type SwapResponse struct {
	SwapId int64 `json:"swapId"`
}

type SwapService

type SwapService struct {
	// contains filtered or unexported fields
}

SwapService swap tokens in liquidity pool

func (*SwapService) BaseAsset

func (s *SwapService) BaseAsset(baseAsset string) *SwapService

BaseAsset set baseAsset

func (*SwapService) Do

func (s *SwapService) Do(ctx context.Context) (*SwapResponse, error)

Do sends the request.

func (*SwapService) QuoteAsset

func (s *SwapService) QuoteAsset(quoteAsset string) *SwapService

QuoteAsset set quoteAsset

func (*SwapService) QuoteQty

func (s *SwapService) QuoteQty(quoteQty float64) *SwapService

QuoteQty set quoteQty

type SwappingStatus

type SwappingStatus int

SwappingStatus define the status of swap when querying the swap history

type Symbol

type Symbol struct {
	Symbol                     string                   `json:"symbol"`
	Status                     string                   `json:"status"`
	BaseAsset                  string                   `json:"baseAsset"`
	BaseAssetPrecision         int                      `json:"baseAssetPrecision"`
	QuoteAsset                 string                   `json:"quoteAsset"`
	QuotePrecision             int                      `json:"quotePrecision"`
	QuoteAssetPrecision        int                      `json:"quoteAssetPrecision"`
	BaseCommissionPrecision    int32                    `json:"baseCommissionPrecision"`
	QuoteCommissionPrecision   int32                    `json:"quoteCommissionPrecision"`
	OrderTypes                 []string                 `json:"orderTypes"`
	IcebergAllowed             bool                     `json:"icebergAllowed"`
	OcoAllowed                 bool                     `json:"ocoAllowed"`
	QuoteOrderQtyMarketAllowed bool                     `json:"quoteOrderQtyMarketAllowed"`
	IsSpotTradingAllowed       bool                     `json:"isSpotTradingAllowed"`
	IsMarginTradingAllowed     bool                     `json:"isMarginTradingAllowed"`
	Filters                    []map[string]interface{} `json:"filters"`
	Permissions                []string                 `json:"permissions"`
}

Symbol market symbol

func (*Symbol) IcebergPartsFilter

func (s *Symbol) IcebergPartsFilter() *IcebergPartsFilter

IcebergPartsFilter return iceberg part filter of symbol

func (*Symbol) LotSizeFilter

func (s *Symbol) LotSizeFilter() *LotSizeFilter

LotSizeFilter return lot size filter of symbol

func (*Symbol) MarketLotSizeFilter

func (s *Symbol) MarketLotSizeFilter() *MarketLotSizeFilter

MarketLotSizeFilter return market lot size filter of symbol

func (*Symbol) MaxNumAlgoOrdersFilter

func (s *Symbol) MaxNumAlgoOrdersFilter() *MaxNumAlgoOrdersFilter

MaxNumAlgoOrdersFilter return max num algo orders filter of symbol

func (*Symbol) MaxNumOrdersFilter added in v2.0.1

func (s *Symbol) MaxNumOrdersFilter() *MaxNumOrdersFilter

For specific meanings, please refer to the type definition MaxNumOrders

func (*Symbol) NotionalFilter

func (s *Symbol) NotionalFilter() *NotionalFilter

NotionalFilter return notional filter of symbol

func (*Symbol) PercentPriceBySideFilter added in v2.0.1

func (s *Symbol) PercentPriceBySideFilter() *PercentPriceBySideFilter

PercentPriceBySideFilter return percent price filter of symbol

func (*Symbol) PriceFilter

func (s *Symbol) PriceFilter() *PriceFilter

PriceFilter return price filter of symbol

func (*Symbol) TrailingDeltaFilter added in v2.0.1

func (s *Symbol) TrailingDeltaFilter() *TrailingDeltaFilter

For specific meanings, please refer to the type definition TrailingDeltaFilter

type SymbolFilterType

type SymbolFilterType string

SymbolFilterType define symbol filter type

type SymbolPrice

type SymbolPrice struct {
	Symbol string `json:"symbol"`
	Price  string `json:"price"`
}

SymbolPrice define symbol and price pair

type SymbolStatusType

type SymbolStatusType string

SymbolStatusType define symbol status type

type SymbolTicker

type SymbolTicker struct {
	Symbol             string `json:"symbol"`
	PriceChange        string `json:"priceChange"`
	PriceChangePercent string `json:"priceChangePercent"`
	WeightedAvgPrice   string `json:"weightedAvgPrice"`
	OpenPrice          string `json:"openPrice"`
	HighPrice          string `json:"highPrice"`
	LowPrice           string `json:"lowPrice"`
	LastPrice          string `json:"lastPrice"`
	Volume             string `json:"volume"`
	QuoteVolume        string `json:"quoteVolume"`
	OpenTime           int64  `json:"openTime"`
	CloseTime          int64  `json:"closeTime"`
	FirstId            int64  `json:"firstId"`
	LastId             int64  `json:"lastId"`
	Count              int64  `json:"count"`
}

type SymbolType

type SymbolType string

SymbolType define symbol type

type TimeInForceType

type TimeInForceType string

TimeInForceType define time in force type of order

type ToggleBNBBurnService

type ToggleBNBBurnService struct {
	// contains filtered or unexported fields
}

ToggleBNBBurnService toggle BNB Burn on spot trade and margin interest

func (*ToggleBNBBurnService) Do

Do send request

func (*ToggleBNBBurnService) InterestBNBBurn

func (s *ToggleBNBBurnService) InterestBNBBurn(v bool) *ToggleBNBBurnService

InterestBNBBurn sets the interest BNB burn parameter

func (*ToggleBNBBurnService) SpotBNBBurn

func (s *ToggleBNBBurnService) SpotBNBBurn(v bool) *ToggleBNBBurnService

SpotBNBBurn sets the spot bnb burn parameter.

type Trade

type Trade struct {
	ID            int64  `json:"id"`
	Price         string `json:"price"`
	Quantity      string `json:"qty"`
	QuoteQuantity string `json:"quoteQty"`
	Time          int64  `json:"time"`
	IsBuyerMaker  bool   `json:"isBuyerMaker"`
	IsBestMatch   bool   `json:"isBestMatch"`
	IsIsolated    bool   `json:"isIsolated"`
}

Trade define trade info

type TradeFeeDetails

type TradeFeeDetails struct {
	Symbol          string `json:"symbol"`
	MakerCommission string `json:"makerCommission"`
	TakerCommission string `json:"takerCommission"`
}

TradeFeeDetails represents details about fees

type TradeFeeService

type TradeFeeService struct {
	// contains filtered or unexported fields
}

TradeFeeService shows current trade fee for all symbols available

func (*TradeFeeService) Do

func (s *TradeFeeService) Do(ctx context.Context) (res []*TradeFeeDetails, err error)

Do send request

func (*TradeFeeService) Symbol

func (s *TradeFeeService) Symbol(symbol string) *TradeFeeService

Symbol set the symbol parameter for the request

type TradeV3

type TradeV3 struct {
	ID              int64  `json:"id"`
	Symbol          string `json:"symbol"`
	OrderID         int64  `json:"orderId"`
	OrderListId     int64  `json:"orderListId"`
	Price           string `json:"price"`
	Quantity        string `json:"qty"`
	QuoteQuantity   string `json:"quoteQty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	Time            int64  `json:"time"`
	IsBuyer         bool   `json:"isBuyer"`
	IsMaker         bool   `json:"isMaker"`
	IsBestMatch     bool   `json:"isBestMatch"`
	IsIsolated      bool   `json:"isIsolated"`
}

TradeV3 define v3 trade info

type TrailingDeltaFilter added in v2.0.1

type TrailingDeltaFilter struct {
	MinTrailingAboveDelta int `json:"minTrailingAboveDelta"`
	MaxTrailingAboveDelta int `json:"maxTrailingAboveDelta"`
	MinTrailingBelowDelta int `json:"minTrailingBelowDelta"`
	MaxTrailingBelowDelta int `json:"maxTrailingBelowDelta"`
}

Spot trading supports tracking stop orders Tracking stop loss sets an automatic trigger price based on market price using a new parameter trailingDelta

type TransactionResponse

type TransactionResponse struct {
	TranID int64 `json:"tranId"`
}

TransactionResponse define transaction response

type TransactionType

type TransactionType string

TransactionType define transaction type

type TransferToSubAccountResponse

type TransferToSubAccountResponse struct {
	TxnID int64 `json:"txnId"`
}

TransferToSubAccountResponse define transfer to subaccount response

type TransferToSubAccountService

type TransferToSubAccountService struct {
	// contains filtered or unexported fields
}

TransferToSubAccountService transfer to subaccount

func (*TransferToSubAccountService) Amount

Amount set amount

func (*TransferToSubAccountService) Asset

Asset set asset

func (*TransferToSubAccountService) Do

Do send request

func (*TransferToSubAccountService) ToEmail

ToEmail set toEmail

type UserAsset

type UserAsset struct {
	Asset    string `json:"asset"`
	Borrowed string `json:"borrowed"`
	Free     string `json:"free"`
	Interest string `json:"interest"`
	Locked   string `json:"locked"`
	NetAsset string `json:"netAsset"`
}

UserAsset define user assets of margin account

type UserAssetDribblet

type UserAssetDribblet struct {
	OperateTime              int64                     `json:"operateTime"`
	TotalTransferedAmount    string                    `json:"totalTransferedAmount"`    //Total transfered BNB amount for this exchange.
	TotalServiceChargeAmount string                    `json:"totalServiceChargeAmount"` //Total service charge amount for this exchange.
	TransID                  int64                     `json:"transId"`
	UserAssetDribbletDetails []UserAssetDribbletDetail `json:"userAssetDribbletDetails"` //Details of this exchange.
}

UserAssetDribblet represents one dust log row

type UserAssetDribbletDetail

type UserAssetDribbletDetail struct {
	TransID             int    `json:"transId"`
	ServiceChargeAmount string `json:"serviceChargeAmount"`
	Amount              string `json:"amount"`
	OperateTime         int64  `json:"operateTime"` //The time of this exchange.
	TransferedAmount    string `json:"transferedAmount"`
	FromAsset           string `json:"fromAsset"`
}

DustLog represents one dust log informations

type UserAssetRecord

type UserAssetRecord struct {
	Asset        string `json:"asset"`
	Free         string `json:"free"`
	Locked       string `json:"locked"`
	Freeze       string `json:"freeze"`
	Withdrawing  string `json:"withdrawing"`
	Ipoable      string `json:"ipoable"`
	BtcValuation string `json:"btcValuation"`
}

type UserDataEventType

type UserDataEventType string

UserDataEventType define spot user data event type

type VIPLoanAsset

type VIPLoanAsset struct {
	LoanCoin              string `json:"loanCoin"`
	D30DailyInterestRate  string `json:"_30dDailyInterestRate"`
	D30YearlyInterestRate string `json:"_30dYearlyInterestRate"`
	D60DailyInterestRate  string `json:"_60dDailyInterestRate"`
	D60YearlyInterestRate string `json:"_60dYearlyInterestRate"`
	MinLimit              string `json:"minLimit"`
	MaxLimit              string `json:"maxLimit"`
	VipLevel              int64  `json:"vipLevel"`
}

type VipLoanService

type VipLoanService struct {
	// contains filtered or unexported fields
}

func (*VipLoanService) Do

func (s *VipLoanService) Do(ctx context.Context, opts ...RequestOption) (res *VipLoanableAssets, err error)

Do send request

type VipLoanableAssets

type VipLoanableAssets struct {
	Rows  []VIPLoanAsset `json:"rows"`
	Total int64          `json:"total"`
}

type Withdraw

type Withdraw struct {
	Address         string `json:"address"`
	Amount          string `json:"amount"`
	ApplyTime       string `json:"applyTime"`
	Coin            string `json:"coin"`
	ID              string `json:"id"`
	WithdrawOrderID string `json:"withdrawOrderId"`
	Network         string `json:"network"`
	TransferType    int    `json:"transferType"`
	Status          int    `json:"status"`
	TransactionFee  string `json:"transactionFee"`
	ConfirmNo       int32  `json:"confirmNo"`
	Info            string `json:"info"`
	TxID            string `json:"txId"`
}

Withdraw represents a single withdraw entry.

type WsAccountUpdate

type WsAccountUpdate struct {
	Asset  string `json:"a"`
	Free   string `json:"f"`
	Locked string `json:"l"`
}

WsAccountUpdate define account update

type WsAccountUpdateList

type WsAccountUpdateList struct {
	AccountUpdateTime int64             `json:"u"`
	WsAccountUpdates  []WsAccountUpdate `json:"B"`
}

type WsAggTradeEvent

type WsAggTradeEvent struct {
	Event                 string `json:"e"`
	Time                  int64  `json:"E"`
	Symbol                string `json:"s"`
	AggTradeID            int64  `json:"a"`
	Price                 string `json:"p"`
	Quantity              string `json:"q"`
	FirstBreakdownTradeID int64  `json:"f"`
	LastBreakdownTradeID  int64  `json:"l"`
	TradeTime             int64  `json:"T"`
	IsBuyerMaker          bool   `json:"m"`
	Placeholder           bool   `json:"M"` // add this field to avoid case insensitive unmarshaling
}

WsAggTradeEvent define websocket aggregate trade event

type WsAggTradeHandler

type WsAggTradeHandler func(event *WsAggTradeEvent)

WsAggTradeHandler handle websocket aggregate trade event

type WsAllMarketsStatEvent

type WsAllMarketsStatEvent []*WsMarketStatEvent

WsAllMarketsStatEvent define array of websocket market statistics events

type WsAllMarketsStatHandler

type WsAllMarketsStatHandler func(event WsAllMarketsStatEvent)

WsAllMarketsStatHandler handle websocket that push all markets statistics for 24hr

type WsAllMiniMarketsStatEvent

type WsAllMiniMarketsStatEvent []*WsMiniMarketsStatEvent

WsAllMiniMarketsStatEvent define array of websocket market mini-ticker statistics events

type WsAllMiniMarketsStatServeHandler

type WsAllMiniMarketsStatServeHandler func(event WsAllMiniMarketsStatEvent)

WsAllMiniMarketsStatServeHandler handle websocket that push all mini-ticker market statistics for 24hr

type WsBalanceUpdate

type WsBalanceUpdate struct {
	Asset           string `json:"a"`
	Change          string `json:"d"`
	TransactionTime int64  `json:"T"`
}

type WsBookTickerEvent

type WsBookTickerEvent struct {
	UpdateID     int64  `json:"u"`
	Symbol       string `json:"s"`
	BestBidPrice string `json:"b"`
	BestBidQty   string `json:"B"`
	BestAskPrice string `json:"a"`
	BestAskQty   string `json:"A"`
}

WsBookTickerEvent define websocket best book ticker event.

type WsBookTickerHandler

type WsBookTickerHandler func(event *WsBookTickerEvent)

WsBookTickerHandler handle websocket that pushes updates to the best bid or ask price or quantity in real-time for a specified symbol.

type WsCombinedBookTickerEvent

type WsCombinedBookTickerEvent struct {
	Data   *WsBookTickerEvent `json:"data"`
	Stream string             `json:"stream"`
}

type WsCombinedTradeEvent

type WsCombinedTradeEvent struct {
	Stream string       `json:"stream"`
	Data   WsTradeEvent `json:"data"`
}

type WsCombinedTradeHandler

type WsCombinedTradeHandler func(event *WsCombinedTradeEvent)

type WsConfig

type WsConfig struct {
	Endpoint string
}

WsConfig webservice configuration

type WsDepthEvent

type WsDepthEvent struct {
	Event         string `json:"e"`
	Time          int64  `json:"E"`
	Symbol        string `json:"s"`
	LastUpdateID  int64  `json:"u"`
	FirstUpdateID int64  `json:"U"`
	Bids          []Bid  `json:"b"`
	Asks          []Ask  `json:"a"`
}

WsDepthEvent define websocket depth event

type WsDepthHandler

type WsDepthHandler func(event *WsDepthEvent)

WsDepthHandler handle websocket depth event

type WsHandler

type WsHandler func(message []byte)

WsHandler handle raw websocket message

type WsKline

type WsKline struct {
	StartTime            int64  `json:"t"`
	EndTime              int64  `json:"T"`
	Symbol               string `json:"s"`
	Interval             string `json:"i"`
	FirstTradeID         int64  `json:"f"`
	LastTradeID          int64  `json:"L"`
	Open                 string `json:"o"`
	Close                string `json:"c"`
	High                 string `json:"h"`
	Low                  string `json:"l"`
	Volume               string `json:"v"`
	TradeNum             int64  `json:"n"`
	IsFinal              bool   `json:"x"`
	QuoteVolume          string `json:"q"`
	ActiveBuyVolume      string `json:"V"`
	ActiveBuyQuoteVolume string `json:"Q"`
}

WsKline define websocket kline

type WsKlineEvent

type WsKlineEvent struct {
	Event  string  `json:"e"`
	Time   int64   `json:"E"`
	Symbol string  `json:"s"`
	Kline  WsKline `json:"k"`
}

WsKlineEvent define websocket kline event

type WsKlineHandler

type WsKlineHandler func(event *WsKlineEvent)

WsKlineHandler handle websocket kline event

type WsMarketStatEvent

type WsMarketStatEvent struct {
	Event              string `json:"e"`
	Time               int64  `json:"E"`
	Symbol             string `json:"s"`
	PriceChange        string `json:"p"`
	PriceChangePercent string `json:"P"`
	WeightedAvgPrice   string `json:"w"`
	PrevClosePrice     string `json:"x"`
	LastPrice          string `json:"c"`
	CloseQty           string `json:"Q"`
	BidPrice           string `json:"b"`
	BidQty             string `json:"B"`
	AskPrice           string `json:"a"`
	AskQty             string `json:"A"`
	OpenPrice          string `json:"o"`
	HighPrice          string `json:"h"`
	LowPrice           string `json:"l"`
	BaseVolume         string `json:"v"`
	QuoteVolume        string `json:"q"`
	OpenTime           int64  `json:"O"`
	CloseTime          int64  `json:"C"`
	FirstID            int64  `json:"F"`
	LastID             int64  `json:"L"`
	Count              int64  `json:"n"`
}

WsMarketStatEvent define websocket market statistics event

type WsMarketStatHandler

type WsMarketStatHandler func(event *WsMarketStatEvent)

WsMarketStatHandler handle websocket that push single market statistics for 24hr

type WsMiniMarketsStatEvent

type WsMiniMarketsStatEvent struct {
	Event       string `json:"e"`
	Time        int64  `json:"E"`
	Symbol      string `json:"s"`
	LastPrice   string `json:"c"`
	OpenPrice   string `json:"o"`
	HighPrice   string `json:"h"`
	LowPrice    string `json:"l"`
	BaseVolume  string `json:"v"`
	QuoteVolume string `json:"q"`
}

WsMiniMarketsStatEvent define websocket market mini-ticker statistics event

type WsOCOOrder

type WsOCOOrder struct {
	Symbol        string `json:"s"`
	OrderId       int64  `json:"i"`
	ClientOrderId string `json:"c"`
}

type WsOCOOrderList

type WsOCOOrderList struct {
	WsOCOOrders []WsOCOOrder `json:"O"`
}

type WsOCOUpdate

type WsOCOUpdate struct {
	Symbol          string `json:"s"`
	OrderListId     int64  `json:"g"`
	ContingencyType string `json:"c"`
	ListStatusType  string `json:"l"`
	ListOrderStatus string `json:"L"`
	RejectReason    string `json:"r"`
	ClientOrderId   string `json:"C"` // List Client Order ID
	TransactionTime int64  `json:"T"`
	Orders          WsOCOOrderList
}

type WsOrderUpdate

type WsOrderUpdate struct {
	Symbol                  string          `json:"s"`
	ClientOrderId           string          `json:"c"`
	Side                    string          `json:"S"`
	Type                    string          `json:"o"`
	TimeInForce             TimeInForceType `json:"f"`
	Volume                  string          `json:"q"`
	Price                   string          `json:"p"`
	StopPrice               string          `json:"P"`
	IceBergVolume           string          `json:"F"`
	OrderListId             int64           `json:"g"` // for OCO
	OrigCustomOrderId       string          `json:"C"` // customized order ID for the original order
	ExecutionType           string          `json:"x"` // execution type for this event NEW/TRADE...
	Status                  string          `json:"X"` // order status
	RejectReason            string          `json:"r"`
	Id                      int64           `json:"i"` // order id
	LatestVolume            string          `json:"l"` // quantity for the latest trade
	FilledVolume            string          `json:"z"`
	LatestPrice             string          `json:"L"` // price for the latest trade
	FeeAsset                string          `json:"N"`
	FeeCost                 string          `json:"n"`
	TransactionTime         int64           `json:"T"`
	TradeId                 int64           `json:"t"`
	IgnoreI                 int64           `json:"I"` // ignore
	IsInOrderBook           bool            `json:"w"` // is the order in the order book?
	IsMaker                 bool            `json:"m"` // is this order maker?
	IgnoreM                 bool            `json:"M"` // ignore
	CreateTime              int64           `json:"O"`
	FilledQuoteVolume       string          `json:"Z"` // the quote volume that already filled
	LatestQuoteVolume       string          `json:"Y"` // the quote volume for the latest trade
	QuoteVolume             string          `json:"Q"`
	SelfTradePreventionMode string          `json:"V"`

	//These are fields that appear in the payload only if certain conditions are met.
	TrailingDelta              int64  `json:"d"` // Appears only for trailing stop orders.
	TrailingTime               int64  `json:"D"`
	StrategyId                 int64  `json:"j"` // Appears only if the strategyId parameter was provided upon order placement.
	StrategyType               int64  `json:"J"` // Appears only if the strategyType parameter was provided upon order placement.
	PreventedMatchId           int64  `json:"v"` // Appears only for orders that expired due to STP.
	PreventedQuantity          string `json:"A"`
	LastPreventedQuantity      string `json:"B"`
	TradeGroupId               int64  `json:"u"`
	CounterOrderId             int64  `json:"U"`
	CounterSymbol              string `json:"Cs"`
	PreventedExecutionQuantity string `json:"pl"`
	PreventedExecutionPrice    string `json:"pL"`
	PreventedExecutionQuoteQty string `json:"pY"`
	WorkingTime                int64  `json:"W"` // Appears when the order is working on the book
	MatchType                  string `json:"b"`
	AllocationId               int64  `json:"a"`
	WorkingFloor               string `json:"k"`  // Appears for orders that could potentially have allocations
	UsedSor                    bool   `json:"uS"` // Appears for orders that used SOR
}

type WsPartialDepthEvent

type WsPartialDepthEvent struct {
	Symbol       string
	LastUpdateID int64 `json:"lastUpdateId"`
	Bids         []Bid `json:"bids"`
	Asks         []Ask `json:"asks"`
}

WsPartialDepthEvent define websocket partial depth book event

type WsPartialDepthHandler

type WsPartialDepthHandler func(event *WsPartialDepthEvent)

WsPartialDepthHandler handle websocket partial depth event

type WsTradeEvent

type WsTradeEvent struct {
	Event         string `json:"e"`
	Time          int64  `json:"E"`
	Symbol        string `json:"s"`
	TradeID       int64  `json:"t"`
	Price         string `json:"p"`
	Quantity      string `json:"q"`
	BuyerOrderID  int64  `json:"b"`
	SellerOrderID int64  `json:"a"`
	TradeTime     int64  `json:"T"`
	IsBuyerMaker  bool   `json:"m"`
	Placeholder   bool   `json:"M"` // add this field to avoid case insensitive unmarshaling
}

WsTradeEvent define websocket trade event

type WsTradeHandler

type WsTradeHandler func(event *WsTradeEvent)

WsTradeHandler handle websocket trade event

type WsUserDataEvent

type WsUserDataEvent struct {
	Event         UserDataEventType `json:"e"`
	Time          int64             `json:"E"`
	AccountUpdate WsAccountUpdateList
	BalanceUpdate WsBalanceUpdate
	OrderUpdate   WsOrderUpdate
	OCOUpdate     WsOCOUpdate
}

WsUserDataEvent define user data event

type WsUserDataHandler

type WsUserDataHandler func(event *WsUserDataEvent)

WsUserDataHandler handle WsUserDataEvent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL