types

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeStake           = "stake"
	EventTypeUnstake         = "unstake"
	EventTypeBuyCreatorCoin  = "buy_creator_coin"
	EventTypeSellCreatorCoin = "sell_creator_coin"

	AttributeKeyVendorID  = "vendor_id"
	AttributeKeyPostID    = "post_id"
	AttributeKeyUsername  = "username"
	AttributeKeyCreator   = "creator"
	AttributeKeyBuyer     = "buyer"
	AttributeKeySeller    = "seller"
	AttributeKeyDelegator = "delegator"
	AttributeKeyValidator = "validator"
	AttributeKeyAmount    = "amount"

	AttributeValueCategory = ModuleName
)

curating module event types

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "stake"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// QuerierKey to be used for querierer msgs
	QuerierKey = ModuleName
)
View Source
const (
	TypeMsgStake          = "stake_stake"
	TypeMsgUnstake        = "stake_unstake"
	TypeMsgBuyCreatorCoin = "buy_creator_coin"
)

msg types

Variables

View Source
var (
	// error code 1 is reserved for internal ABCI error code
	ErrStaketNotFound     = sdkerrors.Register(ModuleName, 2, "stake not found")
	ErrAmountTooLarge     = sdkerrors.Register(ModuleName, 3, "unstake amount too large")
	ErrCurationNotExpired = sdkerrors.Register(ModuleName, 4, "post is still being curated")
)

x/curating 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 (
	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 (
	ErrInvalidLengthStake        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStake          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStake = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// KeyPrefixStake 0x00 | vendor_id | post_id | delegator -> Stake
	KeyPrefixStake = []byte{0x00}
)
View Source
var (
	// ModuleCdc references the global x/curating module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)

Functions

func PostKey

func PostKey(vendorID uint32, postID curatingtypes.PostID) []byte

PostKey is the key used to store stakes for a post

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the curating module interfaces to protobuf Any.

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func StakeKey

func StakeKey(vendorID uint32, postID curatingtypes.PostID, delegator sdk.AccAddress) []byte

StakeKey is the key used to store a stake

Types

type BankKeeper added in v0.7.0

type BankKeeper interface {
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type CurationKeeper

type CurationKeeper interface {
	GetPost(ctx sdk.Context, vendorID uint32, postID curatingtypes.PostID) (post curatingtypes.Post, found bool, err error)
	IteratePosts(ctx sdk.Context, vendorID uint32, cb func(post curatingtypes.Post) (stop bool))
}

CurationKeeper defines the expected interface for the curation module

type GenesisState

type GenesisState struct {
	Stakes Stakes `protobuf:"bytes,1,rep,name=stakes,proto3,castrepeated=Stakes" json:"stakes"`
}

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState - default GenesisState

func (*GenesisState) Descriptor

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

func (*GenesisState) GetStakes

func (m *GenesisState) GetStakes() Stakes

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 x/curating genesis parameters

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 MsgBuyCreatorCoin added in v0.7.0

type MsgBuyCreatorCoin struct {
	Username  string                                 `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty" yaml:"username"`
	Creator   string                                 `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"`
	Buyer     string                                 `protobuf:"bytes,3,opt,name=buyer,proto3" json:"buyer,omitempty" yaml:"buyer"`
	Validator string                                 `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty" yaml:"validator"`
	Amount    github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

func NewMsgBuyCreatorCoin added in v0.7.0

func NewMsgBuyCreatorCoin(
	username string,
	creator sdk.AccAddress,
	buyer sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Int,
) *MsgBuyCreatorCoin

NewMsgBuyCreatorCoin creates a new NewMsgBuyCreatorCoin instance

func (*MsgBuyCreatorCoin) Descriptor added in v0.7.0

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

func (*MsgBuyCreatorCoin) Equal added in v0.7.0

func (this *MsgBuyCreatorCoin) Equal(that interface{}) bool

func (*MsgBuyCreatorCoin) GetBuyer added in v0.7.0

func (m *MsgBuyCreatorCoin) GetBuyer() string

func (*MsgBuyCreatorCoin) GetCreator added in v0.7.0

func (m *MsgBuyCreatorCoin) GetCreator() string

func (MsgBuyCreatorCoin) GetSignBytes added in v0.7.0

func (msg MsgBuyCreatorCoin) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgBuyCreatorCoin) GetSigners added in v0.7.0

func (msg MsgBuyCreatorCoin) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgBuyCreatorCoin) GetUsername added in v0.7.0

func (m *MsgBuyCreatorCoin) GetUsername() string

func (*MsgBuyCreatorCoin) GetValidator added in v0.7.0

func (m *MsgBuyCreatorCoin) GetValidator() string

func (*MsgBuyCreatorCoin) Marshal added in v0.7.0

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

func (*MsgBuyCreatorCoin) MarshalTo added in v0.7.0

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

func (*MsgBuyCreatorCoin) MarshalToSizedBuffer added in v0.7.0

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

func (*MsgBuyCreatorCoin) ProtoMessage added in v0.7.0

func (*MsgBuyCreatorCoin) ProtoMessage()

func (*MsgBuyCreatorCoin) Reset added in v0.7.0

func (m *MsgBuyCreatorCoin) Reset()

func (MsgBuyCreatorCoin) Route added in v0.7.0

func (msg MsgBuyCreatorCoin) Route() string

Route implements sdk.Msg

func (*MsgBuyCreatorCoin) Size added in v0.7.0

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

func (*MsgBuyCreatorCoin) String added in v0.7.0

func (m *MsgBuyCreatorCoin) String() string

func (MsgBuyCreatorCoin) Type added in v0.7.0

func (msg MsgBuyCreatorCoin) Type() string

Type implements sdk.Msg

func (*MsgBuyCreatorCoin) Unmarshal added in v0.7.0

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

func (MsgBuyCreatorCoin) ValidateBasic added in v0.7.0

func (msg MsgBuyCreatorCoin) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgBuyCreatorCoin) XXX_DiscardUnknown added in v0.7.0

func (m *MsgBuyCreatorCoin) XXX_DiscardUnknown()

func (*MsgBuyCreatorCoin) XXX_Marshal added in v0.7.0

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

func (*MsgBuyCreatorCoin) XXX_Merge added in v0.7.0

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

func (*MsgBuyCreatorCoin) XXX_Size added in v0.7.0

func (m *MsgBuyCreatorCoin) XXX_Size() int

func (*MsgBuyCreatorCoin) XXX_Unmarshal added in v0.7.0

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

type MsgBuyCreatorCoinResponse added in v0.7.0

type MsgBuyCreatorCoinResponse struct {
}

func (*MsgBuyCreatorCoinResponse) Descriptor added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) Marshal added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) MarshalTo added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) MarshalToSizedBuffer added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) ProtoMessage added in v0.7.0

func (*MsgBuyCreatorCoinResponse) ProtoMessage()

func (*MsgBuyCreatorCoinResponse) Reset added in v0.7.0

func (m *MsgBuyCreatorCoinResponse) Reset()

func (*MsgBuyCreatorCoinResponse) Size added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) String added in v0.7.0

func (m *MsgBuyCreatorCoinResponse) String() string

func (*MsgBuyCreatorCoinResponse) Unmarshal added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) XXX_DiscardUnknown added in v0.7.0

func (m *MsgBuyCreatorCoinResponse) XXX_DiscardUnknown()

func (*MsgBuyCreatorCoinResponse) XXX_Marshal added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) XXX_Merge added in v0.7.0

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

func (*MsgBuyCreatorCoinResponse) XXX_Size added in v0.7.0

func (m *MsgBuyCreatorCoinResponse) XXX_Size() int

func (*MsgBuyCreatorCoinResponse) XXX_Unmarshal added in v0.7.0

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

type MsgClient

type MsgClient interface {
	Stake(ctx context.Context, in *MsgStake, opts ...grpc.CallOption) (*MsgStakeResponse, error)
	Unstake(ctx context.Context, in *MsgUnstake, opts ...grpc.CallOption) (*MsgUnstakeResponse, error)
	BuyCreatorCoin(ctx context.Context, in *MsgBuyCreatorCoin, opts ...grpc.CallOption) (*MsgBuyCreatorCoinResponse, error)
	SellCreatorCoin(ctx context.Context, in *MsgSellCreatorCoin, opts ...grpc.CallOption) (*MsgSellCreatorCoinResponse, error)
}

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 MsgSellCreatorCoin added in v0.8.0

type MsgSellCreatorCoin struct {
	Username  string                                 `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty" yaml:"username"`
	Creator   string                                 `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"`
	Seller    string                                 `protobuf:"bytes,3,opt,name=seller,proto3" json:"seller,omitempty" yaml:"seller"`
	Validator string                                 `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty" yaml:"validator"`
	Amount    github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

func NewMsgSellCreatorCoin added in v0.8.0

func NewMsgSellCreatorCoin(
	username string,
	creator sdk.AccAddress,
	seller sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Int,
) *MsgSellCreatorCoin

NewMsgSellCreatorCoin creates a new NewMsgSellCreatorCoin instance

func (*MsgSellCreatorCoin) Descriptor added in v0.8.0

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

func (*MsgSellCreatorCoin) Equal added in v0.8.0

func (this *MsgSellCreatorCoin) Equal(that interface{}) bool

func (*MsgSellCreatorCoin) GetCreator added in v0.8.0

func (m *MsgSellCreatorCoin) GetCreator() string

func (*MsgSellCreatorCoin) GetSeller added in v0.8.0

func (m *MsgSellCreatorCoin) GetSeller() string

func (MsgSellCreatorCoin) GetSignBytes added in v0.8.0

func (msg MsgSellCreatorCoin) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgSellCreatorCoin) GetSigners added in v0.8.0

func (msg MsgSellCreatorCoin) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgSellCreatorCoin) GetUsername added in v0.8.0

func (m *MsgSellCreatorCoin) GetUsername() string

func (*MsgSellCreatorCoin) GetValidator added in v0.8.0

func (m *MsgSellCreatorCoin) GetValidator() string

func (*MsgSellCreatorCoin) Marshal added in v0.8.0

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

func (*MsgSellCreatorCoin) MarshalTo added in v0.8.0

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

func (*MsgSellCreatorCoin) MarshalToSizedBuffer added in v0.8.0

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

func (*MsgSellCreatorCoin) ProtoMessage added in v0.8.0

func (*MsgSellCreatorCoin) ProtoMessage()

func (*MsgSellCreatorCoin) Reset added in v0.8.0

func (m *MsgSellCreatorCoin) Reset()

func (MsgSellCreatorCoin) Route added in v0.8.0

func (msg MsgSellCreatorCoin) Route() string

Route implements sdk.Msg

func (*MsgSellCreatorCoin) Size added in v0.8.0

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

func (*MsgSellCreatorCoin) String added in v0.8.0

func (m *MsgSellCreatorCoin) String() string

func (MsgSellCreatorCoin) Type added in v0.8.0

func (msg MsgSellCreatorCoin) Type() string

Type implements sdk.Msg

func (*MsgSellCreatorCoin) Unmarshal added in v0.8.0

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

func (MsgSellCreatorCoin) ValidateBasic added in v0.8.0

func (msg MsgSellCreatorCoin) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgSellCreatorCoin) XXX_DiscardUnknown added in v0.8.0

func (m *MsgSellCreatorCoin) XXX_DiscardUnknown()

func (*MsgSellCreatorCoin) XXX_Marshal added in v0.8.0

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

func (*MsgSellCreatorCoin) XXX_Merge added in v0.8.0

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

func (*MsgSellCreatorCoin) XXX_Size added in v0.8.0

func (m *MsgSellCreatorCoin) XXX_Size() int

func (*MsgSellCreatorCoin) XXX_Unmarshal added in v0.8.0

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

type MsgSellCreatorCoinResponse added in v0.8.0

type MsgSellCreatorCoinResponse struct {
}

func (*MsgSellCreatorCoinResponse) Descriptor added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) Marshal added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) MarshalTo added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) MarshalToSizedBuffer added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) ProtoMessage added in v0.8.0

func (*MsgSellCreatorCoinResponse) ProtoMessage()

func (*MsgSellCreatorCoinResponse) Reset added in v0.8.0

func (m *MsgSellCreatorCoinResponse) Reset()

func (*MsgSellCreatorCoinResponse) Size added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) String added in v0.8.0

func (m *MsgSellCreatorCoinResponse) String() string

func (*MsgSellCreatorCoinResponse) Unmarshal added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) XXX_DiscardUnknown added in v0.8.0

func (m *MsgSellCreatorCoinResponse) XXX_DiscardUnknown()

func (*MsgSellCreatorCoinResponse) XXX_Marshal added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) XXX_Merge added in v0.8.0

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

func (*MsgSellCreatorCoinResponse) XXX_Size added in v0.8.0

func (m *MsgSellCreatorCoinResponse) XXX_Size() int

func (*MsgSellCreatorCoinResponse) XXX_Unmarshal added in v0.8.0

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

type MsgServer

MsgServer is the server API for Msg service.

type MsgStake

type MsgStake struct {
	VendorID  uint32                                 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID    string                                 `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id" yaml:"post_id"`
	Delegator string                                 `protobuf:"bytes,3,opt,name=delegator,proto3" json:"delegator,omitempty" yaml:"delegator"`
	Validator string                                 `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty" yaml:"validator"`
	Amount    github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

func NewMsgStake

func NewMsgStake(
	vendorID uint32,
	postID string,
	delegator sdk.AccAddress,
	validator sdk.ValAddress,
	amount sdk.Int,
) *MsgStake

NewMsgStake creates a new MsgStake instance

func (*MsgStake) Descriptor

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

func (*MsgStake) Equal

func (this *MsgStake) Equal(that interface{}) bool

func (*MsgStake) GetDelegator

func (m *MsgStake) GetDelegator() string

func (*MsgStake) GetPostID

func (m *MsgStake) GetPostID() string

func (MsgStake) GetSignBytes

func (msg MsgStake) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgStake) GetSigners

func (msg MsgStake) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgStake) GetValidator

func (m *MsgStake) GetValidator() string

func (*MsgStake) GetVendorID

func (m *MsgStake) GetVendorID() uint32

func (*MsgStake) Marshal

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

func (*MsgStake) MarshalTo

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

func (*MsgStake) MarshalToSizedBuffer

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

func (*MsgStake) ProtoMessage

func (*MsgStake) ProtoMessage()

func (*MsgStake) Reset

func (m *MsgStake) Reset()

func (MsgStake) Route

func (msg MsgStake) Route() string

Route implements sdk.Msg

func (*MsgStake) Size

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

func (*MsgStake) String

func (m *MsgStake) String() string

func (MsgStake) Type

func (msg MsgStake) Type() string

Type implements sdk.Msg

func (*MsgStake) Unmarshal

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

func (MsgStake) ValidateBasic

func (msg MsgStake) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgStake) XXX_DiscardUnknown

func (m *MsgStake) XXX_DiscardUnknown()

func (*MsgStake) XXX_Marshal

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

func (*MsgStake) XXX_Merge

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

func (*MsgStake) XXX_Size

func (m *MsgStake) XXX_Size() int

func (*MsgStake) XXX_Unmarshal

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

type MsgStakeResponse

type MsgStakeResponse struct {
}

func (*MsgStakeResponse) Descriptor

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

func (*MsgStakeResponse) Marshal

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

func (*MsgStakeResponse) MarshalTo

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

func (*MsgStakeResponse) MarshalToSizedBuffer

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

func (*MsgStakeResponse) ProtoMessage

func (*MsgStakeResponse) ProtoMessage()

func (*MsgStakeResponse) Reset

func (m *MsgStakeResponse) Reset()

func (*MsgStakeResponse) Size

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

func (*MsgStakeResponse) String

func (m *MsgStakeResponse) String() string

func (*MsgStakeResponse) Unmarshal

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

func (*MsgStakeResponse) XXX_DiscardUnknown

func (m *MsgStakeResponse) XXX_DiscardUnknown()

func (*MsgStakeResponse) XXX_Marshal

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

func (*MsgStakeResponse) XXX_Merge

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

func (*MsgStakeResponse) XXX_Size

func (m *MsgStakeResponse) XXX_Size() int

func (*MsgStakeResponse) XXX_Unmarshal

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

type MsgUnstake

type MsgUnstake struct {
	VendorID  uint32                                 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID    string                                 `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id" yaml:"post_id"`
	Delegator string                                 `protobuf:"bytes,3,opt,name=delegator,proto3" json:"delegator,omitempty" yaml:"delegator"`
	Amount    github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

func NewMsgUnstake

func NewMsgUnstake(
	vendorID uint32,
	postID string,
	delegator sdk.AccAddress,
	amount sdk.Int,
) *MsgUnstake

NewMsgUnstake creates a new MsgUnstake instance

func (*MsgUnstake) Descriptor

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

func (*MsgUnstake) Equal

func (this *MsgUnstake) Equal(that interface{}) bool

func (*MsgUnstake) GetDelegator

func (m *MsgUnstake) GetDelegator() string

func (*MsgUnstake) GetPostID

func (m *MsgUnstake) GetPostID() string

func (MsgUnstake) GetSignBytes

func (msg MsgUnstake) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgUnstake) GetSigners

func (msg MsgUnstake) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (*MsgUnstake) GetVendorID

func (m *MsgUnstake) GetVendorID() uint32

func (*MsgUnstake) Marshal

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

func (*MsgUnstake) MarshalTo

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

func (*MsgUnstake) MarshalToSizedBuffer

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

func (*MsgUnstake) ProtoMessage

func (*MsgUnstake) ProtoMessage()

func (*MsgUnstake) Reset

func (m *MsgUnstake) Reset()

func (MsgUnstake) Route

func (msg MsgUnstake) Route() string

Route implements sdk.Msg

func (*MsgUnstake) Size

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

func (*MsgUnstake) String

func (m *MsgUnstake) String() string

func (MsgUnstake) Type

func (msg MsgUnstake) Type() string

Type implements sdk.Msg

func (*MsgUnstake) Unmarshal

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

func (MsgUnstake) ValidateBasic

func (msg MsgUnstake) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgUnstake) XXX_DiscardUnknown

func (m *MsgUnstake) XXX_DiscardUnknown()

func (*MsgUnstake) XXX_Marshal

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

func (*MsgUnstake) XXX_Merge

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

func (*MsgUnstake) XXX_Size

func (m *MsgUnstake) XXX_Size() int

func (*MsgUnstake) XXX_Unmarshal

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

type MsgUnstakeResponse

type MsgUnstakeResponse struct {
}

func (*MsgUnstakeResponse) Descriptor

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

func (*MsgUnstakeResponse) Marshal

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

func (*MsgUnstakeResponse) MarshalTo

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

func (*MsgUnstakeResponse) MarshalToSizedBuffer

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

func (*MsgUnstakeResponse) ProtoMessage

func (*MsgUnstakeResponse) ProtoMessage()

func (*MsgUnstakeResponse) Reset

func (m *MsgUnstakeResponse) Reset()

func (*MsgUnstakeResponse) Size

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

func (*MsgUnstakeResponse) String

func (m *MsgUnstakeResponse) String() string

func (*MsgUnstakeResponse) Unmarshal

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

func (*MsgUnstakeResponse) XXX_DiscardUnknown

func (m *MsgUnstakeResponse) XXX_DiscardUnknown()

func (*MsgUnstakeResponse) XXX_Marshal

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

func (*MsgUnstakeResponse) XXX_Merge

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

func (*MsgUnstakeResponse) XXX_Size

func (m *MsgUnstakeResponse) XXX_Size() int

func (*MsgUnstakeResponse) XXX_Unmarshal

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

type Params

type Params struct {
}

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

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

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

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 QueryClient

type QueryClient interface {
	Stakes(ctx context.Context, in *QueryStakesRequest, opts ...grpc.CallOption) (*QueryStakesResponse, error)
	Stake(ctx context.Context, in *QueryStakeRequest, opts ...grpc.CallOption) (*QueryStakeResponse, 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

QueryServer is the server API for Query service.

type QueryStakeRequest

type QueryStakeRequest struct {
	VendorId  uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"`
	PostId    string `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
	Delegator string `protobuf:"bytes,3,opt,name=delegator,proto3" json:"delegator,omitempty"`
}

func (*QueryStakeRequest) Descriptor

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

func (*QueryStakeRequest) Marshal

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

func (*QueryStakeRequest) MarshalTo

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

func (*QueryStakeRequest) MarshalToSizedBuffer

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

func (*QueryStakeRequest) ProtoMessage

func (*QueryStakeRequest) ProtoMessage()

func (*QueryStakeRequest) Reset

func (m *QueryStakeRequest) Reset()

func (*QueryStakeRequest) Size

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

func (*QueryStakeRequest) String

func (m *QueryStakeRequest) String() string

func (*QueryStakeRequest) Unmarshal

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

func (*QueryStakeRequest) XXX_DiscardUnknown

func (m *QueryStakeRequest) XXX_DiscardUnknown()

func (*QueryStakeRequest) XXX_Marshal

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

func (*QueryStakeRequest) XXX_Merge

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

func (*QueryStakeRequest) XXX_Size

func (m *QueryStakeRequest) XXX_Size() int

func (*QueryStakeRequest) XXX_Unmarshal

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

type QueryStakeResponse

type QueryStakeResponse struct {
	Stake *Stake `protobuf:"bytes,1,opt,name=stake,proto3" json:"stake,omitempty"`
}

func (*QueryStakeResponse) Descriptor

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

func (*QueryStakeResponse) GetStake

func (m *QueryStakeResponse) GetStake() *Stake

func (*QueryStakeResponse) Marshal

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

func (*QueryStakeResponse) MarshalTo

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

func (*QueryStakeResponse) MarshalToSizedBuffer

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

func (*QueryStakeResponse) ProtoMessage

func (*QueryStakeResponse) ProtoMessage()

func (*QueryStakeResponse) Reset

func (m *QueryStakeResponse) Reset()

func (*QueryStakeResponse) Size

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

func (*QueryStakeResponse) String

func (m *QueryStakeResponse) String() string

func (*QueryStakeResponse) Unmarshal

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

func (*QueryStakeResponse) XXX_DiscardUnknown

func (m *QueryStakeResponse) XXX_DiscardUnknown()

func (*QueryStakeResponse) XXX_Marshal

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

func (*QueryStakeResponse) XXX_Merge

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

func (*QueryStakeResponse) XXX_Size

func (m *QueryStakeResponse) XXX_Size() int

func (*QueryStakeResponse) XXX_Unmarshal

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

type QueryStakesRequest

type QueryStakesRequest struct {
	VendorId uint32 `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"`
	PostId   string `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
}

func (*QueryStakesRequest) Descriptor

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

func (*QueryStakesRequest) Marshal

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

func (*QueryStakesRequest) MarshalTo

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

func (*QueryStakesRequest) MarshalToSizedBuffer

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

func (*QueryStakesRequest) ProtoMessage

func (*QueryStakesRequest) ProtoMessage()

func (*QueryStakesRequest) Reset

func (m *QueryStakesRequest) Reset()

func (*QueryStakesRequest) Size

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

func (*QueryStakesRequest) String

func (m *QueryStakesRequest) String() string

func (*QueryStakesRequest) Unmarshal

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

func (*QueryStakesRequest) XXX_DiscardUnknown

func (m *QueryStakesRequest) XXX_DiscardUnknown()

func (*QueryStakesRequest) XXX_Marshal

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

func (*QueryStakesRequest) XXX_Merge

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

func (*QueryStakesRequest) XXX_Size

func (m *QueryStakesRequest) XXX_Size() int

func (*QueryStakesRequest) XXX_Unmarshal

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

type QueryStakesResponse

type QueryStakesResponse struct {
	Stakes []Stake `protobuf:"bytes,1,rep,name=stakes,proto3" json:"stakes"`
}

func (*QueryStakesResponse) Descriptor

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

func (*QueryStakesResponse) GetStakes

func (m *QueryStakesResponse) GetStakes() []Stake

func (*QueryStakesResponse) Marshal

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

func (*QueryStakesResponse) MarshalTo

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

func (*QueryStakesResponse) MarshalToSizedBuffer

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

func (*QueryStakesResponse) ProtoMessage

func (*QueryStakesResponse) ProtoMessage()

func (*QueryStakesResponse) Reset

func (m *QueryStakesResponse) Reset()

func (*QueryStakesResponse) Size

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

func (*QueryStakesResponse) String

func (m *QueryStakesResponse) String() string

func (*QueryStakesResponse) Unmarshal

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

func (*QueryStakesResponse) XXX_DiscardUnknown

func (m *QueryStakesResponse) XXX_DiscardUnknown()

func (*QueryStakesResponse) XXX_Marshal

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

func (*QueryStakesResponse) XXX_Merge

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

func (*QueryStakesResponse) XXX_Size

func (m *QueryStakesResponse) XXX_Size() int

func (*QueryStakesResponse) XXX_Unmarshal

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

type Stake

type Stake struct {
	VendorID  uint32                                                     `protobuf:"varint,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"`
	PostID    github_com_public_awesome_stargaze_x_curating_types.PostID `` /* 154-byte string literal not displayed */
	Delegator string                                                     `protobuf:"bytes,3,opt,name=delegator,proto3" json:"delegator,omitempty" yaml:"delegator"`
	Validator string                                                     `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty" yaml:"validator"`
	Amount    github_com_cosmos_cosmos_sdk_types.Int                     `protobuf:"bytes,5,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

func NewStake

func NewStake(
	vendorID uint32, postID curatingtypes.PostID,
	delegator sdk.AccAddress, validator sdk.ValAddress, amount sdk.Int) Stake

NewStake allocates and returns a new `Stake` struct

func (*Stake) Descriptor

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

func (*Stake) GetDelegator

func (m *Stake) GetDelegator() string

func (*Stake) GetValidator

func (m *Stake) GetValidator() string

func (*Stake) GetVendorID

func (m *Stake) GetVendorID() uint32

func (*Stake) Marshal

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

func (*Stake) MarshalTo

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

func (*Stake) MarshalToSizedBuffer

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

func (*Stake) ProtoMessage

func (*Stake) ProtoMessage()

func (*Stake) Reset

func (m *Stake) Reset()

func (*Stake) Size

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

func (*Stake) String

func (m *Stake) String() string

func (*Stake) Unmarshal

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

func (*Stake) XXX_DiscardUnknown

func (m *Stake) XXX_DiscardUnknown()

func (*Stake) XXX_Marshal

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

func (*Stake) XXX_Merge

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

func (*Stake) XXX_Size

func (m *Stake) XXX_Size() int

func (*Stake) XXX_Unmarshal

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

type Stakes

type Stakes []Stake

Stakes is a collection of Stake 🥩

type StakingKeeper

type StakingKeeper interface {
	GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
	Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc stakingtypes.BondStatus,
		validator stakingtypes.Validator, subtractAccount bool) (newShares sdk.Dec, err error)
	Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (time.Time, error)
}

StakingKeeper expected staking keeper

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) BuyCreatorCoin added in v0.7.0

func (*UnimplementedMsgServer) SellCreatorCoin added in v0.8.0

func (*UnimplementedMsgServer) Stake

func (*UnimplementedMsgServer) Unstake

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Stake

func (*UnimplementedQueryServer) Stakes

Jump to

Keyboard shortcuts

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