txintent

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteIndexed

func ExecuteIndexed(executor common.Address, events *plan.Lazy[*InteropOutput], index int) func(ctx context.Context) (*ExecTrigger, error)

ExecuteIndexed returns a lambda to transform InteropOutput to a new ExecTrigger

func ExecuteIndexeds

func ExecuteIndexeds(multicaller, executor common.Address, events *plan.Lazy[*InteropOutput], indexes []int) func(ctx context.Context) (*MultiTrigger, error)

ExecuteIndexeds returns a lambda to transform InteropOutput to a new MultiTrigger which batches multiple ExecTrigger

func RelayIndexed

func RelayIndexed(executor common.Address, events *plan.Lazy[*InteropOutput], receipt *plan.Lazy[*types.Receipt], index int) func(ctx context.Context) (*RelayTrigger, error)

RelayIndexed returns a lambda to transform InteropOutput to a new RelayTrigger

Types

type Call

type Call interface {
	To() (*common.Address, error)
	AccessList() (types.AccessList, error)
	Input
}

Call expresses minimal representation to plan transaction to write.

type CallView

type CallView[O any] interface {
	Call
	Output[O]
	Client() apis.EthClient
}

CallView expresses minimal representation to plan transaction to view, embedding Call interface. It is typed for interpreting the read result, and binds client for viewing.

type ExecTrigger

type ExecTrigger struct {
	Executor common.Address // address of the EventLogger or CrossL2Inbox
	Msg      messages.Message
}

Trigger for using the CrossL2Inbox to trigger validateMessage This Trigger may be embedded to other triggers for preparing access lists

func (*ExecTrigger) AccessList

func (v *ExecTrigger) AccessList() (types.AccessList, error)

func (*ExecTrigger) EncodeInput

func (v *ExecTrigger) EncodeInput() ([]byte, error)

func (*ExecTrigger) To

func (v *ExecTrigger) To() (*common.Address, error)

type InitTrigger

type InitTrigger struct {
	Emitter    common.Address // address of the EventLogger
	Topics     [][32]byte
	OpaqueData []byte
}

Trigger for using the EventLogger to trigger emitLog

func (*InitTrigger) AccessList

func (v *InitTrigger) AccessList() (types.AccessList, error)

func (*InitTrigger) EncodeInput

func (v *InitTrigger) EncodeInput() ([]byte, error)

func (*InitTrigger) To

func (v *InitTrigger) To() (*common.Address, error)

type Input

type Input interface {
	EncodeInput() ([]byte, error)
}

type IntentTx

type IntentTx[V Call, R Result] struct {
	PlannedTx *txplan.PlannedTx
	Content   plan.Lazy[V]
	Result    plan.Lazy[R]
}

func NewIntent

func NewIntent[V Call, R Result](opts ...txplan.Option) *IntentTx[V, R]

type InteropOutput

type InteropOutput struct {
	Entries []messages.Message
}

func (*InteropOutput) FromReceipt

func (i *InteropOutput) FromReceipt(ctx context.Context, rec *types.Receipt, includedIn eth.BlockRef, chainID eth.ChainID) error

FromReceipt creates Messages from receipt and block included, to prepare validating messages

func (*InteropOutput) Init

func (i *InteropOutput) Init() Result

type MultiTrigger

type MultiTrigger struct {
	Emitter common.Address // address of the MultiCall3 contract
	Calls   []Call
}

Trigger for using the MultiCall3 to batch Calls

func (*MultiTrigger) AccessList

func (v *MultiTrigger) AccessList() (types.AccessList, error)

func (*MultiTrigger) EncodeInput

func (v *MultiTrigger) EncodeInput() ([]byte, error)

func (*MultiTrigger) To

func (m *MultiTrigger) To() (*common.Address, error)

type MulticallOutput

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

func (*MulticallOutput) FromReceipt

func (m *MulticallOutput) FromReceipt(ctx context.Context, rec *types.Receipt, includedIn eth.BlockRef, chainID eth.ChainID) error

FromReceipt stores all gained info

func (*MulticallOutput) Init

func (m *MulticallOutput) Init() Result

type Output

type Output[O any] interface {
	DecodeOutput(data []byte) (dest O, err error)
}

type RelayTrigger

type RelayTrigger struct {
	ExecTrigger
	Payload []byte
}

Trigger for using the L2ToL2CrossDomainMessenger to trigger relayMessage

func (*RelayTrigger) EncodeInput

func (v *RelayTrigger) EncodeInput() ([]byte, error)

type Result

type Result interface {
	FromReceipt(ctx context.Context, rec *types.Receipt, includedIn eth.BlockRef, chainID eth.ChainID) error
	Init() Result
}

type SendTrigger

type SendTrigger struct {
	Emitter         common.Address // address of the L2ToL2CrossDomainMessenger
	DestChainID     eth.ChainID
	Target          common.Address
	RelayedCalldata []byte
}

Trigger for using the L2ToL2CrossDomainMessenger to trigger sendMessage

func (*SendTrigger) AccessList

func (v *SendTrigger) AccessList() (types.AccessList, error)

func (*SendTrigger) EncodeInput

func (v *SendTrigger) EncodeInput() ([]byte, error)

func (*SendTrigger) To

func (v *SendTrigger) To() (*common.Address, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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