types

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 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 = "supply"
	RouterKey  = ModuleName

	QuerierRoute = ModuleName

	QueryCirculatingSupply = "circulatingSupply"
	QueryTotalSupply       = "totalSupply"
)

Variables

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")
)

Functions

func NewDividerPoweredByExponent

func NewDividerPoweredByExponent(exponent uint64) sdk.Int

NewDividerPoweredByExponent takes the given exponent using it to power 10 to calculate the correct divider

func RegisterQueryHandler

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

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 QueryCirculatingRequest

type QueryCirculatingRequest struct {
	// coin denom to query the circulating supply for
	Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	// divider_exponent is a factor used to power the divider used to convert the
	// supply to the desired representation
	DividerExponent uint64 `protobuf:"varint,2,opt,name=divider_exponent,json=dividerExponent,proto3" json:"divider_exponent,omitempty"`
}

QueryCirculatingRequest is the request type for the Query/Circulating RPC method

func NewQueryCirculatingRequest

func NewQueryCirculatingRequest(denom string, dividerExponent uint64) *QueryCirculatingRequest

NewQueryCirculatingRequest returns a new QueryCirculatingRequest instance

func (*QueryCirculatingRequest) Descriptor

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

func (*QueryCirculatingRequest) Marshal

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

func (*QueryCirculatingRequest) MarshalTo

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

func (*QueryCirculatingRequest) MarshalToSizedBuffer

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

func (*QueryCirculatingRequest) ProtoMessage

func (*QueryCirculatingRequest) ProtoMessage()

func (*QueryCirculatingRequest) Reset

func (m *QueryCirculatingRequest) Reset()

func (*QueryCirculatingRequest) Size

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

func (*QueryCirculatingRequest) String

func (m *QueryCirculatingRequest) String() string

func (*QueryCirculatingRequest) Unmarshal

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

func (*QueryCirculatingRequest) XXX_DiscardUnknown

func (m *QueryCirculatingRequest) XXX_DiscardUnknown()

func (*QueryCirculatingRequest) XXX_Marshal

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

func (*QueryCirculatingRequest) XXX_Merge

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

func (*QueryCirculatingRequest) XXX_Size

func (m *QueryCirculatingRequest) XXX_Size() int

func (*QueryCirculatingRequest) XXX_Unmarshal

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

type QueryCirculatingResponse

type QueryCirculatingResponse struct {
	CirculatingSupply github_com_cosmos_cosmos_sdk_types.Int `` /* 152-byte string literal not displayed */
}

QueryCirculatingResponse is the response type for the Query/Circulating RPC method

func (*QueryCirculatingResponse) Descriptor

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

func (*QueryCirculatingResponse) Marshal

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

func (*QueryCirculatingResponse) MarshalTo

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

func (*QueryCirculatingResponse) MarshalToSizedBuffer

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

func (*QueryCirculatingResponse) ProtoMessage

func (*QueryCirculatingResponse) ProtoMessage()

func (*QueryCirculatingResponse) Reset

func (m *QueryCirculatingResponse) Reset()

func (*QueryCirculatingResponse) Size

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

func (*QueryCirculatingResponse) String

func (m *QueryCirculatingResponse) String() string

func (*QueryCirculatingResponse) Unmarshal

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

func (*QueryCirculatingResponse) XXX_DiscardUnknown

func (m *QueryCirculatingResponse) XXX_DiscardUnknown()

func (*QueryCirculatingResponse) XXX_Marshal

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

func (*QueryCirculatingResponse) XXX_Merge

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

func (*QueryCirculatingResponse) XXX_Size

func (m *QueryCirculatingResponse) XXX_Size() int

func (*QueryCirculatingResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Total queries the total supply of the given denom
	Total(ctx context.Context, in *QueryTotalRequest, opts ...grpc.CallOption) (*QueryTotalResponse, error)
	// Circulating queries the amount of tokens circulating in the market of the
	// given denom
	Circulating(ctx context.Context, in *QueryCirculatingRequest, opts ...grpc.CallOption) (*QueryCirculatingResponse, 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 {
	// Total queries the total supply of the given denom
	Total(context.Context, *QueryTotalRequest) (*QueryTotalResponse, error)
	// Circulating queries the amount of tokens circulating in the market of the
	// given denom
	Circulating(context.Context, *QueryCirculatingRequest) (*QueryCirculatingResponse, error)
}

QueryServer is the server API for Query service.

type QueryTotalRequest

type QueryTotalRequest struct {
	// coin denom to query the circulating supply for
	Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	// divider_exponent is a factor used to power the divider used to convert the
	// supply to the desired representation
	DividerExponent uint64 `protobuf:"varint,2,opt,name=divider_exponent,json=dividerExponent,proto3" json:"divider_exponent,omitempty"`
}

QueryTotalRequest is the request type for Query/Total RPC method

func NewQueryTotalRequest

func NewQueryTotalRequest(denom string, dividerExponent uint64) *QueryTotalRequest

NewQueryTotalRequest returns a QueryTotalRequest instance

func (*QueryTotalRequest) Descriptor

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

func (*QueryTotalRequest) Marshal

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

func (*QueryTotalRequest) MarshalTo

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

func (*QueryTotalRequest) MarshalToSizedBuffer

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

func (*QueryTotalRequest) ProtoMessage

func (*QueryTotalRequest) ProtoMessage()

func (*QueryTotalRequest) Reset

func (m *QueryTotalRequest) Reset()

func (*QueryTotalRequest) Size

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

func (*QueryTotalRequest) String

func (m *QueryTotalRequest) String() string

func (*QueryTotalRequest) Unmarshal

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

func (*QueryTotalRequest) XXX_DiscardUnknown

func (m *QueryTotalRequest) XXX_DiscardUnknown()

func (*QueryTotalRequest) XXX_Marshal

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

func (*QueryTotalRequest) XXX_Merge

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

func (*QueryTotalRequest) XXX_Size

func (m *QueryTotalRequest) XXX_Size() int

func (*QueryTotalRequest) XXX_Unmarshal

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

type QueryTotalResponse

type QueryTotalResponse struct {
	TotalSupply github_com_cosmos_cosmos_sdk_types.Int `` /* 134-byte string literal not displayed */
}

QueryTotalResponse is the response type for the Query/Total RPC method

func (*QueryTotalResponse) Descriptor

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

func (*QueryTotalResponse) Marshal

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

func (*QueryTotalResponse) MarshalTo

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

func (*QueryTotalResponse) MarshalToSizedBuffer

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

func (*QueryTotalResponse) ProtoMessage

func (*QueryTotalResponse) ProtoMessage()

func (*QueryTotalResponse) Reset

func (m *QueryTotalResponse) Reset()

func (*QueryTotalResponse) Size

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

func (*QueryTotalResponse) String

func (m *QueryTotalResponse) String() string

func (*QueryTotalResponse) Unmarshal

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

func (*QueryTotalResponse) XXX_DiscardUnknown

func (m *QueryTotalResponse) XXX_DiscardUnknown()

func (*QueryTotalResponse) XXX_Marshal

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

func (*QueryTotalResponse) XXX_Merge

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

func (*QueryTotalResponse) XXX_Size

func (m *QueryTotalResponse) XXX_Size() int

func (*QueryTotalResponse) XXX_Unmarshal

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

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Circulating

func (*UnimplementedQueryServer) Total

Jump to

Keyboard shortcuts

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