types

package
v0.0.0-...-018c514 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 35 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 = "claimsmanager"
	// StoreKey defines the primary module store key.
	StoreKey = ModuleName
	// QuerierRoute is the querier route for the claimsmanager store.
	QuerierRoute = StoreKey
)

Variables

View Source
var (
	ErrInvalidLengthClaimsmanager        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowClaimsmanager          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupClaimsmanager = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrUndefinedAttribute   = sdkioerrors.Register(ModuleName, 1, "expected attribute not defined")
	ErrNegativeAttribute    = sdkioerrors.Register(ModuleName, 2, "expected attribute must not be negative")
	ErrNotPositive          = sdkioerrors.Register(ModuleName, 3, "expected attribute must be positive")
	ErrClaimTypeOutOfBounds = sdkioerrors.Register(ModuleName, 4, fmt.Sprintf("invalid claim type, expects range [1-%d]", len(ClaimType_value)-1))
)

x/claimsmanager module sentinel errors.

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 (
	KeyPrefixClaim          = []byte{0x00}
	KeyPrefixLastEpochClaim = []byte{0x01}
	KeySelfConsensusState   = []byte{0x02}
)
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 ClaimType_name = map[int32]string{
	0: "ClaimTypeUndefined",
	1: "ClaimTypeLiquidToken",
	2: "ClaimTypeOsmosisPool",
	3: "ClaimTypeCrescentPool",
	4: "ClaimTypeSifchainPool",
}
View Source
var ClaimType_value = map[string]int32{
	"ClaimTypeUndefined":    0,
	"ClaimTypeLiquidToken":  1,
	"ClaimTypeOsmosisPool":  2,
	"ClaimTypeCrescentPool": 3,
	"ClaimTypeSifchainPool": 4,
}
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func GetGenericKeyClaim

func GetGenericKeyClaim(key []byte, chainID, address string, module ClaimType, srcChainID string) []byte

GetGenericKeyClaim returns the key for storing a given claim.

func GetKeyClaim

func GetKeyClaim(chainID, address string, module ClaimType, srcChainID string) []byte

func GetKeyLastEpochClaim

func GetKeyLastEpochClaim(chainID, address string, module ClaimType, srcChainID string) []byte

func GetPrefixClaim

func GetPrefixClaim(chainID string) []byte

func GetPrefixLastEpochClaim

func GetPrefixLastEpochClaim(chainID string) []byte

func GetPrefixLastEpochUserClaim

func GetPrefixLastEpochUserClaim(chainID, address string) []byte

func GetPrefixUserClaim

func GetPrefixUserClaim(chainID, address string) []byte

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for claimsmanager module.

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(_ *codec.LegacyAmino)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

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

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Claim

type Claim struct {
	UserAddress   string    `protobuf:"bytes,1,opt,name=user_address,json=userAddress,proto3" json:"user_address,omitempty"`
	ChainId       string    `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	Module        ClaimType `protobuf:"varint,3,opt,name=module,proto3,enum=quicksilver.claimsmanager.v1.ClaimType" json:"module,omitempty"`
	SourceChainId string    `protobuf:"bytes,4,opt,name=source_chain_id,json=sourceChainId,proto3" json:"source_chain_id,omitempty"`
	Amount        uint64    `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"`
}

Claim define the users claim for holding assets within a given zone.

func (*Claim) Descriptor

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

func (*Claim) Marshal

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

func (*Claim) MarshalTo

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

func (*Claim) MarshalToSizedBuffer

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

func (*Claim) ProtoMessage

func (*Claim) ProtoMessage()

func (*Claim) Reset

func (m *Claim) Reset()

func (*Claim) Size

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

func (*Claim) String

func (m *Claim) String() string

func (*Claim) Unmarshal

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

func (*Claim) ValidateBasic

func (c *Claim) ValidateBasic() error

ValidateBasic performs stateless validation of a Claim.

func (*Claim) XXX_DiscardUnknown

func (m *Claim) XXX_DiscardUnknown()

func (*Claim) XXX_Marshal

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

func (*Claim) XXX_Merge

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

func (*Claim) XXX_Size

func (m *Claim) XXX_Size() int

func (*Claim) XXX_Unmarshal

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

type ClaimType

type ClaimType int32
const (
	// Undefined action (per protobuf spec)
	ClaimTypeUndefined    ClaimType = 0
	ClaimTypeLiquidToken  ClaimType = 1
	ClaimTypeOsmosisPool  ClaimType = 2
	ClaimTypeCrescentPool ClaimType = 3
	ClaimTypeSifchainPool ClaimType = 4
)

func (ClaimType) EnumDescriptor

func (ClaimType) EnumDescriptor() ([]byte, []int)

func (ClaimType) String

func (x ClaimType) String() string

type GenesisState

type GenesisState struct {
	Params Params   `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Claims []*Claim `protobuf:"bytes,2,rep,name=claims,proto3" json:"claims,omitempty"`
}

GenesisState defines the claimsmanager module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns the default ics genesis state.

func NewGenesisState

func NewGenesisState(params Params) *GenesisState

func (*GenesisState) Descriptor

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

func (*GenesisState) GetClaims

func (m *GenesisState) GetClaims() []*Claim

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, 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 validates the provided genesis state to ensure the expected invariants holds.

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 MsgClient

type MsgClient interface {
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
}

MsgServer is the server API for Msg service.

type Params

type Params struct {
}

Params holds parameters for the claimsmanager module.

func DefaultParams

func DefaultParams() Params

DefaultParams default claimsmanager params.

func NewParams

func NewParams() Params

NewParams creates a new claimsmanager Params instance.

func (*Params) Descriptor

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

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs implements params.ParamSet.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (*Params) String

func (p *Params) String() string

String implements the Stringer interface.

func (*Params) Unmarshal

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

func (*Params) Validate

func (p *Params) Validate() error

Validate validates params.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type Proof

type Proof struct {
	Key       []byte           `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Data      []byte           `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	ProofOps  *crypto.ProofOps `protobuf:"bytes,3,opt,name=proof_ops,proto3" json:"proof_ops,omitempty"`
	Height    int64            `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
	ProofType string           `protobuf:"bytes,5,opt,name=proof_type,proto3" json:"proof_type,omitempty"`
}

Proof defines a type used to cryptographically prove a claim.

func (*Proof) Descriptor

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

func (*Proof) Marshal

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

func (*Proof) MarshalTo

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

func (*Proof) MarshalToSizedBuffer

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

func (*Proof) ProtoMessage

func (*Proof) ProtoMessage()

func (*Proof) Reset

func (m *Proof) Reset()

func (*Proof) Size

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

func (*Proof) String

func (m *Proof) String() string

func (*Proof) Unmarshal

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

func (*Proof) ValidateBasic

func (p *Proof) ValidateBasic() error

ValidateBasic performs stateless validation for Proof.

func (*Proof) XXX_DiscardUnknown

func (m *Proof) XXX_DiscardUnknown()

func (*Proof) XXX_Marshal

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

func (*Proof) XXX_Merge

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

func (*Proof) XXX_Size

func (m *Proof) XXX_Size() int

func (*Proof) XXX_Unmarshal

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

type QueryClaimsRequest

type QueryClaimsRequest struct {
	ChainId    string             `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"`
	Address    string             `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryClaimsRequest is the request type for the Query/Claims RPC method.

func (*QueryClaimsRequest) Descriptor

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

func (*QueryClaimsRequest) GetAddress

func (m *QueryClaimsRequest) GetAddress() string

func (*QueryClaimsRequest) GetChainId

func (m *QueryClaimsRequest) GetChainId() string

func (*QueryClaimsRequest) GetPagination

func (m *QueryClaimsRequest) GetPagination() *query.PageRequest

func (*QueryClaimsRequest) Marshal

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

func (*QueryClaimsRequest) MarshalTo

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

func (*QueryClaimsRequest) MarshalToSizedBuffer

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

func (*QueryClaimsRequest) ProtoMessage

func (*QueryClaimsRequest) ProtoMessage()

func (*QueryClaimsRequest) Reset

func (m *QueryClaimsRequest) Reset()

func (*QueryClaimsRequest) Size

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

func (*QueryClaimsRequest) String

func (m *QueryClaimsRequest) String() string

func (*QueryClaimsRequest) Unmarshal

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

func (*QueryClaimsRequest) XXX_DiscardUnknown

func (m *QueryClaimsRequest) XXX_DiscardUnknown()

func (*QueryClaimsRequest) XXX_Marshal

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

func (*QueryClaimsRequest) XXX_Merge

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

func (*QueryClaimsRequest) XXX_Size

func (m *QueryClaimsRequest) XXX_Size() int

func (*QueryClaimsRequest) XXX_Unmarshal

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

type QueryClaimsResponse

type QueryClaimsResponse struct {
	Claims     []Claim             `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryClaimsResponse is the response type for the Query/Claims RPC method.

func (*QueryClaimsResponse) Descriptor

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

func (*QueryClaimsResponse) GetClaims

func (m *QueryClaimsResponse) GetClaims() []Claim

func (*QueryClaimsResponse) GetPagination

func (m *QueryClaimsResponse) GetPagination() *query.PageResponse

func (*QueryClaimsResponse) Marshal

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

func (*QueryClaimsResponse) MarshalTo

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

func (*QueryClaimsResponse) MarshalToSizedBuffer

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

func (*QueryClaimsResponse) ProtoMessage

func (*QueryClaimsResponse) ProtoMessage()

func (*QueryClaimsResponse) Reset

func (m *QueryClaimsResponse) Reset()

func (*QueryClaimsResponse) Size

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

func (*QueryClaimsResponse) String

func (m *QueryClaimsResponse) String() string

func (*QueryClaimsResponse) Unmarshal

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

func (*QueryClaimsResponse) XXX_DiscardUnknown

func (m *QueryClaimsResponse) XXX_DiscardUnknown()

func (*QueryClaimsResponse) XXX_Marshal

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

func (*QueryClaimsResponse) XXX_Merge

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

func (*QueryClaimsResponse) XXX_Size

func (m *QueryClaimsResponse) XXX_Size() int

func (*QueryClaimsResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Claims returns all zone claims from the current epoch.
	Claims(ctx context.Context, in *QueryClaimsRequest, opts ...grpc.CallOption) (*QueryClaimsResponse, error)
	// LastEpochClaims returns all zone claims from the last epoch.
	LastEpochClaims(ctx context.Context, in *QueryClaimsRequest, opts ...grpc.CallOption) (*QueryClaimsResponse, error)
	// UserClaims returns all zone claims for a given address from the current epoch.
	UserClaims(ctx context.Context, in *QueryClaimsRequest, opts ...grpc.CallOption) (*QueryClaimsResponse, error)
	// UserLastEpochClaims returns all zone claims for a given address from the last epoch.
	UserLastEpochClaims(ctx context.Context, in *QueryClaimsRequest, opts ...grpc.CallOption) (*QueryClaimsResponse, 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 {
	// Claims returns all zone claims from the current epoch.
	Claims(context.Context, *QueryClaimsRequest) (*QueryClaimsResponse, error)
	// LastEpochClaims returns all zone claims from the last epoch.
	LastEpochClaims(context.Context, *QueryClaimsRequest) (*QueryClaimsResponse, error)
	// UserClaims returns all zone claims for a given address from the current epoch.
	UserClaims(context.Context, *QueryClaimsRequest) (*QueryClaimsResponse, error)
	// UserLastEpochClaims returns all zone claims for a given address from the last epoch.
	UserLastEpochClaims(context.Context, *QueryClaimsRequest) (*QueryClaimsResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Claims

func (*UnimplementedQueryServer) LastEpochClaims

func (*UnimplementedQueryServer) UserClaims

func (*UnimplementedQueryServer) UserLastEpochClaims

Jump to

Keyboard shortcuts

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