types

package
v1.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "token"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	ErrInvalidLengthEvents        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvents          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	BalancePrefix = []byte{0x01} // prefix for keys that store balance
)

KVStore keys

Functions

func RegisterCodec

func RegisterCodec(_ *codec.LegacyAmino)

func RegisterInterfaces added in v1.5.0

func RegisterInterfaces(_ cdctypes.InterfaceRegistry)

func RegisterQueryHandler added in v1.5.0

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v1.5.0

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 added in v1.5.0

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 added in v1.5.0

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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v1.5.0

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type BalanceRequest added in v1.5.0

type BalanceRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

func (*BalanceRequest) Descriptor added in v1.5.0

func (*BalanceRequest) Descriptor() ([]byte, []int)

func (*BalanceRequest) Marshal added in v1.5.0

func (m *BalanceRequest) Marshal() (dAtA []byte, err error)

func (*BalanceRequest) MarshalTo added in v1.5.0

func (m *BalanceRequest) MarshalTo(dAtA []byte) (int, error)

func (*BalanceRequest) MarshalToSizedBuffer added in v1.5.0

func (m *BalanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BalanceRequest) ProtoMessage added in v1.5.0

func (*BalanceRequest) ProtoMessage()

func (*BalanceRequest) Reset added in v1.5.0

func (m *BalanceRequest) Reset()

func (*BalanceRequest) Size added in v1.5.0

func (m *BalanceRequest) Size() (n int)

func (*BalanceRequest) String added in v1.5.0

func (m *BalanceRequest) String() string

func (*BalanceRequest) Unmarshal added in v1.5.0

func (m *BalanceRequest) Unmarshal(dAtA []byte) error

func (*BalanceRequest) XXX_DiscardUnknown added in v1.5.0

func (m *BalanceRequest) XXX_DiscardUnknown()

func (*BalanceRequest) XXX_Marshal added in v1.5.0

func (m *BalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BalanceRequest) XXX_Merge added in v1.5.0

func (m *BalanceRequest) XXX_Merge(src proto.Message)

func (*BalanceRequest) XXX_Size added in v1.5.0

func (m *BalanceRequest) XXX_Size() int

func (*BalanceRequest) XXX_Unmarshal added in v1.5.0

func (m *BalanceRequest) XXX_Unmarshal(b []byte) error

type BalanceResponse added in v1.5.0

type BalanceResponse struct {
	Balance types.DecProto `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance"`
}

func (*BalanceResponse) Descriptor added in v1.5.0

func (*BalanceResponse) Descriptor() ([]byte, []int)

func (*BalanceResponse) GetBalance added in v1.5.0

func (m *BalanceResponse) GetBalance() types.DecProto

func (*BalanceResponse) Marshal added in v1.5.0

func (m *BalanceResponse) Marshal() (dAtA []byte, err error)

func (*BalanceResponse) MarshalTo added in v1.5.0

func (m *BalanceResponse) MarshalTo(dAtA []byte) (int, error)

func (*BalanceResponse) MarshalToSizedBuffer added in v1.5.0

func (m *BalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BalanceResponse) ProtoMessage added in v1.5.0

func (*BalanceResponse) ProtoMessage()

func (*BalanceResponse) Reset added in v1.5.0

func (m *BalanceResponse) Reset()

func (*BalanceResponse) Size added in v1.5.0

func (m *BalanceResponse) Size() (n int)

func (*BalanceResponse) String added in v1.5.0

func (m *BalanceResponse) String() string

func (*BalanceResponse) Unmarshal added in v1.5.0

func (m *BalanceResponse) Unmarshal(dAtA []byte) error

func (*BalanceResponse) XXX_DiscardUnknown added in v1.5.0

func (m *BalanceResponse) XXX_DiscardUnknown()

func (*BalanceResponse) XXX_Marshal added in v1.5.0

func (m *BalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BalanceResponse) XXX_Merge added in v1.5.0

func (m *BalanceResponse) XXX_Merge(src proto.Message)

func (*BalanceResponse) XXX_Size added in v1.5.0

func (m *BalanceResponse) XXX_Size() int

func (*BalanceResponse) XXX_Unmarshal added in v1.5.0

func (m *BalanceResponse) XXX_Unmarshal(b []byte) error

type EventRewardDistribution added in v1.5.0

type EventRewardDistribution struct {
	Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
	Delta   types.DecProto                                `protobuf:"bytes,2,opt,name=delta,proto3" json:"delta"`
	Reward  types.Coin                                    `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward"`
}

func (*EventRewardDistribution) Descriptor added in v1.5.0

func (*EventRewardDistribution) Descriptor() ([]byte, []int)

func (*EventRewardDistribution) GetAddress added in v1.5.0

func (*EventRewardDistribution) GetDelta added in v1.5.0

func (m *EventRewardDistribution) GetDelta() types.DecProto

func (*EventRewardDistribution) GetReward added in v1.5.0

func (m *EventRewardDistribution) GetReward() types.Coin

func (*EventRewardDistribution) Marshal added in v1.5.0

func (m *EventRewardDistribution) Marshal() (dAtA []byte, err error)

func (*EventRewardDistribution) MarshalTo added in v1.5.0

func (m *EventRewardDistribution) MarshalTo(dAtA []byte) (int, error)

func (*EventRewardDistribution) MarshalToSizedBuffer added in v1.5.0

func (m *EventRewardDistribution) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EventRewardDistribution) ProtoMessage added in v1.5.0

func (*EventRewardDistribution) ProtoMessage()

func (*EventRewardDistribution) Reset added in v1.5.0

func (m *EventRewardDistribution) Reset()

func (*EventRewardDistribution) Size added in v1.5.0

func (m *EventRewardDistribution) Size() (n int)

func (*EventRewardDistribution) String added in v1.5.0

func (m *EventRewardDistribution) String() string

func (*EventRewardDistribution) Unmarshal added in v1.5.0

func (m *EventRewardDistribution) Unmarshal(dAtA []byte) error

func (*EventRewardDistribution) XXX_DiscardUnknown added in v1.5.0

func (m *EventRewardDistribution) XXX_DiscardUnknown()

func (*EventRewardDistribution) XXX_Marshal added in v1.5.0

func (m *EventRewardDistribution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventRewardDistribution) XXX_Merge added in v1.5.0

func (m *EventRewardDistribution) XXX_Merge(src proto.Message)

func (*EventRewardDistribution) XXX_Size added in v1.5.0

func (m *EventRewardDistribution) XXX_Size() int

func (*EventRewardDistribution) XXX_Unmarshal added in v1.5.0

func (m *EventRewardDistribution) XXX_Unmarshal(b []byte) error

type GenesisState added in v1.5.0

type GenesisState struct {
	Balances map[string]types.DecProto `` /* 147-byte string literal not displayed */
}

func DefaultGenesis added in v1.5.0

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func (*GenesisState) Descriptor added in v1.5.0

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetBalances added in v1.5.0

func (m *GenesisState) GetBalances() map[string]types.DecProto

func (*GenesisState) Marshal added in v1.5.0

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo added in v1.5.0

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer added in v1.5.0

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage added in v1.5.0

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v1.5.0

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v1.5.0

func (m *GenesisState) Size() (n int)

func (*GenesisState) String added in v1.5.0

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v1.5.0

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate added in v1.5.0

func (m GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown added in v1.5.0

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v1.5.0

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge added in v1.5.0

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size added in v1.5.0

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v1.5.0

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type QueryClient added in v1.5.0

type QueryClient interface {
	Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, 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 added in v1.5.0

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer added in v1.5.0

type QueryServer interface {
	Balance(context.Context, *BalanceRequest) (*BalanceResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer added in v1.5.0

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Balance added in v1.5.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL