portfolio

package
v2.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransferSideToUM   = "TO_UM"
	TransferSideFromUM = "FROM_UM"
)

Constants for transfer side

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

	PositionSideTypeBoth  PositionSideType = "BOTH"
	PositionSideTypeLong  PositionSideType = "LONG"
	PositionSideTypeShort PositionSideType = "SHORT"

	OrderTypeLimit              OrderType = "LIMIT"
	OrderTypeMarket             OrderType = "MARKET"
	OrderTypeStop               OrderType = "STOP"
	OrderTypeStopMarket         OrderType = "STOP_MARKET"
	OrderTypeTakeProfit         OrderType = "TAKE_PROFIT"
	OrderTypeTakeProfitLimit    OrderType = "TAKE_PROFIT_LIMIT"
	OrderTypeTakeProfitMarket   OrderType = "TAKE_PROFIT_MARKET"
	OrderTypeTrailingStopMarket OrderType = "TRAILING_STOP_MARKET"
	OrderTypeLiquidation        OrderType = "LIQUIDATION"

	TimeInForceTypeGTC TimeInForceType = "GTC" // Good Till Cancel
	TimeInForceTypeIOC TimeInForceType = "IOC" // Immediate or Cancel
	TimeInForceTypeFOK TimeInForceType = "FOK" // Fill or Kill
	TimeInForceTypeGTX TimeInForceType = "GTX" // Good Till Crossing (Post Only)
	TimeInForceTypeGTD TimeInForceType = "GTD" // Good Till Date

	NewOrderRespTypeACK    NewOrderRespType = "ACK"
	NewOrderRespTypeRESULT NewOrderRespType = "RESULT"

	OrderExecutionTypeNew         OrderExecutionType = "NEW"
	OrderExecutionTypePartialFill OrderExecutionType = "PARTIAL_FILL"
	OrderExecutionTypeFill        OrderExecutionType = "FILL"
	OrderExecutionTypeCanceled    OrderExecutionType = "CANCELED"
	OrderExecutionTypeCalculated  OrderExecutionType = "CALCULATED"
	OrderExecutionTypeExpired     OrderExecutionType = "EXPIRED"
	OrderExecutionTypeTrade       OrderExecutionType = "TRADE"

	OrderStatusTypeNew             OrderStatusType = "NEW"
	OrderStatusTypePartiallyFilled OrderStatusType = "PARTIALLY_FILLED"
	OrderStatusTypeFilled          OrderStatusType = "FILLED"
	OrderStatusTypeCanceled        OrderStatusType = "CANCELED"
	OrderStatusTypeRejected        OrderStatusType = "REJECTED"
	OrderStatusTypeExpired         OrderStatusType = "EXPIRED"
	OrderStatusTypeNewInsurance    OrderStatusType = "NEW_INSURANCE"
	OrderStatusTypeNewADL          OrderStatusType = "NEW_ADL"

	PriceMatchTypeOpponent   PriceMatchType = "OPPONENT"
	PriceMatchTypeOpponent5  PriceMatchType = "OPPONENT_5"
	PriceMatchTypeOpponent10 PriceMatchType = "OPPONENT_10"
	PriceMatchTypeOpponent20 PriceMatchType = "OPPONENT_20"
	PriceMatchTypeQueue      PriceMatchType = "QUEUE"
	PriceMatchTypeQueue5     PriceMatchType = "QUEUE_5"
	PriceMatchTypeQueue10    PriceMatchType = "QUEUE_10"
	PriceMatchTypeQueue20    PriceMatchType = "QUEUE_20"
	PriceMatchTypeNone       PriceMatchType = "NONE"

	SymbolTypeFuture SymbolType = "FUTURE"

	WorkingTypeMarkPrice     WorkingType = "MARK_PRICE"
	WorkingTypeContractPrice WorkingType = "CONTRACT_PRICE"

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

	SymbolFilterTypeLotSize          SymbolFilterType = "LOT_SIZE"
	SymbolFilterTypePrice            SymbolFilterType = "PRICE_FILTER"
	SymbolFilterTypePercentPrice     SymbolFilterType = "PERCENT_PRICE"
	SymbolFilterTypeMarketLotSize    SymbolFilterType = "MARKET_LOT_SIZE"
	SymbolFilterTypeMaxNumOrders     SymbolFilterType = "MAX_NUM_ORDERS"
	SymbolFilterTypeMaxNumAlgoOrders SymbolFilterType = "MAX_NUM_ALGO_ORDERS"
	SymbolFilterTypeMinNotional      SymbolFilterType = "MIN_NOTIONAL"

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

	MarginTypeIsolated MarginType = "ISOLATED"
	MarginTypeCrossed  MarginType = "CROSSED"

	ContractTypePerpetual      ContractType = "PERPETUAL"
	ContractTypeCurrentQuarter ContractType = "CURRENT_QUARTER"
	ContractTypeNextQuarter    ContractType = "NEXT_QUARTER"

	UserDataEventTypeListenKeyExpired    UserDataEventType = "listenKeyExpired"
	UserDataEventTypeMarginCall          UserDataEventType = "MARGIN_CALL"
	UserDataEventTypeAccountUpdate       UserDataEventType = "ACCOUNT_UPDATE"
	UserDataEventTypeOrderTradeUpdate    UserDataEventType = "ORDER_TRADE_UPDATE"
	UserDataEventTypeAccountConfigUpdate UserDataEventType = "ACCOUNT_CONFIG_UPDATE"
	UserDataEventTypeTradeLite           UserDataEventType = "TRADE_LITE"

	UserDataEventReasonTypeDeposit             UserDataEventReasonType = "DEPOSIT"
	UserDataEventReasonTypeWithdraw            UserDataEventReasonType = "WITHDRAW"
	UserDataEventReasonTypeOrder               UserDataEventReasonType = "ORDER"
	UserDataEventReasonTypeFundingFee          UserDataEventReasonType = "FUNDING_FEE"
	UserDataEventReasonTypeWithdrawReject      UserDataEventReasonType = "WITHDRAW_REJECT"
	UserDataEventReasonTypeAdjustment          UserDataEventReasonType = "ADJUSTMENT"
	UserDataEventReasonTypeInsuranceClear      UserDataEventReasonType = "INSURANCE_CLEAR"
	UserDataEventReasonTypeAdminDeposit        UserDataEventReasonType = "ADMIN_DEPOSIT"
	UserDataEventReasonTypeAdminWithdraw       UserDataEventReasonType = "ADMIN_WITHDRAW"
	UserDataEventReasonTypeMarginTransfer      UserDataEventReasonType = "MARGIN_TRANSFER"
	UserDataEventReasonTypeMarginTypeChange    UserDataEventReasonType = "MARGIN_TYPE_CHANGE"
	UserDataEventReasonTypeAssetTransfer       UserDataEventReasonType = "ASSET_TRANSFER"
	UserDataEventReasonTypeOptionsPremiumFee   UserDataEventReasonType = "OPTIONS_PREMIUM_FEE"
	UserDataEventReasonTypeOptionsSettleProfit UserDataEventReasonType = "OPTIONS_SETTLE_PROFIT"

	ForceOrderCloseTypeLiquidation ForceOrderCloseType = "LIQUIDATION"
	ForceOrderCloseTypeADL         ForceOrderCloseType = "ADL"

	SelfTradePreventionModeNone        SelfTradePreventionMode = "NONE"
	SelfTradePreventionModeExpireTaker SelfTradePreventionMode = "EXPIRE_TAKER"
	SelfTradePreventionModeExpireBoth  SelfTradePreventionMode = "EXPIRE_BOTH"
	SelfTradePreventionModeExpireMaker SelfTradePreventionMode = "EXPIRE_MAKER"

	StrategyTypeStop               StrategyType = "STOP"
	StrategyTypeStopMarket         StrategyType = "STOP_MARKET"
	StrategyTypeTakeProfit         StrategyType = "TAKE_PROFIT"
	StrategyTypeTakeProfitMarket   StrategyType = "TAKE_PROFIT_MARKET"
	StrategyTypeTrailingStopMarket StrategyType = "TRAILING_STOP_MARKET"
)

Global enums

View Source
const (
	CMIncomeTypeTransfer            = "TRANSFER"
	CMIncomeTypeWelcomeBonus        = "WELCOME_BONUS"
	CMIncomeTypeFundingFee          = "FUNDING_FEE"
	CMIncomeTypeRealizedPNL         = "REALIZED_PNL"
	CMIncomeTypeCommission          = "COMMISSION"
	CMIncomeTypeInsuranceClear      = "INSURANCE_CLEAR"
	CMIncomeTypeDeliveredSettlement = "DELIVERED_SETTELMENT"
)

Constants for CM income types

View Source
const (
	ErrUnknown              = -1000 // An unknown error occurred while processing the request
	ErrDisconnected         = -1001 // Internal error; unable to process your request
	ErrUnauthorized         = -1002 // You are not authorized to execute this request
	ErrTooManyRequests      = -1003 // Too many requests
	ErrDuplicateIP          = -1004 // This IP is already on the white list
	ErrNoSuchIP             = -1005 // No such IP has been white listed
	ErrUnexpectedResp       = -1006 // An unexpected response was received from the message bus
	ErrTimeout              = -1007 // Timeout waiting for response from backend server
	ErrErrorMsgReceived     = -1010 // Error message received
	ErrNonWhiteList         = -1011 // This IP cannot access this route
	ErrInvalidMessage       = -1013 // Invalid message
	ErrUnknownOrderCompose  = -1014 // Unsupported order combination
	ErrTooManyOrders        = -1015 // Too many new orders
	ErrServiceShuttingDown  = -1016 // This service is no longer available
	ErrUnsupportedOperation = -1020 // This operation is not supported
	ErrInvalidTimestamp     = -1021 // Timestamp for this request is outside of the recvWindow
	ErrInvalidSignature     = -1022 // Signature for this request is not valid
	ErrStartTimeGreaterEnd  = -1023 // Start time is greater than end time
)

10xx - General Server or Network issues

View Source
const (
	ErrIllegalChars                   = -1100 // Illegal characters found in parameter
	ErrTooManyParameters              = -1101 // Too many parameters sent for this endpoint
	ErrMandatoryParamEmptyOrMalformed = -1102 // Mandatory parameter was not sent, empty/null, or malformed
	ErrUnknownParam                   = -1103 // An unknown parameter was sent
	ErrUnreadParameters               = -1104 // Not all sent parameters were read
	ErrParamEmpty                     = -1105 // Parameter was empty
	ErrParamNotRequired               = -1106 // Parameter was sent when not required
	ErrBadAsset                       = -1108 // Invalid asset
	ErrBadAccount                     = -1109 // Invalid account
	ErrBadInstrumentType              = -1110 // Invalid symbolType
	ErrBadPrecision                   = -1111 // Precision is over the maximum defined
	ErrNoDepth                        = -1112 // No orders on book for symbol
	ErrWithdrawNotNegative            = -1113 // Withdrawal amount must be negative
	ErrTIFNotRequired                 = -1114 // TimeInForce parameter sent when not required
	ErrInvalidTIF                     = -1115 // Invalid timeInForce
	ErrInvalidOrderType               = -1116 // Invalid orderType
	ErrInvalidSide                    = -1117 // Invalid side
	ErrEmptyNewClOrdID                = -1118 // New client order ID was empty
	ErrEmptyOrgClOrdID                = -1119 // Original client order ID was empty
	ErrBadInterval                    = -1120 // Invalid interval
	ErrBadSymbol                      = -1121 // Invalid symbol
	ErrInvalidListenKey               = -1125 // This listenKey does not exist
	ErrMoreThanXXHours                = -1127 // Lookup interval is too big
	ErrOptionalParamsBadCombo         = -1128 // Combination of optional parameters invalid
	ErrInvalidParameter               = -1130 // Invalid data sent for a parameter
	ErrInvalidNewOrderRespType        = -1136 // Invalid newOrderRespType
)

11xx - Request issues

View Source
const (
	ErrNewOrderRejected                = -2010 // NEW_ORDER_REJECTED
	ErrCancelRejected                  = -2011 // CANCEL_REJECTED
	ErrNoSuchOrder                     = -2013 // Order does not exist
	ErrBadAPIKeyFmt                    = -2014 // API-key format invalid
	ErrRejectedMBXKey                  = -2015 // Invalid API-key, IP, or permissions
	ErrNoTradingWindow                 = -2016 // No trading window could be found
	ErrBalanceNotSufficient            = -2018 // Balance is insufficient
	ErrMarginNotSufficient             = -2019 // Margin is insufficient
	ErrUnableToFill                    = -2020 // Unable to fill
	ErrOrderWouldImmediatelyTrigger    = -2021 // Order would immediately trigger
	ErrReduceOnlyReject                = -2022 // ReduceOnly Order is rejected
	ErrUserInLiquidation               = -2023 // User in liquidation mode now
	ErrPositionNotSufficient           = -2024 // Position is not sufficient
	ErrMaxOpenOrderExceeded            = -2025 // Max open order exceeded
	ErrReduceOnlyOrderTypeNotSupported = -2026 // Reduce only order type not supported
	ErrMaxLeverageRatio                = -2027 // Max leverage ratio reached
	ErrMinLeverageRatio                = -2028 // Min leverage ratio reached
)

20xx - Processing Issues

View Source
const (
	ErrInvalidOrderStatus                 = -4000 // Invalid order status
	ErrPriceLessThanZero                  = -4001 // Price less than zero
	ErrPriceGreaterThanMaxPrice           = -4002 // Price greater than max price
	ErrQtyLessThanZero                    = -4003 // Quantity less than zero
	ErrQtyLessThanMinQty                  = -4004 // Quantity less than min quantity
	ErrQtyGreaterThanMaxQty               = -4005 // Quantity greater than max quantity
	ErrStopPriceLessThanZero              = -4006 // Stop price less than zero
	ErrStopPriceGreaterThanMaxPrice       = -4007 // Stop price greater than max price
	ErrTickSizeLessThanZero               = -4008 // Tick size less than zero
	ErrMaxPriceLessThanMinPrice           = -4009 // Max price less than min price
	ErrMaxQtyLessThanMinQty               = -4010 // Max quantity less than min quantity
	ErrStepSizeLessThanZero               = -4011 // Step size less than zero
	ErrMaxNumOrdersLessThanZero           = -4012 // Max number of orders less than zero
	ErrPriceLessThanMinPrice              = -4013 // Price less than min price
	ErrPriceNotIncreasedByTickSize        = -4014 // Price not increased by tick size
	ErrInvalidClOrdIDLen                  = -4015 // Invalid client order ID length
	ErrPriceHigherThanMultiplierUp        = -4016 // Price higher than multiplier up
	ErrMultiplierUpLessThanZero           = -4017 // Multiplier up less than zero
	ErrMultiplierDownLessThanZero         = -4018 // Multiplier down less than zero
	ErrCompositeScaleOverflow             = -4019 // Composite scale overflow
	ErrTargetStrategyInvalid              = -4020 // Target strategy invalid
	ErrInvalidDepthLimit                  = -4021 // Invalid depth limit
	ErrWrongMarketStatus                  = -4022 // Wrong market status
	ErrQtyNotIncreasedByStepSize          = -4023 // Quantity not increased by step size
	ErrPriceLowerThanMultiplierDown       = -4024 // Price lower than multiplier down
	ErrMultiplierDecimalLessThanZero      = -4025 // Multiplier decimal less than zero
	ErrCommissionInvalid                  = -4026 // Commission invalid
	ErrInvalidAccountType                 = -4027 // Invalid account type
	ErrInvalidLeverage                    = -4028 // Invalid leverage
	ErrInvalidTickSizePrecision           = -4029 // Invalid tick size precision
	ErrInvalidStepSizePrecision           = -4030 // Invalid step size precision
	ErrInvalidWorkingType                 = -4031 // Invalid working type
	ErrExceedMaxCancelOrderSize           = -4032 // Exceed max cancel order size
	ErrInsuranceAccountNotFound           = -4033 // Insurance account not found
	ErrInvalidBalanceType                 = -4044 // Invalid balance type
	ErrMaxStopOrderExceeded               = -4045 // Max stop order exceeded
	ErrNoNeedToChangeMarginType           = -4046 // No need to change margin type
	ErrThereExistsOpenOrders              = -4047 // There exists open orders
	ErrThereExistsQuantity                = -4048 // There exists quantity
	ErrAddIsolatedMarginReject            = -4049 // Add isolated margin reject
	ErrCrossBalanceInsufficient           = -4050 // Cross balance insufficient
	ErrIsolatedBalanceInsufficient        = -4051 // Isolated balance insufficient
	ErrNoNeedToChangeAutoAddMargin        = -4052 // No need to change auto add margin
	ErrAutoAddCrossedMarginReject         = -4053 // Auto add crossed margin reject
	ErrAddIsolatedMarginNoPositionReject  = -4054 // Add isolated margin no position reject
	ErrAmountMustBePositive               = -4055 // Amount must be positive
	ErrInvalidAPIKeyType                  = -4056 // Invalid API key type
	ErrInvalidRSAPublicKey                = -4057 // Invalid RSA public key
	ErrMaxPriceTooLarge                   = -4058 // Max price too large
	ErrNoNeedToChangePositionSide         = -4059 // No need to change position side
	ErrInvalidPositionSide                = -4060 // Invalid position side
	ErrPositionSideNotMatch               = -4061 // Position side not match
	ErrReduceOnlyConflict                 = -4062 // Reduce only conflict
	ErrInvalidOptionsRequestType          = -4063 // Invalid options request type
	ErrInvalidOptionsTimeFrame            = -4064 // Invalid options time frame
	ErrInvalidOptionsAmount               = -4065 // Invalid options amount
	ErrInvalidOptionsEventType            = -4066 // Invalid options event type
	ErrPositionSideChangeExistsOpenOrders = -4067 // Position side change exists open orders
	ErrPositionSideChangeExistsQuantity   = -4068 // Position side change exists quantity
	ErrInvalidOptionsPremiumFee           = -4069 // Invalid options premium fee
	ErrInvalidClOptionsIDLen              = -4070 // Invalid cl options ID length
	ErrInvalidOptionsDirection            = -4071 // Invalid options direction
	ErrOptionsPremiumNotUpdate            = -4072 // Options premium not update
	ErrOptionsPremiumInputLessThanZero    = -4073 // Options premium input less than zero
	ErrOptionsAmountBiggerThanUpper       = -4074 // Options amount bigger than upper
	ErrOptionsPremiumOutputZero           = -4075 // Options premium output zero
	ErrOptionsPremiumTooDiff              = -4076 // Options premium too diff
	ErrOptionsPremiumReachLimit           = -4077 // Options premium reach limit
	ErrOptionsCommonError                 = -4078 // Options common error
	ErrInvalidOptionsID                   = -4079 // Invalid options ID
	ErrOptionsUserNotFound                = -4080 // Options user not found
	ErrOptionsNotFound                    = -4081 // Options not found
	ErrInvalidBatchPlaceOrderSize         = -4082 // Invalid batch place order size
	ErrPlaceBatchOrdersFail               = -4083 // Place batch orders fail
	ErrUpcomingMethod                     = -4084 // Upcoming method
	ErrInvalidNotionalLimitCoef           = -4085 // Invalid notional limit coefficient
	ErrInvalidPriceSpreadThreshold        = -4086 // Invalid price spread threshold
	ErrReduceOnlyOrderPermission          = -4087 // Reduce only order permission
	ErrNoPlaceOrderPermission             = -4088 // No place order permission
	ErrInvalidContractType                = -4104 // Invalid contract type
	ErrInvalidClientTranIDLen             = -4114 // Invalid client transaction ID length
	ErrDuplicatedClientTranID             = -4115 // Duplicated client transaction ID
	ErrReduceOnlyMarginCheckFailed        = -4118 // Reduce only margin check failed
	ErrMarketOrderReject                  = -4131 // Market order reject
	ErrInvalidActivationPrice             = -4135 // Invalid activation price
	ErrQuantityExistsWithClosePosition    = -4137 // Quantity exists with close position
	ErrReduceOnlyMustBeTrue               = -4138 // Reduce only must be true
	ErrOrderTypeCannotBeMKT               = -4139 // Order type cannot be MKT
	ErrInvalidOpeningPositionStatus       = -4140 // Invalid opening position status
	ErrSymbolAlreadyClosed                = -4141 // Symbol already closed
	ErrStrategyInvalidTriggerPrice        = -4142 // Strategy invalid trigger price
	ErrInvalidPair                        = -4144 // Invalid pair
	ErrIsolatedLeverageRejectWithPosition = -4161 // Isolated leverage reject with position
	ErrMinNotional                        = -4164 // Min notional
	ErrInvalidTimeInterval                = -4165 // Invalid time interval
	ErrPriceHigherThanStopMultiplierUp    = -4183 // Price higher than stop multiplier up
	ErrPriceLowerThanStopMultiplierDown   = -4184 // Price lower than stop multiplier down
)

40xx - Filters and Other Issues

View Source
const (
	ErrFOKOrderReject      = -5021 // FOK order rejected
	ErrGTXOrderReject      = -5022 // GTX order rejected
	ErrMERecvWindowReject  = -5028 // ME recvWindow rejected
	ErrTooManyRequestQueue = -5041 // Too many requests in queue
)

50xx - Order Execution Issues

View Source
const (
	IncomeTypeTransfer                 = "TRANSFER"
	IncomeTypeWelcomeBonus             = "WELCOME_BONUS"
	IncomeTypeRealizedPNL              = "REALIZED_PNL"
	IncomeTypeFundingFee               = "FUNDING_FEE"
	IncomeTypeCommission               = "COMMISSION"
	IncomeTypeInsuranceClear           = "INSURANCE_CLEAR"
	IncomeTypeReferralKickback         = "REFERRAL_KICKBACK"
	IncomeTypeCommissionRebate         = "COMMISSION_REBATE"
	IncomeTypeAPIRebate                = "API_REBATE"
	IncomeTypeContestReward            = "CONTEST_REWARD"
	IncomeTypeCrossCollateralTransfer  = "CROSS_COLLATERAL_TRANSFER"
	IncomeTypeOptionsPremiumFee        = "OPTIONS_PREMIUM_FEE"
	IncomeTypeOptionsSettleProfit      = "OPTIONS_SETTLE_PROFIT"
	IncomeTypeInternalTransfer         = "INTERNAL_TRANSFER"
	IncomeTypeAutoExchange             = "AUTO_EXCHANGE"
	IncomeTypeDeliveredSettlement      = "DELIVERED_SETTELMENT"
	IncomeTypeCoinSwapDeposit          = "COIN_SWAP_DEPOSIT"
	IncomeTypeCoinSwapWithdraw         = "COIN_SWAP_WITHDRAW"
	IncomeTypePositionLimitIncreaseFee = "POSITION_LIMIT_INCREASE_FEE"
)

Constants for income types

Variables

View Source
var (
	BaseApiMainUrl = "https://papi.binance.com"
)

Endpoints

Functions

func IsPortfolioError

func IsPortfolioError(e error) bool

IsPortfolioError check if e is a Portfolio error

Types

type ADLQuantile

type ADLQuantile struct {
	LONG  int  `json:"LONG"`
	SHORT int  `json:"SHORT"`
	BOTH  *int `json:"BOTH,omitempty"`
	HEDGE *int `json:"HEDGE,omitempty"`
}

ADLQuantile define ADL quantile values

type APIResponse

type APIResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

APIResponse define API response

type Account

type Account struct {
	UniMMR                   string `json:"uniMMR"`        // Portfolio margin account maintenance margin rate
	AccountEquity            string `json:"accountEquity"` // Account equity, in USD value
	ActualEquity             string `json:"actualEquity"`  // Account equity without collateral rate, in USD value
	AccountInitialMargin     string `json:"accountInitialMargin"`
	AccountMaintMargin       string `json:"accountMaintMargin"`       // Portfolio margin account maintenance margin, unit:USD
	AccountStatus            string `json:"accountStatus"`            // Portfolio margin account status
	VirtualMaxWithdrawAmount string `json:"virtualMaxWithdrawAmount"` // Portfolio margin maximum amount for transfer out in USD
	TotalAvailableBalance    string `json:"totalAvailableBalance"`
	TotalMarginOpenLoss      string `json:"totalMarginOpenLoss"` // in USD margin open order
	UpdateTime               int64  `json:"updateTime"`          // last update time
}

Account define account info

type AccountStatus

type AccountStatus string

Add account status constants

const (
	AccountStatusNormal            AccountStatus = "NORMAL"
	AccountStatusMarginCall        AccountStatus = "MARGIN_CALL"
	AccountStatusSupplyMargin      AccountStatus = "SUPPLY_MARGIN"
	AccountStatusReduceOnly        AccountStatus = "REDUCE_ONLY"
	AccountStatusActiveLiquidation AccountStatus = "ACTIVE_LIQUIDATION"
	AccountStatusForceLiquidation  AccountStatus = "FORCE_LIQUIDATION"
	AccountStatusBankrupted        AccountStatus = "BANKRUPTED"
)

type Amendment

type Amendment struct {
	Price   AmendmentDetail `json:"price"`
	OrigQty AmendmentDetail `json:"origQty"`
	Count   int             `json:"count"`
}

Amendment define amendment information

type AmendmentDetail

type AmendmentDetail struct {
	Before string `json:"before"`
	After  string `json:"after"`
}

AmendmentDetail define amendment detail

type AutoRepayFuturesStatus

type AutoRepayFuturesStatus struct {
	AutoRepay bool `json:"autoRepay"` // true for turn on the auto-repay futures; false for turn off
}

AutoRepayFuturesStatus define auto repay futures status

type BNBTransferResponse

type BNBTransferResponse struct {
	TranID int64 `json:"tranId"` // transaction id
}

BNBTransferResponse define bnb transfer response

type BNBTransferService

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

BNBTransferService transfer BNB in and out of UM

func (*BNBTransferService) Amount

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

Amount set amount

func (*BNBTransferService) Do

Do send request

func (*BNBTransferService) TransferSide

func (s *BNBTransferService) TransferSide(transferSide string) *BNBTransferService

TransferSide set transfer side

type Balance

type Balance struct {
	Asset               string `json:"asset"`
	TotalWalletBalance  string `json:"totalWalletBalance"`
	CrossMarginAsset    string `json:"crossMarginAsset"`
	CrossMarginBorrowed string `json:"crossMarginBorrowed"`
	CrossMarginFree     string `json:"crossMarginFree"`
	CrossMarginInterest string `json:"crossMarginInterest"`
	CrossMarginLocked   string `json:"crossMarginLocked"`
	UMWalletBalance     string `json:"umWalletBalance"`
	UMUnrealizedPNL     string `json:"umUnrealizedPNL"`
	CMWalletBalance     string `json:"cmWalletBalance"`
	CMUnrealizedPNL     string `json:"cmUnrealizedPNL"`
	UpdateTime          int64  `json:"updateTime"`
	NegativeBalance     string `json:"negativeBalance"`
}

Balance define user balance of your account

type Bracket

type Bracket struct {
	Bracket          int     `json:"bracket"`          // Notional bracket
	InitialLeverage  int     `json:"initialLeverage"`  // Max initial leverage for this bracket
	NotionalCap      float64 `json:"notionalCap"`      // Cap notional of this bracket
	NotionalFloor    float64 `json:"notionalFloor"`    // Notional threshold of this bracket
	MaintMarginRatio float64 `json:"maintMarginRatio"` // Maintenance ratio for this bracket
	Cum              float64 `json:"cum"`              // Auxiliary number for quick calculation
}

Bracket define bracket info

type CMADLQuantileResponse

type CMADLQuantileResponse struct {
	Symbol      string      `json:"symbol"`
	ADLQuantile ADLQuantile `json:"adlQuantile"`
}

CMADLQuantileResponse define CM ADL quantile response

type CMADLQuantileService

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

CMADLQuantileService service to get CM position ADL quantile estimation

func (*CMADLQuantileService) Do

Do send request

func (*CMADLQuantileService) RecvWindow

func (s *CMADLQuantileService) RecvWindow(recvWindow int64) *CMADLQuantileService

RecvWindow set recvWindow

func (*CMADLQuantileService) Symbol

Symbol set symbol

type CMAccountDetail

type CMAccountDetail struct {
	Assets    []CMAsset    `json:"assets"`
	Positions []CMPosition `json:"positions"`
}

CMAccountDetail define CM account detail

type CMAccountTrade

type CMAccountTrade struct {
	Symbol          string `json:"symbol"`
	ID              int64  `json:"id"`
	OrderID         int64  `json:"orderId"`
	Pair            string `json:"pair"`
	Side            string `json:"side"`
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	RealizedPnl     string `json:"realizedPnl"`
	MarginAsset     string `json:"marginAsset"`
	BaseQty         string `json:"baseQty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	Time            int64  `json:"time"`
	PositionSide    string `json:"positionSide"`
	Buyer           bool   `json:"buyer"`
	Maker           bool   `json:"maker"`
}

CMAccountTrade define CM account trade

type CMAccountTradeService

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

CMAccountTradeService service to get CM account trade list

func (*CMAccountTradeService) Do

Do send request

func (*CMAccountTradeService) EndTime

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

EndTime set endTime

func (*CMAccountTradeService) FromID

FromID set fromId

func (*CMAccountTradeService) Limit

Limit set limit

func (*CMAccountTradeService) Pair

Pair set pair

func (*CMAccountTradeService) RecvWindow

func (s *CMAccountTradeService) RecvWindow(recvWindow int64) *CMAccountTradeService

RecvWindow set recvWindow

func (*CMAccountTradeService) StartTime

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

StartTime set startTime

func (*CMAccountTradeService) Symbol

Symbol set symbol

type CMAccountTradesService

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

CMAccountTradesService service to get CM account trade list

func (*CMAccountTradesService) Do

Do send request

func (*CMAccountTradesService) EndTime

EndTime set endTime

func (*CMAccountTradesService) FromID

FromID set fromID

func (*CMAccountTradesService) Limit

Limit set limit

func (*CMAccountTradesService) Pair

Pair set pair

func (*CMAccountTradesService) RecvWindow

func (s *CMAccountTradesService) RecvWindow(recvWindow int64) *CMAccountTradesService

RecvWindow set recvWindow

func (*CMAccountTradesService) StartTime

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

StartTime set startTime

func (*CMAccountTradesService) Symbol

Symbol set symbol

type CMAllOrdersResponse

type CMAllOrdersResponse struct {
	AvgPrice      string `json:"avgPrice"`
	ClientOrderID string `json:"clientOrderId"`
	CumBase       string `json:"cumBase"`
	ExecutedQty   string `json:"executedQty"`
	OrderID       int64  `json:"orderId"`
	OrigQty       string `json:"origQty"`
	OrigType      string `json:"origType"`
	Price         string `json:"price"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	Status        string `json:"status"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	Time          int64  `json:"time"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	UpdateTime    int64  `json:"updateTime"`
}

CMAllOrdersResponse define all orders response

type CMAllOrdersService

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

CMAllOrdersService service to get all CM orders

func (*CMAllOrdersService) Do

Do send request

func (*CMAllOrdersService) EndTime

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

EndTime set endTime

func (*CMAllOrdersService) Limit

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

Limit set limit

func (*CMAllOrdersService) OrderID

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

OrderID set orderID

func (*CMAllOrdersService) Pair

Pair set pair

func (*CMAllOrdersService) RecvWindow

func (s *CMAllOrdersService) RecvWindow(recvWindow int64) *CMAllOrdersService

RecvWindow set recvWindow

func (*CMAllOrdersService) StartTime

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

StartTime set startTime

func (*CMAllOrdersService) Symbol

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

Symbol set symbol

type CMAsset

type CMAsset struct {
	Asset                  string `json:"asset"`                  // asset name
	CrossWalletBalance     string `json:"crossWalletBalance"`     // total wallet balance
	CrossUnPnl             string `json:"crossUnPnl"`             // unrealized profit or loss
	MaintMargin            string `json:"maintMargin"`            // maintenance margin
	InitialMargin          string `json:"initialMargin"`          // total initial margin required with the latest mark price
	PositionInitialMargin  string `json:"positionInitialMargin"`  // positions' margin required with the latest mark price
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // open orders' initial margin required with the latest mark price
	UpdateTime             int64  `json:"updateTime"`             // last update time
}

CMAsset define CM asset info

type CMBracket

type CMBracket struct {
	Bracket          int     `json:"bracket"`          // bracket level
	InitialLeverage  int     `json:"initialLeverage"`  // the maximum leverage
	QtyCap           float64 `json:"qtyCap"`           // upper edge of base asset quantity
	QtyFloor         float64 `json:"qtyFloor"`         // lower edge of base asset quantity
	MaintMarginRatio float64 `json:"maintMarginRatio"` // maintenance margin rate
	Cum              float64 `json:"cum"`              // Auxiliary number for quick calculation
}

CMBracket define CM bracket info

type CMCancelAllConditionalOrdersResponse

type CMCancelAllConditionalOrdersResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

CMCancelAllConditionalOrdersResponse define cancel all conditional orders response

type CMCancelAllConditionalOrdersService

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

CMCancelAllConditionalOrdersService service to cancel all open CM conditional orders

func (*CMCancelAllConditionalOrdersService) Do

Do send request

func (*CMCancelAllConditionalOrdersService) RecvWindow

RecvWindow set recvWindow

func (*CMCancelAllConditionalOrdersService) Symbol

Symbol set symbol

type CMCancelAllOrdersResponse

type CMCancelAllOrdersResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

CMCancelAllOrdersResponse define cancel all orders response

type CMCancelAllOrdersService

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

CMCancelAllOrdersService service to cancel all open CM orders

func (*CMCancelAllOrdersService) Do

Do send request

func (*CMCancelAllOrdersService) RecvWindow

func (s *CMCancelAllOrdersService) RecvWindow(recvWindow int64) *CMCancelAllOrdersService

RecvWindow set recvWindow

func (*CMCancelAllOrdersService) Symbol

Symbol set symbol

type CMCancelConditionalOrderResponse

type CMCancelConditionalOrderResponse struct {
	NewClientStrategyID string `json:"newClientStrategyId"`
	StrategyID          int64  `json:"strategyId"`
	StrategyStatus      string `json:"strategyStatus"`
	StrategyType        string `json:"strategyType"`
	OrigQty             string `json:"origQty"`
	Price               string `json:"price"`
	ReduceOnly          bool   `json:"reduceOnly"`
	Side                string `json:"side"`
	PositionSide        string `json:"positionSide"`
	StopPrice           string `json:"stopPrice"`
	Symbol              string `json:"symbol"`
	TimeInForce         string `json:"timeInForce"`
	ActivatePrice       string `json:"activatePrice"`
	PriceRate           string `json:"priceRate"`
	BookTime            int64  `json:"bookTime"`
	UpdateTime          int64  `json:"updateTime"`
	WorkingType         string `json:"workingType"`
	PriceProtect        bool   `json:"priceProtect"`
}

CMCancelConditionalOrderResponse define cancel conditional order response

type CMCancelConditionalOrderService

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

CMCancelConditionalOrderService service to cancel CM conditional orders

func (*CMCancelConditionalOrderService) Do

Do send request

func (*CMCancelConditionalOrderService) NewClientStrategyID

func (s *CMCancelConditionalOrderService) NewClientStrategyID(newClientStrategyID string) *CMCancelConditionalOrderService

NewClientStrategyID set newClientStrategyId

func (*CMCancelConditionalOrderService) RecvWindow

RecvWindow set recvWindow

func (*CMCancelConditionalOrderService) StrategyID

StrategyID set strategyId

func (*CMCancelConditionalOrderService) Symbol

Symbol set symbol

type CMCancelOrderResponse

type CMCancelOrderResponse struct {
	AvgPrice      string `json:"avgPrice"`
	ClientOrderID string `json:"clientOrderId"`
	CumQty        string `json:"cumQty"`
	CumBase       string `json:"cumBase"`
	ExecutedQty   string `json:"executedQty"`
	OrderID       int64  `json:"orderId"`
	OrigQty       string `json:"origQty"`
	Price         string `json:"price"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	Status        string `json:"status"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	UpdateTime    int64  `json:"updateTime"`
}

CMCancelOrderResponse define cancel order response

type CMCancelOrderService

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

CMCancelOrderService service to cancel CM orders

func (*CMCancelOrderService) Do

Do send request

func (*CMCancelOrderService) OrderID

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

OrderID set orderID

func (*CMCancelOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*CMCancelOrderService) RecvWindow

func (s *CMCancelOrderService) RecvWindow(recvWindow int64) *CMCancelOrderService

RecvWindow set recvWindow

func (*CMCancelOrderService) Symbol

Symbol set symbol

type CMConditionalOrder

type CMConditionalOrder struct {
	NewClientStrategyId string           `json:"newClientStrategyId"`
	StrategyId          int64            `json:"strategyId"`
	StrategyStatus      string           `json:"strategyStatus"`
	StrategyType        string           `json:"strategyType"`
	OrigQty             string           `json:"origQty"`
	Price               string           `json:"price"`
	ReduceOnly          bool             `json:"reduceOnly"`
	Side                SideType         `json:"side"`
	PositionSide        PositionSideType `json:"positionSide"`
	StopPrice           string           `json:"stopPrice"`
	Symbol              string           `json:"symbol"`
	Pair                string           `json:"pair"`
	TimeInForce         TimeInForceType  `json:"timeInForce"`
	ActivatePrice       string           `json:"activatePrice"`
	PriceRate           string           `json:"priceRate"`
	BookTime            int64            `json:"bookTime"`
	UpdateTime          int64            `json:"updateTime"`
	WorkingType         string           `json:"workingType"`
	PriceProtect        bool             `json:"priceProtect"`
}

CMConditionalOrder define conditional order info

type CMConditionalOrderHistoryResponse

type CMConditionalOrderHistoryResponse struct {
	NewClientStrategyID string `json:"newClientStrategyId"`
	StrategyID          int64  `json:"strategyId"`
	StrategyStatus      string `json:"strategyStatus"`
	StrategyType        string `json:"strategyType"`
	OrigQty             string `json:"origQty"`
	Price               string `json:"price"`
	ReduceOnly          bool   `json:"reduceOnly"`
	Side                string `json:"side"`
	PositionSide        string `json:"positionSide"`
	StopPrice           string `json:"stopPrice"`
	Symbol              string `json:"symbol"`
	OrderID             int64  `json:"orderId"`
	Status              string `json:"status"`
	BookTime            int64  `json:"bookTime"`
	UpdateTime          int64  `json:"updateTime"`
	TriggerTime         int64  `json:"triggerTime"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	ActivatePrice       string `json:"activatePrice"`
	PriceRate           string `json:"priceRate"`
	WorkingType         string `json:"workingType"`
	PriceProtect        bool   `json:"priceProtect"`
	PriceMatch          string `json:"priceMatch"`
}

CMConditionalOrderHistoryResponse define conditional order history response

type CMConditionalOrderHistoryService

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

CMConditionalOrderHistoryService service to get CM conditional order history

func (*CMConditionalOrderHistoryService) Do

Do send request

func (*CMConditionalOrderHistoryService) NewClientStrategyID

func (s *CMConditionalOrderHistoryService) NewClientStrategyID(newClientStrategyID string) *CMConditionalOrderHistoryService

NewClientStrategyID set newClientStrategyId

func (*CMConditionalOrderHistoryService) RecvWindow

RecvWindow set recvWindow

func (*CMConditionalOrderHistoryService) StrategyID

StrategyID set strategyId

func (*CMConditionalOrderHistoryService) Symbol

Symbol set symbol

type CMConditionalOrderResponse

type CMConditionalOrderResponse struct {
	NewClientStrategyID string `json:"newClientStrategyId"`
	StrategyID          int64  `json:"strategyId"`
	StrategyStatus      string `json:"strategyStatus"`
	StrategyType        string `json:"strategyType"`
	OrigQty             string `json:"origQty"`
	Price               string `json:"price"`
	ReduceOnly          bool   `json:"reduceOnly"`
	Side                string `json:"side"`
	PositionSide        string `json:"positionSide"`
	StopPrice           string `json:"stopPrice"`
	Symbol              string `json:"symbol"`
	OrderID             int64  `json:"orderId"`
	Status              string `json:"status"`
	BookTime            int64  `json:"bookTime"`
	UpdateTime          int64  `json:"updateTime"`
	TriggerTime         int64  `json:"triggerTime"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	ActivatePrice       string `json:"activatePrice"`
	PriceRate           string `json:"priceRate"`
}

CMConditionalOrderResponse define conditional order response

type CMConditionalOrderService

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

CMConditionalOrderService service to place CM conditional orders

func (*CMConditionalOrderService) ActivationPrice

func (s *CMConditionalOrderService) ActivationPrice(price string) *CMConditionalOrderService

ActivationPrice set activation price

func (*CMConditionalOrderService) CallbackRate

CallbackRate set callback rate

func (*CMConditionalOrderService) Do

Do send request

func (*CMConditionalOrderService) NewClientStrategyID

func (s *CMConditionalOrderService) NewClientStrategyID(id string) *CMConditionalOrderService

NewClientStrategyID set client strategy ID

func (*CMConditionalOrderService) PositionSide

PositionSide set position side

func (*CMConditionalOrderService) Price

Price set price

func (*CMConditionalOrderService) PriceProtect

func (s *CMConditionalOrderService) PriceProtect(protect bool) *CMConditionalOrderService

PriceProtect set price protect

func (*CMConditionalOrderService) Quantity

Quantity set quantity

func (*CMConditionalOrderService) Side

Side set side

func (*CMConditionalOrderService) StopPrice

StopPrice set stop price

func (*CMConditionalOrderService) StrategyType

func (s *CMConditionalOrderService) StrategyType(strategyType string) *CMConditionalOrderService

StrategyType set strategy type

func (*CMConditionalOrderService) Symbol

Symbol set symbol

func (*CMConditionalOrderService) TimeInForce

TimeInForce set time in force

func (*CMConditionalOrderService) WorkingType

func (s *CMConditionalOrderService) WorkingType(workingType string) *CMConditionalOrderService

WorkingType set working type

type CMConditionalOrdersService

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

CMConditionalOrdersService service to get all CM conditional orders

func (*CMConditionalOrdersService) Do

Do send request

func (*CMConditionalOrdersService) EndTime

EndTime set endTime

func (*CMConditionalOrdersService) Limit

Limit set limit

func (*CMConditionalOrdersService) RecvWindow

func (s *CMConditionalOrdersService) RecvWindow(recvWindow int64) *CMConditionalOrdersService

RecvWindow set recvWindow

func (*CMConditionalOrdersService) StartTime

StartTime set startTime

func (*CMConditionalOrdersService) StrategyID

func (s *CMConditionalOrdersService) StrategyID(strategyID int64) *CMConditionalOrdersService

StrategyID set strategyId

func (*CMConditionalOrdersService) Symbol

Symbol set symbol

type CMForceOrderResponse

type CMForceOrderResponse struct {
	OrderID       int64  `json:"orderId"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	Status        string `json:"status"`
	ClientOrderID string `json:"clientOrderId"`
	Price         string `json:"price"`
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"`
	ExecutedQty   string `json:"executedQty"`
	CumBase       string `json:"cumBase"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	OrigType      string `json:"origType"`
	Time          int64  `json:"time"`
	UpdateTime    int64  `json:"updateTime"`
}

CMForceOrderResponse define force order response

type CMForceOrdersService

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

CMForceOrdersService service to get user's CM force orders

func (*CMForceOrdersService) AutoCloseType

func (s *CMForceOrdersService) AutoCloseType(autoCloseType string) *CMForceOrdersService

AutoCloseType set autoCloseType

func (*CMForceOrdersService) Do

Do send request

func (*CMForceOrdersService) EndTime

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

EndTime set endTime

func (*CMForceOrdersService) Limit

Limit set limit

func (*CMForceOrdersService) RecvWindow

func (s *CMForceOrdersService) RecvWindow(recvWindow int64) *CMForceOrdersService

RecvWindow set recvWindow

func (*CMForceOrdersService) StartTime

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

StartTime set startTime

func (*CMForceOrdersService) Symbol

Symbol set symbol

type CMLeverage

type CMLeverage struct {
	Leverage int    `json:"leverage"`
	MaxQty   string `json:"maxQty"`
	Symbol   string `json:"symbol"`
}

CMLeverage define leverage info

type CMLeverageBracket

type CMLeverageBracket struct {
	Symbol   string      `json:"symbol"`
	Brackets []CMBracket `json:"brackets"`
}

CMLeverageBracket define CM leverage bracket

type CMModifyOrderHistoryResponse

type CMModifyOrderHistoryResponse struct {
	AmendmentID   int64     `json:"amendmentId"`
	Symbol        string    `json:"symbol"`
	Pair          string    `json:"pair"`
	OrderID       int64     `json:"orderId"`
	ClientOrderID string    `json:"clientOrderId"`
	Time          int64     `json:"time"`
	Amendment     Amendment `json:"amendment"`
}

CMModifyOrderHistoryResponse define modify order history response

type CMModifyOrderHistoryService

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

CMModifyOrderHistoryService service to get CM order modification history

func (*CMModifyOrderHistoryService) Do

Do send request

func (*CMModifyOrderHistoryService) EndTime

EndTime set endTime

func (*CMModifyOrderHistoryService) Limit

Limit set limit

func (*CMModifyOrderHistoryService) OrderID

OrderID set orderID

func (*CMModifyOrderHistoryService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderID

func (*CMModifyOrderHistoryService) RecvWindow

RecvWindow set recvWindow

func (*CMModifyOrderHistoryService) StartTime

StartTime set startTime

func (*CMModifyOrderHistoryService) Symbol

Symbol set symbol

type CMModifyOrderResponse

type CMModifyOrderResponse struct {
	OrderID       int64  `json:"orderId"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	Status        string `json:"status"`
	ClientOrderID string `json:"clientOrderId"`
	Price         string `json:"price"`
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"`
	ExecutedQty   string `json:"executedQty"`
	CumQty        string `json:"cumQty"`
	CumBase       string `json:"cumBase"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	OrigType      string `json:"origType"`
	UpdateTime    int64  `json:"updateTime"`
}

CMModifyOrderResponse define modify order response

type CMModifyOrderService

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

CMModifyOrderService service to modify CM orders

func (*CMModifyOrderService) Do

Do send request

func (*CMModifyOrderService) OrderID

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

OrderID set orderID

func (*CMModifyOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*CMModifyOrderService) Price

Price set price

func (*CMModifyOrderService) Quantity

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

Quantity set quantity

func (*CMModifyOrderService) RecvWindow

func (s *CMModifyOrderService) RecvWindow(recvWindow int64) *CMModifyOrderService

RecvWindow set recvWindow

func (*CMModifyOrderService) Side

Side set side

func (*CMModifyOrderService) Symbol

Symbol set symbol

type CMOpenConditionalOrderResponse

type CMOpenConditionalOrderResponse struct {
	NewClientStrategyID string `json:"newClientStrategyId"`
	StrategyID          int64  `json:"strategyId"`
	StrategyStatus      string `json:"strategyStatus"`
	StrategyType        string `json:"strategyType"`
	OrigQty             string `json:"origQty"`
	Price               string `json:"price"`
	ReduceOnly          bool   `json:"reduceOnly"`
	Side                string `json:"side"`
	PositionSide        string `json:"positionSide"`
	StopPrice           string `json:"stopPrice"`
	Symbol              string `json:"symbol"`
	BookTime            int64  `json:"bookTime"`
	UpdateTime          int64  `json:"updateTime"`
	TimeInForce         string `json:"timeInForce"`
	ActivatePrice       string `json:"activatePrice"`
	PriceRate           string `json:"priceRate"`
}

CMOpenConditionalOrderResponse define open conditional order response

type CMOpenConditionalOrderService

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

CMOpenConditionalOrderService service to get current CM open conditional order

func (*CMOpenConditionalOrderService) Do

Do send request

func (*CMOpenConditionalOrderService) NewClientStrategyID

func (s *CMOpenConditionalOrderService) NewClientStrategyID(newClientStrategyID string) *CMOpenConditionalOrderService

NewClientStrategyID set newClientStrategyId

func (*CMOpenConditionalOrderService) RecvWindow

RecvWindow set recvWindow

func (*CMOpenConditionalOrderService) StrategyID

StrategyID set strategyId

func (*CMOpenConditionalOrderService) Symbol

Symbol set symbol

type CMOpenConditionalOrdersService

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

CMOpenConditionalOrdersService service to get all current CM open conditional orders

func (*CMOpenConditionalOrdersService) Do

Do send request

func (*CMOpenConditionalOrdersService) RecvWindow

RecvWindow set recvWindow

func (*CMOpenConditionalOrdersService) Symbol

Symbol set symbol

type CMOpenOrderResponse

type CMOpenOrderResponse struct {
	AvgPrice      string `json:"avgPrice"`
	ClientOrderID string `json:"clientOrderId"`
	CumBase       string `json:"cumBase"`
	ExecutedQty   string `json:"executedQty"`
	OrderID       int64  `json:"orderId"`
	OrigQty       string `json:"origQty"`
	OrigType      string `json:"origType"`
	Price         string `json:"price"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	Status        string `json:"status"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	Time          int64  `json:"time"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	UpdateTime    int64  `json:"updateTime"`
}

CMOpenOrderResponse define open order response

type CMOpenOrderService

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

CMOpenOrderService service to get current CM open order

func (*CMOpenOrderService) Do

Do send request

func (*CMOpenOrderService) OrderID

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

OrderID set orderID

func (*CMOpenOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*CMOpenOrderService) RecvWindow

func (s *CMOpenOrderService) RecvWindow(recvWindow int64) *CMOpenOrderService

RecvWindow set recvWindow

func (*CMOpenOrderService) Symbol

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

Symbol set symbol

type CMOpenOrdersResponse

type CMOpenOrdersResponse struct {
	AvgPrice      string `json:"avgPrice"`
	ClientOrderID string `json:"clientOrderId"`
	CumBase       string `json:"cumBase"`
	ExecutedQty   string `json:"executedQty"`
	OrderID       int64  `json:"orderId"`
	OrigQty       string `json:"origQty"`
	OrigType      string `json:"origType"`
	Price         string `json:"price"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	Status        string `json:"status"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	Time          int64  `json:"time"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	UpdateTime    int64  `json:"updateTime"`
}

CMOpenOrdersResponse define open orders response

type CMOpenOrdersService

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

CMOpenOrdersService service to get all current CM open orders

func (*CMOpenOrdersService) Do

Do send request

func (*CMOpenOrdersService) Pair

Pair set pair

func (*CMOpenOrdersService) RecvWindow

func (s *CMOpenOrdersService) RecvWindow(recvWindow int64) *CMOpenOrdersService

RecvWindow set recvWindow

func (*CMOpenOrdersService) Symbol

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

Symbol set symbol

type CMOrder

type CMOrder struct {
	ClientOrderID string           `json:"clientOrderId"`
	CumQty        string           `json:"cumQty"`
	CumBase       string           `json:"cumBase"`
	ExecutedQty   string           `json:"executedQty"`
	OrderID       int64            `json:"orderId"`
	AvgPrice      string           `json:"avgPrice"`
	OrigQty       string           `json:"origQty"`
	Price         string           `json:"price"`
	ReduceOnly    bool             `json:"reduceOnly"`
	Side          SideType         `json:"side"`
	PositionSide  PositionSideType `json:"positionSide"`
	Status        string           `json:"status"`
	Symbol        string           `json:"symbol"`
	Pair          string           `json:"pair"`
	TimeInForce   TimeInForceType  `json:"timeInForce"`
	Type          OrderType        `json:"type"`
	UpdateTime    int64            `json:"updateTime"`
}

CMOrder define CM order info

type CMOrderService

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

CMOrderService service to place CM orders

func (*CMOrderService) Do

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

Do send request

func (*CMOrderService) NewClientOrderID

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

NewClientOrderID set custom order id

func (*CMOrderService) NewOrderRespType

func (s *CMOrderService) NewOrderRespType(newOrderRespType NewOrderRespType) *CMOrderService

NewOrderRespType set response type

func (*CMOrderService) PositionSide

func (s *CMOrderService) PositionSide(positionSide PositionSideType) *CMOrderService

PositionSide set position side

func (*CMOrderService) Price

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

Price set price

func (*CMOrderService) Quantity

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

Quantity set quantity

func (*CMOrderService) ReduceOnly

func (s *CMOrderService) ReduceOnly(reduceOnly bool) *CMOrderService

ReduceOnly set reduce only

func (*CMOrderService) Side

func (s *CMOrderService) Side(side SideType) *CMOrderService

Side set side

func (*CMOrderService) Symbol

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

Symbol set symbol

func (*CMOrderService) TimeInForce

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

TimeInForce set time in force

func (*CMOrderService) Type

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

Type set order type

type CMPosition

type CMPosition struct {
	Symbol                 string `json:"symbol"`                     // Symbol name
	PositionAmt            string `json:"positionAmt"`                // Position amount
	EntryPrice             string `json:"entryPrice"`                 // Average entry price
	UnrealizedProfit       string `json:"unRealizedProfit"`           // Unrealized profit or loss
	PositionSide           string `json:"positionSide"`               // Position side (BOTH, LONG, SHORT)
	InitialMargin          string `json:"initialMargin"`              // Initial margin required
	MaintMargin            string `json:"maintMargin"`                // Maintenance margin required
	PositionInitialMargin  string `json:"positionInitialMargin"`      // Position initial margin
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"`     // Open orders initial margin
	Leverage               string `json:"leverage"`                   // Current leverage
	MaxQty                 string `json:"maxQty"`                     // Maximum quantity of base asset
	MarkPrice              string `json:"markPrice,omitempty"`        // Mark price
	LiquidationPrice       string `json:"liquidationPrice,omitempty"` // Liquidation price
	NotionalValue          string `json:"notionalValue,omitempty"`    // Notional value
	UpdateTime             int64  `json:"updateTime"`                 // Last update time
}

CMPosition define CM position information

type CMQueryOrderResponse

type CMQueryOrderResponse struct {
	AvgPrice      string `json:"avgPrice"`
	ClientOrderID string `json:"clientOrderId"`
	CumBase       string `json:"cumBase"`
	ExecutedQty   string `json:"executedQty"`
	OrderID       int64  `json:"orderId"`
	OrigQty       string `json:"origQty"`
	OrigType      string `json:"origType"`
	Price         string `json:"price"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	Status        string `json:"status"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	PositionSide  string `json:"positionSide"`
	Time          int64  `json:"time"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	UpdateTime    int64  `json:"updateTime"`
}

CMQueryOrderResponse define query order response

type CMQueryOrderService

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

CMQueryOrderService service to query CM orders

func (*CMQueryOrderService) Do

Do send request

func (*CMQueryOrderService) OrderID

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

OrderID set orderID

func (*CMQueryOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*CMQueryOrderService) RecvWindow

func (s *CMQueryOrderService) RecvWindow(recvWindow int64) *CMQueryOrderService

RecvWindow set recvWindow

func (*CMQueryOrderService) Symbol

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

Symbol set symbol

type ChangeAutoRepayFuturesStatusService

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

ChangeAutoRepayFuturesStatusService change auto-repay-futures status

func (*ChangeAutoRepayFuturesStatusService) AutoRepay

AutoRepay set auto repay status

func (*ChangeAutoRepayFuturesStatusService) Do

Do send request

type ChangeCMInitialLeverageService

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

ChangeCMInitialLeverageService change user's initial leverage of specific symbol in CM

func (*ChangeCMInitialLeverageService) Do

Do send request

func (*ChangeCMInitialLeverageService) Leverage

Leverage set leverage

func (*ChangeCMInitialLeverageService) Symbol

Symbol set symbol

type ChangeCMPositionModeService

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

ChangeCMPositionModeService change user's position mode on EVERY symbol in CM

func (*ChangeCMPositionModeService) Do

Do send request

func (*ChangeCMPositionModeService) DualSidePosition

func (s *ChangeCMPositionModeService) DualSidePosition(dualSidePosition bool) *ChangeCMPositionModeService

DualSidePosition set position mode

type ChangeUMInitialLeverageService

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

ChangeUMInitialLeverageService change user's initial leverage of specific symbol in UM

func (*ChangeUMInitialLeverageService) Do

Do send request

func (*ChangeUMInitialLeverageService) Leverage

Leverage set leverage

func (*ChangeUMInitialLeverageService) Symbol

Symbol set symbol

type ChangeUMPositionModeService

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

ChangeUMPositionModeService change user's position mode on EVERY symbol in UM

func (*ChangeUMPositionModeService) Do

Do send request

func (*ChangeUMPositionModeService) DualSidePosition

func (s *ChangeUMPositionModeService) DualSidePosition(dualSidePosition bool) *ChangeUMPositionModeService

DualSidePosition set position mode

type Client

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

Client define API client

func NewClient

func NewClient(apiKey, secretKey string) *Client

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

func NewProxiedClient

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

NewProxiedClient passing a proxy url

func (*Client) NewBNBTransferService

func (c *Client) NewBNBTransferService() *BNBTransferService

NewBNBTransferService init BNB transfer service

func (*Client) NewCMADLQuantileService

func (c *Client) NewCMADLQuantileService() *CMADLQuantileService

NewCMADLQuantileService creates a new CMADLQuantileService

func (*Client) NewCMAccountTradeService

func (c *Client) NewCMAccountTradeService() *CMAccountTradeService

NewCMAccountTradeService creates a new CMAccountTradeService

func (*Client) NewCMAccountTradesService

func (c *Client) NewCMAccountTradesService() *CMAccountTradesService

NewCMAccountTradesService creates a new CMAccountTradesService

func (*Client) NewCMAllOrdersService

func (c *Client) NewCMAllOrdersService() *CMAllOrdersService

NewCMAllOrdersService creates a new CMAllOrdersService

func (*Client) NewCMCancelAllConditionalOrdersService

func (c *Client) NewCMCancelAllConditionalOrdersService() *CMCancelAllConditionalOrdersService

NewCMCancelAllConditionalOrdersService creates a new CMCancelAllConditionalOrdersService

func (*Client) NewCMCancelAllOrdersService

func (c *Client) NewCMCancelAllOrdersService() *CMCancelAllOrdersService

NewCMCancelAllOrdersService creates a new CMCancelAllOrdersService

func (*Client) NewCMCancelConditionalOrderService

func (c *Client) NewCMCancelConditionalOrderService() *CMCancelConditionalOrderService

NewCMCancelConditionalOrderService creates a new CMCancelConditionalOrderService

func (*Client) NewCMCancelOrderService

func (c *Client) NewCMCancelOrderService() *CMCancelOrderService

NewCMCancelOrderService creates a new CMCancelOrderService

func (*Client) NewCMConditionalOrder

func (c *Client) NewCMConditionalOrder() *CMConditionalOrderService

NewCMConditionalOrder creates a new CMConditionalOrder

func (*Client) NewCMConditionalOrderHistoryService

func (c *Client) NewCMConditionalOrderHistoryService() *CMConditionalOrderHistoryService

NewCMConditionalOrderHistoryService creates a new CMConditionalOrderHistoryService

func (*Client) NewCMConditionalOrderService

func (c *Client) NewCMConditionalOrderService() *CMConditionalOrderService

NewCMConditionalOrderService creates a new CMConditionalOrderService

func (*Client) NewCMConditionalOrdersService

func (c *Client) NewCMConditionalOrdersService() *CMConditionalOrdersService

NewCMConditionalOrdersService creates a new CMConditionalOrdersService

func (*Client) NewCMForceOrdersService

func (c *Client) NewCMForceOrdersService() *CMForceOrdersService

NewCMForceOrdersService creates a new CMForceOrdersService

func (*Client) NewCMModifyOrderHistoryService

func (c *Client) NewCMModifyOrderHistoryService() *CMModifyOrderHistoryService

NewCMModifyOrderHistoryService creates a new CMModifyOrderHistoryService

func (*Client) NewCMModifyOrderService

func (c *Client) NewCMModifyOrderService() *CMModifyOrderService

NewCMModifyOrderService creates a new CMModifyOrderService

func (*Client) NewCMOpenConditionalOrderService

func (c *Client) NewCMOpenConditionalOrderService() *CMOpenConditionalOrderService

NewCMOpenConditionalOrderService creates a new CMOpenConditionalOrderService

func (*Client) NewCMOpenConditionalOrdersService

func (c *Client) NewCMOpenConditionalOrdersService() *CMOpenConditionalOrdersService

NewCMOpenConditionalOrdersService creates a new CMOpenConditionalOrdersService

func (*Client) NewCMOpenOrderService

func (c *Client) NewCMOpenOrderService() *CMOpenOrderService

NewCMOpenOrderService creates a new CMOpenOrderService

func (*Client) NewCMOpenOrdersService

func (c *Client) NewCMOpenOrdersService() *CMOpenOrdersService

NewCMOpenOrdersService creates a new CMOpenOrdersService

func (*Client) NewCMOrderService

func (c *Client) NewCMOrderService() *CMOrderService

NewCMOrderService creates a new CMOrderService

func (*Client) NewCMQueryOrderService

func (c *Client) NewCMQueryOrderService() *CMQueryOrderService

NewCMQueryOrderService creates a new CMQueryOrderService

func (*Client) NewChangeAutoRepayFuturesStatusService

func (c *Client) NewChangeAutoRepayFuturesStatusService() *ChangeAutoRepayFuturesStatusService

NewChangeAutoRepayFuturesStatusService init change auto repay futures status service

func (*Client) NewChangeCMInitialLeverageService

func (c *Client) NewChangeCMInitialLeverageService() *ChangeCMInitialLeverageService

NewChangeCMInitialLeverageService init change CM initial leverage service

func (*Client) NewChangeCMPositionModeService

func (c *Client) NewChangeCMPositionModeService() *ChangeCMPositionModeService

NewChangeCMPositionModeService init change CM position mode service

func (*Client) NewChangeUMInitialLeverageService

func (c *Client) NewChangeUMInitialLeverageService() *ChangeUMInitialLeverageService

NewChangeUMInitialLeverageService init change UM initial leverage service

func (*Client) NewChangeUMPositionModeService

func (c *Client) NewChangeUMPositionModeService() *ChangeUMPositionModeService

NewChangeUMPositionModeService init change UM position mode service

func (*Client) NewFundAutoCollectionService

func (c *Client) NewFundAutoCollectionService() *FundAutoCollectionService

NewFundAutoCollectionService init fund auto-collection service

func (*Client) NewFundCollectionByAssetService

func (c *Client) NewFundCollectionByAssetService() *FundCollectionByAssetService

NewFundCollectionByAssetService init fund collection by asset service

func (*Client) NewGetAccountService

func (c *Client) NewGetAccountService() *GetAccountService

NewGetAccountService init get account service

func (*Client) NewGetAutoRepayFuturesStatusService

func (c *Client) NewGetAutoRepayFuturesStatusService() *GetAutoRepayFuturesStatusService

NewGetAutoRepayFuturesStatusService init get auto repay futures status service

func (*Client) NewGetBalanceService

func (c *Client) NewGetBalanceService() *GetBalanceService

NewServerTimeService init server time service

func (*Client) NewGetCMAccountDetailService

func (c *Client) NewGetCMAccountDetailService() *GetCMAccountDetailService

NewGetCMAccountDetailService init get CM account detail service

func (*Client) NewGetCMCommissionRateService

func (c *Client) NewGetCMCommissionRateService() *GetCMCommissionRateService

NewGetCMCommissionRateService init get CM commission rate service

func (*Client) NewGetCMIncomeHistoryService

func (c *Client) NewGetCMIncomeHistoryService() *GetCMIncomeHistoryService

NewGetCMIncomeHistoryService init get CM income history service

func (*Client) NewGetCMLeverageBracketService

func (c *Client) NewGetCMLeverageBracketService() *GetCMLeverageBracketService

NewGetCMLeverageBracketService init get CM leverage bracket service

func (*Client) NewGetCMPositionModeService

func (c *Client) NewGetCMPositionModeService() *GetCMPositionModeService

NewGetCMPositionModeService init get CM position mode service

func (*Client) NewGetCMPositionRiskService

func (c *Client) NewGetCMPositionRiskService() *GetCMPositionRiskService

NewGetCMPositionRiskService init CM position risk service

func (*Client) NewGetMarginAllOrdersService

func (c *Client) NewGetMarginAllOrdersService() *GetMarginAllOrdersService

NewGetMarginAllOrdersService creates a new GetMarginAllOrdersService

func (*Client) NewGetMarginForceOrdersService

func (c *Client) NewGetMarginForceOrdersService() *GetMarginForceOrdersService

NewGetMarginForceOrdersService creates a new GetMarginForceOrdersService

func (*Client) NewGetMarginInterestHistoryService

func (c *Client) NewGetMarginInterestHistoryService() *GetMarginInterestHistoryService

NewGetMarginInterestHistoryService init get margin interest history service

func (*Client) NewGetMarginLoanService

func (c *Client) NewGetMarginLoanService() *GetMarginLoanService

NewGetMarginLoanService init get margin loan service

func (*Client) NewGetMarginMaxBorrowService

func (c *Client) NewGetMarginMaxBorrowService() *GetMarginMaxBorrowService

NewGetMarginMaxBorrowService init margin max borrow service

func (*Client) NewGetMarginMaxWithdrawService

func (c *Client) NewGetMarginMaxWithdrawService() *GetMarginMaxWithdrawService

NewGetMarginMaxWithdrawService init margin max withdraw service

func (*Client) NewGetMarginOpenOrdersService

func (c *Client) NewGetMarginOpenOrdersService() *GetMarginOpenOrdersService

NewGetMarginOpenOrdersService creates a new GetMarginOpenOrdersService

func (*Client) NewGetMarginRepayService

func (c *Client) NewGetMarginRepayService() *GetMarginRepayService

NewGetMarginRepayService init get margin repay service

func (*Client) NewGetNegativeBalanceExchangeRecordService

func (c *Client) NewGetNegativeBalanceExchangeRecordService() *GetNegativeBalanceExchangeRecordService

NewGetNegativeBalanceExchangeRecordService init getting negative balance exchange record service

func (*Client) NewGetNegativeBalanceInterestHistoryService

func (c *Client) NewGetNegativeBalanceInterestHistoryService() *GetNegativeBalanceInterestHistoryService

NewGetNegativeBalanceInterestHistoryService init get negative balance interest history service

func (*Client) NewGetRateLimitService

func (c *Client) NewGetRateLimitService() *GetRateLimitService

NewGetRateLimitService init getting rate limit service

func (*Client) NewGetUMAccountConfigService

func (c *Client) NewGetUMAccountConfigService() *UMAccountConfigService

NewGetUMAccountConfigService init get UM futures account configuration service

func (*Client) NewGetUMAccountDetailService

func (c *Client) NewGetUMAccountDetailService() *GetUMAccountDetailService

NewGetUMAccountDetailService init get UM account detail service

func (*Client) NewGetUMAccountDetailV2Service

func (c *Client) NewGetUMAccountDetailV2Service() *UMAccountDetailV2Service

NewGetUMAccountDetailV2Service init get UM account detail v2 service

func (*Client) NewGetUMCommissionRateService

func (c *Client) NewGetUMCommissionRateService() *GetUMCommissionRateService

NewGetUMCommissionRateService init get UM commission rate service

func (*Client) NewGetUMIncomeHistoryService

func (c *Client) NewGetUMIncomeHistoryService() *GetUMIncomeHistoryService

NewGetUMIncomeHistoryService init get UM income history service

func (*Client) NewGetUMLeverageBracketService

func (c *Client) NewGetUMLeverageBracketService() *GetUMLeverageBracketService

NewGetUMLeverageBracketService init get UM leverage bracket service

func (*Client) NewGetUMOrderDownloadLinkService

func (c *Client) NewGetUMOrderDownloadLinkService() *GetUMOrderDownloadLinkService

NewGetUMOrderDownloadLinkService init getting um order download link service

func (*Client) NewGetUMOrderHistoryDownloadIDService

func (c *Client) NewGetUMOrderHistoryDownloadIDService() *GetUMOrderHistoryDownloadIDService

NewGetUMOrderHistoryDownloadIDService init getting um order history download id service

func (*Client) NewGetUMPositionModeService

func (c *Client) NewGetUMPositionModeService() *GetUMPositionModeService

NewGetUMPositionModeService init get UM position mode service

func (*Client) NewGetUMPositionRiskService

func (c *Client) NewGetUMPositionRiskService() *GetUMPositionRiskService

NewGetUMPositionRiskService init UM position risk service

func (*Client) NewGetUMSymbolConfigService

func (c *Client) NewGetUMSymbolConfigService() *UMSymbolConfigService

NewGetUMSymbolConfigService init get UM futures symbol configuration service

func (*Client) NewGetUMTradeDownloadLinkService

func (c *Client) NewGetUMTradeDownloadLinkService() *GetUMTradeDownloadLinkService

NewGetUMTradeDownloadLinkService init getting um trade download link service

func (*Client) NewGetUMTradeHistoryDownloadIDService

func (c *Client) NewGetUMTradeHistoryDownloadIDService() *GetUMTradeHistoryDownloadIDService

NewGetUMTradeHistoryDownloadIDService init getting um trade history download id service

func (*Client) NewGetUMTradingStatusService

func (c *Client) NewGetUMTradingStatusService() *GetUMTradingStatusService

NewGetUMTradingStatusService init get UM trading status service

func (*Client) NewGetUMTransactionDownloadLinkService

func (c *Client) NewGetUMTransactionDownloadLinkService() *GetUMTransactionDownloadLinkService

NewGetUMTransactionDownloadLinkService init getting um transaction download link service

func (*Client) NewGetUMTransactionHistoryDownloadIDService

func (c *Client) NewGetUMTransactionHistoryDownloadIDService() *GetUMTransactionHistoryDownloadIDService

NewGetUMTransactionHistoryDownloadIDService init getting um transaction history download id service

func (*Client) NewMarginAccountTradesService

func (c *Client) NewMarginAccountTradesService() *MarginAccountTradesService

NewMarginAccountTradesService creates a new MarginAccountTradesService

func (*Client) NewMarginAllOCOService

func (c *Client) NewMarginAllOCOService() *MarginAllOCOService

NewMarginAllOCOService creates a new MarginAllOCOService

func (*Client) NewMarginCancelAllOrdersService

func (c *Client) NewMarginCancelAllOrdersService() *MarginCancelAllOrdersService

NewMarginCancelAllOrdersService creates a new MarginCancelAllOrdersService

func (*Client) NewMarginCancelOCOService

func (c *Client) NewMarginCancelOCOService() *MarginCancelOCOService

NewMarginCancelOCOService creates a new MarginCancelOCOService

func (*Client) NewMarginCancelOrderService

func (c *Client) NewMarginCancelOrderService() *MarginCancelOrderService

NewMarginCancelOrderService creates a new MarginCancelOrderService

func (*Client) NewMarginForceOrdersService

func (c *Client) NewMarginForceOrdersService() *MarginForceOrdersService

NewMarginForceOrdersService creates a new MarginForceOrdersService

func (*Client) NewMarginLoanService

func (c *Client) NewMarginLoanService() *MarginLoanService

NewMarginLoanService creates a new MarginLoanService

func (*Client) NewMarginOCOQueryService

func (c *Client) NewMarginOCOQueryService() *MarginOCOQueryService

NewMarginOCOQueryService creates a new MarginOCOQueryService

func (*Client) NewMarginOCOService

func (c *Client) NewMarginOCOService() *MarginOCOService

NewMarginOCOService creates a new MarginOCOService

func (*Client) NewMarginOpenOCOService

func (c *Client) NewMarginOpenOCOService() *MarginOpenOCOService

NewMarginOpenOCOService creates a new MarginOpenOCOService

func (*Client) NewMarginOrderService

func (c *Client) NewMarginOrderService() *MarginOrderService

NewMarginOrderService creates a new MarginOrderService

func (*Client) NewMarginRepayDebtService

func (c *Client) NewMarginRepayDebtService() *MarginRepayDebtService

NewMarginRepayDebtService creates a new MarginRepayDebtService

func (*Client) NewMarginRepayService

func (c *Client) NewMarginRepayService() *MarginRepayService

NewMarginRepayService creates a new MarginRepayService

func (*Client) NewPingService

func (c *Client) NewPingService() *PingService

NewPingService init ping service

func (*Client) NewRepayFuturesNegativeBalanceService

func (c *Client) NewRepayFuturesNegativeBalanceService() *RepayFuturesNegativeBalanceService

NewRepayFuturesNegativeBalanceService init repay futures negative balance service

func (*Client) NewUMADLQuantileService

func (c *Client) NewUMADLQuantileService() *UMADLQuantileService

NewUMADLQuantileService creates a new UMADLQuantileService

func (*Client) NewUMAccountTradeService

func (c *Client) NewUMAccountTradeService() *UMAccountTradeService

NewUMAccountTradeService creates a new UMAccountTradeService

func (*Client) NewUMAccountTradesService

func (c *Client) NewUMAccountTradesService() *UMAccountTradesService

NewUMAccountTradesService creates a new UMAccountTradesService

func (*Client) NewUMAllConditionalOrdersService

func (c *Client) NewUMAllConditionalOrdersService() *UMAllConditionalOrdersService

NewUMAllConditionalOrdersService creates a new UMAllConditionalOrdersService

func (*Client) NewUMAllOrdersService

func (c *Client) NewUMAllOrdersService() *UMAllOrdersService

NewUMAllOrdersService creates a new UMAllOrdersService

func (*Client) NewUMCancelAllConditionalOrdersService

func (c *Client) NewUMCancelAllConditionalOrdersService() *UMCancelAllConditionalOrdersService

NewUMCancelAllConditionalOrdersService creates a new UMCancelAllConditionalOrdersService

func (*Client) NewUMCancelAllOrdersService

func (c *Client) NewUMCancelAllOrdersService() *UMCancelAllOrdersService

NewUMCancelAllOrdersService creates a new UMCancelAllOrdersService

func (*Client) NewUMCancelConditionalOrderService

func (c *Client) NewUMCancelConditionalOrderService() *UMCancelConditionalOrderService

NewUMCancelConditionalOrderService creates a new UMCancelConditionalOrderService

func (*Client) NewUMCancelOrderService

func (c *Client) NewUMCancelOrderService() *UMCancelOrderService

NewUMCancelOrderService creates a new UMCancelOrderService

func (*Client) NewUMConditionalOrderHistoryService

func (c *Client) NewUMConditionalOrderHistoryService() *UMConditionalOrderHistoryService

NewUMConditionalOrderHistoryService creates a new UMConditionalOrderHistoryService

func (*Client) NewUMConditionalOrderService

func (c *Client) NewUMConditionalOrderService() *UMConditionalOrderService

NewUMConditionalOrderService init UM conditional order service

func (*Client) NewUMFeeBurnService

func (c *Client) NewUMFeeBurnService() *UMFeeBurnService

NewUMFeeBurnService creates a new UMFeeBurnService

func (*Client) NewUMFeeBurnStatusService

func (c *Client) NewUMFeeBurnStatusService() *UMFeeBurnStatusService

NewUMFeeBurnStatusService creates a new UMFeeBurnStatusService

func (*Client) NewUMForceOrdersService

func (c *Client) NewUMForceOrdersService() *UMForceOrdersService

NewUMForceOrdersService creates a new UMForceOrdersService

func (*Client) NewUMGetADLQuantileService

func (c *Client) NewUMGetADLQuantileService() *UMGetADLQuantileService

NewUMGetADLQuantileService creates a new UMGetADLQuantileService

func (*Client) NewUMModifyOrderHistoryService

func (c *Client) NewUMModifyOrderHistoryService() *UMModifyOrderHistoryService

NewUMModifyOrderHistoryService creates a new UMModifyOrderHistoryService

func (*Client) NewUMModifyOrderService

func (c *Client) NewUMModifyOrderService() *UMModifyOrderService

NewUMModifyOrderService creates a new UMModifyOrderService

func (*Client) NewUMOpenConditionalOrderService

func (c *Client) NewUMOpenConditionalOrderService() *UMOpenConditionalOrderService

NewUMOpenConditionalOrderService creates a new UMOpenConditionalOrderService

func (*Client) NewUMOpenConditionalOrdersService

func (c *Client) NewUMOpenConditionalOrdersService() *UMOpenConditionalOrdersService

NewUMOpenConditionalOrdersService creates a new UMOpenConditionalOrdersService

func (*Client) NewUMOpenOrderService

func (c *Client) NewUMOpenOrderService() *UMOpenOrderService

NewUMOpenOrderService creates a new UMOpenOrderService

func (*Client) NewUMOpenOrdersService

func (c *Client) NewUMOpenOrdersService() *UMOpenOrdersService

NewUMOpenOrdersService creates a new UMOpenOrdersService

func (*Client) NewUMOrderService

func (c *Client) NewUMOrderService() *UMOrderService

NewUMOrderService init UM order service

func (*Client) NewUMQueryOrderService

func (c *Client) NewUMQueryOrderService() *UMQueryOrderService

NewUMQueryOrderService creates a new UMQueryOrderService

func (*Client) SetApiEndpoint

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

SetApiEndpoint set api Endpoint

type CommissionRate

type CommissionRate struct {
	Symbol              string `json:"symbol"`
	MakerCommissionRate string `json:"makerCommissionRate"` // 0.02%
	TakerCommissionRate string `json:"takerCommissionRate"` // 0.04%
}

CommissionRate define commission rate info

type ContractType

type ContractType string

ContractType define contract type

type Error

type Error struct {
	common.APIError
}

Error represents a portfolio error extending the common APIError

func NewError

func NewError(code int64, message string) *Error

NewError creates a new portfolio Error

func NewErrorFromResponse

func NewErrorFromResponse(code int64, message string, response []byte) *Error

NewErrorFromResponse creates a new portfolio Error from raw response

func (Error) Error

func (e Error) Error() string

Error returns the error message

type Fill

type Fill struct {
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
}

Fill define fill info

type ForceOrderCloseType

type ForceOrderCloseType string

ForceOrderCloseType define reason type for force order

type FundAutoCollectionService

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

FundAutoCollectionService fund auto-collection for Portfolio Margin

func (*FundAutoCollectionService) Do

Do send request

type FundCollectionByAssetService

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

FundCollectionByAssetService transfers specific asset from Futures Account to Margin account

func (*FundCollectionByAssetService) Asset

Asset set asset

func (*FundCollectionByAssetService) Do

Do send request

type GetAccountService

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

GetAccountService get account information

func (*GetAccountService) Do

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

Do send request

type GetAutoRepayFuturesStatusService

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

GetAutoRepayFuturesStatusService get auto-repay-futures status

func (*GetAutoRepayFuturesStatusService) Do

Do send request

type GetBalanceService

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

GetBalanceService get account balance

func (*GetBalanceService) Asset

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

Asset set asset

func (*GetBalanceService) Do

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

Do send request

type GetCMAccountDetailService

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

GetCMAccountDetailService get current CM account asset and position information

func (*GetCMAccountDetailService) Do

Do send request

type GetCMCommissionRateService

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

GetCMCommissionRateService get user commission rate for CM

func (*GetCMCommissionRateService) Do

Do send request

func (*GetCMCommissionRateService) Symbol

Symbol set symbol

type GetCMIncomeHistoryService

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

GetCMIncomeHistoryService get CM income history

func (*GetCMIncomeHistoryService) Do

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

Do send request

func (*GetCMIncomeHistoryService) EndTime

EndTime set endTime

func (*GetCMIncomeHistoryService) IncomeType

func (s *GetCMIncomeHistoryService) IncomeType(incomeType string) *GetCMIncomeHistoryService

IncomeType set income type

func (*GetCMIncomeHistoryService) Limit

Limit set limit

func (*GetCMIncomeHistoryService) Page

Page set page

func (*GetCMIncomeHistoryService) StartTime

StartTime set startTime

func (*GetCMIncomeHistoryService) Symbol

Symbol set symbol

type GetCMLeverageBracketService

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

GetCMLeverageBracketService get CM notional and leverage brackets

func (*GetCMLeverageBracketService) Do

Do send request

func (*GetCMLeverageBracketService) Symbol

Symbol set symbol

type GetCMPositionModeService

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

GetCMPositionModeService get user's position mode on EVERY symbol in CM

func (*GetCMPositionModeService) Do

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

Do send request

type GetCMPositionRiskService

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

GetCMPositionRiskService get CM position risk information

func (*GetCMPositionRiskService) Do

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

Do send request

func (*GetCMPositionRiskService) MarginAsset

func (s *GetCMPositionRiskService) MarginAsset(marginAsset string) *GetCMPositionRiskService

MarginAsset set margin asset

func (*GetCMPositionRiskService) Pair

Pair set trading pair

type GetMarginAllOrdersService

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

GetMarginAllOrdersService service to get all margin account orders

func (*GetMarginAllOrdersService) Do

Do send request

func (*GetMarginAllOrdersService) EndTime

EndTime set endTime

func (*GetMarginAllOrdersService) Limit

Limit set limit

func (*GetMarginAllOrdersService) OrderID

OrderID set orderID

func (*GetMarginAllOrdersService) RecvWindow

func (s *GetMarginAllOrdersService) RecvWindow(recvWindow int64) *GetMarginAllOrdersService

RecvWindow set recvWindow

func (*GetMarginAllOrdersService) StartTime

StartTime set startTime

func (*GetMarginAllOrdersService) Symbol

Symbol set symbol

type GetMarginForceOrdersService

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

GetMarginForceOrdersService service to get user's margin force orders

func (*GetMarginForceOrdersService) Current

Current set current page

func (*GetMarginForceOrdersService) Do

Do send request

func (*GetMarginForceOrdersService) EndTime

EndTime set endTime

func (*GetMarginForceOrdersService) RecvWindow

RecvWindow set recvWindow

func (*GetMarginForceOrdersService) Size

Size set page size

func (*GetMarginForceOrdersService) StartTime

StartTime set startTime

type GetMarginInterestHistoryService

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

GetMarginInterestHistoryService get margin borrow/loan interest history

func (*GetMarginInterestHistoryService) Archived

Archived set archived

func (*GetMarginInterestHistoryService) Asset

Asset set asset

func (*GetMarginInterestHistoryService) Current

Current set current page

func (*GetMarginInterestHistoryService) Do

Do send request

func (*GetMarginInterestHistoryService) EndTime

EndTime set endTime

func (*GetMarginInterestHistoryService) Size

Size set page size

func (*GetMarginInterestHistoryService) StartTime

StartTime set startTime

type GetMarginLoanResponse

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

GetMarginLoanResponse define margin loan response

type GetMarginLoanService

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

GetMarginLoanService query margin loan record

func (*GetMarginLoanService) Archived

func (s *GetMarginLoanService) Archived(archived bool) *GetMarginLoanService

Archived set archived

func (*GetMarginLoanService) Asset

Asset set asset

func (*GetMarginLoanService) Current

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

Current set current page

func (*GetMarginLoanService) Do

Do send request

func (*GetMarginLoanService) EndTime

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

EndTime set endTime

func (*GetMarginLoanService) Size

Size set page size

func (*GetMarginLoanService) StartTime

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

StartTime set startTime

func (*GetMarginLoanService) TxID

TxID set transaction id

type GetMarginMaxBorrowService

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

GetMarginMaxBorrowService get margin max borrowable amount

func (*GetMarginMaxBorrowService) Asset

Asset set asset

func (*GetMarginMaxBorrowService) Do

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

Do send request

type GetMarginMaxWithdrawService

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

GetMarginMaxWithdrawService get margin max withdrawable amount

func (*GetMarginMaxWithdrawService) Asset

Asset set asset

func (*GetMarginMaxWithdrawService) Do

Do send request

type GetMarginOpenOrdersService

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

GetMarginOpenOrdersService service to get current margin open orders

func (*GetMarginOpenOrdersService) Do

Do send request

func (*GetMarginOpenOrdersService) RecvWindow

func (s *GetMarginOpenOrdersService) RecvWindow(recvWindow int64) *GetMarginOpenOrdersService

RecvWindow set recvWindow

func (*GetMarginOpenOrdersService) Symbol

Symbol set symbol

type GetMarginRepayResponse

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

GetMarginRepayResponse define margin repay response

type GetMarginRepayService

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

GetMarginRepayService query margin repay record

func (*GetMarginRepayService) Archived

func (s *GetMarginRepayService) Archived(archived bool) *GetMarginRepayService

Archived set archived

func (*GetMarginRepayService) Asset

Asset set asset

func (*GetMarginRepayService) Current

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

Current set current page

func (*GetMarginRepayService) Do

Do send request

func (*GetMarginRepayService) EndTime

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

EndTime set endTime

func (*GetMarginRepayService) Size

Size set page size

func (*GetMarginRepayService) StartTime

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

StartTime set startTime

func (*GetMarginRepayService) TxID

TxID set transaction id

type GetNegativeBalanceExchangeRecordService

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

GetNegativeBalanceExchangeRecordService get user negative balance auto exchange record

func (*GetNegativeBalanceExchangeRecordService) Do

Do send request

func (*GetNegativeBalanceExchangeRecordService) EndTime

EndTime set endTime

func (*GetNegativeBalanceExchangeRecordService) RecvWindow

RecvWindow set recvWindow

func (*GetNegativeBalanceExchangeRecordService) StartTime

StartTime set startTime

type GetNegativeBalanceInterestHistoryService

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

GetNegativeBalanceInterestHistoryService get portfolio margin negative balance interest history

func (*GetNegativeBalanceInterestHistoryService) Asset

Asset set asset

func (*GetNegativeBalanceInterestHistoryService) Do

Do send request

func (*GetNegativeBalanceInterestHistoryService) EndTime

EndTime set endTime

func (*GetNegativeBalanceInterestHistoryService) Size

Size set size

func (*GetNegativeBalanceInterestHistoryService) StartTime

StartTime set startTime

type GetRateLimitService

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

GetRateLimitService get user rate limit

func (*GetRateLimitService) Do

func (s *GetRateLimitService) Do(ctx context.Context, opts ...RequestOption) ([]*RateLimit, error)

Do send request

func (*GetRateLimitService) RecvWindow

func (s *GetRateLimitService) RecvWindow(recvWindow int64) *GetRateLimitService

RecvWindow set recvWindow

type GetUMAccountDetailService

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

GetUMAccountDetailService get current UM account asset and position information

func (*GetUMAccountDetailService) Do

Do send request

type GetUMCommissionRateService

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

GetUMCommissionRateService get user commission rate for UM

func (*GetUMCommissionRateService) Do

Do send request

func (*GetUMCommissionRateService) Symbol

Symbol set symbol

type GetUMIncomeHistoryService

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

GetUMIncomeHistoryService get UM income history

func (*GetUMIncomeHistoryService) Do

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

Do send request

func (*GetUMIncomeHistoryService) EndTime

EndTime set endTime

func (*GetUMIncomeHistoryService) IncomeType

func (s *GetUMIncomeHistoryService) IncomeType(incomeType string) *GetUMIncomeHistoryService

IncomeType set income type

func (*GetUMIncomeHistoryService) Limit

Limit set limit

func (*GetUMIncomeHistoryService) Page

Page set page

func (*GetUMIncomeHistoryService) StartTime

StartTime set startTime

func (*GetUMIncomeHistoryService) Symbol

Symbol set symbol

type GetUMLeverageBracketService

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

GetUMLeverageBracketService get UM notional and leverage brackets

func (*GetUMLeverageBracketService) Do

Do send request

func (*GetUMLeverageBracketService) Symbol

Symbol set symbol

type GetUMOrderDownloadLinkService

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

GetUMOrderDownloadLinkService get UM futures order download link by Id

func (*GetUMOrderDownloadLinkService) Do

Do send request

func (*GetUMOrderDownloadLinkService) DownloadID

DownloadID set downloadId

func (*GetUMOrderDownloadLinkService) RecvWindow

RecvWindow set recvWindow

type GetUMOrderHistoryDownloadIDService

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

GetUMOrderHistoryDownloadIDService get download id for UM futures order history

func (*GetUMOrderHistoryDownloadIDService) Do

Do send request

func (*GetUMOrderHistoryDownloadIDService) EndTime

EndTime set endTime

func (*GetUMOrderHistoryDownloadIDService) RecvWindow

RecvWindow set recvWindow

func (*GetUMOrderHistoryDownloadIDService) StartTime

StartTime set startTime

type GetUMPositionModeService

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

GetUMPositionModeService get user's position mode on EVERY symbol in UM

func (*GetUMPositionModeService) Do

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

Do send request

type GetUMPositionRiskService

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

GetUMPositionRiskService get UM position risk information

func (*GetUMPositionRiskService) Do

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

Do send request

func (*GetUMPositionRiskService) Symbol

Symbol set symbol

type GetUMTradeDownloadLinkService

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

GetUMTradeDownloadLinkService get UM futures trade download link by Id

func (*GetUMTradeDownloadLinkService) Do

Do send request

func (*GetUMTradeDownloadLinkService) DownloadID

DownloadID set downloadId

func (*GetUMTradeDownloadLinkService) RecvWindow

RecvWindow set recvWindow

type GetUMTradeHistoryDownloadIDService

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

GetUMTradeHistoryDownloadIDService get download id for UM futures trade history

func (*GetUMTradeHistoryDownloadIDService) Do

Do send request

func (*GetUMTradeHistoryDownloadIDService) EndTime

EndTime set endTime

func (*GetUMTradeHistoryDownloadIDService) RecvWindow

RecvWindow set recvWindow

func (*GetUMTradeHistoryDownloadIDService) StartTime

StartTime set startTime

type GetUMTradingStatusService

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

GetUMTradingStatusService get UM trading quantitative rules indicators

func (*GetUMTradingStatusService) Do

Do send request

func (*GetUMTradingStatusService) Symbol

Symbol set symbol

type GetUMTransactionDownloadLinkService

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

GetUMTransactionDownloadLinkService get UM futures transaction download link by Id

func (*GetUMTransactionDownloadLinkService) Do

Do send request

func (*GetUMTransactionDownloadLinkService) DownloadID

DownloadID set downloadId

func (*GetUMTransactionDownloadLinkService) RecvWindow

RecvWindow set recvWindow

type GetUMTransactionHistoryDownloadIDService

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

GetUMTransactionHistoryDownloadIDService get download id for UM futures transaction history

func (*GetUMTransactionHistoryDownloadIDService) Do

Do send request

func (*GetUMTransactionHistoryDownloadIDService) EndTime

EndTime set endTime

func (*GetUMTransactionHistoryDownloadIDService) RecvWindow

RecvWindow set recvWindow

func (*GetUMTransactionHistoryDownloadIDService) StartTime

StartTime set startTime

type Income

type Income struct {
	Symbol     string `json:"symbol"`     // trade symbol, if existing
	IncomeType string `json:"incomeType"` // income type
	Income     string `json:"income"`     // income amount
	Asset      string `json:"asset"`      // income asset
	Info       string `json:"info"`       // extra information
	Time       int64  `json:"time"`
	TranID     int64  `json:"tranId"`  // transaction id
	TradeID    string `json:"tradeId"` // trade id, if existing
}

Income define income info

type Indicator

type Indicator struct {
	IsLocked           bool    `json:"isLocked"`
	PlannedRecoverTime int64   `json:"plannedRecoverTime"`
	Indicator          string  `json:"indicator"`    // UFR/IFER/GCR/DR/TMV
	Value              float64 `json:"value"`        // Current value
	TriggerValue       float64 `json:"triggerValue"` // Trigger value
}

Indicator define trading indicator

type LeverageBracket

type LeverageBracket struct {
	Symbol       string    `json:"symbol"`
	NotionalCoef string    `json:"notionalCoef"`
	Brackets     []Bracket `json:"brackets"`
}

LeverageBracket define leverage bracket

type MarginAccountTradesService

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

MarginAccountTradesService service to get margin account trade list

func (*MarginAccountTradesService) Do

Do send request

func (*MarginAccountTradesService) EndTime

EndTime set endTime

func (*MarginAccountTradesService) FromID

FromID set fromID

func (*MarginAccountTradesService) Limit

Limit set limit

func (*MarginAccountTradesService) OrderID

OrderID set orderID

func (*MarginAccountTradesService) RecvWindow

func (s *MarginAccountTradesService) RecvWindow(recvWindow int64) *MarginAccountTradesService

RecvWindow set recvWindow

func (*MarginAccountTradesService) StartTime

StartTime set startTime

func (*MarginAccountTradesService) Symbol

Symbol set symbol

type MarginAllOCOService

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

MarginAllOCOService service to get all OCO orders for a margin account

func (*MarginAllOCOService) Do

Do send request

func (*MarginAllOCOService) EndTime

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

EndTime set endTime

func (*MarginAllOCOService) FromID

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

FromID set fromID

func (*MarginAllOCOService) Limit

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

Limit set limit

func (*MarginAllOCOService) RecvWindow

func (s *MarginAllOCOService) RecvWindow(recvWindow int64) *MarginAllOCOService

RecvWindow set recvWindow

func (*MarginAllOCOService) StartTime

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

StartTime set startTime

type MarginCancelAllOrdersResponse

type MarginCancelAllOrdersResponse struct {
	Symbol              string   `json:"symbol"`
	OrigClientOrderID   string   `json:"origClientOrderId,omitempty"`
	OrderID             int64    `json:"orderId,omitempty"`
	OrderListID         int64    `json:"orderListId"`
	ClientOrderID       string   `json:"clientOrderId,omitempty"`
	Price               string   `json:"price,omitempty"`
	OrigQty             string   `json:"origQty,omitempty"`
	ExecutedQty         string   `json:"executedQty,omitempty"`
	CummulativeQuoteQty string   `json:"cummulativeQuoteQty,omitempty"`
	Status              string   `json:"status,omitempty"`
	TimeInForce         string   `json:"timeInForce,omitempty"`
	Type                string   `json:"type,omitempty"`
	Side                string   `json:"side,omitempty"`
	ContingencyType     string   `json:"contingencyType,omitempty"`
	ListStatusType      string   `json:"listStatusType,omitempty"`
	ListOrderStatus     string   `json:"listOrderStatus,omitempty"`
	ListClientOrderID   string   `json:"listClientOrderId,omitempty"`
	TransactionTime     int64    `json:"transactionTime,omitempty"`
	Orders              []Order  `json:"orders,omitempty"`
	OrderReports        []Report `json:"orderReports,omitempty"`
}

MarginCancelAllOrdersResponse define cancel all orders response

type MarginCancelAllOrdersService

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

MarginCancelAllOrdersService service to cancel all margin account open orders on a symbol

func (*MarginCancelAllOrdersService) Do

Do send request

func (*MarginCancelAllOrdersService) RecvWindow

RecvWindow set recvWindow

func (*MarginCancelAllOrdersService) Symbol

Symbol set symbol

type MarginCancelOCOResponse

type MarginCancelOCOResponse struct {
	OrderListID       int64  `json:"orderListId"`
	ContingencyType   string `json:"contingencyType"`
	ListStatusType    string `json:"listStatusType"`
	ListOrderStatus   string `json:"listOrderStatus"`
	ListClientOrderID string `json:"listClientOrderId"`
	TransactionTime   int64  `json:"transactionTime"`
	Symbol            string `json:"symbol"`
	Orders            []struct {
		Symbol        string `json:"symbol"`
		OrderID       int64  `json:"orderId"`
		ClientOrderID string `json:"clientOrderId"`
	} `json:"orders"`
	OrderReports []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"`
		CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
		Status              string `json:"status"`
		TimeInForce         string `json:"timeInForce"`
		Type                string `json:"type"`
		Side                string `json:"side"`
		StopPrice           string `json:"stopPrice,omitempty"`
	} `json:"orderReports"`
}

MarginCancelOCOResponse define cancel OCO response

type MarginCancelOCOService

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

MarginCancelOCOService service to cancel margin account OCO orders

func (*MarginCancelOCOService) Do

Do send request

func (*MarginCancelOCOService) ListClientOrderID

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

ListClientOrderID set listClientOrderId

func (*MarginCancelOCOService) NewClientOrderID

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

NewClientOrderID set newClientOrderId

func (*MarginCancelOCOService) OrderListID

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

OrderListID set orderListId

func (*MarginCancelOCOService) RecvWindow

func (s *MarginCancelOCOService) RecvWindow(recvWindow int64) *MarginCancelOCOService

RecvWindow set recvWindow

func (*MarginCancelOCOService) Symbol

Symbol set symbol

type MarginCancelOrderResponse

type MarginCancelOrderResponse struct {
	Symbol              string `json:"symbol"`
	OrderID             int64  `json:"orderId"`
	OrigClientOrderID   string `json:"origClientOrderId"`
	ClientOrderID       string `json:"clientOrderId"`
	Price               string `json:"price"`
	OrigQty             string `json:"origQty"`
	ExecutedQty         string `json:"executedQty"`
	CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
}

MarginCancelOrderResponse define cancel order response

type MarginCancelOrderService

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

MarginCancelOrderService service to cancel margin account orders

func (*MarginCancelOrderService) Do

Do send request

func (*MarginCancelOrderService) NewClientOrderID

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

NewClientOrderID set newClientOrderId

func (*MarginCancelOrderService) OrderID

OrderID set orderID

func (*MarginCancelOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*MarginCancelOrderService) RecvWindow

func (s *MarginCancelOrderService) RecvWindow(recvWindow int64) *MarginCancelOrderService

RecvWindow set recvWindow

func (*MarginCancelOrderService) Symbol

Symbol set symbol

type MarginForceOrder

type MarginForceOrder struct {
	AvgPrice    string `json:"avgPrice"`
	ExecutedQty string `json:"executedQty"`
	OrderID     int64  `json:"orderId"`
	Price       string `json:"price"`
	Qty         string `json:"qty"`
	Side        string `json:"side"`
	Symbol      string `json:"symbol"`
	TimeInForce string `json:"timeInForce"`
	UpdatedTime int64  `json:"updatedTime"`
}

MarginForceOrder define margin force order

type MarginForceOrdersResponse

type MarginForceOrdersResponse struct {
	Rows  []*MarginForceOrder `json:"rows"`
	Total int64               `json:"total"`
}

MarginForceOrdersResponse define margin force orders response

type MarginForceOrdersService

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

MarginForceOrdersService service to get user's margin force orders

func (*MarginForceOrdersService) Current

Current set current page

func (*MarginForceOrdersService) Do

Do send request

func (*MarginForceOrdersService) EndTime

EndTime set endTime

func (*MarginForceOrdersService) RecvWindow

func (s *MarginForceOrdersService) RecvWindow(recvWindow int64) *MarginForceOrdersService

RecvWindow set recvWindow

func (*MarginForceOrdersService) Size

Size set page size

func (*MarginForceOrdersService) StartTime

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

StartTime set startTime

type MarginInterest

type MarginInterest struct {
	TxID                int64  `json:"txId"`
	InterestAccuredTime int64  `json:"interestAccuredTime"`
	Asset               string `json:"asset"`
	RawAsset            string `json:"rawAsset"`
	Principal           string `json:"principal"`
	Interest            string `json:"interest"`
	InterestRate        string `json:"interestRate"`
	Type                string `json:"type"` // PERIODIC/ON_BORROW/PERIODIC_CONVERTED/ON_BORROW_CONVERTED/PORTFOLIO
}

MarginInterest define margin interest info

type MarginInterestHistoryResponse

type MarginInterestHistoryResponse struct {
	Rows  []MarginInterest `json:"rows"`
	Total int64            `json:"total"`
}

MarginInterestHistoryResponse define margin interest history response

type MarginLoan

type MarginLoan struct {
	TxID      int64  `json:"txId"`
	Asset     string `json:"asset"`
	Principal string `json:"principal"`
	Timestamp int64  `json:"timestamp"`
	Status    string `json:"status"` // PENDING/CONFIRMED/FAILED
}

MarginLoan define margin loan info

type MarginLoanResponse

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

MarginLoanResponse define margin loan response

type MarginLoanService

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

MarginLoanService service to borrow margin loan

func (*MarginLoanService) Amount

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

Amount set amount

func (*MarginLoanService) Asset

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

Asset set asset

func (*MarginLoanService) Do

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

Do send request

type MarginOCODetail

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

MarginOCODetail defines detail of an OCO order

type MarginOCOOrder

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

MarginOCOOrder defines margin OCO order

type MarginOCOOrderDetail

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

MarginOCOOrderDetail define margin OCO order detail

type MarginOCOOrderReport

type MarginOCOOrderReport struct {
	Symbol              string          `json:"symbol"`
	OrderID             int64           `json:"orderId"`
	OrderListID         int64           `json:"orderListId"`
	ClientOrderID       string          `json:"clientOrderId"`
	TransactTime        int64           `json:"transactTime"`
	Price               string          `json:"price"`
	OrigQty             string          `json:"origQty"`
	ExecutedQty         string          `json:"executedQty"`
	CummulativeQuoteQty string          `json:"cummulativeQuoteQty"`
	Status              string          `json:"status"`
	TimeInForce         TimeInForceType `json:"timeInForce"`
	Type                OrderType       `json:"type"`
	Side                SideType        `json:"side"`
	StopPrice           string          `json:"stopPrice,omitempty"`
}

MarginOCOOrderReport defines margin OCO order report

type MarginOCOQueryService

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

MarginOCOQueryService service to query margin OCO orders

func (*MarginOCOQueryService) Do

Do send request

func (*MarginOCOQueryService) OrderListID

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

OrderListID set orderListID

func (*MarginOCOQueryService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderID

type MarginOCOResponse

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

MarginOCOResponse defines margin OCO response

type MarginOCOService

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

MarginOCOService service to create OCO orders for margin account

func (*MarginOCOService) Do

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

Do send request

func (*MarginOCOService) LimitClientOrderID

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

LimitClientOrderID set limitClientOrderId

func (*MarginOCOService) LimitIcebergQty

func (s *MarginOCOService) LimitIcebergQty(limitIcebergQty string) *MarginOCOService

LimitIcebergQty set limitIcebergQty

func (*MarginOCOService) ListClientOrderID

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

ListClientOrderID set listClientOrderId

func (*MarginOCOService) NewOrderRespType

func (s *MarginOCOService) NewOrderRespType(newOrderRespType NewOrderRespType) *MarginOCOService

NewOrderRespType set newOrderRespType

func (*MarginOCOService) Price

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

Price set price

func (*MarginOCOService) Quantity

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

Quantity set quantity

func (*MarginOCOService) RecvWindow

func (s *MarginOCOService) RecvWindow(recvWindow int64) *MarginOCOService

RecvWindow set recvWindow

func (*MarginOCOService) Side

Side set side

func (*MarginOCOService) SideEffectType

func (s *MarginOCOService) SideEffectType(sideEffectType SideEffectType) *MarginOCOService

SideEffectType set sideEffectType

func (*MarginOCOService) StopClientOrderID

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

StopClientOrderID set stopClientOrderId

func (*MarginOCOService) StopIcebergQty

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

StopIcebergQty set stop iceberg quantity

func (*MarginOCOService) StopLimitPrice

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

StopLimitPrice set stop limit price

func (*MarginOCOService) StopLimitTimeInForce

func (s *MarginOCOService) StopLimitTimeInForce(timeInForce TimeInForceType) *MarginOCOService

StopLimitTimeInForce set stopLimitTimeInForce

func (*MarginOCOService) StopPrice

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

StopPrice set stop price

func (*MarginOCOService) Symbol

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

Symbol set symbol

type MarginOpenOCOService

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

MarginOpenOCOService service to get margin account's open OCO orders

func (*MarginOpenOCOService) Do

Do send request

func (*MarginOpenOCOService) RecvWindow

func (s *MarginOpenOCOService) RecvWindow(recvWindow int64) *MarginOpenOCOService

RecvWindow set recvWindow

type MarginOrder

type MarginOrder struct {
	Symbol                  string          `json:"symbol"`
	OrderID                 int64           `json:"orderId"`
	ClientOrderID           string          `json:"clientOrderId"`
	TransactTime            int64           `json:"time"`
	UpdateTime              int64           `json:"updateTime"`
	Price                   string          `json:"price"`
	OrigQty                 string          `json:"origQty"`
	ExecutedQty             string          `json:"executedQty"`
	CummulativeQuoteQty     string          `json:"cummulativeQuoteQty"`
	Status                  string          `json:"status"`
	TimeInForce             TimeInForceType `json:"timeInForce"`
	Type                    OrderType       `json:"type"`
	Side                    SideType        `json:"side"`
	MarginBuyBorrowAmount   string          `json:"marginBuyBorrowAmount,omitempty"`
	MarginBuyBorrowAsset    string          `json:"marginBuyBorrowAsset,omitempty"`
	IcebergQty              string          `json:"icebergQty"`
	IsWorking               bool            `json:"isWorking"`
	StopPrice               string          `json:"stopPrice"`
	AccountID               int64           `json:"accountId"`
	SelfTradePreventionMode string          `json:"selfTradePreventionMode"`
	PreventedMatchID        *string         `json:"preventedMatchId"`
	PreventedQuantity       *string         `json:"preventedQuantity"`
	Fills                   []*Fill         `json:"fills"`
}

MarginOrder define margin order info

type MarginOrderService

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

MarginOrderService service to place margin orders

func (*MarginOrderService) AutoRepayAtCancel

func (s *MarginOrderService) AutoRepayAtCancel(autoRepay bool) *MarginOrderService

AutoRepayAtCancel set auto repay at cancel

func (*MarginOrderService) Do

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

Do send request

func (*MarginOrderService) IcebergQty

func (s *MarginOrderService) IcebergQty(icebergQty string) *MarginOrderService

IcebergQty set iceberg quantity

func (*MarginOrderService) NewClientOrderID

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

NewClientOrderID set custom order id

func (*MarginOrderService) NewOrderRespType

func (s *MarginOrderService) NewOrderRespType(newOrderRespType NewOrderRespType) *MarginOrderService

NewOrderRespType set response type

func (*MarginOrderService) Price

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

Price set price

func (*MarginOrderService) Quantity

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

Quantity set quantity

func (*MarginOrderService) QuoteOrderQty

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

QuoteOrderQty set quote order quantity

func (*MarginOrderService) SelfTradePreventionMode

func (s *MarginOrderService) SelfTradePreventionMode(mode SelfTradePreventionMode) *MarginOrderService

SelfTradePreventionMode set self trade prevention mode

func (*MarginOrderService) Side

Side set side

func (*MarginOrderService) SideEffectType

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

SideEffectType set side effect type

func (*MarginOrderService) StopPrice

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

StopPrice set stop price

func (*MarginOrderService) Symbol

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

Symbol set symbol

func (*MarginOrderService) TimeInForce

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

TimeInForce set time in force

func (*MarginOrderService) Type

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

Type set order type

type MarginRepay

type MarginRepay struct {
	Amount    string `json:"amount"` // Total amount repaid
	Asset     string `json:"asset"`
	Interest  string `json:"interest"`  // Interest repaid
	Principal string `json:"principal"` // Principal repaid
	Status    string `json:"status"`    // PENDING/CONFIRMED/FAILED
	Timestamp int64  `json:"timestamp"`
	TxID      int64  `json:"txId"`
}

MarginRepay define margin repay info

type MarginRepayDebtResponse

type MarginRepayDebtResponse struct {
	Amount             string   `json:"amount"`
	Asset              string   `json:"asset"`
	SpecifyRepayAssets []string `json:"specifyRepayAssets"`
	UpdateTime         int64    `json:"updateTime"`
	Success            bool     `json:"success"`
}

MarginRepayDebtResponse represents the response from repaying margin debt

type MarginRepayDebtService

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

MarginRepayDebtService service to repay margin debt

func (*MarginRepayDebtService) Amount

Amount set amount

func (*MarginRepayDebtService) Asset

Asset set asset

func (*MarginRepayDebtService) Do

Do send request

func (*MarginRepayDebtService) RecvWindow

func (s *MarginRepayDebtService) RecvWindow(recvWindow int64) *MarginRepayDebtService

RecvWindow set recvWindow

func (*MarginRepayDebtService) SpecifyRepayAssets

func (s *MarginRepayDebtService) SpecifyRepayAssets(assets string) *MarginRepayDebtService

SpecifyRepayAssets set specific assets to repay debt

type MarginRepayResponse

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

MarginRepayResponse define margin repay response

type MarginRepayService

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

MarginRepayService service to repay margin loans

func (*MarginRepayService) Amount

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

Amount set amount

func (*MarginRepayService) Asset

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

Asset set asset

func (*MarginRepayService) Do

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

Do send request

func (*MarginRepayService) RecvWindow

func (s *MarginRepayService) RecvWindow(recvWindow int64) *MarginRepayService

RecvWindow set recvWindow

type MarginTrade

type MarginTrade struct {
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	ID              int64  `json:"id"`
	IsBestMatch     bool   `json:"isBestMatch"`
	IsBuyer         bool   `json:"isBuyer"`
	IsMaker         bool   `json:"isMaker"`
	OrderID         int64  `json:"orderId"`
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	Symbol          string `json:"symbol"`
	Time            int64  `json:"time"`
}

MarginTrade define margin trade info

type MarginType

type MarginType string

MarginType define margin type

type MaxBorrow

type MaxBorrow struct {
	Amount      string `json:"amount"`      // account's currently max borrowable amount with sufficient system availability
	BorrowLimit string `json:"borrowLimit"` // max borrowable amount limited by the account level
}

MaxBorrow define margin max borrowable amount info

type MaxWithdraw

type MaxWithdraw struct {
	Amount string `json:"amount"` // max withdrawable amount
}

MaxWithdraw define margin max withdrawable amount info

type NegativeBalanceExchange

type NegativeBalanceExchange struct {
	StartTime int64                            `json:"startTime"`
	EndTime   int64                            `json:"endTime"`
	Details   []*NegativeBalanceExchangeDetail `json:"details"`
}

NegativeBalanceExchange define negative balance exchange info

type NegativeBalanceExchangeDetail

type NegativeBalanceExchangeDetail struct {
	Asset                string  `json:"asset"`
	NegativeBalance      float64 `json:"negativeBalance"`
	NegativeMaxThreshold float64 `json:"negativeMaxThreshold"`
}

NegativeBalanceExchangeDetail define negative balance exchange detail

type NegativeBalanceExchangeRecord

type NegativeBalanceExchangeRecord struct {
	Total int64                      `json:"total"`
	Rows  []*NegativeBalanceExchange `json:"rows"`
}

NegativeBalanceExchangeRecord define negative balance exchange record response

type NegativeBalanceInterest

type NegativeBalanceInterest struct {
	Asset               string `json:"asset"`
	Interest            string `json:"interest"` // interest amount
	InterestAccuredTime int64  `json:"interestAccuredTime"`
	InterestRate        string `json:"interestRate"` // daily interest rate
	Principal           string `json:"principal"`
}

NegativeBalanceInterest define negative balance interest info

type NewOrderRespType

type NewOrderRespType string

NewOrderRespType define response JSON verbosity

type Order

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

Order define order

type OrderExecutionType

type OrderExecutionType string

OrderExecutionType define order execution type

type OrderStatusType

type OrderStatusType string

OrderStatusType define order status type

type OrderType

type OrderType string

OrderType define order type

type PingService

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

PingService ping server

func (*PingService) Do

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

Do send request

type PositionMode

type PositionMode struct {
	DualSidePosition bool `json:"dualSidePosition"` // true: Hedge Mode; false: One-way Mode
}

PositionMode define position mode info

type PositionSideType

type PositionSideType string

PositionSideType define position side type of order

type PriceMatchType

type PriceMatchType string

PriceMatchType define priceMatch type Can't be passed together with price

type RateLimit

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

RateLimit define rate limit info

type RepayFuturesNegativeBalanceService

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

RepayFuturesNegativeBalanceService repay futures negative balance

func (*RepayFuturesNegativeBalanceService) Do

Do send request

type Report

type Report 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"`
	CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
	StopPrice           string `json:"stopPrice,omitempty"`
	IcebergQty          string `json:"icebergQty,omitempty"`
}

Report define order report

type RequestOption

type RequestOption func(*request)

RequestOption define option type for request

func WithExtraForm

func WithExtraForm(m map[string]any) RequestOption

WithExtraForm add extra form data of the request

func WithHeader

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

WithHeader set or add a header value to the request

func WithHeaders

func WithHeaders(header http.Header) RequestOption

WithHeaders set or replace the headers of the request

func WithRecvWindow

func WithRecvWindow(recvWindow int64) RequestOption

WithRecvWindow set recvWindow param for the request

type SelfTradePreventionMode

type SelfTradePreventionMode string

SelfTradePreventionMode define self trade prevention strategy

type SideEffectType

type SideEffectType string

SideEffectType define side effect type for orders

type SideType

type SideType string

SideType define side type of order

type StrategyType

type StrategyType string

StrategyType define strategy type for conditional orders

type SuccessResponse

type SuccessResponse struct {
	Msg string `json:"msg"`
}

SuccessResponse define success response

type SymbolFilterType

type SymbolFilterType string

SymbolFilterType define symbol filter type

type SymbolStatusType

type SymbolStatusType string

SymbolStatusType define symbol status type

type SymbolType

type SymbolType string

SymbolType define symbol type

type TimeInForceType

type TimeInForceType string

TimeInForceType define time in force type of order

type TradingStatus

type TradingStatus struct {
	Indicators map[string][]Indicator `json:"indicators"`
	UpdateTime int64                  `json:"updateTime"`
}

TradingStatus define trading status

type UMADLQuantileResponse

type UMADLQuantileResponse struct {
	Symbol      string      `json:"symbol"`
	ADLQuantile ADLQuantile `json:"adlQuantile"`
}

UMADLQuantileResponse define UM ADL quantile response

type UMADLQuantileService

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

UMADLQuantileService service to get UM position ADL quantile estimation

func (*UMADLQuantileService) Do

Do send request

func (*UMADLQuantileService) RecvWindow

func (s *UMADLQuantileService) RecvWindow(recvWindow int64) *UMADLQuantileService

RecvWindow set recvWindow

func (*UMADLQuantileService) Symbol

Symbol set symbol

type UMAccountConfig

type UMAccountConfig struct {
	FeeTier           int   `json:"feeTier"`          // Account commission tier
	CanTrade          bool  `json:"canTrade"`         // If can trade
	CanDeposit        bool  `json:"canDeposit"`       // If can transfer in asset
	CanWithdraw       bool  `json:"canWithdraw"`      // If can transfer out asset
	DualSidePosition  bool  `json:"dualSidePosition"` // If dual side position is enabled
	UpdateTime        int64 `json:"updateTime"`       // Reserved property
	MultiAssetsMargin bool  `json:"multiAssetsMargin"`
	TradeGroupId      int   `json:"tradeGroupId"`
}

UMAccountConfig define UM futures account configuration

type UMAccountConfigService

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

UMAccountConfigService get UM futures account configuration

func (*UMAccountConfigService) Do

Do send request

type UMAccountDetail

type UMAccountDetail struct {
	Assets    []UMAsset    `json:"assets"`
	Positions []UMPosition `json:"positions"`
}

UMAccountDetail define UM account detail

type UMAccountDetailV2

type UMAccountDetailV2 struct {
	Assets    []*UMAssetV2    `json:"assets"`
	Positions []*UMPositionV2 `json:"positions"`
}

UMAccountDetailV2 define UM account detail v2

type UMAccountDetailV2Service

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

UMAccountDetailV2Service get UM account detail v2

func (*UMAccountDetailV2Service) Do

Do send request

type UMAccountTrade

type UMAccountTrade struct {
	Symbol          string `json:"symbol"`
	ID              int64  `json:"id"`
	OrderID         int64  `json:"orderId"`
	Side            string `json:"side"`
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	RealizedPnl     string `json:"realizedPnl"`
	QuoteQty        string `json:"quoteQty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	Time            int64  `json:"time"`
	Buyer           bool   `json:"buyer"`
	Maker           bool   `json:"maker"`
	PositionSide    string `json:"positionSide"`
}

UMAccountTrade define UM account trade

type UMAccountTradeService

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

UMAccountTradeService service to get UM account trade list

func (*UMAccountTradeService) Do

Do send request

func (*UMAccountTradeService) EndTime

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

EndTime set endTime

func (*UMAccountTradeService) FromID

FromID set fromId

func (*UMAccountTradeService) Limit

Limit set limit

func (*UMAccountTradeService) RecvWindow

func (s *UMAccountTradeService) RecvWindow(recvWindow int64) *UMAccountTradeService

RecvWindow set recvWindow

func (*UMAccountTradeService) StartTime

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

StartTime set startTime

func (*UMAccountTradeService) Symbol

Symbol set symbol

type UMAccountTradesService

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

UMAccountTradesService service to get UM account trade list

func (*UMAccountTradesService) Do

Do send request

func (*UMAccountTradesService) EndTime

EndTime set endTime

func (*UMAccountTradesService) FromID

FromID set fromID

func (*UMAccountTradesService) Limit

Limit set limit

func (*UMAccountTradesService) RecvWindow

func (s *UMAccountTradesService) RecvWindow(recvWindow int64) *UMAccountTradesService

RecvWindow set recvWindow

func (*UMAccountTradesService) StartTime

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

StartTime set startTime

func (*UMAccountTradesService) Symbol

Symbol set symbol

type UMAllConditionalOrdersService

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

UMAllConditionalOrdersService service to get all UM conditional orders

func (*UMAllConditionalOrdersService) Do

Do send request

func (*UMAllConditionalOrdersService) EndTime

EndTime set endTime

func (*UMAllConditionalOrdersService) Limit

Limit set limit

func (*UMAllConditionalOrdersService) RecvWindow

RecvWindow set recvWindow

func (*UMAllConditionalOrdersService) StartTime

StartTime set startTime

func (*UMAllConditionalOrdersService) StrategyID

StrategyID set strategyId

func (*UMAllConditionalOrdersService) Symbol

Symbol set symbol

type UMAllOrdersResponse

type UMAllOrdersResponse struct {
	AvgPrice                string `json:"avgPrice"`
	ClientOrderID           string `json:"clientOrderId"`
	CumQuote                string `json:"cumQuote"`
	ExecutedQty             string `json:"executedQty"`
	OrderID                 int64  `json:"orderId"`
	OrigQty                 string `json:"origQty"`
	OrigType                string `json:"origType"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	Status                  string `json:"status"`
	Symbol                  string `json:"symbol"`
	Time                    int64  `json:"time"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	UpdateTime              int64  `json:"updateTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMAllOrdersResponse define all orders response

type UMAllOrdersService

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

UMAllOrdersService service to get all UM orders

func (*UMAllOrdersService) Do

Do send request

func (*UMAllOrdersService) EndTime

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

EndTime set endTime

func (*UMAllOrdersService) Limit

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

Limit set limit

func (*UMAllOrdersService) OrderID

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

OrderID set orderID

func (*UMAllOrdersService) RecvWindow

func (s *UMAllOrdersService) RecvWindow(recvWindow int64) *UMAllOrdersService

RecvWindow set recvWindow

func (*UMAllOrdersService) StartTime

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

StartTime set startTime

func (*UMAllOrdersService) Symbol

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

Symbol set symbol

type UMAsset

type UMAsset struct {
	Asset                  string `json:"asset"`                  // asset name
	CrossWalletBalance     string `json:"crossWalletBalance"`     // wallet balance
	CrossUnPnl             string `json:"crossUnPnl"`             // unrealized profit
	MaintMargin            string `json:"maintMargin"`            // maintenance margin required
	InitialMargin          string `json:"initialMargin"`          // total initial margin required with current mark price
	PositionInitialMargin  string `json:"positionInitialMargin"`  // initial margin required for positions with current mark price
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // initial margin required for open orders with current mark price
	UpdateTime             int64  `json:"updateTime"`             // last update time
}

UMAsset define UM asset info

type UMAssetV2

type UMAssetV2 struct {
	Asset                  string `json:"asset"`                  // Asset name
	CrossWalletBalance     string `json:"crossWalletBalance"`     // Wallet balance
	CrossUnPnl             string `json:"crossUnPnl"`             // Unrealized profit
	MaintMargin            string `json:"maintMargin"`            // Maintenance margin required
	InitialMargin          string `json:"initialMargin"`          // Total initial margin required
	PositionInitialMargin  string `json:"positionInitialMargin"`  // Initial margin required for positions
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // Initial margin required for open orders
	UpdateTime             int64  `json:"updateTime"`             // Last update time
}

UMAssetV2 define UM asset detail v2

type UMCancelAllConditionalOrdersResponse

type UMCancelAllConditionalOrdersResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

UMCancelAllConditionalOrdersResponse define cancel all conditional orders response

type UMCancelAllConditionalOrdersService

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

UMCancelAllConditionalOrdersService service to cancel all open UM conditional orders

func (*UMCancelAllConditionalOrdersService) Do

Do send request

func (*UMCancelAllConditionalOrdersService) RecvWindow

RecvWindow set recvWindow

func (*UMCancelAllConditionalOrdersService) Symbol

Symbol set symbol

type UMCancelAllOrdersResponse

type UMCancelAllOrdersResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

UMCancelAllOrdersResponse defines cancel all orders response

type UMCancelAllOrdersService

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

UMCancelAllOrdersService service to cancel all active UM orders on a symbol

func (*UMCancelAllOrdersService) Do

Do send request

func (*UMCancelAllOrdersService) RecvWindow

func (s *UMCancelAllOrdersService) RecvWindow(recvWindow int64) *UMCancelAllOrdersService

RecvWindow set recvWindow

func (*UMCancelAllOrdersService) Symbol

Symbol set symbol

type UMCancelConditionalOrderResponse

type UMCancelConditionalOrderResponse struct {
	NewClientStrategyID     string `json:"newClientStrategyId"`
	StrategyID              int64  `json:"strategyId"`
	StrategyStatus          string `json:"strategyStatus"`
	StrategyType            string `json:"strategyType"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	TimeInForce             string `json:"timeInForce"`
	ActivatePrice           string `json:"activatePrice"`
	PriceRate               string `json:"priceRate"`
	BookTime                int64  `json:"bookTime"`
	UpdateTime              int64  `json:"updateTime"`
	WorkingType             string `json:"workingType"`
	PriceProtect            bool   `json:"priceProtect"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMCancelConditionalOrderResponse define cancel conditional order response

type UMCancelConditionalOrderService

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

UMCancelConditionalOrderService service to cancel UM conditional orders

func (*UMCancelConditionalOrderService) Do

Do send request

func (*UMCancelConditionalOrderService) NewClientStrategyID

func (s *UMCancelConditionalOrderService) NewClientStrategyID(newClientStrategyID string) *UMCancelConditionalOrderService

NewClientStrategyID set newClientStrategyId

func (*UMCancelConditionalOrderService) RecvWindow

RecvWindow set recvWindow

func (*UMCancelConditionalOrderService) StrategyID

StrategyID set strategyId

func (*UMCancelConditionalOrderService) Symbol

Symbol set symbol

type UMCancelOrderService

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

UMCancelOrderService service to cancel UM orders

func (*UMCancelOrderService) Do

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

Do send request

func (*UMCancelOrderService) OrderID

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

OrderID set orderID

func (*UMCancelOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderID

func (*UMCancelOrderService) RecvWindow

func (s *UMCancelOrderService) RecvWindow(recvWindow int64) *UMCancelOrderService

RecvWindow set recvWindow

func (*UMCancelOrderService) Symbol

Symbol set symbol

type UMConditionalOrder

type UMConditionalOrder struct {
	NewClientStrategyId string           `json:"newClientStrategyId"`
	StrategyId          int64            `json:"strategyId"`
	StrategyStatus      string           `json:"strategyStatus"`
	StrategyType        string           `json:"strategyType"`
	OrigQty             string           `json:"origQty"`
	Price               string           `json:"price"`
	ReduceOnly          bool             `json:"reduceOnly"`
	Side                SideType         `json:"side"`
	PositionSide        PositionSideType `json:"positionSide"`
	StopPrice           string           `json:"stopPrice"`
	Symbol              string           `json:"symbol"`
	TimeInForce         TimeInForceType  `json:"timeInForce"`
	ActivatePrice       string           `json:"activatePrice"`
	PriceRate           string           `json:"priceRate"`
	BookTime            int64            `json:"bookTime"`
	UpdateTime          int64            `json:"updateTime"`
	WorkingType         string           `json:"workingType"`
	PriceProtect        bool             `json:"priceProtect"`
	PriceMatch          string           `json:"priceMatch"`
}

UMConditionalOrder define conditional order info

type UMConditionalOrderHistoryResponse

type UMConditionalOrderHistoryResponse struct {
	NewClientStrategyID     string `json:"newClientStrategyId"`
	StrategyID              int64  `json:"strategyId"`
	StrategyStatus          string `json:"strategyStatus"`
	StrategyType            string `json:"strategyType"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	OrderID                 int64  `json:"orderId"`
	Status                  string `json:"status"`
	BookTime                int64  `json:"bookTime"`
	UpdateTime              int64  `json:"updateTime"`
	TriggerTime             int64  `json:"triggerTime"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	ActivatePrice           string `json:"activatePrice"`
	PriceRate               string `json:"priceRate"`
	WorkingType             string `json:"workingType"`
	PriceProtect            bool   `json:"priceProtect"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
}

UMConditionalOrderHistoryResponse define conditional order history response

type UMConditionalOrderHistoryService

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

UMConditionalOrderHistoryService service to get UM conditional order history

func (*UMConditionalOrderHistoryService) Do

Do send request

func (*UMConditionalOrderHistoryService) NewClientStrategyID

func (s *UMConditionalOrderHistoryService) NewClientStrategyID(newClientStrategyID string) *UMConditionalOrderHistoryService

NewClientStrategyID set newClientStrategyId

func (*UMConditionalOrderHistoryService) RecvWindow

RecvWindow set recvWindow

func (*UMConditionalOrderHistoryService) StrategyID

StrategyID set strategyId

func (*UMConditionalOrderHistoryService) Symbol

Symbol set symbol

type UMConditionalOrderResponse

type UMConditionalOrderResponse struct {
	NewClientStrategyID     string `json:"newClientStrategyId"`
	StrategyID              int64  `json:"strategyId"`
	StrategyStatus          string `json:"strategyStatus"`
	StrategyType            string `json:"strategyType"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	OrderID                 int64  `json:"orderId"`
	Status                  string `json:"status"`
	BookTime                int64  `json:"bookTime"`
	UpdateTime              int64  `json:"updateTime"`
	TriggerTime             int64  `json:"triggerTime"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	ActivatePrice           string `json:"activatePrice"`
	PriceRate               string `json:"priceRate"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMConditionalOrderResponse define conditional order response

type UMConditionalOrderService

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

UMConditionalOrderService service to place UM conditional orders

func (*UMConditionalOrderService) ActivationPrice

func (s *UMConditionalOrderService) ActivationPrice(price string) *UMConditionalOrderService

ActivationPrice set activation price

func (*UMConditionalOrderService) CallbackRate

CallbackRate set callback rate

func (*UMConditionalOrderService) Do

Do send request

func (*UMConditionalOrderService) PositionSide

PositionSide set position side

func (*UMConditionalOrderService) Price

Price set price

func (*UMConditionalOrderService) PriceProtect

func (s *UMConditionalOrderService) PriceProtect(protect bool) *UMConditionalOrderService

PriceProtect set price protect

func (*UMConditionalOrderService) Quantity

Quantity set quantity

func (*UMConditionalOrderService) Side

Side set side

func (*UMConditionalOrderService) StopPrice

StopPrice set stop price

func (*UMConditionalOrderService) StrategyType

func (s *UMConditionalOrderService) StrategyType(strategyType string) *UMConditionalOrderService

StrategyType set strategy type

func (*UMConditionalOrderService) Symbol

Symbol set symbol

func (*UMConditionalOrderService) TimeInForce

TimeInForce set time in force

func (*UMConditionalOrderService) WorkingType

func (s *UMConditionalOrderService) WorkingType(workingType string) *UMConditionalOrderService

WorkingType set working type

type UMFeeBurnResponse

type UMFeeBurnResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

UMFeeBurnResponse define response for toggling BNB burn

type UMFeeBurnService

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

UMFeeBurnService service to toggle BNB burn on UM futures trade

func (*UMFeeBurnService) Do

Do send request

func (*UMFeeBurnService) FeeBurn

func (s *UMFeeBurnService) FeeBurn(feeBurn bool) *UMFeeBurnService

FeeBurn set feeBurn status

func (*UMFeeBurnService) RecvWindow

func (s *UMFeeBurnService) RecvWindow(recvWindow int64) *UMFeeBurnService

RecvWindow set recvWindow

type UMFeeBurnStatusResponse

type UMFeeBurnStatusResponse struct {
	FeeBurn bool `json:"feeBurn"`
}

UMFeeBurnStatusResponse define response for getting BNB burn status

type UMFeeBurnStatusService

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

UMFeeBurnStatusService service to get BNB burn status on UM futures trade

func (*UMFeeBurnStatusService) Do

Do send request

func (*UMFeeBurnStatusService) RecvWindow

func (s *UMFeeBurnStatusService) RecvWindow(recvWindow int64) *UMFeeBurnStatusService

RecvWindow set recvWindow

type UMForceOrderResponse

type UMForceOrderResponse struct {
	OrderID       int64  `json:"orderId"`
	Symbol        string `json:"symbol"`
	Status        string `json:"status"`
	ClientOrderID string `json:"clientOrderId"`
	Price         string `json:"price"`
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"`
	ExecutedQty   string `json:"executedQty"`
	CumQuote      string `json:"cumQuote"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	OrigType      string `json:"origType"`
	Time          int64  `json:"time"`
	UpdateTime    int64  `json:"updateTime"`
}

UMForceOrderResponse define force order response

type UMForceOrdersService

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

UMForceOrdersService service to get user's UM force orders

func (*UMForceOrdersService) AutoCloseType

func (s *UMForceOrdersService) AutoCloseType(autoCloseType string) *UMForceOrdersService

AutoCloseType set autoCloseType

func (*UMForceOrdersService) Do

Do send request

func (*UMForceOrdersService) EndTime

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

EndTime set endTime

func (*UMForceOrdersService) Limit

Limit set limit

func (*UMForceOrdersService) RecvWindow

func (s *UMForceOrdersService) RecvWindow(recvWindow int64) *UMForceOrdersService

RecvWindow set recvWindow

func (*UMForceOrdersService) StartTime

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

StartTime set startTime

func (*UMForceOrdersService) Symbol

Symbol set symbol

type UMGetADLQuantileService

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

UMGetADLQuantileService service to get UM position ADL quantile estimation

func (*UMGetADLQuantileService) Do

Do send request

func (*UMGetADLQuantileService) RecvWindow

func (s *UMGetADLQuantileService) RecvWindow(recvWindow int64) *UMGetADLQuantileService

RecvWindow set recvWindow

func (*UMGetADLQuantileService) Symbol

Symbol set symbol

type UMLeverage

type UMLeverage struct {
	Leverage         int    `json:"leverage"`
	MaxNotionalValue string `json:"maxNotionalValue"`
	Symbol           string `json:"symbol"`
}

UMLeverage define leverage info

type UMModifyOrderHistoryResponse

type UMModifyOrderHistoryResponse struct {
	AmendmentID   int64     `json:"amendmentId"`
	Symbol        string    `json:"symbol"`
	Pair          string    `json:"pair"`
	OrderID       int64     `json:"orderId"`
	ClientOrderID string    `json:"clientOrderId"`
	Time          int64     `json:"time"`
	Amendment     Amendment `json:"amendment"`
	PriceMatch    string    `json:"priceMatch"`
}

UMModifyOrderHistoryResponse define modify order history response

type UMModifyOrderHistoryService

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

UMModifyOrderHistoryService service to get UM order modification history

func (*UMModifyOrderHistoryService) Do

Do send request

func (*UMModifyOrderHistoryService) EndTime

EndTime set endTime

func (*UMModifyOrderHistoryService) Limit

Limit set limit

func (*UMModifyOrderHistoryService) OrderID

OrderID set orderID

func (*UMModifyOrderHistoryService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderID

func (*UMModifyOrderHistoryService) RecvWindow

RecvWindow set recvWindow

func (*UMModifyOrderHistoryService) StartTime

StartTime set startTime

func (*UMModifyOrderHistoryService) Symbol

Symbol set symbol

type UMModifyOrderResponse

type UMModifyOrderResponse struct {
	OrderID                 int64  `json:"orderId"`
	Symbol                  string `json:"symbol"`
	Status                  string `json:"status"`
	ClientOrderID           string `json:"clientOrderId"`
	Price                   string `json:"price"`
	AvgPrice                string `json:"avgPrice"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumQty                  string `json:"cumQty"`
	CumQuote                string `json:"cumQuote"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	OrigType                string `json:"origType"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	UpdateTime              int64  `json:"updateTime"`
	PriceMatch              string `json:"priceMatch"`
}

UMModifyOrderResponse define modify order response

type UMModifyOrderService

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

UMModifyOrderService service to modify UM orders

func (*UMModifyOrderService) Do

Do send request

func (*UMModifyOrderService) OrderID

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

OrderID set orderID

func (*UMModifyOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*UMModifyOrderService) Price

Price set price

func (*UMModifyOrderService) PriceMatch

func (s *UMModifyOrderService) PriceMatch(priceMatch string) *UMModifyOrderService

PriceMatch set priceMatch

func (*UMModifyOrderService) Quantity

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

Quantity set quantity

func (*UMModifyOrderService) RecvWindow

func (s *UMModifyOrderService) RecvWindow(recvWindow int64) *UMModifyOrderService

RecvWindow set recvWindow

func (*UMModifyOrderService) Side

Side set side

func (*UMModifyOrderService) Symbol

Symbol set symbol

type UMOpenConditionalOrderResponse

type UMOpenConditionalOrderResponse struct {
	NewClientStrategyID     string `json:"newClientStrategyId"`
	StrategyID              int64  `json:"strategyId"`
	StrategyStatus          string `json:"strategyStatus"`
	StrategyType            string `json:"strategyType"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	BookTime                int64  `json:"bookTime"`
	UpdateTime              int64  `json:"updateTime"`
	TimeInForce             string `json:"timeInForce"`
	ActivatePrice           string `json:"activatePrice"`
	PriceRate               string `json:"priceRate"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMOpenConditionalOrderResponse define open conditional order response

type UMOpenConditionalOrderService

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

UMOpenConditionalOrderService service to get current UM open conditional order

func (*UMOpenConditionalOrderService) Do

Do send request

func (*UMOpenConditionalOrderService) NewClientStrategyID

func (s *UMOpenConditionalOrderService) NewClientStrategyID(newClientStrategyID string) *UMOpenConditionalOrderService

NewClientStrategyID set newClientStrategyId

func (*UMOpenConditionalOrderService) RecvWindow

RecvWindow set recvWindow

func (*UMOpenConditionalOrderService) StrategyID

StrategyID set strategyId

func (*UMOpenConditionalOrderService) Symbol

Symbol set symbol

type UMOpenConditionalOrdersService

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

UMOpenConditionalOrdersService service to get all current UM open conditional orders

func (*UMOpenConditionalOrdersService) Do

Do send request

func (*UMOpenConditionalOrdersService) RecvWindow

RecvWindow set recvWindow

func (*UMOpenConditionalOrdersService) Symbol

Symbol set symbol

type UMOpenOrderResponse

type UMOpenOrderResponse struct {
	AvgPrice                string `json:"avgPrice"`
	ClientOrderID           string `json:"clientOrderId"`
	CumQuote                string `json:"cumQuote"`
	ExecutedQty             string `json:"executedQty"`
	OrderID                 int64  `json:"orderId"`
	OrigQty                 string `json:"origQty"`
	OrigType                string `json:"origType"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	Status                  string `json:"status"`
	Symbol                  string `json:"symbol"`
	Time                    int64  `json:"time"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	UpdateTime              int64  `json:"updateTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMOpenOrderResponse define open order response

type UMOpenOrderService

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

UMOpenOrderService service to get current UM open order

func (*UMOpenOrderService) Do

Do send request

func (*UMOpenOrderService) OrderID

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

OrderID set orderID

func (*UMOpenOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*UMOpenOrderService) RecvWindow

func (s *UMOpenOrderService) RecvWindow(recvWindow int64) *UMOpenOrderService

RecvWindow set recvWindow

func (*UMOpenOrderService) Symbol

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

Symbol set symbol

type UMOpenOrdersResponse

type UMOpenOrdersResponse struct {
	AvgPrice                string `json:"avgPrice"`
	ClientOrderID           string `json:"clientOrderId"`
	CumQuote                string `json:"cumQuote"`
	ExecutedQty             string `json:"executedQty"`
	OrderID                 int64  `json:"orderId"`
	OrigQty                 string `json:"origQty"`
	OrigType                string `json:"origType"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	Status                  string `json:"status"`
	Symbol                  string `json:"symbol"`
	Time                    int64  `json:"time"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	UpdateTime              int64  `json:"updateTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMOpenOrdersResponse define open orders response

type UMOpenOrdersService

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

UMOpenOrdersService service to get all current UM open orders

func (*UMOpenOrdersService) Do

Do send request

func (*UMOpenOrdersService) RecvWindow

func (s *UMOpenOrdersService) RecvWindow(recvWindow int64) *UMOpenOrdersService

RecvWindow set recvWindow

func (*UMOpenOrdersService) Symbol

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

Symbol set symbol

type UMOrder

type UMOrder struct {
	ClientOrderID           string                  `json:"clientOrderId"`
	CumQty                  string                  `json:"cumQty"`
	CumQuote                string                  `json:"cumQuote"`
	ExecutedQty             string                  `json:"executedQty"`
	OrderID                 int64                   `json:"orderId"`
	AvgPrice                string                  `json:"avgPrice"`
	OrigQty                 string                  `json:"origQty"`
	Price                   string                  `json:"price"`
	ReduceOnly              bool                    `json:"reduceOnly"`
	Side                    SideType                `json:"side"`
	PositionSide            PositionSideType        `json:"positionSide"`
	Status                  string                  `json:"status"`
	Symbol                  string                  `json:"symbol"`
	TimeInForce             TimeInForceType         `json:"timeInForce"`
	Type                    OrderType               `json:"type"`
	SelfTradePreventionMode SelfTradePreventionMode `json:"selfTradePreventionMode"`
	GoodTillDate            int64                   `json:"goodTillDate"`
	UpdateTime              int64                   `json:"updateTime"`
	PriceMatch              PriceMatchType          `json:"priceMatch"`
}

UMOrder define UM order info

type UMOrderDownloadLink struct {
	DownloadID          string `json:"downloadId"`
	Status              string `json:"status"` // Enum:completed,processing
	URL                 string `json:"url"`    // The link is mapped to download id
	S3Link              string `json:"s3Link"`
	Notified            bool   `json:"notified"`            // ignore
	ExpirationTimestamp int64  `json:"expirationTimestamp"` // The link would expire after this timestamp
	IsExpired           *bool  `json:"isExpired"`
}

UMOrderDownloadLink define download link response

type UMOrderHistoryDownloadID

type UMOrderHistoryDownloadID struct {
	AvgCostTimestampOfLast30d int64  `json:"avgCostTimestampOfLast30d"`
	DownloadID                string `json:"downloadId"`
}

UMOrderHistoryDownloadID define download id response

type UMOrderService

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

UMOrderService service to place UM orders

func (*UMOrderService) Do

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

Do send request

func (*UMOrderService) GoodTillDate

func (s *UMOrderService) GoodTillDate(timestamp int64) *UMOrderService

GoodTillDate set good till date timestamp

func (*UMOrderService) NewClientOrderID

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

NewClientOrderID set custom order id

func (*UMOrderService) NewOrderRespType

func (s *UMOrderService) NewOrderRespType(newOrderRespType NewOrderRespType) *UMOrderService

NewOrderRespType set response type

func (*UMOrderService) PositionSide

func (s *UMOrderService) PositionSide(positionSide PositionSideType) *UMOrderService

PositionSide set position side

func (*UMOrderService) Price

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

Price set price

func (*UMOrderService) PriceMatch

func (s *UMOrderService) PriceMatch(priceMatch PriceMatchType) *UMOrderService

PriceMatch set price match type

func (*UMOrderService) Quantity

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

Quantity set quantity

func (*UMOrderService) ReduceOnly

func (s *UMOrderService) ReduceOnly(reduceOnly bool) *UMOrderService

ReduceOnly set reduce only

func (*UMOrderService) SelfTradePreventionMode

func (s *UMOrderService) SelfTradePreventionMode(mode SelfTradePreventionMode) *UMOrderService

SelfTradePreventionMode set self trade prevention mode

func (*UMOrderService) Side

func (s *UMOrderService) Side(side SideType) *UMOrderService

Side set side

func (*UMOrderService) Symbol

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

Symbol set symbol

func (*UMOrderService) TimeInForce

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

TimeInForce set time in force

func (*UMOrderService) Type

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

Type set order type

type UMPosition

type UMPosition struct {
	Symbol                 string `json:"symbol"`                     // symbol name
	PositionAmt            string `json:"positionAmt"`                // position amount
	EntryPrice             string `json:"entryPrice"`                 // average entry price
	MarkPrice              string `json:"markPrice,omitempty"`        // mark price (only in position risk endpoint)
	UnrealizedProfit       string `json:"unrealizedProfit"`           // unrealized profit
	LiquidationPrice       string `json:"liquidationPrice,omitempty"` // liquidation price (only in position risk endpoint)
	Leverage               string `json:"leverage"`                   // current initial leverage
	MaxNotional            string `json:"maxNotional,omitempty"`      // maximum available notional with current leverage (account detail)
	MaxNotionalValue       string `json:"maxNotionalValue,omitempty"` // maximum notional value (position risk)
	PositionSide           string `json:"positionSide"`               // position side
	InitialMargin          string `json:"initialMargin"`              // initial margin required with current mark price
	MaintMargin            string `json:"maintMargin"`                // maintenance margin required
	PositionInitialMargin  string `json:"positionInitialMargin"`      // initial margin required for positions with current mark price
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"`     // initial margin required for open orders with current mark price
	Notional               string `json:"notional,omitempty"`         // notional value (only in position risk endpoint)
	BidNotional            string `json:"bidNotional"`                // bids notional
	AskNotional            string `json:"askNotional"`                // ask notional
	UpdateTime             int64  `json:"updateTime"`                 // last update time
}

UMPosition define UM position information

type UMPositionV2

type UMPositionV2 struct {
	Symbol           string `json:"symbol"`           // Symbol name
	InitialMargin    string `json:"initialMargin"`    // Initial margin required
	MaintMargin      string `json:"maintMargin"`      // Maintenance margin required
	UnrealizedProfit string `json:"unrealizedProfit"` // Unrealized profit
	PositionSide     string `json:"positionSide"`     // Position side
	PositionAmt      string `json:"positionAmt"`      // Position amount
	UpdateTime       int64  `json:"updateTime"`       // Last update time
	Notional         string `json:"notional"`         // Notional value
}

UMPositionV2 define UM position detail v2

type UMQueryOrderResponse

type UMQueryOrderResponse struct {
	AvgPrice                string `json:"avgPrice"`
	ClientOrderID           string `json:"clientOrderId"`
	CumQuote                string `json:"cumQuote"`
	ExecutedQty             string `json:"executedQty"`
	OrderID                 int64  `json:"orderId"`
	OrigQty                 string `json:"origQty"`
	OrigType                string `json:"origType"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	Status                  string `json:"status"`
	Symbol                  string `json:"symbol"`
	Time                    int64  `json:"time"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	UpdateTime              int64  `json:"updateTime"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	GoodTillDate            int64  `json:"goodTillDate"`
	PriceMatch              string `json:"priceMatch"`
}

UMQueryOrderResponse define query order response

type UMQueryOrderService

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

UMQueryOrderService service to query UM orders

func (*UMQueryOrderService) Do

Do send request

func (*UMQueryOrderService) OrderID

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

OrderID set orderID

func (*UMQueryOrderService) OrigClientOrderID

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

OrigClientOrderID set origClientOrderId

func (*UMQueryOrderService) RecvWindow

func (s *UMQueryOrderService) RecvWindow(recvWindow int64) *UMQueryOrderService

RecvWindow set recvWindow

func (*UMQueryOrderService) Symbol

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

Symbol set symbol

type UMSymbolConfig

type UMSymbolConfig struct {
	Symbol           string `json:"symbol"`
	MarginType       string `json:"marginType"`
	IsAutoAddMargin  bool   `json:"isAutoAddMargin"`
	Leverage         int    `json:"leverage"`
	MaxNotionalValue string `json:"maxNotionalValue"`
}

UMSymbolConfig define UM futures symbol configuration

type UMSymbolConfigService

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

UMSymbolConfigService get UM futures symbol configuration

func (*UMSymbolConfigService) Do

Do send request

func (*UMSymbolConfigService) Symbol

Symbol set symbol

type UMTradeDownloadLink struct {
	DownloadID          string `json:"downloadId"`
	Status              string `json:"status"` // Enum:completed,processing
	URL                 string `json:"url"`    // The link is mapped to download id
	S3Link              string `json:"s3Link"`
	Notified            bool   `json:"notified"`            // ignore
	ExpirationTimestamp int64  `json:"expirationTimestamp"` // The link would expire after this timestamp
	IsExpired           *bool  `json:"isExpired"`
}

UMTradeDownloadLink define download link response

type UMTradeHistoryDownloadID

type UMTradeHistoryDownloadID struct {
	AvgCostTimestampOfLast30d int64  `json:"avgCostTimestampOfLast30d"`
	DownloadID                string `json:"downloadId"`
}

UMTradeHistoryDownloadID define download id response

type UMTransactionDownloadLink struct {
	DownloadID          string `json:"downloadId"`
	Status              string `json:"status"` // Enum:completed,processing
	URL                 string `json:"url"`    // The link is mapped to download id
	S3Link              string `json:"s3Link"`
	Notified            bool   `json:"notified"`            // ignore
	ExpirationTimestamp int64  `json:"expirationTimestamp"` // The link would expire after this timestamp
	IsExpired           *bool  `json:"isExpired"`
}

UMTransactionDownloadLink define download link response

type UMTransactionHistoryDownloadID

type UMTransactionHistoryDownloadID struct {
	AvgCostTimestampOfLast30d int64  `json:"avgCostTimestampOfLast30d"`
	DownloadID                string `json:"downloadId"`
}

UMTransactionHistoryDownloadID define download id response

type UserDataEventReasonType

type UserDataEventReasonType string

UserDataEventReasonType define reason type for user data event

type UserDataEventType

type UserDataEventType string

UserDataEventType define user data event type

type WorkingType

type WorkingType string

WorkingType define working type

Source Files

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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