types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllFuturesInfo

type AllFuturesInfo struct {
	Success   bool          `json:"success"`
	Rows      []FuturesInfo `json:"rows"`
	Timestamp int64         `json:"timestamp"`
}

type AssetHisotryResp

type AssetHisotryResp struct {
	Response
	Meta struct {
		RecordsPerPage int `json:"records_per_page"`
		CurrentPage    int `json:"current_page"`
	} `json:"meta"`
	Rows []Hisotry `json:"rows"`
}

type AvailableSymbols

type AvailableSymbols struct {
	Response
	Rows []struct {
		Symbol      string  `json:"symbol"`
		QuoteMin    float64 `json:"quote_min"`
		QuoteMax    float64 `json:"quote_max"`
		QuoteTick   float64 `json:"quote_tick"`
		BaseMin     float64 `json:"base_min"`
		BaseMax     float64 `json:"base_max"`
		BaseTick    float64 `json:"base_tick"`
		MinNotional float64 `json:"min_notional"`
		PriceRange  float64 `json:"price_range"`
		PriceScope  float64 `json:"price_scope"`
		CreatedTime string  `json:"created_time"`
		UpdatedTime string  `json:"updated_time"`
		IsStable    int     `json:"is_stable"`
	} `json:"rows"`
}

type Balance

type Balance struct {
	Response
	Data struct {
		Holding []struct {
			Token            string  `json:"token"`
			Holding          float64 `json:"holding"`
			Frozen           float64 `json:"frozen"`
			Staked           float64 `json:"staked"`
			Unbonding        float64 `json:"unbonding"`
			Vault            float64 `json:"vault"`
			Interest         float64 `json:"interest"`
			PendingShortQty  float64 `json:"pendingShortQty"`
			PendingLongQty   float64 `json:"pendingLongQty"`
			AvailableBalance float64 `json:"availableBalance"`
			UpdatedTime      float64 `json:"updatedTime"`
		} `json:"holding"`
	} `json:"data"`
	Timestamp int64 `json:"timestamp"`
}

type CancelOrderByClientOrderIDParam

type CancelOrderByClientOrderIDParam struct {
	Symbol        string `url:"symbol" validate:"required"`
	ClientOrderID int64  `url:"client_order_id" validate:"required"`
}

type CancelOrderParam

type CancelOrderParam struct {
	Symbol  string `url:"symbol" validate:"required"`
	OrderID int64  `url:"order_id" validate:"required"`
}

type CancelOrderResp

type CancelOrderResp struct {
	Response
	Status string `json:"status"`
}

type CancelOrdersParam

type CancelOrdersParam struct {
	Symbol string `url:"symbol" validate:"required"`
}

type FundingRate

type FundingRate struct {
	Response
	SymbolFundingRate
	Timestamp int64 `json:"timestamp"`
}

type FundingRates

type FundingRates struct {
	Success   bool                `json:"success"`
	Rows      []SymbolFundingRate `json:"rows"`
	Timestamp int64               `json:"timestamp"`
}

type FuturesInfo

type FuturesInfo struct {
	Symbol          string  `json:"symbol"`
	IndexPrice      float64 `json:"index_price"`
	MarkPrice       float64 `json:"mark_price"`
	EstFundingRate  float64 `json:"est_funding_rate"`
	LastFundingRate float64 `json:"last_funding_rate"`
	NextFundingTime int64   `json:"next_funding_time"`
	OpenInterest    float64 `json:"open_interest"`
	Two4HOpen       float64 `json:"24h_open"`
	Two4HClose      float64 `json:"24h_close"`
	Two4HHigh       float64 `json:"24h_high"`
	Two4HLow        float64 `json:"24h_low"`
	Two4HVolume     float64 `json:"24h_volume"`
	Two4HAmount     float64 `json:"24h_amount"`
}

type GetAccountInfo

type GetAccountInfo struct {
	Response
	Data struct {
		ApplicationID          string  `json:"applicationId"`
		Account                string  `json:"account"`
		Alias                  string  `json:"alias"`
		AccountMode            string  `json:"accountMode"`
		Leverage               int     `json:"leverage"`
		TakerFeeRate           float64 `json:"takerFeeRate"`
		MakerFeeRate           float64 `json:"makerFeeRate"`
		InterestRate           float64 `json:"interestRate"`
		FuturesTakerFeeRate    float64 `json:"futuresTakerFeeRate"`
		FuturesMakerFeeRate    float64 `json:"futuresMakerFeeRate"`
		Otpauth                bool    `json:"otpauth"`
		MarginRatio            float64 `json:"marginRatio"`
		OpenMarginRatio        float64 `json:"openMarginRatio"`
		InitialMarginRatio     float64 `json:"initialMarginRatio"`
		MaintenanceMarginRatio float64 `json:"maintenanceMarginRatio"`
		TotalCollateral        float64 `json:"totalCollateral"`
		FreeCollateral         float64 `json:"freeCollateral"`
		TotalAccountValue      float64 `json:"totalAccountValue"`
		TotalVaultValue        float64 `json:"totalVaultValue"`
		TotalStakingValue      float64 `json:"totalStakingValue"`
	} `json:"data"`
	Timestamp int64 `json:"timestamp"`
}

type GetAllV3PositionInfo

type GetAllV3PositionInfo struct {
	Response
	Data struct {
		Positions []V3Position `json:"positions"`
	} `json:"data"`
	Timestamp int64 `json:"timestamp"`
}

type GetAssetHisotryParam

type GetAssetHisotryParam struct {
	Token        string `url:"token,omitempty"`
	BalanceToken string `url:"balance_token,omitempty"`
	Type         string `url:"type,omitempty"`
	TokenSide    string `url:"token_side,omitempty"`
	Status       string `url:"status,omitempty"`
	StartTime    int64  `url:"start_t,omitempty" validate:"omitempty,gt=999999999999"`
	EndTime      int64  `url:"end_t,omitempty" validate:"omitempty,gt=999999999999"`
	Page         int64  `url:"page,omitempty"`
	Size         int64  `url:"size,omitempty"`
}

type GetKlineParam

type GetKlineParam struct {
	Symbol string `url:"symbol" validate:"required"`
	Type   string `url:"type" validate:"required,oneof=1m 5m 15m 30m 1h 4h 12h 1d 1w 1mon 1y"`
	Limit  int    `url:"limit,omitempty" validate:"max=1000"`
}

type GetMarketTradesParam

type GetMarketTradesParam struct {
	Symbol string `url:"symbol" validate:"required"`
	Limit  int    `url:"limit,omitempty"`
}

type GetOnePositionInfo

type GetOnePositionInfo struct {
	Response
	V1Position
}

type GetOrder

type GetOrder struct {
	Response
	Order
}

type GetOrderbookParam

type GetOrderbookParam struct {
	MaxLevel int `url:"max_level,omitempty"`
}

type GetOrders

type GetOrders struct {
	Response
	Meta struct {
		Total          int `json:"total"`
		RecordsPerPage int `json:"records_per_page"`
		CurrentPage    int `json:"current_page"`
	} `json:"meta"`
	Rows []Order `json:"rows"`
}

type GetOrdersParam

type GetOrdersParam struct {
	Symbol    string `url:"symbol,omitempty"`
	Side      string `url:"side,omitempty" validate:"omitempty,oneof=SELL BUY"`
	Size      int64  `url:"size,omitempty" validate:"omitempty,max=500"`
	OrderType string `url:"order_type,omitempty" validate:"omitempty,oneof=LIMIT MARKET IOC FOK POST_ONLY LIQUIDATE"`
	OrderTag  string `url:"order_tag,omitempty" validate:"omitempty"`
	Status    string `url:"status,omitempty" validate:"omitempty,oneof=NEW CANCELLED PARTIAL_FILLED FILLED REJECTED INCOMPLETE COMPLETED"`
	StartTime int64  `url:"start_t,omitempty" validate:"omitempty,gt=999999999999"`
	EndTime   int64  `url:"end_t,omitempty" validate:"omitempty,gt=999999999999"`
	Page      int64  `url:"page,omitempty" validate:"omitempty"`
}

type GetTrade

type GetTrade struct {
	Response
	Trade
}

type GetTradeHistory

type GetTradeHistory struct {
	Response
	Meta struct {
		Total          int `json:"total"`
		RecordsPerPage int `json:"records_per_page"`
		CurrentPage    int `json:"current_page"`
	} `json:"meta"`
	Rows []Trade `json:"rows"`
}

type GetTradeHistoryParam

type GetTradeHistoryParam struct {
	Symbol    string `url:"symbol,omitempty"`
	OrderTag  string `url:"order_tag,omitempty" validate:"omitempty"`
	StartTime int64  `url:"start_t,omitempty" validate:"omitempty,gt=999999999999"`
	EndTime   int64  `url:"end_t,omitempty" validate:"omitempty,gt=999999999999"`
	Page      int64  `url:"page,omitempty" validate:"omitempty"`
	Size      int64  `url:"size,omitempty" validate:"omitempty"`
}

type GetTrades

type GetTrades struct {
	Response
	Rows []Trade `json:"rows"`
}

type HTTPRequest

type HTTPRequest struct {
	URL     string
	Path    string
	Method  string
	Headers map[string]string
	Query   any
	Body    any
	Debug   bool
}

type Hisotry

type Hisotry struct {
	CreatedTime         string  `json:"created_time"`
	UpdatedTime         string  `json:"updated_time"`
	ID                  string  `json:"id"`
	ExternalID          string  `json:"external_id"`
	ApplicationID       string  `json:"application_id"`
	Token               string  `json:"token"`
	TargetAddress       string  `json:"target_address"`
	SourceAddress       string  `json:"source_address"`
	ConfirmingThreshold int     `json:"confirming_threshold"`
	ConfirmedNumber     int     `json:"confirmed_number"`
	Extra               string  `json:"extra"`
	Type                string  `json:"type"`
	TokenSide           string  `json:"token_side"`
	Amount              float64 `json:"amount"`
	TxID                string  `json:"tx_id"`
	FeeToken            string  `json:"fee_token"`
	FeeAmount           float64 `json:"fee_amount"`
	Status              string  `json:"status"`
}

type IPRestriction

type IPRestriction struct {
	Response
	Rows []struct {
		IPList     string `json:"ip_list"`
		APIKey     string `json:"api_key"`
		UpdateTime string `json:"update_time"`
		Restrict   bool   `json:"restrict"`
	} `json:"rows"`
	Meta struct {
		Total          int `json:"total"`
		RecordsPerPage int `json:"records_per_page"`
		CurrentPage    int `json:"current_page"`
	} `json:"meta"`
}

type Kline

type Kline struct {
	Response
	Rows []struct {
		Open           float64 `json:"open"`
		Close          float64 `json:"close"`
		Low            float64 `json:"low"`
		High           float64 `json:"high"`
		Volume         float64 `json:"volume"`
		Amount         float64 `json:"amount"`
		Symbol         string  `json:"symbol"`
		Type           string  `json:"type"`
		StartTimestamp int64   `json:"start_timestamp"`
		EndTimestamp   int64   `json:"end_timestamp"`
	} `json:"rows"`
}

type MarketTrade

type MarketTrade struct {
	Response
	Rows []struct {
		Symbol            string  `json:"symbol"`
		Side              string  `json:"side"`
		ExecutedPrice     float64 `json:"executed_price"`
		ExecutedQuantity  float64 `json:"executed_quantity"`
		ExecutedTimestamp string  `json:"executed_timestamp"`
		Source            int     `json:"source"`
	} `json:"rows"`
}

type OneFuturesInfo

type OneFuturesInfo struct {
	Response
	Info      FuturesInfo `json:"info"`
	Timestamp int64       `json:"timestamp"`
}

type Order

type Order struct {
	Side                 string  `json:"side"`
	Status               string  `json:"status"`
	Symbol               string  `json:"symbol"`
	ClientOrderID        int     `json:"client_order_id"`
	ReduceOnly           bool    `json:"reduce_only"`
	OrderID              int     `json:"order_id"`
	OrderTag             string  `json:"order_tag"`
	Type                 string  `json:"type"`
	Price                float64 `json:"price"`
	Quantity             float64 `json:"quantity"`
	Amount               float64 `json:"amount"`
	Visible              float64 `json:"visible"`
	Executed             float64 `json:"executed"`
	TotalFee             float64 `json:"total_fee"`
	FeeAsset             string  `json:"fee_asset"`
	CreatedTime          string  `json:"created_time"`
	UpdatedTime          string  `json:"updated_time"`
	AverageExecutedPrice float64 `json:"average_executed_price"`
	RealizedPnl          float64 `json:"realized_pnl"`
}

type Orderbook

type Orderbook struct {
	Response
	Asks []struct {
		Price    float64 `json:"price"`
		Quantity float64 `json:"quantity"`
	} `json:"asks"`
	Bids []struct {
		Price    float64 `json:"price"`
		Quantity float64 `json:"quantity"`
	} `json:"bids"`
	Timestamp int64 `json:"timestamp"`
}

type Response

type Response struct {
	Success bool   `json:"success"`
	Code    int    `json:"code"`
	Message string `json:"messsage"`
}

type SendOrderReq

type SendOrderReq struct {
	Symbol          string  `url:"symbol" validate:"required"`
	ClientOrderID   int64   `url:"client_order_id,omitempty"`
	OrderTag        string  `url:"order_tag,omitempty"`
	OrderType       string  `url:"order_type" validate:"required,oneof=LIMIT MARKET IOC FOK POST_ONLY ASK BID"`
	OrderPrice      float64 `url:"order_price,omitempty"`
	OrderQuantity   float64 `url:"order_quantity,omitempty"`
	OrderAmount     float64 `url:"order_amount,omitempty"`
	ReduceOnly      bool    `url:"reduce_only,omitempty"`
	VisibleQuantity float64 `url:"visible_quantity,omitempty"`
	Side            string  `url:"side" validate:"required,oneof=SELL BUY"`
}

type SendOrderResp

type SendOrderResp struct {
	Response
	OrderID       int     `json:"order_id"`
	ClientOrderID int     `json:"client_order_id"`
	OrderType     string  `json:"order_type"`
	OrderPrice    float64 `json:"order_price"`
	OrderQuantity float64 `json:"order_quantity"`
	OrderAmount   float64 `json:"order_amount"`
	ReduceOnly    bool    `json:"reduce_only"`
	Timestamp     string  `json:"timestamp"`
}

type SubAccounts

type SubAccounts struct {
	Response
	Rows []struct {
		ApplicationID string `json:"application_id"`
		Account       string `json:"account"`
		CreatedTime   string `json:"created_time"`
	} `json:"rows"`
}

type SymbolFundingRate

type SymbolFundingRate struct {
	Symbol                   string  `json:"symbol"`
	EstFundingRate           float64 `json:"est_funding_rate"`
	EstFundingRateTimestamp  int64   `json:"est_funding_rate_timestamp"`
	LastFundingRate          float64 `json:"last_funding_rate"`
	LastFundingRateTimestamp int64   `json:"last_funding_rate_timestamp"`
	NextFundingTime          int64   `json:"next_funding_time"`
	LastFundingRateInterval  int     `json:"last_funding_rate_interval"`
	EstFundingRateInterval   int     `json:"est_funding_rate_interval"`
}

type SymbolInfo

type SymbolInfo struct {
	Response
	Info struct {
		Symbol      string  `json:"symbol"`
		QuoteMin    float64 `json:"quote_min"`
		QuoteMax    float64 `json:"quote_max"`
		QuoteTick   float64 `json:"quote_tick"`
		BaseMin     float64 `json:"base_min"`
		BaseMax     float64 `json:"base_max"`
		BaseTick    float64 `json:"base_tick"`
		MinNotional float64 `json:"min_notional"`
		PriceRange  float64 `json:"price_range"`
		PriceScope  float64 `json:"price_scope"`
		CreatedTime string  `json:"created_time"`
		UpdatedTime string  `json:"updated_time"`
		IsStable    int     `json:"is_stable"`
	} `json:"info"`
}

type Tokens

type Tokens struct {
	Response
	Rows []struct {
		Token         string `json:"token"`
		Fullname      string `json:"fullname"`
		Decimals      int    `json:"decimals"`
		BalanceToken  string `json:"balance_token"`
		CreatedTime   string `json:"created_time"`
		UpdatedTime   string `json:"updated_time"`
		CanCollateral bool   `json:"can_collateral"`
		CanShort      bool   `json:"can_short"`
	} `json:"rows"`
}

type Trade

type Trade struct {
	ID                int     `json:"id"`
	Symbol            string  `json:"symbol"`
	OrderID           int     `json:"order_id"`
	OrderTag          string  `json:"order_tag"`
	ExecutedPrice     float64 `json:"executed_price"`
	ExecutedQuantity  float64 `json:"executed_quantity"`
	IsMaker           int     `json:"is_maker"`
	Side              string  `json:"side"`
	Fee               float64 `json:"fee"`
	FeeAsset          string  `json:"fee_asset"`
	ExecutedTimestamp string  `json:"executed_timestamp"`
}

type TransferAssetParam

type TransferAssetParam struct {
	Token     string  `url:"token" validate:"required"`
	Amount    float64 `url:"amount" validate:"required"`
	FromAppID string  `url:"from_application_id" validate:"required"`
	ToAppID   string  `url:"to_application_id" validate:"required"`
}

type TransferAssetResp

type TransferAssetResp struct {
	Response
	ID int64 `json:"id"`
}

type UpdateAccountModeParam

type UpdateAccountModeParam struct {
	AccountMode string `url:"account_mode" json:"account_mode" validate:"required,oneof=PURE_SPOT MARGIN FUTURES"`
}

type UpdateLeverageSettingParam

type UpdateLeverageSettingParam struct {
	Leverage int64 `url:"leverage" validate:"required,oneof=1 2 3 4 5 10 15 20"`
}

type V1Position

type V1Position struct {
	Symbol           string  `json:"symbol"`
	Holding          float64 `json:"holding"`
	PendingLongQty   float64 `json:"pending_long_qty"`
	PendingShortQty  float64 `json:"pending_short_qty"`
	SettlePrice      float64 `json:"settle_price"`
	AverageOpenPrice float64 `json:"average_open_price"`
	Pnl24H           float64 `json:"pnl_24_h"`
	Fee24H           float64 `json:"fee_24_h"`
	MarkPrice        float64 `json:"mark_price"`
	EstLiqPrice      float64 `json:"est_liq_price"`
	Timestamp        string  `json:"timestamp"`
}

type V3Position

type V3Position struct {
	Symbol           string  `json:"symbol"`
	Holding          float64 `json:"holding"`
	PendingLongQty   float64 `json:"pending_long_qty"`
	PendingShortQty  float64 `json:"pending_short_qty"`
	SettlePrice      float64 `json:"settle_price"`
	AverageOpenPrice float64 `json:"average_open_price"`
	Pnl24H           float64 `json:"pnl_24_h"`
	Fee24H           float64 `json:"fee_24_h"`
	MarkPrice        float64 `json:"mark_price"`
	EstLiqPrice      float64 `json:"est_liq_price"`
	Timestamp        float64 `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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