Documentation ¶
Index ¶
- func CreateCoinReturnEvents(ctx sdk.Context, username linotypes.AccountKey, times int64, interval int64, ...) ([]linotypes.Event, sdk.Error)
- type AccountManager
- func (accManager AccountManager) AddCoinToAddress(ctx sdk.Context, addr sdk.Address, coin linotypes.Coin) sdk.Error
- func (accManager AccountManager) AddCoinToUsername(ctx sdk.Context, username linotypes.AccountKey, coin linotypes.Coin) sdk.Error
- func (accManager AccountManager) AddFrozenMoney(ctx sdk.Context, username linotypes.AccountKey, amount linotypes.Coin, ...) sdk.Error
- func (accManager AccountManager) AuthorizePermission(ctx sdk.Context, me linotypes.AccountKey, grantTo linotypes.AccountKey, ...) sdk.Error
- func (accManager AccountManager) CheckSigningPubKeyOwner(ctx sdk.Context, me linotypes.AccountKey, signKey crypto.PubKey, ...) (linotypes.AccountKey, sdk.Error)
- func (accManager AccountManager) CreateAccount(ctx sdk.Context, username linotypes.AccountKey, ...) sdk.Error
- func (accManager AccountManager) DoesAccountExist(ctx sdk.Context, username linotypes.AccountKey) bool
- func (accManager AccountManager) ExportToFile(ctx sdk.Context, filepath string) error
- func (accManager AccountManager) GetAddress(ctx sdk.Context, username linotypes.AccountKey) (sdk.AccAddress, sdk.Error)
- func (accManager AccountManager) GetAllGrantPubKeys(ctx sdk.Context, username linotypes.AccountKey) ([]*model.GrantPermission, sdk.Error)
- func (accManager AccountManager) GetBank(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountBank, sdk.Error)
- func (accManager AccountManager) GetFrozenMoneyList(ctx sdk.Context, addr sdk.Address) ([]model.FrozenMoney, sdk.Error)
- func (accManager AccountManager) GetGrantPubKeys(ctx sdk.Context, username, grantTo linotypes.AccountKey) ([]*model.GrantPermission, sdk.Error)
- func (accManager AccountManager) GetInfo(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountInfo, sdk.Error)
- func (accManager AccountManager) GetMeta(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountMeta, sdk.Error)
- func (accManager AccountManager) GetSavingFromAddress(ctx sdk.Context, address sdk.Address) (linotypes.Coin, sdk.Error)
- func (accManager AccountManager) GetSavingFromUsername(ctx sdk.Context, username linotypes.AccountKey) (linotypes.Coin, sdk.Error)
- func (accManager AccountManager) GetSequence(ctx sdk.Context, address sdk.Address) (uint64, sdk.Error)
- func (accManager AccountManager) GetSigningKey(ctx sdk.Context, username linotypes.AccountKey) (crypto.PubKey, sdk.Error)
- func (accManager AccountManager) GetTransactionKey(ctx sdk.Context, username linotypes.AccountKey) (crypto.PubKey, sdk.Error)
- func (accManager AccountManager) ImportFromFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error
- func (accManager AccountManager) IncreaseSequenceByOne(ctx sdk.Context, address sdk.Address) sdk.Error
- func (accManager AccountManager) IterateAccounts(ctx sdk.Context, ...)
- func (accManager AccountManager) MinusCoinFromAddress(ctx sdk.Context, address sdk.Address, coin linotypes.Coin) sdk.Error
- func (accManager AccountManager) MinusCoinFromUsername(ctx sdk.Context, username linotypes.AccountKey, coin linotypes.Coin) sdk.Error
- func (accManager AccountManager) MoveCoinFromUsernameToUsername(ctx sdk.Context, sender, receiver linotypes.AccountKey, coin linotypes.Coin) sdk.Error
- func (accManager AccountManager) RecoverAccount(ctx sdk.Context, username linotypes.AccountKey, ...) sdk.Error
- func (accManager AccountManager) RegisterAccount(ctx sdk.Context, referrerAddr sdk.AccAddress, registerFee linotypes.Coin, ...) sdk.Error
- func (accManager AccountManager) RevokePermission(ctx sdk.Context, me linotypes.AccountKey, grantTo linotypes.AccountKey, ...) sdk.Error
- func (accManager AccountManager) UpdateJSONMeta(ctx sdk.Context, username linotypes.AccountKey, jsonMeta string) sdk.Error
- type ReturnCoinEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
AccountManager - account manager
func NewAccountManager ¶
func NewAccountManager(key sdk.StoreKey, holder param.ParamKeeper, gm global.GlobalKeeper) AccountManager
NewLinoAccount - new account manager
func (AccountManager) AddCoinToAddress ¶
func (accManager AccountManager) AddCoinToAddress(ctx sdk.Context, addr sdk.Address, coin linotypes.Coin) sdk.Error
AddCoinToAddress - add coin to address associated username
func (AccountManager) AddCoinToUsername ¶
func (accManager AccountManager) AddCoinToUsername(ctx sdk.Context, username linotypes.AccountKey, coin linotypes.Coin) sdk.Error
AddCoinToUsername - add coin to address associated username
func (AccountManager) AddFrozenMoney ¶
func (accManager AccountManager) AddFrozenMoney( ctx sdk.Context, username linotypes.AccountKey, amount linotypes.Coin, start, interval, times int64) sdk.Error
AddFrozenMoney - add frozen money to user's frozen money list
func (AccountManager) AuthorizePermission ¶
func (accManager AccountManager) AuthorizePermission( ctx sdk.Context, me linotypes.AccountKey, grantTo linotypes.AccountKey, validityPeriod int64, grantLevel linotypes.Permission, amount linotypes.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 linotypes.AccountKey, signKey crypto.PubKey, permission linotypes.Permission, amount linotypes.Coin) (linotypes.AccountKey, sdk.Error)
CheckSigningPubKeyOwner - given a public key, check if it is valid for given permission
func (AccountManager) CreateAccount ¶
func (accManager AccountManager) CreateAccount( ctx sdk.Context, username linotypes.AccountKey, signingKey, transactionKey crypto.PubKey) 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 linotypes.AccountKey) bool
func (AccountManager) ExportToFile ¶
func (accManager AccountManager) ExportToFile(ctx sdk.Context, filepath string) error
Export -
func (AccountManager) GetAddress ¶
func (accManager AccountManager) GetAddress(ctx sdk.Context, username linotypes.AccountKey) (sdk.AccAddress, sdk.Error)
GetAddress - get user bank address
func (AccountManager) GetAllGrantPubKeys ¶
func (accManager AccountManager) GetAllGrantPubKeys(ctx sdk.Context, username linotypes.AccountKey) ([]*model.GrantPermission, sdk.Error)
func (AccountManager) GetBank ¶
func (accManager AccountManager) GetBank(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountBank, sdk.Error)
func (AccountManager) GetFrozenMoneyList ¶
func (accManager AccountManager) GetFrozenMoneyList( ctx sdk.Context, addr sdk.Address) ([]model.FrozenMoney, sdk.Error)
GetFrozenMoneyList - get user frozen money list
func (AccountManager) GetGrantPubKeys ¶
func (accManager AccountManager) GetGrantPubKeys(ctx sdk.Context, username, grantTo linotypes.AccountKey) ([]*model.GrantPermission, sdk.Error)
func (AccountManager) GetInfo ¶
func (accManager AccountManager) GetInfo(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountInfo, sdk.Error)
getter
func (AccountManager) GetMeta ¶
func (accManager AccountManager) GetMeta(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountMeta, sdk.Error)
func (AccountManager) GetSavingFromAddress ¶
func (accManager AccountManager) GetSavingFromAddress(ctx sdk.Context, address sdk.Address) (linotypes.Coin, sdk.Error)
GetSavingFromBank - get user balance
func (AccountManager) GetSavingFromUsername ¶
func (accManager AccountManager) GetSavingFromUsername(ctx sdk.Context, username linotypes.AccountKey) (linotypes.Coin, sdk.Error)
GetSavingFromUsername - get user balance
func (AccountManager) GetSequence ¶
func (accManager AccountManager) GetSequence(ctx sdk.Context, address sdk.Address) (uint64, sdk.Error)
GetSequence - get user sequence number
func (AccountManager) GetSigningKey ¶
func (accManager AccountManager) GetSigningKey( ctx sdk.Context, username linotypes.AccountKey) (crypto.PubKey, sdk.Error)
GetAppKey - get app public key
func (AccountManager) GetTransactionKey ¶
func (accManager AccountManager) GetTransactionKey( ctx sdk.Context, username linotypes.AccountKey) (crypto.PubKey, sdk.Error)
GetTransactionKey - get transaction public key
func (AccountManager) ImportFromFile ¶
func (accManager AccountManager) ImportFromFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error
ImportFromFile import state from file.
func (AccountManager) IncreaseSequenceByOne ¶
func (accManager AccountManager) IncreaseSequenceByOne(ctx sdk.Context, address sdk.Address) sdk.Error
IncreaseSequenceByOne - increase user sequence number by one
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) MinusCoinFromAddress ¶
func (accManager AccountManager) MinusCoinFromAddress(ctx sdk.Context, address sdk.Address, coin linotypes.Coin) sdk.Error
MinusCoinFromAddress - minus coin from address
func (AccountManager) MinusCoinFromUsername ¶
func (accManager AccountManager) MinusCoinFromUsername(ctx sdk.Context, username linotypes.AccountKey, coin linotypes.Coin) sdk.Error
MinusSavingCoin - minus coin from balance, remove coin day in the tail
func (AccountManager) MoveCoinFromUsernameToUsername ¶
func (accManager AccountManager) MoveCoinFromUsernameToUsername(ctx sdk.Context, sender, receiver linotypes.AccountKey, coin linotypes.Coin) sdk.Error
MoveCoinFromUsernameToUsername - move coin from sender to receiver
func (AccountManager) RecoverAccount ¶
func (accManager AccountManager) RecoverAccount( ctx sdk.Context, username linotypes.AccountKey, newTransactionPubKey, newSigningKey crypto.PubKey) sdk.Error
RecoverAccount - reset two public key pairs
func (AccountManager) RegisterAccount ¶
func (accManager AccountManager) RegisterAccount( ctx sdk.Context, referrerAddr sdk.AccAddress, registerFee linotypes.Coin, username linotypes.AccountKey, signingKey, transactionKey crypto.PubKey) sdk.Error
RegisterAccount - register account, deduct fee from referrer address then create a new account
func (AccountManager) RevokePermission ¶
func (accManager AccountManager) RevokePermission( ctx sdk.Context, me linotypes.AccountKey, grantTo linotypes.AccountKey, permission linotypes.Permission) sdk.Error
RevokePermission - revoke permission from a developer
func (AccountManager) UpdateJSONMeta ¶
func (accManager AccountManager) UpdateJSONMeta( ctx sdk.Context, username linotypes.AccountKey, jsonMeta string) sdk.Error
UpdateJSONMeta - update user JONS meta data
type ReturnCoinEvent ¶
type ReturnCoinEvent struct { Username linotypes.AccountKey `json:"username"` Amount linotypes.Coin `json:"amount"` ReturnType linotypes.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