Versions in this module Expand all Collapse all v1 v1.4.2 May 30, 2023 v1.4.0 May 30, 2023 Changes in this version + const CostCall + const CostContract + const CostExtend + const Decimal + const DtAddress + const DtArray + const DtBool + const DtBytes + const DtFile + const DtFloat + const DtInt + const DtMap + const DtMoney + const DtString + const Extend_account_id + const Extend_black_hole_account + const Extend_black_hole_key + const Extend_block + const Extend_block_key_id + const Extend_block_time + const Extend_contract + const Extend_ecosystem_id + const Extend_gen_block + const Extend_guest_account + const Extend_guest_key + const Extend_key_id + const Extend_loop + const Extend_node_position + const Extend_original_contract + const Extend_parent + const Extend_pre_block_data_hash + const Extend_result + const Extend_rt + const Extend_rt_state + const Extend_sc + const Extend_stack + const Extend_this_contract + const Extend_time + const Extend_time_limit + const Extend_txcost + const Extend_txhash + const Extend_type + const Extend_white_hole_account + const Extend_white_hole_key + const File + const Interface + const MaxErrLen + const TagAddress + const TagFile + const TagOptional + const TagSignature + var ErrMemoryLimit = errors.New("Memory limit exceeded") + var ErrVMTimeLimit = errors.New(`time limit exceeded`) + var ObjectType_name = map[int32]string + var ObjectType_value = map[string]int32 + var VMType_name = map[int32]string + var VMType_value = map[string]int32 + var VarRegexp = `^[a-zA-Z][a-zA-Z0-9_]*$` + func ContractsList(value string) ([]string, error) + func ExContract(rt *RunTime, state uint32, name string, params *types.Map) (any, error) + func ExecContract(rt *RunTime, name, txs string, params ...any) (any, error) + func GetFieldDefaultValue(fieldType uint32) any + func GetSettings(rt *RunTime, cntname, name string) (any, error) + func LoadSysFuncs(vm *VM, state int) error + func MemoryUsage(rt *RunTime) int64 + func OriginalToString(original uint32) string + func ReleaseSmartVMObjects() + func RollbackSmartVMObjects() + func RunContractById(vm *VM, id int32, methods []string, extend map[string]any, txHash []byte) error + func RunContractByName(vm *VM, name string, methods []string, extend map[string]any, txHash []byte) error + func SavepointSmartVMObjects() + func SetVMError(eType string, eText any) error + func StateName(state uint32, name string) string + func VMCompileEval(vm *VM, src string, prefix uint32) error + func VMObjectExists(vm *VM, name string, state uint32) bool + func VMRun(vm *VM, block *CodeBlock, params []any, extend map[string]any, hash []byte) (ret []any, err error) + func ValueToDecimal(v any) (ret decimal.Decimal, err error) + func ValueToFloat(v any) (ret float64) + type ByteCode struct + Cmd uint16 + Line uint16 + Value any + type ByteCodes []*ByteCode + type CodeBlock struct + Children CodeBlocks + Code ByteCodes + Info isCodeBlockInfo + Objects map[string]*ObjInfo + Owner *OwnerInfo + Parent *CodeBlock + Type ObjectType + Vars []reflect.Type + func NewCodeBlock() *CodeBlock + func (b *CodeBlock) Extend(ext *ExtendData) + func (m *CodeBlock) GetContractInfo() *ContractInfo + func (m *CodeBlock) GetFuncInfo() *FuncInfo + func (m *CodeBlock) GetInfo() isCodeBlockInfo + type CodeBlocks []*CodeBlock + type ContractInfo struct + CanWrite bool + ID uint32 + Name string + Owner *OwnerInfo + Settings map[string]any + Tx *[]*FieldInfo + Used map[string]bool + func VMGetContractByID(vm *VM, id int32) *ContractInfo + func (c *ContractInfo) TxMap() map[string]*FieldInfo + type ErrInfo struct + Line uint16 + Name string + type ExtFuncInfo struct + Auto []string + CanWrite bool + Func any + Name string + Params []reflect.Type + Results []reflect.Type + Variadic bool + type ExtendData struct + AutoPars map[string]string + Objects map[string]any + WriteFuncs map[string]struct{} + func NewExtendData() *ExtendData + type FieldInfo struct + Name string + Original uint32 + Tags string + Type reflect.Type + func (fi *FieldInfo) ContainsTag(tag string) bool + type FuncInfo struct + CanWrite bool + ID uint32 + Name string + Names *map[string]FuncName + Params []reflect.Type + Results []reflect.Type + Variadic bool + type FuncName struct + Offset []int + Params []reflect.Type + Variadic bool + type FuncNameCmd struct + Count int + Name string + type GlobalVm struct + type IndexInfo struct + Extend string + Owner *CodeBlock + VarOffset int + type Lexeme struct + Column uint32 + Ext uint32 + Line uint16 + Type uint32 + Value any + func NewLexeme(t uint32, ext uint32, value any, line uint16, column uint32) *Lexeme + func (l *Lexeme) GetLogger() *log.Entry + type Lexemes []*Lexeme + type ObjInfo struct + Type ObjectType + Value isObjInfoValue + func (m *ObjInfo) GetCodeBlock() *CodeBlock + func (m *ObjInfo) GetExtFuncInfo() *ExtFuncInfo + func (m *ObjInfo) GetExtendVariable() *ObjInfo_ExtendVariable + func (m *ObjInfo) GetValue() isObjInfoValue + func (m *ObjInfo) GetVariable() *ObjInfo_Variable + type ObjInfo_ExtendVariable struct + Name string + type ObjInfo_Variable struct + Index int + Name string + type ObjectType int32 + const ObjectType_Contract + const ObjectType_ExtFunc + const ObjectType_ExtVar + const ObjectType_Func + const ObjectType_Unknown + const ObjectType_Var + func (ObjectType) EnumDescriptor() ([]byte, []int) + func (x ObjectType) String() string + type OwnerInfo struct + Active bool + StateID uint32 + TableID int64 + TokenID int64 + WalletID int64 + type RunTime struct + func NewRunTime(vm *VM, cost int64) *RunTime + func (rt *RunTime) Cost() int64 + func (rt *RunTime) Run(block *CodeBlock, params []any, extend map[string]any) (ret []any, err error) + func (rt *RunTime) RunCode(block *CodeBlock) (status int, err error) + func (rt *RunTime) SetCost(cost int64) + func (rt *RunTime) Stack() []any + func (rt *RunTime) SubCost(cost int64) error + type Stacker interface + AppendStack func(fn string) error + PopStack func(fn string) + type VM struct + ExtCost func(string) int64 + Extern bool + FuncCallsDB map[string]struct{} + ShiftContract int64 + func GetVM() *VM + func NewVM() *VM + func (vm *VM) Call(name string, params []any, extend map[string]any) (ret []any, err error) + func (vm *VM) Compile(input []rune, owner *OwnerInfo) error + func (vm *VM) CompileBlock(input []rune, owner *OwnerInfo) (*CodeBlock, error) + func (vm *VM) CompileEval(input string, state uint32) error + func (vm *VM) EvalIf(input string, state uint32, vars map[string]any) (bool, error) + func (vm *VM) FlushBlock(root *CodeBlock) + func (vm *VM) FlushExtern() + func (vm *VM) SetExtendCost(ext func(string) int64) + func (vm *VM) SetFuncCallsDB(funcCallsDB map[string]struct{}) + type VMError struct + Error string + Type string + type VMType int32 + const VMType_CLB + const VMType_CLBMaster + const VMType_INVALID + const VMType_Smart + func (VMType) EnumDescriptor() ([]byte, []int) + func (x VMType) String() string + type VarInfo struct + Obj *ObjInfo + Owner *CodeBlock