ast

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxBytesResult      = 65536
	MaxStringResult     = 32767
	MaxBytesToVerify    = 32 * 1024
	DefaultThrowMessage = "Explicit script termination"
	MaxListSize         = 1000
)
View Source
const InstanceFieldName = "$instance"

Variables

This section is empty.

Functions

func NewVariablesFromOrder added in v0.3.0

func NewVariablesFromOrder(scheme proto.Scheme, tx proto.Order) (map[string]Expr, error)

func NewVariablesFromScriptAction added in v0.5.0

func NewVariablesFromScriptAction(scheme proto.Scheme, action proto.ScriptAction, invokerPK crypto.PublicKey, txID crypto.Digest, txTimestamp uint64) (map[string]Expr, error)

func NewVariablesFromScriptTransfer added in v0.3.0

func NewVariablesFromScriptTransfer(tx *proto.FullScriptTransfer) (map[string]Expr, error)

func NewVariablesFromTransaction

func NewVariablesFromTransaction(scheme byte, t proto.Transaction) (map[string]Expr, error)

func VariablesV1 added in v0.3.0

func VariablesV1() map[string]Expr

func VariablesV2 added in v0.3.0

func VariablesV2() map[string]Expr

func VariablesV3 added in v0.3.0

func VariablesV3() map[string]Expr

func VariablesV4 added in v0.5.0

func VariablesV4() map[string]Expr

Types

type Actionable added in v0.5.0

type Actionable interface {
	ToAction(parent *crypto.Digest) (proto.ScriptAction, error)
}

type AddressExpr

type AddressExpr proto.Address

func NewAddressFromProtoAddress

func NewAddressFromProtoAddress(a proto.Address) *AddressExpr

func NewAddressFromString

func NewAddressFromString(s string) (*AddressExpr, error)

func (*AddressExpr) Eq

func (a *AddressExpr) Eq(other Expr) bool

func (*AddressExpr) Evaluate

func (a *AddressExpr) Evaluate(Scope) (Expr, error)

func (*AddressExpr) Get added in v0.3.0

func (a *AddressExpr) Get(name string) (Expr, error)

func (*AddressExpr) InstanceOf

func (a *AddressExpr) InstanceOf() string

func (*AddressExpr) Recipient added in v0.3.0

func (a *AddressExpr) Recipient() proto.Recipient

func (*AddressExpr) Write

func (a *AddressExpr) Write(w io.Writer)

type AliasExpr

type AliasExpr proto.Alias

func NewAliasFromProtoAlias

func NewAliasFromProtoAlias(a proto.Alias) *AliasExpr

func (*AliasExpr) Eq

func (a *AliasExpr) Eq(other Expr) bool

func (*AliasExpr) Evaluate

func (a *AliasExpr) Evaluate(Scope) (Expr, error)

func (*AliasExpr) InstanceOf

func (a *AliasExpr) InstanceOf() string

func (*AliasExpr) Recipient added in v0.3.0

func (a *AliasExpr) Recipient() proto.Recipient

Recipient interface

func (*AliasExpr) Write

func (a *AliasExpr) Write(w io.Writer)

type ArrayExpr added in v0.5.0

type ArrayExpr struct {
	Items []Expr
}

func NewArray added in v0.5.0

func NewArray(items []Expr) *ArrayExpr

func (*ArrayExpr) Eq added in v0.5.0

func (a *ArrayExpr) Eq(other Expr) bool

func (*ArrayExpr) Evaluate added in v0.5.0

func (a *ArrayExpr) Evaluate(scope Scope) (Expr, error)

func (*ArrayExpr) InstanceOf added in v0.5.0

func (a *ArrayExpr) InstanceOf() string

func (*ArrayExpr) Write added in v0.5.0

func (a *ArrayExpr) Write(w io.Writer)

type AssetInfoExpr added in v0.3.0

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

func NewAssetInfo added in v0.3.0

func NewAssetInfo(obj object) *AssetInfoExpr

func (*AssetInfoExpr) Eq added in v0.3.0

func (a *AssetInfoExpr) Eq(other Expr) bool

func (*AssetInfoExpr) Evaluate added in v0.3.0

func (a *AssetInfoExpr) Evaluate(Scope) (Expr, error)

func (*AssetInfoExpr) Get added in v0.3.0

func (a *AssetInfoExpr) Get(name string) (Expr, error)

func (*AssetInfoExpr) InstanceOf added in v0.3.0

func (a *AssetInfoExpr) InstanceOf() string

func (*AssetInfoExpr) Write added in v0.3.0

func (a *AssetInfoExpr) Write(w io.Writer)

type AssetPairExpr added in v0.3.0

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

func NewAssetPair added in v0.3.0

func NewAssetPair(amountAsset Expr, priceAsset Expr) *AssetPairExpr

func (*AssetPairExpr) Eq added in v0.3.0

func (a *AssetPairExpr) Eq(other Expr) bool

func (*AssetPairExpr) Evaluate added in v0.3.0

func (a *AssetPairExpr) Evaluate(Scope) (Expr, error)

func (*AssetPairExpr) Get added in v0.3.0

func (a *AssetPairExpr) Get(name string) (Expr, error)

func (*AssetPairExpr) InstanceOf added in v0.3.0

func (a *AssetPairExpr) InstanceOf() string

func (*AssetPairExpr) Write added in v0.3.0

func (a *AssetPairExpr) Write(w io.Writer)

type AttachedPaymentExpr added in v0.3.0

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

assetId ByteVector|Unit amount Int

func NewAttachedPaymentExpr added in v0.3.0

func NewAttachedPaymentExpr(assetId Expr, amount Expr) *AttachedPaymentExpr

func (*AttachedPaymentExpr) Eq added in v0.3.0

func (a *AttachedPaymentExpr) Eq(other Expr) bool

func (*AttachedPaymentExpr) Evaluate added in v0.3.0

func (a *AttachedPaymentExpr) Evaluate(Scope) (Expr, error)

func (*AttachedPaymentExpr) Get added in v0.3.0

func (a *AttachedPaymentExpr) Get(key string) (Expr, error)

func (*AttachedPaymentExpr) InstanceOf added in v0.3.0

func (a *AttachedPaymentExpr) InstanceOf() string

func (*AttachedPaymentExpr) Write added in v0.3.0

func (a *AttachedPaymentExpr) Write(w io.Writer)

type BalanceDetailsExpr added in v0.7.0

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

func NewBalanceDetailsExpr added in v0.7.0

func NewBalanceDetailsExpr(balance *proto.FullWavesBalance) *BalanceDetailsExpr

func (*BalanceDetailsExpr) Eq added in v0.7.0

func (a *BalanceDetailsExpr) Eq(other Expr) bool

func (*BalanceDetailsExpr) Evaluate added in v0.7.0

func (a *BalanceDetailsExpr) Evaluate(Scope) (Expr, error)

func (*BalanceDetailsExpr) Get added in v0.7.0

func (a *BalanceDetailsExpr) Get(key string) (Expr, error)

func (*BalanceDetailsExpr) InstanceOf added in v0.7.0

func (a *BalanceDetailsExpr) InstanceOf() string

func (*BalanceDetailsExpr) Write added in v0.7.0

func (a *BalanceDetailsExpr) Write(w io.Writer)

type Block

type Block struct {
	Let  *LetExpr
	Body Expr
}

func (*Block) Eq

func (a *Block) Eq(other Expr) bool

func (*Block) Evaluate

func (a *Block) Evaluate(s Scope) (Expr, error)

func (*Block) InstanceOf

func (a *Block) InstanceOf() string

func (*Block) Write

func (a *Block) Write(w io.Writer)

type BlockInfoExpr added in v0.3.0

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

func NewBlockInfo added in v0.3.0

func NewBlockInfo(scheme proto.Scheme, header *proto.BlockHeader, height proto.Height) (*BlockInfoExpr, error)

func (*BlockInfoExpr) Eq added in v0.3.0

func (a *BlockInfoExpr) Eq(other Expr) bool

func (*BlockInfoExpr) Evaluate added in v0.3.0

func (a *BlockInfoExpr) Evaluate(Scope) (Expr, error)

func (*BlockInfoExpr) Get added in v0.3.0

func (a *BlockInfoExpr) Get(name string) (Expr, error)

func (*BlockInfoExpr) InstanceOf added in v0.3.0

func (a *BlockInfoExpr) InstanceOf() string

func (*BlockInfoExpr) Write added in v0.3.0

func (a *BlockInfoExpr) Write(w io.Writer)

type BlockV2 added in v0.3.0

type BlockV2 struct {
	Decl Expr
	Body Expr
}

func (*BlockV2) Eq added in v0.3.0

func (a *BlockV2) Eq(other Expr) bool

func (*BlockV2) Evaluate added in v0.3.0

func (a *BlockV2) Evaluate(s Scope) (Expr, error)

func (*BlockV2) InstanceOf added in v0.3.0

func (a *BlockV2) InstanceOf() string

func (*BlockV2) Write added in v0.3.0

func (a *BlockV2) Write(w io.Writer)

type BooleanExpr

type BooleanExpr struct {
	Value bool
}

func NewBoolean

func NewBoolean(value bool) *BooleanExpr

func (*BooleanExpr) Eq

func (a *BooleanExpr) Eq(other Expr) bool

func (*BooleanExpr) Evaluate

func (a *BooleanExpr) Evaluate(Scope) (Expr, error)

func (*BooleanExpr) InstanceOf

func (a *BooleanExpr) InstanceOf() string

func (*BooleanExpr) Write

func (a *BooleanExpr) Write(w io.Writer)

type BurnExpr added in v0.5.0

type BurnExpr struct {
	AssetID  crypto.Digest
	Quantity int64
}

func NewBurnExpr added in v0.5.0

func NewBurnExpr(assetID []byte, quantity int64) (*BurnExpr, error)

func (*BurnExpr) Eq added in v0.5.0

func (a *BurnExpr) Eq(other Expr) bool

func (*BurnExpr) Evaluate added in v0.5.0

func (a *BurnExpr) Evaluate(Scope) (Expr, error)

func (*BurnExpr) Get added in v0.5.0

func (a *BurnExpr) Get(name string) (Expr, error)

func (*BurnExpr) InstanceOf added in v0.5.0

func (a *BurnExpr) InstanceOf() string

func (*BurnExpr) ToAction added in v0.5.0

func (a *BurnExpr) ToAction(*crypto.Digest) (proto.ScriptAction, error)

func (*BurnExpr) Write added in v0.5.0

func (a *BurnExpr) Write(w io.Writer)

type BuyExpr added in v0.3.0

type BuyExpr struct{}

func NewBuy added in v0.3.0

func NewBuy() *BuyExpr

func (*BuyExpr) Eq added in v0.3.0

func (a *BuyExpr) Eq(other Expr) bool

func (*BuyExpr) Evaluate added in v0.3.0

func (a *BuyExpr) Evaluate(Scope) (Expr, error)

func (*BuyExpr) InstanceOf added in v0.3.0

func (a *BuyExpr) InstanceOf() string

func (*BuyExpr) Write added in v0.3.0

func (a *BuyExpr) Write(w io.Writer)

type BytesExpr

type BytesExpr struct {
	Value []byte
}

func NewBytes

func NewBytes(b []byte) *BytesExpr

func (*BytesExpr) Eq

func (a *BytesExpr) Eq(other Expr) bool

func (*BytesExpr) Evaluate

func (a *BytesExpr) Evaluate(Scope) (Expr, error)

func (*BytesExpr) InstanceOf

func (a *BytesExpr) InstanceOf() string

func (*BytesExpr) Write

func (a *BytesExpr) Write(w io.Writer)

type Callable

type Callable func(Scope, Exprs) (Expr, error)

func SimpleTypeConstructorFactory added in v0.3.0

func SimpleTypeConstructorFactory(name string, expr Expr) Callable

type CeilingExpr added in v0.3.0

type CeilingExpr struct{}

func (*CeilingExpr) Eq added in v0.3.0

func (a *CeilingExpr) Eq(other Expr) bool

func (*CeilingExpr) Evaluate added in v0.3.0

func (a *CeilingExpr) Evaluate(Scope) (Expr, error)

func (*CeilingExpr) InstanceOf added in v0.3.0

func (a *CeilingExpr) InstanceOf() string

func (*CeilingExpr) Write added in v0.3.0

func (a *CeilingExpr) Write(w io.Writer)

type DApp added in v0.3.0

type DApp struct {
	DAppVersion   byte
	LibVersion    byte
	Meta          DappMeta
	Declarations  Exprs
	CallableFuncs map[string]*DappCallableFunc
	Verifier      *DappCallableFunc
}

type DappCallableFunc added in v0.3.0

type DappCallableFunc struct {
	AnnotationInvokeName string
	FuncDecl             *FuncDeclaration
}

type DappMeta added in v0.3.0

type DappMeta struct {
	Version int32
	Bytes   []byte
}

type DataEntryDeleteExpr added in v0.5.0

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

func NewDataEntryDeleteExpr added in v0.5.0

func NewDataEntryDeleteExpr(key string) *DataEntryDeleteExpr

func (*DataEntryDeleteExpr) Eq added in v0.5.0

func (a *DataEntryDeleteExpr) Eq(other Expr) bool

func (*DataEntryDeleteExpr) Evaluate added in v0.5.0

func (a *DataEntryDeleteExpr) Evaluate(Scope) (Expr, error)

func (*DataEntryDeleteExpr) Get added in v0.5.0

func (a *DataEntryDeleteExpr) Get(name string) (Expr, error)

func (*DataEntryDeleteExpr) InstanceOf added in v0.5.0

func (a *DataEntryDeleteExpr) InstanceOf() string

func (*DataEntryDeleteExpr) ToAction added in v0.5.0

func (*DataEntryDeleteExpr) Write added in v0.5.0

func (a *DataEntryDeleteExpr) Write(w io.Writer)

type DataEntryExpr added in v0.3.0

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

func DataEntries added in v0.3.0

func DataEntries(params ...*DataEntryExpr) []*DataEntryExpr

func NewDataEntry added in v0.3.0

func NewDataEntry(key string, value Expr) *DataEntryExpr

func (*DataEntryExpr) Eq added in v0.3.0

func (a *DataEntryExpr) Eq(other Expr) bool

func (*DataEntryExpr) Evaluate added in v0.3.0

func (a *DataEntryExpr) Evaluate(Scope) (Expr, error)

func (*DataEntryExpr) Get added in v0.3.0

func (a *DataEntryExpr) Get(name string) (Expr, error)

func (*DataEntryExpr) InstanceOf added in v0.3.0

func (a *DataEntryExpr) InstanceOf() string

func (*DataEntryExpr) ToAction added in v0.5.0

func (*DataEntryExpr) Write added in v0.3.0

func (a *DataEntryExpr) Write(w io.Writer)

type Declaration added in v0.3.0

type Declaration interface {
	Eval(s Scope)
}

type DownExpr added in v0.3.0

type DownExpr struct{}

func (*DownExpr) Eq added in v0.3.0

func (a *DownExpr) Eq(other Expr) bool

func (*DownExpr) Evaluate added in v0.3.0

func (a *DownExpr) Evaluate(Scope) (Expr, error)

func (*DownExpr) InstanceOf added in v0.3.0

func (a *DownExpr) InstanceOf() string

func (*DownExpr) Write added in v0.3.0

func (a *DownExpr) Write(w io.Writer)

type Expr

type Expr interface {
	Write(io.Writer)
	Evaluate(Scope) (Expr, error)
	Eq(Expr) bool
	InstanceOf() string
}

func AppendToList added in v0.5.0

func AppendToList(s Scope, e Exprs) (Expr, error)

func AssetPair added in v0.3.0

func AssetPair(s Scope, e Exprs) (Expr, error)

func Burn added in v0.5.0

func Burn(s Scope, e Exprs) (Expr, error)

func CalculateAssetID added in v0.5.0

func CalculateAssetID(s Scope, e Exprs) (Expr, error)

func Concat added in v0.5.0

func Concat(s Scope, e Exprs) (Expr, error)

func Contains added in v0.5.0

func Contains(s Scope, e Exprs) (Expr, error)

func DataEntry added in v0.3.0

func DataEntry(s Scope, e Exprs) (Expr, error)

func DataTransaction added in v0.3.0

func DataTransaction(s Scope, e Exprs) (Expr, error)

func DeleteEntry added in v0.5.0

func DeleteEntry(s Scope, e Exprs) (Expr, error)

func ECRecover added in v0.7.0

func ECRecover(s Scope, e Exprs) (Expr, error)

func IndexOf added in v0.7.0

func IndexOf(s Scope, e Exprs) (Expr, error)

func Issue added in v0.5.0

func Issue(s Scope, e Exprs) (Expr, error)

Issue is a constructor of IssueExpr type

func LastIndexOf added in v0.7.0

func LastIndexOf(s Scope, e Exprs) (Expr, error)

func LimitedCreateList added in v0.5.0

func LimitedCreateList(s Scope, e Exprs) (Expr, error)

func Max added in v0.7.0

func Max(s Scope, e Exprs) (Expr, error)

func Median added in v0.5.0

func Median(s Scope, e Exprs) (Expr, error)

func Min added in v0.7.0

func Min(s Scope, e Exprs) (Expr, error)

func NativeAddressFromRecipient

func NativeAddressFromRecipient(s Scope, e Exprs) (Expr, error)

func NativeAddressToString added in v0.3.0

func NativeAddressToString(s Scope, e Exprs) (Expr, error)

func NativeAssetBalanceV3 added in v0.7.0

func NativeAssetBalanceV3(s Scope, e Exprs) (Expr, error)

Asset balance for account

func NativeAssetBalanceV4 added in v0.7.0

func NativeAssetBalanceV4(s Scope, e Exprs) (Expr, error)

func NativeAssetInfoV3 added in v0.7.0

func NativeAssetInfoV3(s Scope, e Exprs) (Expr, error)

1004: accepts id: []byte

func NativeAssetInfoV4 added in v0.7.0

func NativeAssetInfoV4(s Scope, e Exprs) (Expr, error)

func NativeBlockInfoByHeight added in v0.3.0

func NativeBlockInfoByHeight(s Scope, e Exprs) (Expr, error)

1005:

func NativeBooleanToBytes

func NativeBooleanToBytes(s Scope, e Exprs) (Expr, error)

Boolean to bytes representation (1 - true, 0 - false)

func NativeBooleanToString

func NativeBooleanToString(s Scope, e Exprs) (Expr, error)

String representation

func NativeBytesToLong added in v0.3.0

func NativeBytesToLong(s Scope, e Exprs) (Expr, error)

func NativeBytesToLongWithOffset added in v0.3.0

func NativeBytesToLongWithOffset(s Scope, e Exprs) (Expr, error)

func NativeBytesToUTF8String added in v0.3.0

func NativeBytesToUTF8String(s Scope, e Exprs) (Expr, error)

func NativeCheckMerkleProof added in v0.3.0

func NativeCheckMerkleProof(s Scope, e Exprs) (Expr, error)

func NativeConcatBytes

func NativeConcatBytes(s Scope, e Exprs) (Expr, error)

Limited bytes concatenation

func NativeConcatStrings

func NativeConcatStrings(s Scope, e Exprs) (Expr, error)

Limited strings concatenation

func NativeCreateList added in v0.3.0

func NativeCreateList(s Scope, e Exprs) (Expr, error)

func NativeDataBinaryFromArray

func NativeDataBinaryFromArray(s Scope, e Exprs) (Expr, error)

Get bytes from data of DataTransaction

func NativeDataBinaryFromState added in v0.3.0

func NativeDataBinaryFromState(s Scope, e Exprs) (Expr, error)

Get bytes from account state

func NativeDataBooleanFromArray

func NativeDataBooleanFromArray(s Scope, e Exprs) (Expr, error)

Get boolean from data of DataTransaction

func NativeDataBooleanFromState

func NativeDataBooleanFromState(s Scope, e Exprs) (Expr, error)

Get bool from account state

func NativeDataIntegerFromArray added in v0.3.0

func NativeDataIntegerFromArray(s Scope, e Exprs) (Expr, error)

Get integer from data of DataTransaction

func NativeDataIntegerFromState added in v0.3.0

func NativeDataIntegerFromState(s Scope, e Exprs) (Expr, error)

Get integer from account state

func NativeDataStringFromArray

func NativeDataStringFromArray(s Scope, e Exprs) (Expr, error)

Get string from data of DataTransaction

func NativeDataStringFromState

func NativeDataStringFromState(s Scope, e Exprs) (Expr, error)

Get string from account state

func NativeDivLong

func NativeDivLong(s Scope, e Exprs) (Expr, error)

Integer division

func NativeDropBytes

func NativeDropBytes(s Scope, e Exprs) (Expr, error)

Skip firsts bytes

func NativeDropStrings

func NativeDropStrings(s Scope, e Exprs) (Expr, error)

Remove string prefix

func NativeEq

func NativeEq(s Scope, e Exprs) (Expr, error)

Equality

func NativeFractionLong

func NativeFractionLong(s Scope, e Exprs) (Expr, error)

Multiply and division with big integer intermediate representation

func NativeFromBase16 added in v0.3.0

func NativeFromBase16(s Scope, e Exprs) (Expr, error)

Base16 (Hex) decode

func NativeFromBase58

func NativeFromBase58(s Scope, e Exprs) (Expr, error)

Base58 decode

func NativeFromBase64 added in v0.3.0

func NativeFromBase64(s Scope, e Exprs) (Expr, error)

Base64 decode

func NativeGeLong

func NativeGeLong(s Scope, e Exprs) (Expr, error)

func NativeGetList

func NativeGetList(s Scope, e Exprs) (Expr, error)

Get list element by position

func NativeGtLong

func NativeGtLong(s Scope, e Exprs) (Expr, error)

func NativeIndexOfSubstring added in v0.3.0

func NativeIndexOfSubstring(s Scope, e Exprs) (Expr, error)

func NativeIndexOfSubstringWithOffset added in v0.3.0

func NativeIndexOfSubstringWithOffset(s Scope, e Exprs) (Expr, error)

func NativeIsInstanceOf

func NativeIsInstanceOf(s Scope, e Exprs) (Expr, error)

Internal function to check value type

func NativeLastIndexOfSubstring added in v0.3.0

func NativeLastIndexOfSubstring(s Scope, e Exprs) (Expr, error)

func NativeLastIndexOfSubstringWithOffset added in v0.3.0

func NativeLastIndexOfSubstringWithOffset(s Scope, e Exprs) (Expr, error)

func NativeLogLong added in v0.3.0

func NativeLogLong(s Scope, e Exprs) (Expr, error)

NativeLogLong calculates logarithm.

func NativeLongToBytes

func NativeLongToBytes(s Scope, e Exprs) (Expr, error)

Long to big endian bytes

func NativeLongToString

func NativeLongToString(s Scope, e Exprs) (Expr, error)

String representation

func NativeModLong

func NativeModLong(s Scope, e Exprs) (Expr, error)

Modulo

func NativeMulLong

func NativeMulLong(s Scope, e Exprs) (Expr, error)

Integer multiplication

func NativeParseInt added in v0.3.0

func NativeParseInt(s Scope, e Exprs) (Expr, error)

func NativePowLong added in v0.3.0

func NativePowLong(s Scope, e Exprs) (Expr, error)

NativePowLong calculates power.

func NativeSizeBytes

func NativeSizeBytes(s Scope, e Exprs) (Expr, error)

Size of bytes vector

func NativeSizeList

func NativeSizeList(s Scope, e Exprs) (Expr, error)

Size of list

func NativeSizeString

func NativeSizeString(s Scope, e Exprs) (Expr, error)

String size in characters

func NativeSplitString added in v0.3.0

func NativeSplitString(s Scope, e Exprs) (Expr, error)

func NativeStringToBytes

func NativeStringToBytes(s Scope, e Exprs) (Expr, error)

String to bytes representation

func NativeSubLong

func NativeSubLong(s Scope, e Exprs) (Expr, error)

Integer substitution

func NativeSumLong

func NativeSumLong(s Scope, e Exprs) (Expr, error)

Integer sum

func NativeTakeBytes

func NativeTakeBytes(s Scope, e Exprs) (Expr, error)

Take firsts bytes

func NativeTakeStrings

func NativeTakeStrings(s Scope, e Exprs) (Expr, error)

Take string prefix

func NativeThrow

func NativeThrow(s Scope, e Exprs) (Expr, error)

Fail script

func NativeToBase16 added in v0.3.0

func NativeToBase16(s Scope, e Exprs) (Expr, error)

Base16 (Hex) encode

func NativeToBase58

func NativeToBase58(s Scope, e Exprs) (Expr, error)

Base58 encode

func NativeToBase64 added in v0.3.0

func NativeToBase64(s Scope, e Exprs) (Expr, error)

Base64 encode

func NativeTransactionByID

func NativeTransactionByID(s Scope, e Exprs) (Expr, error)

Lookup transaction

func NativeTransactionHeightByID

func NativeTransactionHeightByID(s Scope, e Exprs) (Expr, error)

Height when transaction was stored to blockchain

func NativeTransferTransactionByID added in v0.3.0

func NativeTransferTransactionByID(s Scope, e Exprs) (Expr, error)

1006: returns Union[TransferTransaction, Unit]

func NewObjectFromAssetInfoV3 added in v0.7.0

func NewObjectFromAssetInfoV3(info proto.AssetInfo) Expr

func NewObjectFromAssetInfoV4 added in v0.7.0

func NewObjectFromAssetInfoV4(info proto.FullAssetInfo) Expr

func NewObjectFromBlockInfo added in v0.3.0

func NewObjectFromBlockInfo(info proto.BlockInfo) Expr

func RebuildMerkleRoot added in v0.5.0

func RebuildMerkleRoot(s Scope, e Exprs) (Expr, error)

func Reissue added in v0.5.0

func Reissue(s Scope, e Exprs) (Expr, error)

Reissue is a constructor of ReissueExpr type

func ScriptResult added in v0.3.0

func ScriptResult(s Scope, e Exprs) (Expr, error)

func ScriptTransfer added in v0.3.0

func ScriptTransfer(s Scope, e Exprs) (Expr, error)

func SimplifiedIssue added in v0.7.0

func SimplifiedIssue(s Scope, e Exprs) (Expr, error)

SimplifiedIssue is a constructor of IssueExpr with some parameters set to default values

func Sponsorship added in v0.7.0

func Sponsorship(s Scope, e Exprs) (Expr, error)

func TransferFromProtobuf added in v0.5.0

func TransferFromProtobuf(s Scope, e Exprs) (Expr, error)

func UserAddress

func UserAddress(s Scope, e Exprs) (Expr, error)

type constructor

func UserAddressFromPublicKey

func UserAddressFromPublicKey(s Scope, e Exprs) (Expr, error)

func UserAddressFromString

func UserAddressFromString(s Scope, e Exprs) (Expr, error)

Decode account address

func UserAlias

func UserAlias(s Scope, e Exprs) (Expr, error)

func UserDataBinaryFromArrayByIndex

func UserDataBinaryFromArrayByIndex(s Scope, e Exprs) (Expr, error)

func UserDataBooleanFromArrayByIndex

func UserDataBooleanFromArrayByIndex(s Scope, e Exprs) (Expr, error)

func UserDataIntegerFromArrayByIndex

func UserDataIntegerFromArrayByIndex(s Scope, e Exprs) (Expr, error)

func UserDataStringFromArrayByIndex

func UserDataStringFromArrayByIndex(s Scope, e Exprs) (Expr, error)

func UserDropRightBytes

func UserDropRightBytes(s Scope, e Exprs) (Expr, error)

func UserDropRightString

func UserDropRightString(s Scope, e Exprs) (Expr, error)

func UserExtract

func UserExtract(s Scope, e Exprs) (Expr, error)

func UserFunctionNeq

func UserFunctionNeq(s Scope, e Exprs) (Expr, error)

!=

func UserIsDefined

func UserIsDefined(s Scope, e Exprs) (Expr, error)

func UserTakeRightBytes

func UserTakeRightBytes(s Scope, e Exprs) (Expr, error)

func UserTakeRightString

func UserTakeRightString(s Scope, e Exprs) (Expr, error)

func UserThrow

func UserThrow(_ Scope, _ Exprs) (Expr, error)

Fail script without message (default will be used)

func UserTransferSet added in v0.3.0

func UserTransferSet(s Scope, e Exprs) (Expr, error)

func UserUnaryMinus

func UserUnaryMinus(s Scope, e Exprs) (Expr, error)

func UserUnaryNot

func UserUnaryNot(s Scope, e Exprs) (Expr, error)

func UserValue added in v0.3.0

func UserValue(s Scope, e Exprs) (Expr, error)

func UserValueOrErrorMessage added in v0.3.0

func UserValueOrErrorMessage(s Scope, e Exprs) (Expr, error)

func UserWavesBalanceV3 added in v0.7.0

func UserWavesBalanceV3(s Scope, e Exprs) (Expr, error)

func UserWavesBalanceV4 added in v0.7.0

func UserWavesBalanceV4(s Scope, e Exprs) (Expr, error)

func UserWriteSet added in v0.3.0

func UserWriteSet(s Scope, e Exprs) (Expr, error)

func ValueOrElse added in v0.5.0

func ValueOrElse(s Scope, e Exprs) (Expr, error)

type Exprs

type Exprs []Expr

func NewDataEntryList

func NewDataEntryList(entries []proto.DataEntry) Exprs

func NewExprs

func NewExprs(e ...Expr) Exprs

func Params

func Params(params ...Expr) Exprs

func (Exprs) Eq

func (a Exprs) Eq(other Expr) bool

func (Exprs) Evaluate

func (a Exprs) Evaluate(s Scope) (Expr, error)

func (Exprs) EvaluateAll

func (a Exprs) EvaluateAll(s Scope) (Exprs, error)

func (Exprs) InstanceOf

func (a Exprs) InstanceOf() string

func (Exprs) Write

func (a Exprs) Write(w io.Writer)

type FloorExpr added in v0.3.0

type FloorExpr struct{}

func (*FloorExpr) Eq added in v0.3.0

func (a *FloorExpr) Eq(other Expr) bool

func (*FloorExpr) Evaluate added in v0.3.0

func (a *FloorExpr) Evaluate(Scope) (Expr, error)

func (*FloorExpr) InstanceOf added in v0.3.0

func (a *FloorExpr) InstanceOf() string

func (*FloorExpr) Write added in v0.3.0

func (a *FloorExpr) Write(w io.Writer)

type FuncCallExpr added in v0.3.0

type FuncCallExpr struct {
	Func Expr
}

func NewFuncCall

func NewFuncCall(f Expr) *FuncCallExpr

func (*FuncCallExpr) Eq added in v0.3.0

func (a *FuncCallExpr) Eq(other Expr) bool

func (*FuncCallExpr) Evaluate added in v0.3.0

func (a *FuncCallExpr) Evaluate(s Scope) (Expr, error)

func (*FuncCallExpr) InstanceOf added in v0.3.0

func (a *FuncCallExpr) InstanceOf() string

func (*FuncCallExpr) Write added in v0.3.0

func (a *FuncCallExpr) Write(w io.Writer)

type FuncDeclaration added in v0.3.0

type FuncDeclaration struct {
	Name string
	Args []string
	Body Expr
}

func (*FuncDeclaration) Eq added in v0.3.0

func (a *FuncDeclaration) Eq(other Expr) bool

func (*FuncDeclaration) Evaluate added in v0.3.0

func (a *FuncDeclaration) Evaluate(s Scope) (Expr, error)

func (*FuncDeclaration) InstanceOf added in v0.3.0

func (a *FuncDeclaration) InstanceOf() string

func (*FuncDeclaration) Write added in v0.3.0

func (a *FuncDeclaration) Write(w io.Writer)

type Function added in v0.3.0

type Function struct {
	Argc  int
	Argv  []string
	Body  Expr
	Scope Scope
}

func FunctionFromPredefined added in v0.3.0

func FunctionFromPredefined(c Callable, argc uint32) *Function

func NewFunctionWithScope added in v0.3.0

func NewFunctionWithScope(Argv []string, Body Expr, s Scope) *Function

func (*Function) Eq added in v0.3.0

func (a *Function) Eq(other Expr) bool

func (*Function) Evaluate added in v0.3.0

func (a *Function) Evaluate(s Scope) (Expr, error)

func (*Function) InstanceOf added in v0.3.0

func (a *Function) InstanceOf() string

func (*Function) Write added in v0.3.0

func (a *Function) Write(w io.Writer)

type FunctionCall added in v0.3.0

type FunctionCall struct {
	Name string
	Argc int
	Argv Exprs
}

func NewFunctionCall added in v0.3.0

func NewFunctionCall(name string, argv Exprs) *FunctionCall

func (*FunctionCall) Eq added in v0.3.0

func (a *FunctionCall) Eq(other Expr) bool

func (*FunctionCall) Evaluate added in v0.3.0

func (a *FunctionCall) Evaluate(s Scope) (Expr, error)

func (*FunctionCall) InstanceOf added in v0.3.0

func (a *FunctionCall) InstanceOf() string

func (*FunctionCall) Write added in v0.3.0

func (a *FunctionCall) Write(w io.Writer)

type Functions added in v0.3.0

type Functions map[string]Expr

type Getable added in v0.3.0

type Getable interface {
	Get(string) (Expr, error)
}

get property from object

type GetterExpr

type GetterExpr struct {
	Object Expr
	Key    string
}

func NewGetterExpr

func NewGetterExpr(object Expr, key string) *GetterExpr

func (*GetterExpr) Eq

func (a *GetterExpr) Eq(other Expr) bool

func (*GetterExpr) Evaluate

func (a *GetterExpr) Evaluate(s Scope) (Expr, error)

func (*GetterExpr) InstanceOf

func (a *GetterExpr) InstanceOf() string

func (*GetterExpr) Write

func (a *GetterExpr) Write(w io.Writer)

type HalfDownExpr added in v0.3.0

type HalfDownExpr struct{}

func (*HalfDownExpr) Eq added in v0.3.0

func (a *HalfDownExpr) Eq(other Expr) bool

func (*HalfDownExpr) Evaluate added in v0.3.0

func (a *HalfDownExpr) Evaluate(Scope) (Expr, error)

func (*HalfDownExpr) InstanceOf added in v0.3.0

func (a *HalfDownExpr) InstanceOf() string

func (*HalfDownExpr) Write added in v0.3.0

func (a *HalfDownExpr) Write(w io.Writer)

type HalfEvenExpr added in v0.3.0

type HalfEvenExpr struct{}

func (*HalfEvenExpr) Eq added in v0.3.0

func (a *HalfEvenExpr) Eq(other Expr) bool

func (*HalfEvenExpr) Evaluate added in v0.3.0

func (a *HalfEvenExpr) Evaluate(Scope) (Expr, error)

func (*HalfEvenExpr) InstanceOf added in v0.3.0

func (a *HalfEvenExpr) InstanceOf() string

func (*HalfEvenExpr) Write added in v0.3.0

func (a *HalfEvenExpr) Write(w io.Writer)

type HalfUpExpr added in v0.3.0

type HalfUpExpr struct{}

func (*HalfUpExpr) Eq added in v0.3.0

func (a *HalfUpExpr) Eq(other Expr) bool

func (*HalfUpExpr) Evaluate added in v0.3.0

func (a *HalfUpExpr) Evaluate(Scope) (Expr, error)

func (*HalfUpExpr) InstanceOf added in v0.3.0

func (a *HalfUpExpr) InstanceOf() string

func (*HalfUpExpr) Write added in v0.3.0

func (a *HalfUpExpr) Write(w io.Writer)

type IfExpr

type IfExpr struct {
	Condition Expr
	True      Expr
	False     Expr
}

func NewIf

func NewIf(cond, trueExpr, falseExpr Expr) *IfExpr

func (*IfExpr) Eq

func (a *IfExpr) Eq(other Expr) bool

func (*IfExpr) Evaluate

func (a *IfExpr) Evaluate(s Scope) (Expr, error)

func (*IfExpr) InstanceOf

func (a *IfExpr) InstanceOf() string

func (*IfExpr) Write

func (a *IfExpr) Write(w io.Writer)

type InvalidAddressExpr added in v0.3.0

type InvalidAddressExpr BytesExpr

func (*InvalidAddressExpr) Eq added in v0.3.0

func (a *InvalidAddressExpr) Eq(other Expr) bool

func (*InvalidAddressExpr) Evaluate added in v0.3.0

func (a *InvalidAddressExpr) Evaluate(Scope) (Expr, error)

func (*InvalidAddressExpr) Get added in v0.3.0

func (a *InvalidAddressExpr) Get(name string) (Expr, error)

func (*InvalidAddressExpr) InstanceOf added in v0.3.0

func (a *InvalidAddressExpr) InstanceOf() string

func (*InvalidAddressExpr) Write added in v0.3.0

func (a *InvalidAddressExpr) Write(w io.Writer)

type InvocationExpr added in v0.3.0

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

func (*InvocationExpr) Eq added in v0.3.0

func (a *InvocationExpr) Eq(other Expr) bool

func (*InvocationExpr) Evaluate added in v0.3.0

func (a *InvocationExpr) Evaluate(Scope) (Expr, error)

func (*InvocationExpr) Get added in v0.3.0

func (a *InvocationExpr) Get(name string) (Expr, error)

func (*InvocationExpr) InstanceOf added in v0.3.0

func (a *InvocationExpr) InstanceOf() string

func (*InvocationExpr) Write added in v0.3.0

func (a *InvocationExpr) Write(w io.Writer)

type IssueExpr added in v0.5.0

type IssueExpr struct {
	Name        string
	Description string
	Quantity    int64
	Decimals    int64
	Reissuable  bool
	Nonce       int64
}

func NewIssueExpr added in v0.5.0

func NewIssueExpr(name, description string, quantity, decimals int64, reissuable bool, nonce int64) *IssueExpr

func (*IssueExpr) Eq added in v0.5.0

func (a *IssueExpr) Eq(other Expr) bool

func (*IssueExpr) Evaluate added in v0.5.0

func (a *IssueExpr) Evaluate(Scope) (Expr, error)

func (*IssueExpr) Get added in v0.5.0

func (a *IssueExpr) Get(name string) (Expr, error)

func (*IssueExpr) InstanceOf added in v0.5.0

func (a *IssueExpr) InstanceOf() string

func (*IssueExpr) ToAction added in v0.5.0

func (a *IssueExpr) ToAction(parent *crypto.Digest) (proto.ScriptAction, error)

func (*IssueExpr) Write added in v0.5.0

func (a *IssueExpr) Write(w io.Writer)

type LazyValueExpr added in v0.3.0

type LazyValueExpr struct {
	Expr  Expr
	Scope Scope
}

will be calculated in future, with known Scope

func NewLazyValue added in v0.3.0

func NewLazyValue(Expr Expr, Scope Scope) *LazyValueExpr

func (*LazyValueExpr) Eq added in v0.3.0

func (a *LazyValueExpr) Eq(other Expr) bool

func (*LazyValueExpr) Evaluate added in v0.3.0

func (a *LazyValueExpr) Evaluate(Scope) (Expr, error)

func (*LazyValueExpr) InstanceOf added in v0.3.0

func (a *LazyValueExpr) InstanceOf() string

func (*LazyValueExpr) Write added in v0.3.0

func (a *LazyValueExpr) Write(w io.Writer)

type LetDeclaration added in v0.3.0

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

func (*LetDeclaration) Eval added in v0.3.0

func (a *LetDeclaration) Eval(s Scope)

type LetExpr

type LetExpr struct {
	Name  string
	Value Expr
}

func NewLet

func NewLet(name string, value Expr) *LetExpr

func (*LetExpr) Eq added in v0.3.0

func (a *LetExpr) Eq(other Expr) bool

func (*LetExpr) Evaluate added in v0.3.0

func (a *LetExpr) Evaluate(s Scope) (Expr, error)

func (*LetExpr) InstanceOf added in v0.3.0

func (a *LetExpr) InstanceOf() string

func (*LetExpr) Write

func (a *LetExpr) Write(w io.Writer)

type LongExpr

type LongExpr struct {
	Value int64
}

func NewLong

func NewLong(value int64) *LongExpr

func (*LongExpr) Eq

func (a *LongExpr) Eq(other Expr) bool

func (*LongExpr) Evaluate

func (a *LongExpr) Evaluate(Scope) (Expr, error)

func (*LongExpr) InstanceOf

func (a *LongExpr) InstanceOf() string

func (*LongExpr) Write

func (a *LongExpr) Write(w io.Writer)

type MD5Expr added in v0.3.0

type MD5Expr struct{}

func (*MD5Expr) Eq added in v0.3.0

func (a *MD5Expr) Eq(other Expr) bool

func (*MD5Expr) Evaluate added in v0.3.0

func (a *MD5Expr) Evaluate(Scope) (Expr, error)

func (*MD5Expr) InstanceOf added in v0.3.0

func (a *MD5Expr) InstanceOf() string

func (*MD5Expr) Write added in v0.3.0

func (a *MD5Expr) Write(w io.Writer)

type NoAlgExpr added in v0.3.0

type NoAlgExpr struct{}

func (*NoAlgExpr) Eq added in v0.3.0

func (a *NoAlgExpr) Eq(other Expr) bool

func (*NoAlgExpr) Evaluate added in v0.3.0

func (a *NoAlgExpr) Evaluate(Scope) (Expr, error)

func (*NoAlgExpr) InstanceOf added in v0.3.0

func (a *NoAlgExpr) InstanceOf() string

func (*NoAlgExpr) Write added in v0.3.0

func (a *NoAlgExpr) Write(w io.Writer)

type ObjectExpr

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

func NewObject

func NewObject(fields map[string]Expr) *ObjectExpr

func (*ObjectExpr) Eq

func (a *ObjectExpr) Eq(other Expr) bool

func (*ObjectExpr) Evaluate

func (a *ObjectExpr) Evaluate(Scope) (Expr, error)

func (*ObjectExpr) Get

func (a *ObjectExpr) Get(name string) (Expr, error)

func (*ObjectExpr) InstanceOf

func (a *ObjectExpr) InstanceOf() string

func (*ObjectExpr) Write

func (a *ObjectExpr) Write(w io.Writer)

type PredefFunction added in v0.3.0

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

func (*PredefFunction) Eq added in v0.3.0

func (a *PredefFunction) Eq(other Expr) bool

func (*PredefFunction) Evaluate added in v0.3.0

func (a *PredefFunction) Evaluate(s Scope) (Expr, error)

func (*PredefFunction) InstanceOf added in v0.3.0

func (a *PredefFunction) InstanceOf() string

func (*PredefFunction) Write added in v0.3.0

func (a *PredefFunction) Write(w io.Writer)

type Recipient added in v0.3.0

type Recipient interface {
	Expr
	Recipient() proto.Recipient
}

type RecipientExpr

type RecipientExpr proto.Recipient

func NewRecipientFromProtoRecipient

func NewRecipientFromProtoRecipient(a proto.Recipient) *RecipientExpr

func (*RecipientExpr) Eq

func (a *RecipientExpr) Eq(other Expr) bool

func (*RecipientExpr) Evaluate

func (a *RecipientExpr) Evaluate(Scope) (Expr, error)

func (*RecipientExpr) InstanceOf

func (a *RecipientExpr) InstanceOf() string

func (*RecipientExpr) Recipient added in v0.3.0

func (a *RecipientExpr) Recipient() proto.Recipient

func (*RecipientExpr) Write

func (a *RecipientExpr) Write(w io.Writer)

type RefExpr

type RefExpr struct {
	Name string
}

func (*RefExpr) Eq

func (a *RefExpr) Eq(other Expr) bool

func (*RefExpr) Evaluate

func (a *RefExpr) Evaluate(s Scope) (Expr, error)

func (*RefExpr) InstanceOf

func (a *RefExpr) InstanceOf() string

func (*RefExpr) Write

func (a *RefExpr) Write(w io.Writer)

type ReissueExpr added in v0.5.0

type ReissueExpr struct {
	AssetID    crypto.Digest
	Quantity   int64
	Reissuable bool
}

func NewReissueExpr added in v0.5.0

func NewReissueExpr(assetID []byte, quantity int64, reissuable bool) (*ReissueExpr, error)

func (*ReissueExpr) Eq added in v0.5.0

func (a *ReissueExpr) Eq(other Expr) bool

func (*ReissueExpr) Evaluate added in v0.5.0

func (a *ReissueExpr) Evaluate(Scope) (Expr, error)

func (*ReissueExpr) Get added in v0.5.0

func (a *ReissueExpr) Get(name string) (Expr, error)

func (*ReissueExpr) InstanceOf added in v0.5.0

func (a *ReissueExpr) InstanceOf() string

func (*ReissueExpr) ToAction added in v0.5.0

func (a *ReissueExpr) ToAction(*crypto.Digest) (proto.ScriptAction, error)

func (*ReissueExpr) Write added in v0.5.0

func (a *ReissueExpr) Write(w io.Writer)

type Result added in v0.6.0

type Result struct {
	Value   bool
	Throw   bool
	Message string
}

func (*Result) Error added in v0.7.0

func (r *Result) Error() error

func (*Result) Failed added in v0.7.0

func (r *Result) Failed() bool

type SHA1Expr added in v0.3.0

type SHA1Expr struct{}

func (*SHA1Expr) Eq added in v0.3.0

func (a *SHA1Expr) Eq(other Expr) bool

func (*SHA1Expr) Evaluate added in v0.3.0

func (a *SHA1Expr) Evaluate(Scope) (Expr, error)

func (*SHA1Expr) InstanceOf added in v0.3.0

func (a *SHA1Expr) InstanceOf() string

func (*SHA1Expr) Write added in v0.3.0

func (a *SHA1Expr) Write(w io.Writer)

type SHA224Expr added in v0.3.0

type SHA224Expr struct{}

func (*SHA224Expr) Eq added in v0.3.0

func (a *SHA224Expr) Eq(other Expr) bool

func (*SHA224Expr) Evaluate added in v0.3.0

func (a *SHA224Expr) Evaluate(Scope) (Expr, error)

func (*SHA224Expr) InstanceOf added in v0.3.0

func (a *SHA224Expr) InstanceOf() string

func (*SHA224Expr) Write added in v0.3.0

func (a *SHA224Expr) Write(w io.Writer)

type SHA256Expr added in v0.3.0

type SHA256Expr struct{}

func (*SHA256Expr) Eq added in v0.3.0

func (a *SHA256Expr) Eq(other Expr) bool

func (*SHA256Expr) Evaluate added in v0.3.0

func (a *SHA256Expr) Evaluate(Scope) (Expr, error)

func (*SHA256Expr) InstanceOf added in v0.3.0

func (a *SHA256Expr) InstanceOf() string

func (*SHA256Expr) Write added in v0.3.0

func (a *SHA256Expr) Write(w io.Writer)

type SHA3224Expr added in v0.3.0

type SHA3224Expr struct{}

func (*SHA3224Expr) Eq added in v0.3.0

func (a *SHA3224Expr) Eq(other Expr) bool

func (*SHA3224Expr) Evaluate added in v0.3.0

func (a *SHA3224Expr) Evaluate(Scope) (Expr, error)

func (*SHA3224Expr) InstanceOf added in v0.3.0

func (a *SHA3224Expr) InstanceOf() string

func (*SHA3224Expr) Write added in v0.3.0

func (a *SHA3224Expr) Write(w io.Writer)

type SHA3256Expr added in v0.3.0

type SHA3256Expr struct{}

func (*SHA3256Expr) Eq added in v0.3.0

func (a *SHA3256Expr) Eq(other Expr) bool

func (*SHA3256Expr) Evaluate added in v0.3.0

func (a *SHA3256Expr) Evaluate(Scope) (Expr, error)

func (*SHA3256Expr) InstanceOf added in v0.3.0

func (a *SHA3256Expr) InstanceOf() string

func (*SHA3256Expr) Write added in v0.3.0

func (a *SHA3256Expr) Write(w io.Writer)

type SHA3384Expr added in v0.3.0

type SHA3384Expr struct{}

func (*SHA3384Expr) Eq added in v0.3.0

func (a *SHA3384Expr) Eq(other Expr) bool

func (*SHA3384Expr) Evaluate added in v0.3.0

func (a *SHA3384Expr) Evaluate(Scope) (Expr, error)

func (*SHA3384Expr) InstanceOf added in v0.3.0

func (a *SHA3384Expr) InstanceOf() string

func (*SHA3384Expr) Write added in v0.3.0

func (a *SHA3384Expr) Write(w io.Writer)

type SHA3512Expr added in v0.3.0

type SHA3512Expr struct{}

func (*SHA3512Expr) Eq added in v0.3.0

func (a *SHA3512Expr) Eq(other Expr) bool

func (*SHA3512Expr) Evaluate added in v0.3.0

func (a *SHA3512Expr) Evaluate(Scope) (Expr, error)

func (*SHA3512Expr) InstanceOf added in v0.3.0

func (a *SHA3512Expr) InstanceOf() string

func (*SHA3512Expr) Write added in v0.3.0

func (a *SHA3512Expr) Write(w io.Writer)

type SHA384Expr added in v0.3.0

type SHA384Expr struct{}

func (*SHA384Expr) Eq added in v0.3.0

func (a *SHA384Expr) Eq(other Expr) bool

func (*SHA384Expr) Evaluate added in v0.3.0

func (a *SHA384Expr) Evaluate(Scope) (Expr, error)

func (*SHA384Expr) InstanceOf added in v0.3.0

func (a *SHA384Expr) InstanceOf() string

func (*SHA384Expr) Write added in v0.3.0

func (a *SHA384Expr) Write(w io.Writer)

type SHA512Expr added in v0.3.0

type SHA512Expr struct{}

func (SHA512Expr) Eq added in v0.3.0

func (a SHA512Expr) Eq(other Expr) bool

func (*SHA512Expr) Evaluate added in v0.3.0

func (a *SHA512Expr) Evaluate(Scope) (Expr, error)

func (*SHA512Expr) InstanceOf added in v0.3.0

func (a *SHA512Expr) InstanceOf() string

func (*SHA512Expr) Write added in v0.3.0

func (a *SHA512Expr) Write(w io.Writer)

type Scope

type Scope interface {
	Clone() Scope
	AddValue(name string, expr Expr)
	Value(string) (Expr, bool)
	State() types.SmartState
	Scheme() byte
	Initial() Scope
	SetTransaction(transaction map[string]Expr)
	SetHeight(height uint64)
	SetThis(this Expr)
	// contains filtered or unexported methods
}

type ScopeImpl

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

func NewScope

func NewScope(version int, scheme byte, state types.SmartState) *ScopeImpl

func (*ScopeImpl) AddValue

func (a *ScopeImpl) AddValue(name string, value Expr)

func (*ScopeImpl) Clone

func (a *ScopeImpl) Clone() Scope

func (*ScopeImpl) Initial added in v0.3.0

func (a *ScopeImpl) Initial() Scope

clone scope with only predefined expressions

func (*ScopeImpl) Scheme

func (a *ScopeImpl) Scheme() byte

func (*ScopeImpl) SetHeight added in v0.3.0

func (a *ScopeImpl) SetHeight(height uint64)

func (*ScopeImpl) SetLastBlockInfo added in v0.3.0

func (a *ScopeImpl) SetLastBlockInfo(lastBlock Expr)

func (*ScopeImpl) SetThis added in v0.3.0

func (a *ScopeImpl) SetThis(this Expr)

func (*ScopeImpl) SetTransaction added in v0.3.0

func (a *ScopeImpl) SetTransaction(transaction map[string]Expr)

func (*ScopeImpl) State

func (a *ScopeImpl) State() types.SmartState

func (*ScopeImpl) Value

func (a *ScopeImpl) Value(name string) (Expr, bool)

type Script added in v0.3.0

type Script struct {
	Version    int
	HasBlockV2 bool
	HasArrays  bool
	Verifier   Expr
	DApp       DApp
	// contains filtered or unexported fields
}

func BuildScript added in v0.3.0

func BuildScript(r *BytesReader) (*Script, error)

func (*Script) CallFunction added in v0.3.0

func (a *Script) CallFunction(scheme proto.Scheme, state types.SmartState, tx *proto.InvokeScriptWithProofs, this, lastBlock Expr) (bool, []proto.ScriptAction, error)

func (*Script) Eval added in v0.3.0

func (a *Script) Eval(s Scope) (Result, error)

func (*Script) HasVerifier added in v0.3.0

func (a *Script) HasVerifier() bool

func (*Script) IsDapp added in v0.3.0

func (a *Script) IsDapp() bool

func (*Script) Verify added in v0.3.0

func (a *Script) Verify(scheme byte, state types.SmartState, object map[string]Expr, this, lastBlock Expr) (Result, error)

type ScriptResultExpr added in v0.3.0

type ScriptResultExpr struct {
	WriteSet    *WriteSetExpr
	TransferSet *TransferSetExpr
}

func NewScriptResult added in v0.3.0

func NewScriptResult(writeSet *WriteSetExpr, transferSet *TransferSetExpr) *ScriptResultExpr

func (*ScriptResultExpr) Eq added in v0.3.0

func (a *ScriptResultExpr) Eq(other Expr) bool

func (*ScriptResultExpr) Evaluate added in v0.3.0

func (a *ScriptResultExpr) Evaluate(Scope) (Expr, error)

func (*ScriptResultExpr) InstanceOf added in v0.3.0

func (a *ScriptResultExpr) InstanceOf() string

func (*ScriptResultExpr) ToActions added in v0.5.0

func (a *ScriptResultExpr) ToActions() ([]proto.ScriptAction, error)

func (*ScriptResultExpr) Write added in v0.3.0

func (a *ScriptResultExpr) Write(w io.Writer)

type ScriptTransferExpr added in v0.3.0

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

func NewScriptTransfer added in v0.3.0

func NewScriptTransfer(recipient Recipient, amount *LongExpr, asset Expr) (*ScriptTransferExpr, error)

func (*ScriptTransferExpr) Eq added in v0.3.0

func (a *ScriptTransferExpr) Eq(other Expr) bool

func (*ScriptTransferExpr) Evaluate added in v0.3.0

func (a *ScriptTransferExpr) Evaluate(Scope) (Expr, error)

func (*ScriptTransferExpr) InstanceOf added in v0.3.0

func (a *ScriptTransferExpr) InstanceOf() string

func (*ScriptTransferExpr) ToAction added in v0.5.0

func (*ScriptTransferExpr) Write added in v0.3.0

func (a *ScriptTransferExpr) Write(w io.Writer)

type SellExpr added in v0.3.0

type SellExpr struct{}

func NewSell added in v0.3.0

func NewSell() *SellExpr

func (*SellExpr) Eq added in v0.3.0

func (a *SellExpr) Eq(other Expr) bool

func (*SellExpr) Evaluate added in v0.3.0

func (a *SellExpr) Evaluate(Scope) (Expr, error)

func (*SellExpr) InstanceOf added in v0.3.0

func (a *SellExpr) InstanceOf() string

func (*SellExpr) Write added in v0.3.0

func (a *SellExpr) Write(w io.Writer)

type SponsorshipExpr added in v0.7.0

type SponsorshipExpr struct {
	AssetID crypto.Digest
	MinFee  int64
}

func NewSponsorshipExpr added in v0.7.0

func NewSponsorshipExpr(assetID []byte, minFee int64) (*SponsorshipExpr, error)

func (*SponsorshipExpr) Eq added in v0.7.0

func (a *SponsorshipExpr) Eq(other Expr) bool

func (*SponsorshipExpr) Evaluate added in v0.7.0

func (a *SponsorshipExpr) Evaluate(Scope) (Expr, error)

func (*SponsorshipExpr) Get added in v0.7.0

func (a *SponsorshipExpr) Get(name string) (Expr, error)

func (*SponsorshipExpr) InstanceOf added in v0.7.0

func (a *SponsorshipExpr) InstanceOf() string

func (*SponsorshipExpr) ToAction added in v0.7.0

func (*SponsorshipExpr) Write added in v0.7.0

func (a *SponsorshipExpr) Write(w io.Writer)

type StringExpr

type StringExpr struct {
	Value string
}

func NewString

func NewString(value string) *StringExpr

func (*StringExpr) Eq

func (a *StringExpr) Eq(other Expr) bool

func (*StringExpr) Evaluate

func (a *StringExpr) Evaluate(Scope) (Expr, error)

func (*StringExpr) InstanceOf

func (a *StringExpr) InstanceOf() string

func (*StringExpr) Write

func (a *StringExpr) Write(w io.Writer)

type Throw

type Throw struct {
	Message string
}

func (Throw) Error

func (a Throw) Error() string

type TransferSetExpr added in v0.3.0

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

func NewTransferSet added in v0.3.0

func NewTransferSet(e ...*ScriptTransferExpr) *TransferSetExpr

func (*TransferSetExpr) Eq added in v0.3.0

func (a *TransferSetExpr) Eq(other Expr) bool

func (*TransferSetExpr) Evaluate added in v0.3.0

func (a *TransferSetExpr) Evaluate(Scope) (Expr, error)

func (*TransferSetExpr) InstanceOf added in v0.3.0

func (a *TransferSetExpr) InstanceOf() string

func (*TransferSetExpr) ToActions added in v0.5.0

func (a *TransferSetExpr) ToActions() ([]proto.ScriptAction, error)

func (*TransferSetExpr) Write added in v0.3.0

func (a *TransferSetExpr) Write(w io.Writer)

type Unit

type Unit struct {
}

func NewUnit

func NewUnit() *Unit

func (*Unit) Eq

func (a *Unit) Eq(other Expr) bool

func (*Unit) Evaluate

func (a *Unit) Evaluate(Scope) (Expr, error)

func (*Unit) InstanceOf

func (a *Unit) InstanceOf() string

func (*Unit) Write

func (a *Unit) Write(w io.Writer)

type UpExpr added in v0.3.0

type UpExpr struct{}

func (*UpExpr) Eq added in v0.3.0

func (a *UpExpr) Eq(other Expr) bool

func (*UpExpr) Evaluate added in v0.3.0

func (a *UpExpr) Evaluate(Scope) (Expr, error)

func (*UpExpr) InstanceOf added in v0.3.0

func (a *UpExpr) InstanceOf() string

func (*UpExpr) Write added in v0.3.0

func (a *UpExpr) Write(w io.Writer)

type WriteSetExpr added in v0.3.0

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

func NewWriteSet added in v0.3.0

func NewWriteSet(e ...*DataEntryExpr) *WriteSetExpr

func (*WriteSetExpr) Eq added in v0.3.0

func (a *WriteSetExpr) Eq(other Expr) bool

func (*WriteSetExpr) Evaluate added in v0.3.0

func (a *WriteSetExpr) Evaluate(Scope) (Expr, error)

func (*WriteSetExpr) Get added in v0.5.0

func (a *WriteSetExpr) Get(name string) (Expr, error)

func (*WriteSetExpr) InstanceOf added in v0.3.0

func (a *WriteSetExpr) InstanceOf() string

func (*WriteSetExpr) ToActions added in v0.5.0

func (a *WriteSetExpr) ToActions() ([]proto.ScriptAction, error)

func (*WriteSetExpr) Write added in v0.3.0

func (a *WriteSetExpr) Write(w io.Writer)

Jump to

Keyboard shortcuts

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