Documentation
¶
Index ¶
- Constants
- Variables
- func Accrue(ctx coretypes.Sandbox, target coretypes.AgentID, ...) error
- func CreditToAccount(state kv.KVStore, agentID coretypes.AgentID, ...)
- func DebitFromAccount(state kv.KVStore, agentID coretypes.AgentID, ...) bool
- func DecodeBalances(balances dict.Dict) (map[balance.Color]int64, error)
- func EncodeBalances(balances map[balance.Color]int64) dict.Dict
- func GetAccountBalances(state kv.KVStoreReader, agentID coretypes.AgentID) (map[balance.Color]int64, bool)
- func GetBalance(state kv.KVStoreReader, agentID coretypes.AgentID, color balance.Color) int64
- func MoveBetweenAccounts(state kv.KVStore, fromAgentID, toAgentID coretypes.AgentID, ...) bool
Constants ¶
View Source
const ( FuncBalance = "balance" FuncTotalAssets = "totalAssets" FuncDeposit = "deposit" FuncWithdrawToAddress = "withdrawToAddress" FuncWithdrawToChain = "withdrawToChain" FuncAccounts = "accounts" ParamAgentID = "a" )
View Source
const (
Name = "accounts"
)
Variables ¶
View Source
var ( Interface = &coreutil.ContractInterface{ Name: Name, Description: description, ProgramHash: hashing.HashStrings(Name), } )
Functions ¶
func Accrue ¶
func Accrue(ctx coretypes.Sandbox, target coretypes.AgentID, tokens coretypes.ColoredBalances) error
Accrue calls "deposit" entry point of the accounts contract. Can only be called from full sandbox context
func CreditToAccount ¶
func CreditToAccount(state kv.KVStore, agentID coretypes.AgentID, transfer coretypes.ColoredBalances)
CreditToAccount brings new funds to the on chain ledger.
func DebitFromAccount ¶
func DebitFromAccount(state kv.KVStore, agentID coretypes.AgentID, transfer coretypes.ColoredBalances) bool
DebitFromAccount removes funds from the chain ledger.
func GetAccountBalances ¶
func GetAccountBalances(state kv.KVStoreReader, agentID coretypes.AgentID) (map[balance.Color]int64, bool)
GetAccountBalances returns all colored balances belonging to the agentID on the state. Normally, the state is the partition of the 'accountsc'
func GetBalance ¶
func MoveBetweenAccounts ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.