mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
accounts: Move to instance methods, fix races and isolate tests (#1923)
* Bybit: Fix race in TestUpdateAccountInfo and TestWSHandleData * DriveBy rename TestWSHandleData * This doesn't address running with -race=2+ due to the singleton * Accounts: Add account.GetService() * exchange: Assertify TestSetupDefaults * Exchanges: Add account.Service override for testing * Exchanges: Remove duplicate IsWebsocketEnabled test from TestSetupDefaults * Dispatch: Replace nil checks with NilGuard * Engine: Remove deprecated printAccountHoldingsChangeSummary * Dispatcher: Add EnsureRunning method * Accounts: Move singleton accounts service to exchange Accounts * Move singleton accounts service to exchange Accounts This maintains the concept of a global store, whilst allowing exchanges to override it when needed, particularly for testing. APIServer: * Remove getAllActiveAccounts from apiserver Deprecated apiserver only thing using this, so remove it instead of updating it * Update comment for UpdateAccountBalances everywhere * Docs: Add punctuation to function comments * Bybit: Coverage for wsProcessWalletPushData Save
This commit is contained in:
@@ -1719,7 +1719,7 @@ func (x *GetOrderbooksResponse) GetOrderbooks() []*Orderbooks {
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetAccountInfoRequest struct {
|
||||
type GetAccountBalancesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"`
|
||||
AssetType string `protobuf:"bytes,2,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"`
|
||||
@@ -1727,20 +1727,20 @@ type GetAccountInfoRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoRequest) Reset() {
|
||||
*x = GetAccountInfoRequest{}
|
||||
func (x *GetAccountBalancesRequest) Reset() {
|
||||
*x = GetAccountBalancesRequest{}
|
||||
mi := &file_rpc_proto_msgTypes[32]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoRequest) String() string {
|
||||
func (x *GetAccountBalancesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAccountInfoRequest) ProtoMessage() {}
|
||||
func (*GetAccountBalancesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetAccountInfoRequest) ProtoReflect() protoreflect.Message {
|
||||
func (x *GetAccountBalancesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[32]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -1752,19 +1752,19 @@ func (x *GetAccountInfoRequest) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetAccountInfoRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetAccountInfoRequest) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use GetAccountBalancesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetAccountBalancesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{32}
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoRequest) GetExchange() string {
|
||||
func (x *GetAccountBalancesRequest) GetExchange() string {
|
||||
if x != nil {
|
||||
return x.Exchange
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoRequest) GetAssetType() string {
|
||||
func (x *GetAccountBalancesRequest) GetAssetType() string {
|
||||
if x != nil {
|
||||
return x.AssetType
|
||||
}
|
||||
@@ -1915,7 +1915,7 @@ func (x *AccountCurrencyInfo) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetAccountInfoResponse struct {
|
||||
type GetAccountBalancesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"`
|
||||
Accounts []*Account `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"`
|
||||
@@ -1923,20 +1923,20 @@ type GetAccountInfoResponse struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoResponse) Reset() {
|
||||
*x = GetAccountInfoResponse{}
|
||||
func (x *GetAccountBalancesResponse) Reset() {
|
||||
*x = GetAccountBalancesResponse{}
|
||||
mi := &file_rpc_proto_msgTypes[35]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoResponse) String() string {
|
||||
func (x *GetAccountBalancesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAccountInfoResponse) ProtoMessage() {}
|
||||
func (*GetAccountBalancesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetAccountInfoResponse) ProtoReflect() protoreflect.Message {
|
||||
func (x *GetAccountBalancesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[35]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -1948,19 +1948,19 @@ func (x *GetAccountInfoResponse) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetAccountInfoResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetAccountInfoResponse) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use GetAccountBalancesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetAccountBalancesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{35}
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoResponse) GetExchange() string {
|
||||
func (x *GetAccountBalancesResponse) GetExchange() string {
|
||||
if x != nil {
|
||||
return x.Exchange
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetAccountInfoResponse) GetAccounts() []*Account {
|
||||
func (x *GetAccountBalancesResponse) GetAccounts() []*Account {
|
||||
if x != nil {
|
||||
return x.Accounts
|
||||
}
|
||||
@@ -15231,8 +15231,8 @@ const file_rpc_proto_rawDesc = "" +
|
||||
"\x15GetOrderbooksResponse\x122\n" +
|
||||
"\n" +
|
||||
"orderbooks\x18\x01 \x03(\v2\x12.gctrpc.OrderbooksR\n" +
|
||||
"orderbooks\"R\n" +
|
||||
"\x15GetAccountInfoRequest\x12\x1a\n" +
|
||||
"orderbooks\"V\n" +
|
||||
"\x19GetAccountBalancesRequest\x12\x1a\n" +
|
||||
"\bexchange\x18\x01 \x01(\tR\bexchange\x12\x1d\n" +
|
||||
"\n" +
|
||||
"asset_type\x18\x02 \x01(\tR\tassetType\"V\n" +
|
||||
@@ -15250,8 +15250,8 @@ const file_rpc_proto_rawDesc = "" +
|
||||
"\x13free_without_borrow\x18\x05 \x01(\x01R\x11freeWithoutBorrow\x12\x1a\n" +
|
||||
"\bborrowed\x18\x06 \x01(\x01R\bborrowed\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"a\n" +
|
||||
"\x16GetAccountInfoResponse\x12\x1a\n" +
|
||||
"updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"e\n" +
|
||||
"\x1aGetAccountBalancesResponse\x12\x1a\n" +
|
||||
"\bexchange\x18\x01 \x01(\tR\bexchange\x12+\n" +
|
||||
"\baccounts\x18\x02 \x03(\v2\x0f.gctrpc.AccountR\baccounts\"\x12\n" +
|
||||
"\x10GetConfigRequest\"'\n" +
|
||||
@@ -16367,7 +16367,7 @@ const file_rpc_proto_rawDesc = "" +
|
||||
"\x05asset\x18\x02 \x01(\tR\x05asset\x12(\n" +
|
||||
"\x04pair\x18\x03 \x01(\v2\x14.gctrpc.CurrencyPairR\x04pair\"/\n" +
|
||||
"\x1bGetCurrencyTradeURLResponse\x12\x10\n" +
|
||||
"\x03url\x18\x01 \x01(\tR\x03url2\x9al\n" +
|
||||
"\x03url\x18\x01 \x01(\tR\x03url2\xccl\n" +
|
||||
"\x15GoCryptoTraderService\x12O\n" +
|
||||
"\aGetInfo\x12\x16.gctrpc.GetInfoRequest\x1a\x17.gctrpc.GetInfoResponse\"\x13\x82\xd3\xe4\x93\x02\r\x12\v/v1/getinfo\x12g\n" +
|
||||
"\rGetSubsystems\x12\x1c.gctrpc.GetSubsystemsRequest\x1a\x1d.gctrpc.GetSusbsytemsResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/getsubsystems\x12h\n" +
|
||||
@@ -16385,10 +16385,10 @@ const file_rpc_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"GetTickers\x12\x19.gctrpc.GetTickersRequest\x1a\x1a.gctrpc.GetTickersResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/gettickers\x12c\n" +
|
||||
"\fGetOrderbook\x12\x1b.gctrpc.GetOrderbookRequest\x1a\x19.gctrpc.OrderbookResponse\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/v1/getorderbook\x12g\n" +
|
||||
"\rGetOrderbooks\x12\x1c.gctrpc.GetOrderbooksRequest\x1a\x1d.gctrpc.GetOrderbooksResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/getorderbooks\x12k\n" +
|
||||
"\x0eGetAccountInfo\x12\x1d.gctrpc.GetAccountInfoRequest\x1a\x1e.gctrpc.GetAccountInfoResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/getaccountinfo\x12q\n" +
|
||||
"\x11UpdateAccountInfo\x12\x1d.gctrpc.GetAccountInfoRequest\x1a\x1e.gctrpc.GetAccountInfoResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/updateaccountinfo\x12y\n" +
|
||||
"\x14GetAccountInfoStream\x12\x1d.gctrpc.GetAccountInfoRequest\x1a\x1e.gctrpc.GetAccountInfoResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/getaccountinfostream0\x01\x12W\n" +
|
||||
"\rGetOrderbooks\x12\x1c.gctrpc.GetOrderbooksRequest\x1a\x1d.gctrpc.GetOrderbooksResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/getorderbooks\x12{\n" +
|
||||
"\x12GetAccountBalances\x12!.gctrpc.GetAccountBalancesRequest\x1a\".gctrpc.GetAccountBalancesResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/getaccountbalances\x12\x81\x01\n" +
|
||||
"\x15UpdateAccountBalances\x12!.gctrpc.GetAccountBalancesRequest\x1a\".gctrpc.GetAccountBalancesResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/updateaccountbalances\x12\x89\x01\n" +
|
||||
"\x18GetAccountBalancesStream\x12!.gctrpc.GetAccountBalancesRequest\x1a\".gctrpc.GetAccountBalancesResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/getaccountbalancesstream0\x01\x12W\n" +
|
||||
"\tGetConfig\x12\x18.gctrpc.GetConfigRequest\x1a\x19.gctrpc.GetConfigResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/v1/getconfig\x12c\n" +
|
||||
"\fGetPortfolio\x12\x1b.gctrpc.GetPortfolioRequest\x1a\x1c.gctrpc.GetPortfolioResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/getportfolio\x12\x7f\n" +
|
||||
"\x13GetPortfolioSummary\x12\".gctrpc.GetPortfolioSummaryRequest\x1a#.gctrpc.GetPortfolioSummaryResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/getportfoliosummary\x12v\n" +
|
||||
@@ -16532,10 +16532,10 @@ var file_rpc_proto_goTypes = []any{
|
||||
(*GetOrderbooksRequest)(nil), // 29: gctrpc.GetOrderbooksRequest
|
||||
(*Orderbooks)(nil), // 30: gctrpc.Orderbooks
|
||||
(*GetOrderbooksResponse)(nil), // 31: gctrpc.GetOrderbooksResponse
|
||||
(*GetAccountInfoRequest)(nil), // 32: gctrpc.GetAccountInfoRequest
|
||||
(*GetAccountBalancesRequest)(nil), // 32: gctrpc.GetAccountBalancesRequest
|
||||
(*Account)(nil), // 33: gctrpc.Account
|
||||
(*AccountCurrencyInfo)(nil), // 34: gctrpc.AccountCurrencyInfo
|
||||
(*GetAccountInfoResponse)(nil), // 35: gctrpc.GetAccountInfoResponse
|
||||
(*GetAccountBalancesResponse)(nil), // 35: gctrpc.GetAccountBalancesResponse
|
||||
(*GetConfigRequest)(nil), // 36: gctrpc.GetConfigRequest
|
||||
(*GetConfigResponse)(nil), // 37: gctrpc.GetConfigResponse
|
||||
(*PortfolioAddress)(nil), // 38: gctrpc.PortfolioAddress
|
||||
@@ -16762,7 +16762,7 @@ var file_rpc_proto_depIdxs = []int32{
|
||||
30, // 16: gctrpc.GetOrderbooksResponse.orderbooks:type_name -> gctrpc.Orderbooks
|
||||
34, // 17: gctrpc.Account.currencies:type_name -> gctrpc.AccountCurrencyInfo
|
||||
240, // 18: gctrpc.AccountCurrencyInfo.updated_at:type_name -> google.protobuf.Timestamp
|
||||
33, // 19: gctrpc.GetAccountInfoResponse.accounts:type_name -> gctrpc.Account
|
||||
33, // 19: gctrpc.GetAccountBalancesResponse.accounts:type_name -> gctrpc.Account
|
||||
38, // 20: gctrpc.GetPortfolioResponse.portfolio:type_name -> gctrpc.PortfolioAddress
|
||||
43, // 21: gctrpc.OfflineCoins.addresses:type_name -> gctrpc.OfflineCoinSummary
|
||||
233, // 22: gctrpc.OnlineCoins.coins:type_name -> gctrpc.OnlineCoins.CoinsEntry
|
||||
@@ -16915,9 +16915,9 @@ var file_rpc_proto_depIdxs = []int32{
|
||||
23, // 169: gctrpc.GoCryptoTraderService.GetTickers:input_type -> gctrpc.GetTickersRequest
|
||||
26, // 170: gctrpc.GoCryptoTraderService.GetOrderbook:input_type -> gctrpc.GetOrderbookRequest
|
||||
29, // 171: gctrpc.GoCryptoTraderService.GetOrderbooks:input_type -> gctrpc.GetOrderbooksRequest
|
||||
32, // 172: gctrpc.GoCryptoTraderService.GetAccountInfo:input_type -> gctrpc.GetAccountInfoRequest
|
||||
32, // 173: gctrpc.GoCryptoTraderService.UpdateAccountInfo:input_type -> gctrpc.GetAccountInfoRequest
|
||||
32, // 174: gctrpc.GoCryptoTraderService.GetAccountInfoStream:input_type -> gctrpc.GetAccountInfoRequest
|
||||
32, // 172: gctrpc.GoCryptoTraderService.GetAccountBalances:input_type -> gctrpc.GetAccountBalancesRequest
|
||||
32, // 173: gctrpc.GoCryptoTraderService.UpdateAccountBalances:input_type -> gctrpc.GetAccountBalancesRequest
|
||||
32, // 174: gctrpc.GoCryptoTraderService.GetAccountBalancesStream:input_type -> gctrpc.GetAccountBalancesRequest
|
||||
36, // 175: gctrpc.GoCryptoTraderService.GetConfig:input_type -> gctrpc.GetConfigRequest
|
||||
39, // 176: gctrpc.GoCryptoTraderService.GetPortfolio:input_type -> gctrpc.GetPortfolioRequest
|
||||
41, // 177: gctrpc.GoCryptoTraderService.GetPortfolioSummary:input_type -> gctrpc.GetPortfolioSummaryRequest
|
||||
@@ -17030,9 +17030,9 @@ var file_rpc_proto_depIdxs = []int32{
|
||||
25, // 284: gctrpc.GoCryptoTraderService.GetTickers:output_type -> gctrpc.GetTickersResponse
|
||||
28, // 285: gctrpc.GoCryptoTraderService.GetOrderbook:output_type -> gctrpc.OrderbookResponse
|
||||
31, // 286: gctrpc.GoCryptoTraderService.GetOrderbooks:output_type -> gctrpc.GetOrderbooksResponse
|
||||
35, // 287: gctrpc.GoCryptoTraderService.GetAccountInfo:output_type -> gctrpc.GetAccountInfoResponse
|
||||
35, // 288: gctrpc.GoCryptoTraderService.UpdateAccountInfo:output_type -> gctrpc.GetAccountInfoResponse
|
||||
35, // 289: gctrpc.GoCryptoTraderService.GetAccountInfoStream:output_type -> gctrpc.GetAccountInfoResponse
|
||||
35, // 287: gctrpc.GoCryptoTraderService.GetAccountBalances:output_type -> gctrpc.GetAccountBalancesResponse
|
||||
35, // 288: gctrpc.GoCryptoTraderService.UpdateAccountBalances:output_type -> gctrpc.GetAccountBalancesResponse
|
||||
35, // 289: gctrpc.GoCryptoTraderService.GetAccountBalancesStream:output_type -> gctrpc.GetAccountBalancesResponse
|
||||
37, // 290: gctrpc.GoCryptoTraderService.GetConfig:output_type -> gctrpc.GetConfigResponse
|
||||
40, // 291: gctrpc.GoCryptoTraderService.GetPortfolio:output_type -> gctrpc.GetPortfolioResponse
|
||||
47, // 292: gctrpc.GoCryptoTraderService.GetPortfolioSummary:output_type -> gctrpc.GetPortfolioSummaryResponse
|
||||
|
||||
@@ -474,93 +474,93 @@ func local_request_GoCryptoTraderService_GetOrderbooks_0(ctx context.Context, ma
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_GetAccountInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
filter_GoCryptoTraderService_GetAccountBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_GetAccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountInfoRequest
|
||||
func request_GoCryptoTraderService_GetAccountBalances_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountBalancesRequest
|
||||
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_GetAccountInfo_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetAccountBalances_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetAccountInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
msg, err := client.GetAccountBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_GetAccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountInfoRequest
|
||||
func local_request_GoCryptoTraderService_GetAccountBalances_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountBalancesRequest
|
||||
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_GetAccountInfo_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetAccountBalances_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetAccountInfo(ctx, &protoReq)
|
||||
msg, err := server.GetAccountBalances(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_UpdateAccountInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
filter_GoCryptoTraderService_UpdateAccountBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_UpdateAccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountInfoRequest
|
||||
func request_GoCryptoTraderService_UpdateAccountBalances_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountBalancesRequest
|
||||
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_UpdateAccountInfo_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_UpdateAccountBalances_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateAccountInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
msg, err := client.UpdateAccountBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_GoCryptoTraderService_UpdateAccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountInfoRequest
|
||||
func local_request_GoCryptoTraderService_UpdateAccountBalances_0(ctx context.Context, marshaler runtime.Marshaler, server GoCryptoTraderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountBalancesRequest
|
||||
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_UpdateAccountInfo_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_UpdateAccountBalances_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateAccountInfo(ctx, &protoReq)
|
||||
msg, err := server.UpdateAccountBalances(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_GoCryptoTraderService_GetAccountInfoStream_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
filter_GoCryptoTraderService_GetAccountBalancesStream_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_GoCryptoTraderService_GetAccountInfoStream_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (GoCryptoTraderService_GetAccountInfoStreamClient, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountInfoRequest
|
||||
func request_GoCryptoTraderService_GetAccountBalancesStream_0(ctx context.Context, marshaler runtime.Marshaler, client GoCryptoTraderServiceClient, req *http.Request, pathParams map[string]string) (GoCryptoTraderService_GetAccountBalancesStreamClient, runtime.ServerMetadata, error) {
|
||||
var protoReq GetAccountBalancesRequest
|
||||
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_GetAccountInfoStream_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_GoCryptoTraderService_GetAccountBalancesStream_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
stream, err := client.GetAccountInfoStream(ctx, &protoReq)
|
||||
stream, err := client.GetAccountBalancesStream(ctx, &protoReq)
|
||||
if err != nil {
|
||||
return nil, metadata, err
|
||||
}
|
||||
@@ -4159,7 +4159,7 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
@@ -4167,12 +4167,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/GetAccountInfo", runtime.WithHTTPPathPattern("/v1/getaccountinfo"))
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetAccountBalances", runtime.WithHTTPPathPattern("/v1/getaccountbalances"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetAccountInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_GoCryptoTraderService_GetAccountBalances_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 {
|
||||
@@ -4180,11 +4180,11 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_GetAccountInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_GetAccountBalances_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_UpdateAccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_UpdateAccountBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
@@ -4192,12 +4192,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/UpdateAccountInfo", runtime.WithHTTPPathPattern("/v1/updateaccountinfo"))
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/UpdateAccountBalances", runtime.WithHTTPPathPattern("/v1/updateaccountbalances"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_GoCryptoTraderService_UpdateAccountInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_GoCryptoTraderService_UpdateAccountBalances_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 {
|
||||
@@ -4205,11 +4205,11 @@ func RegisterGoCryptoTraderServiceHandlerServer(ctx context.Context, mux *runtim
|
||||
return
|
||||
}
|
||||
|
||||
forward_GoCryptoTraderService_UpdateAccountInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_UpdateAccountBalances_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountInfoStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountBalancesStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
|
||||
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
@@ -6919,69 +6919,69 @@ func RegisterGoCryptoTraderServiceHandlerClient(ctx context.Context, mux *runtim
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountBalances_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/GetAccountInfo", runtime.WithHTTPPathPattern("/v1/getaccountinfo"))
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetAccountBalances", runtime.WithHTTPPathPattern("/v1/getaccountbalances"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_GetAccountInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_GoCryptoTraderService_GetAccountBalances_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_GetAccountInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_GetAccountBalances_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_UpdateAccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_UpdateAccountBalances_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/UpdateAccountInfo", runtime.WithHTTPPathPattern("/v1/updateaccountinfo"))
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/UpdateAccountBalances", runtime.WithHTTPPathPattern("/v1/updateaccountbalances"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_UpdateAccountInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_GoCryptoTraderService_UpdateAccountBalances_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_UpdateAccountInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_UpdateAccountBalances_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountInfoStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_GoCryptoTraderService_GetAccountBalancesStream_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/GetAccountInfoStream", runtime.WithHTTPPathPattern("/v1/getaccountinfostream"))
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/gctrpc.GoCryptoTraderService/GetAccountBalancesStream", runtime.WithHTTPPathPattern("/v1/getaccountbalancesstream"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_GoCryptoTraderService_GetAccountInfoStream_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_GoCryptoTraderService_GetAccountBalancesStream_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_GetAccountInfoStream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
||||
forward_GoCryptoTraderService_GetAccountBalancesStream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -9133,11 +9133,11 @@ var (
|
||||
|
||||
pattern_GoCryptoTraderService_GetOrderbooks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getorderbooks"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetAccountInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getaccountinfo"}, ""))
|
||||
pattern_GoCryptoTraderService_GetAccountBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getaccountbalances"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_UpdateAccountInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "updateaccountinfo"}, ""))
|
||||
pattern_GoCryptoTraderService_UpdateAccountBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "updateaccountbalances"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetAccountInfoStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getaccountinfostream"}, ""))
|
||||
pattern_GoCryptoTraderService_GetAccountBalancesStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getaccountbalancesstream"}, ""))
|
||||
|
||||
pattern_GoCryptoTraderService_GetConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "getconfig"}, ""))
|
||||
|
||||
@@ -9365,11 +9365,11 @@ var (
|
||||
|
||||
forward_GoCryptoTraderService_GetOrderbooks_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetAccountInfo_0 = runtime.ForwardResponseMessage
|
||||
forward_GoCryptoTraderService_GetAccountBalances_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_UpdateAccountInfo_0 = runtime.ForwardResponseMessage
|
||||
forward_GoCryptoTraderService_UpdateAccountBalances_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_GoCryptoTraderService_GetAccountInfoStream_0 = runtime.ForwardResponseStream
|
||||
forward_GoCryptoTraderService_GetAccountBalancesStream_0 = runtime.ForwardResponseStream
|
||||
|
||||
forward_GoCryptoTraderService_GetConfig_0 = runtime.ForwardResponseMessage
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ message GetOrderbooksResponse {
|
||||
repeated Orderbooks orderbooks = 1;
|
||||
}
|
||||
|
||||
message GetAccountInfoRequest {
|
||||
message GetAccountBalancesRequest {
|
||||
string exchange = 1;
|
||||
string asset_type = 2;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ message AccountCurrencyInfo {
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
|
||||
message GetAccountInfoResponse {
|
||||
message GetAccountBalancesResponse {
|
||||
string exchange = 1;
|
||||
repeated Account accounts = 2;
|
||||
}
|
||||
@@ -1608,16 +1608,16 @@ service GoCryptoTraderService {
|
||||
option (google.api.http) = {get: "/v1/getorderbooks"};
|
||||
}
|
||||
|
||||
rpc GetAccountInfo(GetAccountInfoRequest) returns (GetAccountInfoResponse) {
|
||||
option (google.api.http) = {get: "/v1/getaccountinfo"};
|
||||
rpc GetAccountBalances(GetAccountBalancesRequest) returns (GetAccountBalancesResponse) {
|
||||
option (google.api.http) = {get: "/v1/getaccountbalances"};
|
||||
}
|
||||
|
||||
rpc UpdateAccountInfo(GetAccountInfoRequest) returns (GetAccountInfoResponse) {
|
||||
option (google.api.http) = {get: "/v1/updateaccountinfo"};
|
||||
rpc UpdateAccountBalances(GetAccountBalancesRequest) returns (GetAccountBalancesResponse) {
|
||||
option (google.api.http) = {get: "/v1/updateaccountbalances"};
|
||||
}
|
||||
|
||||
rpc GetAccountInfoStream(GetAccountInfoRequest) returns (stream GetAccountInfoResponse) {
|
||||
option (google.api.http) = {get: "/v1/getaccountinfostream"};
|
||||
rpc GetAccountBalancesStream(GetAccountBalancesRequest) returns (stream GetAccountBalancesResponse) {
|
||||
option (google.api.http) = {get: "/v1/getaccountbalancesstream"};
|
||||
}
|
||||
|
||||
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {
|
||||
|
||||
@@ -1064,14 +1064,14 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getaccountinfo": {
|
||||
"/v1/getaccountbalances": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetAccountInfo",
|
||||
"operationId": "GoCryptoTraderService_GetAccountBalances",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcGetAccountInfoResponse"
|
||||
"$ref": "#/definitions/gctrpcGetAccountBalancesResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
@@ -1100,9 +1100,9 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/getaccountinfostream": {
|
||||
"/v1/getaccountbalancesstream": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_GetAccountInfoStream",
|
||||
"operationId": "GoCryptoTraderService_GetAccountBalancesStream",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.(streaming responses)",
|
||||
@@ -1110,13 +1110,13 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"result": {
|
||||
"$ref": "#/definitions/gctrpcGetAccountInfoResponse"
|
||||
"$ref": "#/definitions/gctrpcGetAccountBalancesResponse"
|
||||
},
|
||||
"error": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
},
|
||||
"title": "Stream result of gctrpcGetAccountInfoResponse"
|
||||
"title": "Stream result of gctrpcGetAccountBalancesResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
@@ -4283,14 +4283,14 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/updateaccountinfo": {
|
||||
"/v1/updateaccountbalances": {
|
||||
"get": {
|
||||
"operationId": "GoCryptoTraderService_UpdateAccountInfo",
|
||||
"operationId": "GoCryptoTraderService_UpdateAccountBalances",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gctrpcGetAccountInfoResponse"
|
||||
"$ref": "#/definitions/gctrpcGetAccountBalancesResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
@@ -5852,7 +5852,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gctrpcGetAccountInfoResponse": {
|
||||
"gctrpcGetAccountBalancesResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"exchange": {
|
||||
|
||||
@@ -35,9 +35,9 @@ const (
|
||||
GoCryptoTraderService_GetTickers_FullMethodName = "/gctrpc.GoCryptoTraderService/GetTickers"
|
||||
GoCryptoTraderService_GetOrderbook_FullMethodName = "/gctrpc.GoCryptoTraderService/GetOrderbook"
|
||||
GoCryptoTraderService_GetOrderbooks_FullMethodName = "/gctrpc.GoCryptoTraderService/GetOrderbooks"
|
||||
GoCryptoTraderService_GetAccountInfo_FullMethodName = "/gctrpc.GoCryptoTraderService/GetAccountInfo"
|
||||
GoCryptoTraderService_UpdateAccountInfo_FullMethodName = "/gctrpc.GoCryptoTraderService/UpdateAccountInfo"
|
||||
GoCryptoTraderService_GetAccountInfoStream_FullMethodName = "/gctrpc.GoCryptoTraderService/GetAccountInfoStream"
|
||||
GoCryptoTraderService_GetAccountBalances_FullMethodName = "/gctrpc.GoCryptoTraderService/GetAccountBalances"
|
||||
GoCryptoTraderService_UpdateAccountBalances_FullMethodName = "/gctrpc.GoCryptoTraderService/UpdateAccountBalances"
|
||||
GoCryptoTraderService_GetAccountBalancesStream_FullMethodName = "/gctrpc.GoCryptoTraderService/GetAccountBalancesStream"
|
||||
GoCryptoTraderService_GetConfig_FullMethodName = "/gctrpc.GoCryptoTraderService/GetConfig"
|
||||
GoCryptoTraderService_GetPortfolio_FullMethodName = "/gctrpc.GoCryptoTraderService/GetPortfolio"
|
||||
GoCryptoTraderService_GetPortfolioSummary_FullMethodName = "/gctrpc.GoCryptoTraderService/GetPortfolioSummary"
|
||||
@@ -156,9 +156,9 @@ type GoCryptoTraderServiceClient interface {
|
||||
GetTickers(ctx context.Context, in *GetTickersRequest, opts ...grpc.CallOption) (*GetTickersResponse, error)
|
||||
GetOrderbook(ctx context.Context, in *GetOrderbookRequest, opts ...grpc.CallOption) (*OrderbookResponse, error)
|
||||
GetOrderbooks(ctx context.Context, in *GetOrderbooksRequest, opts ...grpc.CallOption) (*GetOrderbooksResponse, error)
|
||||
GetAccountInfo(ctx context.Context, in *GetAccountInfoRequest, opts ...grpc.CallOption) (*GetAccountInfoResponse, error)
|
||||
UpdateAccountInfo(ctx context.Context, in *GetAccountInfoRequest, opts ...grpc.CallOption) (*GetAccountInfoResponse, error)
|
||||
GetAccountInfoStream(ctx context.Context, in *GetAccountInfoRequest, opts ...grpc.CallOption) (GoCryptoTraderService_GetAccountInfoStreamClient, error)
|
||||
GetAccountBalances(ctx context.Context, in *GetAccountBalancesRequest, opts ...grpc.CallOption) (*GetAccountBalancesResponse, error)
|
||||
UpdateAccountBalances(ctx context.Context, in *GetAccountBalancesRequest, opts ...grpc.CallOption) (*GetAccountBalancesResponse, error)
|
||||
GetAccountBalancesStream(ctx context.Context, in *GetAccountBalancesRequest, opts ...grpc.CallOption) (GoCryptoTraderService_GetAccountBalancesStreamClient, error)
|
||||
GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error)
|
||||
GetPortfolio(ctx context.Context, in *GetPortfolioRequest, opts ...grpc.CallOption) (*GetPortfolioResponse, error)
|
||||
GetPortfolioSummary(ctx context.Context, in *GetPortfolioSummaryRequest, opts ...grpc.CallOption) (*GetPortfolioSummaryResponse, error)
|
||||
@@ -409,30 +409,30 @@ func (c *goCryptoTraderServiceClient) GetOrderbooks(ctx context.Context, in *Get
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *goCryptoTraderServiceClient) GetAccountInfo(ctx context.Context, in *GetAccountInfoRequest, opts ...grpc.CallOption) (*GetAccountInfoResponse, error) {
|
||||
out := new(GetAccountInfoResponse)
|
||||
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetAccountInfo_FullMethodName, in, out, opts...)
|
||||
func (c *goCryptoTraderServiceClient) GetAccountBalances(ctx context.Context, in *GetAccountBalancesRequest, opts ...grpc.CallOption) (*GetAccountBalancesResponse, error) {
|
||||
out := new(GetAccountBalancesResponse)
|
||||
err := c.cc.Invoke(ctx, GoCryptoTraderService_GetAccountBalances_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *goCryptoTraderServiceClient) UpdateAccountInfo(ctx context.Context, in *GetAccountInfoRequest, opts ...grpc.CallOption) (*GetAccountInfoResponse, error) {
|
||||
out := new(GetAccountInfoResponse)
|
||||
err := c.cc.Invoke(ctx, GoCryptoTraderService_UpdateAccountInfo_FullMethodName, in, out, opts...)
|
||||
func (c *goCryptoTraderServiceClient) UpdateAccountBalances(ctx context.Context, in *GetAccountBalancesRequest, opts ...grpc.CallOption) (*GetAccountBalancesResponse, error) {
|
||||
out := new(GetAccountBalancesResponse)
|
||||
err := c.cc.Invoke(ctx, GoCryptoTraderService_UpdateAccountBalances_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *goCryptoTraderServiceClient) GetAccountInfoStream(ctx context.Context, in *GetAccountInfoRequest, opts ...grpc.CallOption) (GoCryptoTraderService_GetAccountInfoStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &GoCryptoTraderService_ServiceDesc.Streams[0], GoCryptoTraderService_GetAccountInfoStream_FullMethodName, opts...)
|
||||
func (c *goCryptoTraderServiceClient) GetAccountBalancesStream(ctx context.Context, in *GetAccountBalancesRequest, opts ...grpc.CallOption) (GoCryptoTraderService_GetAccountBalancesStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &GoCryptoTraderService_ServiceDesc.Streams[0], GoCryptoTraderService_GetAccountBalancesStream_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &goCryptoTraderServiceGetAccountInfoStreamClient{stream}
|
||||
x := &goCryptoTraderServiceGetAccountBalancesStreamClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -442,17 +442,17 @@ func (c *goCryptoTraderServiceClient) GetAccountInfoStream(ctx context.Context,
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type GoCryptoTraderService_GetAccountInfoStreamClient interface {
|
||||
Recv() (*GetAccountInfoResponse, error)
|
||||
type GoCryptoTraderService_GetAccountBalancesStreamClient interface {
|
||||
Recv() (*GetAccountBalancesResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type goCryptoTraderServiceGetAccountInfoStreamClient struct {
|
||||
type goCryptoTraderServiceGetAccountBalancesStreamClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *goCryptoTraderServiceGetAccountInfoStreamClient) Recv() (*GetAccountInfoResponse, error) {
|
||||
m := new(GetAccountInfoResponse)
|
||||
func (x *goCryptoTraderServiceGetAccountBalancesStreamClient) Recv() (*GetAccountBalancesResponse, error) {
|
||||
m := new(GetAccountBalancesResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1458,9 +1458,9 @@ type GoCryptoTraderServiceServer interface {
|
||||
GetTickers(context.Context, *GetTickersRequest) (*GetTickersResponse, error)
|
||||
GetOrderbook(context.Context, *GetOrderbookRequest) (*OrderbookResponse, error)
|
||||
GetOrderbooks(context.Context, *GetOrderbooksRequest) (*GetOrderbooksResponse, error)
|
||||
GetAccountInfo(context.Context, *GetAccountInfoRequest) (*GetAccountInfoResponse, error)
|
||||
UpdateAccountInfo(context.Context, *GetAccountInfoRequest) (*GetAccountInfoResponse, error)
|
||||
GetAccountInfoStream(*GetAccountInfoRequest, GoCryptoTraderService_GetAccountInfoStreamServer) error
|
||||
GetAccountBalances(context.Context, *GetAccountBalancesRequest) (*GetAccountBalancesResponse, error)
|
||||
UpdateAccountBalances(context.Context, *GetAccountBalancesRequest) (*GetAccountBalancesResponse, error)
|
||||
GetAccountBalancesStream(*GetAccountBalancesRequest, GoCryptoTraderService_GetAccountBalancesStreamServer) error
|
||||
GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error)
|
||||
GetPortfolio(context.Context, *GetPortfolioRequest) (*GetPortfolioResponse, error)
|
||||
GetPortfolioSummary(context.Context, *GetPortfolioSummaryRequest) (*GetPortfolioSummaryResponse, error)
|
||||
@@ -1612,14 +1612,14 @@ func (UnimplementedGoCryptoTraderServiceServer) GetOrderbook(context.Context, *G
|
||||
func (UnimplementedGoCryptoTraderServiceServer) GetOrderbooks(context.Context, *GetOrderbooksRequest) (*GetOrderbooksResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetOrderbooks not implemented")
|
||||
}
|
||||
func (UnimplementedGoCryptoTraderServiceServer) GetAccountInfo(context.Context, *GetAccountInfoRequest) (*GetAccountInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetAccountInfo not implemented")
|
||||
func (UnimplementedGoCryptoTraderServiceServer) GetAccountBalances(context.Context, *GetAccountBalancesRequest) (*GetAccountBalancesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetAccountBalances not implemented")
|
||||
}
|
||||
func (UnimplementedGoCryptoTraderServiceServer) UpdateAccountInfo(context.Context, *GetAccountInfoRequest) (*GetAccountInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateAccountInfo not implemented")
|
||||
func (UnimplementedGoCryptoTraderServiceServer) UpdateAccountBalances(context.Context, *GetAccountBalancesRequest) (*GetAccountBalancesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateAccountBalances not implemented")
|
||||
}
|
||||
func (UnimplementedGoCryptoTraderServiceServer) GetAccountInfoStream(*GetAccountInfoRequest, GoCryptoTraderService_GetAccountInfoStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method GetAccountInfoStream not implemented")
|
||||
func (UnimplementedGoCryptoTraderServiceServer) GetAccountBalancesStream(*GetAccountBalancesRequest, GoCryptoTraderService_GetAccountBalancesStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method GetAccountBalancesStream not implemented")
|
||||
}
|
||||
func (UnimplementedGoCryptoTraderServiceServer) GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented")
|
||||
@@ -2210,60 +2210,60 @@ func _GoCryptoTraderService_GetOrderbooks_Handler(srv interface{}, ctx context.C
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GoCryptoTraderService_GetAccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountInfoRequest)
|
||||
func _GoCryptoTraderService_GetAccountBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountBalancesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GoCryptoTraderServiceServer).GetAccountInfo(ctx, in)
|
||||
return srv.(GoCryptoTraderServiceServer).GetAccountBalances(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: GoCryptoTraderService_GetAccountInfo_FullMethodName,
|
||||
FullMethod: GoCryptoTraderService_GetAccountBalances_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GoCryptoTraderServiceServer).GetAccountInfo(ctx, req.(*GetAccountInfoRequest))
|
||||
return srv.(GoCryptoTraderServiceServer).GetAccountBalances(ctx, req.(*GetAccountBalancesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GoCryptoTraderService_UpdateAccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountInfoRequest)
|
||||
func _GoCryptoTraderService_UpdateAccountBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountBalancesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GoCryptoTraderServiceServer).UpdateAccountInfo(ctx, in)
|
||||
return srv.(GoCryptoTraderServiceServer).UpdateAccountBalances(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: GoCryptoTraderService_UpdateAccountInfo_FullMethodName,
|
||||
FullMethod: GoCryptoTraderService_UpdateAccountBalances_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GoCryptoTraderServiceServer).UpdateAccountInfo(ctx, req.(*GetAccountInfoRequest))
|
||||
return srv.(GoCryptoTraderServiceServer).UpdateAccountBalances(ctx, req.(*GetAccountBalancesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GoCryptoTraderService_GetAccountInfoStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(GetAccountInfoRequest)
|
||||
func _GoCryptoTraderService_GetAccountBalancesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(GetAccountBalancesRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(GoCryptoTraderServiceServer).GetAccountInfoStream(m, &goCryptoTraderServiceGetAccountInfoStreamServer{stream})
|
||||
return srv.(GoCryptoTraderServiceServer).GetAccountBalancesStream(m, &goCryptoTraderServiceGetAccountBalancesStreamServer{stream})
|
||||
}
|
||||
|
||||
type GoCryptoTraderService_GetAccountInfoStreamServer interface {
|
||||
Send(*GetAccountInfoResponse) error
|
||||
type GoCryptoTraderService_GetAccountBalancesStreamServer interface {
|
||||
Send(*GetAccountBalancesResponse) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type goCryptoTraderServiceGetAccountInfoStreamServer struct {
|
||||
type goCryptoTraderServiceGetAccountBalancesStreamServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *goCryptoTraderServiceGetAccountInfoStreamServer) Send(m *GetAccountInfoResponse) error {
|
||||
func (x *goCryptoTraderServiceGetAccountBalancesStreamServer) Send(m *GetAccountBalancesResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
@@ -4082,12 +4082,12 @@ var GoCryptoTraderService_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _GoCryptoTraderService_GetOrderbooks_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAccountInfo",
|
||||
Handler: _GoCryptoTraderService_GetAccountInfo_Handler,
|
||||
MethodName: "GetAccountBalances",
|
||||
Handler: _GoCryptoTraderService_GetAccountBalances_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateAccountInfo",
|
||||
Handler: _GoCryptoTraderService_UpdateAccountInfo_Handler,
|
||||
MethodName: "UpdateAccountBalances",
|
||||
Handler: _GoCryptoTraderService_UpdateAccountBalances_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetConfig",
|
||||
@@ -4456,8 +4456,8 @@ var GoCryptoTraderService_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "GetAccountInfoStream",
|
||||
Handler: _GoCryptoTraderService_GetAccountInfoStream_Handler,
|
||||
StreamName: "GetAccountBalancesStream",
|
||||
Handler: _GoCryptoTraderService_GetAccountBalancesStream_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user