mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 15:10:40 +00:00
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:
@@ -4,8 +4,10 @@ deps:
|
||||
- remote: buf.build
|
||||
owner: googleapis
|
||||
repository: googleapis
|
||||
commit: 62f35d8aed1149c291d606d958a7ce32
|
||||
commit: cc916c31859748a68fd229a3c8d7a2e8
|
||||
digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8
|
||||
- remote: buf.build
|
||||
owner: grpc-ecosystem
|
||||
repository: grpc-gateway
|
||||
commit: bc28b723cd774c32b6fbc77621518765
|
||||
commit: a1ecdc58eccd49aa8bea2a7a9022dc27
|
||||
digest: shake256:efdd86fbdc42e8b7259fe461a49656827a03fb7cba0b3b9eb622ca10654ec6beccb9a051229c1553ccd89ed3e95d69ad4d7c799f1da3f3f1bd447b7947a4893e
|
||||
|
||||
7493
gctrpc/rpc.pb.go
7493
gctrpc/rpc.pb.go
File diff suppressed because it is too large
Load Diff
@@ -3024,37 +3024,73 @@ func local_request_GoCryptoTraderService_CurrencyStateTradingPair_0(ctx context.
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_GetFuturesPositions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
filter_GoCryptoTraderService_GetFuturesPositionsSummary_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_GetFuturesPositions_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetFuturesPositionsRequest
|
||||
func request_GoCryptoTraderService_GetFuturesPositionsSummary_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetFuturesPositionsSummaryRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetFuturesPositions_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetFuturesPositionsSummary_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetFuturesPositions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
msg, err := client.GetFuturesPositionsSummary(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_GetFuturesPositions_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetFuturesPositionsRequest
|
||||
func local_request_GoCryptoTraderService_GetFuturesPositionsSummary_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetFuturesPositionsSummaryRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetFuturesPositions_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetFuturesPositionsSummary_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetFuturesPositions(ctx, &protoReq)
|
||||
msg, err := server.GetFuturesPositionsSummary(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_GetFuturesPositionsOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_GetFuturesPositionsOrders_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetFuturesPositionsOrdersRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetFuturesPositionsOrders_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetFuturesPositionsOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_GetFuturesPositionsOrders_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetFuturesPositionsOrdersRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetFuturesPositionsOrders_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetFuturesPositionsOrders(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
@@ -3437,6 +3473,214 @@ func local_request_GoCryptoTraderService_GetOrderbookAmountByImpact_0(ctx contex
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_GetCollateralMode_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_GetCollateralMode_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetCollateralModeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetCollateralMode_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetCollateralMode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_GetCollateralMode_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetCollateralModeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetCollateralMode_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetCollateralMode(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_GetLeverage_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_GetLeverage_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetLeverageRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetLeverage_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetLeverage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_GetLeverage_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetLeverageRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetLeverage_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetLeverage(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_GoCryptoTraderService_SetCollateralMode_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SetCollateralModeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SetCollateralMode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_SetCollateralMode_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SetCollateralModeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SetCollateralMode(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_GoCryptoTraderService_SetMarginType_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SetMarginTypeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SetMarginType(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_SetMarginType_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SetMarginTypeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SetMarginType(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_GoCryptoTraderService_SetLeverage_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SetLeverageRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SetLeverage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_SetLeverage_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SetLeverageRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SetLeverage(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_GoCryptoTraderService_ChangePositionMargin_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ChangePositionMarginRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ChangePositionMargin(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_ChangePositionMargin_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ChangePositionMarginRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ChangePositionMargin(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterGoCryptoTraderServiceHandlerServer registers the http handlers for service GoCryptoTraderService to "mux".
|
||||
// UnaryRPC :call GoCryptoTraderServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
@@ -5685,7 +5929,7 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetFuturesPositions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetFuturesPositionsSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
@@ -5693,12 +5937,12 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetFuturesPositions", runtime.WithHTTPPathPattern("/v1/getfuturespositions"))
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetFuturesPositionsSummary", runtime.WithHTTPPathPattern("/v1/getfuturespositionssummary"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetFuturesPositions_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetFuturesPositionsSummary_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
@@ -5706,7 +5950,32 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetFuturesPositions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_GetFuturesPositionsSummary_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetFuturesPositionsOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetFuturesPositionsOrders", runtime.WithHTTPPathPattern("/v1/getfuturespositionsorders"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetFuturesPositionsOrders_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetFuturesPositionsOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -5985,6 +6254,156 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetCollateralMode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetCollateralMode", runtime.WithHTTPPathPattern("/v1/getcollateralmode"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetCollateralMode_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetCollateralMode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetLeverage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetLeverage", runtime.WithHTTPPathPattern("/v1/getleverage"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetLeverage_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetLeverage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_SetCollateralMode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/SetCollateralMode", runtime.WithHTTPPathPattern("/v1/getcollateralmode"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_SetCollateralMode_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_SetCollateralMode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_SetMarginType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/SetMarginType", runtime.WithHTTPPathPattern("/v1/getmargintype"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_SetMarginType_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_SetMarginType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_SetLeverage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/SetLeverage", runtime.WithHTTPPathPattern("/v1/getleverage"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_SetLeverage_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_SetLeverage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_ChangePositionMargin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/ChangePositionMargin", runtime.WithHTTPPathPattern("/v1/changepositionmargin"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_ChangePositionMargin_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_ChangePositionMargin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -8094,25 +8513,47 @@ func RegisterGoCryptoTraderServiceHandlerClient(ctx context.Context, mux *runtim
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetFuturesPositions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetFuturesPositionsSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetFuturesPositions", runtime.WithHTTPPathPattern("/v1/getfuturespositions"))
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetFuturesPositionsSummary", runtime.WithHTTPPathPattern("/v1/getfuturespositionssummary"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_GetFuturesPositions_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_GoCryptoTraderService_GetFuturesPositionsSummary_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetFuturesPositions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_GetFuturesPositionsSummary_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetFuturesPositionsOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetFuturesPositionsOrders", runtime.WithHTTPPathPattern("/v1/getfuturespositionsorders"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_GetFuturesPositionsOrders_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetFuturesPositionsOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -8358,6 +8799,138 @@ func RegisterGoCryptoTraderServiceHandlerClient(ctx context.Context, mux *runtim
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetCollateralMode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetCollateralMode", runtime.WithHTTPPathPattern("/v1/getcollateralmode"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_GetCollateralMode_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetCollateralMode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetLeverage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetLeverage", runtime.WithHTTPPathPattern("/v1/getleverage"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_GetLeverage_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetLeverage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_SetCollateralMode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/SetCollateralMode", runtime.WithHTTPPathPattern("/v1/getcollateralmode"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_SetCollateralMode_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_SetCollateralMode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_SetMarginType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/SetMarginType", runtime.WithHTTPPathPattern("/v1/getmargintype"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_SetMarginType_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_SetMarginType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_SetLeverage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/SetLeverage", runtime.WithHTTPPathPattern("/v1/getleverage"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_SetLeverage_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_SetLeverage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_GoCryptoTraderService_ChangePositionMargin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/ChangePositionMargin", runtime.WithHTTPPathPattern("/v1/changepositionmargin"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_ChangePositionMargin_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_ChangePositionMargin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -8550,7 +9123,9 @@ var (
|
||||
|
||||
pattern_GoCryptoTraderService_CurrencyStateTradingPair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "currencystatetradingpair"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetFuturesPositions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getfuturespositions"}, ""))
|
||||
pattern_GoCryptoTraderService_GetFuturesPositionsSummary_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getfuturespositionssummary"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetFuturesPositionsOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getfuturespositionsorders"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetCollateral_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getcollateral"}, ""))
|
||||
|
||||
@@ -8573,6 +9148,18 @@ var (
|
||||
pattern_GoCryptoTraderService_GetOrderbookAmountByNominal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getorderbookamountbynominal"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetOrderbookAmountByImpact_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getorderbookamountbyimpact"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetCollateralMode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getcollateralmode"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetLeverage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getleverage"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_SetCollateralMode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getcollateralmode"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_SetMarginType_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getmargintype"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_SetLeverage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getleverage"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_ChangePositionMargin_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "changepositionmargin"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -8764,7 +9351,9 @@ var (
|
||||
|
||||
forward_GoCryptoTraderService_CurrencyStateTradingPair_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetFuturesPositions_0 = runtime.ForwardResponseMessage
|
||||
forward_GoCryptoTraderService_GetFuturesPositionsSummary_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetFuturesPositionsOrders_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetCollateral_0 = runtime.ForwardResponseMessage
|
||||
|
||||
@@ -8787,4 +9376,16 @@ var (
|
||||
forward_GoCryptoTraderService_GetOrderbookAmountByNominal_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetOrderbookAmountByImpact_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetCollateralMode_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetLeverage_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_SetCollateralMode_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_SetMarginType_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_SetLeverage_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_ChangePositionMargin_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
197
gctrpc/rpc.proto
197
gctrpc/rpc.proto
@@ -346,6 +346,7 @@ message SubmitOrderRequest {
|
||||
double price = 6;
|
||||
string client_id = 7;
|
||||
string asset_type = 8;
|
||||
string margin_type = 9;
|
||||
}
|
||||
|
||||
message Trades {
|
||||
@@ -366,6 +367,7 @@ message SimulateOrderRequest {
|
||||
CurrencyPair pair = 2;
|
||||
double amount = 3;
|
||||
string side = 4;
|
||||
string margin_type = 5;
|
||||
}
|
||||
|
||||
message SimulateOrderResponse {
|
||||
@@ -1062,6 +1064,18 @@ message FuturesPositionStats {
|
||||
string margin_fraction = 10;
|
||||
string free_collateral = 11;
|
||||
string total_collateral = 12;
|
||||
string frozen_balance = 13;
|
||||
string equity_of_currency = 14;
|
||||
string available_equity = 15;
|
||||
string cash_balance = 16;
|
||||
string discount_equity = 17;
|
||||
string equity_usd = 18;
|
||||
string isolated_equity = 19;
|
||||
string isolated_liabilities = 20;
|
||||
string isolated_upl = 21;
|
||||
string notional_leverage = 22;
|
||||
string total_equity = 23;
|
||||
string strategy_equity = 24;
|
||||
}
|
||||
|
||||
message FuturePosition {
|
||||
@@ -1106,31 +1120,143 @@ message GetManagedPositionsResponse {
|
||||
repeated FuturePosition positions = 1;
|
||||
}
|
||||
|
||||
message GetFuturesPositionsRequest {
|
||||
message GetFuturesPositionsSummaryRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
string start_date = 4;
|
||||
string end_date = 5;
|
||||
string status = 6;
|
||||
int64 position_limit = 7;
|
||||
bool overwrite = 8;
|
||||
bool get_position_stats = 9;
|
||||
bool include_full_order_data = 10;
|
||||
bool get_funding_payments = 11;
|
||||
bool include_full_funding_rates = 12;
|
||||
bool include_predicted_rate = 13;
|
||||
CurrencyPair underlying_pair = 4;
|
||||
}
|
||||
|
||||
message GetFuturesPositionsResponse {
|
||||
int64 total_orders = 1;
|
||||
string sub_account = 2;
|
||||
string total_realised_pnl = 3;
|
||||
string total_unrealised_pnl = 4;
|
||||
string total_pnl = 5;
|
||||
message GetFuturesPositionsSummaryResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
FuturesPositionStats position_stats = 4;
|
||||
}
|
||||
|
||||
message GetFuturesPositionsOrdersRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
CurrencyPair underlying_pair = 4;
|
||||
string start_date = 5;
|
||||
string end_date = 6;
|
||||
bool respect_order_history_limits = 7;
|
||||
bool sync_with_order_manager = 8;
|
||||
}
|
||||
|
||||
message GetFuturesPositionsOrdersResponse {
|
||||
repeated FuturePosition positions = 6;
|
||||
}
|
||||
|
||||
message GetCollateralModeRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
}
|
||||
|
||||
message GetCollateralModeResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
string collateral_mode = 3;
|
||||
}
|
||||
|
||||
message SetCollateralModeRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
string collateral_mode = 3;
|
||||
}
|
||||
|
||||
message SetCollateralModeResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
bool success = 3;
|
||||
}
|
||||
|
||||
message GetMarginTypeRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
}
|
||||
|
||||
message GetMarginTypeResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
string margin_type = 4;
|
||||
}
|
||||
|
||||
message ChangePositionMarginRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
string margin_type = 4;
|
||||
double original_allocated_margin = 5;
|
||||
double new_allocated_margin = 6;
|
||||
string margin_side = 7;
|
||||
}
|
||||
|
||||
message ChangePositionMarginResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
string margin_type = 4;
|
||||
double new_allocated_margin = 5;
|
||||
string margin_side = 6;
|
||||
}
|
||||
|
||||
message SetMarginTypeRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
string margin_type = 4;
|
||||
}
|
||||
|
||||
message SetMarginTypeResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
bool success = 4;
|
||||
}
|
||||
|
||||
message GetLeverageRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
CurrencyPair underlying_pair = 4;
|
||||
string margin_type = 5;
|
||||
string order_side = 6;
|
||||
}
|
||||
|
||||
message GetLeverageResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
CurrencyPair underlying_pair = 4;
|
||||
string margin_type = 5;
|
||||
double leverage = 6;
|
||||
string order_side = 7;
|
||||
}
|
||||
|
||||
message SetLeverageRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
CurrencyPair underlying_pair = 4;
|
||||
string margin_type = 5;
|
||||
double leverage = 6;
|
||||
string order_side = 7;
|
||||
}
|
||||
|
||||
message SetLeverageResponse {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
CurrencyPair pair = 3;
|
||||
CurrencyPair underlying_pair = 4;
|
||||
string margin_type = 5;
|
||||
string order_side = 6;
|
||||
bool success = 7;
|
||||
}
|
||||
|
||||
message GetCollateralRequest {
|
||||
string exchange = 1;
|
||||
string asset = 2;
|
||||
@@ -1844,8 +1970,11 @@ service GoCryptoTraderService {
|
||||
rpc CurrencyStateTradingPair(CurrencyStateTradingPairRequest) returns (GenericResponse) {
|
||||
option (google.api.http) = {get: "/v1/currencystatetradingpair"};
|
||||
}
|
||||
rpc GetFuturesPositions(GetFuturesPositionsRequest) returns (GetFuturesPositionsResponse) {
|
||||
option (google.api.http) = {get: "/v1/getfuturespositions"};
|
||||
rpc GetFuturesPositionsSummary(GetFuturesPositionsSummaryRequest) returns (GetFuturesPositionsSummaryResponse) {
|
||||
option (google.api.http) = {get: "/v1/getfuturespositionssummary"};
|
||||
}
|
||||
rpc GetFuturesPositionsOrders(GetFuturesPositionsOrdersRequest) returns (GetFuturesPositionsOrdersResponse) {
|
||||
option (google.api.http) = {get: "/v1/getfuturespositionsorders"};
|
||||
}
|
||||
rpc GetCollateral(GetCollateralRequest) returns (GetCollateralResponse) {
|
||||
option (google.api.http) = {get: "/v1/getcollateral"};
|
||||
@@ -1880,4 +2009,34 @@ service GoCryptoTraderService {
|
||||
rpc GetOrderbookAmountByImpact(GetOrderbookAmountByImpactRequest) returns (GetOrderbookAmountByImpactResponse) {
|
||||
option (google.api.http) = {get: "/v1/getorderbookamountbyimpact"};
|
||||
}
|
||||
rpc GetCollateralMode(GetCollateralModeRequest) returns (GetCollateralModeResponse) {
|
||||
option (google.api.http) = {get: "/v1/getcollateralmode"};
|
||||
}
|
||||
rpc GetLeverage(GetLeverageRequest) returns (GetLeverageResponse) {
|
||||
option (google.api.http) = {get: "/v1/getleverage"};
|
||||
}
|
||||
rpc SetCollateralMode(SetCollateralModeRequest) returns (SetCollateralModeResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/getcollateralmode"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc SetMarginType(SetMarginTypeRequest) returns (SetMarginTypeResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/getmargintype"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc SetLeverage(SetLeverageRequest) returns (SetLeverageResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/getleverage"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc ChangePositionMargin(ChangePositionMarginRequest) returns (ChangePositionMarginResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/changepositionmargin"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,6 +176,38 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/changepositionmargin": {
|
||||
"post": {
|
||||
"operationId": "GoCryptoTraderService_ChangePositionMargin",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcChangePositionMarginResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcChangePositionMarginRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/converttradestocandles": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_ConvertTradesToCandles",
|
||||
@@ -1325,6 +1357,72 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getcollateralmode": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetCollateralMode",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcGetCollateralModeResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "exchange",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "asset",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"operationId": "GoCryptoTraderService_SetCollateralMode",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcSetCollateralModeResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcSetCollateralModeRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getcommunicationrelayers": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetCommunicationRelayers",
|
||||
@@ -1961,14 +2059,14 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getfuturespositions": {
|
||||
"/v1/getfuturespositionsorders": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetFuturesPositions",
|
||||
"operationId": "GoCryptoTraderService_GetFuturesPositionsOrders",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcGetFuturesPositionsResponse"
|
||||
"$ref": "#/definitions/gctrpcGetFuturesPositionsOrdersResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
@@ -2009,6 +2107,24 @@
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "underlyingPair.delimiter",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "underlyingPair.base",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "underlyingPair.quote",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "startDate",
|
||||
"in": "query",
|
||||
@@ -2022,53 +2138,88 @@
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"name": "respectOrderHistoryLimits",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "syncWithOrderManager",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getfuturespositionssummary": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetFuturesPositionsSummary",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcGetFuturesPositionsSummaryResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "exchange",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "positionLimit",
|
||||
"name": "asset",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "overwrite",
|
||||
"name": "pair.delimiter",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "getPositionStats",
|
||||
"name": "pair.base",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "includeFullOrderData",
|
||||
"name": "pair.quote",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "getFundingPayments",
|
||||
"name": "underlyingPair.delimiter",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "includeFullFundingRates",
|
||||
"name": "underlyingPair.base",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "includePredictedRate",
|
||||
"name": "underlyingPair.quote",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
@@ -2336,6 +2487,120 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getleverage": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetLeverage",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcGetLeverageResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "exchange",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "asset",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "pair.delimiter",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "pair.base",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "pair.quote",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "underlyingPair.delimiter",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "underlyingPair.base",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "underlyingPair.quote",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "marginType",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "orderSide",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"operationId": "GoCryptoTraderService_SetLeverage",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcSetLeverageResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcSetLeverageRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getloggerdetails": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetLoggerDetails",
|
||||
@@ -2572,6 +2837,38 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getmargintype": {
|
||||
"post": {
|
||||
"operationId": "GoCryptoTraderService_SetMarginType",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcSetMarginTypeResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcSetMarginTypeRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"GoCryptoTraderService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getorder": {
|
||||
"post": {
|
||||
"operationId": "GoCryptoTraderService_GetOrder",
|
||||
@@ -4640,6 +4937,58 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcChangePositionMarginRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
},
|
||||
"originalAllocatedMargin": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"newAllocatedMargin": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"marginSide": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcChangePositionMarginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
},
|
||||
"newAllocatedMargin": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"marginSide": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcCoin": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -5251,6 +5600,42 @@
|
||||
},
|
||||
"totalCollateral": {
|
||||
"type": "string"
|
||||
},
|
||||
"frozenBalance": {
|
||||
"type": "string"
|
||||
},
|
||||
"equityOfCurrency": {
|
||||
"type": "string"
|
||||
},
|
||||
"availableEquity": {
|
||||
"type": "string"
|
||||
},
|
||||
"cashBalance": {
|
||||
"type": "string"
|
||||
},
|
||||
"discountEquity": {
|
||||
"type": "string"
|
||||
},
|
||||
"equityUsd": {
|
||||
"type": "string"
|
||||
},
|
||||
"isolatedEquity": {
|
||||
"type": "string"
|
||||
},
|
||||
"isolatedLiabilities": {
|
||||
"type": "string"
|
||||
},
|
||||
"isolatedUpl": {
|
||||
"type": "string"
|
||||
},
|
||||
"notionalLeverage": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalEquity": {
|
||||
"type": "string"
|
||||
},
|
||||
"strategyEquity": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -5422,6 +5807,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetCollateralModeResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"collateralMode": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetCollateralResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -5689,25 +6088,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetFuturesPositionsResponse": {
|
||||
"gctrpcGetFuturesPositionsOrdersResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"totalOrders": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
},
|
||||
"subAccount": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalRealisedPnl": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalUnrealisedPnl": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalPnl": {
|
||||
"type": "string"
|
||||
},
|
||||
"positions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -5717,6 +6100,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetFuturesPositionsSummaryResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"positionStats": {
|
||||
"$ref": "#/definitions/gctrpcFuturesPositionStats"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetHistoricCandlesResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -5786,6 +6186,33 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetLeverageResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"underlyingPair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
},
|
||||
"leverage": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"orderSide": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetLoggerDetailsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -6543,6 +6970,34 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetCollateralModeRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"collateralMode": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetCollateralModeResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetDataHistoryJobStatusRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -6579,6 +7034,59 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetLeverageRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"underlyingPair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
},
|
||||
"leverage": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"orderSide": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetLeverageResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"underlyingPair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
},
|
||||
"orderSide": {
|
||||
"type": "string"
|
||||
},
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetLoggerDetailsRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -6590,6 +7098,40 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetMarginTypeRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcSetMarginTypeResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
"type": "string"
|
||||
},
|
||||
"asset": {
|
||||
"type": "string"
|
||||
},
|
||||
"pair": {
|
||||
"$ref": "#/definitions/gctrpcCurrencyPair"
|
||||
},
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcShutdownResponse": {
|
||||
"type": "object"
|
||||
},
|
||||
@@ -6608,6 +7150,9 @@
|
||||
},
|
||||
"side": {
|
||||
"type": "string"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -6670,6 +7215,9 @@
|
||||
},
|
||||
"assetType": {
|
||||
"type": "string"
|
||||
},
|
||||
"marginType": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user