lib

package
v0.0.0-...-5be9b26 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action byte
const (
	Auth   Action = 0
	Mint   Action = 1
	Call   Action = 2
	Spawn  Action = 3
	Deploy Action = 4
)

type Child

type Child struct {
	Contract *Outpoint `json:"contract"`
	Method   string    `json:"method"`
	CallData []byte    `json:"callData"`
}

func (Child) MarshalEasyJSON

func (v Child) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Child) MarshalJSON

func (v Child) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Child) UnmarshalEasyJSON

func (v *Child) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Child) UnmarshalJSON

func (v *Child) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Error

type Error struct {
	Code int
	Err  string
}

func (*Error) Error

func (err *Error) Error() string

func (Error) MarshalEasyJSON

func (v Error) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Error) MarshalJSON

func (v Error) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Error) UnmarshalEasyJSON

func (v *Error) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Error) UnmarshalJSON

func (v *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Event

type Event struct {
	Id     string   `json:"id"`
	Topics [][]byte `json:"topics"`
}

func (Event) MarshalEasyJSON

func (v Event) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Event) MarshalJSON

func (v Event) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Event) UnmarshalEasyJSON

func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Event) UnmarshalJSON

func (v *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ExecContext

type ExecContext struct {
	Action   Action         `json:"action"`
	Contract *Outpoint      `json:"contract"`
	Method   string         `json:"method"`
	CallData []byte         `json:"callData,omitempty"`
	Stack    []*ExecContext `json:"stack,omitempty"`
	Parent   int32          `json:"parent"`
	Instance *Instance      `json:"instance"`
	Events   []*Event       `json:"events,omitempty"`
	Children []*Child       `json:"children,omitempty"`
}

func Initialize

func Initialize() (exec *ExecContext, err error)

func ParseScript

func ParseScript(script []byte) (exec *ExecContext, err error)

func (*ExecContext) Build

func (e *ExecContext) Build() (output *bt.Output, err error)

func (*ExecContext) Emit

func (e *ExecContext) Emit(event string, topics [][]byte)

func (ExecContext) MarshalEasyJSON

func (v ExecContext) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ExecContext) MarshalJSON

func (v ExecContext) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ExecContext) Return

func (exec *ExecContext) Return(err error)

func (*ExecContext) Script

func (e *ExecContext) Script() (script *bscript.Script, err error)

func (*ExecContext) Spawn

func (e *ExecContext) Spawn(contract *Outpoint, method string, callData []byte)

func (*ExecContext) UnmarshalEasyJSON

func (v *ExecContext) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ExecContext) UnmarshalJSON

func (v *ExecContext) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type File

type File struct {
	Outpoint *Outpoint `json:"outpoint,omitempty"`
	Data     []byte    `json:"data"`
	Type     string    `json:"type,omitempty"`
	Encoding string    `json:"enc,omitempty"`
	Name     string    `json:"name,omitempty"`
	Size     uint32    `json:"size,omitempty"`
	Hash     []byte    `json:"hash,omitempty"`
}

func (*File) Build

func (file *File) Build() (output *bt.Output, err error)

func (File) MarshalEasyJSON

func (v File) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (File) MarshalJSON

func (v File) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*File) UnmarshalEasyJSON

func (v *File) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*File) UnmarshalJSON

func (v *File) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Instance

type Instance struct {
	Txo      *Txo      `json:"txo,omitempty"`
	Outpoint *Outpoint `json:"outpoint,omitempty"`
	Origin   *Outpoint `json:"origin,omitempty"`
	Nonce    uint64    `json:"nonce,omitempty"`
	Kind     *Outpoint `json:"kind,omitempty"`
	Satoshis uint64    `json:"sats"`
	Lock     []byte    `json:"lock"`
	Storage  []byte    `json:"store,omitempty"`
	Code     *Outpoint `json:"code"`
	Creator  *Instance `json:"creator"`
}

func (*Instance) Destroy

func (i *Instance) Destroy()

func (Instance) MarshalEasyJSON

func (v Instance) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Instance) MarshalJSON

func (v Instance) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Instance) UnmarshalEasyJSON

func (v *Instance) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Instance) UnmarshalJSON

func (v *Instance) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Outpoint

type Outpoint []byte

func NewOutpoint

func NewOutpoint(txid []byte, vout uint32) *Outpoint

func NewOutpointFromBytes

func NewOutpointFromBytes(b []byte) *Outpoint

func NewOutpointFromString

func NewOutpointFromString(s string) (*Outpoint, error)

func (*Outpoint) Equal

func (o *Outpoint) Equal(c []byte) bool

func (Outpoint) String

func (o Outpoint) String() string

func (Outpoint) Txid

func (o Outpoint) Txid() []byte

func (Outpoint) Vout

func (o Outpoint) Vout() uint32

type Txo

type Txo struct {
	Outpoint *Outpoint       `json:"outpoint,omitempty"`
	Satoshis uint64          `json:"sats"`
	Lock     []byte          `json:"lock"`
	Script   *bscript.Script `json:"script"`
}

func (Txo) MarshalEasyJSON

func (v Txo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Txo) MarshalJSON

func (v Txo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Txo) UnmarshalEasyJSON

func (v *Txo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Txo) UnmarshalJSON

func (v *Txo) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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