Documentation ¶
Index ¶
- func CreateCoinReturnEvents(username types.AccountKey, times int64, interval int64, coin types.Coin, ...) ([]types.Event, sdk.Error)
- func ErrAccountAlreadyExists(accKey types.AccountKey) sdk.Error
- func ErrAccountNotFound(username types.AccountKey) sdk.Error
- func ErrAccountSavingCoinNotEnough() sdk.Error
- func ErrAccountTPSCapacityNotEnough(accKey types.AccountKey) sdk.Error
- func ErrAddSavingCoin() sdk.Error
- func ErrAddSavingCoinWithFullCoinDay() sdk.Error
- func ErrAppGrantKeyMismatch(owner types.AccountKey) sdk.Error
- func ErrCheckAuthenticatePubKeyOwner(accKey types.AccountKey) sdk.Error
- func ErrCheckGrantAppKey() sdk.Error
- func ErrCheckResetKey() sdk.Error
- func ErrCheckTransactionKey() sdk.Error
- func ErrCheckUserTPSCapacity(accKey types.AccountKey) sdk.Error
- func ErrFolloweeNotFound(username types.AccountKey) sdk.Error
- func ErrFollowerNotFound(username types.AccountKey) sdk.Error
- func ErrFrozenMoneyListTooLong() sdk.Error
- func ErrGetAppKey(accKey types.AccountKey) sdk.Error
- func ErrGetFrozenMoneyList(err error) sdk.Error
- func ErrGetLastPostAt(err error) sdk.Error
- func ErrGetLastReportOrUpvoteAt(err error) sdk.Error
- func ErrGetResetKey(accKey types.AccountKey) sdk.Error
- func ErrGetSavingFromBank(err error) sdk.Error
- func ErrGetSequence(err error) sdk.Error
- func ErrGetTransactionKey(accKey types.AccountKey) sdk.Error
- func ErrGrantKeyExpired(owner types.AccountKey) sdk.Error
- func ErrGrantKeyMismatch(owner types.AccountKey) sdk.Error
- func ErrIncreaseSequenceByOne(err error) sdk.Error
- func ErrInvalidJSONMeta() sdk.Error
- func ErrInvalidMemo() sdk.Error
- func ErrInvalidUsername(msg string) sdk.Error
- func ErrPreAuthAmountInsufficient(owner types.AccountKey, balance, consume types.Coin) sdk.Error
- func ErrPreAuthGrantKeyMismatch(owner types.AccountKey) sdk.Error
- func ErrReceiverNotFound(username types.AccountKey) sdk.Error
- func ErrReferrerNotFound(username types.AccountKey) sdk.Error
- func ErrRegisterFeeInsufficient() sdk.Error
- func ErrRevokePermissionLevelMismatch(got, expect types.Permission) sdk.Error
- func ErrSenderNotFound(username types.AccountKey) sdk.Error
- func ErrUnsupportGrantLevel() sdk.Error
- func ErrUpdateLastPostAt(err error) sdk.Error
- func ErrUpdateLastReportOrUpvoteAt(err error) sdk.Error
- func NewHandler(am AccountManager, gm global.GlobalManager) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type AccountManager
- func (accManager AccountManager) AddBalanceHistory(ctx sdk.Context, username types.AccountKey, numOfTx int64, ...) sdk.Error
- func (accManager AccountManager) AddDirectDeposit(ctx sdk.Context, username types.AccountKey, directDeposit types.Coin) sdk.Error
- func (accManager AccountManager) AddFrozenMoney(ctx sdk.Context, username types.AccountKey, amount types.Coin, ...) sdk.Error
- func (accManager AccountManager) AddIncomeAndReward(ctx sdk.Context, username types.AccountKey, ...) sdk.Error
- func (accManager AccountManager) AddRewardHistory(ctx sdk.Context, username types.AccountKey, numOfReward int64, ...) sdk.Error
- func (accManager AccountManager) AddSavingCoin(ctx sdk.Context, username types.AccountKey, coin types.Coin, ...) (err sdk.Error)
- func (accManager AccountManager) AddSavingCoinWithFullCoinDay(ctx sdk.Context, username types.AccountKey, coin types.Coin, ...) (err sdk.Error)
- func (accManager AccountManager) AuthorizePermission(ctx sdk.Context, me types.AccountKey, authorizedUser types.AccountKey, ...) sdk.Error
- func (accManager AccountManager) CheckSigningPubKeyOwner(ctx sdk.Context, me types.AccountKey, signKey crypto.PubKey, ...) (types.AccountKey, sdk.Error)
- func (accManager AccountManager) CheckUserTPSCapacity(ctx sdk.Context, me types.AccountKey, tpsCapacityRatio sdk.Rat) sdk.Error
- func (accManager AccountManager) ClaimReward(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (accManager AccountManager) ClearRewardHistory(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (accManager AccountManager) CreateAccount(ctx sdk.Context, referrer types.AccountKey, username types.AccountKey, ...) sdk.Error
- func (accManager AccountManager) DoesAccountExist(ctx sdk.Context, username types.AccountKey) bool
- func (accManager AccountManager) GetAppKey(ctx sdk.Context, username types.AccountKey) (crypto.PubKey, sdk.Error)
- func (accManager AccountManager) GetCoinDay(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
- func (accManager AccountManager) GetDonationRelationship(ctx sdk.Context, me, other types.AccountKey) (int64, sdk.Error)
- func (accManager AccountManager) GetFrozenMoneyList(ctx sdk.Context, username types.AccountKey) ([]model.FrozenMoney, sdk.Error)
- func (accManager AccountManager) GetLastPostAt(ctx sdk.Context, username types.AccountKey) (int64, sdk.Error)
- func (accManager AccountManager) GetLastReportOrUpvoteAt(ctx sdk.Context, username types.AccountKey) (int64, sdk.Error)
- func (accManager AccountManager) GetResetKey(ctx sdk.Context, username types.AccountKey) (crypto.PubKey, sdk.Error)
- func (accManager AccountManager) GetSavingFromBank(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
- func (accManager AccountManager) GetSequence(ctx sdk.Context, username types.AccountKey) (int64, sdk.Error)
- func (accManager AccountManager) GetTransactionKey(ctx sdk.Context, username types.AccountKey) (crypto.PubKey, sdk.Error)
- func (accManager AccountManager) IncreaseSequenceByOne(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (accManager AccountManager) IsMyFollower(ctx sdk.Context, me types.AccountKey, follower types.AccountKey) bool
- func (accManager AccountManager) IsMyFollowing(ctx sdk.Context, me types.AccountKey, following types.AccountKey) bool
- func (accManager AccountManager) IterateAccounts(ctx sdk.Context, ...)
- func (accManager AccountManager) MinusSavingCoin(ctx sdk.Context, username types.AccountKey, coin types.Coin, ...) (err sdk.Error)
- func (accManager AccountManager) MinusSavingCoinWithFullCoinDay(ctx sdk.Context, username types.AccountKey, coin types.Coin, ...) (err sdk.Error)
- func (accManager AccountManager) RecoverAccount(ctx sdk.Context, username types.AccountKey, ...) sdk.Error
- func (accManager AccountManager) RemoveFollower(ctx sdk.Context, me types.AccountKey, follower types.AccountKey) sdk.Error
- func (accManager AccountManager) RemoveFollowing(ctx sdk.Context, me types.AccountKey, following types.AccountKey) sdk.Error
- func (accManager AccountManager) RevokePermission(ctx sdk.Context, me types.AccountKey, pubKey crypto.PubKey) sdk.Error
- func (accManager AccountManager) SetFollower(ctx sdk.Context, me types.AccountKey, follower types.AccountKey) sdk.Error
- func (accManager AccountManager) SetFollowing(ctx sdk.Context, me types.AccountKey, following types.AccountKey) sdk.Error
- func (accManager AccountManager) UpdateDonationRelationship(ctx sdk.Context, me, other types.AccountKey) sdk.Error
- func (accManager AccountManager) UpdateJSONMeta(ctx sdk.Context, username types.AccountKey, JSONMeta string) sdk.Error
- func (accManager AccountManager) UpdateLastPostAt(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (accManager AccountManager) UpdateLastReportOrUpvoteAt(ctx sdk.Context, username types.AccountKey) sdk.Error
- type ClaimMsg
- func (msg ClaimMsg) GetConsumeAmount() types.Coin
- func (msg ClaimMsg) GetPermission() types.Permission
- func (msg ClaimMsg) GetSignBytes() []byte
- func (msg ClaimMsg) GetSigners() []sdk.AccAddress
- func (msg ClaimMsg) String() string
- func (msg ClaimMsg) Type() string
- func (msg ClaimMsg) ValidateBasic() sdk.Error
- type FollowMsg
- func (msg FollowMsg) GetConsumeAmount() types.Coin
- func (msg FollowMsg) GetPermission() types.Permission
- func (msg FollowMsg) GetSignBytes() []byte
- func (msg FollowMsg) GetSigners() []sdk.AccAddress
- func (msg FollowMsg) String() string
- func (msg FollowMsg) Type() string
- func (msg FollowMsg) ValidateBasic() sdk.Error
- type RecoverMsg
- func (msg RecoverMsg) GetConsumeAmount() types.Coin
- func (msg RecoverMsg) GetPermission() types.Permission
- func (msg RecoverMsg) GetSignBytes() []byte
- func (msg RecoverMsg) GetSigners() []sdk.AccAddress
- func (msg RecoverMsg) String() string
- func (msg RecoverMsg) Type() string
- func (msg RecoverMsg) ValidateBasic() sdk.Error
- type RegisterMsg
- func (msg RegisterMsg) GetConsumeAmount() types.Coin
- func (msg RegisterMsg) GetPermission() types.Permission
- func (msg RegisterMsg) GetSignBytes() []byte
- func (msg RegisterMsg) GetSigners() []sdk.AccAddress
- func (msg RegisterMsg) String() string
- func (msg RegisterMsg) Type() string
- func (msg RegisterMsg) ValidateBasic() sdk.Error
- type ReturnCoinEvent
- type TransferMsg
- func (msg TransferMsg) GetConsumeAmount() types.Coin
- func (msg TransferMsg) GetPermission() types.Permission
- func (msg TransferMsg) GetSignBytes() []byte
- func (msg TransferMsg) GetSigners() []sdk.AccAddress
- func (msg TransferMsg) String() string
- func (msg TransferMsg) Type() string
- func (msg TransferMsg) ValidateBasic() sdk.Error
- type UnfollowMsg
- func (msg UnfollowMsg) GetConsumeAmount() types.Coin
- func (msg UnfollowMsg) GetPermission() types.Permission
- func (msg UnfollowMsg) GetSignBytes() []byte
- func (msg UnfollowMsg) GetSigners() []sdk.AccAddress
- func (msg UnfollowMsg) String() string
- func (msg UnfollowMsg) Type() string
- func (msg UnfollowMsg) ValidateBasic() sdk.Error
- type UpdateAccountMsg
- func (msg UpdateAccountMsg) GetConsumeAmount() types.Coin
- func (msg UpdateAccountMsg) GetPermission() types.Permission
- func (msg UpdateAccountMsg) GetSignBytes() []byte
- func (msg UpdateAccountMsg) GetSigners() []sdk.AccAddress
- func (msg UpdateAccountMsg) String() string
- func (msg UpdateAccountMsg) Type() string
- func (msg UpdateAccountMsg) ValidateBasic() sdk.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCoinReturnEvents ¶
func CreateCoinReturnEvents( username types.AccountKey, times int64, interval int64, coin types.Coin, returnType types.TransferDetailType) ([]types.Event, sdk.Error)
CreateCoinReturnEvents - create coin return events
func ErrAccountAlreadyExists ¶
func ErrAccountAlreadyExists(accKey types.AccountKey) sdk.Error
ErrAccountAlreadyExists - error when register user already exists
func ErrAccountNotFound ¶
func ErrAccountNotFound(username types.AccountKey) sdk.Error
ErrAccountNotFound - error when account is not found
func ErrAccountSavingCoinNotEnough ¶
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 ¶
ErrAddSavingCoin - error when register add deposit failed
func ErrAddSavingCoinWithFullCoinDay ¶ added in v0.1.1
ErrAddSavingCoinWithFullCoinDay - error when register deposit with full coin day failed
func ErrAppGrantKeyMismatch ¶
func ErrAppGrantKeyMismatch(owner types.AccountKey) sdk.Error
ErrGrantKeyMismatch - error when transaction signed by mismatch app permission grant public key
func ErrCheckAuthenticatePubKeyOwner ¶
func ErrCheckAuthenticatePubKeyOwner(accKey types.AccountKey) sdk.Error
ErrCheckAuthenticatePubKeyOwner - error when transaction signed by invalid public key
func ErrCheckGrantAppKey ¶
ErrCheckGrantAppKey - error when transaction needs app key permission signed by other key
func ErrCheckResetKey ¶
ErrCheckResetKey - error when transaction needs reset permission signed by other key
func ErrCheckTransactionKey ¶
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 ErrFolloweeNotFound ¶
func ErrFolloweeNotFound(username types.AccountKey) sdk.Error
ErrFolloweeNotFound - error when followee user is not found
func ErrFollowerNotFound ¶
func ErrFollowerNotFound(username types.AccountKey) sdk.Error
ErrFollowerNotFound - error when follower user is not found
func ErrFrozenMoneyListTooLong ¶ added in v0.1.1
ErrFrozenMoneyListTooLong - error when the length of frozen money list exceeds the upper limit
func ErrGetAppKey ¶
func ErrGetAppKey(accKey types.AccountKey) sdk.Error
ErrGetAppKey - error when get app public key failed
func ErrGetFrozenMoneyList ¶
ErrGetFrozenMoneyList - error when get frozen money list failed
func ErrGetLastPostAt ¶ added in v0.1.1
ErrGetLastPostAt - error when get last post time failed
func ErrGetLastReportOrUpvoteAt ¶
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 ¶
ErrGetSavingFromBank - error when get saving failed
func ErrGetSequence ¶
ErrGetSequence - error when get sequence number 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 ErrIncreaseSequenceByOne ¶
ErrIncreaseSequenceByOne - error when increase sequence number failed
func ErrInvalidJSONMeta ¶
ErrInvalidMemo - error when JSON meta is invalid (length too long)
func ErrInvalidMemo ¶
ErrInvalidMemo - error when memo is invalid (length too long)
func ErrInvalidUsername ¶
ErrInvalidUsername - error when username is invalid
func ErrPreAuthAmountInsufficient ¶
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 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 ¶
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 ¶
ErrUnsupportGrantLevel - error when grant permission not supported
func ErrUpdateLastPostAt ¶ added in v0.1.1
ErrUpdateLastPostAt - error when update last post time failed
func ErrUpdateLastReportOrUpvoteAt ¶
ErrGetLastReportOrUpvoteAt - error when update last report or upvote time failed
func NewHandler ¶
func NewHandler(am AccountManager, gm global.GlobalManager) sdk.Handler
NewHandler - Handle all "account" type messages.
func RegisterWire ¶
RegisterWire - register concrete types on wire codec
Types ¶
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
AccountManager - account manager
func NewAccountManager ¶
func NewAccountManager(key sdk.StoreKey, holder param.ParamHolder) AccountManager
NewLinoAccount - new account manager
func (AccountManager) AddBalanceHistory ¶
func (accManager AccountManager) AddBalanceHistory( ctx sdk.Context, username types.AccountKey, numOfTx int64, transactionDetail model.Detail) sdk.Error
AddBalanceHistory - add each balance related tx to balance history
func (AccountManager) AddDirectDeposit ¶
func (accManager AccountManager) AddDirectDeposit( ctx sdk.Context, username types.AccountKey, directDeposit types.Coin) sdk.Error
AddDirectDeposit - when user received the donation, the donation except friction will be added to total income and original income
func (AccountManager) AddFrozenMoney ¶
func (accManager AccountManager) AddFrozenMoney( ctx sdk.Context, username types.AccountKey, amount types.Coin, start, interval, times int64) sdk.Error
AddFrozenMoney - add frozen money to user's frozen money list
func (AccountManager) AddIncomeAndReward ¶
func (accManager AccountManager) AddIncomeAndReward( ctx sdk.Context, username types.AccountKey, originalDonation, friction, actualReward types.Coin, consumer, postAuthor types.AccountKey, postID string) sdk.Error
AddIncomeAndReward - after the evaluate of content value, the original friction will be added to original income and friciton income. The actual inflation will be added to inflation income, total income and unclaim reward
func (AccountManager) AddRewardHistory ¶
func (accManager AccountManager) AddRewardHistory( ctx sdk.Context, username types.AccountKey, numOfReward int64, rewardDetail model.RewardDetail) sdk.Error
AddRewardHistory - add reward detail to user reward history
func (AccountManager) AddSavingCoin ¶
func (accManager AccountManager) AddSavingCoin( ctx sdk.Context, username types.AccountKey, coin types.Coin, from types.AccountKey, memo string, detailType types.TransferDetailType) (err sdk.Error)
AddSavingCoin - add coin to balance and pending coin day
func (AccountManager) AddSavingCoinWithFullCoinDay ¶ added in v0.1.1
func (accManager AccountManager) AddSavingCoinWithFullCoinDay( ctx sdk.Context, username types.AccountKey, coin types.Coin, from types.AccountKey, memo string, detailType types.TransferDetailType) (err sdk.Error)
AddSavingCoinWithFullCoinDay - add coin to balance with full coin day
func (AccountManager) AuthorizePermission ¶
func (accManager AccountManager) AuthorizePermission( ctx sdk.Context, me types.AccountKey, authorizedUser types.AccountKey, validityPeriod int64, grantLevel types.Permission, amount types.Coin) sdk.Error
AuthorizePermission - userA authorize permission to userB (currently only support auth to a developer)
func (AccountManager) CheckSigningPubKeyOwner ¶
func (accManager AccountManager) CheckSigningPubKeyOwner( ctx sdk.Context, me types.AccountKey, signKey crypto.PubKey, permission types.Permission, amount types.Coin) (types.AccountKey, sdk.Error)
CheckSigningPubKeyOwner - given a public key, check if it is valid for given permission
func (AccountManager) CheckUserTPSCapacity ¶
func (accManager AccountManager) CheckUserTPSCapacity( ctx sdk.Context, me types.AccountKey, tpsCapacityRatio sdk.Rat) sdk.Error
CheckUserTPSCapacity - to prevent user spam the chain, every user has a TPS capacity
func (AccountManager) ClaimReward ¶
func (accManager AccountManager) ClaimReward( ctx sdk.Context, username types.AccountKey) sdk.Error
ClaimReward - add content reward to user balance
func (AccountManager) ClearRewardHistory ¶
func (accManager AccountManager) ClearRewardHistory( ctx sdk.Context, username types.AccountKey) sdk.Error
ClearRewardHistory - clear user reward history
func (AccountManager) CreateAccount ¶
func (accManager AccountManager) CreateAccount( ctx sdk.Context, referrer types.AccountKey, username types.AccountKey, resetKey, transactionKey, appKey crypto.PubKey, registerDeposit types.Coin) sdk.Error
CreateAccount - create account, caller should make sure the register fee is valid
func (AccountManager) DoesAccountExist ¶
func (accManager AccountManager) DoesAccountExist(ctx sdk.Context, username types.AccountKey) bool
DoesAccountExist - check if account exists in KVStore or not
func (AccountManager) GetAppKey ¶
func (accManager AccountManager) GetAppKey( ctx sdk.Context, username types.AccountKey) (crypto.PubKey, sdk.Error)
GetAppKey - get app public key
func (AccountManager) GetCoinDay ¶ added in v0.1.1
func (accManager AccountManager) GetCoinDay( ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
GetCoinDay - recalculate and get user current coin day
func (AccountManager) GetDonationRelationship ¶
func (accManager AccountManager) GetDonationRelationship( ctx sdk.Context, me, other types.AccountKey) (int64, sdk.Error)
GetDonationRelationship - get donation relationship between two user
func (AccountManager) GetFrozenMoneyList ¶
func (accManager AccountManager) GetFrozenMoneyList( ctx sdk.Context, username types.AccountKey) ([]model.FrozenMoney, sdk.Error)
GetFrozenMoneyList - get user frozen money list
func (AccountManager) GetLastPostAt ¶ added in v0.1.1
func (accManager AccountManager) GetLastPostAt( ctx sdk.Context, username types.AccountKey) (int64, sdk.Error)
GetLastPostAt - get user last post time
func (AccountManager) GetLastReportOrUpvoteAt ¶
func (accManager AccountManager) GetLastReportOrUpvoteAt( ctx sdk.Context, username types.AccountKey) (int64, sdk.Error)
GetLastReportOrUpvoteAt - get user last report or upvote time
func (AccountManager) GetResetKey ¶
func (accManager AccountManager) GetResetKey( ctx sdk.Context, username types.AccountKey) (crypto.PubKey, sdk.Error)
GetResetKey - get reset public key
func (AccountManager) GetSavingFromBank ¶
func (accManager AccountManager) GetSavingFromBank( ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
GetSavingFromBank - get user balance
func (AccountManager) GetSequence ¶
func (accManager AccountManager) GetSequence( ctx sdk.Context, username types.AccountKey) (int64, sdk.Error)
GetSequence - get user sequence number
func (AccountManager) GetTransactionKey ¶
func (accManager AccountManager) GetTransactionKey( ctx sdk.Context, username types.AccountKey) (crypto.PubKey, sdk.Error)
GetTransactionKey - get transaction public key
func (AccountManager) IncreaseSequenceByOne ¶
func (accManager AccountManager) IncreaseSequenceByOne( ctx sdk.Context, username types.AccountKey) sdk.Error
IncreaseSequenceByOne - increase user sequence number by one
func (AccountManager) IsMyFollower ¶
func (accManager AccountManager) IsMyFollower( ctx sdk.Context, me types.AccountKey, follower types.AccountKey) bool
IsMyFollower - check KV store to check if user in my follower list
func (AccountManager) IsMyFollowing ¶
func (accManager AccountManager) IsMyFollowing( ctx sdk.Context, me types.AccountKey, following types.AccountKey) bool
IsMyFollowing - check KV store to check if user in my following list
func (AccountManager) IterateAccounts ¶
func (accManager AccountManager) IterateAccounts(ctx sdk.Context, process func(model.AccountInfo, model.AccountBank) (stop bool))
IterateAccounts - iterate accounts in KVStore
func (AccountManager) MinusSavingCoin ¶
func (accManager AccountManager) MinusSavingCoin( ctx sdk.Context, username types.AccountKey, coin types.Coin, to types.AccountKey, memo string, detailType types.TransferDetailType) (err sdk.Error)
MinusSavingCoin - minus coin from balance, remove coin day in the tail
func (AccountManager) MinusSavingCoinWithFullCoinDay ¶ added in v0.1.1
func (accManager AccountManager) MinusSavingCoinWithFullCoinDay( ctx sdk.Context, username types.AccountKey, coin types.Coin, to types.AccountKey, memo string, detailType types.TransferDetailType) (err sdk.Error)
MinusSavingCoin - minus coin from balance, remove most charged coin day coin
func (AccountManager) RecoverAccount ¶
func (accManager AccountManager) RecoverAccount( ctx sdk.Context, username types.AccountKey, newResetPubKey, newTransactionPubKey, newAppPubKey crypto.PubKey) sdk.Error
RecoverAccount - reset three public key pairs
func (AccountManager) RemoveFollower ¶
func (accManager AccountManager) RemoveFollower( ctx sdk.Context, me types.AccountKey, follower types.AccountKey) sdk.Error
RemoveFollower - update KV store to remove follower if exist
func (AccountManager) RemoveFollowing ¶
func (accManager AccountManager) RemoveFollowing( ctx sdk.Context, me types.AccountKey, following types.AccountKey) sdk.Error
RemoveFollowing - update KV store to remove following if exist
func (AccountManager) RevokePermission ¶
func (accManager AccountManager) RevokePermission( ctx sdk.Context, me types.AccountKey, pubKey crypto.PubKey) sdk.Error
RevokePermission - revoke permission from a developer
func (AccountManager) SetFollower ¶
func (accManager AccountManager) SetFollower( ctx sdk.Context, me types.AccountKey, follower types.AccountKey) sdk.Error
SetFollower - update KV store to add follower if doesn't exist
func (AccountManager) SetFollowing ¶
func (accManager AccountManager) SetFollowing( ctx sdk.Context, me types.AccountKey, following types.AccountKey) sdk.Error
SetFollowing - update KV store to add following if doesn't exist
func (AccountManager) UpdateDonationRelationship ¶
func (accManager AccountManager) UpdateDonationRelationship( ctx sdk.Context, me, other types.AccountKey) sdk.Error
UpdateDonationRelationship - increase donation relationship times by 1
func (AccountManager) UpdateJSONMeta ¶
func (accManager AccountManager) UpdateJSONMeta( ctx sdk.Context, username types.AccountKey, JSONMeta string) sdk.Error
UpdateJSONMeta - update user JONS meta data
func (AccountManager) UpdateLastPostAt ¶ added in v0.1.1
func (accManager AccountManager) UpdateLastPostAt( ctx sdk.Context, username types.AccountKey) sdk.Error
UpdateLastPostAt - update user last post time to current block time
func (AccountManager) UpdateLastReportOrUpvoteAt ¶
func (accManager AccountManager) UpdateLastReportOrUpvoteAt( ctx sdk.Context, username types.AccountKey) sdk.Error
UpdateLastReportOrUpvoteAt - update user last report or upvote time to current block time
type ClaimMsg ¶
type ClaimMsg struct {
Username types.AccountKey `json:"username"`
}
ClaimMsg - claim content reward
func (ClaimMsg) GetConsumeAmount ¶
GetConsumeAmount - implements types.Msg
func (ClaimMsg) GetPermission ¶
func (msg ClaimMsg) GetPermission() types.Permission
GetPermission - implements types.Msg
func (ClaimMsg) GetSignBytes ¶
GetSignBytes - implements sdk.Msg
func (ClaimMsg) GetSigners ¶
func (msg ClaimMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (ClaimMsg) ValidateBasic ¶
ValidateBasic - implements sdk.Msg
type FollowMsg ¶
type FollowMsg struct { Follower types.AccountKey `json:"follower"` Followee types.AccountKey `json:"followee"` }
FollowMsg - follower follow followee
func NewFollowMsg ¶
NewFollowMsg - return a FollowMsg
func (FollowMsg) GetConsumeAmount ¶
GetConsumeAmount - implements types.Msg
func (FollowMsg) GetPermission ¶
func (msg FollowMsg) GetPermission() types.Permission
GetPermission - implements types.Msg
func (FollowMsg) GetSignBytes ¶
GetSignBytes - implements sdk.Msg
func (FollowMsg) GetSigners ¶
func (msg FollowMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (FollowMsg) ValidateBasic ¶
ValidateBasic - implements sdk.Msg
type RecoverMsg ¶
type RecoverMsg struct { Username types.AccountKey `json:"username"` NewResetPubKey crypto.PubKey `json:"new_reset_public_key"` NewTransactionPubKey crypto.PubKey `json:"new_transaction_public_key"` NewAppPubKey crypto.PubKey `json:"new_app_public_key"` }
RecoverMsg - replace three public keys
func NewRecoverMsg ¶
func NewRecoverMsg( username string, resetPubkey, transactionPubkey, appPubkey crypto.PubKey) RecoverMsg
NewRecoverMsg - return a recover msg
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) String ¶
func (msg RecoverMsg) String() string
func (RecoverMsg) ValidateBasic ¶
func (msg RecoverMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type RegisterMsg ¶
type RegisterMsg struct { Referrer types.AccountKey `json:"referrer"` RegisterFee types.LNO `json:"register_fee"` NewUser types.AccountKey `json:"new_username"` NewResetPubKey crypto.PubKey `json:"new_reset_public_key"` NewTransactionPubKey crypto.PubKey `json:"new_transaction_public_key"` NewAppPubKey crypto.PubKey `json:"new_app_public_key"` }
RegisterMsg - bind username with public key, need to be referred by others (pay for it)
func NewRegisterMsg ¶
func NewRegisterMsg( referrer string, newUser string, registerFee types.LNO, resetPubkey, transactionPubkey, appPubkey crypto.PubKey) RegisterMsg
NewRegisterMsg - construct register msg.
func (RegisterMsg) GetConsumeAmount ¶
func (msg RegisterMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (RegisterMsg) GetPermission ¶
func (msg RegisterMsg) GetPermission() types.Permission
GetPermission - implements types.Msg
func (RegisterMsg) GetSignBytes ¶
func (msg RegisterMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (RegisterMsg) GetSigners ¶
func (msg RegisterMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (RegisterMsg) String ¶
func (msg RegisterMsg) String() string
func (RegisterMsg) ValidateBasic ¶
func (msg RegisterMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type ReturnCoinEvent ¶
type ReturnCoinEvent struct { Username types.AccountKey `json:"username"` Amount types.Coin `json:"amount"` ReturnType types.TransferDetailType `json:"return_type"` }
ReturnCoinEvent - return a certain amount of coin to an account
func (ReturnCoinEvent) Execute ¶
func (event ReturnCoinEvent) Execute(ctx sdk.Context, am AccountManager) sdk.Error
Execute - execute coin return events
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) String ¶
func (msg TransferMsg) String() string
func (TransferMsg) ValidateBasic ¶
func (msg TransferMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg
type UnfollowMsg ¶
type UnfollowMsg struct { Follower types.AccountKey `json:"follower"` Followee types.AccountKey `json:"followee"` }
UnfollowMsg - follower unfollow followee
func NewUnfollowMsg ¶
func NewUnfollowMsg(follower string, followee string) UnfollowMsg
NewUnfollowMsg - return a UnfollowMsg
func (UnfollowMsg) GetConsumeAmount ¶
func (msg UnfollowMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (UnfollowMsg) GetPermission ¶
func (msg UnfollowMsg) GetPermission() types.Permission
GetPermission - implements types.Msg
func (UnfollowMsg) GetSignBytes ¶
func (msg UnfollowMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (UnfollowMsg) GetSigners ¶
func (msg UnfollowMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (UnfollowMsg) String ¶
func (msg UnfollowMsg) String() string
func (UnfollowMsg) ValidateBasic ¶
func (msg UnfollowMsg) 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) String ¶
func (msg UpdateAccountMsg) String() string
func (UpdateAccountMsg) ValidateBasic ¶
func (msg UpdateAccountMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg