Versions in this module Expand all Collapse all v1 v1.0.0 Jun 16, 2026 Changes in this version + const BaseURL + const ServerTimeURL + func GenerateSignature(secretKey, data string) string + func Timestamp() int64 + type APIError struct + Code int + Msg string + func (e *APIError) Error() string + type Client struct + APIKey string + BaseURL string + HTTPClient *http.Client + Logger *zap.SugaredLogger + SecretKey string + ServerTimeBaseURL string + func NewClient() *Client + func (c *Client) Borrow(ctx context.Context, asset string, amount float64, isIsolated bool, ...) (int64, error) + func (c *Client) CancelOrder(ctx context.Context, symbol string, orderID int64, origClientOrderID string, ...) (*MarginOrder, error) + func (c *Client) Delete(ctx context.Context, endpoint string, params map[string]interface{}, ...) error + func (c *Client) Get(ctx context.Context, endpoint string, params map[string]interface{}, ...) error + func (c *Client) GetAccount(ctx context.Context) (*MarginAccount, error) + func (c *Client) GetIsolatedAccount(ctx context.Context, symbols string) (*IsolatedMarginAccount, error) + func (c *Client) GetOrder(ctx context.Context, symbol string, orderID int64, origClientOrderID string, ...) (*MarginOrder, error) + func (c *Client) PlaceOrder(ctx context.Context, params *PlaceOrderParams) (*OrderResponseFull, error) + func (c *Client) Post(ctx context.Context, endpoint string, params map[string]interface{}, ...) error + func (c *Client) Repay(ctx context.Context, asset string, amount float64, isIsolated bool, ...) (int64, error) + func (c *Client) WithBaseURL(url string) *Client + func (c *Client) WithCredentials(apiKey, secretKey string) *Client + func (c *Client) WithServerTimeBaseURL(url string) *Client + type IsolatedMarginAccount struct + Assets []IsolatedMarginSymbol + TotalAssetOfBtc string + TotalLiabilityOfBtc string + TotalNetAssetOfBtc string + type IsolatedMarginAsset struct + Asset string + BorrowEnabled bool + Borrowed string + Free string + Interest string + Locked string + NetAsset string + NetAssetOfBtc string + RepayEnabled bool + TotalAsset string + type IsolatedMarginSymbol struct + BaseAsset IsolatedMarginAsset + Enabled bool + IndexPrice string + IsolatedCreated bool + LiquidatePrice string + LiquidateRate string + MarginLevel string + MarginLevelStatus string + MarginRatio string + QuoteAsset IsolatedMarginAsset + Symbol string + TradeEnabled bool + type MarginAccount struct + BorrowEnabled bool + MarginLevel string + TotalAssetOfBtc string + TotalLiabilityOfBtc string + TotalNetAssetOfBtc string + TradeEnabled bool + TransferEnabled bool + UserAssets []UserAsset + type MarginOrder struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + IsIsolated bool + OrderID int64 + OrigQty string + Price string + Side string + Status string + Symbol string + TimeInForce string + TransactTime int64 + Type string + type OrderResponseFull struct + Fills []struct{ ... } + type PlaceOrderParams struct + IsIsolated bool + NewClientOrderID string + Price float64 + Quantity float64 + QuoteOrderQty float64 + Side string + SideEffectType string + Symbol string + TimeInForce string + Type string + type TransactionResult struct + TranId int64 + type UserAsset struct + Asset string + Borrowed string + Free string + Interest string + Locked string + NetAsset string