types

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

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

	// RouterKey is the message route for account
	RouterKey = ModuleName

	// QuerierRoute is the querier route for account
	QuerierRoute = ModuleName

	// query pathes
	QueryAccountInfo            = "info"
	QueryAccountBank            = "bank"
	QueryAccountBankByAddress   = "bankByAddress"
	QueryAccountMeta            = "meta"
	QueryAccountPendingCoinDay  = "pendingCoinDay"
	QueryAccountGrantPubKeys    = "grantPubKey"
	QueryAccountAllGrantPubKeys = "allGrantPubKey"
	QueryTxAndAccountSequence   = "txAndSeq"
	QueryPool                   = "pool"
	QuerySupply                 = "supply"
)

Variables

This section is empty.

Functions

func ErrAccountAlreadyExists

func ErrAccountAlreadyExists(accKey types.AccountKey) sdk.Error

ErrAccountAlreadyExists - error when register user already exists

func ErrAccountBankNotFound added in v0.6.0

func ErrAccountBankNotFound(addr sdk.Address) sdk.Error

ErrAccountBankNotFound - error if account bank is not found

func ErrAccountNotFound

func ErrAccountNotFound(username types.AccountKey) sdk.Error

ErrAccountNotFound - error when account is not found

func ErrAccountSavingCoinNotEnough

func ErrAccountSavingCoinNotEnough() sdk.Error

ErrAccountSavingCoinNotEnough - error when user saving balance not enough

func ErrAccountTPSCapacityNotEnough

func ErrAccountTPSCapacityNotEnough(accKey types.AccountKey) sdk.Error

ErrAccountTPSCapacityNotEnough - error when user tps capacity not enough

func ErrAddSavingCoin

func ErrAddSavingCoin() sdk.Error

ErrAddSavingCoin - error when register add deposit failed

func ErrAddSavingCoinWithFullCoinDay

func ErrAddSavingCoinWithFullCoinDay() sdk.Error

ErrAddSavingCoinWithFullCoinDay - error when register deposit with full coin day failed

func ErrAddressAlreadyTaken

func ErrAddressAlreadyTaken(addr string) sdk.Error

ErrAddressAlreadyTaken - error when register address is already took by other username

func ErrAppGrantKeyMismatch

func ErrAppGrantKeyMismatch(owner types.AccountKey) sdk.Error

ErrGrantKeyMismatch - error when transaction signed by mismatch app permission grant public key

func ErrCheckAuthenticatePubKeyAddress added in v0.4.0

func ErrCheckAuthenticatePubKeyAddress(addr sdk.AccAddress) sdk.Error

ErrCheckAuthenticatePubKeyAddress - error when transaction signed by invalid public key

func ErrCheckAuthenticatePubKeyOwner

func ErrCheckAuthenticatePubKeyOwner(accKey types.AccountKey) sdk.Error

ErrCheckAuthenticatePubKeyOwner - error when transaction signed by invalid public key

func ErrCheckGrantAppKey

func ErrCheckGrantAppKey() sdk.Error

ErrCheckGrantAppKey - error when transaction needs app key permission signed by other key

func ErrCheckResetKey

func ErrCheckResetKey() sdk.Error

ErrCheckResetKey - error when transaction needs reset permission signed by other key

func ErrCheckTransactionKey

func ErrCheckTransactionKey() sdk.Error

ErrCheckTransactionKey - error when transaction needs transaction key permission signed by other key

func ErrCheckUserTPSCapacity

func ErrCheckUserTPSCapacity(accKey types.AccountKey) sdk.Error

ErrCheckUserTPSCapacity - error when check user capacity failed

func ErrFrozenMoneyListTooLong

func ErrFrozenMoneyListTooLong() sdk.Error

ErrFrozenMoneyListTooLong - error when the length of frozen money list exceeds the upper limit

func ErrGetAddress

func ErrGetAddress(err error) sdk.Error

ErrGetAddress - error when get address failed

func ErrGetAppKey

func ErrGetAppKey(accKey types.AccountKey) sdk.Error

ErrGetAppKey - error when get app public key failed

func ErrGetFrozenMoneyList

func ErrGetFrozenMoneyList(err error) sdk.Error

ErrGetFrozenMoneyList - error when get frozen money list failed

func ErrGetLastPostAt

func ErrGetLastPostAt(err error) sdk.Error

ErrGetLastPostAt - error when get last post time failed

func ErrGetLastReportOrUpvoteAt

func ErrGetLastReportOrUpvoteAt(err error) sdk.Error

ErrGetLastReportOrUpvoteAt - error when get last report or upvote time failed

func ErrGetResetKey

func ErrGetResetKey(accKey types.AccountKey) sdk.Error

ErrGetResetKey - error when get reset public key failed

func ErrGetSavingFromBank

func ErrGetSavingFromBank(err error) sdk.Error

ErrGetSavingFromBank - error when get saving failed

func ErrGetSequence

func ErrGetSequence(err error) sdk.Error

ErrGetSequence - error when get sequence number failed

func ErrGetSigningKey

func ErrGetSigningKey(username types.AccountKey) sdk.Error

ErrSigningKey - error when get signing public key failed

func ErrGetTransactionKey

func ErrGetTransactionKey(accKey types.AccountKey) sdk.Error

ErrGetTransactionKey - error when get transaction public key failed

func ErrGrantKeyExpired

func ErrGrantKeyExpired(owner types.AccountKey) sdk.Error

ErrGrantKeyExpired - error when transaction signed by expired grant public key

func ErrGrantKeyMismatch

func ErrGrantKeyMismatch(owner types.AccountKey) sdk.Error

ErrGrantKeyMismatch - error when transaction signed by mismatch permission grant public key

func ErrGrantPubKeyNotFound added in v0.6.0

func ErrGrantPubKeyNotFound() sdk.Error

ErrGrantPubKeyNotFound - error if grant public key is not found

func ErrIncreaseSequenceByOne

func ErrIncreaseSequenceByOne(err error) sdk.Error

ErrIncreaseSequenceByOne - error when increase sequence number failed

func ErrInvalidJSONMeta

func ErrInvalidJSONMeta() sdk.Error

ErrInvalidJSONMeta - error when JSON meta is invalid (length too long)

func ErrInvalidMemo

func ErrInvalidMemo() sdk.Error

ErrInvalidMemo - error when memo is invalid (length too long)

func ErrInvalidUsername

func ErrInvalidUsername(msg string) sdk.Error

ErrInvalidUsername - error when username is invalid

func ErrNegativeMoveAmount added in v0.6.0

func ErrNegativeMoveAmount(amount types.Coin) sdk.Error

ErrNegativeMoveAmount -

func ErrPoolNotEnough added in v0.6.0

func ErrPoolNotEnough(name types.PoolName) sdk.Error

ErrPoolNotEnough - error if pool balance is not enough.

func ErrPoolNotFound added in v0.6.0

func ErrPoolNotFound(name types.PoolName) sdk.Error

ErrPoolNotFound - error if pool is not found

func ErrPreAuthAmountInsufficient

func ErrPreAuthAmountInsufficient(owner types.AccountKey, balance, consume types.Coin) sdk.Error

ErrPreAuthAmountInsufficient - error when transaction cost coin exceeds preauth amount

func ErrPreAuthGrantKeyMismatch

func ErrPreAuthGrantKeyMismatch(owner types.AccountKey) sdk.Error

ErrPreAuthGrantKeyMismatch - error when transaction signed by mismatch preauth permission grant public key

func ErrQueryFailed

func ErrQueryFailed() sdk.Error

ErrQueryFailed - error when query account store failed

func ErrQueryTxFailed

func ErrQueryTxFailed(msg string) sdk.Error

ErrQueryTxFaild - error when query tx failed

func ErrReceiverNotFound

func ErrReceiverNotFound(username types.AccountKey) sdk.Error

ErrReceiverNotFound - error when receiver user is not found

func ErrReferrerNotFound

func ErrReferrerNotFound(username types.AccountKey) sdk.Error

ErrReferrerNotFound - error when referrer is not found

func ErrRegisterFeeInsufficient

func ErrRegisterFeeInsufficient() sdk.Error

ErrRegisterFeeInsufficient - error when register fee insufficient

func ErrRevokePermissionLevelMismatch

func ErrRevokePermissionLevelMismatch(got, expect types.Permission) sdk.Error

ErrRevokePermissionLevelMismatch - error when revoke permission doesn't match target public key

func ErrSenderNotFound

func ErrSenderNotFound(username types.AccountKey) sdk.Error

ErrSenderNotFound - error when sender user is not found

func ErrUnsupportGrantLevel

func ErrUnsupportGrantLevel() sdk.Error

ErrUnsupportGrantLevel - error when grant permission not supported

func ErrUpdateLastPostAt

func ErrUpdateLastPostAt(err error) sdk.Error

ErrUpdateLastPostAt - error when update last post time failed

func ErrUpdateLastReportOrUpvoteAt

func ErrUpdateLastReportOrUpvoteAt(err error) sdk.Error

ErrGetLastReportOrUpvoteAt - error when update last report or upvote time failed

func RegisterWire

func RegisterWire(cdc *wire.Codec)

RegisterWire - register concrete types on wire codec

Types

type RecoverMsg

type RecoverMsg struct {
	Username         types.AccountKey `json:"username"`
	NewTxPubKey      crypto.PubKey    `json:"new_tx_public_key"`
	NewSigningPubKey crypto.PubKey    `json:"new_signing_public_key"`
}

RecoverMsg - replace two keys

func NewRecoverMsg

func NewRecoverMsg(
	username string, transactionPubkey, signingPubkey crypto.PubKey) RecoverMsg

NewRecoverMsg - return a recover msg

func (RecoverMsg) GetAccOrAddrSigners added in v0.4.0

func (msg RecoverMsg) GetAccOrAddrSigners() []types.AccOrAddr

GetAccOrAddrSigners - implements types.AddrMsg

func (RecoverMsg) GetConsumeAmount

func (msg RecoverMsg) GetConsumeAmount() types.Coin

GetConsumeAmount - implements types.Msg

func (RecoverMsg) GetPermission

func (msg RecoverMsg) GetPermission() types.Permission

GetPermission - implements types.Msg

func (RecoverMsg) GetSignBytes

func (msg RecoverMsg) GetSignBytes() []byte

GetSignBytes - implements sdk.Msg

func (RecoverMsg) GetSigners

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

GetSigners - implements sdk.Msg

func (RecoverMsg) Route

func (msg RecoverMsg) Route() string

Route - implements sdk.Msg

func (RecoverMsg) String

func (msg RecoverMsg) String() string

func (RecoverMsg) Type

func (msg RecoverMsg) Type() string

Type - implements sdk.Msg

func (RecoverMsg) ValidateBasic

func (msg RecoverMsg) ValidateBasic() sdk.Error

ValidateBasic - implements sdk.Msg

type RegisterV2Msg added in v0.4.0

type RegisterV2Msg struct {
	Referrer             types.AccOrAddr  `json:"referrer"`
	RegisterFee          types.LNO        `json:"register_fee"`
	NewUser              types.AccountKey `json:"new_username"`
	NewTransactionPubKey crypto.PubKey    `json:"new_transaction_public_key"`
	NewSigningPubKey     crypto.PubKey    `json:"new_signing_public_key"`
}

RegisterV2Msg - bind username with public key, need to be referred by others (pay for it)

func NewRegisterV2Msg added in v0.4.0

func NewRegisterV2Msg(
	referrer types.AccOrAddr, newUser string, registerFee types.LNO,
	transactionPubkey, signingPubKey crypto.PubKey) RegisterV2Msg

NewRegisterV2Msg - construct register msg.

func (RegisterV2Msg) GetAccOrAddrSigners added in v0.4.0

func (msg RegisterV2Msg) GetAccOrAddrSigners() []types.AccOrAddr

GetAccOrAddrSigners - implements types.AddrMsg

func (RegisterV2Msg) GetSignBytes added in v0.4.0

func (msg RegisterV2Msg) GetSignBytes() []byte

GetSignBytes - implements sdk.Msg

func (RegisterV2Msg) GetSigners added in v0.4.0

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

GetSigners - implements sdk.Msg

func (RegisterV2Msg) Route added in v0.4.0

func (msg RegisterV2Msg) Route() string

Route - implements sdk.Msg

func (RegisterV2Msg) String added in v0.4.0

func (msg RegisterV2Msg) String() string

func (RegisterV2Msg) Type added in v0.4.0

func (msg RegisterV2Msg) Type() string

Type - implements sdk.Msg

func (RegisterV2Msg) ValidateBasic added in v0.4.0

func (msg RegisterV2Msg) ValidateBasic() sdk.Error

ValidateBasic - implements sdk.Msg

type TransferMsg

type TransferMsg struct {
	Sender   types.AccountKey `json:"sender"`
	Receiver types.AccountKey `json:"receiver"`
	Amount   types.LNO        `json:"amount"`
	Memo     string           `json:"memo"`
}

TransferMsg - sender transfer money to receiver

func NewTransferMsg

func NewTransferMsg(sender, receiver string, amount types.LNO, memo string) TransferMsg

NewTransferMsg - return a TransferMsg

func (TransferMsg) GetConsumeAmount

func (msg TransferMsg) GetConsumeAmount() types.Coin

GetConsumeAmount - implements types.Msg

func (TransferMsg) GetPermission

func (msg TransferMsg) GetPermission() types.Permission

GetPermission - implements types.Msg

func (TransferMsg) GetSignBytes

func (msg TransferMsg) GetSignBytes() []byte

GetSignBytes - implements sdk.Msg

func (TransferMsg) GetSigners

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

GetSigners - implements sdk.Msg

func (TransferMsg) Route

func (msg TransferMsg) Route() string

Route - implements sdk.Msg

func (TransferMsg) String

func (msg TransferMsg) String() string

func (TransferMsg) Type

func (msg TransferMsg) Type() string

Type - implements sdk.Msg

func (TransferMsg) ValidateBasic

func (msg TransferMsg) ValidateBasic() sdk.Error

ValidateBasic - implements sdk.Msg

type TransferV2Msg added in v0.4.0

type TransferV2Msg struct {
	Sender   types.AccOrAddr `json:"sender"`
	Receiver types.AccOrAddr `json:"receiver"`
	Amount   types.LNO       `json:"amount"`
	Memo     string          `json:"memo"`
}

TransferV2Msg - support account/addr to account/addr

func NewTransferV2Msg added in v0.4.0

func NewTransferV2Msg(sender, receiver types.AccOrAddr, amount types.LNO, memo string) TransferV2Msg

NewTransferV2Msg - return a TransferV2Msg

func (TransferV2Msg) GetAccOrAddrSigners added in v0.4.0

func (msg TransferV2Msg) GetAccOrAddrSigners() []types.AccOrAddr

GetAccOrAddrSigners - implements types.AddrMsg

func (TransferV2Msg) GetSignBytes added in v0.4.0

func (msg TransferV2Msg) GetSignBytes() []byte

GetSignBytes - implements sdk.Msg

func (TransferV2Msg) GetSigners added in v0.4.0

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

GetSigners - implements sdk.Msg

func (TransferV2Msg) Route added in v0.4.0

func (msg TransferV2Msg) Route() string

Route - implements sdk.Msg

func (TransferV2Msg) String added in v0.4.0

func (msg TransferV2Msg) String() string

func (TransferV2Msg) Type added in v0.4.0

func (msg TransferV2Msg) Type() string

Type - implements sdk.Msg

func (TransferV2Msg) ValidateBasic added in v0.4.0

func (msg TransferV2Msg) ValidateBasic() sdk.Error

ValidateBasic - implements sdk.Msg

type UpdateAccountMsg

type UpdateAccountMsg struct {
	Username types.AccountKey `json:"username"`
	JSONMeta string           `json:"json_meta"`
}

UpdateAccountMsg - update account JSON meta info

func NewUpdateAccountMsg

func NewUpdateAccountMsg(username string, jsonMeta string) UpdateAccountMsg

NewUpdateAccountMsg - construct user update msg to update user JSON meta info.

func (UpdateAccountMsg) GetConsumeAmount

func (msg UpdateAccountMsg) GetConsumeAmount() types.Coin

GetConsumeAmount - implements types.Msg

func (UpdateAccountMsg) GetPermission

func (msg UpdateAccountMsg) GetPermission() types.Permission

GetPermission - implements types.Msg

func (UpdateAccountMsg) GetSignBytes

func (msg UpdateAccountMsg) GetSignBytes() []byte

GetSignBytes - implements sdk.Msg

func (UpdateAccountMsg) GetSigners

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

GetSigners - implements sdk.Msg

func (UpdateAccountMsg) Route

func (msg UpdateAccountMsg) Route() string

Type - implements sdk.Msg

func (UpdateAccountMsg) String

func (msg UpdateAccountMsg) String() string

func (UpdateAccountMsg) Type

func (msg UpdateAccountMsg) Type() string

Type - implements sdk.Msg

func (UpdateAccountMsg) ValidateBasic

func (msg UpdateAccountMsg) ValidateBasic() sdk.Error

ValidateBasic - implements sdk.Msg

Jump to

Keyboard shortcuts

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