types

package
v0.0.0-...-8551cdf Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCreate   = "create"
	EventTypeIssue    = "issue"
	EventTypeTransfer = "transfer"
	EventTypeLock     = "lock"
	EventTypeUnlock   = "unlock"
)
View Source
const (
	AttributeKeyFrom          = "from"
	AttributeKeyTo            = "to"
	AttributeKeyAmount        = "amount"
	AttributeKeyCreator       = "creator"
	AttributeKeySymbol        = "symbol"
	AttributeKeyMaxSupply     = "max"
	AttributeKeyAccount       = "id"
	AttributeKeyUnlockHeight  = "unlockHeight"
	AttributeKeyCanIssue      = "canIssue"
	AttributeKeyCanLock       = "canLock"
	AttributeKeyIssueToHeight = "issueToHeight"
	AttributeKeyInit          = "init"
	AttributeKeyDescription   = "desc"
)
View Source
const (
	// module name
	ModuleName = "asset"

	// StoreKey is string representation of the store key for auth
	StoreKey = "asset"

	// QuerierRoute is the querier route for acc
	QuerierRoute = StoreKey
)
View Source
const (
	QueryCoin            = "coin"
	QueryCoins           = "coins"
	QueryCoinPower       = "coinpower"
	QueryCoinPowers      = "coinpowers"
	QueryCoinStat        = "coinstate"
	QueryCoinDescription = "coindesc"
	QueryCoinLocked      = "coinslocked"
)

query endpoints supported by the auth Querier

View Source
const (
	AttributeValueCategory = ModuleName
)
View Source
const (
	CoinDescriptionLen = 256
)
View Source
const (
	MaxDescriptionLength = 256
)
View Source
const RouterKey = ModuleName

RouterKey is they name of the asset module

Variables

View Source
var (
	CoinDenom             = types.CoinDenom
	CoinAccountsFromDenom = types.CoinAccountsFromDenom
	NewCoin               = types.NewCoin
	NewName               = types.NewName
	MustName              = types.MustName
	NewAccountIDFromName  = types.NewAccountIDFromName
	NewAccountIDFromStr   = types.NewAccountIDFromStr
	NewInt                = sdk.NewInt
)
View Source
var (
	ErrAssetHasCreated                       = sdkerrors.Register(ModuleName, 1, "asset has created")
	ErrAssetDenom                            = sdkerrors.Register(ModuleName, 2, "denom format error")
	ErrAssetDescriptorTooLarge               = sdkerrors.Register(ModuleName, 3, "description for coin too large")
	ErrAssetIssueGTMaxSupply                 = sdkerrors.Register(ModuleName, 4, "asset issue cannot great then max supply")
	ErrAssetNoCreator                        = sdkerrors.Register(ModuleName, 5, "asset creator error")
	ErrAssetCoinNoExit                       = sdkerrors.Register(ModuleName, 6, "asset no exit")
	ErrAssetCoinNoEnough                     = sdkerrors.Register(ModuleName, 7, "account coins no enough")
	ErrAssetFromAccountEmpty                 = sdkerrors.Register(ModuleName, 8, "from account empty")
	ErrAssetToAccountEmpty                   = sdkerrors.Register(ModuleName, 9, "to account empty")
	ErrAssetLockCoinsNoEnough                = sdkerrors.Register(ModuleName, 10, "current coins need great or equal to lock coins")
	ErrAssetLockUnlockBlockHeightErr         = sdkerrors.Register(ModuleName, 11, "unlock block height error")
	ErrAssetUnLockCoins                      = sdkerrors.Register(ModuleName, 12, "unlock coins error")
	ErrAssetCoinsLocked                      = sdkerrors.Register(ModuleName, 13, "coins has locked")
	ErrAssetCoinCannotBeLock                 = sdkerrors.Register(ModuleName, 14, "coin state not allowe lock")
	ErrAssetCoinCannotBeIssue                = sdkerrors.Register(ModuleName, 15, "coin state not allowe issue")
	ErrAssetCoinCannotBeIssueInHeight        = sdkerrors.Register(ModuleName, 16, "coin state not allowe issue that in this height")
	ErrAssetCoinMustCanIssueWhenIssueByBlock = sdkerrors.Register(ModuleName, 17, "coin state must can issue when set to issue by height")
	ErrAssetCoinMustSupplyNeedGTInitSupply   = sdkerrors.Register(ModuleName, 18, "coin max_supply need > init_supply")
	ErrAssetIssueToHeightMustGTCurrentHeight = sdkerrors.Register(ModuleName, 19, "coin issue to height must > current height")
)
View Source
var (
	// AssetModuleKeyPrefix prefix for asset store
	// TODO: all Store key prefix should be more to a go package
	AssetModuleKeyPrefix = []byte{0x02}

	CoinStoreKeyPrefix           = chainTypes.MustName("coin").Bytes()
	CoinPowerStoreKeyPrefix      = chainTypes.MustName("coin.power").Bytes()
	CoinLockedStoreKeyPrefix     = chainTypes.MustName("coin.lock").Bytes()
	CoinLockedStatStoreKeyPrefix = chainTypes.MustName("coin.locks").Bytes()
	CoinStatStoreKeyPrefix       = chainTypes.MustName("coin.stat").Bytes()
	CoinDescStoreKeyPrefix       = chainTypes.MustName("coin.desc").Bytes()
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ModuleCdc = codec.New()

ModuleCdc auth module wide codec

View Source
var (
	RouterKeyName = types.MustName(RouterKey)
)

Functions

func AccountIDFromCoinLockedStatStoreKey

func AccountIDFromCoinLockedStatStoreKey(key []byte) chainTypes.AccountID

AccountIDFromCoinLockedStatStoreKey get accountID from key

func AccountIDFromCoinLockedStoreKey

func AccountIDFromCoinLockedStoreKey(key []byte) chainTypes.AccountID

AccountIDFromCoinLockedStoreKey get accountID from key

func AccountIDFromCoinPowerStoreKey

func AccountIDFromCoinPowerStoreKey(key []byte) chainTypes.AccountID

AccountIDFromCoinPowerStoreKey get accountID from key

func AccountIDFromCoinStoreKey

func AccountIDFromCoinStoreKey(key []byte) chainTypes.AccountID

AccountIDFromCoinStoreKey get accountID from key

func Cdc

func Cdc() *codec.Codec

Cdc get codec for types

func CheckCoinStatOpts

func CheckCoinStatOpts(createHeight int64, canIssue, canLock bool, issue2Height int64, init, max Coin) error

func CoinDescStoreKey

func CoinDescStoreKey(creator, symbol chainTypes.Name) []byte

CoinDescStoreKey get the key of coin desc store keeper for asset

func CoinLockedStatStoreKey

func CoinLockedStatStoreKey(account chainTypes.AccountID) []byte

CoinLockedStatStoreKey get the key of coin store keeper for asset

func CoinLockedStoreKey

func CoinLockedStoreKey(account chainTypes.AccountID) []byte

CoinLockedStoreKey get the key of coin store keeper for asset

func CoinPowerStoreKey

func CoinPowerStoreKey(account chainTypes.AccountID) []byte

CoinPowerStoreKey get the key of coin store keeper for asset

func CoinStatStoreKey

func CoinStatStoreKey(creator, symbol chainTypes.Name) []byte

CoinStatStoreKey get the key of coin state store keeper for asset

func CoinStoreKey

func CoinStoreKey(account chainTypes.AccountID) []byte

CoinStoreKey get the key of coin store keeper for asset

func GetKeyPrefix

func GetKeyPrefix(pre []byte) []byte

GetKeyPrefix get key prefix for coins

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the codec

Types

type AccountID

type AccountID = types.AccountID

type AssetRetriever

type AssetRetriever struct {
	// contains filtered or unexported fields
}

AssetRetriever defines the properties of a type that can be used to retrieve accounts.

func NewAssetRetriever

func NewAssetRetriever(querier NodeQuerier) AssetRetriever

NewAssetRetriever init a new AssetRetriever instance.

func (AssetRetriever) GetCoin

func (ar AssetRetriever) GetCoin(acc AccountID, creator, symbol Name) (Coin, int64, error)

GetCoin queries for coin for a account

func (AssetRetriever) GetCoinPower

func (ar AssetRetriever) GetCoinPower(acc AccountID, creator, symbol Name) (Coin, int64, error)

GetCoin queries for coin for a account

func (AssetRetriever) GetCoinPowers

func (ar AssetRetriever) GetCoinPowers(acc AccountID) (Coins, int64, error)

GetCoinPowers queries for coins powers for a account

func (AssetRetriever) GetCoinStat

func (ar AssetRetriever) GetCoinStat(creator, symbol Name) (GetCoinStatResponse, int64, error)

func (AssetRetriever) GetCoins

func (ar AssetRetriever) GetCoins(acc AccountID) (Coins, int64, error)

GetCoins queries for coins for a account

func (AssetRetriever) GetLockedCoins

func (ar AssetRetriever) GetLockedCoins(acc AccountID) (QueryLockedCoinsResponse, int64, error)

GetLockedCoins queries for coins locked for a account

type BaseGenesisAsset

type BaseGenesisAsset struct {
	ID    AccountID `json:"id"`
	Coins Coins     `json:"coins"`
}

func NewGenesisAsset

func NewGenesisAsset(id AccountID, coins ...Coin) BaseGenesisAsset

func NewGenesisAssetByCoins

func NewGenesisAssetByCoins(id AccountID, coins Coins) BaseGenesisAsset

func (BaseGenesisAsset) GetCoins

func (g BaseGenesisAsset) GetCoins() Coins

func (BaseGenesisAsset) GetID

func (g BaseGenesisAsset) GetID() AccountID

type BaseGensisAssetCoin

type BaseGensisAssetCoin struct {
	Creator     Name   `json:"creator"`
	Symbol      Name   `json:"symbol"`
	MaxSupply   Coin   `json:"maxSupply"`
	Description string `json:"description"`
}

GensisAssetCoin

func NewGenesisCoin

func NewGenesisCoin(creator, symbol Name, maxSupplyAmount Int, description string) BaseGensisAssetCoin

func (BaseGensisAssetCoin) GetCreator

func (g BaseGensisAssetCoin) GetCreator() Name

GetCreator imp GenesisCoin

func (BaseGensisAssetCoin) GetDescription

func (g BaseGensisAssetCoin) GetDescription() string

GetDescription imp GenesisCoin

func (BaseGensisAssetCoin) GetMaxSupply

func (g BaseGensisAssetCoin) GetMaxSupply() Coin

GetMaxSupply imp GenesisCoin

func (BaseGensisAssetCoin) GetSymbol

func (g BaseGensisAssetCoin) GetSymbol() Name

GetSymbol imp GenesisCoin

func (BaseGensisAssetCoin) Validate

func (g BaseGensisAssetCoin) Validate() error

Validate imp GenesisCoin

type Coin

type Coin = types.Coin

type CoinDescription

type CoinDescription struct {
	// Symbol coin symbol name
	Symbol types.Name `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol" yaml:"symbol"`
	// Creator coin creator account name
	Creator types.Name `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator" yaml:"creator"`
	// Description coin description info
	Description []byte `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty" yaml:"description"`
}

CoinDescription description info for a coin type

func NewCoinDescription

func NewCoinDescription(creator, symbol Name, desc []byte) CoinDescription

NewCoinDescription create coin description

func (*CoinDescription) Descriptor

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

func (*CoinDescription) Marshal

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

func (*CoinDescription) MarshalTo

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

func (*CoinDescription) MarshalToSizedBuffer

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

func (*CoinDescription) ProtoMessage

func (*CoinDescription) ProtoMessage()

func (*CoinDescription) Reset

func (m *CoinDescription) Reset()

func (*CoinDescription) Size

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

func (CoinDescription) String

func (m CoinDescription) String() string

func (*CoinDescription) Unmarshal

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

func (*CoinDescription) XXX_DiscardUnknown

func (m *CoinDescription) XXX_DiscardUnknown()

func (*CoinDescription) XXX_Marshal

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

func (*CoinDescription) XXX_Merge

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

func (*CoinDescription) XXX_Size

func (m *CoinDescription) XXX_Size() int

func (*CoinDescription) XXX_Unmarshal

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

type CoinStat

type CoinStat struct {
	// Symbol coin symbol name
	Symbol types.Name `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol" yaml:"symbol"`
	// Creator coin creator account name
	Creator      types.Name `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator" yaml:"creator"`
	CreateHeight int64      `protobuf:"varint,3,opt,name=create_height,json=createHeight,proto3" json:"create_height,omitempty" yaml:"create_height"`
	// Supply coin current supply
	Supply types1.Coin `protobuf:"bytes,4,opt,name=supply,proto3" json:"supply" yaml:"supply"`
	// MaxSupply coin max supply limit
	MaxSupply     types1.Coin `protobuf:"bytes,5,opt,name=max_supply,json=maxSupply,proto3" json:"max_supply" yaml:"max_supply"`
	CanIssue      bool        `protobuf:"varint,6,opt,name=can_issue,json=canIssue,proto3" json:"can_issue,omitempty" yaml:"can_issue"`
	CanLock       bool        `protobuf:"varint,7,opt,name=can_lock,json=canLock,proto3" json:"can_lock,omitempty" yaml:"can_lock"`
	IssueToHeight int64       `` /* 126-byte string literal not displayed */
	// InitSupply coin init supply, if issue_to_height is not zero, this will be the start supply for issue
	InitSupply types1.Coin `protobuf:"bytes,9,opt,name=init_supply,json=initSupply,proto3" json:"init_supply" yaml:"init_supply"`
}

CoinStat state for a coin type

func NewCoinStat

func NewCoinStat(ctx sdk.Context, creator, symbol Name, maxSupply Coin) CoinStat

NewCoinStat creates a Coin status

func (*CoinStat) Descriptor

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

func (*CoinStat) GetCurrentMaxSupplyLimit

func (c *CoinStat) GetCurrentMaxSupplyLimit(currentHeight int64) types.Coin

func (*CoinStat) Marshal

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

func (*CoinStat) MarshalTo

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

func (*CoinStat) MarshalToSizedBuffer

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

func (*CoinStat) ProtoMessage

func (*CoinStat) ProtoMessage()

func (*CoinStat) Reset

func (m *CoinStat) Reset()

func (*CoinStat) SetOpt

func (c *CoinStat) SetOpt(canIssue, canLock bool, issue2Height int64, initSupply Coin) error

SetOpt set coin optional

func (*CoinStat) Size

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

func (CoinStat) String

func (m CoinStat) String() string

func (*CoinStat) Unmarshal

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

func (*CoinStat) XXX_DiscardUnknown

func (m *CoinStat) XXX_DiscardUnknown()

func (*CoinStat) XXX_Marshal

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

func (*CoinStat) XXX_Merge

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

func (*CoinStat) XXX_Size

func (m *CoinStat) XXX_Size() int

func (*CoinStat) XXX_Unmarshal

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

type Coins

type Coins = types.Coins

type GenesisAsset

type GenesisAsset interface {
	GetID() AccountID
	GetCoins() Coins
}

GenesisAsset gensis asset for accountID

type GenesisCoin

type GenesisCoin interface {
	GetCreator() Name
	GetSymbol() Name
	GetMaxSupply() Coin
	GetDescription() string

	Validate() error
}

GenesisCoin gensis coin type

type GenesisState

type GenesisState struct {
	GenesisAssets []GenesisAsset `json:"genesisAssets"`
	GenesisCoins  []GenesisCoin  `json:"genesisCoins"`
}

GenesisState is the bank state that must be provided at genesis.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func NewGenesisState

func NewGenesisState() GenesisState

NewGenesisState creates a new genesis state.

func (GenesisState) ValidateGenesis

func (g GenesisState) ValidateGenesis() error

ValidateGenesis performs basic validation of bank genesis data returning an error for any failed validation criteria.

type GetCoinStatResponse

type GetCoinStatResponse struct {
	CoinStat

	CoinDescription       string `json:"description"`
	CurrentMaxSupplyLimit Coin   `json:"current_max_supply"`
}

type Int

type Int = sdk.Int

type KuMsg

type KuMsg = types.KuMsg

func NewMsgTransfer

func NewMsgTransfer(auth types.AccAddress, from types.AccountID, to types.AccountID, amount sdk.Coins) KuMsg

NewMsgTransfer create msg transfer

type LockedCoins

type LockedCoins struct {
	Coins             types.Coins `json:"coins" yaml:"coins"`
	UnlockBlockHeight int64       `json:"unlock_block_height" yaml:"unlock_block_height"`
}

type MsgBurnCoin

type MsgBurnCoin struct {
	types.KuMsg
}

type MsgBurnCoinData

type MsgBurnCoinData struct {
	// Symbol coin symbol name
	Id types.AccountID `protobuf:"bytes,1,opt,name=id,proto3" json:"id" yaml:"id"`
	// MaxSupply coin max supply limit
	Amount types1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount" yaml:"amount"`
}

func (*MsgBurnCoinData) Descriptor

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

func (*MsgBurnCoinData) Marshal

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

func (*MsgBurnCoinData) MarshalTo

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

func (*MsgBurnCoinData) MarshalToSizedBuffer

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

func (*MsgBurnCoinData) ProtoMessage

func (*MsgBurnCoinData) ProtoMessage()

func (*MsgBurnCoinData) Reset

func (m *MsgBurnCoinData) Reset()

func (*MsgBurnCoinData) Size

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

func (*MsgBurnCoinData) String

func (m *MsgBurnCoinData) String() string

func (MsgBurnCoinData) Type

func (MsgBurnCoinData) Type() types.Name

Type imp for data KuMsgData

func (*MsgBurnCoinData) Unmarshal

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

func (*MsgBurnCoinData) XXX_DiscardUnknown

func (m *MsgBurnCoinData) XXX_DiscardUnknown()

func (*MsgBurnCoinData) XXX_Marshal

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

func (*MsgBurnCoinData) XXX_Merge

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

func (*MsgBurnCoinData) XXX_Size

func (m *MsgBurnCoinData) XXX_Size() int

func (*MsgBurnCoinData) XXX_Unmarshal

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

type MsgCreateCoin

type MsgCreateCoin struct {
	types.KuMsg
}

func NewMsgCreate

func NewMsgCreate(auth types.AccAddress, creator types.Name, symbol types.Name, maxSupply types.Coin, canIssue, canLock bool, issue2Height int64, initSupply types.Coin, desc []byte) MsgCreateCoin

NewMsgCreate new create coin msg

type MsgCreateCoinData

type MsgCreateCoinData struct {
	// Symbol coin symbol name
	Symbol types.Name `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol" yaml:"symbol"`
	// Creator coin creator account name
	Creator types.Name `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator" yaml:"creator"`
	// MaxSupply coin max supply limit
	MaxSupply types1.Coin `protobuf:"bytes,3,opt,name=max_supply,json=maxSupply,proto3" json:"max_supply" yaml:"max_supply"`
	// CanIssue if the coin can issue after create
	CanIssue bool `protobuf:"varint,4,opt,name=can_issue,json=canIssue,proto3" json:"can_issue,omitempty" yaml:"can_issue"`
	// CanLock if the coin can lock by user
	CanLock bool `protobuf:"varint,5,opt,name=can_lock,json=canLock,proto3" json:"can_lock,omitempty" yaml:"can_lock"`
	// IssueToHeight if this is not zero, creator only can issue this
	IssueToHeight int64 `` /* 126-byte string literal not displayed */
	// InitSupply coin init supply, if issue_to_height is not zero, this will be the start supply for issue
	InitSupply types1.Coin `protobuf:"bytes,7,opt,name=init_supply,json=initSupply,proto3" json:"init_supply" yaml:"init_supply"`
	Desc       []byte      `protobuf:"bytes,8,opt,name=desc,proto3" json:"desc,omitempty" yaml:"desc"`
}

func (*MsgCreateCoinData) Descriptor

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

func (*MsgCreateCoinData) Marshal

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

func (*MsgCreateCoinData) MarshalTo

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

func (*MsgCreateCoinData) MarshalToSizedBuffer

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

func (*MsgCreateCoinData) ProtoMessage

func (*MsgCreateCoinData) ProtoMessage()

func (*MsgCreateCoinData) Reset

func (m *MsgCreateCoinData) Reset()

func (*MsgCreateCoinData) Size

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

func (*MsgCreateCoinData) String

func (m *MsgCreateCoinData) String() string

func (MsgCreateCoinData) Type

func (MsgCreateCoinData) Type() types.Name

func (*MsgCreateCoinData) Unmarshal

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

func (*MsgCreateCoinData) XXX_DiscardUnknown

func (m *MsgCreateCoinData) XXX_DiscardUnknown()

func (*MsgCreateCoinData) XXX_Marshal

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

func (*MsgCreateCoinData) XXX_Merge

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

func (*MsgCreateCoinData) XXX_Size

func (m *MsgCreateCoinData) XXX_Size() int

func (*MsgCreateCoinData) XXX_Unmarshal

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

type MsgIssueCoin

type MsgIssueCoin struct {
	types.KuMsg
}

func NewMsgBurn

func NewMsgBurn(auth types.AccAddress, id types.AccountID, amount types.Coin) MsgIssueCoin

NewMsgBurn new issue msg

func NewMsgIssue

func NewMsgIssue(auth types.AccAddress, creator, symbol types.Name, amount types.Coin) MsgIssueCoin

NewMsgIssue new issue msg

type MsgIssueCoinData

type MsgIssueCoinData struct {
	// Symbol coin symbol name
	Symbol types.Name `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol" yaml:"symbol"`
	// Creator coin creator account name
	Creator types.Name `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator" yaml:"creator"`
	// MaxSupply coin max supply limit
	Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount" yaml:"amount"`
}

func (*MsgIssueCoinData) Descriptor

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

func (*MsgIssueCoinData) Marshal

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

func (*MsgIssueCoinData) MarshalTo

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

func (*MsgIssueCoinData) MarshalToSizedBuffer

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

func (*MsgIssueCoinData) ProtoMessage

func (*MsgIssueCoinData) ProtoMessage()

func (*MsgIssueCoinData) Reset

func (m *MsgIssueCoinData) Reset()

func (*MsgIssueCoinData) Size

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

func (*MsgIssueCoinData) String

func (m *MsgIssueCoinData) String() string

func (MsgIssueCoinData) Type

func (MsgIssueCoinData) Type() types.Name

Type imp for data KuMsgData

func (*MsgIssueCoinData) Unmarshal

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

func (*MsgIssueCoinData) XXX_DiscardUnknown

func (m *MsgIssueCoinData) XXX_DiscardUnknown()

func (*MsgIssueCoinData) XXX_Marshal

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

func (*MsgIssueCoinData) XXX_Merge

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

func (*MsgIssueCoinData) XXX_Size

func (m *MsgIssueCoinData) XXX_Size() int

func (*MsgIssueCoinData) XXX_Unmarshal

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

type MsgLockCoin

type MsgLockCoin struct {
	types.KuMsg
}

MsgLockCoin msg to lock coin

func NewMsgLockCoin

func NewMsgLockCoin(auth types.AccAddress, id types.AccountID, amount types.Coins, unlockBlockHeight int64) MsgLockCoin

NewMsgLockCoin create new lock coin msg

type MsgLockCoinData

type MsgLockCoinData struct {
	// Id lock account
	Id types.AccountID `protobuf:"bytes,1,opt,name=id,proto3" json:"id" yaml:"id"`
	// Amount coins to lock
	Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount" yaml:"amount"`
	// UnlockBlockHeight the block height the coins unlock
	UnlockBlockHeight int64 `protobuf:"varint,3,opt,name=unlockBlockHeight,proto3" json:"unlockBlockHeight,omitempty" yaml:"unlockBlockHeight"`
}

func (*MsgLockCoinData) Descriptor

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

func (*MsgLockCoinData) Marshal

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

func (*MsgLockCoinData) MarshalTo

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

func (*MsgLockCoinData) MarshalToSizedBuffer

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

func (*MsgLockCoinData) ProtoMessage

func (*MsgLockCoinData) ProtoMessage()

func (*MsgLockCoinData) Reset

func (m *MsgLockCoinData) Reset()

func (*MsgLockCoinData) Size

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

func (*MsgLockCoinData) String

func (m *MsgLockCoinData) String() string

func (*MsgLockCoinData) Type

func (m *MsgLockCoinData) Type() types.Name

Type imp for data KuMsgData

func (*MsgLockCoinData) Unmarshal

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

func (*MsgLockCoinData) XXX_DiscardUnknown

func (m *MsgLockCoinData) XXX_DiscardUnknown()

func (*MsgLockCoinData) XXX_Marshal

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

func (*MsgLockCoinData) XXX_Merge

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

func (*MsgLockCoinData) XXX_Size

func (m *MsgLockCoinData) XXX_Size() int

func (*MsgLockCoinData) XXX_Unmarshal

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

type MsgUnlockCoin

type MsgUnlockCoin struct {
	types.KuMsg
}

MsgUnlockCoin msg to unlock coin

func NewMsgUnlockCoin

func NewMsgUnlockCoin(auth types.AccAddress, id types.AccountID, amount types.Coins) MsgUnlockCoin

NewMsgUnlockCoin create new lock coin msg

type MsgUnlockCoinData

type MsgUnlockCoinData struct {
	// Id lock account
	Id types.AccountID `protobuf:"bytes,1,opt,name=id,proto3" json:"id" yaml:"id"`
	// Amount coins to lock
	Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount" yaml:"amount"`
}

func (*MsgUnlockCoinData) Descriptor

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

func (*MsgUnlockCoinData) Marshal

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

func (*MsgUnlockCoinData) MarshalTo

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

func (*MsgUnlockCoinData) MarshalToSizedBuffer

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

func (*MsgUnlockCoinData) ProtoMessage

func (*MsgUnlockCoinData) ProtoMessage()

func (*MsgUnlockCoinData) Reset

func (m *MsgUnlockCoinData) Reset()

func (*MsgUnlockCoinData) Size

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

func (*MsgUnlockCoinData) String

func (m *MsgUnlockCoinData) String() string

func (*MsgUnlockCoinData) Type

func (m *MsgUnlockCoinData) Type() types.Name

Type imp for data KuMsgData

func (*MsgUnlockCoinData) Unmarshal

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

func (*MsgUnlockCoinData) XXX_DiscardUnknown

func (m *MsgUnlockCoinData) XXX_DiscardUnknown()

func (*MsgUnlockCoinData) XXX_Marshal

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

func (*MsgUnlockCoinData) XXX_Merge

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

func (*MsgUnlockCoinData) XXX_Size

func (m *MsgUnlockCoinData) XXX_Size() int

func (*MsgUnlockCoinData) XXX_Unmarshal

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

type Name

type Name = types.Name

type NodeQuerier

type NodeQuerier interface {
	// QueryWithData performs a query to a Tendermint node with the provided path
	// and a data payload. It returns the result and height of the query upon success
	// or an error if the query fails.
	QueryWithData(path string, data []byte) ([]byte, int64, error)
}

NodeQuerier is an interface that is satisfied by types that provide the QueryWithData method

type QueryCoinDescParams

type QueryCoinDescParams struct {
	Creator types.Name
	Symbol  types.Name
}

QueryCoinDescParams defines the params for querying coin desc.

func NewQueryCoinDescParams

func NewQueryCoinDescParams(creator, symbol types.Name) QueryCoinDescParams

NewQueryCoinDescParams creates a new instance of QueryCoinDescParams.

type QueryCoinParams

type QueryCoinParams struct {
	AccountID types.AccountID
	Creator   types.Name
	Symbol    types.Name
}

QueryCoinParams defines the params for querying coin.

func NewQueryCoinParams

func NewQueryCoinParams(accountID types.AccountID, creator, symbol types.Name) QueryCoinParams

NewQueryCoinParams creates a new instance of QueryCoinParams.

type QueryCoinPowerParams

type QueryCoinPowerParams struct {
	AccountID types.AccountID
	Creator   types.Name
	Symbol    types.Name
}

QueryCoinPowerParams defines the params for querying coin.

func NewQueryCoinPowerParams

func NewQueryCoinPowerParams(accountID types.AccountID, creator, symbol types.Name) QueryCoinPowerParams

NewQueryCoinPowerParams creates a new instance of QueryCoinParams.

type QueryCoinPowersParams

type QueryCoinPowersParams struct {
	AccountID types.AccountID
}

QueryCoinPowersParams defines the params for querying coin.

func NewQueryCoinPowersParams

func NewQueryCoinPowersParams(accountID types.AccountID) QueryCoinPowersParams

NewQueryCoinPowersParams creates a new instance of QueryCoinParams.

type QueryCoinStatParams

type QueryCoinStatParams struct {
	Creator types.Name
	Symbol  types.Name
}

QueryCoinStatParams defines the params for querying coin stat.

func NewQueryCoinStatParams

func NewQueryCoinStatParams(creator, symbol types.Name) QueryCoinStatParams

NewQueryCoinStatParams creates a new instance of QueryCoinStatParams.

type QueryCoinsParams

type QueryCoinsParams struct {
	AccountID types.AccountID
}

QueryCoinsParams defines the params for querying coin.

func NewQueryCoinsParams

func NewQueryCoinsParams(accountID types.AccountID) QueryCoinsParams

NewQueryCoinsParams creates a new instance of QueryCoinParams.

type QueryLockedCoinsParams

type QueryLockedCoinsParams struct {
	AccountID types.AccountID
}

QueryLockedCoinsParams defines the params for querying coin.

func NewQueryLockedCoinsParams

func NewQueryLockedCoinsParams(accountID types.AccountID) QueryLockedCoinsParams

NewQueryLockedCoinsParamscreates a new instance of QueryCoinParams.

type QueryLockedCoinsResponse

type QueryLockedCoinsResponse struct {
	LockedCoins types.Coins   `json:"coins"`
	Locks       []LockedCoins `json:"locks"`
}

Jump to

Keyboard shortcuts

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