Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func SupplyInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AddBalance(ctx sdk.Context, denomID, mtID string, amount uint64, addr sdk.AccAddress) error
- func (k Keeper) Authorize(ctx sdk.Context, denomID string, owner sdk.AccAddress) error
- func (k Keeper) Balances(c context.Context, request *types.QueryBalancesRequest) (*types.QueryBalancesResponse, error)
- func (k Keeper) BurnMT(ctx sdk.Context, denomID, mtID string, amount uint64, owner sdk.AccAddress) error
- func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
- func (k Keeper) Denoms(c context.Context, request *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
- func (k Keeper) EditMT(ctx sdk.Context, denomID, mtID string, metadata []byte, sender sdk.AccAddress) error
- func (k Keeper) ExportGenesisState(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetBalance(ctx sdk.Context, denomID, mtID string, addr sdk.AccAddress) uint64
- func (k Keeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, found bool)
- func (k Keeper) GetDenomSequence(ctx sdk.Context) uint64
- func (k Keeper) GetDenomSupply(ctx sdk.Context, denomID string) uint64
- func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom)
- func (k Keeper) GetMT(ctx sdk.Context, denomID, mtID string) (mt exported.MT, err error)
- func (k Keeper) GetMTSequence(ctx sdk.Context) uint64
- func (k Keeper) GetMTSupply(ctx sdk.Context, denomID, mtID string) uint64
- func (k Keeper) GetMTs(ctx sdk.Context, denomID string) (mts []exported.MT)
- func (k Keeper) HasDenom(ctx sdk.Context, id string) bool
- func (k Keeper) HasMT(ctx sdk.Context, denomID, mtID string) bool
- func (k Keeper) IncreaseDenomSupply(ctx sdk.Context, denomID string)
- func (k Keeper) IncreaseMTSupply(ctx sdk.Context, denomID, mtID string, amount uint64) error
- func (k Keeper) IssueDenom(ctx sdk.Context, id, name string, sender sdk.AccAddress, data []byte) types.Denom
- func (k Keeper) IssueMT(ctx sdk.Context, denomID, mtID string, amount uint64, data []byte, ...) (types.MT, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MT(c context.Context, request *types.QueryMTRequest) (*types.QueryMTResponse, error)
- func (k Keeper) MTSupply(c context.Context, request *types.QueryMTSupplyRequest) (*types.QueryMTSupplyResponse, error)
- func (k Keeper) MTs(c context.Context, request *types.QueryMTsRequest) (*types.QueryMTsResponse, error)
- func (k Keeper) MintMT(ctx sdk.Context, denomID, mtID string, amount uint64, recipient sdk.AccAddress) error
- func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom)
- func (k Keeper) SetDenomSequence(ctx sdk.Context, sequence uint64)
- func (k Keeper) SetMT(ctx sdk.Context, denomID string, mt types.MT)
- func (k Keeper) SetMTSequence(ctx sdk.Context, sequence uint64)
- func (k Keeper) SubBalance(ctx sdk.Context, denomID, mtID string, amount uint64, addr sdk.AccAddress)
- func (k Keeper) Supply(context.Context, *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
- func (k Keeper) Transfer(ctx sdk.Context, denomID, mtID string, amount uint64, from, to sdk.AccAddress) error
- func (k Keeper) TransferDenomOwner(ctx sdk.Context, denomID string, srcOwner, dstOwner sdk.AccAddress) error
- func (k Keeper) TransferOwner(ctx sdk.Context, denomID, mtID string, amount uint64, ...) error
- func (k Keeper) UpdateDenom(ctx sdk.Context, denom types.Denom) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the MT module.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MT MsgServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all supply invariants
func SupplyInvariant ¶
SupplyInvariant checks that the total amount of MTs on collections matches the total amount owned by addresses
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey) Keeper
NewKeeper creates a new instance of the MT Keeper
func (Keeper) AddBalance ¶
func (k Keeper) AddBalance(ctx sdk.Context, denomID, mtID string, amount uint64, addr sdk.AccAddress) error
AddBalance adds amounts to an account
func (Keeper) Balances ¶
func (k Keeper) Balances(c context.Context, request *types.QueryBalancesRequest) (*types.QueryBalancesResponse, error)
func (Keeper) BurnMT ¶
func (k Keeper) BurnMT(ctx sdk.Context, denomID, mtID string, amount uint64, owner sdk.AccAddress) error
BurnMT burn amounts of MT from a owner
func (Keeper) Denom ¶
func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
func (Keeper) Denoms ¶
func (k Keeper) Denoms(c context.Context, request *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
func (Keeper) EditMT ¶
func (k Keeper) EditMT(ctx sdk.Context, denomID, mtID string, metadata []byte, sender sdk.AccAddress, ) error
EditMT updates an existing MT
func (Keeper) ExportGenesisState ¶
func (k Keeper) ExportGenesisState(ctx sdk.Context) *types.GenesisState
func (Keeper) GetBalance ¶
GetBalance gets balance of an MT
func (Keeper) GetDenomSequence ¶
GetDenomSequence gets the next denom sequence from the store.
func (Keeper) GetDenomSupply ¶
GetDenomSupply returns the number of Mts by the specified denom ID
func (Keeper) GetMTSequence ¶
GetMTSequence gets the next MT sequence from the store.
func (Keeper) GetMTSupply ¶
GetMTSupply returns the supply of a specified MT
func (Keeper) IncreaseDenomSupply ¶
IncreaseDenomSupply increase total supply (count of MTs) of a denom
func (Keeper) IncreaseMTSupply ¶
IncreaseMTSupply increase total supply of an MT
func (Keeper) IssueDenom ¶
func (k Keeper) IssueDenom(ctx sdk.Context, id, name string, sender sdk.AccAddress, data []byte, ) types.Denom
IssueDenom issues a denom according to the given params
func (Keeper) IssueMT ¶
func (k Keeper) IssueMT(ctx sdk.Context, denomID, mtID string, amount uint64, data []byte, recipient sdk.AccAddress, ) (types.MT, error)
IssueMT issues a new MT
func (Keeper) MT ¶
func (k Keeper) MT(c context.Context, request *types.QueryMTRequest) (*types.QueryMTResponse, error)
func (Keeper) MTSupply ¶
func (k Keeper) MTSupply(c context.Context, request *types.QueryMTSupplyRequest) (*types.QueryMTSupplyResponse, error)
func (Keeper) MTs ¶
func (k Keeper) MTs(c context.Context, request *types.QueryMTsRequest) (*types.QueryMTsResponse, error)
func (Keeper) MintMT ¶
func (k Keeper) MintMT(ctx sdk.Context, denomID, mtID string, amount uint64, recipient sdk.AccAddress, ) error
MintMT mints amounts of an existing MT
func (Keeper) SetDenomSequence ¶
SetDenomSequence sets the next denom sequence to the store.
func (Keeper) SetMTSequence ¶
SetMTSequence sets the next MT sequence to the store.
func (Keeper) SubBalance ¶
func (k Keeper) SubBalance(ctx sdk.Context, denomID, mtID string, amount uint64, addr sdk.AccAddress)
SubBalance subs amounts from an account
func (Keeper) Supply ¶
func (k Keeper) Supply(context.Context, *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
func (Keeper) Transfer ¶
func (k Keeper) Transfer(ctx sdk.Context, denomID, mtID string, amount uint64, from, to sdk.AccAddress) error
Transfer transfers mts
func (Keeper) TransferDenomOwner ¶
func (k Keeper) TransferDenomOwner( ctx sdk.Context, denomID string, srcOwner, dstOwner sdk.AccAddress, ) error
TransferDenomOwner transfers the ownership of the given denom to the new owner
func (Keeper) TransferOwner ¶
func (k Keeper) TransferOwner(ctx sdk.Context, denomID, mtID string, amount uint64, srcOwner, dstOwner sdk.AccAddress, ) error
TransferOwner transfers the ownership of the given MT to the new owner