binance

package module
v0.0.0-...-a47ae34 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 23 Imported by: 0

README

Binance Spot Go Connector

This is a lightweight library that works as a connector to Binance public API

Supported API Endpoints:

  • Account/Trade: account.go
  • Wallet: wallet.go
  • Margin Account/Trade: margin.go
  • Market Data: market.go
  • Sub-Accounts: subaccount.go
  • Staking: staking.go
  • Websocket Market/User Data Stream: websocket.go
  • Websocket User Data Stream: user_stream.go

Installation

go get github.com/binance/binance-connector-go

To reference the package in your code, use the following import statement:

import (
    "github.com/binance/binance-connector-go"
)

Authentication

// The Client can be initiated with apiKey, secretKey and baseURL.
// The baseURL is optional. If not specified, it will default to "https://api.binance.com".
client := binance_connector.NewClient("yourApiKey", "yourSecretKey")

Extra Options

client := binance_connector.NewClient("yourApiKey", "yourSecretKey", "https://api.binance.com")

// Debug Mode
client.Debug = true

// TimeOffset (in milliseconds) - used to adjust the request timestamp by subtracting/adding the current time with it:
client.TimeOffset = -1000 // implies adding: request timestamp = current time - (-1000)

REST API

Create an order example

package main

import (
	"context"
	"fmt"

	binance_connector "github.com/binance/binance-connector-go"
)

func main() {
	apiKey := "yourApiKey"
	secretKey := "yourSecretKey"
	baseURL := "https://testnet.binance.vision"

	// Initialise the client
	client := binance_connector.NewClient(apiKey, secretKey, baseURL)

	// Create new order
	newOrder, err := client.NewCreateOrderService().Symbol("BTCUSDT").
		Side("BUY").Type("MARKET").Quantity(0.001).
		Do(context.Background())
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(binance_connector.PrettyPrint(newOrder))
}

Please find more examples for each supported endpoint in the examples folder.

Websocket API

Initialising Websocket Client

  • Websocket Client can be initialized with 2 parameters, NewWebsocketStreamClient(isCombined, baseURL):
  • isCombined is a MANDATORY boolean value that specifies whether you are calling a combined stream or not.
    • If isCombined is set to true, "/stream?streams=" will be appended to the baseURL to allow for Combining streams.
    • Otherwise, if set to false, "/ws/" will be appended to the baseURL.
  • baseURL is an OPTIONAL string value that determines the base URL to use for the websocket connection.
    • If baseURL is not set, it will default to the Live Exchange URL: "wss://stream.binance.com:9443".
// Initialise Websocket Client with Production baseURL and false for "isCombined" parameter

websocketStreamClient := binance_connector.NewWebsocketStreamClient(false, "wss://testnet.binance.vision")

// Initialise Websocket Client with Production baseURL and true for "isCombined" parameter

websocketStreamClient := binance_connector.NewWebsocketStreamClient(true)

Diff. Depth Stream Example

package main

import (
	"fmt"
	"time"

	binance_connector "github.com/binance/binance-connector-go"
)

func main() {
	// Initialise Websocket Client with Testnet BaseURL and false for "isCombined" parameter
	websocketStreamClient := binance_connector.NewWebsocketStreamClient(false, "wss://testnet.binance.vision")

	wsDepthHandler := func(event *binance_connector.WsDepthEvent) {
		fmt.Println(binance_connector.PrettyPrint(event))
	}

	errHandler := func(err error) {
		fmt.Println(err)
	}

	// Depth stream subscription
	doneCh, stopCh, err := websocketStreamClient.WsDepthServe("BNBUSDT", wsDepthHandler, errHandler)
	if err != nil {
		fmt.Println(err)
		return
	}

	go func() {
		time.Sleep(30 * time.Second)
		stopCh <- struct{}{} // use stopCh to stop streaming
	}()

	<-doneCh
}

Combined Diff. Depth Stream Example

package main

import (
	"fmt"
	"time"

	binance_connector "github.com/binance/binance-connector-go"
)

func main() {
	// Set isCombined parameter to true as we are using Combined Depth Stream
	websocketStreamClient := binance_connector.NewWebsocketStreamClient(true)

	wsCombinedDepthHandler := func(event *binance_connector.WsDepthEvent) {
		fmt.Println(binance_connector.PrettyPrint(event))
	}
	errHandler := func(err error) {
		fmt.Println(err)
	}
	// Use WsCombinedDepthServe to subscribe to multiple streams
	doneCh, stopCh, err := websocketStreamClient.WsCombinedDepthServe([]string{"LTCBTC", "BTCUSDT", "MATICUSDT"}, wsCombinedDepthHandler, errHandler)
	if err != nil {
		fmt.Println(err)
		return
	}
	go func() {
		time.Sleep(5 * time.Second)
		stopCh <- struct{}{}
	}()
	<-doneCh
}

Base URL

Testnet Support

  • In order to use the Testnet, simply set the baseURL to "https://testnet.binance.vision"
  • You can find step-by-step instructions on how to use the get a Testnet API and Secret Key here

Pretty Print vs PrintLn

  • The fmt.Println(<response>) function will print the struct in a single line, which is not very readable.
  • The fmt.Println(binance_connector.PrettyPrint(<response>)) function will print the struct, including both the key and value, in a multi-line format which is more easily readable.
Regular PrintLn Example Output
&{depthUpdate 1680092520368 LTCBTC 1989614201 1989614210 [{0.00322300 70.96700000} {0.00322200 52.57100000} {0.00322000 248.64000000} {0.00321900 34.98300000}] [{0.00322600 71.52600000} {0.00323400 53.88900000} {0.00323500 27.37000000}]}
&{depthUpdate 1680092521368 LTCBTC 1989614211 1989614212 [{0.00320700 197.10100000} {0.00320100 15.76800000}] []}
&{depthUpdate 1680092522368 LTCBTC 1989614213 1989614224 [{0.00322300 86.15400000} {0.00322200 37.38400000} {0.00322100 252.53900000} {0.00322000 60.01300000}] [{0.00322800 75.48400000} {0.00322900 254.84500000} {0.00323000 8.74700000} {0.00323100 37.42800000}]}
&{depthUpdate 1680092523369 LTCBTC 1989614225 1989614226 [{0.00322300 103.57400000}] [{0.00399500 11.75400000}]}
&{depthUpdate 1680092524369 LTCBTC 1989614227 1989614276 [{0.00322500 0.00000000} {0.00322400 101.32700000} {0.00322300 138.82600000} {0.00322200 58.49100000} {0.00322100 249.65400000} {0.00321900 47.34800000} {0.00317800 16.08500000} {0.00317500 38.36500000}] [{0.00322500 75.14300000} {0.00322600 48.19100000} {0.00322700 44.97900000} {0.00322800 242.74300000} {0.00322900 20.73400000} {0.00532700 0.18900000} {0.00779700 0.05600000}]}
binance_connector.PrettyPrint Example Output
{
	"e": "depthUpdate",
	"E": 1680092041346,
	"s": "LTCBTC",
    "U": 1989606566,
	"u": 1989606596,
	"b": [
		{
			"Price": "0.00322800",
			"Quantity": "83.05100000"
		},
		{
			"Price": "0.00322700",
			"Quantity": "12.50200000"
		},
		{
			"Price": "0.00322500",
			"Quantity": "48.53700000"
		},
		{
			"Price": "0.00322400",
			"Quantity": "244.13500000"
		}
	],
	"a": [
		{
			"Price": "0.00322900",
			"Quantity": "79.52900000"
		},
		{
			"Price": "0.00323000",
			"Quantity": "42.68400000"
		},
		{
			"Price": "0.00323100",
			"Quantity": "68.75500000"
		}
	]
}
{
	"e": "depthUpdate",
	"E": 1680092042346,
	"s": "LTCBTC",
	"U": 1989606597,
	"u": 1989606611,
	"b": [
		{
			"Price": "0.00321400",
			"Quantity": "0.24700000"
		},
		{
			"Price": "0.00318000",
			"Quantity": "1.91600000"
		}
	],
	"a": [
		{
			"Price": "0.00322900",
			"Quantity": "79.27900000"
		}
	]
}

Limitations

Futures and European Options APIs are not supported:

  • /fapi/*
  • /dapi/*
  • /vapi/*
  • Associated Websocket Market and User Data Streams

Contributing

Contributions are welcome.
If you've found a bug within this project, please open an issue to discuss what you would like to change.
If it's an issue with the API, please open a topic at Binance Developer Community

Documentation

Index

Constants

View Source
const (
	ACK    = 1
	RESULT = 2
	FULL   = 3
)
View Source
const Name = "binance-connector-go"
View Source
const (
	QuerySubAccountTransactionTatisticsEndpoint = "/sapi/v1/sub-account/transaction-tatistics"
)

Query Sub-account Transaction Tatistics (For Master Account) (USER_DATA)

View Source
const Version = "0.4.0"

Variables

View Source
var (
	// 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
)

Functions

func FormatTimestamp

func FormatTimestamp(t time.Time) int64

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

func PrettyPrint

func PrettyPrint(i interface{}) string

func TestFormatTimestamp

func TestFormatTimestamp(t *testing.T)

Types

type APIKeyPermissionResponse

type APIKeyPermissionResponse 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"`
}

APIKeyPermissionResponse define response of APIKeyPermissionService

type APIKeyPermissionService

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

APIKeyPermissionService get api key permission

func (*APIKeyPermissionService) Do

type AccountApiTradingStatusResponse

type AccountApiTradingStatusResponse struct {
	Data struct {
		IsLocked           bool  `json:"isLocked"`
		PlannedRecoverTime int64 `json:"plannedRecoverTime"`
		TriggerCondition   struct {
			GCR  int `json:"GCR"`
			IFER int `json:"IFER"`
			UFR  int `json:"UFR"`
		} `json:"triggerCondition"`
		UpdateTime uint64 `json:"updateTime"`
	} `json:"data"`
}

AccountApiTradingStatusResponse define response of AccountApiTradingStatusService

type AccountApiTradingStatusService

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

AccountApiTradingStatusService account api trading status

func (*AccountApiTradingStatusService) Do

type AccountOrderBookResponse

type AccountOrderBookResponse struct {
}

Create AccountOrderBookResponse

type AccountResponse

type AccountResponse struct {
	MakerCommission  int64     `json:"makerCommission"`
	TakerCommission  int64     `json:"takerCommission"`
	BuyerCommission  int64     `json:"buyerCommission"`
	SellerCommission int64     `json:"sellerCommission"`
	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"`
}

Create AccountResponse

type AccountSnapshotResponse

type AccountSnapshotResponse struct {
	Code        int    `json:"code"`
	Msg         string `json:"msg"`
	SnapshotVos []struct {
		Data struct {
			Balances []struct {
				Asset  string `json:"asset"`
				Free   string `json:"free"`
				Locked string `json:"locked"`
			} `json:"balances"`
			TotalAssetOfBtc string `json:"totalAssetOfBtc"`
		} `json:"data"`
		Type       string `json:"type"`
		UpdateTime uint64 `json:"updateTime"`
	} `json:"snapshotVos"`
}

AccountSnapshotResponse define response of GetAccountSnapshotService

type AccountStatusResponse

type AccountStatusResponse struct {
	Data string `json:"data"`
}

AccountStatusResponse define response of AccountStatusService

type AccountStatusService

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

AccountStatusService account status

func (*AccountStatusService) Do

type AccountTradeListResponse

type AccountTradeListResponse 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            uint64 `json:"time"`
	IsBuyer         bool   `json:"isBuyer"`
	IsMaker         bool   `json:"isMaker"`
	IsBestMatch     bool   `json:"isBestMatch"`
}

type AggTradesList

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

Binance Compressed/Aggregate Trades List endpoint (GET /api/v3/aggTrades)

func (*AggTradesList) Do

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

Send the request

func (*AggTradesList) EndTime

func (s *AggTradesList) EndTime(endTime uint64) *AggTradesList

EndTime set endTime

func (*AggTradesList) FromId

func (s *AggTradesList) FromId(fromId int) *AggTradesList

FromId set fromId

func (*AggTradesList) Limit

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

Limit set limit

func (*AggTradesList) StartTime

func (s *AggTradesList) StartTime(startTime uint64) *AggTradesList

StartTime set startTime

func (*AggTradesList) Symbol

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

Symbol set symbol

type AggTradesListResponse

type AggTradesListResponse struct {
	AggTradeId   uint64 `json:"a"`
	Price        string `json:"p"`
	Qty          string `json:"q"`
	FirstTradeId uint64 `json:"f"`
	LastTradeId  uint64 `json:"l"`
	Time         uint64 `json:"T"`
	IsBuyer      bool   `json:"m"`
	IsBest       bool   `json:"M"`
}

AggTradesListResponse define compressed trades list response

type AllIsolatedMarginSymbolService

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

AllIsolatedMarginSymbolService returns all isolated margin symbols

func (*AllIsolatedMarginSymbolService) Do

Do send request

type Ask

type Ask = PriceLevel

Ask is a type alias for PriceLevel.

type AssetDetailResponse

type AssetDetailResponse struct {
	Details []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"`
	} `json:"details"`
	TotalTransferBtc   string `json:"totalTransferBtc"`
	TotalTransferBnb   string `json:"totalTransferBnb"`
	DribbletPercentage string `json:"dribbletPercentage"`
}

AssetDetailResponse define response of AssetDetailService

type AssetDetailService

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

AssetDetailService asset detail

func (*AssetDetailService) Do

type AssetDetailV2Response

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

AssetDetailV2Response define response of AssetDetailV2Service

type AssetDetailV2Service

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

AssetDetailV2Service asset detail v2

func (*AssetDetailV2Service) Asset

Asset set asset

func (*AssetDetailV2Service) Do

type AssetDividendRecordResponse

type AssetDividendRecordResponse struct {
	Rows []struct {
		Id      int64  `json:"id"`
		Amount  string `json:"amount"`
		Asset   string `json:"asset"`
		DivTime uint64 `json:"divTime"`
		EnInfo  string `json:"enInfo"`
		TranId  int64  `json:"tranId"`
	} `json:"rows"`
	Total int64 `json:"total"`
}

AssetDividendRecordResponse define response of AssetDividendRecordService

type AssetDividendRecordService

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

AssetDividendRecordService asset dividend record

func (*AssetDividendRecordService) Asset

Asset set asset

func (*AssetDividendRecordService) Do

func (*AssetDividendRecordService) EndTime

EndTime set endTime

func (*AssetDividendRecordService) Limit

Limit set limit

func (*AssetDividendRecordService) StartTime

StartTime set startTime

type AutoConvertStableCoinResponse

type AutoConvertStableCoinResponse struct {
	ConvertEnabled bool `json:"convertEnabled"`
	Coins          []struct {
		Asset string `json:"coin"`
	} `json:"coins"`
	ExchangeRates []struct {
		Asset string `json:"coin"`
	} `json:"exchangeRates"`
}

AutoConvertStableCoinResponse define response of AutoConvertStableCoinService

type AutoConvertStableCoinService

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

AutoConvertStableCoinService auto convert stable coin

func (*AutoConvertStableCoinService) Do

type AvgPrice

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

Binance Current Average Price (GET /api/v3/avgPrice)

func (*AvgPrice) Do

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

Send the request

func (*AvgPrice) Symbol

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

Symbol set symbol

type AvgPriceResponse

type AvgPriceResponse struct {
	Mins  uint64 `json:"mins"`
	Price string `json:"price"`
}

Define AvgPrice response data

type BUSDConvertHistoryResponse

type BUSDConvertHistoryResponse struct {
	Total int32 `json:"total"`
	Rows  []struct {
		TranId         int64  `json:"tranId"`
		Type           int32  `json:"type"`
		Time           uint64 `json:"time"`
		DeductedAsset  string `json:"deductedAsset"`
		DeductedAmount string `json:"deductedAmount"`
		TargetAsset    string `json:"targetAsset"`
		TargetAmount   string `json:"targetAmount"`
		Status         string `json:"status"`
		AccountType    string `json:"accountType"`
	} `json:"rows"`
}

BUSDConvertHistoryResponse define response of BUSDConvertHistoryService

type BUSDConvertHistoryService

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

BUSDConvertHistoryService BUSD convert history

func (*BUSDConvertHistoryService) AccountType

func (s *BUSDConvertHistoryService) AccountType(accountType string) *BUSDConvertHistoryService

AccountType set accountType

func (*BUSDConvertHistoryService) Asset

Asset set asset

func (*BUSDConvertHistoryService) ClientTranId

func (s *BUSDConvertHistoryService) ClientTranId(clientTranId string) *BUSDConvertHistoryService

ClientTranId set clientTranId

func (*BUSDConvertHistoryService) Current

Current set current

func (*BUSDConvertHistoryService) Do

func (*BUSDConvertHistoryService) EndTime

EndTime set endTime

func (*BUSDConvertHistoryService) Size

Size set size

func (*BUSDConvertHistoryService) StartTime

StartTime set startTime

func (*BUSDConvertHistoryService) TranId

TranId set tranId

type BUSDConvertResponse

type BUSDConvertResponse struct {
	TranId int64  `json:"tranId"`
	Status string `json:"status"`
}

BUSDConvertResponse define response of BUSDConvertService

type BUSDConvertService

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

BUSDConvertService BUSD convert

func (*BUSDConvertService) AccountType

func (s *BUSDConvertService) AccountType(accountType string) *BUSDConvertService

AccountType set accountType

func (*BUSDConvertService) Amount

func (s *BUSDConvertService) Amount(amount float64) *BUSDConvertService

Amount set amount

func (*BUSDConvertService) Asset

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

Asset set asset

func (*BUSDConvertService) ClientTranId

func (s *BUSDConvertService) ClientTranId(clientTranId string) *BUSDConvertService

ClientTranId set clientTranId

func (*BUSDConvertService) Do

func (*BUSDConvertService) TargetAsset

func (s *BUSDConvertService) TargetAsset(targetAsset string) *BUSDConvertService

TargetAsset set targetAsset

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 = PriceLevel

Bid is a type alias for PriceLevel.

type BorrowResponse

type BorrowResponse struct {
	TranId int64 `json:"tranId"`
}

BorrowResponse define borrow response

type BorrowService

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

BorrowService borrow from cross margin account

func (*BorrowService) Amount

func (s *BorrowService) Amount(amount float64) *BorrowService

Amount set amount

func (*BorrowService) Asset

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

Asset set asset

func (*BorrowService) Do

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

Do send request

func (*BorrowService) IsIsolated

func (s *BorrowService) IsIsolated(isIsolated string) *BorrowService

IsIsolated set isolated

type CancelOCOService

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

Binance Cancel OCO (TRADE) (DELETE /api/v3/orderList) CancelOCOService cancel OCO order

func (*CancelOCOService) Do

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

Do send request

func (*CancelOCOService) ListClientOrderId

func (s *CancelOCOService) ListClientOrderId(ListClientOrderId string) *CancelOCOService

ListClientId set listClientId

func (*CancelOCOService) NewClientOrderId

func (s *CancelOCOService) NewClientOrderId(newClientOrderId string) *CancelOCOService

NewClientOrderId set newClientOrderId

func (*CancelOCOService) OrderListId

func (s *CancelOCOService) OrderListId(orderListId int) *CancelOCOService

OrderListId set orderListId

func (*CancelOCOService) Symbol

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

Symbol set symbol

type CancelOpenOrdersService

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

Binance Cancel all open orders on a symbol (DELETE /api/v3/openOrders) CancelOpenOrdersService cancel open orders

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"`
	Price               string `json:"price"`
	OrigQty             string `json:"origQty"`
	ExecutedQty         string `json:"executedQty"`
	CumulativeQuoteQty  string `json:"cumulativeQuoteQty"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
	SelfTradePrevention string `json:"selfTradePrevention"`
	IcebergQty          string `json:"icebergQty,omitempty"`
	PreventedMatchId    int64  `json:"preventedMatchId,omitempty"`
	PreventedQuantity   string `json:"preventedQuantity,omitempty"`
	StopPrice           string `json:"stopPrice,omitempty"`
	StrategyId          int64  `json:"strategyId,omitempty"`
	StrategyType        int64  `json:"strategyType,omitempty"`
	TrailingDelta       string `json:"trailingDelta,omitempty"`
	TrailingTime        int64  `json:"trailingTime,omitempty"`
}

Create CancelOrderResponse

type CancelOrderService

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

Binance Cancel Order endpoint (DELETE /api/v3/order) CancelOrderService cancel order

func (*CancelOrderService) CancelRestrictions

func (s *CancelOrderService) CancelRestrictions(cancelRestrictions string) *CancelOrderService

CancelRestrictions set cancelRestrictions

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 CancelReplaceResponse

type CancelReplaceResponse struct {
	Code           int64  `json:"code,omitempty"`
	Msg            string `json:"msg,omitempty"`
	CancelResult   string `json:"cancelResult,omitempty"`
	NewOrderResult string `json:"newOrderResult,omitempty"`
	CancelResponse *struct {
		Code                    int    `json:"code,omitempty"`
		Msg                     string `json:"msg,omitempty"`
		Symbol                  string `json:"symbol,omitempty"`
		OrigClientOrderId       string `json:"origClientOrderId,omitempty"`
		OrderId                 int64  `json:"orderId,omitempty"`
		OrderListId             int64  `json:"orderListId,omitempty"`
		ClientOrderId           string `json:"clientOrderId,omitempty"`
		Price                   string `json:"price,omitempty"`
		OrigQty                 string `json:"origQty,omitempty"`
		ExecutedQty             string `json:"executedQty,omitempty"`
		CumulativeQuoteQty      string `json:"cumulativeQuoteQty,omitempty"`
		Status                  string `json:"status,omitempty"`
		TimeInForce             string `json:"timeInForce,omitempty"`
		Type                    string `json:"type,omitempty"`
		Side                    string `json:"side,omitempty"`
		SelfTradePreventionMode string `json:"selfTradePreventionMode,omitempty"`
	} `json:"cancelResponse,omitempty"`
	NewOrderResponse *struct {
		Code                    int64    `json:"code,omitempty"`
		Msg                     string   `json:"msg,omitempty"`
		Symbol                  string   `json:"symbol,omitempty"`
		OrderId                 int64    `json:"orderId,omitempty"`
		OrderListId             int64    `json:"orderListId,omitempty"`
		ClientOrderId           string   `json:"clientOrderId,omitempty"`
		TransactTime            uint64   `json:"transactTime,omitempty"`
		Price                   string   `json:"price,omitempty"`
		OrigQty                 string   `json:"origQty,omitempty"`
		ExecutedQty             string   `json:"executedQty,omitempty"`
		CumulativeQuoteQty      string   `json:"cumulativeQuoteQty,omitempty"`
		Status                  string   `json:"status,omitempty"`
		TimeInForce             string   `json:"timeInForce,omitempty"`
		Type                    string   `json:"type,omitempty"`
		Side                    string   `json:"side,omitempty"`
		Fills                   []string `json:"fills,omitempty"`
		SelfTradePreventionMode string   `json:"selfTradePreventionMode,omitempty"`
	} `json:"newOrderResponse,omitempty"`
	Data *struct {
		CancelResult   string `json:"cancelResult,omitempty"`
		NewOrderResult string `json:"newOrderResult,omitempty"`
		CancelResponse *struct {
			Code                    int64  `json:"code,omitempty"`
			Msg                     string `json:"msg,omitempty"`
			Symbol                  string `json:"symbol,omitempty"`
			OrigClientOrderId       string `json:"origClientOrderId,omitempty"`
			OrderId                 int64  `json:"orderId,omitempty"`
			OrderListId             int64  `json:"orderListId,omitempty"`
			ClientOrderId           string `json:"clientOrderId,omitempty"`
			Price                   string `json:"price,omitempty"`
			OrigQty                 string `json:"origQty,omitempty"`
			ExecutedQty             string `json:"executedQty,omitempty"`
			CumulativeQuoteQty      string `json:"cumulativeQuoteQty,omitempty"`
			Status                  string `json:"status,omitempty"`
			TimeInForce             string `json:"timeInForce,omitempty"`
			Type                    string `json:"type,omitempty"`
			Side                    string `json:"side,omitempty"`
			SelfTradePreventionMode string `json:"selfTradePreventionMode,omitempty"`
		} `json:"cancelResponse,omitempty"`
		NewOrderResponse struct {
			Code                    int64    `json:"code,omitempty"`
			Msg                     string   `json:"msg,omitempty"`
			Symbol                  string   `json:"symbol,omitempty"`
			OrderId                 int64    `json:"orderId,omitempty"`
			OrderListId             int64    `json:"orderListId,omitempty"`
			ClientOrderId           string   `json:"clientOrderId,omitempty"`
			TransactTime            uint64   `json:"transactTime,omitempty"`
			Price                   string   `json:"price,omitempty"`
			OrigQty                 string   `json:"origQty,omitempty"`
			ExecutedQty             string   `json:"executedQty,omitempty"`
			CumulativeQuoteQty      string   `json:"cumulativeQuoteQty,omitempty"`
			Status                  string   `json:"status,omitempty"`
			TimeInForce             string   `json:"timeInForce,omitempty"`
			Type                    string   `json:"type,omitempty"`
			Side                    string   `json:"side,omitempty"`
			Fills                   []string `json:"fills,omitempty"`
			SelfTradePreventionMode string   `json:"selfTradePreventionMode,omitempty"`
		} `json:"newOrderResponse"`
	} `json:"data,omitempty"`
}

type CancelReplaceService

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

Cancel an Existing Order and Send a New Order (TRADE)

func (*CancelReplaceService) CancelNewClientOrderId

func (s *CancelReplaceService) CancelNewClientOrderId(cancelNewClientOrderId string) *CancelReplaceService

CancelNewClientOrderId set cancelNewClientOrderId

func (*CancelReplaceService) CancelOrderId

func (s *CancelReplaceService) CancelOrderId(cancelOrderId int64) *CancelReplaceService

CancelOrderId set cancelOrderId

func (*CancelReplaceService) CancelOrigClientOrderId

func (s *CancelReplaceService) CancelOrigClientOrderId(cancelOrigClientOrderId string) *CancelReplaceService

CancelOrigClientOrderId set cancelOrigClientOrderId

func (*CancelReplaceService) CancelReplaceMode

func (s *CancelReplaceService) CancelReplaceMode(cancelReplaceMode string) *CancelReplaceService

CancelReplaceMode set cancelReplaceMode

func (*CancelReplaceService) CancelRestrictions

func (s *CancelReplaceService) CancelRestrictions(cancelRestrictions string) *CancelReplaceService

CancelRestrictions set cancelRestrictions

func (*CancelReplaceService) Do

Do send request

func (*CancelReplaceService) IcebergQty

func (s *CancelReplaceService) IcebergQty(icebergQty float64) *CancelReplaceService

IcebergQty set icebergQty

func (*CancelReplaceService) NewClientOrderId

func (s *CancelReplaceService) NewClientOrderId(newClientOrderId string) *CancelReplaceService

NewClientOrderId set newClientOrderId

func (*CancelReplaceService) NewOrderRespType

func (s *CancelReplaceService) NewOrderRespType(newOrderRespType string) *CancelReplaceService

NewOrderRespType set newOrderRespType

func (*CancelReplaceService) OrderType

func (s *CancelReplaceService) OrderType(orderType string) *CancelReplaceService

OrderType set orderType

func (*CancelReplaceService) Price

Price set price

func (*CancelReplaceService) Quantity

func (s *CancelReplaceService) Quantity(quantity float64) *CancelReplaceService

Quantity set quantity

func (*CancelReplaceService) QuoteOrderQty

func (s *CancelReplaceService) QuoteOrderQty(quoteOrderQty float64) *CancelReplaceService

QuoteOrderQty set quoteOrderQty

func (*CancelReplaceService) SelfTradePreventionMode

func (s *CancelReplaceService) SelfTradePreventionMode(selfTradePreventionMode string) *CancelReplaceService

SelfTradePreventionMode set selfTradePreventionMode

func (*CancelReplaceService) Side

Side set side

func (*CancelReplaceService) StopPrice

func (s *CancelReplaceService) StopPrice(stopPrice float64) *CancelReplaceService

StopPrice set stopPrice

func (*CancelReplaceService) StrategyId

func (s *CancelReplaceService) StrategyId(strategyId int32) *CancelReplaceService

StrategyId set strategyId

func (*CancelReplaceService) StrategyType

func (s *CancelReplaceService) StrategyType(strategyType int32) *CancelReplaceService

StrategyType set strategyType

func (*CancelReplaceService) Symbol

Symbol set symbol

func (*CancelReplaceService) TimeInForce

func (s *CancelReplaceService) TimeInForce(timeInForce string) *CancelReplaceService

TimeInForce set timeInForce

func (*CancelReplaceService) TrailingDelta

func (s *CancelReplaceService) TrailingDelta(trailingDelta int64) *CancelReplaceService

TrailingDelta set trailingDelta

type Client

type Client struct {
	APIKey     string
	SecretKey  string
	BaseURL    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 string, secretKey string, baseURL ...string) *Client

Create client function for initialising new Binance client

func (*Client) NewAPIKeyPermissionService

func (c *Client) NewAPIKeyPermissionService() *APIKeyPermissionService

func (*Client) NewAccountApiTradingStatusService

func (c *Client) NewAccountApiTradingStatusService() *AccountApiTradingStatusService

func (*Client) NewAccountStatusService

func (c *Client) NewAccountStatusService() *AccountStatusService

func (*Client) NewAggTradesListService

func (c *Client) NewAggTradesListService() *AggTradesList

func (*Client) NewAllIsolatedMarginSymbolService

func (c *Client) NewAllIsolatedMarginSymbolService() *AllIsolatedMarginSymbolService

func (*Client) NewAssetDetailService

func (c *Client) NewAssetDetailService() *AssetDetailService

func (*Client) NewAssetDetailV2Service

func (c *Client) NewAssetDetailV2Service() *AssetDetailV2Service

func (*Client) NewAssetDividendRecordService

func (c *Client) NewAssetDividendRecordService() *AssetDividendRecordService

func (*Client) NewAutoConvertStableCoinService

func (c *Client) NewAutoConvertStableCoinService() *AutoConvertStableCoinService

func (*Client) NewAvgPriceService

func (c *Client) NewAvgPriceService() *AvgPrice

func (*Client) NewBUSDConvertHistoryService

func (c *Client) NewBUSDConvertHistoryService() *BUSDConvertHistoryService

func (*Client) NewBUSDConvertService

func (c *Client) NewBUSDConvertService() *BUSDConvertService

func (*Client) NewBorrowService

func (c *Client) NewBorrowService() *BorrowService

func (*Client) NewCancelOCOService

func (c *Client) NewCancelOCOService() *CancelOCOService

func (*Client) NewCancelOpenOrdersService

func (c *Client) NewCancelOpenOrdersService() *CancelOpenOrdersService

func (*Client) NewCancelOrderService

func (c *Client) NewCancelOrderService() *CancelOrderService

func (*Client) NewCancelReplaceService

func (c *Client) NewCancelReplaceService() *CancelReplaceService

func (*Client) NewCloseUserStream

func (c *Client) NewCloseUserStream() *CloseUserStream

func (*Client) NewCloudMiningPaymentHistoryService

func (c *Client) NewCloudMiningPaymentHistoryService() *CloudMiningPaymentHistoryService

func (*Client) NewCreateListenKeyService

func (c *Client) NewCreateListenKeyService() *CreateListenKey

User Data Streams:

func (*Client) NewCreateOrderService

func (c *Client) NewCreateOrderService() *CreateOrderService

func (*Client) NewCreateSubAccountService

func (c *Client) NewCreateSubAccountService() *CreateSubAccountService

Sub-Account Endpoints:

func (*Client) NewCrossMarginAccountDetailService

func (c *Client) NewCrossMarginAccountDetailService() *CrossMarginAccountDetailService

func (*Client) NewCrossMarginTransferHistoryService

func (c *Client) NewCrossMarginTransferHistoryService() *CrossMarginTransferHistoryService

func (*Client) NewDeleteIPListForSubAccountAPIKeyService

func (c *Client) NewDeleteIPListForSubAccountAPIKeyService() *DeleteIPListForSubAccountAPIKeyService

func (*Client) NewDepositAddressService

func (c *Client) NewDepositAddressService() *DepositAddressService

func (*Client) NewDepositAssetsIntoManagedSubAccountService

func (c *Client) NewDepositAssetsIntoManagedSubAccountService() *DepositAssetsIntoTheManagedSubAccountService

func (*Client) NewDepositHistoryService

func (c *Client) NewDepositHistoryService() *DepositHistoryService

func (*Client) NewDisableFastWithdrawSwitchService

func (c *Client) NewDisableFastWithdrawSwitchService() *DisableFastWithdrawSwitchService

func (*Client) NewDustLogService

func (c *Client) NewDustLogService() *DustLogService

func (*Client) NewDustTransferService

func (c *Client) NewDustTransferService() *DustTransferService

func (*Client) NewEnableFastWithdrawSwitchService

func (c *Client) NewEnableFastWithdrawSwitchService() *EnableFastWithdrawSwitchService

func (*Client) NewEnableFuturesForSubAccountService

func (c *Client) NewEnableFuturesForSubAccountService() *EnableFuturesForSubAccountService

func (*Client) NewEnableLeverageTokenForSubAccountService

func (c *Client) NewEnableLeverageTokenForSubAccountService() *EnableLeverageTokenForSubAccountService

func (*Client) NewEnableMarginForSubAccountService

func (c *Client) NewEnableMarginForSubAccountService() *EnableMarginForSubAccountService

func (*Client) NewExchangeInfoService

func (c *Client) NewExchangeInfoService() *ExchangeInfo

func (*Client) NewForceLiquidationRecordService

func (c *Client) NewForceLiquidationRecordService() *ForceLiquidationRecordService

func (*Client) NewFundingWalletService

func (c *Client) NewFundingWalletService() *FundingWalletService

func (*Client) NewFuturesTransferForSubAccountService

func (c *Client) NewFuturesTransferForSubAccountService() *FuturesTransferForSubAccountService

func (*Client) NewGetAccountService

func (c *Client) NewGetAccountService() *GetAccountService

func (*Client) NewGetAccountSnapshotService

func (c *Client) NewGetAccountSnapshotService() *GetAccountSnapshotService

func (*Client) NewGetAllCoinsInfoService

func (c *Client) NewGetAllCoinsInfoService() *GetAllCoinsInfoService

func (*Client) NewGetAllMarginAssetsService

func (c *Client) NewGetAllMarginAssetsService() *GetAllMarginAssetsService

func (*Client) NewGetAllMarginPairsService

func (c *Client) NewGetAllMarginPairsService() *GetAllMarginPairsService

func (*Client) NewGetAllOrdersService

func (c *Client) NewGetAllOrdersService() *GetAllOrdersService

func (*Client) NewGetDetailOnSubAccountFuturesAccountService

func (c *Client) NewGetDetailOnSubAccountFuturesAccountService() *GetDetailOnSubAccountFuturesAccountService

func (*Client) NewGetDetailOnSubAccountFuturesAccountV2Service

func (c *Client) NewGetDetailOnSubAccountFuturesAccountV2Service() *GetDetailOnSubAccountFuturesAccountV2Service

func (*Client) NewGetDetailOnSubAccountMarginAccountService

func (c *Client) NewGetDetailOnSubAccountMarginAccountService() *GetDetailOnSubAccountMarginAccountService

func (*Client) NewGetFuturesPositionRiskOfSubAccountService

func (c *Client) NewGetFuturesPositionRiskOfSubAccountService() *GetFuturesPositionRiskOfSubAccountService

func (*Client) NewGetFuturesPositionRiskOfSubAccountV2Service

func (c *Client) NewGetFuturesPositionRiskOfSubAccountV2Service() *GetFuturesPositionRiskOfSubAccountV2Service

func (*Client) NewGetIPRestrictionForSubAccountAPIKeyService

func (c *Client) NewGetIPRestrictionForSubAccountAPIKeyService() *GetIPRestrictionForSubAccountAPIKeyService

func (*Client) NewGetManagedSubAccountDepositAddressService

func (c *Client) NewGetManagedSubAccountDepositAddressService() *GetManagedSubAccountDepositAddressService

func (*Client) NewGetMyTradesService

func (c *Client) NewGetMyTradesService() *GetMyTradesService

func (*Client) NewGetOpenOrdersService

func (c *Client) NewGetOpenOrdersService() *GetOpenOrdersService

func (*Client) NewGetOrderService

func (c *Client) NewGetOrderService() *GetOrderService

func (*Client) NewGetQueryCurrentOrderCountUsageService

func (c *Client) NewGetQueryCurrentOrderCountUsageService() *GetQueryCurrentOrderCountUsageService

func (*Client) NewGetQueryPreventedMatchesService

func (c *Client) NewGetQueryPreventedMatchesService() *GetQueryPreventedMatchesService

func (*Client) NewGetStakingHistoryService

func (c *Client) NewGetStakingHistoryService() *GetStakingHistoryService

func (*Client) NewGetStakingProductListService

func (c *Client) NewGetStakingProductListService() *GetStakingProductListService

Staking Endpoints:

func (*Client) NewGetStakingProductPositionService

func (c *Client) NewGetStakingProductPositionService() *GetStakingProductPositionService

func (*Client) NewGetSubAccountDepositAddressService

func (c *Client) NewGetSubAccountDepositAddressService() *GetSubAccountDepositAddressService

func (*Client) NewGetSubAccountDepositHistoryService

func (c *Client) NewGetSubAccountDepositHistoryService() *GetSubAccountDepositHistoryService

func (*Client) NewGetSubAccountStatusService

func (c *Client) NewGetSubAccountStatusService() *GetSubAccountStatusService

func (*Client) NewGetSummaryOfSubAccountFuturesAccountService

func (c *Client) NewGetSummaryOfSubAccountFuturesAccountService() *GetSummaryOfSubAccountFuturesAccountService

func (*Client) NewGetSummaryOfSubAccountFuturesAccountV2Service

func (c *Client) NewGetSummaryOfSubAccountFuturesAccountV2Service() *GetSummaryOfSubAccountFuturesAccountV2Service

func (*Client) NewGetSummaryOfSubAccountMarginAccountService

func (c *Client) NewGetSummaryOfSubAccountMarginAccountService() *GetSummaryOfSubAccountMarginAccountService

func (*Client) NewGetSystemStatusService

func (c *Client) NewGetSystemStatusService() *GetSystemStatusService

Wallet Endpoints:

func (*Client) NewHistoricalTradeLookupService

func (c *Client) NewHistoricalTradeLookupService() *HistoricalTradeLookup

func (*Client) NewInterestHistoryService

func (c *Client) NewInterestHistoryService() *InterestHistoryService

func (*Client) NewKlinesService

func (c *Client) NewKlinesService() *Klines

func (*Client) NewLoanRecordService

func (c *Client) NewLoanRecordService() *LoanRecordService

func (*Client) NewMarginAccountAllOrderService

func (c *Client) NewMarginAccountAllOrderService() *MarginAccountAllOrderService

func (*Client) NewMarginAccountCancelAllOrdersService

func (c *Client) NewMarginAccountCancelAllOrdersService() *MarginAccountCancelAllOrdersService

func (*Client) NewMarginAccountCancelOCOService

func (c *Client) NewMarginAccountCancelOCOService() *MarginAccountCancelOCOService

func (*Client) NewMarginAccountCancelOrderService

func (c *Client) NewMarginAccountCancelOrderService() *MarginAccountCancelOrderService

func (*Client) NewMarginAccountNewOCOService

func (c *Client) NewMarginAccountNewOCOService() *MarginAccountNewOCOService

func (*Client) NewMarginAccountNewOrderService

func (c *Client) NewMarginAccountNewOrderService() *MarginAccountNewOrderService

func (*Client) NewMarginAccountOpenOrderService

func (c *Client) NewMarginAccountOpenOrderService() *MarginAccountOpenOrderService

func (*Client) NewMarginAccountOrderService

func (c *Client) NewMarginAccountOrderService() *MarginAccountOrderService

func (*Client) NewMarginAccountQueryAllOCOService

func (c *Client) NewMarginAccountQueryAllOCOService() *MarginAccountQueryAllOCOService

func (*Client) NewMarginAccountQueryMaxBorrowService

func (c *Client) NewMarginAccountQueryMaxBorrowService() *MarginAccountQueryMaxBorrowService

func (*Client) NewMarginAccountQueryMaxTransferOutAmountService

func (c *Client) NewMarginAccountQueryMaxTransferOutAmountService() *MarginAccountQueryMaxTransferOutAmountService

func (*Client) NewMarginAccountQueryOCOService

func (c *Client) NewMarginAccountQueryOCOService() *MarginAccountQueryOCOService

func (*Client) NewMarginAccountQueryOpenOCOService

func (c *Client) NewMarginAccountQueryOpenOCOService() *MarginAccountQueryOpenOCOService

func (*Client) NewMarginAccountQueryTradeListService

func (c *Client) NewMarginAccountQueryTradeListService() *MarginAccountQueryTradeListService

func (*Client) NewMarginAccountSummaryService

func (c *Client) NewMarginAccountSummaryService() *MarginAccountSummaryService

func (*Client) NewMarginBnbBurnStatusService

func (c *Client) NewMarginBnbBurnStatusService() *MarginBnbBurnStatusService

func (*Client) NewMarginCrossCollateralRatioService

func (c *Client) NewMarginCrossCollateralRatioService() *MarginCrossCollateralRatioService

func (*Client) NewMarginCrossMarginFeeService

func (c *Client) NewMarginCrossMarginFeeService() *MarginCrossMarginFeeService

func (*Client) NewMarginCurrentOrderCountService

func (c *Client) NewMarginCurrentOrderCountService() *MarginCurrentOrderCountService

func (*Client) NewMarginDustlogService

func (c *Client) NewMarginDustlogService() *MarginDustlogService

func (*Client) NewMarginInterestRateHistoryService

func (c *Client) NewMarginInterestRateHistoryService() *MarginInterestRateHistoryService

func (*Client) NewMarginIsolatedAccountDisableService

func (c *Client) NewMarginIsolatedAccountDisableService() *MarginIsolatedAccountDisableService

func (*Client) NewMarginIsolatedAccountEnableService

func (c *Client) NewMarginIsolatedAccountEnableService() *MarginIsolatedAccountEnableService

func (*Client) NewMarginIsolatedAccountInfoService

func (c *Client) NewMarginIsolatedAccountInfoService() *MarginIsolatedAccountInfoService

func (*Client) NewMarginIsolatedAccountLimitService

func (c *Client) NewMarginIsolatedAccountLimitService() *MarginIsolatedAccountLimitService

func (*Client) NewMarginIsolatedAccountTransferHistoryService

func (c *Client) NewMarginIsolatedAccountTransferHistoryService() *MarginIsolatedAccountTransferHistoryService

func (*Client) NewMarginIsolatedAccountTransferService

func (c *Client) NewMarginIsolatedAccountTransferService() *MarginIsolatedAccountTransferService

func (*Client) NewMarginIsolatedMarginFeeService

func (c *Client) NewMarginIsolatedMarginFeeService() *MarginIsolatedMarginFeeService

func (*Client) NewMarginIsolatedMarginTierService

func (c *Client) NewMarginIsolatedMarginTierService() *MarginIsolatedMarginTierService

func (*Client) NewMarginIsolatedSymbolService

func (c *Client) NewMarginIsolatedSymbolService() *MarginIsolatedSymbolService

func (*Client) NewMarginSmallLiabilityExchangeCoinListService

func (c *Client) NewMarginSmallLiabilityExchangeCoinListService() *MarginSmallLiabilityExchangeCoinListService

func (*Client) NewMarginSmallLiabilityExchangeHistoryService

func (c *Client) NewMarginSmallLiabilityExchangeHistoryService() *MarginSmallLiabilityExchangeHistoryService

func (*Client) NewMarginSmallLiabilityExchangeService

func (c *Client) NewMarginSmallLiabilityExchangeService() *MarginSmallLiabilityExchangeService

func (*Client) NewMarginToggleBnbBurnService

func (c *Client) NewMarginToggleBnbBurnService() *MarginToggleBnbBurnService

func (*Client) NewMarginTransferForSubAccountService

func (c *Client) NewMarginTransferForSubAccountService() *MarginTransferForSubAccountService

func (*Client) NewNewOCOService

func (c *Client) NewNewOCOService() *NewOCOService

func (*Client) NewOrderBookService

func (c *Client) NewOrderBookService() *OrderBook

func (*Client) NewPersonalLeftQuotaService

func (c *Client) NewPersonalLeftQuotaService() *PersonalLeftQuotaService

func (*Client) NewPingService

func (c *Client) NewPingService() *Ping

Market Endpoints:

func (*Client) NewPingUserStream

func (c *Client) NewPingUserStream() *PingUserStream

func (*Client) NewPurchaseStakingProductService

func (c *Client) NewPurchaseStakingProductService() *PurchaseStakingProductService

func (*Client) NewQueryAllOCOService

func (c *Client) NewQueryAllOCOService() *QueryAllOCOService

func (*Client) NewQueryCrossMarginPairService

func (c *Client) NewQueryCrossMarginPairService() *QueryCrossMarginPairService

func (*Client) NewQueryManagedSubAccountAssetDetailsService

func (c *Client) NewQueryManagedSubAccountAssetDetailsService() *QueryManagedSubAccountAssetDetailsService

func (*Client) NewQueryManagedSubAccountFuturesAssetDetailsService

func (c *Client) NewQueryManagedSubAccountFuturesAssetDetailsService() *QueryManagedSubAccountFuturesAssetDetailsService

func (*Client) NewQueryManagedSubAccountList

func (c *Client) NewQueryManagedSubAccountList() *QueryManagedSubAccountList

func (*Client) NewQueryManagedSubAccountMarginAssetDetailsService

func (c *Client) NewQueryManagedSubAccountMarginAssetDetailsService() *QueryManagedSubAccountMarginAssetDetailsService

func (*Client) NewQueryManagedSubAccountSnapshotService

func (c *Client) NewQueryManagedSubAccountSnapshotService() *QueryManagedSubAccountSnapshotService

func (*Client) NewQueryManagedSubAccountTransferLogForTradingTeamService

func (c *Client) NewQueryManagedSubAccountTransferLogForTradingTeamService() *QueryManagedSubAccountTransferLogForTradingTeamService

func (*Client) NewQueryManagedSubAccountTransferLogService

func (c *Client) NewQueryManagedSubAccountTransferLogService() *QueryManagedSubAccountTransferLogService

func (*Client) NewQueryMarginAssetService

func (c *Client) NewQueryMarginAssetService() *QueryMarginAssetService

func (*Client) NewQueryMarginPriceIndexService

func (c *Client) NewQueryMarginPriceIndexService() *QueryMarginPriceIndexService

func (*Client) NewQueryOCOService

func (c *Client) NewQueryOCOService() *QueryOCOService

func (*Client) NewQueryOpenOCOService

func (c *Client) NewQueryOpenOCOService() *QueryOpenOCOService

func (*Client) NewQuerySubAccountAssetsForMasterAccountService

func (c *Client) NewQuerySubAccountAssetsForMasterAccountService() *QuerySubAccountAssetsForMasterAccountService

func (*Client) NewQuerySubAccountAssetsService

func (c *Client) NewQuerySubAccountAssetsService() *QuerySubAccountAssetsService

func (*Client) NewQuerySubAccountFuturesAssetTransferHistoryService

func (c *Client) NewQuerySubAccountFuturesAssetTransferHistoryService() *QuerySubAccountFuturesAssetTransferHistoryService

func (*Client) NewQuerySubAccountListService

func (c *Client) NewQuerySubAccountListService() *QuerySubAccountListService

func (*Client) NewQuerySubAccountSpotAssetTransferHistoryService

func (c *Client) NewQuerySubAccountSpotAssetTransferHistoryService() *QuerySubAccountSpotAssetTransferHistoryService

func (*Client) NewQuerySubAccountSpotAssetsSummaryService

func (c *Client) NewQuerySubAccountSpotAssetsSummaryService() *QuerySubAccountSpotAssetsSummaryService

func (*Client) NewQuerySubAccountTransactionTatistics

func (c *Client) NewQuerySubAccountTransactionTatistics() *QuerySubAccountTransactionTatistics

func (*Client) NewQueryUniversalTransferHistoryService

func (c *Client) NewQueryUniversalTransferHistoryService() *QueryUniversalTransferHistoryService

func (*Client) NewRecentTradesListService

func (c *Client) NewRecentTradesListService() *RecentTradesList

func (*Client) NewRedeemStakingProductService

func (c *Client) NewRedeemStakingProductService() *RedeemStakingProductService

func (*Client) NewRepayRecordService

func (c *Client) NewRepayRecordService() *RepayRecordService

func (*Client) NewRepayService

func (c *Client) NewRepayService() *RepayService

func (*Client) NewServerTimeService

func (c *Client) NewServerTimeService() *ServerTime

func (*Client) NewSetAutoStakingService

func (c *Client) NewSetAutoStakingService() *SetAutoStakingService

func (*Client) NewSubAccountFuturesAssetTransferService

func (c *Client) NewSubAccountFuturesAssetTransferService() *SubAccountFuturesAssetTransferService

func (*Client) NewSubAccountTransferHistoryService

func (c *Client) NewSubAccountTransferHistoryService() *SubAccountTransferHistoryService

func (*Client) NewTestNewOrder

func (c *Client) NewTestNewOrder() *TestNewOrder

Account Endpoints:

func (*Client) NewTicker24hrService

func (c *Client) NewTicker24hrService() *Ticker24hr

func (*Client) NewTickerBookTickerService

func (c *Client) NewTickerBookTickerService() *TickerBookTicker

func (*Client) NewTickerPriceService

func (c *Client) NewTickerPriceService() *TickerPrice

func (*Client) NewTickerService

func (c *Client) NewTickerService() *Ticker

func (*Client) NewTradeFeeService

func (c *Client) NewTradeFeeService() *TradeFeeService

func (*Client) NewTransferService

func (c *Client) NewTransferService() *TransferService

Margin Endpoints:

func (*Client) NewTransferToMasterService

func (c *Client) NewTransferToMasterService() *TransferToMasterService

func (*Client) NewTransferToSubAccountOfSameMasterService

func (c *Client) NewTransferToSubAccountOfSameMasterService() *TransferToSubAccountOfSameMasterService

func (*Client) NewUIKlinesService

func (c *Client) NewUIKlinesService() *UiKlines

func (*Client) NewUniversalTransferService

func (c *Client) NewUniversalTransferService() *UniversalTransferService

func (*Client) NewUpdateIPRestrictionForSubAccountAPIKeyService

func (c *Client) NewUpdateIPRestrictionForSubAccountAPIKeyService() *UpdateIPRestrictionForSubAccountAPIKeyService

func (*Client) NewUserAssetService

func (c *Client) NewUserAssetService() *UserAssetService

func (*Client) NewUserUniversalTransferHistoryService

func (c *Client) NewUserUniversalTransferHistoryService() *UserUniversalTransferHistoryService

func (*Client) NewUserUniversalTransferService

func (c *Client) NewUserUniversalTransferService() *UserUniversalTransferService

func (*Client) NewWithdrawAssetsFromTheManagedSubAccountService

func (c *Client) NewWithdrawAssetsFromTheManagedSubAccountService() *WithdrawAssetsFromTheManagedSubAccountService

func (*Client) NewWithdrawHistoryService

func (c *Client) NewWithdrawHistoryService() *WithdrawHistoryService

func (*Client) NewWithdrawService

func (c *Client) NewWithdrawService() *WithdrawService

type CloseUserStream

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

CloseUserStream delete listen key

func (*CloseUserStream) Do

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

Do send request

func (*CloseUserStream) ListenKey

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

ListenKey set listen key

type CloudMiningPaymentHistoryResponse

type CloudMiningPaymentHistoryResponse struct {
	Total int32 `json:"total"`
	Rows  []struct {
		CreateTime uint64 `json:"createTime"`
		TranId     int64  `json:"tranId"`
		Type       int32  `json:"type"`
		Asset      string `json:"asset"`
		Amount     string `json:"amount"`
		Status     string `json:"status"`
	} `json:"rows"`
}

CloudMiningPaymentHistoryResponse define response of CloudMiningPaymentHistoryService

type CloudMiningPaymentHistoryService

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

CloudMiningPaymentHistoryService cloud mining payment history

func (*CloudMiningPaymentHistoryService) Asset

Asset set asset

func (*CloudMiningPaymentHistoryService) ClientTranId

ClientTranId set clientTranId

func (*CloudMiningPaymentHistoryService) Current

Current set current

func (*CloudMiningPaymentHistoryService) Do

func (*CloudMiningPaymentHistoryService) EndTime

EndTime set endTime

func (*CloudMiningPaymentHistoryService) Size

Size set size

func (*CloudMiningPaymentHistoryService) StartTime

StartTime set startTime

func (*CloudMiningPaymentHistoryService) Tranid

Tranid set tranid

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      []struct {
		AddressRegex            string `json:"addressRegex"`
		Coin                    string `json:"coin"`
		DepositDesc             string `json:"depositDesc"`
		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"`
		WithdrawEnable          bool   `json:"withdrawEnable"`
		WithdrawFee             string `json:"withdrawFee"`
		WithdrawIntegerMultiple string `json:"withdrawIntegerMultiple"`
		WithdrawMax             string `json:"withdrawMax"`
		WithdrawMin             string `json:"withdrawMin"`
		SameAddress             bool   `json:"sameAddress"`
		EstimatedArrivalTime    uint64 `json:"estimatedArrivalTime"`
		Busy                    bool   `json:"busy"`
	} `json:"networkList"`
	Storage           string `json:"storage"`
	Trading           bool   `json:"trading"`
	WithdrawAllEnable bool   `json:"withdrawAllEnable"`
	Withdrawing       string `json:"withdrawing"`
}

CoinInfo define response of GetAllCoinsInfoService

type CreateListenKey

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

Create Listen Key

func (*CreateListenKey) Do

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

Do send request

type CreateOrderResponseACK

type CreateOrderResponseACK struct {
	Symbol        string `json:"symbol"`
	OrderId       int64  `json:"orderId"`
	OrderListId   int64  `json:"orderListId"`
	ClientOrderId string `json:"clientOrderId"`
	TransactTime  uint64 `json:"transactTime"`
}

Create CreateOrderResponseACK

type CreateOrderResponseFULL

type CreateOrderResponseFULL struct {
	Symbol                  string `json:"symbol"`
	OrderId                 int64  `json:"orderId"`
	OrderListId             int64  `json:"orderListId"`
	ClientOrderId           string `json:"clientOrderId"`
	TransactTime            uint64 `json:"transactTime"`
	Price                   string `json:"price"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumulativeQuoteQty      string `json:"cummulativeQuoteQty"`
	Status                  string `json:"status"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	Side                    string `json:"side"`
	WorkingTime             uint64 `json:"workingTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	IcebergQty              string `json:"icebergQty,omitempty"`
	PreventedMatchId        int64  `json:"preventedMatchId,omitempty"`
	PreventedQuantity       string `json:"preventedQuantity,omitempty"`
	StopPrice               string `json:"stopPrice,omitempty"`
	StrategyId              int64  `json:"strategyId,omitempty"`
	StrategyType            int64  `json:"strategyType,omitempty"`
	TrailingDelta           string `json:"trailingDelta,omitempty"`
	TrailingTime            int64  `json:"trailingTime,omitempty"`
	Fills                   []struct {
		Price           string `json:"price"`
		Qty             string `json:"qty"`
		Commission      string `json:"commission"`
		CommissionAsset string `json:"commissionAsset"`
		TradeId         int64  `json:"tradeId"`
	} `json:"fills"`
}

Create CreateOrderResponseFULL

type CreateOrderResponseRESULT

type CreateOrderResponseRESULT struct {
	Symbol                  string `json:"symbol"`
	OrderId                 int64  `json:"orderId"`
	OrderListId             int64  `json:"orderListId"`
	ClientOrderId           string `json:"clientOrderId"`
	TransactTime            uint64 `json:"transactTime"`
	Price                   string `json:"price"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumulativeQuoteQty      string `json:"cummulativeQuoteQty"`
	Status                  string `json:"status"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	Side                    string `json:"side"`
	WorkingTime             uint64 `json:"workingTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	IcebergQty              string `json:"icebergQty,omitempty"`
	PreventedMatchId        int64  `json:"preventedMatchId,omitempty"`
	PreventedQuantity       string `json:"preventedQuantity,omitempty"`
	StopPrice               string `json:"stopPrice,omitempty"`
	StrategyId              int64  `json:"strategyId,omitempty"`
	StrategyType            int64  `json:"strategyType,omitempty"`
	TrailingDelta           string `json:"trailingDelta,omitempty"`
	TrailingTime            int64  `json:"trailingTime,omitempty"`
}

Create CreateOrderResponseRESULT

type CreateOrderService

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

Binance New Order endpoint (POST /api/v3/order) CreateOrderService create order

func (*CreateOrderService) Do

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

Do send request

func (*CreateOrderService) IcebergQuantity

func (s *CreateOrderService) IcebergQuantity(icebergQty float64) *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 string) *CreateOrderService

NewOrderRespType set newOrderRespType

func (*CreateOrderService) Price

Price set price

func (*CreateOrderService) Quantity

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

Quantity set quantity

func (*CreateOrderService) QuoteOrderQty

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

QuoteOrderQty set quoteOrderQty

func (*CreateOrderService) SelfTradePreventionMode

func (s *CreateOrderService) SelfTradePreventionMode(selfTradePreventionMode string) *CreateOrderService

SelfTradePreventionMode set selfTradePreventionMode

func (*CreateOrderService) Side

Side set side

func (*CreateOrderService) StopPrice

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

StopPrice set stopPrice

func (*CreateOrderService) StrategyId

func (s *CreateOrderService) StrategyId(strategyId int) *CreateOrderService

StrategyId set strategyId

func (*CreateOrderService) StrategyType

func (s *CreateOrderService) StrategyType(strategyType int) *CreateOrderService

StrategyType set strategyType

func (*CreateOrderService) Symbol

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

Symbol set symbol

func (*CreateOrderService) TimeInForce

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

TimeInForce set timeInForce

func (*CreateOrderService) TrailingDelta

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

TrailingDelta set trailingDelta

func (*CreateOrderService) Type

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

Type set type

type CreateSubAccountResp

type CreateSubAccountResp struct {
	Email string `json:"email"`
}

type CreateSubAccountService

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

func (*CreateSubAccountService) Do

func (*CreateSubAccountService) SubAccountString

func (s *CreateSubAccountService) SubAccountString(subAccountString string) *CreateSubAccountService

type CrossMarginAccountDetailResponse

type CrossMarginAccountDetailResponse 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          []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"`
	} `json:"userAssets"`
}

CrossMarginAccountDetailResponse define cross margin account detail response

type CrossMarginAccountDetailService

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

CrossMarginAccountDetailService query cross margin account details

func (*CrossMarginAccountDetailService) Do

Do send request

type CrossMarginTransferHistoryResponse

type CrossMarginTransferHistoryResponse struct {
	Rows []struct {
		Amount    string `json:"amount"`
		Asset     string `json:"asset"`
		Status    string `json:"status"`
		Timestamp uint64 `json:"timestamp"`
		TxId      int64  `json:"txId"`
		Type      string `json:"type"`
	} `json:"rows"`
	Total int `json:"total"`
}

CrossMarginTransferHistoryResponse define cross margin transfer history response

type CrossMarginTransferHistoryService

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

CrossMarginTransferHistoryService get cross margin transfer history

func (*CrossMarginTransferHistoryService) Archived

Archived set archived

func (*CrossMarginTransferHistoryService) Asset

Asset set asset

func (*CrossMarginTransferHistoryService) Current

Current set current

func (*CrossMarginTransferHistoryService) Do

Do send request

func (*CrossMarginTransferHistoryService) EndTime

EndTime set endTime

func (*CrossMarginTransferHistoryService) OrderType

OrderType set orderType

func (*CrossMarginTransferHistoryService) Size

Size set size

func (*CrossMarginTransferHistoryService) StartTime

StartTime set startTime

type DeleteIPListForSubAccountAPIKeyResp

type DeleteIPListForSubAccountAPIKeyResp struct {
	IpRestrict string `json:"ipRestrict"`
	IpList     []struct {
		Ip string `json:"ip"`
	} `json:"ipList"`
	UpdateTime uint64 `json:"updateTime"`
	ApiKey     string `json:"apiKey"`
}

type DeleteIPListForSubAccountAPIKeyService

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

func (*DeleteIPListForSubAccountAPIKeyService) Do

func (*DeleteIPListForSubAccountAPIKeyService) Email

func (*DeleteIPListForSubAccountAPIKeyService) IpAddress

func (*DeleteIPListForSubAccountAPIKeyService) SubAccountApiKey

type DepositAddressResponse

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

DepositAddressResponse define response of DepositAddressService

type DepositAddressService

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

DepositAddressService deposit address

func (*DepositAddressService) Coin

Coin set coin

func (*DepositAddressService) Do

func (*DepositAddressService) Network

func (s *DepositAddressService) Network(network string) *DepositAddressService

Network set network

type DepositAssetsIntoTheManagedSubAccountResp

type DepositAssetsIntoTheManagedSubAccountResp struct {
	TranId int64 `json:"tranId"`
}

type DepositAssetsIntoTheManagedSubAccountService

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

func (*DepositAssetsIntoTheManagedSubAccountService) Amount

func (*DepositAssetsIntoTheManagedSubAccountService) Asset

func (*DepositAssetsIntoTheManagedSubAccountService) Do

func (*DepositAssetsIntoTheManagedSubAccountService) ToEmail

type DepositHistoryResponse

type DepositHistoryResponse struct {
	Id            string `json:"id"`
	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    uint64 `json:"insertTime"`
	TransferType  int    `json:"transferType"`
	ConfirmTimes  string `json:"confirmTimes"`
	UnlockConfirm int    `json:"unlockConfirm"`
	WalletType    int    `json:"walletType"`
}

DepositHistoryResponse define response of DepositHistoryService

type DepositHistoryService

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

DepositHistoryService deposit history

func (*DepositHistoryService) Coin

Coin set coin

func (*DepositHistoryService) Do

func (*DepositHistoryService) EndTime

func (s *DepositHistoryService) EndTime(endTime uint64) *DepositHistoryService

EndTime set endTime

func (*DepositHistoryService) Limit

Limit set limit

func (*DepositHistoryService) Offset

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

Offset set offset

func (*DepositHistoryService) StartTime

func (s *DepositHistoryService) StartTime(startTime uint64) *DepositHistoryService

StartTime set startTime

func (*DepositHistoryService) Status

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

Status set status

func (*DepositHistoryService) TxId

TxId set txid

type DisableFastWithdrawSwitchResponse

type DisableFastWithdrawSwitchResponse struct {
}

DisableFastWithdrawSwitchResponse define response of DisableFastWithdrawSwitchService This endpoint has empty response

type DisableFastWithdrawSwitchService

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

DisableFastWithdrawSwitchService disable fast withdraw switch

func (*DisableFastWithdrawSwitchService) Do

type DustLogResponse

type DustLogResponse struct {
	Total              int `json:"total"`
	UserAssetDribblets []struct {
		OperateTime              uint64 `json:"operateTime"`
		TotalTransferedAmount    string `json:"totalTransferedAmount"`
		TotalServiceChargeAmount string `json:"totalServiceChargeAmount"`
		TransId                  int64  `json:"transId"`
		UserAssetDribbletDetails []struct {
			TransId             int64  `json:"transId"`
			ServiceChargeAmount string `json:"serviceChargeAmount"`
			Amount              string `json:"amount"`
			OperateTime         uint64 `json:"operateTime"`
			TransferedAmount    string `json:"transferedAmount"`
			FromAsset           string `json:"fromAsset"`
		} `json:"userAssetDribbletDetails"`
	} `json:"userAssetDribblets"`
}

DustLogResponse define response of DustLogService

type DustLogService

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

DustLogService dust log

func (*DustLogService) Do

func (s *DustLogService) Do(ctx context.Context) (res *DustLogResponse, err error)

func (*DustLogService) EndTime

func (s *DustLogService) EndTime(endTime uint64) *DustLogService

EndTime set endTime

func (*DustLogService) StartTime

func (s *DustLogService) StartTime(startTime uint64) *DustLogService

StartTime set startTime

type DustTransferResponse

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

DustTransferResponse define response of 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 dust transfer

func (*DustTransferService) Asset

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

Asset set asset

func (*DustTransferService) Do

type EnableFastWithdrawSwitchResponse

type EnableFastWithdrawSwitchResponse struct {
}

EnableFastWithdrawSwitchResponse define response of EnableFastWithdrawSwitchService This endpoint has empty response

type EnableFastWithdrawSwitchService

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

EnableFastWithdrawSwitchService enable fast withdraw switch

func (*EnableFastWithdrawSwitchService) Do

type EnableFuturesForSubAccountResp

type EnableFuturesForSubAccountResp struct {
	Email            string `json:"email"`
	IsFuturesEnabled bool   `json:"isFuturesEnabled"`
}

type EnableFuturesForSubAccountService

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

func (*EnableFuturesForSubAccountService) Do

func (*EnableFuturesForSubAccountService) Email

type EnableLeverageTokenForSubAccountResp

type EnableLeverageTokenForSubAccountResp struct {
	Email      string `json:"email"`
	EnableBlvt bool   `json:"enableBlvt"`
}

type EnableLeverageTokenForSubAccountService

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

func (*EnableLeverageTokenForSubAccountService) Do

func (*EnableLeverageTokenForSubAccountService) Email

func (*EnableLeverageTokenForSubAccountService) EnableBlvt

type EnableMarginForSubAccountResp

type EnableMarginForSubAccountResp struct {
	Email           string `json:"email"`
	IsMarginEnabled bool   `json:"isMarginEnabled"`
}

type EnableMarginForSubAccountService

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

func (*EnableMarginForSubAccountService) Do

func (*EnableMarginForSubAccountService) Email

type ErrHandler

type ErrHandler func(err error)

ErrHandler handles errors

type ExchangeFilter

type ExchangeFilter struct {
	FilterType string `json:"filterType"`
	MaxNumAlgo int64  `json:"maxNumAlgoOrders"`
}

ExchangeFilter define exchange filter

type ExchangeInfo

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

Binance Exchange Information endpoint (GET /api/v3/exchangeInfo)

func (*ExchangeInfo) Do

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

Send the request

type ExchangeInfoResponse

type ExchangeInfoResponse struct {
	Timezone        string            `json:"timezone"`
	ServerTime      uint64            `json:"serverTime"`
	RateLimits      []*RateLimit      `json:"rateLimits"`
	ExchangeFilters []*ExchangeFilter `json:"exchangeFilters"`
	Symbols         []*SymbolInfo     `json:"symbols"`
}

ExchangeInfoResponse define exchange info response

type ForceLiquidationRecordResponse

type ForceLiquidationRecordResponse struct {
	Rows []struct {
		AvgPrice    string `json:"avgPrice"`
		ExecutedQty string `json:"executedQty"`
		OrderId     int    `json:"orderId"`
		Price       string `json:"price"`
		Qty         string `json:"qty"`
		Side        string `json:"side"`
		Symbol      string `json:"symbol"`
		TimeInForce string `json:"timeInForce"`
		IsIsolated  bool   `json:"isIsolated"`
		UpdatedTime uint64 `json:"updatedTime"`
	} `json:"rows"`
	Total int `json:"total"`
}

ForceLiquidationRecordResponse define force liquidation record response

type ForceLiquidationRecordService

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

ForceLiquidationRecordService query force liquidation record

func (*ForceLiquidationRecordService) Current

Current set current

func (*ForceLiquidationRecordService) Do

Do send request

func (*ForceLiquidationRecordService) EndTime

EndTime set endTime

func (*ForceLiquidationRecordService) IsolatedSymbol

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

IsolatedSymbol set isolatedSymbol

func (*ForceLiquidationRecordService) Size

Size set size

func (*ForceLiquidationRecordService) StartTime

StartTime set startTime

type FundingWalletResponse

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

FundingWalletResponse define response of FundingWalletService

type FundingWalletService

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

FundingWalletService funding wallet

func (*FundingWalletService) Asset

Asset set asset

func (*FundingWalletService) Do

func (*FundingWalletService) NeedBtcValuation

func (s *FundingWalletService) NeedBtcValuation(needBtcValuation string) *FundingWalletService

NeedBtcValuation set needBtcValuation

type FuturesTransferForSubAccountResp

type FuturesTransferForSubAccountResp struct {
	TxnId int `json:"txnId"`
}

type FuturesTransferForSubAccountService

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

func (*FuturesTransferForSubAccountService) Amount

func (*FuturesTransferForSubAccountService) Asset

func (*FuturesTransferForSubAccountService) Do

func (*FuturesTransferForSubAccountService) Email

func (*FuturesTransferForSubAccountService) TransferType

type GetAccountService

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

Binance Account Information (USER_DATA) (GET /api/v3/account) GetAccountService get account information

func (*GetAccountService) Do

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

Do send request

type GetAccountSnapshotService

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

GetAccountSnapshotService get all orders from account

func (*GetAccountSnapshotService) Do

func (*GetAccountSnapshotService) EndTime

EndTime set end time

func (*GetAccountSnapshotService) Limit

Limit set limit

func (*GetAccountSnapshotService) MarketType

func (s *GetAccountSnapshotService) MarketType(marketType string) *GetAccountSnapshotService

MarketType set market type

func (*GetAccountSnapshotService) StartTime

StartTime set start time

type GetAllCoinsInfoService

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

GetAllCoinsInfoService get all coins' information

func (*GetAllCoinsInfoService) Do

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

type GetAllMarginAssetsResponse

type GetAllMarginAssetsResponse struct {
	AssetDetailList []struct {
		AssetFullName  string `json:"assetFullName"`
		AssetName      string `json:"assetName"`
		IsBorrowable   bool   `json:"isBorrowable"`
		IsMortgageable bool   `json:"isMortgageable"`
		MinLoanAmt     string `json:"minLoanAmt"`
		MaxLoanAmt     string `json:"maxLoanAmt"`
		MinMortgageAmt string `json:"minMortgageAmt"`
		MaxMortgageAmt string `json:"maxMortgageAmt"`
		Asset          string `json:"asset"`
	} `json:"assetDetailList"`
}

GetAllMarginAssetsResponse define get all margin assets response

type GetAllMarginAssetsService

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

GetAllMarginAssetsService get all margin assets

func (*GetAllMarginAssetsService) Do

Do send request

type GetAllMarginPairsResponse

type GetAllMarginPairsResponse struct {
	SymbolDetailList []struct {
		Base          string `json:"base"`
		Id            int    `json:"id"`
		IsBuyAllowed  bool   `json:"isBuyAllowed"`
		IsMarginTrade bool   `json:"isMarginTrade"`
		IsSellAllowed bool   `json:"isSellAllowed"`
		Quote         string `json:"quote"`
		Symbol        string `json:"symbol"`
	} `json:"symbolDetailList"`
}

GetAllMarginPairsResponse define get all margin pairs response

type GetAllMarginPairsService

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

GetAllMarginPairsService get all margin pairs

func (*GetAllMarginPairsService) Do

Do send request

type GetAllOrdersService

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

Binance Get all account orders; active, canceled, or filled (GET /api/v3/allOrders) GetAllOrdersService get all orders

func (*GetAllOrdersService) Do

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

Do send request

func (*GetAllOrdersService) EndTime

func (s *GetAllOrdersService) EndTime(endTime uint64) *GetAllOrdersService

EndTime set endTime

func (*GetAllOrdersService) Limit

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

Limit set limit

func (*GetAllOrdersService) OrderId

func (s *GetAllOrdersService) OrderId(orderId int64) *GetAllOrdersService

OrderId set orderId

func (*GetAllOrdersService) StartTime

func (s *GetAllOrdersService) StartTime(startTime uint64) *GetAllOrdersService

StartTime set startTime

func (*GetAllOrdersService) Symbol

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

Symbol set symbol

type GetDetailOnSubAccountFuturesAccountResp

type GetDetailOnSubAccountFuturesAccountResp struct {
	Email  string `json:"email"`
	Asset  string `json:"asset"`
	Assets []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"`
	} `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                  uint64 `json:"updateTime"`
}

type GetDetailOnSubAccountFuturesAccountService

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

func (*GetDetailOnSubAccountFuturesAccountService) Do

func (*GetDetailOnSubAccountFuturesAccountService) Email

type GetDetailOnSubAccountFuturesAccountV2COINResp

type GetDetailOnSubAccountFuturesAccountV2COINResp struct {
	DeliveryAccountResp struct {
		Email  string `json:"email"`
		Assets []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"`
		} `json:"assets"`
		CanDeposit  bool   `json:"canDeposit"`
		CanTrade    bool   `json:"canTrade"`
		CanWithdraw bool   `json:"canWithdraw"`
		FeeTier     int    `json:"feeTier"`
		UpdateTime  uint64 `json:"updateTime"`
	} `json:"deliveryAccountResp"`
}

type GetDetailOnSubAccountFuturesAccountV2Service

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

func (*GetDetailOnSubAccountFuturesAccountV2Service) Do

func (s *GetDetailOnSubAccountFuturesAccountV2Service) Do(ctx context.Context, opts ...RequestOption) (res interface{}, err error)

func (*GetDetailOnSubAccountFuturesAccountV2Service) Email

func (*GetDetailOnSubAccountFuturesAccountV2Service) FuturesType

type GetDetailOnSubAccountFuturesAccountV2USDTResp

type GetDetailOnSubAccountFuturesAccountV2USDTResp struct {
	FutureAccountResp struct {
		Email  string `json:"email"`
		Assets []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"`
		} `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                  uint64 `json:"updateTime"`
	} `json:"futureAccountResp"`
}

type GetDetailOnSubAccountMarginAccountResp

type GetDetailOnSubAccountMarginAccountResp struct {
	Email               string `json:"email"`
	MarginLevel         string `json:"marginLevel"`
	TotalAssetOfBtc     string `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string `json:"totalNetAssetOfBtc"`
	MarginTradeCoeffVo  struct {
		ForceLiquidationRate string `json:"forceLiquidationRate"`
		MarginCallBar        string `json:"marginCallBar"`
		NormalBar            string `json:"normalBar"`
	} `json:"marginTradeCoeffVo"`
	MarginUserAssetVoList []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"`
	}
}

type GetDetailOnSubAccountMarginAccountService

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

func (*GetDetailOnSubAccountMarginAccountService) Do

func (*GetDetailOnSubAccountMarginAccountService) Email

type GetFuturesPositionRiskOfSubAccountResp

type GetFuturesPositionRiskOfSubAccountResp struct {
	EntryPrice       string `json:"entryPrice"`
	Leverage         string `json:"leverage"`
	MaxNotional      string `json:"maxNotional"`
	LiquidationPrice string `json:"liquidationPrice"`
	MarkPrice        string `json:"markPrice"`
	PositionAmount   string `json:"positionAmount"`
	Symbol           string `json:"symbol"`
	UnrealizedProfit string `json:"unrealizedProfit"`
}

type GetFuturesPositionRiskOfSubAccountService

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

func (*GetFuturesPositionRiskOfSubAccountService) Do

func (*GetFuturesPositionRiskOfSubAccountService) Email

type GetFuturesPositionRiskOfSubAccountV2COINResp

type GetFuturesPositionRiskOfSubAccountV2COINResp struct {
	DeliveryPositionRiskVos []struct {
		EntryPrice       string `json:"entryPrice"`
		MarkPrice        string `json:"markPrice"`
		Leverage         string `json:"leverage"`
		Isolated         string `json:"isolated"`
		IsolatedWallet   string `json:"isolatedWallet"`
		IsolatedMargin   string `json:"isolatedMargin"`
		IsAutoAddMargin  string `json:"isAutoAddMargin"`
		PositionSide     string `json:"positionSide"`
		PositionAmount   string `json:"positionAmount"`
		Symbol           string `json:"symbol"`
		UnrealizedProfit string `json:"unrealizedProfit"`
	} `json:"deliveryPositionRiskVos"`
}

type GetFuturesPositionRiskOfSubAccountV2Service

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

func (*GetFuturesPositionRiskOfSubAccountV2Service) Do

func (s *GetFuturesPositionRiskOfSubAccountV2Service) Do(ctx context.Context, opts ...RequestOption) (res interface{}, err error)

func (*GetFuturesPositionRiskOfSubAccountV2Service) Email

func (*GetFuturesPositionRiskOfSubAccountV2Service) FuturesType

type GetFuturesPositionRiskOfSubAccountV2USDTResp

type GetFuturesPositionRiskOfSubAccountV2USDTResp struct {
	FuturePositionRiskVos []struct {
		EntryPrice       string `json:"entryPrice"`
		Leverage         string `json:"leverage"`
		MaxNotional      string `json:"maxNotional"`
		LiquidationPrice string `json:"liquidationPrice"`
		MarkPrice        string `json:"markPrice"`
		PositionAmount   string `json:"positionAmount"`
		Symbol           string `json:"symbol"`
		UnrealizedProfit string `json:"unrealizedProfit"`
	} `json:"futurePositionRiskVos"`
}

type GetIPRestrictionForSubAccountAPIKeyResp

type GetIPRestrictionForSubAccountAPIKeyResp struct {
	IpRestrict string `json:"ipRestrict"`
	IpList     []struct {
		Ip string `json:"ip"`
	} `json:"ipList"`
	UpdateTime uint64 `json:"updateTime"`
	ApiKey     string `json:"apiKey"`
}

type GetIPRestrictionForSubAccountAPIKeyService

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

func (*GetIPRestrictionForSubAccountAPIKeyService) Do

func (*GetIPRestrictionForSubAccountAPIKeyService) Email

func (*GetIPRestrictionForSubAccountAPIKeyService) SubAccountApiKey

type GetManagedSubAccountDepositAddressResp

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

type GetManagedSubAccountDepositAddressService

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

func (*GetManagedSubAccountDepositAddressService) Coin

func (*GetManagedSubAccountDepositAddressService) Do

func (*GetManagedSubAccountDepositAddressService) Email

func (*GetManagedSubAccountDepositAddressService) Network

type GetMyTradesService

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

Binance Get trades for a specific account and symbol (USER_DATA) (GET /api/v3/myTrades) GetMyTradesService get trades for a specific account and symbol

func (*GetMyTradesService) Do

Do send request

func (*GetMyTradesService) EndTime

func (s *GetMyTradesService) EndTime(endTime uint64) *GetMyTradesService

EndTime set endTime

func (*GetMyTradesService) FromId

func (s *GetMyTradesService) FromId(fromId int64) *GetMyTradesService

FromId set fromId

func (*GetMyTradesService) Limit

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

Limit set limit

func (*GetMyTradesService) OrderId

func (s *GetMyTradesService) OrderId(orderId int64) *GetMyTradesService

OrderId set orderId

func (*GetMyTradesService) StartTime

func (s *GetMyTradesService) StartTime(startTime uint64) *GetMyTradesService

StartTime set startTime

func (*GetMyTradesService) Symbol

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

Symbol set symbol

type GetOpenOrdersService

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

Binance Get current open orders (GET /api/v3/openOrders) GetOpenOrdersService get open orders

func (*GetOpenOrdersService) Do

Do send request

func (*GetOpenOrdersService) Symbol

Symbol set symbol

type GetOrderResponse

type GetOrderResponse struct {
	Symbol                  string `json:"symbol"`
	OrderId                 int64  `json:"orderId"`
	OrderListId             int64  `json:"orderListId"`
	ClientOrderId           string `json:"clientOrderId"`
	Price                   string `json:"price"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumulativeQuoteQty      string `json:"cumulativeQuoteQty"`
	Status                  string `json:"status"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	Side                    string `json:"side"`
	StopPrice               string `json:"stopPrice"`
	IcebergQty              string `json:"icebergQty,omitempty"`
	Time                    uint64 `json:"time"`
	UpdateTime              uint64 `json:"updateTime"`
	IsWorking               bool   `json:"isWorking"`
	WorkingTime             uint64 `json:"workingTime"`
	OrigQuoteOrderQty       string `json:"origQuoteOrderQty"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	PreventedMatchId        int64  `json:"preventedMatchId,omitempty"`
	PreventedQuantity       string `json:"preventedQuantity,omitempty"`
	StrategyId              int64  `json:"strategyId,omitempty"`
	StrategyType            int64  `json:"strategyType,omitempty"`
	TrailingDelta           string `json:"trailingDelta,omitempty"`
	TrailingTime            int64  `json:"trailingTime,omitempty"`
}

Create GetOrderResponse

type GetOrderService

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

Query Order (USER_DATA) Binance Query Order (USER_DATA) (GET /api/v3/order) GetOrderService get order

func (*GetOrderService) Do

func (s *GetOrderService) Do(ctx context.Context, opts ...RequestOption) (res *GetOrderResponse, 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 GetQueryCurrentOrderCountUsageService

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

Query Current Order Count Usage (TRADE) GetQueryCurrentOrderCountUsageService query current order count usage

func (*GetQueryCurrentOrderCountUsageService) Do

Do send request

type GetQueryPreventedMatchesService

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

Query Prevented Matches (USER_DATA) GetQueryPreventedMatchesService query prevented matches

func (*GetQueryPreventedMatchesService) Do

Do send request

func (*GetQueryPreventedMatchesService) FromPreventedMatchId

func (s *GetQueryPreventedMatchesService) FromPreventedMatchId(fromPreventedMatchId int64) *GetQueryPreventedMatchesService

FromPreventedMatchId set fromPreventedMatchId

func (*GetQueryPreventedMatchesService) Limit

Limit set limit

func (*GetQueryPreventedMatchesService) OrderId

OrderId set orderId

func (*GetQueryPreventedMatchesService) PreventMatchId

func (s *GetQueryPreventedMatchesService) PreventMatchId(preventMatchId int64) *GetQueryPreventedMatchesService

PreventMatchId set preventMatchId

func (*GetQueryPreventedMatchesService) Symbol

Symbol set symbol

type GetStakingHistoryResponse

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

GetStakingHistoryResponse define get staking history response

type GetStakingHistoryService

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

Get Staking History(USER_DATA)

func (*GetStakingHistoryService) Asset

Asset set asset

func (*GetStakingHistoryService) Current

Current set current

func (*GetStakingHistoryService) Do

Do send request

func (*GetStakingHistoryService) EndTime

EndTime set endTime

func (*GetStakingHistoryService) Product

Product set product

func (*GetStakingHistoryService) Size

Size set size

func (*GetStakingHistoryService) StartTime

func (s *GetStakingHistoryService) StartTime(startTime uint64) *GetStakingHistoryService

StartTime set startTime

func (*GetStakingHistoryService) TxnType

TxnType set txnType

type GetStakingProductListService

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

Get Staking Product List (USER_DATA)

func (*GetStakingProductListService) Asset

Asset set asset

func (*GetStakingProductListService) Current

Current set current

func (*GetStakingProductListService) Do

Do send request

func (*GetStakingProductListService) Product

Product set product

func (*GetStakingProductListService) Size

Size set size

type GetStakingProductPositionResponse

type GetStakingProductPositionResponse struct {
	PositionId            string `json:"positionId"`
	ProjectId             string `json:"projectId"`
	Asset                 string `json:"asset"`
	Amount                string `json:"amount"`
	PurchaseTime          string `json:"purchaseTime"`
	Duration              string `json:"duration"`
	AccrualDays           string `json:"accrualDays"`
	RewardAsset           string `json:"rewardAsset"`
	APY                   string `json:"APY"`
	RewardAmt             string `json:"rewardAmt"`
	ExtraRewardAsset      string `json:"extraRewardAsset"`
	ExtraRewardAPY        string `json:"extraRewardAPY"`
	EstExtraRewardAmt     string `json:"estExtraRewardAmt"`
	NextInterestPay       string `json:"nextInterestPay"`
	NextInterestPayDate   string `json:"nextInterestPayDate"`
	PayInterestPeriod     string `json:"payInterestPeriod"`
	RedeemAmountEarly     string `json:"redeemAmountEarly"`
	InterestEndDate       string `json:"interestEndDate"`
	DeliverDate           string `json:"deliverDate"`
	RedeemPeriod          string `json:"redeemPeriod"`
	RedeemingAmt          string `json:"redeemingAmt"`
	PartialAmtDeliverDate string `json:"partialAmtDeliverDate"`
	CanRedeemEarly        bool   `json:"canRedeemEarly"`
	Renewable             bool   `json:"renewable"`
	Type                  string `json:"type"`
	Status                string `json:"status"`
}

GetStakingProductPositionResponse define get staking product position response

type GetStakingProductPositionService

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

Get Staking Product Position(USER_DATA)

func (*GetStakingProductPositionService) Asset

Asset set asset

func (*GetStakingProductPositionService) Current

Current set current

func (*GetStakingProductPositionService) Do

Do send request

func (*GetStakingProductPositionService) Product

Product set product

func (*GetStakingProductPositionService) ProductId

ProductId set productId

func (*GetStakingProductPositionService) Size

Size set size

type GetSubAccountDepositAddressResp

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

type GetSubAccountDepositAddressService

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

func (*GetSubAccountDepositAddressService) Coin

func (*GetSubAccountDepositAddressService) Do

func (*GetSubAccountDepositAddressService) Email

func (*GetSubAccountDepositAddressService) Network

type GetSubAccountDepositHistoryResp

type GetSubAccountDepositHistoryResp struct {
	DepositList []struct {
		Id            int64  `json:"id"`
		Amount        string `json:"amount"`
		Coin          string `json:"coin"`
		Network       string `json:"network"`
		Status        int64  `json:"status"`
		Address       string `json:"address"`
		AddressTag    string `json:"addressTag"`
		TxId          string `json:"txId"`
		InsertTime    uint64 `json:"insertTime"`
		TransferType  int64  `json:"transferType"`
		ConfirmTimes  string `json:"confirmTimes"`
		UnlockConfirm int64  `json:"unlockConfirm"`
		WalletType    int    `json:"walletType"`
	}
}

type GetSubAccountDepositHistoryService

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

func (*GetSubAccountDepositHistoryService) Coin

func (*GetSubAccountDepositHistoryService) Do

func (*GetSubAccountDepositHistoryService) Email

func (*GetSubAccountDepositHistoryService) EndTime

func (*GetSubAccountDepositHistoryService) Limit

func (*GetSubAccountDepositHistoryService) Offset

func (*GetSubAccountDepositHistoryService) StartTime

func (*GetSubAccountDepositHistoryService) Status

type GetSubAccountStatusResp

type GetSubAccountStatusResp struct {
	Email            string `json:"email"`
	IsSubUserEnabled bool   `json:"isSubUserEnabled"`
	IsUserActive     bool   `json:"isUserActive"`
	InsertTime       uint64 `json:"insertTime"`
	IsMarginEnabled  bool   `json:"isMarginEnabled"`
	IsFuturesEnabled bool   `json:"isFuturesEnabled"`
	Mobile           int64  `json:"mobile"`
}

type GetSubAccountStatusService

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

func (*GetSubAccountStatusService) Do

func (*GetSubAccountStatusService) Email

type GetSummaryOfSubAccountFuturesAccountResp

type GetSummaryOfSubAccountFuturesAccountResp struct {
	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"`
	Asset                       string `json:"asset"`
	SubAccountList              []struct {
		Email                       string `json:"email"`
		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"`
		Asset                       string `json:"asset"`
	} `json:"subAccountList"`
}

type GetSummaryOfSubAccountFuturesAccountService

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

func (*GetSummaryOfSubAccountFuturesAccountService) Do

type GetSummaryOfSubAccountFuturesAccountV2COINResp

type GetSummaryOfSubAccountFuturesAccountV2COINResp struct {
	DeliveryAccountSummaryResp struct {
		TotalMarginBalanceOfBTC    string `json:"totalMarginBalanceOfBTC"`
		TotalUnrealizedProfitOfBTC string `json:"totalUnrealizedProfitOfBTC"`
		TotalWalletBalanceOfBTC    string `json:"totalWalletBalanceOfBTC"`
		Asset                      string `json:"asset"`
		SubAccountList             []struct {
			Email                 string `json:"email"`
			TotalMarginBalance    string `json:"totalMarginBalance"`
			TotalUnrealizedProfit string `json:"totalUnrealizedProfit"`
			TotalWalletBalance    string `json:"totalWalletBalance"`
			Asset                 string `json:"asset"`
		} `json:"subAccountList"`
	} `json:"deliveryAccountSummaryResp"`
}

type GetSummaryOfSubAccountFuturesAccountV2Service

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

func (*GetSummaryOfSubAccountFuturesAccountV2Service) Do

func (s *GetSummaryOfSubAccountFuturesAccountV2Service) Do(ctx context.Context, opts ...RequestOption) (res interface{}, err error)

func (*GetSummaryOfSubAccountFuturesAccountV2Service) FuturesType

func (*GetSummaryOfSubAccountFuturesAccountV2Service) Limit

func (*GetSummaryOfSubAccountFuturesAccountV2Service) Page

type GetSummaryOfSubAccountFuturesAccountV2USDTResp

type GetSummaryOfSubAccountFuturesAccountV2USDTResp struct {
	FutureAccountSummaryResp struct {
		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"`
		Asset                       string `json:"asset"`
		SubAccountList              []struct {
			Email                       string `json:"email"`
			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"`
			Asset                       string `json:"asset"`
		} `json:"subAccountList"`
	} `json:"futureAccountSummaryResp"`
}

type GetSummaryOfSubAccountMarginAccountResp

type GetSummaryOfSubAccountMarginAccountResp struct {
	TotalAssetOfBtc     string `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string `json:"totalNetAssetOfBtc"`
	SubAccountList      []struct {
		Email               string `json:"email"`
		TotalAssetOfBtc     string `json:"totalAssetOfBtc"`
		TotalLiabilityOfBtc string `json:"totalLiabilityOfBtc"`
		TotalNetAssetOfBtc  string `json:"totalNetAssetOfBtc"`
	} `json:"subAccountList"`
}

type GetSummaryOfSubAccountMarginAccountService

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

func (*GetSummaryOfSubAccountMarginAccountService) Do

type GetSystemStatusService

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

GetSystemStatusService get account info

func (*GetSystemStatusService) Do

type HistoricalTradeLookup

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

Binance Old Trade Lookup endpoint (GET /api/v3/historicalTrades)

func (*HistoricalTradeLookup) Do

Send the request

func (*HistoricalTradeLookup) FromId

FromId set fromId

func (*HistoricalTradeLookup) Limit

Limit set limit

func (*HistoricalTradeLookup) Symbol

Symbol set symbol

type InterestHistoryResponse

type InterestHistoryResponse struct {
	Rows []struct {
		TxId                int64  `json:"txId"`
		InterestAccruedTime uint64 `json:"interestAccruedTime"`
		Asset               string `json:"asset"`
		RawAsset            string `json:"rawAsset"`
		Principal           string `json:"principal"`
		Interest            string `json:"interest"`
		InterestRate        string `json:"interestRate"`
		Type                string `json:"type"`
		IsolatedSymbol      string `json:"isolatedSymbol"`
	} `json:"rows"`
	Total int `json:"total"`
}

InterestHistoryResponse define interest history response

type InterestHistoryService

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

InterestHistoryService query interest history

func (*InterestHistoryService) Archived

func (s *InterestHistoryService) Archived(archived string) *InterestHistoryService

Archived set archived

func (*InterestHistoryService) Asset

Asset set asset

func (*InterestHistoryService) Current

func (s *InterestHistoryService) Current(current int) *InterestHistoryService

Current set current

func (*InterestHistoryService) Do

Do send request

func (*InterestHistoryService) EndTime

EndTime set endTime

func (*InterestHistoryService) IsolatedSymbol

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

IsolatedSymbol set isolatedSymbol

func (*InterestHistoryService) Size

Size set size

func (*InterestHistoryService) StartTime

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

StartTime set startTime

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 Klines

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

Binance Kline/Candlestick Data endpoint (GET /api/v3/klines)

func (*Klines) Do

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

func (*Klines) EndTime

func (s *Klines) EndTime(endTime uint64) *Klines

EndTime set endTime

func (*Klines) Interval

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

Interval set interval

func (*Klines) Limit

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

Limit set limit

func (*Klines) StartTime

func (s *Klines) StartTime(startTime uint64) *Klines

StartTime set startTime

func (*Klines) Symbol

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

Symbol set symbol

type KlinesResponse

type KlinesResponse struct {
	OpenTime                 uint64 `json:"openTime"`
	Open                     string `json:"open"`
	High                     string `json:"high"`
	Low                      string `json:"low"`
	Close                    string `json:"close"`
	Volume                   string `json:"volume"`
	CloseTime                uint64 `json:"closeTime"`
	QuoteAssetVolume         string `json:"quoteAssetVolume"`
	NumberOfTrades           uint64 `json:"numberOfTrades"`
	TakerBuyBaseAssetVolume  string `json:"takerBuyBaseAssetVolume"`
	TakerBuyQuoteAssetVolume string `json:"takerBuyQuoteAssetVolume"`
}

Define Klines response data

type KlinesResponseArray

type KlinesResponseArray [][]interface{}

type LoanRecordResponse

type LoanRecordResponse struct {
	Rows []struct {
		IsolatedSymbol string `json:"isolatedSymbol"`
		TxId           int64  `json:"txId"`
		Asset          string `json:"asset"`
		Principal      string `json:"principal"`
		Timestamp      uint64 `json:"timestamp"`
		Status         string `json:"status"`
	} `json:"rows"`
	Total int `json:"total"`
}

LoanRecordResponse define loan record response

type LoanRecordService

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

LoanRecordService query loan record

func (*LoanRecordService) Archived

func (s *LoanRecordService) Archived(archived string) *LoanRecordService

Archived set archived

func (*LoanRecordService) Asset

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

Asset set asset

func (*LoanRecordService) Current

func (s *LoanRecordService) Current(current int) *LoanRecordService

Current set current

func (*LoanRecordService) Do

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

Do send request

func (*LoanRecordService) EndTime

func (s *LoanRecordService) EndTime(endTime uint64) *LoanRecordService

EndTime set endTime

func (*LoanRecordService) IsolatedSymbol

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

IsolatedSymbol set isolatedSymbol

func (*LoanRecordService) Size

func (s *LoanRecordService) Size(size int) *LoanRecordService

Size set size

func (*LoanRecordService) StartTime

func (s *LoanRecordService) StartTime(startTime uint64) *LoanRecordService

StartTime set startTime

func (*LoanRecordService) TxId

func (s *LoanRecordService) TxId(txid int64) *LoanRecordService

TxId set txid

type MarginAccountAllOrderResponse

type MarginAccountAllOrderResponse struct {
	Orders []struct {
		ClientOrderId      string `json:"clientOrderId"`
		CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
		ExecutedQty        string `json:"executedQty"`
		IcebergQty         string `json:"icebergQty"`
		IsWorking          bool   `json:"isWorking"`
		OrderId            int    `json:"orderId"`
		OrigQty            string `json:"origQty"`
		Price              string `json:"price"`
		Side               string `json:"side"`
		Status             string `json:"status"`
		StopPrice          string `json:"stopPrice"`
		Symbol             string `json:"symbol"`
		IsIsolated         bool   `json:"isIsolated"`
		Time               uint64 `json:"time"`
		TimeInForce        string `json:"timeInForce"`
		OrderType          string `json:"type"`
		UpdateTime         uint64 `json:"updateTime"`
	} `json:"orders"`
}

MarginAccountAllOrderResponse define margin account all order response

type MarginAccountAllOrderService

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

MarginAccountAllOrderService query margin account's all order

func (*MarginAccountAllOrderService) Do

Do send request

func (*MarginAccountAllOrderService) EndTime

EndTime set endTime

func (*MarginAccountAllOrderService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountAllOrderService) Limit

Limit set limit

func (*MarginAccountAllOrderService) OrderId

OrderId set orderId

func (*MarginAccountAllOrderService) StartTime

StartTime set startTime

func (*MarginAccountAllOrderService) Symbol

Symbol set symbol

type MarginAccountCancelAllOrdersResponse

type MarginAccountCancelAllOrdersResponse struct {
	Symbol             string `json:"symbol"`
	IsIsolated         bool   `json:"isIsolated"`
	OrigClientOrderId  string `json:"origClientOrderId"`
	OrderId            int    `json:"orderId"`
	OrderListId        int    `json:"orderListId"`
	ClientOrderId      string `json:"clientOrderId"`
	Price              string `json:"price"`
	OrigQty            string `json:"origQty"`
	ExecutedQty        string `json:"executedQty"`
	CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
	Status             string `json:"status"`
	TimeInForce        string `json:"timeInForce"`
	Type               string `json:"type"`
	Side               string `json:"side"`
}

MarginAccountCancelAllOrdersResponse define margin account cancel all orders response

type MarginAccountCancelAllOrdersService

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

MarginAccountCancelAllOrdersService margin account cancel all orders

func (*MarginAccountCancelAllOrdersService) Do

Do send request

func (*MarginAccountCancelAllOrdersService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountCancelAllOrdersService) Symbol

Symbol set symbol

type MarginAccountCancelOCOResponse

type MarginAccountCancelOCOResponse struct {
	OrderListId       int    `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderId string `json:"listClientOrderId"`
	TransactionTime   uint64 `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	IsIsolated        bool   `json:"isIsolated"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderId       int    `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
	OrderReports []struct {
		Symbol             string `json:"symbol"`
		OrigClientOrderId  string `json:"origClientOrderId"`
		OrderId            int    `json:"orderId"`
		OrderListId        int    `json:"orderListId"`
		ClientOrderId      string `json:"clientOrderId"`
		Price              string `json:"price"`
		OrigQty            string `json:"origQty"`
		ExecutedQty        string `json:"executedQty"`
		CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
		Status             string `json:"status"`
		TimeInForce        string `json:"timeInForce"`
		OrderType          string `json:"type"`
		Side               string `json:"side"`
		StopPrice          string `json:"stopPrice"`
	} `json:"orderReports"`
}

MarginAccountCancelOCOService response

type MarginAccountCancelOCOService

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

func (*MarginAccountCancelOCOService) Do

Do send request

func (*MarginAccountCancelOCOService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountCancelOCOService) ListClientOrderId

func (s *MarginAccountCancelOCOService) ListClientOrderId(listClientOrderId string) *MarginAccountCancelOCOService

ListClientOrderId set listClientOrderId

func (*MarginAccountCancelOCOService) NewClientOrderId

func (s *MarginAccountCancelOCOService) NewClientOrderId(newClientOrderId string) *MarginAccountCancelOCOService

NewClientOrderId set newClientOrderId

func (*MarginAccountCancelOCOService) OrderListId

OrderListId set orderListId

func (*MarginAccountCancelOCOService) Symbol

Symbol set symbol

type MarginAccountCancelOrderResponse

type MarginAccountCancelOrderResponse struct {
	Symbol             string `json:"symbol"`
	IsIsolated         bool   `json:"isIsolated"`
	OrderId            int    `json:"orderId"`
	OrigClientOrderId  string `json:"origClientOrderId"`
	ClientOrderId      string `json:"clientOrderId"`
	Price              string `json:"price"`
	OrigQty            string `json:"origQty"`
	ExecutedQty        string `json:"executedQty"`
	CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
	Status             string `json:"status"`
	TimeInForce        string `json:"timeInForce"`
	Type               string `json:"type"`
	Side               string `json:"side"`
}

MarginAccountCancelOrderResponse define margin account cancel order response

type MarginAccountCancelOrderService

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

MarginAccountCancelOrderService margin account cancel order

func (*MarginAccountCancelOrderService) Do

Do send request

func (*MarginAccountCancelOrderService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountCancelOrderService) NewClientOrderId

func (s *MarginAccountCancelOrderService) NewClientOrderId(newClientOrderId string) *MarginAccountCancelOrderService

NewClientOrderId set newClientOrderId

func (*MarginAccountCancelOrderService) OrderId

OrderId set orderId

func (*MarginAccountCancelOrderService) OrigClientOrderId

func (s *MarginAccountCancelOrderService) OrigClientOrderId(origClientOrderId string) *MarginAccountCancelOrderService

OrigClientOrderId set origClientOrderId

func (*MarginAccountCancelOrderService) Symbol

Symbol set symbol

type MarginAccountNewOCOResponse

type MarginAccountNewOCOResponse struct {
	OrderListId           int    `json:"orderListId"`
	ContingencyType       string `json:"contingencyType"`
	ListStatusType        string `json:"listStatusType"`
	ListOrderStatus       string `json:"listOrderStatus"`
	ListClientOrderId     string `json:"listClientOrderId"`
	TransactionTime       uint64 `json:"transactionTime"`
	Symbol                string `json:"symbol"`
	MarginBuyBorrowAmount string `json:"marginBuyBorrowAmount"`
	MarginBuyBorrowAsset  string `json:"marginBuyBorrowAsset"`
	Orders                []struct {
		Symbol        string `json:"symbol"`
		OrderId       int    `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
	OrderReports []struct {
		Symbol             string `json:"symbol"`
		OrderId            int    `json:"orderId"`
		OrderListId        int    `json:"orderListId"`
		ClientOrderId      string `json:"clientOrderId"`
		TransactTime       uint64 `json:"transactTime"`
		Price              string `json:"price"`
		OrigQty            string `json:"origQty"`
		ExecutedQty        string `json:"executedQty"`
		CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
		Status             string `json:"status"`
		TimeInForce        string `json:"timeInForce"`
		OrderType          string `json:"type"`
		Side               string `json:"side"`
		StopPrice          string `json:"stopPrice"`
	} `json:"orderReports"`
}

MarginAccountNewOCOService response

type MarginAccountNewOCOService

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

MarginAccountNewOCOService create new oco order

func (*MarginAccountNewOCOService) Do

Do send request

func (*MarginAccountNewOCOService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountNewOCOService) LimitClientOrderId

func (s *MarginAccountNewOCOService) LimitClientOrderId(limitClientOrderId string) *MarginAccountNewOCOService

LimitClientOrderId set limitClientOrderId

func (*MarginAccountNewOCOService) LimitIcebergQty

func (s *MarginAccountNewOCOService) LimitIcebergQty(limitIcebergQty float64) *MarginAccountNewOCOService

LimitIcebergQty set limitIcebergQty

func (*MarginAccountNewOCOService) ListClientOrderId

func (s *MarginAccountNewOCOService) ListClientOrderId(listClientOrderId string) *MarginAccountNewOCOService

ListClientOrderId set listClientOrderId

func (*MarginAccountNewOCOService) NewOrderRespType

func (s *MarginAccountNewOCOService) NewOrderRespType(newOrderRespType string) *MarginAccountNewOCOService

NewOrderRespType set newOrderRespType

func (*MarginAccountNewOCOService) Price

Price set price

func (*MarginAccountNewOCOService) Quantity

Quantity set quantity

func (*MarginAccountNewOCOService) Side

Side set side

func (*MarginAccountNewOCOService) SideEffectType

func (s *MarginAccountNewOCOService) SideEffectType(sideEffectType string) *MarginAccountNewOCOService

SideEffectType set sideEffectType

func (*MarginAccountNewOCOService) StopClientOrderId

func (s *MarginAccountNewOCOService) StopClientOrderId(stopClientOrderId string) *MarginAccountNewOCOService

StopClientOrderId set stopClientOrderId

func (*MarginAccountNewOCOService) StopIcebergQty

func (s *MarginAccountNewOCOService) StopIcebergQty(stopIcebergQty float64) *MarginAccountNewOCOService

StopIcebergQty set stopIcebergQty

func (*MarginAccountNewOCOService) StopLimitPrice

func (s *MarginAccountNewOCOService) StopLimitPrice(stopLimitPrice float64) *MarginAccountNewOCOService

StopLimitPrice set stopLimitPrice

func (*MarginAccountNewOCOService) StopLimitTimeInForce

func (s *MarginAccountNewOCOService) StopLimitTimeInForce(stopLimitTimeInForce string) *MarginAccountNewOCOService

StopLimitTimeInForce set stopLimitTimeInForce

func (*MarginAccountNewOCOService) StopPrice

StopPrice set stopPrice

func (*MarginAccountNewOCOService) Symbol

Symbol set symbol

type MarginAccountNewOrderResponseACK

type MarginAccountNewOrderResponseACK struct {
	Symbol        string `json:"symbol"`
	OrderId       int64  `json:"orderId"`
	ClientOrderId int64  `json:"clientOrderId"`
	IsIsolated    bool   `json:"isIsolated"`
	TransactTime  uint64 `json:"transactTime"`
}

Create MarginAccountNewOrderResponseACK

type MarginAccountNewOrderResponseFULL

type MarginAccountNewOrderResponseFULL struct {
	Symbol                string  `json:"symbol"`
	OrderId               int64   `json:"orderId"`
	ClientOrderId         string  `json:"clientOrderId"`
	TransactTime          uint64  `json:"transactTime"`
	Price                 string  `json:"price"`
	OrigQty               string  `json:"origQty"`
	ExecutedQty           string  `json:"executedQty"`
	CumulativeQuoteQty    string  `json:"cummulativeQuoteQty"`
	Status                string  `json:"status"`
	TimeInForce           string  `json:"timeInForce"`
	Type                  string  `json:"type"`
	Side                  string  `json:"side"`
	MarginBuyBorrowAmount float64 `json:"marginBuyBorrowAmount"`
	MarginBuyBorrowAsset  string  `json:"marginBuyBorrowAsset"`
	IsIsolated            bool    `json:"isIsolated"`
	Fills                 []struct {
		Price           string `json:"price"`
		Qty             string `json:"qty"`
		Commission      string `json:"commission"`
		CommissionAsset string `json:"commissionAsset"`
	} `json:"fills"`
}

Create MarginAccountNewOrderResponseFULL

type MarginAccountNewOrderResponseRESULT

type MarginAccountNewOrderResponseRESULT struct {
	Symbol             string `json:"symbol"`
	OrderId            int64  `json:"orderId"`
	ClientOrderId      string `json:"clientOrderId"`
	TransactTime       uint64 `json:"transactTime"`
	Price              string `json:"price"`
	OrigQty            string `json:"origQty"`
	ExecutedQty        string `json:"executedQty"`
	CumulativeQuoteQty string `json:"cummulativeQuoteQty"`
	Status             string `json:"status"`
	TimeInForce        string `json:"timeInForce"`
	Type               string `json:"type"`
	IsIsolated         bool   `json:"isIsolated"`
	Side               string `json:"side"`
}

Create MarginAccountNewOrderResponseRESULT

type MarginAccountNewOrderService

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

MarginAccountNewOrderService margin account new order

func (*MarginAccountNewOrderService) Do

func (s *MarginAccountNewOrderService) Do(ctx context.Context, opts ...RequestOption) (res interface{}, err error)

Do send request

func (*MarginAccountNewOrderService) IcebergQty

IcebergQty set icebergQty

func (*MarginAccountNewOrderService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountNewOrderService) NewClientOrderId

func (s *MarginAccountNewOrderService) NewClientOrderId(newClientOrderId string) *MarginAccountNewOrderService

NewClientOrderId set newClientOrderId

func (*MarginAccountNewOrderService) NewOrderRespType

func (s *MarginAccountNewOrderService) NewOrderRespType(newOrderRespType string) *MarginAccountNewOrderService

NewOrderRespType set newOrderRespType

func (*MarginAccountNewOrderService) OrderType

OrderType set orderType

func (*MarginAccountNewOrderService) Price

Price set price

func (*MarginAccountNewOrderService) Quantity

Quantity set quantity

func (*MarginAccountNewOrderService) QuoteOrderQty

func (s *MarginAccountNewOrderService) QuoteOrderQty(quoteOrderQty float64) *MarginAccountNewOrderService

QuoteOrderQty set quoteOrderQty

func (*MarginAccountNewOrderService) Side

Side set side

func (*MarginAccountNewOrderService) SideEffectType

func (s *MarginAccountNewOrderService) SideEffectType(sideEffectType string) *MarginAccountNewOrderService

SideEffectType set sideEffectType

func (*MarginAccountNewOrderService) StopPrice

StopPrice set stopPrice

func (*MarginAccountNewOrderService) Symbol

Symbol set symbol

func (*MarginAccountNewOrderService) TimeInForce

TimeInForce set timeInForce

type MarginAccountOpenOrderResponse

type MarginAccountOpenOrderResponse struct {
	Orders []struct {
		ClientOrderId      string `json:"clientOrderId"`
		CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
		ExecutedQty        string `json:"executedQty"`
		IcebergQty         string `json:"icebergQty"`
		IsWorking          bool   `json:"isWorking"`
		OrderId            int    `json:"orderId"`
		OrigQty            string `json:"origQty"`
		Price              string `json:"price"`
		Side               string `json:"side"`
		Status             string `json:"status"`
		StopPrice          string `json:"stopPrice"`
		Symbol             string `json:"symbol"`
		IsIsolated         bool   `json:"isIsolated"`
		Time               uint64 `json:"time"`
		TimeInForce        string `json:"timeInForce"`
		OrderType          string `json:"type"`
		UpdateTime         uint64 `json:"updateTime"`
	} `json:"orders"`
}

MarginAccountOpenOrderResponse define margin account open order response

type MarginAccountOpenOrderService

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

MarginAccountOpenOrderService query margin account's open order

func (*MarginAccountOpenOrderService) Do

Do send request

func (*MarginAccountOpenOrderService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountOpenOrderService) Symbol

Symbol set symbol

type MarginAccountOrderResponse

type MarginAccountOrderResponse struct {
	ClientOrderId      string `json:"clientOrderId"`
	CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
	ExecutedQty        string `json:"executedQty"`
	IcebergQty         string `json:"icebergQty"`
	IsWorking          bool   `json:"isWorking"`
	OrderId            int    `json:"orderId"`
	OrigQty            string `json:"origQty"`
	Price              string `json:"price"`
	Side               string `json:"side"`
	Status             string `json:"status"`
	StopPrice          string `json:"stopPrice"`
	Symbol             string `json:"symbol"`
	IsIsolated         bool   `json:"isIsolated"`
	Time               uint64 `json:"time"`
	TimeInForce        string `json:"timeInForce"`
	OrderType          string `json:"type"`
	UpdateTime         uint64 `json:"updateTime"`
}

MarginAccountOrderResponse define margin account order response

type MarginAccountOrderService

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

MarginAccountOrderService query margin account's order

func (*MarginAccountOrderService) Do

Do send request

func (*MarginAccountOrderService) IsIsolated

func (s *MarginAccountOrderService) IsIsolated(isIsolated string) *MarginAccountOrderService

IsIsolated set isIsolated

func (*MarginAccountOrderService) OrderId

OrderId set orderId

func (*MarginAccountOrderService) OrigClientOrderId

func (s *MarginAccountOrderService) OrigClientOrderId(origClientOrderId string) *MarginAccountOrderService

OrigClientOrderId set origClientOrderId

func (*MarginAccountOrderService) Symbol

Symbol set symbol

type MarginAccountQueryAllOCOResponse

type MarginAccountQueryAllOCOResponse struct {
	OrderListId       int    `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderId string `json:"listClientOrderId"`
	TransactionTime   uint64 `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	IsIsolated        bool   `json:"isIsolated"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderId       int    `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
}

MarginAccountQueryAllOCOService response

type MarginAccountQueryAllOCOService

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

func (*MarginAccountQueryAllOCOService) Do

Do send request

func (*MarginAccountQueryAllOCOService) EndTime

EndTime set endTime

func (*MarginAccountQueryAllOCOService) FromId

FromId set fromId

func (*MarginAccountQueryAllOCOService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountQueryAllOCOService) Limit

Limit set limit

func (*MarginAccountQueryAllOCOService) StartTime

StartTime set startTime

func (*MarginAccountQueryAllOCOService) Symbol

Symbol set symbol

type MarginAccountQueryMaxBorrowResponse

type MarginAccountQueryMaxBorrowResponse struct {
	Amount      string `json:"amount"`
	BorrowLimit string `json:"borrowLimit"`
}

MarginAccountQueryMaxBorrowService response

type MarginAccountQueryMaxBorrowService

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

func (*MarginAccountQueryMaxBorrowService) Asset

Asset set asset

func (*MarginAccountQueryMaxBorrowService) Do

Do send request

func (*MarginAccountQueryMaxBorrowService) IsolatedSymbol

IsolatedSymbol set isolatedSymbol

type MarginAccountQueryMaxTransferOutAmountResponse

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

MarginAccountQueryMaxTransferOutAmountService response

type MarginAccountQueryMaxTransferOutAmountService

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

func (*MarginAccountQueryMaxTransferOutAmountService) Asset

Asset set asset

func (*MarginAccountQueryMaxTransferOutAmountService) Do

Do send request

func (*MarginAccountQueryMaxTransferOutAmountService) IsolatedSymbol

IsolatedSymbol set isolatedSymbol

type MarginAccountQueryOCOResponse

type MarginAccountQueryOCOResponse struct {
	OrderListId       int    `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderId string `json:"listClientOrderId"`
	TransactionTime   uint64 `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	IsIsolated        bool   `json:"isIsolated"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderId       int    `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
}

MarginAccountQueryOCOService response

type MarginAccountQueryOCOService

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

func (*MarginAccountQueryOCOService) Do

Do send request

func (*MarginAccountQueryOCOService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountQueryOCOService) OrderListId

func (s *MarginAccountQueryOCOService) OrderListId(orderListId int) *MarginAccountQueryOCOService

OrderListId set orderListId

func (*MarginAccountQueryOCOService) OrigClientOrderId

func (s *MarginAccountQueryOCOService) OrigClientOrderId(origClientOrderId string) *MarginAccountQueryOCOService

OrigClientOrderId set origClientOrderId

func (*MarginAccountQueryOCOService) Symbol

Symbol set symbol

type MarginAccountQueryOpenOCOResponse

type MarginAccountQueryOpenOCOResponse struct {
	OrderListId       int    `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderId string `json:"listClientOrderId"`
	TransactionTime   uint64 `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	IsIsolated        bool   `json:"isIsolated"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderId       int    `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
}

MarginAccountQueryOpenOCOService response

type MarginAccountQueryOpenOCOService

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

func (*MarginAccountQueryOpenOCOService) Do

Do send request

func (*MarginAccountQueryOpenOCOService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountQueryOpenOCOService) Symbol

Symbol set symbol

type MarginAccountQueryTradeListResponse

type MarginAccountQueryTradeListResponse struct {
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	Id              int    `json:"id"`
	IsBestMatch     bool   `json:"isBestMatch"`
	IsBuyer         bool   `json:"isBuyer"`
	IsMaker         bool   `json:"isMaker"`
	OrderId         int    `json:"orderId"`
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	Symbol          string `json:"symbol"`
	IsIsolated      bool   `json:"isIsolated"`
	Time            uint64 `json:"time"`
}

MarginAccountQueryTradeListService response

type MarginAccountQueryTradeListService

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

func (*MarginAccountQueryTradeListService) Do

Do send request

func (*MarginAccountQueryTradeListService) EndTime

EndTime set endTime

func (*MarginAccountQueryTradeListService) FromId

FromId set fromId

func (*MarginAccountQueryTradeListService) IsIsolated

IsIsolated set isIsolated

func (*MarginAccountQueryTradeListService) Limit

Limit set limit

func (*MarginAccountQueryTradeListService) OrderId

OrderId set orderId

func (*MarginAccountQueryTradeListService) StartTime

StartTime set startTime

func (*MarginAccountQueryTradeListService) Symbol

Symbol set symbol

type MarginAccountSummaryResponse

type MarginAccountSummaryResponse struct {
	NormalBar           string `json:"normalBar"`
	MarginCallBar       string `json:"marginCallBar"`
	ForceLiquidationBar string `json:"forceLiquidationBar"`
}

MarginAccountSummaryService response

type MarginAccountSummaryService

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

func (*MarginAccountSummaryService) Do

Do send request

type MarginBnbBurnStatusResponse

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

MarginBnbBurnStatusService response

type MarginBnbBurnStatusService

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

func (*MarginBnbBurnStatusService) Do

Do send request

type MarginCrossCollateralRatioResponse

type MarginCrossCollateralRatioResponse struct {
	Collaterals []*struct {
		MinUsdValue  string `json:"minUsdValue"`
		MaxUsdValue  string `json:"maxUsdValue"`
		DiscountRate string `json:"discountRate"`
	} `json:"collaterals"`
	AssetNames []*struct {
		Asset string `json:"asset"`
	} `json:"assetNames"`
}

MarginCrossCollateralRatioService response

type MarginCrossCollateralRatioService

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

func (*MarginCrossCollateralRatioService) Do

Do send request

type MarginCrossMarginFeeResponse

type MarginCrossMarginFeeResponse struct {
	VIPLevel        int    `json:"vipLevel"`
	Coin            string `json:"coin"`
	TransferIn      bool   `json:"transferIn"`
	Borrowable      bool   `json:"transferOut"`
	DailyInterest   string `json:"dailyInterest"`
	YearlyInterest  string `json:"yearlyInterest"`
	BorrowLimit     string `json:"borrowLimit"`
	MarginablePairs struct {
		Pair string `json:"pair"`
	} `json:"marginablePairs"`
}

MarginCrossMarginFeeService response

type MarginCrossMarginFeeService

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

func (*MarginCrossMarginFeeService) Coin

Coin set coin

func (*MarginCrossMarginFeeService) Do

Do send request

func (*MarginCrossMarginFeeService) VipLevel

VipLevel set vipLevel

type MarginCurrentOrderCountResponse

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

MarginCurrentOrderCountService response

type MarginCurrentOrderCountService

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

func (*MarginCurrentOrderCountService) Do

Do send request

func (*MarginCurrentOrderCountService) IsIsolated

IsIsolated set isIsolated

func (*MarginCurrentOrderCountService) Symbol

Symbol set symbol

type MarginDustlogResponse

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

type MarginDustlogService

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

func (*MarginDustlogService) Do

Do send request

func (*MarginDustlogService) EndTime

func (s *MarginDustlogService) EndTime(endTime uint64) *MarginDustlogService

EndTime set endTime

func (*MarginDustlogService) StartTime

func (s *MarginDustlogService) StartTime(startTime uint64) *MarginDustlogService

StartTime set startTime

type MarginInterestRateHistoryResponse

type MarginInterestRateHistoryResponse struct {
	Asset             string  `json:"asset"`
	DailyInterestRate float64 `json:"dailyInterestRate"`
	Timestamp         uint64  `json:"timestamp"`
	VIPLevel          int     `json:"vipLevel"`
}

MarginInterestRateHistoryService response

type MarginInterestRateHistoryService

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

func (*MarginInterestRateHistoryService) Asset

Asset set asset

func (*MarginInterestRateHistoryService) Do

Do send request

func (*MarginInterestRateHistoryService) EndTime

EndTime set endTime

func (*MarginInterestRateHistoryService) StartTime

StartTime set startTime

func (*MarginInterestRateHistoryService) VipLevel

VipLevel set vipLevel

type MarginIsolatedAccountDisableResponse

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

MarginIsolatedAccountDisableService response

type MarginIsolatedAccountDisableService

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

func (*MarginIsolatedAccountDisableService) Do

Do send request

func (*MarginIsolatedAccountDisableService) Symbol

Symbol set symbol

type MarginIsolatedAccountEnableResponse

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

MarginIsolatedAccountEnableService response

type MarginIsolatedAccountEnableService

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

func (*MarginIsolatedAccountEnableService) Do

Do send request

func (*MarginIsolatedAccountEnableService) Symbol

Symbol set symbol

type MarginIsolatedAccountInfoAssets

type MarginIsolatedAccountInfoAssets struct {
	BaseAsset struct {
		Asset         string `json:"asset"`
		BorrowEnabled bool   `json:"borrowEnabled"`
		Free          string `json:"free"`
		Interest      string `json:"interest"`
		Locked        string `json:"locked"`
		NetAsset      string `json:"netAsset"`
		NetAssetOfBtc string `json:"netAssetOfBtc"`
		RepayEnabled  bool   `json:"repayEnabled"`
		TotalAsset    string `json:"totalAsset"`
	} `json:"baseAsset"`
	QuoteAsset struct {
		Asset         string `json:"asset"`
		BorrowEnabled bool   `json:"borrowEnabled"`
		Free          string `json:"free"`
		Interest      string `json:"interest"`
		Locked        string `json:"locked"`
		NetAsset      string `json:"netAsset"`
		NetAssetOfBtc string `json:"netAssetOfBtc"`
		RepayEnabled  bool   `json:"repayEnabled"`
		TotalAsset    string `json:"totalAsset"`
	} `json:"quoteAsset"`
	Symbol            string `json:"symbol"`
	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"`
}

type MarginIsolatedAccountInfoResponse

type MarginIsolatedAccountInfoResponse struct {
	Assets              []*MarginIsolatedAccountInfoAssets `json:"assets"`
	TotalAssetOfBtc     string                             `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string                             `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string                             `json:"totalNetAssetOfBtc"`
}

MarginIsolatedAccountInfoService response if symbols parameter is sent

type MarginIsolatedAccountInfoResponseSymbols

type MarginIsolatedAccountInfoResponseSymbols struct {
	Assets []*MarginIsolatedAccountInfoAssets `json:"assets"`
}

MarginIsolatedAccountInfoService response if symbols parameter is not sent

type MarginIsolatedAccountInfoService

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

func (*MarginIsolatedAccountInfoService) Do

func (s *MarginIsolatedAccountInfoService) Do(ctx context.Context, opts ...RequestOption) (res interface{}, err error)

Do send request

func (*MarginIsolatedAccountInfoService) Symbols

Symbols set symbols

type MarginIsolatedAccountLimitResponse

type MarginIsolatedAccountLimitResponse struct {
	EnabledAccount int `json:"enabledAccount"`
	MaxAccount     int `json:"maxAccount"`
}

MarginIsolatedAccountLimitService response

type MarginIsolatedAccountLimitService

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

func (*MarginIsolatedAccountLimitService) Do

Do send request

type MarginIsolatedAccountTransferHistoryResponse

type MarginIsolatedAccountTransferHistoryResponse struct {
	Rows []struct {
		Amount    string `json:"amount"`
		Asset     string `json:"asset"`
		Status    string `json:"status"`
		TimeStamp uint64 `json:"timeStamp"`
		TxId      int64  `json:"txId"`
		TransFrom string `json:"transFrom"`
		TransTo   string `json:"transTo"`
	} `json:"rows"`
	Total int64 `json:"total"`
}

MarginIsolatedAccountTransferHistoryService response

type MarginIsolatedAccountTransferHistoryService

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

func (*MarginIsolatedAccountTransferHistoryService) Archived

Archived set archived

func (*MarginIsolatedAccountTransferHistoryService) Asset

Asset set asset

func (*MarginIsolatedAccountTransferHistoryService) Current

Current set current

func (*MarginIsolatedAccountTransferHistoryService) Do

Do send request

func (*MarginIsolatedAccountTransferHistoryService) EndTime

EndTime set endTime

func (*MarginIsolatedAccountTransferHistoryService) Size

Size set size

func (*MarginIsolatedAccountTransferHistoryService) StartTime

StartTime set startTime

func (*MarginIsolatedAccountTransferHistoryService) Symbol

Symbol set symbol

func (*MarginIsolatedAccountTransferHistoryService) TransFrom

TransFrom set transFrom

func (*MarginIsolatedAccountTransferHistoryService) TransTo

TransTo set transTo

type MarginIsolatedAccountTransferResponse

type MarginIsolatedAccountTransferResponse struct {
	TranId string `json:"tranId"`
}

MarginIsolatedAccountTransferService response

type MarginIsolatedAccountTransferService

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

func (*MarginIsolatedAccountTransferService) Amount

Amount set amount

func (*MarginIsolatedAccountTransferService) Asset

Asset set asset

func (*MarginIsolatedAccountTransferService) Do

Do send request

func (*MarginIsolatedAccountTransferService) Symbol

Symbol set symbol

func (*MarginIsolatedAccountTransferService) TransFrom

TransFrom set transFrom

func (*MarginIsolatedAccountTransferService) TransTo

TransTo set transTo

type MarginIsolatedMarginFeeResponse

type MarginIsolatedMarginFeeResponse struct {
	VIPLevel int    `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"`
}

MarginIsolatedMarginFeeService response

type MarginIsolatedMarginFeeService

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

func (*MarginIsolatedMarginFeeService) Do

Do send request

func (*MarginIsolatedMarginFeeService) Symbol

Symbol set symbol

func (*MarginIsolatedMarginFeeService) VipLevel

VipLevel set vipLevel

type MarginIsolatedMarginTierResponse

type MarginIsolatedMarginTierResponse struct {
	Symbol                  string `json:"symbol"`
	Tier                    int    `json:"tier"`
	EffectiveMultiple       string `json:"effectiveMultiple"`
	InitialRiskRatio        string `json:"initialRiskRatio"`
	LiquidationRiskRatio    string `json:"liquidationRiskRatio"`
	BaseAssetMaxBorrowable  string `json:"baseAssetMaxBorrowable"`
	QuoteAssetMaxBorrowable string `json:"quoteAssetMaxBorrowable"`
}

MarginIsolatedMarginTierService response

type MarginIsolatedMarginTierService

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

func (*MarginIsolatedMarginTierService) Do

Do send request

func (*MarginIsolatedMarginTierService) Symbol

Symbol set symbol

func (*MarginIsolatedMarginTierService) Tier

Tier set tier

type MarginIsolatedSymbolResponse

type MarginIsolatedSymbolResponse 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"`
}

MarginIsolatedSymbolService response

type MarginIsolatedSymbolService

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

func (*MarginIsolatedSymbolService) Do

Do send request

func (*MarginIsolatedSymbolService) Symbol

Symbol set symbol

type MarginSmallLiabilityExchangeCoinListResponse

type MarginSmallLiabilityExchangeCoinListResponse struct {
	Asset           string `json:"asset"`
	Interest        string `json:"interest"`
	Principal       string `json:"principal"`
	LiabilityOfBUSD string `json:"liabilityOfBUSD"`
}

MarginSmallLiabilityExchangeCoinListService response

type MarginSmallLiabilityExchangeCoinListService

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

func (*MarginSmallLiabilityExchangeCoinListService) Do

Do send request

type MarginSmallLiabilityExchangeHistoryResponse

type MarginSmallLiabilityExchangeHistoryResponse struct {
	Total int `json:"total"`
	Rows  []*struct {
		Asset        string `json:"asset"`
		Amount       string `json:"amount"`
		TargetAsset  string `json:"targetAsset"`
		TargetAmount string `json:"targetAmount"`
		BizType      string `json:"bizType"`
		Timestamp    uint64 `json:"timestamp"`
	} `json:"rows"`
}

MarginSmallLiabilityExchangeHistoryService response

type MarginSmallLiabilityExchangeHistoryService

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

func (*MarginSmallLiabilityExchangeHistoryService) Current

Current set current

func (*MarginSmallLiabilityExchangeHistoryService) Do

Do send request

func (*MarginSmallLiabilityExchangeHistoryService) EndTime

EndTime set endTime

func (*MarginSmallLiabilityExchangeHistoryService) Size

Size set size

func (*MarginSmallLiabilityExchangeHistoryService) StartTime

StartTime set startTime

type MarginSmallLiabilityExchangeResponse

type MarginSmallLiabilityExchangeResponse struct {
}

MarginSmallLiabilityExchangeService response

type MarginSmallLiabilityExchangeService

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

func (*MarginSmallLiabilityExchangeService) AssetNames

AssetNames set assetNames

func (*MarginSmallLiabilityExchangeService) Do

Do send request

type MarginToggleBnbBurnResponse

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

MarginToggleBnbBurnService response

type MarginToggleBnbBurnService

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

func (*MarginToggleBnbBurnService) Do

Do send request

func (*MarginToggleBnbBurnService) InterestBNBBurn

func (s *MarginToggleBnbBurnService) InterestBNBBurn(interestBNBBurn string) *MarginToggleBnbBurnService

InterestBNBBurn set interestBNBBurn

func (*MarginToggleBnbBurnService) SpotBNBBurn

func (s *MarginToggleBnbBurnService) SpotBNBBurn(spotBNBBurn string) *MarginToggleBnbBurnService

SpotBNBBurn set spotBNBBurn

type MarginTransferForSubAccountResp

type MarginTransferForSubAccountResp struct {
	TxnId int `json:"txnId"`
}

type MarginTransferForSubAccountService

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

func (*MarginTransferForSubAccountService) Amount

func (*MarginTransferForSubAccountService) Asset

func (*MarginTransferForSubAccountService) Do

func (*MarginTransferForSubAccountService) Email

func (*MarginTransferForSubAccountService) TransferType

type NewAllOrdersResponse

type NewAllOrdersResponse struct {
	Symbol                  string `json:"symbol"`
	ListClientOrderId       string `json:"listClientOrderId"`
	OrderId                 int64  `json:"orderId"`
	OrderListId             int64  `json:"orderListId"`
	ClientOrderId           string `json:"clientOrderId"`
	Price                   string `json:"price"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumulativeQuoteQty      string `json:"cumulativeQuoteQty"`
	Status                  string `json:"status"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	Side                    string `json:"side"`
	StopPrice               string `json:"stopPrice"`
	IcebergQty              string `json:"icebergQty,omitempty"`
	Time                    uint64 `json:"time"`
	UpdateTime              uint64 `json:"updateTime"`
	IsWorking               bool   `json:"isWorking"`
	OrigQuoteOrderQty       string `json:"origQuoteOrderQty"`
	WorkingTime             uint64 `json:"workingTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	PreventedMatchId        int64  `json:"preventedMatchId,omitempty"`
	PreventedQuantity       string `json:"preventedQuantity,omitempty"`
	StrategyId              int64  `json:"strategyId,omitempty"`
	StrategyType            int64  `json:"strategyType,omitempty"`
	TrailingDelta           string `json:"trailingDelta,omitempty"`
	TrailingTime            int64  `json:"trailingTime,omitempty"`
}

Create NewAllOrdersResponse

type NewOCOService

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

Binance New OCO (TRADE) (POST /api/v3/order/oco) NewOCOService create new OCO order

func (*NewOCOService) Do

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

Do send request

func (*NewOCOService) LimitClientOrderId

func (s *NewOCOService) LimitClientOrderId(limitClientOrderId string) *NewOCOService

LimitClientOrderId set limitClientOrderId

func (*NewOCOService) LimitIcebergQty

func (s *NewOCOService) LimitIcebergQty(limitIcebergQty float64) *NewOCOService

LimitIcebergQty set limitIcebergQty

func (*NewOCOService) LimitStrategyId

func (s *NewOCOService) LimitStrategyId(limitStrategyId int) *NewOCOService

LimitStrategyId set limitStrategyId

func (*NewOCOService) LimitStrategyType

func (s *NewOCOService) LimitStrategyType(limitStrategyType int) *NewOCOService

LimitStrategyType set limitStrategyType

func (*NewOCOService) ListClientOrderId

func (s *NewOCOService) ListClientOrderId(listClientOrderId string) *NewOCOService

ListClientOrderId set listClientOrderId

func (*NewOCOService) NewOrderRespType

func (s *NewOCOService) NewOrderRespType(newOrderRespType string) *NewOCOService

NewOrderRespType set newOrderRespType

func (*NewOCOService) Price

func (s *NewOCOService) Price(price float64) *NewOCOService

Price set price

func (*NewOCOService) Quantity

func (s *NewOCOService) Quantity(quantity float64) *NewOCOService

Quantity set quantity

func (*NewOCOService) SelfTradePreventionMode

func (s *NewOCOService) SelfTradePreventionMode(selfTradePreventionMode string) *NewOCOService

selfTradePreventionMode set selfTradePreventionMode

func (*NewOCOService) Side

func (s *NewOCOService) Side(side string) *NewOCOService

Side set side

func (*NewOCOService) StopClientOrderId

func (s *NewOCOService) StopClientOrderId(stopClientOrderId string) *NewOCOService

StopClientOrderId set stopClientOrderId

func (*NewOCOService) StopIcebergQty

func (s *NewOCOService) StopIcebergQty(stopIcebergQty float64) *NewOCOService

StopIcebergQty set stopIcebergQty

func (*NewOCOService) StopLimitPrice

func (s *NewOCOService) StopLimitPrice(stopLimitPrice float64) *NewOCOService

StopLimitPrice set stopLimitPrice

func (*NewOCOService) StopLimitTimeInForce

func (s *NewOCOService) StopLimitTimeInForce(stopLimitTimeInForce string) *NewOCOService

StopLimitTimeInForce set stopLimitTimeInForce

func (*NewOCOService) StopPrice

func (s *NewOCOService) StopPrice(stopPrice float64) *NewOCOService

StopPrice set stopPrice

func (*NewOCOService) StopStrategyId

func (s *NewOCOService) StopStrategyId(stopStrategyId int) *NewOCOService

StopStrategyId set stopStrategyId

func (*NewOCOService) StopStrategyType

func (s *NewOCOService) StopStrategyType(stopStrategyType int) *NewOCOService

StopStrategyType set stopStrategyType

func (*NewOCOService) Symbol

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

Symbol set symbol

func (*NewOCOService) TrailingDelta

func (s *NewOCOService) TrailingDelta(trailingDelta int) *NewOCOService

TrailingDelta set trailingDelta

type NewOpenOrdersResponse

type NewOpenOrdersResponse struct {
	Symbol                  string `json:"symbol"`
	OrderId                 int64  `json:"orderId"`
	OrderListId             int64  `json:"orderListId"`
	ClientOrderId           string `json:"clientOrderId"`
	Price                   string `json:"price"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumulativeQuoteQty      string `json:"cumulativeQuoteQty"`
	Status                  string `json:"status"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	Side                    string `json:"side"`
	StopPrice               string `json:"stopPrice"`
	IcebergQty              string `json:"icebergQty,omitempty"`
	Time                    uint64 `json:"time"`
	UpdateTime              uint64 `json:"updateTime"`
	IsWorking               bool   `json:"isWorking"`
	WorkingTime             uint64 `json:"workingTime"`
	OrigQuoteOrderQty       string `json:"origQuoteOrderQty"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	PreventedMatchId        int64  `json:"preventedMatchId,omitempty"`
	PreventedQuantity       string `json:"preventedQuantity,omitempty"`
	StrategyId              int64  `json:"strategyId,omitempty"`
	StrategyType            int64  `json:"strategyType,omitempty"`
	TrailingDelta           string `json:"trailingDelta,omitempty"`
	TrailingTime            int64  `json:"trailingTime,omitempty"`
}

Create NewOpenOrdersResponse

type OCOResponse

type OCOResponse struct {
	OrderListId       int64  `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderId string `json:"listClientOrderId"`
	TransactionTime   uint64 `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderId       int64  `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
}

Create OCOResponse

type OrderBook

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

Binance Order Book endpoint (GET /api/v3/depth)

func (*OrderBook) Do

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

Send the request

func (*OrderBook) Limit

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

Limit set limit

func (*OrderBook) Symbol

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

Symbol set symbol

type OrderBookResponse

type OrderBookResponse struct {
	LastUpdateId uint64         `json:"lastUpdateId"`
	Bids         [][]*big.Float `json:"bids"`
	Asks         [][]*big.Float `json:"asks"`
}

OrderBookResponse define order book response

type OrderOCOResponse

type OrderOCOResponse struct {
	OrderListId       int64  `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderId string `json:"listClientOrderId"`
	TransactionTime   uint64 `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderId       int64  `json:"orderId"`
		ClientOrderId string `json:"clientOrderId"`
	} `json:"orders"`
	OrderReports []struct {
		Symbol                  string  `json:"symbol"`
		OrderId                 int64   `json:"orderId"`
		OrderListId             int64   `json:"orderListId"`
		ClientOrderId           string  `json:"clientOrderId"`
		TransactTime            uint64  `json:"transactTime"`
		Price                   float64 `json:"price"`
		OrigQty                 float64 `json:"origQty"`
		ExecutedQty             float64 `json:"executedQty"`
		CummulativeQuoteQty     float64 `json:"cummulativeQuoteQty"`
		Status                  string  `json:"status"`
		TimeInForce             string  `json:"timeInForce"`
		Type                    string  `json:"type"`
		Side                    string  `json:"side"`
		StopPrice               string  `json:"stopPrice"`
		WorkingTime             uint64  `json:"workingTime"`
		SelfTradePreventionMode string  `json:"selfTradePreventionMode"`
		IcebergQty              string  `json:"icebergQty,omitempty"`
		PreventedMatchId        int64   `json:"preventedMatchId,omitempty"`
		PreventedQuantity       string  `json:"preventedQuantity,omitempty"`
		StrategyId              int64   `json:"strategyId,omitempty"`
		StrategyType            int64   `json:"strategyType,omitempty"`
		TrailingDelta           string  `json:"trailingDelta,omitempty"`
		TrailingTime            int64   `json:"trailingTime,omitempty"`
	} `json:"orderReports"`
}

type PersonalLeftQuotaResponse

type PersonalLeftQuotaResponse struct {
	LeftPersonalQuota string `json:"leftPersonalQuota"`
}

PersonalLeftQuotaResponse define get staking asset response

type PersonalLeftQuotaService

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

Get Personal Left Quota of Staking Product(USER_DATA)

func (*PersonalLeftQuotaService) Do

Do send request

func (*PersonalLeftQuotaService) Product

Product set product

func (*PersonalLeftQuotaService) ProductId

func (s *PersonalLeftQuotaService) ProductId(productId string) *PersonalLeftQuotaService

ProductId set productId

type Ping

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

Binance Test Connectivity endpoint (GET /api/v3/ping)

func (*Ping) Do

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

Send the request

type PingUserStream

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

Keep Alive/Ping User Stream

func (*PingUserStream) Do

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

Do send request

func (*PingUserStream) ListenKey

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

ListenKey set listen key

type PriceLevel

type PriceLevel struct {
	Price    string
	Quantity string
}

func (*PriceLevel) Parse

func (p *PriceLevel) Parse() (float64, float64, error)

Parse parses this PriceLevel's Price and Quantity and returns them both. It also returns an error if either fails to parse.

type PurchaseStakingProductResponse

type PurchaseStakingProductResponse struct {
	PositionId string `json:"positionId"`
	Success    bool   `json:"success"`
}

PurchaseStakingProductResponse define purchase staking product response

type PurchaseStakingProductService

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

Purchase Staking Product(USER_DATA)

func (*PurchaseStakingProductService) Amount

Amount set amount

func (*PurchaseStakingProductService) Do

Do send request

func (*PurchaseStakingProductService) Product

Product set product

func (*PurchaseStakingProductService) ProductId

ProductId set productId

func (*PurchaseStakingProductService) Renewable

Renewable set renewable

type QueryAllOCOService

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

Binance Query all OCO (USER_DATA) (GET /api/v3/allOrderList) QueryAllOCOService query all OCO order

func (*QueryAllOCOService) Do

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

Do send request

func (*QueryAllOCOService) EndTime

func (s *QueryAllOCOService) EndTime(endTime uint64) *QueryAllOCOService

EndTime set endTime

func (*QueryAllOCOService) FromId

func (s *QueryAllOCOService) FromId(fromId int64) *QueryAllOCOService

FromId set fromId

func (*QueryAllOCOService) Limit

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

Limit set limit

func (*QueryAllOCOService) StartTime

func (s *QueryAllOCOService) StartTime(startTime uint64) *QueryAllOCOService

StartTime set startTime

type QueryCrossMarginPairResponse

type QueryCrossMarginPairResponse struct {
	SymbolDetail struct {
		Symbol        string `json:"symbol"`
		IsMarginTrade bool   `json:"isMarginTrade"`
		IsBuyAllowed  bool   `json:"isBuyAllowed"`
		IsSellAllowed bool   `json:"isSellAllowed"`
	} `json:"symbolDetail"`
}

QueryCrossMarginPairResponse define query cross margin pair response

type QueryCrossMarginPairService

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

QueryCrossMarginPairService query cross margin pair

func (*QueryCrossMarginPairService) Do

Do send request

func (*QueryCrossMarginPairService) Symbol

Symbol set symbol

type QueryCurrentOrderCountUsageResponse

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

Create QueryCurrentOrderCountUsageResponse

type QueryManagedSubAccountAssetDetailsResp

type QueryManagedSubAccountAssetDetailsResp struct {
	AssetDetail []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"`
	} `json:"assetDetail"`
}

type QueryManagedSubAccountAssetDetailsService

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

func (*QueryManagedSubAccountAssetDetailsService) Do

func (*QueryManagedSubAccountAssetDetailsService) Email

type QueryManagedSubAccountFuturesAssetDetailsResp

type QueryManagedSubAccountFuturesAssetDetailsResp struct {
	Code        int    `json:"code"`
	Message     string `json:"message"`
	SnapshotVos []struct {
		Type       string `json:"type"`
		UpdateTime uint64 `json:"updateTime"`
		Data       struct {
			Assets []struct {
				Asset         string `json:"asset"`
				MarginBalance int64  `json:"marginBalance"`
				WalletBalance int64  `json:"walletBalance"`
			} `json:"assets"`
			Position []struct {
				Symbol      string `json:"symbol"`
				EntryPrice  int64  `json:"entryPrice"`
				MarkPrice   int64  `json:"markPrice"`
				PositionAmt int64  `json:"positionAmt"`
			} `json:"position"`
		} `json:"data"`
	} `json:"snapshotVos"`
}

type QueryManagedSubAccountFuturesAssetDetailsService

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

func (*QueryManagedSubAccountFuturesAssetDetailsService) Do

func (*QueryManagedSubAccountFuturesAssetDetailsService) Email

type QueryManagedSubAccountList

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

func (*QueryManagedSubAccountList) Do

func (*QueryManagedSubAccountList) Email

func (*QueryManagedSubAccountList) Limit

func (*QueryManagedSubAccountList) Page

type QueryManagedSubAccountListResp

type QueryManagedSubAccountListResp struct {
	Total                    int `json:"total"`
	ManagerSubUserInfoVoList []struct {
		RootUserId               int    `json:"rootUserId"`
		ManagersubUserId         int    `json:"managersubUserId"`
		BindParentUserId         int    `json:"bindParentUserId"`
		Email                    string `json:"email"`
		InsertTimestamp          uint64 `json:"insertTimestamp"`
		BindParentEmail          string `json:"bindParentEmail"`
		IsSubUserEnabled         bool   `json:"isSubUserEnabled"`
		IsUserActive             bool   `json:"isUserActive"`
		IsMarginEnabled          bool   `json:"isMarginEnabled"`
		IsFutureEnabled          bool   `json:"isFutureEnabled"`
		IsSignedLVTRiskAgreement bool   `json:"isSignedLVTRiskAgreement"`
	} `json:"managerSubUserInfoVoList"`
}

type QueryManagedSubAccountMarginAssetDetailsResp

type QueryManagedSubAccountMarginAssetDetailsResp struct {
	MarginLevel         string `json:"marginLevel"`
	TotalAssetOfBtc     string `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string `json:"totalNetAssetOfBtc"`
	UserAssets          []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"`
	} `json:"userAssets"`
}

type QueryManagedSubAccountMarginAssetDetailsService

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

func (*QueryManagedSubAccountMarginAssetDetailsService) Do

func (*QueryManagedSubAccountMarginAssetDetailsService) Email

type QueryManagedSubAccountSnapshotResp

type QueryManagedSubAccountSnapshotResp struct {
	Code        int    `json:"code"`
	Msg         string `json:"msg"`
	SnapshotVos []struct {
		Data []struct {
			Balances []struct {
				Asset  string `json:"asset"`
				Free   string `json:"free"`
				Locked string `json:"locked"`
			} `json:"balances"`
			TotalAssetOfBtc string `json:"totalAssetOfBtc"`
		} `json:"data"`
		Type       string `json:"type"`
		UpdateTime uint64 `json:"updateTime"`
	} `json:"snapshotVos"`
}

type QueryManagedSubAccountSnapshotService

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

func (*QueryManagedSubAccountSnapshotService) Do

func (*QueryManagedSubAccountSnapshotService) Email

func (*QueryManagedSubAccountSnapshotService) EndTime

func (*QueryManagedSubAccountSnapshotService) Limit

func (*QueryManagedSubAccountSnapshotService) StartTime

func (*QueryManagedSubAccountSnapshotService) SubType

type QueryManagedSubAccountTransferLogForTradingTeamResp

type QueryManagedSubAccountTransferLogForTradingTeamResp struct {
	ManagerSubTransferHistoryVos []struct {
		FromEmail       string `json:"fromEmail"`
		FromAccountType string `json:"fromAccountType"`
		ToEmail         string `json:"toEmail"`
		ToAccountType   string `json:"toAccountType"`
		Asset           string `json:"asset"`
		Amount          string `json:"amount"`
		ScheduledData   int64  `json:"scheduledData"`
		CreateTime      uint64 `json:"createTime"`
		Status          string `json:"status"`
	} `json:"managerSubTransferHistoryVos"`
	Count int `json:"count"`
}

type QueryManagedSubAccountTransferLogForTradingTeamService

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

func (*QueryManagedSubAccountTransferLogForTradingTeamService) Do

func (*QueryManagedSubAccountTransferLogForTradingTeamService) Email

func (*QueryManagedSubAccountTransferLogForTradingTeamService) EndTime

func (*QueryManagedSubAccountTransferLogForTradingTeamService) Limit

func (*QueryManagedSubAccountTransferLogForTradingTeamService) Page

func (*QueryManagedSubAccountTransferLogForTradingTeamService) StartTime

func (*QueryManagedSubAccountTransferLogForTradingTeamService) TransferFunctionAccountType

func (*QueryManagedSubAccountTransferLogForTradingTeamService) Transfers

type QueryManagedSubAccountTransferLogResp

type QueryManagedSubAccountTransferLogResp struct {
	ManagerSubTransferHistoryVos []struct {
		FromEmail       string `json:"fromEmail"`
		FromAccountType string `json:"fromAccountType"`
		ToEmail         string `json:"toEmail"`
		ToAccountType   string `json:"toAccountType"`
		Asset           string `json:"asset"`
		Amount          int    `json:"amount"`
		ScheduledData   int    `json:"scheduledData"`
		CreateTime      uint64 `json:"createTime"`
		Status          string `json:"status"`
	} `json:"managerSubTransferHistoryVos"`
	Count int `json:"count"`
}

type QueryManagedSubAccountTransferLogService

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

func (*QueryManagedSubAccountTransferLogService) Do

func (*QueryManagedSubAccountTransferLogService) Email

func (*QueryManagedSubAccountTransferLogService) EndTime

func (*QueryManagedSubAccountTransferLogService) Limit

func (*QueryManagedSubAccountTransferLogService) Page

func (*QueryManagedSubAccountTransferLogService) StartTime

func (*QueryManagedSubAccountTransferLogService) TransferFunctionAccountType

func (s *QueryManagedSubAccountTransferLogService) TransferFunctionAccountType(transferFunctionAccountType string) *QueryManagedSubAccountTransferLogService

func (*QueryManagedSubAccountTransferLogService) Transfers

type QueryMarginAssetResponse

type QueryMarginAssetResponse 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"`
}

QueryMarginAssetResponse define query margin asset response

type QueryMarginAssetService

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

QueryMarginAssetService query margin asset

func (*QueryMarginAssetService) Asset

Asset set asset

func (*QueryMarginAssetService) Do

Do send request

type QueryMarginPriceIndexResponse

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

QueryMarginPriceIndexResponse define query margin price index response

type QueryMarginPriceIndexService

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

QueryMarginPriceIndexService query margin price index

func (*QueryMarginPriceIndexService) Do

Do send request

func (*QueryMarginPriceIndexService) Symbol

Symbol set symbol

type QueryOCOService

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

Binance Query OCO (USER_DATA) (GET /api/v3/orderList) QueryOCOService query OCO order

func (*QueryOCOService) Do

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

Do send request

func (*QueryOCOService) OrderListId

func (s *QueryOCOService) OrderListId(orderListId int64) *QueryOCOService

OrderListId set orderListId

func (*QueryOCOService) OrigClientOrderId

func (s *QueryOCOService) OrigClientOrderId(origClientOrderId string) *QueryOCOService

OrigClientOrderId set origClientOrderId

type QueryOpenOCOService

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

Binance Query open OCO (USER_DATA) (GET /api/v3/openOrderList) QueryOpenOCOService query open OCO order

func (*QueryOpenOCOService) Do

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

Do send request

type QueryPreventedMatchesResponse

type QueryPreventedMatchesResponse struct {
	PreventedMatches []struct {
		Symbol                  string `json:"symbol"`
		PreventedMatchId        int64  `json:"preventedMatchId"`
		TakerOrderId            int64  `json:"takerOrderId"`
		MakerOrderId            int64  `json:"makerOrderId"`
		TradeGroupId            int64  `json:"tradeGroupId"`
		SelfTradePreventionMode string `json:"selfTradePreventionMode"`
		Price                   string `json:"price"`
		MakerPreventedQuantity  string `json:"makerPreventedQuantity"`
		TransactTime            uint64 `json:"transactTime"`
	} `json:"preventedMatches"`
}

Create QueryPreventedMatchesResponse

type QuerySubAccountAssetsForMasterAccountResp

type QuerySubAccountAssetsForMasterAccountResp struct {
	Balances []struct {
		Asset  string `json:"asset"`
		Free   string `json:"free"`
		Locked string `json:"locked"`
	} `json:"balances"`
}

type QuerySubAccountAssetsForMasterAccountService

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

func (*QuerySubAccountAssetsForMasterAccountService) Do

func (*QuerySubAccountAssetsForMasterAccountService) Email

type QuerySubAccountAssetsResp

type QuerySubAccountAssetsResp struct {
	Balances []struct {
		Asset  string `json:"asset"`
		Free   string `json:"free"`
		Locked string `json:"locked"`
	} `json:"balances"`
}

type QuerySubAccountAssetsService

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

func (*QuerySubAccountAssetsService) Do

func (*QuerySubAccountAssetsService) Email

type QuerySubAccountFuturesAssetTransferHistoryResp

type QuerySubAccountFuturesAssetTransferHistoryResp struct {
	Success     bool  `json:"success"`
	FuturesType int64 `json:"futuresType"`
	Transfers   []struct {
		From   string `json:"from"`
		To     string `json:"to"`
		Asset  string `json:"asset"`
		Qty    string `json:"qty"`
		TranId int64  `json:"tranId"`
		Time   uint64 `json:"time"`
	} `json:"transfers"`
}

type QuerySubAccountFuturesAssetTransferHistoryService

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

func (*QuerySubAccountFuturesAssetTransferHistoryService) Do

func (*QuerySubAccountFuturesAssetTransferHistoryService) Email

func (*QuerySubAccountFuturesAssetTransferHistoryService) EndTime

func (*QuerySubAccountFuturesAssetTransferHistoryService) FuturesType

func (*QuerySubAccountFuturesAssetTransferHistoryService) Limit

func (*QuerySubAccountFuturesAssetTransferHistoryService) Page

func (*QuerySubAccountFuturesAssetTransferHistoryService) StartTime

type QuerySubAccountListService

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

func (*QuerySubAccountListService) Do

func (*QuerySubAccountListService) Email

func (*QuerySubAccountListService) IsFreeze

func (*QuerySubAccountListService) Limit

func (*QuerySubAccountListService) Page

type QuerySubAccountSpotAssetTransferHistoryResp

type QuerySubAccountSpotAssetTransferHistoryResp struct {
	Rows []struct {
		From   string `json:"from"`
		To     string `json:"to"`
		Asset  string `json:"asset"`
		Qty    string `json:"qty"`
		Status string `json:"status"`
		TranId int64  `json:"tranId"`
		Time   uint64 `json:"time"`
	}
}

type QuerySubAccountSpotAssetTransferHistoryService

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

func (*QuerySubAccountSpotAssetTransferHistoryService) Do

func (*QuerySubAccountSpotAssetTransferHistoryService) EndTime

func (*QuerySubAccountSpotAssetTransferHistoryService) FromEmail

func (*QuerySubAccountSpotAssetTransferHistoryService) Limit

func (*QuerySubAccountSpotAssetTransferHistoryService) Page

func (*QuerySubAccountSpotAssetTransferHistoryService) StartTime

func (*QuerySubAccountSpotAssetTransferHistoryService) ToEmail

type QuerySubAccountSpotAssetsSummaryResp

type QuerySubAccountSpotAssetsSummaryResp struct {
	TotalCount                int64  `json:"totalCount"`
	MasterAccountTotalAsset   string `json:"masterAccountTotalAsset"`
	SpotSubUserAssetBtcVoList []struct {
		Email   string `json:"email"`
		ToAsset string `json:"toAsset"`
	} `json:"spotSubUserAssetBtcVoList"`
}

type QuerySubAccountSpotAssetsSummaryService

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

func (*QuerySubAccountSpotAssetsSummaryService) Do

func (*QuerySubAccountSpotAssetsSummaryService) Email

func (*QuerySubAccountSpotAssetsSummaryService) Page

func (*QuerySubAccountSpotAssetsSummaryService) Size

type QuerySubAccountTransactionTatistics

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

func (*QuerySubAccountTransactionTatistics) Do

func (*QuerySubAccountTransactionTatistics) Email

type QuerySubAccountTransactionTatisticsResp

type QuerySubAccountTransactionTatisticsResp struct {
	Recent30BtcTotal         string `json:"recent30BtcTotal"`
	Recent30BtcFuturesTotal  string `json:"recent30BtcFuturesTotal"`
	Recent30BtcMarginTotal   string `json:"recent30BtcMarginTotal"`
	Recent30BusdTotal        string `json:"recent30BusdTotal"`
	Recent30BusdFuturesTotal string `json:"recent30BusdFuturesTotal"`
	Recent30BusdMarginTotal  string `json:"recent30BusdMarginTotal"`
	TradeInfoVos             []struct {
		UserId      int64 `json:"userId"`
		Btc         int   `json:"btc"`
		BtcFutures  int   `json:"btcFutures"`
		BtcMargin   int   `json:"btcMargin"`
		Busd        int   `json:"busd"`
		BusdFutures int   `json:"busdFutures"`
		BusdMargin  int   `json:"busdMargin"`
		Date        int64 `json:"date"`
	} `json:"tradeInfoVos"`
}

type QueryUniversalTransferHistoryResp

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

type QueryUniversalTransferHistoryService

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

func (*QueryUniversalTransferHistoryService) ClientTranId

func (*QueryUniversalTransferHistoryService) Do

func (*QueryUniversalTransferHistoryService) EndTime

func (*QueryUniversalTransferHistoryService) FromEmail

func (*QueryUniversalTransferHistoryService) Limit

func (*QueryUniversalTransferHistoryService) Page

func (*QueryUniversalTransferHistoryService) StartTime

func (*QueryUniversalTransferHistoryService) ToEmail

type RateLimit

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

RateLimit define rate limit

type RecentTradesList

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

Binance Recent Trades List endpoint (GET /api/v3/trades)

func (*RecentTradesList) Do

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

Send the request

func (*RecentTradesList) Limit

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

Limit set limit

func (*RecentTradesList) Symbol

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

Symbol set symbol

type RecentTradesListResponse

type RecentTradesListResponse struct {
	Id           uint64 `json:"id"`
	Price        string `json:"price"`
	Qty          string `json:"qty"`
	Time         uint64 `json:"time"`
	QuoteQty     string `json:"quoteQty"`
	IsBuyerMaker bool   `json:"isBuyerMaker"`
	IsBest       bool   `json:"isBestMatch"`
}

RecentTradesListResponse define recent trades list response

type RedeemStakingProductResponse

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

RedeemStakingProductResponse define redeem staking product response

type RedeemStakingProductService

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

Redeem Staking Product(USER_DATA)

func (*RedeemStakingProductService) Amount

Amount set amount

func (*RedeemStakingProductService) Do

Do send request

func (*RedeemStakingProductService) PositionId

PositionId set positionId

func (*RedeemStakingProductService) Product

Product set product

func (*RedeemStakingProductService) ProductId

ProductId set productId

type RepayRecordResponse

type RepayRecordResponse struct {
	Rows []struct {
		IsolatedSymbol string `json:"isolatedSymbol"`
		Amount         string `json:"amount"`
		Asset          string `json:"asset"`
		Interest       string `json:"interest"`
		Principal      string `json:"principal"`
		Status         string `json:"status"`
		Timestamp      uint64 `json:"timestamp"`
		TxId           int64  `json:"txId"`
	} `json:"rows"`
	Total int `json:"total"`
}

RepayRecordResponse define repay record response

type RepayRecordService

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

RepayRecordService query repay record

func (*RepayRecordService) Archived

func (s *RepayRecordService) Archived(archived string) *RepayRecordService

Archived set archived

func (*RepayRecordService) Asset

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

Asset set asset

func (*RepayRecordService) Current

func (s *RepayRecordService) Current(current int) *RepayRecordService

Current set current

func (*RepayRecordService) Do

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

Do send request

func (*RepayRecordService) EndTime

func (s *RepayRecordService) EndTime(endTime uint64) *RepayRecordService

EndTime set endTime

func (*RepayRecordService) IsolatedSymbol

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

IsolatedSymbol set isolatedSymbol

func (*RepayRecordService) Size

func (s *RepayRecordService) Size(size int) *RepayRecordService

Size set size

func (*RepayRecordService) StartTime

func (s *RepayRecordService) StartTime(startTime uint64) *RepayRecordService

StartTime set startTime

func (*RepayRecordService) TxId

TxId set txid

type RepayResponse

type RepayResponse struct {
	TranId int64 `json:"tranId"`
}

RepayResponse define repay response

type RepayService

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

RepayService repay to cross margin account

func (*RepayService) Amount

func (s *RepayService) Amount(amount float64) *RepayService

Amount set amount

func (*RepayService) Asset

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

Asset set asset

func (*RepayService) Do

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

Do send request

func (*RepayService) IsIsolated

func (s *RepayService) IsIsolated(isIsolated string) *RepayService

IsIsolated set isolated

func (*RepayService) Symbol

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

Symbol set symbol

type RequestOption

type RequestOption func(*request)

RequestOption define option type for request

func WithRecvWindow

func WithRecvWindow(recvWindow int64) RequestOption

Append `WithRecvWindow(insert_recvwindow)` to request to modify the default recvWindow value

type ServerTime

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

Binance Check Server Time endpoint (GET /api/v3/time)

func (*ServerTime) Do

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

Send the request

type ServerTimeResponse

type ServerTimeResponse struct {
	ServerTime uint64 `json:"serverTime"`
}

ServerTimeResponse define server time response

type SetAutoStakingResponse

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

SetAutoStakingResponse define set auto staking response

type SetAutoStakingService

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

Set Auto Staking(USER_DATA)

func (*SetAutoStakingService) Do

Do send request

func (*SetAutoStakingService) PositionId

func (s *SetAutoStakingService) PositionId(positionId string) *SetAutoStakingService

PositionId set positionId

func (*SetAutoStakingService) Product

func (s *SetAutoStakingService) Product(product string) *SetAutoStakingService

Product set product

func (*SetAutoStakingService) Renewable

func (s *SetAutoStakingService) Renewable(renewable string) *SetAutoStakingService

Renewable set renewable

type StakingProductListResponse

type StakingProductListResponse struct {
	ProjectId string `json:"projectId"`
	Detail    struct {
		Asset       string `json:"asset"`
		RewardAsset string `json:"rewardAsset"`
		Duration    int64  `json:"duration"`
		Renewable   bool   `json:"renewable"`
		Apy         string `json:"apy"`
	} `json:"detail"`
	Quota struct {
		TotalPersonalQuota string `json:"totalPersonalQuota"`
		Minimum            string `json:"minimum"`
	} `json:"quota"`
}

StakingProductListResponse define staking product list response

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 SubAccountFuturesAssetTransferResp

type SubAccountFuturesAssetTransferResp struct {
	Success bool   `json:"success"`
	TxnId   string `json:"txnId"`
}

type SubAccountFuturesAssetTransferService

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

func (*SubAccountFuturesAssetTransferService) Amount

func (*SubAccountFuturesAssetTransferService) Asset

func (*SubAccountFuturesAssetTransferService) Do

func (*SubAccountFuturesAssetTransferService) FromEmail

func (*SubAccountFuturesAssetTransferService) FuturesType

func (*SubAccountFuturesAssetTransferService) ToEmail

type SubAccountListResp

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

type SubAccountTransferHistoryResp

type SubAccountTransferHistoryResp struct {
	CounterParty    string `json:"counterParty"`
	Email           string `json:"email"`
	Type            int    `json:"type"`
	Asset           string `json:"asset"`
	Qty             string `json:"qty"`
	FromAccountType string `json:"fromAccountType"`
	ToAccountType   string `json:"toAccountType"`
	Status          string `json:"status"`
	TranId          int    `json:"tranId"`
	Time            uint64 `json:"time"`
}

type SubAccountTransferHistoryService

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

func (*SubAccountTransferHistoryService) Asset

func (*SubAccountTransferHistoryService) Do

func (*SubAccountTransferHistoryService) EndTime

func (*SubAccountTransferHistoryService) Limit

func (*SubAccountTransferHistoryService) StartTime

func (*SubAccountTransferHistoryService) TransferType

type SymbolFilter

type SymbolFilter struct {
	FilterType       string `json:"filterType"`
	MinPrice         string `json:"minPrice"`
	MaxPrice         string `json:"maxPrice"`
	TickSize         string `json:"tickSize"`
	MinQty           string `json:"minQty"`
	MaxQty           string `json:"maxQty"`
	StepSize         string `json:"stepSize"`
	MinNotional      string `json:"minNotional"`
	Limit            uint   `json:"limit"`
	MaxNumAlgoOrders int64  `json:"maxNumAlgoOrders"`
}

SymbolFilter define symbol filter

type SymbolInfo

type SymbolInfo struct {
	Symbol                     string          `json:"symbol"`
	Status                     string          `json:"status"`
	BaseAsset                  string          `json:"baseAsset"`
	BaseAssetPrecision         int64           `json:"baseAssetPrecision"`
	QuoteAsset                 string          `json:"quoteAsset"`
	QuotePrecision             int64           `json:"quotePrecision"`
	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                    []*SymbolFilter `json:"filters"`
	Permissions                []string        `json:"permissions"`
}

Symbol define symbol

type SystemStatusResponse

type SystemStatusResponse struct {
	Status bool   `json:"status"`
	Msg    string `json:"msg"`
}

SystemStatusResponse define response of GetSystemStatusService

type TestNewOrder

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

Binance Test New Order endpoint (POST /api/v3/order/test)

func (*TestNewOrder) Do

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

Send the request

func (*TestNewOrder) IcebergQty

func (s *TestNewOrder) IcebergQty(icebergQty float64) *TestNewOrder

IcebergQty set icebergQty

func (*TestNewOrder) NewClientOrderId

func (s *TestNewOrder) NewClientOrderId(newClientOrderId string) *TestNewOrder

NewClientOrderId set newClientOrderId

func (*TestNewOrder) NewOrderRespType

func (s *TestNewOrder) NewOrderRespType(newOrderRespType string) *TestNewOrder

NewOrderRespType set newOrderRespType

func (*TestNewOrder) OrderType

func (s *TestNewOrder) OrderType(orderType string) *TestNewOrder

OrderType set orderType

func (*TestNewOrder) Price

func (s *TestNewOrder) Price(price float64) *TestNewOrder

Price set price

func (*TestNewOrder) Quantity

func (s *TestNewOrder) Quantity(quantity float64) *TestNewOrder

Quantity set quantity

func (*TestNewOrder) QuoteOrderQty

func (s *TestNewOrder) QuoteOrderQty(quoteOrderQty float64) *TestNewOrder

QuoteOrderQty set quoteOrderQty

func (*TestNewOrder) SelfTradePrevention

func (s *TestNewOrder) SelfTradePrevention(selfTradePrevention string) *TestNewOrder

SelfTradePrevention set selfTradePrevention

func (*TestNewOrder) Side

func (s *TestNewOrder) Side(side string) *TestNewOrder

Side set side

func (*TestNewOrder) StopPrice

func (s *TestNewOrder) StopPrice(stopPrice float64) *TestNewOrder

StopPrice set stopPrice

func (*TestNewOrder) StrategyId

func (s *TestNewOrder) StrategyId(strategyId int) *TestNewOrder

StrategyId set strategyId

func (*TestNewOrder) StrategyType

func (s *TestNewOrder) StrategyType(strategyType int) *TestNewOrder

StrategyType set strategyType

func (*TestNewOrder) Symbol

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

Symbol set symbol

func (*TestNewOrder) TimeInForce

func (s *TestNewOrder) TimeInForce(timeInForce string) *TestNewOrder

TimeInForce set timeInForce

func (*TestNewOrder) TrailingDelta

func (s *TestNewOrder) TrailingDelta(trailingDelta int) *TestNewOrder

TrailingDelta set trailingDelta

type Ticker

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

Binance Rolling window price change statistics (GET /api/v3/ticker)

func (*Ticker) Do

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

Send the request

func (*Ticker) Symbol

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

Symbol set symbol

func (*Ticker) Type

func (s *Ticker) Type(tickerType string) *Ticker

Type set type

func (*Ticker) WindowSize

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

WindowSize set windowSize

type Ticker24hr

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

Binance 24hr Ticker Price Change Statistics (GET /api/v3/ticker/24hr)

func (*Ticker24hr) Do

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

Send the request

func (*Ticker24hr) Symbol

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

Symbol set symbol

func (*Ticker24hr) Symbols

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

Symbols set symbols

type Ticker24hrResponse

type Ticker24hrResponse 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"`
	AskPrice           string `json:"askPrice"`
	OpenPrice          string `json:"openPrice"`
	HighPrice          string `json:"highPrice"`
	LowPrice           string `json:"lowPrice"`
	Volume             string `json:"volume"`
	QuoteVolume        string `json:"quoteVolume"`
	OpenTime           uint64 `json:"openTime"`
	CloseTime          uint64 `json:"closeTime"`
	FirstId            uint64 `json:"firstId"`
	LastId             uint64 `json:"lastId"`
	Count              uint64 `json:"count"`
}

Define Ticker24hr response data

type TickerBookTicker

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

Binance Symbol Order Book Ticker (GET /api/v3/ticker/bookTicker)

func (*TickerBookTicker) Do

func (s *TickerBookTicker) Do(ctx context.Context, opts ...RequestOption) (res []*TickerBookTickerResponse, err error)
func (s *ListBookTickersService) Do(ctx context.Context, opts ...RequestOption) (res []*BookTicker, err error) {
	r := &request{
		method:   http.MethodGet,
		endpoint: "/api/v3/ticker/bookTicker",
	}
	if s.symbol != nil {
		r.setParam("symbol", *s.symbol)
	}
	data, err := s.c.callAPI(ctx, r, opts...)
	data = common.ToJSONList(data)
	if err != nil {
		return []*BookTicker{}, err
	}
	res = make([]*BookTicker, 0)
	err = json.Unmarshal(data, &res)
	if err != nil {
		return []*BookTicker{}, err
	}
	return res, nil
}

Send the request

func (*TickerBookTicker) Symbol

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

Symbol set symbol

func (*TickerBookTicker) Symbols

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

Symbols set symbols

type TickerBookTickerResponse

type TickerBookTickerResponse struct {
	Symbol   string `json:"symbol"`
	BidPrice string `json:"bidPrice"`
	BidQty   string `json:"bidQty"`
	AskPrice string `json:"askPrice"`
	AskQty   string `json:"askQty"`
}

Define TickerBookTicker response data

type TickerPrice

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

Binance Symbol Price Ticker (GET /api/v3/ticker/price)

func (*TickerPrice) Do

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

Send the request

func (*TickerPrice) Symbol

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

Symbol set symbol

func (*TickerPrice) Symbols

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

Symbols set symbols

type TickerPriceResponse

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

Define TickerPrice response data

type TickerResponse

type TickerResponse 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"`
	AskPrice           string `json:"askPrice"`
	OpenPrice          string `json:"openPrice"`
	HighPrice          string `json:"highPrice"`
	LowPrice           string `json:"lowPrice"`
	Volume             string `json:"volume"`
	QuoteVolume        string `json:"quoteVolume"`
	OpenTime           uint64 `json:"openTime"`
	CloseTime          uint64 `json:"closeTime"`
	FirstId            uint64 `json:"firstId"`
	LastId             uint64 `json:"lastId"`
	Count              uint64 `json:"count"`
}

Define Ticker response data

type TimeInForceType

type TimeInForceType string

TimeInForceType define time in force type of order

type TradeFeeResponse

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

TradeFeeResponse define response of TradeFeeService

type TradeFeeService

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

TradeFeeService trade fee

func (*TradeFeeService) Do

func (s *TradeFeeService) Do(ctx context.Context) (res *TradeFeeResponse, err error)

func (*TradeFeeService) Symbol

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

Symbol set symbol

type TransferResponse

type TransferResponse struct {
	TranId int64 `json:"tranId"`
}

TransferResponse define transfer response

type TransferService

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

TransferService transfer between spot and margin account

func (*TransferService) Amount

func (s *TransferService) Amount(amount float64) *TransferService

Amount set amount

func (*TransferService) Asset

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

Asset set asset

func (*TransferService) Do

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

Do send request

func (*TransferService) TransferType

func (s *TransferService) TransferType(transferType int) *TransferService

TransferType set transfer type

type TransferToMasterResp

type TransferToMasterResp struct {
	TxnId int `json:"txnId"`
}

type TransferToMasterService

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

func (*TransferToMasterService) Amount

func (*TransferToMasterService) Asset

func (*TransferToMasterService) Do

type TransferToSubAccountOfSameMasterResp

type TransferToSubAccountOfSameMasterResp struct {
	TxnId int `json:"txnId"`
}

type TransferToSubAccountOfSameMasterService

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

func (*TransferToSubAccountOfSameMasterService) Amount

func (*TransferToSubAccountOfSameMasterService) Asset

func (*TransferToSubAccountOfSameMasterService) Do

func (*TransferToSubAccountOfSameMasterService) ToEmail

type UiKlines

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

Binance UI Klines GET /api/v3/uiKlines

func (*UiKlines) Do

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

Send the request

func (*UiKlines) EndTime

func (s *UiKlines) EndTime(endTime uint64) *UiKlines

EndTime set endTime

func (*UiKlines) Interval

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

Interval set interval

func (*UiKlines) Limit

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

Limit set limit

func (*UiKlines) StartTime

func (s *UiKlines) StartTime(startTime uint64) *UiKlines

StartTime set startTime

func (*UiKlines) Symbol

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

Symbol set symbol

type UiKlinesResponse

type UiKlinesResponse struct {
	OpenTime                 uint64 `json:"openTime"`
	Open                     string `json:"open"`
	High                     string `json:"high"`
	Low                      string `json:"low"`
	Close                    string `json:"close"`
	Volume                   string `json:"volume"`
	CloseTime                uint64 `json:"closeTime"`
	QuoteAssetVolume         string `json:"quoteAssetVolume"`
	NumberOfTrades           uint64 `json:"numberOfTrades"`
	TakerBuyBaseAssetVolume  string `json:"takerBuyBaseAssetVolume"`
	TakerBuyQuoteAssetVolume string `json:"takerBuyQuoteAssetVolume"`
}

Define UiKlines response data

type UiKlinesResponseArray

type UiKlinesResponseArray [][]interface{}

type UniversalTransferResp

type UniversalTransferResp struct {
	TranId       int    `json:"tranId"`
	ClientTranId string `json:"clientTranId"`
}

type UniversalTransferService

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

func (*UniversalTransferService) Amount

func (*UniversalTransferService) Asset

func (*UniversalTransferService) ClientTranId

func (s *UniversalTransferService) ClientTranId(clientTranId string) *UniversalTransferService

func (*UniversalTransferService) Do

func (*UniversalTransferService) FromAccountType

func (s *UniversalTransferService) FromAccountType(fromAccountType string) *UniversalTransferService

func (*UniversalTransferService) FromEmail

func (s *UniversalTransferService) FromEmail(fromEmail string) *UniversalTransferService

func (*UniversalTransferService) Symbol

func (*UniversalTransferService) ToAccountType

func (s *UniversalTransferService) ToAccountType(toAccountType string) *UniversalTransferService

func (*UniversalTransferService) ToEmail

type UpdateIPRestrictionForSubAccountAPIKeyResp

type UpdateIPRestrictionForSubAccountAPIKeyResp struct {
	Status string `json:"status"`
	IpList []struct {
		Ip string `json:"ip"`
	} `json:"ipList"`
	UpdateTime uint64 `json:"updateTime"`
	ApiKey     string `json:"apiKey"`
}

type UpdateIPRestrictionForSubAccountAPIKeyService

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

func (*UpdateIPRestrictionForSubAccountAPIKeyService) Do

func (*UpdateIPRestrictionForSubAccountAPIKeyService) Email

func (*UpdateIPRestrictionForSubAccountAPIKeyService) IpAddress

func (*UpdateIPRestrictionForSubAccountAPIKeyService) Status

func (*UpdateIPRestrictionForSubAccountAPIKeyService) SubAccountApiKey

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 UserAssetResponse

type UserAssetResponse 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"`
}

UserAssetResponse define response of UserAssetService

type UserAssetService

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

UserAssetService user asset

func (*UserAssetService) Asset

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

Asset set asset

func (*UserAssetService) Do

func (s *UserAssetService) Do(ctx context.Context) (res *UserAssetResponse, err error)

func (*UserAssetService) NeedBtcValuation

func (s *UserAssetService) NeedBtcValuation(needBtcValuation bool) *UserAssetService

NeedBtcValuation set needBtcValuation

type UserDataEventType

type UserDataEventType string

UserDataEventType define spot user data event type

const (
	UserDataEventTypeOutboundAccountPosition UserDataEventType = "outboundAccountPosition"
	UserDataEventTypeBalanceUpdate           UserDataEventType = "balanceUpdate"
	UserDataEventTypeExecutionReport         UserDataEventType = "executionReport"
	UserDataEventTypeListStatus              UserDataEventType = "ListStatus"
)

type UserUniversalTransferHistoryResponse

type UserUniversalTransferHistoryResponse struct {
	Total int64 `json:"total"`
	Rows  []struct {
		Asset     string `json:"asset"`
		Amount    string `json:"amount"`
		Type      string `json:"type"`
		Status    string `json:"status"`
		TranId    int64  `json:"tranId"`
		Timestamp uint64 `json:"timestamp"`
	} `json:"rows"`
}

UserUniversalTransferHistoryResponse define response of UserUniversalTransferHistoryService

type UserUniversalTransferHistoryService

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

UserUniversalTransferHistoryService user universal transfer history

func (*UserUniversalTransferHistoryService) Current

Current set current

func (*UserUniversalTransferHistoryService) Do

func (*UserUniversalTransferHistoryService) EndTime

EndTime set endTime

func (*UserUniversalTransferHistoryService) FromSymbol

FromSymbol set fromSymbol

func (*UserUniversalTransferHistoryService) Size

Size set size

func (*UserUniversalTransferHistoryService) StartTime

StartTime set startTime

func (*UserUniversalTransferHistoryService) ToSymbol

ToSymbol set toSymbol

func (*UserUniversalTransferHistoryService) TransferType

TransferType set transferType

type UserUniversalTransferResponse

type UserUniversalTransferResponse struct {
	TranId int64 `json:"tranId"`
}

UserUniversalTransferResponse define response of UserUniversalTransferService

type UserUniversalTransferService

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

UserUniversalTransferService user universal transfer

func (*UserUniversalTransferService) Amount

Amount set amount

func (*UserUniversalTransferService) Asset

Asset set asset

func (*UserUniversalTransferService) Do

func (*UserUniversalTransferService) FromSymbol

FromSymbol set fromSymbol

func (*UserUniversalTransferService) ToSymbol

ToSymbol set toSymbol

func (*UserUniversalTransferService) TransferType

func (s *UserUniversalTransferService) TransferType(transferType string) *UserUniversalTransferService

TransferType set transferType

type WebsocketStreamClient

type WebsocketStreamClient struct {
	Endpoint   string
	IsCombined bool
}

func NewWebsocketStreamClient

func NewWebsocketStreamClient(isCombined bool, baseURL ...string) *WebsocketStreamClient

func (*WebsocketStreamClient) WsAggTradeServe

func (c *WebsocketStreamClient) WsAggTradeServe(symbol string, handler WsAggTradeHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsAggTradeServe serve websocket aggregate handler with a symbol

func (*WebsocketStreamClient) WsAllMarketMiniTickersStatServe

func (c *WebsocketStreamClient) WsAllMarketMiniTickersStatServe(handler WsAllMarketMiniTickersStatServeHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsAllMarketTickersStatServe

func (c *WebsocketStreamClient) WsAllMarketTickersStatServe(handler WsAllMarketTickersStatHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsBookTickerServe

func (c *WebsocketStreamClient) WsBookTickerServe(symbol string, handler WsBookTickerHandler, errHandler ErrHandler) (doneCh, stopCh 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 (*WebsocketStreamClient) WsCombinedAggTradeServe

func (c *WebsocketStreamClient) WsCombinedAggTradeServe(symbols []string, handler WsAggTradeHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsCombinedAggTradeServe is similar to WsAggTradeServe, but it handles multiple symbolx

func (*WebsocketStreamClient) WsCombinedBookTickerServe

func (c *WebsocketStreamClient) WsCombinedBookTickerServe(symbols []string, handler WsBookTickerHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsCombinedDepthServe

func (c *WebsocketStreamClient) WsCombinedDepthServe(symbols []string, handler WsDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsCombinedDepthServe is similar to WsDepthServe, but it for multiple symbols

func (*WebsocketStreamClient) WsCombinedDepthServe100Ms

func (c *WebsocketStreamClient) WsCombinedDepthServe100Ms(symbols []string, handler WsDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

func (*WebsocketStreamClient) WsCombinedKlineServe

func (c *WebsocketStreamClient) WsCombinedKlineServe(symbolIntervalPair map[string]string, handler WsKlineHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsCombinedMarketTickersStatServe

func (c *WebsocketStreamClient) WsCombinedMarketTickersStatServe(symbols []string, handler WsMarketTickersStatHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsCombinedMarketTickersStatServe is similar to WsMarketTickersStatServe, but it handles multiple symbols

func (*WebsocketStreamClient) WsCombinedPartialDepthServe

func (c *WebsocketStreamClient) WsCombinedPartialDepthServe(symbolLevels map[string]string, handler WsPartialDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsCombinedPartialDepthServe is similar to WsPartialDepthServe, but it for multiple symbols

func (*WebsocketStreamClient) WsCombinedTradeServe

func (c *WebsocketStreamClient) WsCombinedTradeServe(symbols []string, handler WsCombinedTradeHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

func (*WebsocketStreamClient) WsDepthServe

func (c *WebsocketStreamClient) WsDepthServe(symbol string, handler WsDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsDepthServe100Ms

func (c *WebsocketStreamClient) WsDepthServe100Ms(symbol string, handler WsDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsKlineServe

func (c *WebsocketStreamClient) WsKlineServe(symbol string, interval string, handler WsKlineHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsMarketTickersStatServe

func (c *WebsocketStreamClient) WsMarketTickersStatServe(symbol string, handler WsMarketTickersStatHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsPartialDepthServe

func (c *WebsocketStreamClient) WsPartialDepthServe(symbol string, levels string, handler WsPartialDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsPartialDepthServe100Ms

func (c *WebsocketStreamClient) WsPartialDepthServe100Ms(symbol string, levels string, handler WsPartialDepthHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

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

func (*WebsocketStreamClient) WsTradeServe

func (c *WebsocketStreamClient) WsTradeServe(symbol string, handler WsTradeHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsTradeServe serve websocket handler with a symbol

func (*WebsocketStreamClient) WsUserDataServe

func (c *WebsocketStreamClient) WsUserDataServe(listenKey string, handler WsUserDataHandler, errHandler ErrHandler) (doneCh, stopCh chan struct{}, err error)

WsUserDataServe serve user data handler with listen key

type WithdrawAssetsFromTheManagedSubAccountResp

type WithdrawAssetsFromTheManagedSubAccountResp struct {
	TranId int64 `json:"tranId"`
}

type WithdrawAssetsFromTheManagedSubAccountService

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

func (*WithdrawAssetsFromTheManagedSubAccountService) Amount

func (*WithdrawAssetsFromTheManagedSubAccountService) Asset

func (*WithdrawAssetsFromTheManagedSubAccountService) Do

func (*WithdrawAssetsFromTheManagedSubAccountService) FromEmail

func (*WithdrawAssetsFromTheManagedSubAccountService) TransferDate

type WithdrawHistoryResponse

type WithdrawHistoryResponse struct {
	Id              string `json:"id"`
	Amount          string `json:"amount"`
	TransactionFee  string `json:"transactionFee"`
	Coin            string `json:"coin"`
	Status          int    `json:"status"`
	Address         string `json:"address"`
	TxId            string `json:"txId"`
	ApplyTime       uint64 `json:"applyTime"`
	Network         string `json:"network"`
	TransferType    int    `json:"transferType"`
	WithdrawOrderId string `json:"withdrawOrderId"`
	Info            string `json:"info"`
	ConfirmNo       int    `json:"confirmNo"`
	WalletType      int    `json:"walletType"`
	TxKey           string `json:"txKey"`
}

WithdrawHistoryResponse define response of WithdrawHistoryService

type WithdrawHistoryService

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

WithdrawHistoryService withdraw history

func (*WithdrawHistoryService) Coin

Coin set coin

func (*WithdrawHistoryService) Do

func (*WithdrawHistoryService) EndTime

EndTime set endTime

func (*WithdrawHistoryService) Limit

Limit set limit

func (*WithdrawHistoryService) Offset

Offset set offset

func (*WithdrawHistoryService) StartTime

func (s *WithdrawHistoryService) StartTime(startTime uint64) *WithdrawHistoryService

StartTime set startTime

func (*WithdrawHistoryService) Status

Status set status

func (*WithdrawHistoryService) WithdrawOrderId

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

WithdrawOrderId set withdrawOrderId

type WithdrawResponse

type WithdrawResponse struct {
	Id string `json:"id"`
}

WithdrawResponse define response of WithdrawService

type WithdrawService

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

WithdrawService withdraw

func (*WithdrawService) Address

func (s *WithdrawService) Address(address string) *WithdrawService

Address set address

func (*WithdrawService) AddressTag

func (s *WithdrawService) AddressTag(addressTag string) *WithdrawService

AddressTag set addressTag

func (*WithdrawService) Amount

func (s *WithdrawService) Amount(amount float64) *WithdrawService

Amount set amount

func (*WithdrawService) Coin

func (s *WithdrawService) Coin(coin string) *WithdrawService

Coin set coin

func (*WithdrawService) Do

func (s *WithdrawService) Do(ctx context.Context) (res *WithdrawResponse, err error)

func (*WithdrawService) Name

func (s *WithdrawService) Name(name string) *WithdrawService

Name set name

func (*WithdrawService) Network

func (s *WithdrawService) Network(network string) *WithdrawService

Network set network

func (*WithdrawService) TransactionFeeFlag

func (s *WithdrawService) TransactionFeeFlag(transactionFeeFlag bool) *WithdrawService

TransactionFeeFlag set transactionFeeFlag

func (*WithdrawService) WalletType

func (s *WithdrawService) WalletType(walletType int) *WithdrawService

WalletType set walletType

func (*WithdrawService) WithdrawOrderId

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

WithdrawOrderId set withdrawOrderId

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 {
	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 WsAllMarketMiniTickersStatEvent

type WsAllMarketMiniTickersStatEvent []*WsMarketMiniStatEvent

WsAllMarketMiniTickersStatEvent define array of websocket market mini-ticker statistics events

type WsAllMarketMiniTickersStatServeHandler

type WsAllMarketMiniTickersStatServeHandler func(event WsAllMarketMiniTickersStatEvent)

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

type WsAllMarketTickersStatEvent

type WsAllMarketTickersStatEvent []*WsMarketTickerStatEvent

WsAllMarketTickersStatEvent define array of websocket market statistics events

type WsAllMarketTickersStatHandler

type WsAllMarketTickersStatHandler func(event WsAllMarketTickersStatEvent)

WsAllMarketTickersStatHandler handle websocket that push all markets statistics for 24hr

type WsBalanceUpdate

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

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"`
	FirstUpdateID int64  `json:"U"`
	LastUpdateID  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 WsMarketMiniStatEvent

type WsMarketMiniStatEvent 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"`
}

WsMarketMiniStatEvent define websocket market mini-ticker statistics event

type WsMarketTickerStatEvent

type WsMarketTickerStatEvent 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"`
}

WsMarketTickerStatEvent define websocket market statistics event

type WsMarketTickersStatHandler

type WsMarketTickersStatHandler func(event *WsMarketTickerStatEvent)

WsMarketTickersStatHandler handle websocket that push single market statistics for 24hr

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
	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"`
	TrailingDelta           int64           `json:"d"` // Trailing Delta
	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"`
	IsInOrderBook           bool            `json:"w"` // is the order in the order book?
	IsMaker                 bool            `json:"m"` // is this order maker?
	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"`
	TrailingTime            int64           `json:"D"` // Trailing Time
	StrategyId              int64           `json:"j"` // Strategy ID
	StrategyType            int64           `json:"J"` // Strategy Type
	WorkingTime             int64           `json:"W"` // Working Time
	SelfTradePreventionMode string          `json:"V"`
}

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"`
	TransactionTime   int64             `json:"T"`
	AccountUpdateTime int64             `json:"u"`
	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