types

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeLiquidate = "liquidate_locked_vesting_coins"
	EventTypeRedeem    = "redeem_liquid_token"

	AttributeKeyAmount      = "amount"
	AttributeKeyDestination = "destination"
)

liquidvesting events

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

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

	RouterKey = ModuleName
)
View Source
const (
	TypeMsgLiquidate = "liquidate"
	TypeMsgRedeem    = "redeem"
)
View Source
const DefaultMinimumLiquidationAmountISLM = 1000

DefaultMinimumLiquidationAmountISLM default parameter value in ISLM

Variables

View Source
var (
	ErrLiquidationFailed = sdkerrors.Register(ModuleName, 1102, "liquidation failed")
	ErrRedeemFailed      = sdkerrors.Register(ModuleName, 1103, "redeem failed")
	ErrDenomNotFound     = sdkerrors.Register(ModuleName, 1104, "denom not found")
	ErrModuleIsDisabled  = sdkerrors.Register(ModuleName, 1105, "module is disabled")
)
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 (
	DenomKeyPrefix  = []byte{prefixDenom}
	DenomCounterKey = []byte{denomCounter}
)
View Source
var (
	ErrInvalidLengthLiquidvesting        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLiquidvesting          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLiquidvesting = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	DefaultMinimumLiquidationAmount = math.NewInt(DefaultMinimumLiquidationAmountISLM).Mul(AttoMultiplier)
	DefaultEnableLiquidVesting      = true
)

DefaultMinimumLiquidationAmount default atto parameter value

View Source
var (
	ParamStoreKeyMinimumLiquidationAmount = []byte("MinimumLiquidationAmount")
	ParamStoreKeyEnableLiquidVesting      = []byte("EnableLiquidVesting")
)

ParamStoreKeyMinimumLiquidationAmount Parameter store keys

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 (
	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 (

	// AminoCdc is a amino codec created to support amino JSON compatible msgs.
	AminoCdc = codec.NewAminoCodec(amino)
)
View Source
var AttoMultiplier = math.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil))

AttoMultiplier 10^18

Functions

func CurrentPeriodShift

func CurrentPeriodShift(startTime, currentTime int64, periods sdkvesting.Periods) int64

CurrentPeriodShift calculates how much time has passed since the beginning of the current period

func DenomBaseNameFromID

func DenomBaseNameFromID(id uint64) string

DenomBaseNameFromID compose denom name based on id for exponent 0

func DenomDisplayNameFromID

func DenomDisplayNameFromID(id uint64) string

DenomDisplayNameFromID compose denom name based on id for exponent 18

func DenomIDFromBaseName added in v1.7.4

func DenomIDFromBaseName(baseName string) (uint64, error)

func ExtractPastPeriods added in v1.7.4

func ExtractPastPeriods(startDate, endDate int64, periods sdkvesting.Periods, readTime int64) sdkvesting.Periods

ExtractPastPeriods takes the list of periods with started time and returns list of periods which are already in the past

func ExtractUpcomingPeriods

func ExtractUpcomingPeriods(startDate, endDate int64, periods sdkvesting.Periods, readTime int64) sdkvesting.Periods

ExtractUpcomingPeriods takes the list of periods with started time and returns list of periods which are currently upcoming

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces associates protoName with AccountI and VestingAccount Interfaces and creates a registry of it's concrete implementations

func RegisterLegacyAminoCodec added in v1.7.3

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the necessary x/erc20 interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization and EIP-712 compatibility.

func RegisterMsgHandler

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

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

func RegisterMsgHandlerClient

func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error

RegisterMsgHandlerClient registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MsgClient" to call the correct interceptors.

func RegisterMsgHandlerFromEndpoint

func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMsgHandlerServer

func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error

RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer 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 RegisterMsgHandlerFromEndpoint instead.

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)

func ReplacePeriodsTail

func ReplacePeriodsTail(periods, replacement sdkvesting.Periods) sdkvesting.Periods

ReplacePeriodsTail replaces the last N periods in original periods list with replacements period list where N is length of replacement list

func SubtractAmountFromPeriods

func SubtractAmountFromPeriods(
	minuendPeriods sdkvesting.Periods,
	subtrahend sdk.Coin,
) (decreasedPeriods, diffPeriods sdkvesting.Periods, err error)

SubtractAmountFromPeriods subtracts coin amount from given periods proportionally, returns decreased periods and diff of initial periods and decreased periods

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI // only used for simulation
	SetAccount(sdk.Context, authtypes.AccountI)
	NewAccount(ctx sdk.Context, acc authtypes.AccountI) authtypes.AccountI
	GetModuleAddress(moduleName string) sdk.AccAddress
}

AccountKeeper defines the expected interface for the Account module.

type BankKeeper

type BankKeeper interface {
	BlockedAddr(addr sdk.AccAddress) bool

	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

	HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool

	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin

	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error

	GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
	SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
}

BankKeeper defines the expected interface for the Bank module.

type Denom

type Denom struct {
	// base_denom main identifier for the denom, used to query it from store.
	BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"`
	// display_denom identifier used for display name for broad audience
	DisplayDenom string `protobuf:"bytes,2,opt,name=display_denom,json=displayDenom,proto3" json:"display_denom,omitempty"`
	// original_denom which liquid denom derived from
	OriginalDenom string `protobuf:"bytes,3,opt,name=original_denom,json=originalDenom,proto3" json:"original_denom,omitempty"`
	// start date
	StartTime time.Time `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"`
	// end_date
	EndTime time.Time `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"`
	// lockup periods
	LockupPeriods github_com_cosmos_cosmos_sdk_x_auth_vesting_types.Periods `` /* 161-byte string literal not displayed */
}

Denom represents liquid token bonded to some specific vesting schedule

func (*Denom) Descriptor

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

func (*Denom) GetBaseDenom

func (m *Denom) GetBaseDenom() string

func (*Denom) GetDisplayDenom

func (m *Denom) GetDisplayDenom() string

func (*Denom) GetEndTime

func (m *Denom) GetEndTime() time.Time

func (*Denom) GetOriginalDenom

func (m *Denom) GetOriginalDenom() string

func (*Denom) GetStartTime

func (m *Denom) GetStartTime() time.Time

func (*Denom) Marshal

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

func (*Denom) MarshalTo

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

func (*Denom) MarshalToSizedBuffer

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

func (*Denom) ProtoMessage

func (*Denom) ProtoMessage()

func (*Denom) Reset

func (m *Denom) Reset()

func (*Denom) Size

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

func (*Denom) String

func (m *Denom) String() string

func (*Denom) Unmarshal

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

func (*Denom) XXX_DiscardUnknown

func (m *Denom) XXX_DiscardUnknown()

func (*Denom) XXX_Marshal

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

func (*Denom) XXX_Merge

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

func (*Denom) XXX_Size

func (m *Denom) XXX_Size() int

func (*Denom) XXX_Unmarshal

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

type ERC20Keeper

type ERC20Keeper interface {
	ToggleConversion(ctx sdk.Context, token string) (erc20types.TokenPair, error)
	GetTokenPairID(ctx sdk.Context, token string) []byte
	GetTokenPair(ctx sdk.Context, id []byte) (erc20types.TokenPair, bool)
	BalanceOf(ctx sdk.Context, abi abi.ABI, contract, account common.Address) *big.Int
	ConvertCoin(goCtx context.Context, msg *erc20types.MsgConvertCoin) (*erc20types.MsgConvertCoinResponse, error)
	ConvertERC20(context.Context, *erc20types.MsgConvertERC20) (*erc20types.MsgConvertERC20Response, error)
	RegisterCoin(ctx sdk.Context, coinMetadata banktypes.Metadata) (*erc20types.TokenPair, error)
}

ERC20Keeper defines the expected interface for the ERC20 module.

type GenesisState

type GenesisState struct {
	// params defines all the paramaters of the module.
	Params       Params  `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	DenomCounter uint64  `protobuf:"varint,2,opt,name=denom_counter,json=denomCounter,proto3" json:"denom_counter,omitempty"`
	Denoms       []Denom `protobuf:"bytes,3,rep,name=denoms,proto3" json:"denoms"`
}

GenesisState defines the liquidvesting module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

func NewGenesisState

func NewGenesisState(
	params Params,
	denomCounter uint64,
	denoms []Denom,
) GenesisState

func (*GenesisState) Descriptor

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

func (*GenesisState) GetDenomCounter added in v1.7.4

func (m *GenesisState) GetDenomCounter() uint64

func (*GenesisState) GetDenoms added in v1.7.4

func (m *GenesisState) GetDenoms() []Denom

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 genesis state

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 {
	// Liquidate transforms specified amount of tokens locked on vesting account
	// into a new liquid token
	Liquidate(ctx context.Context, in *MsgLiquidate, opts ...grpc.CallOption) (*MsgLiquidateResponse, error)
	// Redeem burns liquid token and deposits corresponding amount of vesting
	// token to the specified account
	Redeem(ctx context.Context, in *MsgRedeem, opts ...grpc.CallOption) (*MsgRedeemResponse, 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 MsgLiquidate

type MsgLiquidate struct {
	// account for liquidation of locked vesting tokens
	LiquidateFrom string `protobuf:"bytes,1,opt,name=liquidate_from,json=liquidateFrom,proto3" json:"liquidate_from,omitempty"`
	// account to send resulted liquid token
	LiquidateTo string `protobuf:"bytes,2,opt,name=liquidate_to,json=liquidateTo,proto3" json:"liquidate_to,omitempty"`
	// amount of tokens subject for liquidation
	Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}

MsgLiquidate represents message to liquidate arbitrary amount of tokens locked in vesting

func NewMsgLiquidate

func NewMsgLiquidate(liquidateFrom, liquidateTo sdk.AccAddress, amount sdk.Coin) *MsgLiquidate

NewMsgLiquidate creates new instance of MsgLiquidate

func (*MsgLiquidate) Descriptor

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

func (*MsgLiquidate) GetAmount

func (m *MsgLiquidate) GetAmount() types.Coin

func (*MsgLiquidate) GetLiquidateFrom

func (m *MsgLiquidate) GetLiquidateFrom() string

func (*MsgLiquidate) GetLiquidateTo

func (m *MsgLiquidate) GetLiquidateTo() string

func (*MsgLiquidate) GetSignBytes added in v1.7.3

func (msg *MsgLiquidate) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgLiquidate) GetSigners

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

GetSigners defines whose signature is required

func (*MsgLiquidate) Marshal

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

func (*MsgLiquidate) MarshalTo

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

func (*MsgLiquidate) MarshalToSizedBuffer

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

func (*MsgLiquidate) ProtoMessage

func (*MsgLiquidate) ProtoMessage()

func (*MsgLiquidate) Reset

func (m *MsgLiquidate) Reset()

func (MsgLiquidate) Route

func (msg MsgLiquidate) Route() string

Route returns the name of the module

func (*MsgLiquidate) Size

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

func (*MsgLiquidate) String

func (m *MsgLiquidate) String() string

func (MsgLiquidate) Type

func (msg MsgLiquidate) Type() string

Type returns the action type

func (*MsgLiquidate) Unmarshal

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

func (MsgLiquidate) ValidateBasic

func (msg MsgLiquidate) ValidateBasic() error

ValidateBasic runs stateless checks on the message

func (*MsgLiquidate) XXX_DiscardUnknown

func (m *MsgLiquidate) XXX_DiscardUnknown()

func (*MsgLiquidate) XXX_Marshal

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

func (*MsgLiquidate) XXX_Merge

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

func (*MsgLiquidate) XXX_Size

func (m *MsgLiquidate) XXX_Size() int

func (*MsgLiquidate) XXX_Unmarshal

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

type MsgLiquidateResponse

type MsgLiquidateResponse struct {
	// amount of liquid tokens minted
	Minted types.Coin `protobuf:"bytes,1,opt,name=minted,proto3" json:"minted"`
	// address of erc20 the liquidation denom contract
	ContractAddr string `protobuf:"bytes,2,opt,name=contract_addr,json=contractAddr,proto3" json:"contract_addr,omitempty"`
}

MsgLiquidateResponse defines the Msg/Liquidate response type

func (*MsgLiquidateResponse) Descriptor

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

func (*MsgLiquidateResponse) GetContractAddr added in v1.7.6

func (m *MsgLiquidateResponse) GetContractAddr() string

func (*MsgLiquidateResponse) GetMinted added in v1.7.6

func (m *MsgLiquidateResponse) GetMinted() types.Coin

func (*MsgLiquidateResponse) Marshal

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

func (*MsgLiquidateResponse) MarshalTo

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

func (*MsgLiquidateResponse) MarshalToSizedBuffer

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

func (*MsgLiquidateResponse) ProtoMessage

func (*MsgLiquidateResponse) ProtoMessage()

func (*MsgLiquidateResponse) Reset

func (m *MsgLiquidateResponse) Reset()

func (*MsgLiquidateResponse) Size

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

func (*MsgLiquidateResponse) String

func (m *MsgLiquidateResponse) String() string

func (*MsgLiquidateResponse) Unmarshal

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

func (*MsgLiquidateResponse) XXX_DiscardUnknown

func (m *MsgLiquidateResponse) XXX_DiscardUnknown()

func (*MsgLiquidateResponse) XXX_Marshal

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

func (*MsgLiquidateResponse) XXX_Merge

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

func (*MsgLiquidateResponse) XXX_Size

func (m *MsgLiquidateResponse) XXX_Size() int

func (*MsgLiquidateResponse) XXX_Unmarshal

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

type MsgRedeem

type MsgRedeem struct {
	RedeemFrom string `protobuf:"bytes,1,opt,name=redeem_from,json=redeemFrom,proto3" json:"redeem_from,omitempty"`
	// destination address for vesting tokens
	RedeemTo string `protobuf:"bytes,2,opt,name=redeem_to,json=redeemTo,proto3" json:"redeem_to,omitempty"`
	// amount of vesting tokens to redeem from liquidation module
	Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}

MsgLiquidate represents message to redeem arbitrary amount of liquid vesting tokens

func NewMsgRedeem

func NewMsgRedeem(redeemFrom, redeemTo sdk.AccAddress, amount sdk.Coin) *MsgRedeem

NewMsgRedeem creates new instance of MsgLiquidate

func (*MsgRedeem) Descriptor

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

func (*MsgRedeem) GetAmount

func (m *MsgRedeem) GetAmount() types.Coin

func (*MsgRedeem) GetRedeemFrom

func (m *MsgRedeem) GetRedeemFrom() string

func (*MsgRedeem) GetRedeemTo

func (m *MsgRedeem) GetRedeemTo() string

func (*MsgRedeem) GetSignBytes added in v1.7.3

func (msg *MsgRedeem) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgRedeem) GetSigners

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

GetSigners defines whose signature is required

func (*MsgRedeem) Marshal

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

func (*MsgRedeem) MarshalTo

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

func (*MsgRedeem) MarshalToSizedBuffer

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

func (*MsgRedeem) ProtoMessage

func (*MsgRedeem) ProtoMessage()

func (*MsgRedeem) Reset

func (m *MsgRedeem) Reset()

func (MsgRedeem) Route

func (msg MsgRedeem) Route() string

Route returns the name of the module

func (*MsgRedeem) Size

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

func (*MsgRedeem) String

func (m *MsgRedeem) String() string

func (MsgRedeem) Type

func (msg MsgRedeem) Type() string

Type returns the action type

func (*MsgRedeem) Unmarshal

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

func (MsgRedeem) ValidateBasic

func (msg MsgRedeem) ValidateBasic() error

ValidateBasic runs stateless checks on the message

func (*MsgRedeem) XXX_DiscardUnknown

func (m *MsgRedeem) XXX_DiscardUnknown()

func (*MsgRedeem) XXX_Marshal

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

func (*MsgRedeem) XXX_Merge

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

func (*MsgRedeem) XXX_Size

func (m *MsgRedeem) XXX_Size() int

func (*MsgRedeem) XXX_Unmarshal

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

type MsgRedeemResponse

type MsgRedeemResponse struct {
}

MsgRedeemResponse defines the Msg/Redeem response type

func (*MsgRedeemResponse) Descriptor

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

func (*MsgRedeemResponse) Marshal

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

func (*MsgRedeemResponse) MarshalTo

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

func (*MsgRedeemResponse) MarshalToSizedBuffer

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

func (*MsgRedeemResponse) ProtoMessage

func (*MsgRedeemResponse) ProtoMessage()

func (*MsgRedeemResponse) Reset

func (m *MsgRedeemResponse) Reset()

func (*MsgRedeemResponse) Size

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

func (*MsgRedeemResponse) String

func (m *MsgRedeemResponse) String() string

func (*MsgRedeemResponse) Unmarshal

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

func (*MsgRedeemResponse) XXX_DiscardUnknown

func (m *MsgRedeemResponse) XXX_DiscardUnknown()

func (*MsgRedeemResponse) XXX_Marshal

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

func (*MsgRedeemResponse) XXX_Merge

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

func (*MsgRedeemResponse) XXX_Size

func (m *MsgRedeemResponse) XXX_Size() int

func (*MsgRedeemResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// Liquidate transforms specified amount of tokens locked on vesting account
	// into a new liquid token
	Liquidate(context.Context, *MsgLiquidate) (*MsgLiquidateResponse, error)
	// Redeem burns liquid token and deposits corresponding amount of vesting
	// token to the specified account
	Redeem(context.Context, *MsgRedeem) (*MsgRedeemResponse, error)
}

MsgServer is the server API for Msg service.

type Params

type Params struct {
	MinimumLiquidationAmount cosmossdk_io_math.Int `` /* 158-byte string literal not displayed */
	// parameter to enable liquid vesting
	EnableLiquidVesting bool `protobuf:"varint,2,opt,name=enable_liquid_vesting,json=enableLiquidVesting,proto3" json:"enable_liquid_vesting,omitempty"`
}

Params holds parameters for the liquidvesting module.

func DefaultParams

func DefaultParams() Params

func NewParams

func NewParams(
	minimumLiquidationAmount math.Int,
	enableLiquidVesting bool,
) Params

func (*Params) Descriptor

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

func (*Params) GetEnableLiquidVesting added in v1.7.5

func (m *Params) GetEnableLiquidVesting() bool

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 (m *Params) String() string

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() 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 {
	// Denom queries liquid vesting token info by denom
	Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error)
	// Denoms queries liquid vesting tokens info
	Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, 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 QueryDenomRequest

type QueryDenomRequest struct {
	// denom is liquidated vesting token
	Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
}

QueryDenomRequest is request fo Denom rpc method

func (*QueryDenomRequest) Descriptor

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

func (*QueryDenomRequest) GetDenom

func (m *QueryDenomRequest) GetDenom() string

func (*QueryDenomRequest) Marshal

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

func (*QueryDenomRequest) MarshalTo

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

func (*QueryDenomRequest) MarshalToSizedBuffer

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

func (*QueryDenomRequest) ProtoMessage

func (*QueryDenomRequest) ProtoMessage()

func (*QueryDenomRequest) Reset

func (m *QueryDenomRequest) Reset()

func (*QueryDenomRequest) Size

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

func (*QueryDenomRequest) String

func (m *QueryDenomRequest) String() string

func (*QueryDenomRequest) Unmarshal

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

func (*QueryDenomRequest) XXX_DiscardUnknown

func (m *QueryDenomRequest) XXX_DiscardUnknown()

func (*QueryDenomRequest) XXX_Marshal

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

func (*QueryDenomRequest) XXX_Merge

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

func (*QueryDenomRequest) XXX_Size

func (m *QueryDenomRequest) XXX_Size() int

func (*QueryDenomRequest) XXX_Unmarshal

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

type QueryDenomResponse

type QueryDenomResponse struct {
	// denom is liquidated vesting token
	Denom Denom `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom"`
}

QueryDenomResponse is response for Denom rpc method

func (*QueryDenomResponse) Descriptor

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

func (*QueryDenomResponse) GetDenom

func (m *QueryDenomResponse) GetDenom() Denom

func (*QueryDenomResponse) Marshal

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

func (*QueryDenomResponse) MarshalTo

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

func (*QueryDenomResponse) MarshalToSizedBuffer

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

func (*QueryDenomResponse) ProtoMessage

func (*QueryDenomResponse) ProtoMessage()

func (*QueryDenomResponse) Reset

func (m *QueryDenomResponse) Reset()

func (*QueryDenomResponse) Size

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

func (*QueryDenomResponse) String

func (m *QueryDenomResponse) String() string

func (*QueryDenomResponse) Unmarshal

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

func (*QueryDenomResponse) XXX_DiscardUnknown

func (m *QueryDenomResponse) XXX_DiscardUnknown()

func (*QueryDenomResponse) XXX_Marshal

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

func (*QueryDenomResponse) XXX_Merge

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

func (*QueryDenomResponse) XXX_Size

func (m *QueryDenomResponse) XXX_Size() int

func (*QueryDenomResponse) XXX_Unmarshal

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

type QueryDenomsRequest

type QueryDenomsRequest struct {
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryDenomsRequest is request for Denoms rpc method

func (*QueryDenomsRequest) Descriptor

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

func (*QueryDenomsRequest) GetPagination

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

func (*QueryDenomsRequest) Marshal

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

func (*QueryDenomsRequest) MarshalTo

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

func (*QueryDenomsRequest) MarshalToSizedBuffer

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

func (*QueryDenomsRequest) ProtoMessage

func (*QueryDenomsRequest) ProtoMessage()

func (*QueryDenomsRequest) Reset

func (m *QueryDenomsRequest) Reset()

func (*QueryDenomsRequest) Size

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

func (*QueryDenomsRequest) String

func (m *QueryDenomsRequest) String() string

func (*QueryDenomsRequest) Unmarshal

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

func (*QueryDenomsRequest) XXX_DiscardUnknown

func (m *QueryDenomsRequest) XXX_DiscardUnknown()

func (*QueryDenomsRequest) XXX_Marshal

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

func (*QueryDenomsRequest) XXX_Merge

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

func (*QueryDenomsRequest) XXX_Size

func (m *QueryDenomsRequest) XXX_Size() int

func (*QueryDenomsRequest) XXX_Unmarshal

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

type QueryDenomsResponse

type QueryDenomsResponse struct {
	// denoms are liquidated vesting tokens
	Denoms []Denom `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryDenomsResponse is response for Denoms rpc method

func (*QueryDenomsResponse) Descriptor

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

func (*QueryDenomsResponse) GetDenoms

func (m *QueryDenomsResponse) GetDenoms() []Denom

func (*QueryDenomsResponse) GetPagination

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

func (*QueryDenomsResponse) Marshal

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

func (*QueryDenomsResponse) MarshalTo

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

func (*QueryDenomsResponse) MarshalToSizedBuffer

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

func (*QueryDenomsResponse) ProtoMessage

func (*QueryDenomsResponse) ProtoMessage()

func (*QueryDenomsResponse) Reset

func (m *QueryDenomsResponse) Reset()

func (*QueryDenomsResponse) Size

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

func (*QueryDenomsResponse) String

func (m *QueryDenomsResponse) String() string

func (*QueryDenomsResponse) Unmarshal

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

func (*QueryDenomsResponse) XXX_DiscardUnknown

func (m *QueryDenomsResponse) XXX_DiscardUnknown()

func (*QueryDenomsResponse) XXX_Marshal

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

func (*QueryDenomsResponse) XXX_Merge

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

func (*QueryDenomsResponse) XXX_Size

func (m *QueryDenomsResponse) XXX_Size() int

func (*QueryDenomsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Denom queries liquid vesting token info by denom
	Denom(context.Context, *QueryDenomRequest) (*QueryDenomResponse, error)
	// Denoms queries liquid vesting tokens info
	Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Liquidate

func (*UnimplementedMsgServer) Redeem

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Denom

func (*UnimplementedQueryServer) Denoms

type VestingKeeper

type VestingKeeper interface {
	ApplyVestingSchedule(
		ctx sdk.Context,
		funder, funded sdk.AccAddress,
		coins sdk.Coins,
		startTime time.Time,
		lockupPeriods, vestingPeriods sdkvesting.Periods,
		merge bool,
	) (vestingAcc *vestingtypes.ClawbackVestingAccount, newAccountCreated, wasMerged bool, err error)
}

VestingKeeper defines the expected interface for the Vesting module.

Jump to

Keyboard shortcuts

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