From 1ccd35eab82959d7f036b4e1ece3eff1c4881580 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Mon, 16 Dec 2024 10:59:35 -0500 Subject: [PATCH] feat(accountplus): Add query for accountplus account state (#2659) (cherry picked from commit 5fd53fc37e587ead622d258e9d2b6bf6a7169268) --- .../dydxprotocol/accountplus/query.lcd.ts | 10 +- .../accountplus/query.rpc.Query.ts | 16 +- .../codegen/dydxprotocol/accountplus/query.ts | 127 +++++ proto/dydxprotocol/accountplus/query.proto | 14 + protocol/x/accountplus/client/cli/query.go | 28 ++ protocol/x/accountplus/keeper/query.go | 23 + protocol/x/accountplus/types/query.pb.go | 471 ++++++++++++++++-- protocol/x/accountplus/types/query.pb.gw.go | 101 ++++ 8 files changed, 750 insertions(+), 40 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts index 6331bc8560..d0a5e9d697 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@osmonauts/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, GetAuthenticatorRequest, GetAuthenticatorResponseSDKType, GetAuthenticatorsRequest, GetAuthenticatorsResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, GetAuthenticatorRequest, GetAuthenticatorResponseSDKType, GetAuthenticatorsRequest, GetAuthenticatorsResponseSDKType, AccountStateRequest, AccountStateResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -12,6 +12,7 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.getAuthenticator = this.getAuthenticator.bind(this); this.getAuthenticators = this.getAuthenticators.bind(this); + this.accountState = this.accountState.bind(this); } /* Parameters queries the parameters of the module. */ @@ -34,5 +35,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/accountplus/authenticators/${params.account}`; return await this.req.get(endpoint); } + /* Queries for an account state (timestamp nonce). */ + + + async accountState(params: AccountStateRequest): Promise { + const endpoint = `dydxprotocol/accountplus/account_state/${params.address}`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts index ab66285450..85bf8dcafc 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, GetAuthenticatorRequest, GetAuthenticatorResponse, GetAuthenticatorsRequest, GetAuthenticatorsResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, GetAuthenticatorRequest, GetAuthenticatorResponse, GetAuthenticatorsRequest, GetAuthenticatorsResponse, AccountStateRequest, AccountStateResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -13,6 +13,9 @@ export interface Query { /** Queries all authenticators for a given account. */ getAuthenticators(request: GetAuthenticatorsRequest): Promise; + /** Queries for an account state (timestamp nonce). */ + + accountState(request: AccountStateRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -22,6 +25,7 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.getAuthenticator = this.getAuthenticator.bind(this); this.getAuthenticators = this.getAuthenticators.bind(this); + this.accountState = this.accountState.bind(this); } params(request: QueryParamsRequest = {}): Promise { @@ -42,6 +46,12 @@ export class QueryClientImpl implements Query { return promise.then(data => GetAuthenticatorsResponse.decode(new _m0.Reader(data))); } + accountState(request: AccountStateRequest): Promise { + const data = AccountStateRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.accountplus.Query", "AccountState", data); + return promise.then(data => AccountStateResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -57,6 +67,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { getAuthenticators(request: GetAuthenticatorsRequest): Promise { return queryService.getAuthenticators(request); + }, + + accountState(request: AccountStateRequest): Promise { + return queryService.accountState(request); } }; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts index 432a383d59..b109634853 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/query.ts @@ -1,7 +1,44 @@ +import { AccountState, AccountStateSDKType } from "./accountplus"; import { Params, ParamsSDKType } from "./params"; import { AccountAuthenticator, AccountAuthenticatorSDKType } from "./models"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../helpers"; +/** AccountStateRequest is request type for the Query/AccountState RPC method. */ + +export interface AccountStateRequest { + /** AccountStateRequest is request type for the Query/AccountState RPC method. */ + address: string; +} +/** AccountStateRequest is request type for the Query/AccountState RPC method. */ + +export interface AccountStateRequestSDKType { + /** AccountStateRequest is request type for the Query/AccountState RPC method. */ + address: string; +} +/** + * AccountStateResponse is response type for the Query/GetAccountState RPC + * method. + */ + +export interface AccountStateResponse { + /** + * AccountStateResponse is response type for the Query/GetAccountState RPC + * method. + */ + accountState?: AccountState; +} +/** + * AccountStateResponse is response type for the Query/GetAccountState RPC + * method. + */ + +export interface AccountStateResponseSDKType { + /** + * AccountStateResponse is response type for the Query/GetAccountState RPC + * method. + */ + account_state?: AccountStateSDKType; +} /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -65,6 +102,96 @@ export interface GetAuthenticatorResponseSDKType { account_authenticator?: AccountAuthenticatorSDKType; } +function createBaseAccountStateRequest(): AccountStateRequest { + return { + address: "" + }; +} + +export const AccountStateRequest = { + encode(message: AccountStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountStateRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): AccountStateRequest { + const message = createBaseAccountStateRequest(); + message.address = object.address ?? ""; + return message; + } + +}; + +function createBaseAccountStateResponse(): AccountStateResponse { + return { + accountState: undefined + }; +} + +export const AccountStateResponse = { + encode(message: AccountStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.accountState !== undefined) { + AccountState.encode(message.accountState, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountStateResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.accountState = AccountState.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): AccountStateResponse { + const message = createBaseAccountStateResponse(); + message.accountState = object.accountState !== undefined && object.accountState !== null ? AccountState.fromPartial(object.accountState) : undefined; + return message; + } + +}; + function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } diff --git a/proto/dydxprotocol/accountplus/query.proto b/proto/dydxprotocol/accountplus/query.proto index 5314055957..0262262615 100644 --- a/proto/dydxprotocol/accountplus/query.proto +++ b/proto/dydxprotocol/accountplus/query.proto @@ -3,6 +3,7 @@ package dydxprotocol.accountplus; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "dydxprotocol/accountplus/accountplus.proto"; import "dydxprotocol/accountplus/models.proto"; import "dydxprotocol/accountplus/params.proto"; @@ -28,8 +29,21 @@ service Query { option (google.api.http).get = "/dydxprotocol/accountplus/authenticators/{account}"; } + + // Queries for an account state (timestamp nonce). + rpc AccountState(AccountStateRequest) returns (AccountStateResponse) { + option (google.api.http).get = + "/dydxprotocol/accountplus/account_state/{address}"; + } } +// AccountStateRequest is request type for the Query/AccountState RPC method. +message AccountStateRequest { string address = 1; } + +// AccountStateResponse is response type for the Query/GetAccountState RPC +// method. +message AccountStateResponse { AccountState account_state = 1; } + // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} diff --git a/protocol/x/accountplus/client/cli/query.go b/protocol/x/accountplus/client/cli/query.go index 7201eb2f30..866edfc454 100644 --- a/protocol/x/accountplus/client/cli/query.go +++ b/protocol/x/accountplus/client/cli/query.go @@ -27,6 +27,7 @@ func GetQueryCmd() *cobra.Command { CmdQueryParam(), CmdQueryGetAuthenticator(), CmdQueryGetAllAuthenticators(), + CmdQueryAccountState(), ) return cmd } @@ -114,3 +115,30 @@ func CmdQueryGetAllAuthenticators() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +func CmdQueryAccountState() *cobra.Command { + cmd := &cobra.Command{ + Use: "account-state [address]", + Short: "Get account state for an address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.AccountState( + context.Background(), + &types.AccountStateRequest{ + Address: args[0], + }, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/protocol/x/accountplus/keeper/query.go b/protocol/x/accountplus/keeper/query.go index 0bbd00a257..2b7065797b 100644 --- a/protocol/x/accountplus/keeper/query.go +++ b/protocol/x/accountplus/keeper/query.go @@ -67,3 +67,26 @@ func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*t return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil } + +// AccountState returns the x/accountplus account state for an address +func (k Keeper) AccountState( + ctx context.Context, + request *types.AccountStateRequest, +) (*types.AccountStateResponse, error) { + if request == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + addr, err := sdk.AccAddressFromBech32(request.Address) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "not valid bech32 address") + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + // GetAccountState returns `empty, false` AccountState if the account does not exist. + accountState, _ := k.GetAccountState(sdkCtx, addr) + + return &types.AccountStateResponse{ + AccountState: &accountState, + }, nil +} diff --git a/protocol/x/accountplus/types/query.pb.go b/protocol/x/accountplus/types/query.pb.go index f850e057f1..ecfc23c071 100644 --- a/protocol/x/accountplus/types/query.pb.go +++ b/protocol/x/accountplus/types/query.pb.go @@ -29,6 +29,97 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// AccountStateRequest is request type for the Query/AccountState RPC method. +type AccountStateRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *AccountStateRequest) Reset() { *m = AccountStateRequest{} } +func (m *AccountStateRequest) String() string { return proto.CompactTextString(m) } +func (*AccountStateRequest) ProtoMessage() {} +func (*AccountStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3beaace7ec4b0b78, []int{0} +} +func (m *AccountStateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountStateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AccountStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountStateRequest.Merge(m, src) +} +func (m *AccountStateRequest) XXX_Size() int { + return m.Size() +} +func (m *AccountStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AccountStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountStateRequest proto.InternalMessageInfo + +func (m *AccountStateRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// AccountStateResponse is response type for the Query/GetAccountState RPC +// method. +type AccountStateResponse struct { + AccountState *AccountState `protobuf:"bytes,1,opt,name=account_state,json=accountState,proto3" json:"account_state,omitempty"` +} + +func (m *AccountStateResponse) Reset() { *m = AccountStateResponse{} } +func (m *AccountStateResponse) String() string { return proto.CompactTextString(m) } +func (*AccountStateResponse) ProtoMessage() {} +func (*AccountStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3beaace7ec4b0b78, []int{1} +} +func (m *AccountStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountStateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AccountStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountStateResponse.Merge(m, src) +} +func (m *AccountStateResponse) XXX_Size() int { + return m.Size() +} +func (m *AccountStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AccountStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountStateResponse proto.InternalMessageInfo + +func (m *AccountStateResponse) GetAccountState() *AccountState { + if m != nil { + return m.AccountState + } + return nil +} + // QueryParamsRequest is request type for the Query/Params RPC method. type QueryParamsRequest struct { } @@ -37,7 +128,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3beaace7ec4b0b78, []int{0} + return fileDescriptor_3beaace7ec4b0b78, []int{2} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +167,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3beaace7ec4b0b78, []int{1} + return fileDescriptor_3beaace7ec4b0b78, []int{3} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,7 +212,7 @@ func (m *GetAuthenticatorsRequest) Reset() { *m = GetAuthenticatorsReque func (m *GetAuthenticatorsRequest) String() string { return proto.CompactTextString(m) } func (*GetAuthenticatorsRequest) ProtoMessage() {} func (*GetAuthenticatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3beaace7ec4b0b78, []int{2} + return fileDescriptor_3beaace7ec4b0b78, []int{4} } func (m *GetAuthenticatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -166,7 +257,7 @@ func (m *GetAuthenticatorsResponse) Reset() { *m = GetAuthenticatorsResp func (m *GetAuthenticatorsResponse) String() string { return proto.CompactTextString(m) } func (*GetAuthenticatorsResponse) ProtoMessage() {} func (*GetAuthenticatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3beaace7ec4b0b78, []int{3} + return fileDescriptor_3beaace7ec4b0b78, []int{5} } func (m *GetAuthenticatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,7 +303,7 @@ func (m *GetAuthenticatorRequest) Reset() { *m = GetAuthenticatorRequest func (m *GetAuthenticatorRequest) String() string { return proto.CompactTextString(m) } func (*GetAuthenticatorRequest) ProtoMessage() {} func (*GetAuthenticatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3beaace7ec4b0b78, []int{4} + return fileDescriptor_3beaace7ec4b0b78, []int{6} } func (m *GetAuthenticatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -264,7 +355,7 @@ func (m *GetAuthenticatorResponse) Reset() { *m = GetAuthenticatorRespon func (m *GetAuthenticatorResponse) String() string { return proto.CompactTextString(m) } func (*GetAuthenticatorResponse) ProtoMessage() {} func (*GetAuthenticatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3beaace7ec4b0b78, []int{5} + return fileDescriptor_3beaace7ec4b0b78, []int{7} } func (m *GetAuthenticatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -301,6 +392,8 @@ func (m *GetAuthenticatorResponse) GetAccountAuthenticator() *AccountAuthenticat } func init() { + proto.RegisterType((*AccountStateRequest)(nil), "dydxprotocol.accountplus.AccountStateRequest") + proto.RegisterType((*AccountStateResponse)(nil), "dydxprotocol.accountplus.AccountStateResponse") proto.RegisterType((*QueryParamsRequest)(nil), "dydxprotocol.accountplus.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dydxprotocol.accountplus.QueryParamsResponse") proto.RegisterType((*GetAuthenticatorsRequest)(nil), "dydxprotocol.accountplus.GetAuthenticatorsRequest") @@ -314,38 +407,43 @@ func init() { } var fileDescriptor_3beaace7ec4b0b78 = []byte{ - // 486 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xde, 0xa9, 0xeb, 0x8a, 0xd3, 0x83, 0x75, 0xdc, 0x6a, 0x5c, 0x24, 0x86, 0x41, 0x61, 0x05, - 0x9b, 0xc1, 0x74, 0x4f, 0x82, 0x42, 0x8b, 0x28, 0x82,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0x88, 0xa3, 0xcd, 0x3c, 0x56, 0x66, 0x06, 0xc8, 0xbb, 0xa0, 0x19, 0xf1, - 0xdf, 0xcd, 0xf6, 0xbb, 0xe3, 0x89, 0x0d, 0x4e, 0x26, 0x36, 0xf8, 0x33, 0xb1, 0xc1, 0x97, 0xa9, - 0xdd, 0x3a, 0x99, 0xda, 0xad, 0x5f, 0x53, 0xbb, 0xf5, 0xfe, 0x49, 0x14, 0xcb, 0x61, 0xb1, 0xeb, - 0x06, 0x7c, 0x64, 0xce, 0xfd, 0x38, 0xd8, 0x08, 0x86, 0x34, 0x4e, 0xc9, 0xac, 0xb2, 0x6f, 0xec, - 0x92, 0xe3, 0x8c, 0x89, 0xdd, 0x8e, 0xea, 0x6e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x3e, - 0x4f, 0x88, 0x4d, 0x05, 0x00, 0x00, + // 574 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xd1, 0x6a, 0x13, 0x41, + 0x14, 0xcd, 0xd4, 0x36, 0xe2, 0xb4, 0x62, 0x9d, 0xa6, 0xba, 0x06, 0x59, 0xc3, 0xa0, 0x12, 0xc5, + 0xec, 0xd0, 0x24, 0x2f, 0x0a, 0x0a, 0x2d, 0xa2, 0x88, 0x3e, 0x68, 0x44, 0x04, 0x1f, 0x2c, 0xd3, + 0xdd, 0x61, 0xb3, 0x90, 0xec, 0x6c, 0x77, 0x66, 0xa5, 0x21, 0x04, 0xa1, 0x3f, 0xa0, 0xe0, 0x4f, + 0xf8, 0x09, 0xfe, 0x81, 0xf5, 0xad, 0xe0, 0x8b, 0x4f, 0x22, 0x89, 0x1f, 0x22, 0xd9, 0x9d, 0xc6, + 0x9d, 0x24, 0xcb, 0x26, 0x6f, 0x3b, 0x73, 0xcf, 0xbd, 0xf7, 0x9c, 0x73, 0x67, 0x2f, 0xbc, 0xe9, + 0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 0x0f, 0x62, + 0x31, 0x4d, 0x54, 0x5f, 0x50, 0x8c, 0xf8, 0xaf, 0x06, 0x7d, 0x05, 0x70, 0x23, 0xbd, 0x48, 0x50, + 0x6d, 0xc1, 0x85, 0xa3, 0x08, 0x5b, 0x8b, 0xc2, 0x15, 0xd7, 0xfb, 0x31, 0xd7, 0x06, 0xda, 0x21, + 0x79, 0x2b, 0x3b, 0x59, 0x83, 0xa4, 0xaf, 0x16, 0xe7, 0x60, 0xef, 0xed, 0xc9, 0xd0, 0x04, 0xa7, + 0x43, 0x13, 0xfc, 0x19, 0x9a, 0xe0, 0xf3, 0xc8, 0x2c, 0x9c, 0x8e, 0xcc, 0xc2, 0xaf, 0x91, 0x59, + 0x78, 0xf7, 0xd0, 0xf5, 0x64, 0x3b, 0x3a, 0xb0, 0x6c, 0xde, 0xd5, 0xcb, 0x7e, 0x68, 0xd6, 0xec, + 0x36, 0xf5, 0x7c, 0x32, 0xb9, 0x39, 0xd2, 0x5a, 0xc9, 0x5e, 0xc0, 0xc4, 0x41, 0x31, 0x8e, 0x36, + 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xbb, 0x87, 0xc0, 0xba, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -366,6 +464,8 @@ type QueryClient interface { GetAuthenticator(ctx context.Context, in *GetAuthenticatorRequest, opts ...grpc.CallOption) (*GetAuthenticatorResponse, error) // Queries all authenticators for a given account. GetAuthenticators(ctx context.Context, in *GetAuthenticatorsRequest, opts ...grpc.CallOption) (*GetAuthenticatorsResponse, error) + // Queries for an account state (timestamp nonce). + AccountState(ctx context.Context, in *AccountStateRequest, opts ...grpc.CallOption) (*AccountStateResponse, error) } type queryClient struct { @@ -403,6 +503,15 @@ func (c *queryClient) GetAuthenticators(ctx context.Context, in *GetAuthenticato return out, nil } +func (c *queryClient) AccountState(ctx context.Context, in *AccountStateRequest, opts ...grpc.CallOption) (*AccountStateResponse, error) { + out := new(AccountStateResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.accountplus.Query/AccountState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -411,6 +520,8 @@ type QueryServer interface { GetAuthenticator(context.Context, *GetAuthenticatorRequest) (*GetAuthenticatorResponse, error) // Queries all authenticators for a given account. GetAuthenticators(context.Context, *GetAuthenticatorsRequest) (*GetAuthenticatorsResponse, error) + // Queries for an account state (timestamp nonce). + AccountState(context.Context, *AccountStateRequest) (*AccountStateResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -426,6 +537,9 @@ func (*UnimplementedQueryServer) GetAuthenticator(ctx context.Context, req *GetA func (*UnimplementedQueryServer) GetAuthenticators(ctx context.Context, req *GetAuthenticatorsRequest) (*GetAuthenticatorsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAuthenticators not implemented") } +func (*UnimplementedQueryServer) AccountState(ctx context.Context, req *AccountStateRequest) (*AccountStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountState not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -485,6 +599,24 @@ func _Query_GetAuthenticators_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_AccountState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.accountplus.Query/AccountState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountState(ctx, req.(*AccountStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.accountplus.Query", HandlerType: (*QueryServer)(nil), @@ -501,11 +633,80 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetAuthenticators", Handler: _Query_GetAuthenticators_Handler, }, + { + MethodName: "AccountState", + Handler: _Query_AccountState_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/accountplus/query.proto", } +func (m *AccountStateRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AccountStateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AccountStateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AccountStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccountState != nil { + { + size, err := m.AccountState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -710,6 +911,32 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *AccountStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *AccountStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountState != nil { + l = m.AccountState.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 @@ -793,6 +1020,174 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *AccountStateRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccountStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AccountStateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccountStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccountState == nil { + m.AccountState = &AccountState{} + } + if err := m.AccountState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/accountplus/types/query.pb.gw.go b/protocol/x/accountplus/types/query.pb.gw.go index 490d4e2343..1383c0806c 100644 --- a/protocol/x/accountplus/types/query.pb.gw.go +++ b/protocol/x/accountplus/types/query.pb.gw.go @@ -181,6 +181,60 @@ func local_request_Query_GetAuthenticators_0(ctx context.Context, marshaler runt } +func request_Query_AccountState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AccountStateRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.AccountState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AccountState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AccountStateRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.AccountState(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -256,6 +310,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AccountState_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AccountState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -357,6 +434,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AccountState_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AccountState_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -366,6 +463,8 @@ var ( pattern_Query_GetAuthenticator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dydxprotocol", "accountplus", "authenticator", "account", "authenticator_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GetAuthenticators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dydxprotocol", "accountplus", "authenticators", "account"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AccountState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dydxprotocol", "accountplus", "account_state", "address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -374,4 +473,6 @@ var ( forward_Query_GetAuthenticator_0 = runtime.ForwardResponseMessage forward_Query_GetAuthenticators_0 = runtime.ForwardResponseMessage + + forward_Query_AccountState_0 = runtime.ForwardResponseMessage )