Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type AccountKeeper
- type BankKeeper
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryServer
- type SupplyRequest
- func (*SupplyRequest) Descriptor() ([]byte, []int)
- func (m *SupplyRequest) Marshal() (dAtA []byte, err error)
- func (m *SupplyRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *SupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SupplyRequest) ProtoMessage()
- func (m *SupplyRequest) Reset()
- func (m *SupplyRequest) Size() (n int)
- func (m *SupplyRequest) String() string
- func (m *SupplyRequest) Unmarshal(dAtA []byte) error
- func (m *SupplyRequest) XXX_DiscardUnknown()
- func (m *SupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SupplyRequest) XXX_Merge(src proto.Message)
- func (m *SupplyRequest) XXX_Size() int
- func (m *SupplyRequest) XXX_Unmarshal(b []byte) error
- type SupplyResponse
- func (*SupplyResponse) Descriptor() ([]byte, []int)
- func (m *SupplyResponse) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins
- func (m *SupplyResponse) Marshal() (dAtA []byte, err error)
- func (m *SupplyResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *SupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SupplyResponse) ProtoMessage()
- func (m *SupplyResponse) Reset()
- func (m *SupplyResponse) Size() (n int)
- func (m *SupplyResponse) String() string
- func (m *SupplyResponse) Unmarshal(dAtA []byte) error
- func (m *SupplyResponse) XXX_DiscardUnknown()
- func (m *SupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SupplyResponse) XXX_Merge(src proto.Message)
- func (m *SupplyResponse) XXX_Size() int
- func (m *SupplyResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedQueryServer
- type VestingAccounts
- func (*VestingAccounts) Descriptor() ([]byte, []int)
- func (m *VestingAccounts) GetAddresses() []string
- func (m *VestingAccounts) Marshal() (dAtA []byte, err error)
- func (m *VestingAccounts) MarshalTo(dAtA []byte) (int, error)
- func (m *VestingAccounts) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VestingAccounts) ProtoMessage()
- func (m *VestingAccounts) Reset()
- func (m *VestingAccounts) Size() (n int)
- func (m *VestingAccounts) String() string
- func (m *VestingAccounts) Unmarshal(dAtA []byte) error
- func (m *VestingAccounts) XXX_DiscardUnknown()
- func (m *VestingAccounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VestingAccounts) XXX_Merge(src proto.Message)
- func (m *VestingAccounts) XXX_Size() int
- func (m *VestingAccounts) XXX_Unmarshal(b []byte) error
Constants ¶
const ( // ModuleName defines the module name ModuleName = "supply" // StoreKey defines the primary module store key StoreKey = ModuleName // RouterKey defines the module's message routing key RouterKey = ModuleName // QuerierRoute defines the module's query routing key QuerierRoute = ModuleName )
const ( // QueryTotalSupply defines rest route for total supply QueryTotalSupply = "total_supply" // QueryLiquidSupply defines rest route for liquid supply QueryLiquidSupply = "liquid_supply" )
Variables ¶
var ( ErrInvalidLengthAccounts = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAccounts = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAccounts = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( // VestingAccountsKey for storing vesting account addresses VestingAccountsKey = []byte("vestingAccounts") )
Functions ¶
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
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. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetModuleAddress(moduleName string) sdk.AccAddress IterateAccounts(sdk.Context, func(types.AccountI) bool) }
AccountKeeper defines the account contract that must be fulfilled when creating a x/supply keeper.
type BankKeeper ¶
type BankKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins GetSupply(ctx sdk.Context, denom string) sdk.Coin LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins }
BankKeeper defines the bank contract that must be fulfilled when creating a x/supply keeper.
type GenesisState ¶
type GenesisState struct { }
GenesisState defines the capability module's genesis state. TODO: currently left empty (for versioning), later, it may include fields needed for custom capabilities (subscriptions, vaultable accounts, ...)
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default Capability genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface { // TotalSupply queries the total supply of all coins. TotalSupply(ctx context.Context, in *SupplyRequest, opts ...grpc.CallOption) (*SupplyResponse, error) // LiquidSupply queries the liquid supply of all coins. LiquidSupply(ctx context.Context, in *SupplyRequest, opts ...grpc.CallOption) (*SupplyResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryServer ¶
type QueryServer interface { // TotalSupply queries the total supply of all coins. TotalSupply(context.Context, *SupplyRequest) (*SupplyResponse, error) // LiquidSupply queries the liquid supply of all coins. LiquidSupply(context.Context, *SupplyRequest) (*SupplyResponse, error) }
QueryServer is the server API for Query service.
type SupplyRequest ¶
type SupplyRequest struct { }
SupplyRequest is the request type for the Query/TotalSupply RPC method.
func NewSupplyRequest ¶
func NewSupplyRequest() *SupplyRequest
NewSupplyRequest returns a new supply request
func (*SupplyRequest) Descriptor ¶
func (*SupplyRequest) Descriptor() ([]byte, []int)
func (*SupplyRequest) Marshal ¶
func (m *SupplyRequest) Marshal() (dAtA []byte, err error)
func (*SupplyRequest) MarshalToSizedBuffer ¶
func (m *SupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SupplyRequest) ProtoMessage ¶
func (*SupplyRequest) ProtoMessage()
func (*SupplyRequest) Reset ¶
func (m *SupplyRequest) Reset()
func (*SupplyRequest) Size ¶
func (m *SupplyRequest) Size() (n int)
func (*SupplyRequest) String ¶
func (m *SupplyRequest) String() string
func (*SupplyRequest) Unmarshal ¶
func (m *SupplyRequest) Unmarshal(dAtA []byte) error
func (*SupplyRequest) XXX_DiscardUnknown ¶
func (m *SupplyRequest) XXX_DiscardUnknown()
func (*SupplyRequest) XXX_Marshal ¶
func (m *SupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SupplyRequest) XXX_Merge ¶
func (m *SupplyRequest) XXX_Merge(src proto.Message)
func (*SupplyRequest) XXX_Size ¶
func (m *SupplyRequest) XXX_Size() int
func (*SupplyRequest) XXX_Unmarshal ¶
func (m *SupplyRequest) XXX_Unmarshal(b []byte) error
type SupplyResponse ¶
type SupplyResponse struct { // supply is the supply of the coins Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` }
SupplyResponse is the response type for the Query/TotalSupply RPC method
func (*SupplyResponse) Descriptor ¶
func (*SupplyResponse) Descriptor() ([]byte, []int)
func (*SupplyResponse) GetSupply ¶
func (m *SupplyResponse) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins
func (*SupplyResponse) Marshal ¶
func (m *SupplyResponse) Marshal() (dAtA []byte, err error)
func (*SupplyResponse) MarshalToSizedBuffer ¶
func (m *SupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SupplyResponse) ProtoMessage ¶
func (*SupplyResponse) ProtoMessage()
func (*SupplyResponse) Reset ¶
func (m *SupplyResponse) Reset()
func (*SupplyResponse) Size ¶
func (m *SupplyResponse) Size() (n int)
func (*SupplyResponse) String ¶
func (m *SupplyResponse) String() string
func (*SupplyResponse) Unmarshal ¶
func (m *SupplyResponse) Unmarshal(dAtA []byte) error
func (*SupplyResponse) XXX_DiscardUnknown ¶
func (m *SupplyResponse) XXX_DiscardUnknown()
func (*SupplyResponse) XXX_Marshal ¶
func (m *SupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SupplyResponse) XXX_Merge ¶
func (m *SupplyResponse) XXX_Merge(src proto.Message)
func (*SupplyResponse) XXX_Size ¶
func (m *SupplyResponse) XXX_Size() int
func (*SupplyResponse) XXX_Unmarshal ¶
func (m *SupplyResponse) XXX_Unmarshal(b []byte) error
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) LiquidSupply ¶
func (*UnimplementedQueryServer) LiquidSupply(ctx context.Context, req *SupplyRequest) (*SupplyResponse, error)
func (*UnimplementedQueryServer) TotalSupply ¶
func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *SupplyRequest) (*SupplyResponse, error)
type VestingAccounts ¶
type VestingAccounts struct { // addresses defines addresses of all the vesting accounts at genesis Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` }
VestingAccounts stored in keeper
func (*VestingAccounts) Descriptor ¶
func (*VestingAccounts) Descriptor() ([]byte, []int)
func (*VestingAccounts) GetAddresses ¶
func (m *VestingAccounts) GetAddresses() []string
func (*VestingAccounts) Marshal ¶
func (m *VestingAccounts) Marshal() (dAtA []byte, err error)
func (*VestingAccounts) MarshalToSizedBuffer ¶
func (m *VestingAccounts) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VestingAccounts) ProtoMessage ¶
func (*VestingAccounts) ProtoMessage()
func (*VestingAccounts) Reset ¶
func (m *VestingAccounts) Reset()
func (*VestingAccounts) Size ¶
func (m *VestingAccounts) Size() (n int)
func (*VestingAccounts) String ¶
func (m *VestingAccounts) String() string
func (*VestingAccounts) Unmarshal ¶
func (m *VestingAccounts) Unmarshal(dAtA []byte) error
func (*VestingAccounts) XXX_DiscardUnknown ¶
func (m *VestingAccounts) XXX_DiscardUnknown()
func (*VestingAccounts) XXX_Marshal ¶
func (m *VestingAccounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VestingAccounts) XXX_Merge ¶
func (m *VestingAccounts) XXX_Merge(src proto.Message)
func (*VestingAccounts) XXX_Size ¶
func (m *VestingAccounts) XXX_Size() int
func (*VestingAccounts) XXX_Unmarshal ¶
func (m *VestingAccounts) XXX_Unmarshal(b []byte) error