Path: blob/master/bitget-golang-sdk-api/pkg/client/v1/mixaccountclient.go
518 views
package v112import (3"bitget/internal"4"bitget/internal/common"5)67type MixAccountClient struct {8BitgetRestClient *common.BitgetRestClient9}1011func (p *MixAccountClient) Init() *MixAccountClient {12p.BitgetRestClient = new(common.BitgetRestClient).Init()13return p14}1516func (p *MixAccountClient) Account(params map[string]string) (string, error) {17resp, err := p.BitgetRestClient.DoGet("/api/mix/v1/account/account", params)18return resp, err19}2021func (p *MixAccountClient) Accounts(params map[string]string) (string, error) {22resp, err := p.BitgetRestClient.DoGet("/api/mix/v1/account/accounts", params)23return resp, err24}2526func (p *MixAccountClient) SetLeverage(params map[string]string) (string, error) {27postBody, jsonErr := internal.ToJson(params)28if jsonErr != nil {29return "", jsonErr30}31resp, err := p.BitgetRestClient.DoPost("/api/mix/v1/account/setLeverage", postBody)32return resp, err33}3435func (p *MixAccountClient) SetMargin(params map[string]string) (string, error) {36postBody, jsonErr := internal.ToJson(params)37if jsonErr != nil {38return "", jsonErr39}40resp, err := p.BitgetRestClient.DoPost("/api/mix/v1/account/setMargin", postBody)41return resp, err42}4344func (p *MixAccountClient) SetMarginMode(params map[string]string) (string, error) {45postBody, jsonErr := internal.ToJson(params)46if jsonErr != nil {47return "", jsonErr48}49resp, err := p.BitgetRestClient.DoPost("/api/mix/v1/account/setMarginMode", postBody)50return resp, err51}5253func (p *MixAccountClient) SetPositionMode(params map[string]string) (string, error) {54postBody, jsonErr := internal.ToJson(params)55if jsonErr != nil {56return "", jsonErr57}58resp, err := p.BitgetRestClient.DoPost("/api/mix/v1/account/setPositionMode", postBody)59return resp, err60}6162// position63func (p *MixAccountClient) SinglePosition(params map[string]string) (string, error) {64resp, err := p.BitgetRestClient.DoGet("/api/mix/v1/position/singlePosition", params)65return resp, err66}6768func (p *MixAccountClient) AllPosition(params map[string]string) (string, error) {69resp, err := p.BitgetRestClient.DoGet("/api/mix/v1/position/allPosition", params)70return resp, err71}727374