Documentation ¶
Index ¶
- Constants
- func EventStringAccountCall(addr crypto.Address) string
- func EventStringAccountInput(addr crypto.Address) string
- func EventStringAccountOutput(addr crypto.Address) string
- func EventStringBond() string
- func EventStringLogEvent(addr crypto.Address) string
- func EventStringNameReg(name string) string
- func EventStringPermissions(perm ptypes.PermFlag) string
- func EventStringUnbond() string
- func PublishAccountCall(publisher event.Publisher, tx *txs.Tx, height uint64, call *EventDataCall) error
- func PublishAccountInput(publisher event.Publisher, height uint64, address crypto.Address, tx *txs.Tx, ...) error
- func PublishAccountOutput(publisher event.Publisher, height uint64, address crypto.Address, tx *txs.Tx, ...) error
- func PublishLogEvent(publisher event.Publisher, tx *txs.Tx, log *EventDataLog) error
- func PublishNameReg(publisher event.Publisher, height uint64, tx *txs.Tx) error
- func PublishPermissions(publisher event.Publisher, height uint64, tx *txs.Tx) error
- func SubscribeAccountCall(ctx context.Context, subscribable event.Subscribable, subscriber string, ...) error
- func SubscribeAccountOutputSendTx(ctx context.Context, subscribable event.Subscribable, subscriber string, ...) error
- func SubscribeLogEvent(ctx context.Context, subscribable event.Subscribable, subscriber string, ...) error
- type CallData
- type Event
- func (ev *Event) Copy() *Event
- func (ev *Event) Encode() ([]byte, error)
- func (ev *Event) Get(key string) (value string, ok bool)
- func (ev *Event) GetCall() *EventDataCall
- func (ev *Event) GetLog() *EventDataLog
- func (ev *Event) GetTx() *EventDataTx
- func (ev *Event) Key() Key
- func (ev *Event) Keys() []string
- func (ev *Event) Len() int
- func (ev *Event) ProvideIndex(index uint64)
- func (ev *Event) String() string
- func (ev *Event) Tags() event.Tags
- type EventDataCall
- type EventDataLog
- type EventDataTx
- type Header
- type Key
- type Provider
- type Type
Constants ¶
const ( TypeCall = Type(0x00) TypeLog = Type(0x01) TypeAccountInput = Type(0x02) TypeAccountOutput = Type(0x03) )
Execution event types
Variables ¶
This section is empty.
Functions ¶
func EventStringAccountCall ¶ added in v0.19.0
func EventStringAccountInput ¶
func EventStringBond ¶
func EventStringBond() string
func EventStringLogEvent ¶ added in v0.19.0
func EventStringNameReg ¶
func EventStringPermissions ¶
func EventStringUnbond ¶
func EventStringUnbond() string
func PublishAccountCall ¶ added in v0.19.0
func PublishAccountCall(publisher event.Publisher, tx *txs.Tx, height uint64, call *EventDataCall) error
Publish/Subscribe
func PublishAccountInput ¶
func PublishAccountInput(publisher event.Publisher, height uint64, address crypto.Address, tx *txs.Tx, ret []byte, exception *errors.Exception) error
Publish/Subscribe
func PublishAccountOutput ¶
func PublishLogEvent ¶ added in v0.19.0
Publish/Subscribe
func PublishNameReg ¶
func PublishPermissions ¶
func SubscribeAccountCall ¶ added in v0.19.0
func SubscribeAccountCall(ctx context.Context, subscribable event.Subscribable, subscriber string, address crypto.Address, txHash []byte, stackDepth int, ch chan<- *EventDataCall) error
Subscribe to account call event - if TxHash is provided listens for a specifc Tx otherwise captures all, if stackDepth is greater than or equal to 0 captures calls at a specific stack depth (useful for capturing the return of the root call over recursive calls
func SubscribeLogEvent ¶ added in v0.19.0
func SubscribeLogEvent(ctx context.Context, subscribable event.Subscribable, subscriber string, address crypto.Address, ch chan<- *EventDataLog) error
Types ¶
type Event ¶ added in v0.19.0
type Event struct { Header *Header Call *EventDataCall `json:",omitempty"` Log *EventDataLog `json:",omitempty"` Tx *EventDataTx `json:",omitempty"` // contains filtered or unexported fields }
func DecodeEvent ¶ added in v0.19.0
func (*Event) GetCall ¶ added in v0.19.0
func (ev *Event) GetCall() *EventDataCall
func (*Event) GetLog ¶ added in v0.19.0
func (ev *Event) GetLog() *EventDataLog
func (*Event) GetTx ¶ added in v0.19.0
func (ev *Event) GetTx() *EventDataTx
func (*Event) ProvideIndex ¶ added in v0.19.0
event.Cache will provide an index through this methods of Indexable
type EventDataCall ¶ added in v0.19.0
type EventDataCall struct { CallData *CallData Origin crypto.Address StackDepth uint64 Return binary.HexBytes Exception *errors.Exception }
EventDataCall fires when we call a contract, and when a contract calls another contract
func (*EventDataCall) Get ¶ added in v0.19.0
func (call *EventDataCall) Get(key string) (string, bool)
Implements Tags for events
func (*EventDataCall) Keys ¶ added in v0.19.0
func (call *EventDataCall) Keys() []string
func (*EventDataCall) Len ¶ added in v0.19.0
func (call *EventDataCall) Len() int
func (*EventDataCall) Tags ¶ added in v0.19.0
func (call *EventDataCall) Tags(tags map[string]interface{}) map[string]interface{}
type EventDataLog ¶ added in v0.19.0
type EventDataLog struct { Height uint64 Address crypto.Address Topics []Word256 Data binary.HexBytes }
EventDataLog fires when a contract executes the LOG opcode
func (*EventDataLog) GetTopic ¶ added in v0.19.0
func (log *EventDataLog) GetTopic(i int) Word256
func (*EventDataLog) Keys ¶ added in v0.19.0
func (log *EventDataLog) Keys() []string
func (*EventDataLog) Len ¶ added in v0.19.0
func (log *EventDataLog) Len() int
type EventDataTx ¶
All txs fire EventDataTx, but only CallTx might have Return or Exception
func (*EventDataTx) Keys ¶ added in v0.19.0
func (tx *EventDataTx) Keys() []string
func (*EventDataTx) Len ¶ added in v0.19.0
func (tx *EventDataTx) Len() int
type Header ¶ added in v0.19.0
type Header struct { TxType payload.Type TxHash binary.HexBytes EventType Type EventID string Height uint64 Index uint64 }
type Key ¶ added in v0.19.0
type Key []byte
func (Key) IsSuccessorOf ¶ added in v0.19.0
Returns true iff k is a valid successor key to p; iff (the height is the same and the index is one greater) or (the height is greater and the index is zero) or (p is uninitialised)
type Type ¶ added in v0.19.0
type Type int8