bitget

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

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 12 Imported by: 0

README

bitget-golang-sdk-api

Custom code from a fork of outtoin https://github.com/outtoin/bitget-golang-sdk-api

Custom code from a fork of Bitget Open API V3 SDK https://github.com/BitgetLimited/v3-bitget-api-sdk

Updating Go

sudo rm -rvf /usr/local/go wget https://golang.org/dl/go1.21.1.linux-arm64.tar.gz -O go.tar.gz && tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

client

func NewClient

func NewClient(creds config.InterApiCreds) *Client

func (*Client) GetBrokerService

func (c *Client) GetBrokerService() *broker.BrokerAccountClient

broker

func (*Client) GetMixAccountService

func (c *Client) GetMixAccountService() *mix.MixAccountClient

mix

func (*Client) GetMixMarketService

func (c *Client) GetMixMarketService() *mix.MixMarketClient

func (*Client) GetMixOrderService

func (c *Client) GetMixOrderService() *mix.MixOrderClient

func (*Client) GetMixPlanService

func (c *Client) GetMixPlanService() *mix.MixPlanClient

func (*Client) GetMixPositionService

func (c *Client) GetMixPositionService() *mix.MixPositionClient

func (*Client) GetMixTraceService

func (c *Client) GetMixTraceService() *mix.MixTraceClient

func (*Client) GetSpotAccountService

func (c *Client) GetSpotAccountService() *spot.SpotAccountClient

spot

func (*Client) GetSpotMarketService

func (c *Client) GetSpotMarketService() *spot.SpotMarketClient

func (*Client) GetSpotOrderService

func (c *Client) GetSpotOrderService() *spot.SpotOrderClient

func (*Client) GetSpotPublicService

func (c *Client) GetSpotPublicService() *spot.SpotPublicClient

func (*Client) SetHttpClient

func (c *Client) SetHttpClient(client *http.Client) *Client

type InterClient

type InterClient interface {
	GetBrokerService() *broker.BrokerAccountClient
	GetMixAccountService() *mix.MixAccountClient
	GetMixMarketService() *mix.MixMarketClient
	GetMixOrderService() *mix.MixOrderClient
	GetMixPlanService() *mix.MixPlanClient
	GetMixPositionService() *mix.MixPositionClient
	GetMixTraceService() *mix.MixTraceClient
	GetSpotAccountService() *spot.SpotAccountClient
	GetSpotMarketService() *spot.SpotMarketClient
	GetSpotOrderService() *spot.SpotOrderClient
	GetSpotPublicService() *spot.SpotPublicClient
}

type InterRest

type InterRest interface {
	InterRestPublic

	GetApiKeyList(subAccountUid string) (*v2.GetApiKeyList, error)

	GetAccountInfo() (*v2.GetAccountInfo, error)
	GetAccountList(productType string) (*v2.GetAccountList, error)
	GetAllAccountBalance() (*v2.GetAllAccountBalance, error)

	ChangeMarginMode(productType, symbol, marginCoin, marginMode string) (*v2.ChangeMarginMode, error)
	ChangePositionMode(productType, posMode string) (*v2.ChangePositionMode, error)

	GetPendingOrders(productType string) (*v2.GetPendingOrders, error)
	PlaceOrder(productType, symbol, side, size, marginMode, marginCoin, orderType string) (*v2.PlaceOrder, error)
	ModifyOrder(productType, symbol, newClientOid string) (*v2.ModifyOrder, error)
	CancelOrder(productType, symbol string) (*v2.CancelOrder, error)
	ClosePositions(productType string) (*v2.ClosePositions, error)

	AgentCustomerList() (*v1.AgentCustomerList, error)
	AgentCustomerTradeVolumeList() (*v1.AgentCustomerTradeVolumeList, error)
}

type InterRestPublic

type InterRestPublic interface {
	GetContractConfig(productType string) (*v2.GetContractConfig, error)
}

type Rest

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

func NewRest

func NewRest(creds config.InterApiCreds) *Rest

func (*Rest) AgentCustomerList

func (r *Rest) AgentCustomerList() (*v1.AgentCustomerList, error)

func (*Rest) AgentCustomerTradeVolumeList

func (r *Rest) AgentCustomerTradeVolumeList() (*v1.AgentCustomerTradeVolumeList, error)

func (*Rest) CancelOrder

func (r *Rest) CancelOrder(productType, symbol string) (*v2.CancelOrder, error)

func (*Rest) ChangeMarginMode

func (r *Rest) ChangeMarginMode(productType, symbol, marginCoin, marginMode string) (*v2.ChangeMarginMode, error)

func (*Rest) ChangePositionMode

func (r *Rest) ChangePositionMode(productType, posMode string) (*v2.ChangePositionMode, error)

func (*Rest) ClosePositions

func (r *Rest) ClosePositions(productType string) (*v2.ClosePositions, error)

func (*Rest) GetAccountInfo

func (r *Rest) GetAccountInfo() (*v2.GetAccountInfo, error)

func (*Rest) GetAccountList

func (r *Rest) GetAccountList(productType string) (*v2.GetAccountList, error)

func (*Rest) GetAllAccountBalance

func (r *Rest) GetAllAccountBalance() (*v2.GetAllAccountBalance, error)

func (*Rest) GetApiKeyList

func (r *Rest) GetApiKeyList(subAccountUid string) (*v2.GetApiKeyList, error)

func (*Rest) GetContractConfig

func (r *Rest) GetContractConfig(productType string) (*v2.GetContractConfig, error)

func (*Rest) GetPendingOrders

func (r *Rest) GetPendingOrders(productType string) (*v2.GetPendingOrders, error)

order

func (*Rest) ModifyOrder

func (r *Rest) ModifyOrder(productType, symbol, newClientOid string) (*v2.ModifyOrder, error)

func (*Rest) PlaceOrder

func (r *Rest) PlaceOrder(productType, symbol, side, size, marginMode, marginCoin, orderType string) (*v2.PlaceOrder, error)

type UnscribeFunc

type UnscribeFunc func()

type WsClient

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

ws

func NewWsClient

func NewWsClient() *WsClient

func (*WsClient) Close

func (ws *WsClient) Close()

func (*WsClient) Init

func (ws *WsClient) Init(listener common.OnReceive, errorListener common.OnReceive, secure bool, creds config.InterApiCreds) *ws.BitgetWsClient

func (*WsClient) SubscribeForContracts

func (ws *WsClient) SubscribeForContracts(channel string, contracts ...string) UnscribeFunc

func (*WsClient) SubscribeFutures

func (ws *WsClient) SubscribeFutures(listener common.OnReceive, channel string, symbols ...string) UnscribeFunc

futures

func (*WsClient) SubscribeFuturesOrder

func (ws *WsClient) SubscribeFuturesOrder(listener common.OnReceive) UnscribeFunc

func (*WsClient) SubscribeSpot

func (ws *WsClient) SubscribeSpot(channel string, symbols ...string) UnscribeFunc

spot

func (*WsClient) SubscribeSpotAccount

func (ws *WsClient) SubscribeSpotAccount() UnscribeFunc

func (*WsClient) SubscribeSpotOrder

func (ws *WsClient) SubscribeSpotOrder(symbols ...string) UnscribeFunc

Jump to

Keyboard shortcuts

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