manager

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountManager

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

AccountManager - account manager

func NewAccountManager

func NewAccountManager(key sdk.StoreKey, holder param.ParamKeeper) AccountManager

NewLinoAccount - new account manager

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) CheckSigningPubKeyOwner

func (accManager AccountManager) CheckSigningPubKeyOwner(ctx sdk.Context, me linotypes.AccountKey, signKey crypto.PubKey) (linotypes.AccountKey, sdk.Error)

CheckSigningPubKeyOwner - given a public key, check if it is valid for the user.

func (AccountManager) CheckSigningPubKeyOwnerByAddress added in v0.4.0

func (accManager AccountManager) CheckSigningPubKeyOwnerByAddress(
	ctx sdk.Context, address sdk.AccAddress, signKey crypto.PubKey, isPaid bool) sdk.Error

CheckSigningPubKeyOwnerByAddress - given a public key, check if it is valid for address. If tx is already paid then bank can be created.

func (AccountManager) DoesAccountExist

func (am AccountManager) DoesAccountExist(ctx sdk.Context, username linotypes.AccountKey) bool

func (AccountManager) ExportToFile

func (am AccountManager) ExportToFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error

ExportToFile -

func (AccountManager) GenesisAccount added in v0.6.0

func (am AccountManager) GenesisAccount(ctx sdk.Context, username linotypes.AccountKey, signingKey, transactionKey crypto.PubKey) sdk.Error

func (AccountManager) GetAddress

func (accManager AccountManager) GetAddress(ctx sdk.Context, username linotypes.AccountKey) (sdk.AccAddress, sdk.Error)

GetAddress - get user bank address

func (AccountManager) GetBank

func (accManager AccountManager) GetBank(ctx sdk.Context, username linotypes.AccountKey) (*model.AccountBank, sdk.Error)

func (AccountManager) GetBankByAddress added in v0.4.0

func (accManager AccountManager) GetBankByAddress(ctx sdk.Context, addr sdk.AccAddress) (*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) 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) GetPool added in v0.6.0

func (am AccountManager) GetPool(
	ctx sdk.Context, poolName linotypes.PoolName) (linotypes.Coin, 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) GetSupply added in v0.6.0

func (accManager AccountManager) GetSupply(ctx sdk.Context) model.Supply

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 (am 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) InitGenesis added in v0.6.0

func (am AccountManager) InitGenesis(ctx sdk.Context, total linotypes.Coin, pools []model.Pool)

func (AccountManager) Mint added in v0.6.0

func (am AccountManager) Mint(ctx sdk.Context) sdk.Error

Mint - distribute the inflation to pools hourly.

func (AccountManager) MoveBetweenPools added in v0.6.0

func (am AccountManager) MoveBetweenPools(ctx sdk.Context, from, to linotypes.PoolName, amount linotypes.Coin) sdk.Error

MoveBetweenPools, move coin between pools.

func (AccountManager) MoveCoin added in v0.6.0

func (am AccountManager) MoveCoin(ctx sdk.Context, sender, receiver linotypes.AccOrAddr, coin linotypes.Coin) sdk.Error

MoveCoin move coins from the acc/addr to the acc/addr.

func (AccountManager) MoveFromPool added in v0.6.0

func (am AccountManager) MoveFromPool(ctx sdk.Context, poolName linotypes.PoolName, dest linotypes.AccOrAddr, amount linotypes.Coin) sdk.Error

MoveFromPool - move coin from pool to an address or user.

func (AccountManager) MoveToPool added in v0.6.0

func (am AccountManager) MoveToPool(ctx sdk.Context, poolName linotypes.PoolName, from linotypes.AccOrAddr, amount linotypes.Coin) sdk.Error

MoveToPool - move coin from an address or account to pool

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 (am AccountManager) RegisterAccount(ctx sdk.Context, referrer linotypes.AccOrAddr, 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) 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"`
	FromPool   linotypes.PoolName           `json:"from_pool"`
	At         int64                        `json:"at"`
}

ReturnCoinEvent - return a certain amount of coin to an account

func CreateCoinReturnEvents

func CreateCoinReturnEvents(username linotypes.AccountKey, startAt, interval, times int64, coin linotypes.Coin, returnType linotypes.TransferDetailType, pool linotypes.PoolName) []ReturnCoinEvent

CreateCoinReturnEvents - create coin return events The return interval list is expected to be executed at [start + interval, start + 2 * interval...] If [start, start + interval...] is expected, pass int (startAt - interval) as start at instead.

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