forwarders

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: LGPL-3.0, MIT Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForwarderForEOANotFound = errors.New("cannot find forwarder for given EOA")

ErrForwarderForEOANotFound defines the error triggered when no valid forwarders were found for EOA

Functions

func FilterName

func FilterName(addr common.Address) string

Types

type Config

type Config interface {
	FinalityDepth() uint32
}

type DSORM

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

func NewORM

func NewORM(ds sqlutil.DataSource) *DSORM

func (*DSORM) CreateForwarder

func (o *DSORM) CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (fwd Forwarder, err error)

CreateForwarder creates the Forwarder address associated with the current EVM chain id.

func (*DSORM) DeleteForwarder

func (o *DSORM) DeleteForwarder(ctx context.Context, id int64, cleanup func(tx sqlutil.DataSource, evmChainID int64, addr common.Address) error) (err error)

DeleteForwarder removes a forwarder address. If cleanup is non-nil, it can be used to perform any chain- or contract-specific cleanup that need to happen atomically on forwarder deletion. If cleanup returns an error, forwarder deletion will be aborted.

func (*DSORM) FindForwarders

func (o *DSORM) FindForwarders(ctx context.Context, offset, limit int) (fwds []Forwarder, count int, err error)

FindForwarders returns all forwarder addresses from offset up until limit.

func (*DSORM) FindForwardersByChain

func (o *DSORM) FindForwardersByChain(ctx context.Context, evmChainId big.Big) (fwds []Forwarder, err error)

FindForwardersByChain returns all forwarder addresses for a chain.

func (*DSORM) FindForwardersInListByChain

func (o *DSORM) FindForwardersInListByChain(ctx context.Context, evmChainId big.Big, addrs []common.Address) ([]Forwarder, error)

func (*DSORM) Transact

func (o *DSORM) Transact(ctx context.Context, fn func(*DSORM) error) (err error)

type Forwarder

type Forwarder struct {
	ID         int64
	Address    common.Address
	EVMChainID big.Big
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Forwarder is the struct for Forwarder Addresses

type FwdMgr

type FwdMgr struct {
	services.Service

	ORM ORM
	// contains filtered or unexported fields
}

func NewFwdMgr

func NewFwdMgr(ds sqlutil.DataSource, client evmclient.Client, logpoller evmlogpoller.LogPoller, lggr logger.Logger, cfg Config) *FwdMgr

func (*FwdMgr) ConvertPayload

func (f *FwdMgr) ConvertPayload(dest common.Address, origPayload []byte) ([]byte, error)

func (*FwdMgr) ForwarderFor

func (f *FwdMgr) ForwarderFor(ctx context.Context, addr common.Address) (forwarder common.Address, err error)

func (*FwdMgr) ForwarderForOCR2Feeds

func (f *FwdMgr) ForwarderForOCR2Feeds(ctx context.Context, eoa, ocr2Aggregator common.Address) (forwarder common.Address, err error)

type ORM

type ORM interface {
	CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (fwd Forwarder, err error)
	FindForwarders(ctx context.Context, offset, limit int) ([]Forwarder, int, error)
	FindForwardersByChain(ctx context.Context, evmChainId big.Big) ([]Forwarder, error)
	DeleteForwarder(ctx context.Context, id int64, cleanup func(tx sqlutil.DataSource, evmChainId int64, addr common.Address) error) error
	FindForwardersInListByChain(ctx context.Context, evmChainId big.Big, addrs []common.Address) ([]Forwarder, error)
}

Jump to

Keyboard shortcuts

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