manager

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCoinReturnEvents

func CreateCoinReturnEvents(
	ctx sdk.Context, username linotypes.AccountKey, times int64, interval int64, coin linotypes.Coin,
	returnType linotypes.TransferDetailType) ([]linotypes.Event, sdk.Error)

CreateCoinReturnEvents - create coin return events

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

Jump to

Keyboard shortcuts

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