Binance,Okx: Add Leverage, MarginType, Positions and CollateralMode support (#1220)

* init

* surprise train commit

* basic distinctions

* the terms of binance are confusing

* renames and introduction of allocatedMargin

* add new margin funcs

* pulling out wires

* implement proper getposition stuff

* bad coding day

* investigate order manager next

* a broken mess, but a progressing one

* finally completes some usdtmargined stuff

* coinMfutures eludes me

* expand to okx

* imports fix

* completes okx wrapper implementations

* cleans and polishes before rpc implementations

* rpc setup, order manager features, exch features

* more rpc, collateral and margin things

* mini test

* looking at rpc response, expansion of features

* reorganising before the storm

* changing how futures requests work

* cleanup and tests of cli usage

* remove silly client side logic

* cleanup

* collateral package, typo fix, margin err, rpc derive

* uses convert.StringToFloat ONLY ON STRUCTS FROM THIS PR

* fix binance order history bug

* niteroos

* adds new funcs to exchange standards testing

* more post merge fixes

* fix binance

* replace simepletimeformat

* fix for merge

* merge fixes

* micro fixes

* order side now required for leverage

* fix up the rest

* global -> portfolio collateral

* Update exchanges/collateral/collateral_test.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* adds fields and todos

* rm field redundancy

* lint fix oopsie daisy

* fixes panic, expands error and cli explanations (sorry shaz)

* ensures casing is appropriate for underlying

* Adds a shiny TODO

---------

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
Scott
2023-09-26 16:16:31 +10:00
committed by GitHub
parent a2ae99ed7f
commit 5f2f6f884b
67 changed files with 11558 additions and 4475 deletions

View File

@@ -113,7 +113,8 @@ const (
GoCryptoTraderService_CurrencyStateDeposit_FullMethodName = "/gctrpc.GoCryptoTraderService/CurrencyStateDeposit"
GoCryptoTraderService_CurrencyStateWithdraw_FullMethodName = "/gctrpc.GoCryptoTraderService/CurrencyStateWithdraw"
GoCryptoTraderService_CurrencyStateTradingPair_FullMethodName = "/gctrpc.GoCryptoTraderService/CurrencyStateTradingPair"
GoCryptoTraderService_GetFuturesPositions_FullMethodName = "/gctrpc.GoCryptoTraderService/GetFuturesPositions"
GoCryptoTraderService_GetFuturesPositionsSummary_FullMethodName = "/gctrpc.GoCryptoTraderService/GetFuturesPositionsSummary"
GoCryptoTraderService_GetFuturesPositionsOrders_FullMethodName = "/gctrpc.GoCryptoTraderService/GetFuturesPositionsOrders"
GoCryptoTraderService_GetCollateral_FullMethodName = "/gctrpc.GoCryptoTraderService/GetCollateral"
GoCryptoTraderService_Shutdown_FullMethodName = "/gctrpc.GoCryptoTraderService/Shutdown"
GoCryptoTraderService_GetTechnicalAnalysis_FullMethodName = "/gctrpc.GoCryptoTraderService/GetTechnicalAnalysis"
@@ -125,6 +126,12 @@ const (
GoCryptoTraderService_GetOrderbookMovement_FullMethodName = "/gctrpc.GoCryptoTraderService/GetOrderbookMovement"
GoCryptoTraderService_GetOrderbookAmountByNominal_FullMethodName = "/gctrpc.GoCryptoTraderService/GetOrderbookAmountByNominal"
GoCryptoTraderService_GetOrderbookAmountByImpact_FullMethodName = "/gctrpc.GoCryptoTraderService/GetOrderbookAmountByImpact"
GoCryptoTraderService_GetCollateralMode_FullMethodName = "/gctrpc.GoCryptoTraderService/GetCollateralMode"
GoCryptoTraderService_GetLeverage_FullMethodName = "/gctrpc.GoCryptoTraderService/GetLeverage"
GoCryptoTraderService_SetCollateralMode_FullMethodName = "/gctrpc.GoCryptoTraderService/SetCollateralMode"
GoCryptoTraderService_SetMarginType_FullMethodName = "/gctrpc.GoCryptoTraderService/SetMarginType"
GoCryptoTraderService_SetLeverage_FullMethodName = "/gctrpc.GoCryptoTraderService/SetLeverage"
GoCryptoTraderService_ChangePositionMargin_FullMethodName = "/gctrpc.GoCryptoTraderService/ChangePositionMargin"
)
// GoCryptoTraderServiceClient is the client API for GoCryptoTraderService service.
@@ -225,7 +232,8 @@ type GoCryptoTraderServiceClient interface {
CurrencyStateDeposit(ctx context.Context, in *CurrencyStateDepositRequest, opts ...grpc.CallOption) (*GenericResponse, error)
CurrencyStateWithdraw(ctx context.Context, in *CurrencyStateWithdrawRequest, opts ...grpc.CallOption) (*GenericResponse, error)
CurrencyStateTradingPair(ctx context.Context, in *CurrencyStateTradingPairRequest, opts ...grpc.CallOption) (*GenericResponse, error)
GetFuturesPositions(ctx context.Context, in *GetFuturesPositionsRequest, opts ...grpc.CallOption) (*GetFuturesPositionsResponse, error)
GetFuturesPositionsSummary(ctx context.Context, in *GetFuturesPositionsSummaryRequest, opts ...grpc.CallOption) (*GetFuturesPositionsSummaryResponse, error)
GetFuturesPositionsOrders(ctx context.Context, in *GetFuturesPositionsOrdersRequest, opts ...grpc.CallOption) (*GetFuturesPositionsOrdersResponse, error)
GetCollateral(ctx context.Context, in *GetCollateralRequest, opts ...grpc.CallOption) (*GetCollateralResponse, error)
Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
GetTechnicalAnalysis(ctx context.Context, in *GetTechnicalAnalysisRequest, opts ...grpc.CallOption) (*GetTechnicalAnalysisResponse, error)
@@ -237,6 +245,12 @@ type GoCryptoTraderServiceClient interface {
GetOrderbookMovement(ctx context.Context, in *GetOrderbookMovementRequest, opts ...grpc.CallOption) (*GetOrderbookMovementResponse, error)
GetOrderbookAmountByNominal(ctx context.Context, in *GetOrderbookAmountByNominalRequest, opts ...grpc.CallOption) (*GetOrderbookAmountByNominalResponse, error)
GetOrderbookAmountByImpact(ctx context.Context, in *GetOrderbookAmountByImpactRequest, opts ...grpc.CallOption) (*GetOrderbookAmountByImpactResponse, error)
GetCollateralMode(ctx context.Context, in *GetCollateralModeRequest, opts ...grpc.CallOption) (*GetCollateralModeResponse, error)
GetLeverage(ctx context.Context, in *GetLeverageRequest, opts ...grpc.CallOption) (*GetLeverageResponse, error)
SetCollateralMode(ctx context.Context, in *SetCollateralModeRequest, opts ...grpc.CallOption) (*SetCollateralModeResponse, error)
SetMarginType(ctx context.Context, in *SetMarginTypeRequest, opts ...grpc.CallOption) (*SetMarginTypeResponse, error)
SetLeverage(ctx context.Context, in *SetLeverageRequest, opts ...grpc.CallOption) (*SetLeverageResponse, error)
ChangePositionMargin(ctx context.Context, in *ChangePositionMarginRequest, opts ...grpc.CallOption) (*ChangePositionMarginResponse, error)
}
type goCryptoTraderServiceClient struct {
@@ -1231,9 +1245,18 @@ func (c *goCryptoTraderServiceClient) CurrencyStateTradingPair(ctx context.Conte
return out, nil
}
func (c *goCryptoTraderServiceClient) GetFuturesPositions(ctx context.Context, in *GetFuturesPositionsRequest, opts ...grpc.CallOption) (*GetFuturesPositionsResponse, error) {
out := new(GetFuturesPositionsResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetFuturesPositions_FullMethodName, in, out, opts...)
func (c *goCryptoTraderServiceClient) GetFuturesPositionsSummary(ctx context.Context, in *GetFuturesPositionsSummaryRequest, opts ...grpc.CallOption) (*GetFuturesPositionsSummaryResponse, error) {
out := new(GetFuturesPositionsSummaryResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetFuturesPositionsSummary_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *goCryptoTraderServiceClient) GetFuturesPositionsOrders(ctx context.Context, in *GetFuturesPositionsOrdersRequest, opts ...grpc.CallOption) (*GetFuturesPositionsOrdersResponse, error) {
out := new(GetFuturesPositionsOrdersResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetFuturesPositionsOrders_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -1339,6 +1362,60 @@ func (c *goCryptoTraderServiceClient) GetOrderbookAmountByImpact(ctx context.Con
return out, nil
}
func (c *goCryptoTraderServiceClient) GetCollateralMode(ctx context.Context, in *GetCollateralModeRequest, opts ...grpc.CallOption) (*GetCollateralModeResponse, error) {
out := new(GetCollateralModeResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetCollateralMode_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *goCryptoTraderServiceClient) GetLeverage(ctx context.Context, in *GetLeverageRequest, opts ...grpc.CallOption) (*GetLeverageResponse, error) {
out := new(GetLeverageResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetLeverage_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *goCryptoTraderServiceClient) SetCollateralMode(ctx context.Context, in *SetCollateralModeRequest, opts ...grpc.CallOption) (*SetCollateralModeResponse, error) {
out := new(SetCollateralModeResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_SetCollateralMode_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *goCryptoTraderServiceClient) SetMarginType(ctx context.Context, in *SetMarginTypeRequest, opts ...grpc.CallOption) (*SetMarginTypeResponse, error) {
out := new(SetMarginTypeResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_SetMarginType_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *goCryptoTraderServiceClient) SetLeverage(ctx context.Context, in *SetLeverageRequest, opts ...grpc.CallOption) (*SetLeverageResponse, error) {
out := new(SetLeverageResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_SetLeverage_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *goCryptoTraderServiceClient) ChangePositionMargin(ctx context.Context, in *ChangePositionMarginRequest, opts ...grpc.CallOption) (*ChangePositionMarginResponse, error) {
out := new(ChangePositionMarginResponse)
err := c.cc.Invoke(ctx, GoCryptoTraderService_ChangePositionMargin_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// GoCryptoTraderServiceServer is the server API for GoCryptoTraderService service.
// All implementations must embed UnimplementedGoCryptoTraderServiceServer
// for forward compatibility
@@ -1437,7 +1514,8 @@ type GoCryptoTraderServiceServer interface {
CurrencyStateDeposit(context.Context, *CurrencyStateDepositRequest) (*GenericResponse, error)
CurrencyStateWithdraw(context.Context, *CurrencyStateWithdrawRequest) (*GenericResponse, error)
CurrencyStateTradingPair(context.Context, *CurrencyStateTradingPairRequest) (*GenericResponse, error)
GetFuturesPositions(context.Context, *GetFuturesPositionsRequest) (*GetFuturesPositionsResponse, error)
GetFuturesPositionsSummary(context.Context, *GetFuturesPositionsSummaryRequest) (*GetFuturesPositionsSummaryResponse, error)
GetFuturesPositionsOrders(context.Context, *GetFuturesPositionsOrdersRequest) (*GetFuturesPositionsOrdersResponse, error)
GetCollateral(context.Context, *GetCollateralRequest) (*GetCollateralResponse, error)
Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
GetTechnicalAnalysis(context.Context, *GetTechnicalAnalysisRequest) (*GetTechnicalAnalysisResponse, error)
@@ -1449,6 +1527,12 @@ type GoCryptoTraderServiceServer interface {
GetOrderbookMovement(context.Context, *GetOrderbookMovementRequest) (*GetOrderbookMovementResponse, error)
GetOrderbookAmountByNominal(context.Context, *GetOrderbookAmountByNominalRequest) (*GetOrderbookAmountByNominalResponse, error)
GetOrderbookAmountByImpact(context.Context, *GetOrderbookAmountByImpactRequest) (*GetOrderbookAmountByImpactResponse, error)
GetCollateralMode(context.Context, *GetCollateralModeRequest) (*GetCollateralModeResponse, error)
GetLeverage(context.Context, *GetLeverageRequest) (*GetLeverageResponse, error)
SetCollateralMode(context.Context, *SetCollateralModeRequest) (*SetCollateralModeResponse, error)
SetMarginType(context.Context, *SetMarginTypeRequest) (*SetMarginTypeResponse, error)
SetLeverage(context.Context, *SetLeverageRequest) (*SetLeverageResponse, error)
ChangePositionMargin(context.Context, *ChangePositionMarginRequest) (*ChangePositionMarginResponse, error)
mustEmbedUnimplementedGoCryptoTraderServiceServer()
}
@@ -1738,8 +1822,11 @@ func (UnimplementedGoCryptoTraderServiceServer) CurrencyStateWithdraw(context.Co
func (UnimplementedGoCryptoTraderServiceServer) CurrencyStateTradingPair(context.Context, *CurrencyStateTradingPairRequest) (*GenericResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CurrencyStateTradingPair not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) GetFuturesPositions(context.Context, *GetFuturesPositionsRequest) (*GetFuturesPositionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetFuturesPositions not implemented")
func (UnimplementedGoCryptoTraderServiceServer) GetFuturesPositionsSummary(context.Context, *GetFuturesPositionsSummaryRequest) (*GetFuturesPositionsSummaryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetFuturesPositionsSummary not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) GetFuturesPositionsOrders(context.Context, *GetFuturesPositionsOrdersRequest) (*GetFuturesPositionsOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetFuturesPositionsOrders not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) GetCollateral(context.Context, *GetCollateralRequest) (*GetCollateralResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCollateral not implemented")
@@ -1774,6 +1861,24 @@ func (UnimplementedGoCryptoTraderServiceServer) GetOrderbookAmountByNominal(cont
func (UnimplementedGoCryptoTraderServiceServer) GetOrderbookAmountByImpact(context.Context, *GetOrderbookAmountByImpactRequest) (*GetOrderbookAmountByImpactResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrderbookAmountByImpact not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) GetCollateralMode(context.Context, *GetCollateralModeRequest) (*GetCollateralModeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCollateralMode not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) GetLeverage(context.Context, *GetLeverageRequest) (*GetLeverageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetLeverage not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) SetCollateralMode(context.Context, *SetCollateralModeRequest) (*SetCollateralModeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetCollateralMode not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) SetMarginType(context.Context, *SetMarginTypeRequest) (*SetMarginTypeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetMarginType not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) SetLeverage(context.Context, *SetLeverageRequest) (*SetLeverageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetLeverage not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) ChangePositionMargin(context.Context, *ChangePositionMarginRequest) (*ChangePositionMarginResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangePositionMargin not implemented")
}
func (UnimplementedGoCryptoTraderServiceServer) mustEmbedUnimplementedGoCryptoTraderServiceServer() {}
// UnsafeGoCryptoTraderServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -3497,20 +3602,38 @@ func _GoCryptoTraderService_CurrencyStateTradingPair_Handler(srv interface{}, ct
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_GetFuturesPositions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetFuturesPositionsRequest)
func _GoCryptoTraderService_GetFuturesPositionsSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetFuturesPositionsSummaryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).GetFuturesPositions(ctx, in)
return srv.(GoCryptoTraderServiceServer).GetFuturesPositionsSummary(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_GetFuturesPositions_FullMethodName,
FullMethod: GoCryptoTraderService_GetFuturesPositionsSummary_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).GetFuturesPositions(ctx, req.(*GetFuturesPositionsRequest))
return srv.(GoCryptoTraderServiceServer).GetFuturesPositionsSummary(ctx, req.(*GetFuturesPositionsSummaryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_GetFuturesPositionsOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetFuturesPositionsOrdersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).GetFuturesPositionsOrders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_GetFuturesPositionsOrders_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).GetFuturesPositionsOrders(ctx, req.(*GetFuturesPositionsOrdersRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -3713,6 +3836,114 @@ func _GoCryptoTraderService_GetOrderbookAmountByImpact_Handler(srv interface{},
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_GetCollateralMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCollateralModeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).GetCollateralMode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_GetCollateralMode_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).GetCollateralMode(ctx, req.(*GetCollateralModeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_GetLeverage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetLeverageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).GetLeverage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_GetLeverage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).GetLeverage(ctx, req.(*GetLeverageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_SetCollateralMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetCollateralModeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).SetCollateralMode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_SetCollateralMode_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).SetCollateralMode(ctx, req.(*SetCollateralModeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_SetMarginType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetMarginTypeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).SetMarginType(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_SetMarginType_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).SetMarginType(ctx, req.(*SetMarginTypeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_SetLeverage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetLeverageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).SetLeverage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_SetLeverage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).SetLeverage(ctx, req.(*SetLeverageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GoCryptoTraderService_ChangePositionMargin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangePositionMarginRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GoCryptoTraderServiceServer).ChangePositionMargin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GoCryptoTraderService_ChangePositionMargin_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GoCryptoTraderServiceServer).ChangePositionMargin(ctx, req.(*ChangePositionMarginRequest))
}
return interceptor(ctx, in, info, handler)
}
// GoCryptoTraderService_ServiceDesc is the grpc.ServiceDesc for GoCryptoTraderService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -4073,8 +4304,12 @@ var GoCryptoTraderService_ServiceDesc = grpc.ServiceDesc{
Handler: _GoCryptoTraderService_CurrencyStateTradingPair_Handler,
},
{
MethodName: "GetFuturesPositions",
Handler: _GoCryptoTraderService_GetFuturesPositions_Handler,
MethodName: "GetFuturesPositionsSummary",
Handler: _GoCryptoTraderService_GetFuturesPositionsSummary_Handler,
},
{
MethodName: "GetFuturesPositionsOrders",
Handler: _GoCryptoTraderService_GetFuturesPositionsOrders_Handler,
},
{
MethodName: "GetCollateral",
@@ -4120,6 +4355,30 @@ var GoCryptoTraderService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetOrderbookAmountByImpact",
Handler: _GoCryptoTraderService_GetOrderbookAmountByImpact_Handler,
},
{
MethodName: "GetCollateralMode",
Handler: _GoCryptoTraderService_GetCollateralMode_Handler,
},
{
MethodName: "GetLeverage",
Handler: _GoCryptoTraderService_GetLeverage_Handler,
},
{
MethodName: "SetCollateralMode",
Handler: _GoCryptoTraderService_SetCollateralMode_Handler,
},
{
MethodName: "SetMarginType",
Handler: _GoCryptoTraderService_SetMarginType_Handler,
},
{
MethodName: "SetLeverage",
Handler: _GoCryptoTraderService_SetLeverage_Handler,
},
{
MethodName: "ChangePositionMargin",
Handler: _GoCryptoTraderService_ChangePositionMargin_Handler,
},
},
Streams: []grpc.StreamDesc{
{