receipts

package
v0.63.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFilterBlockRange = 7500

Variables

This section is empty.

Functions

func FilterMetaTransactionAny added in v0.63.0

func FilterMetaTransactionAny() ethreceipts.FilterQuery

Find any Sequence meta txns

func FilterMetaTransactionID added in v0.63.0

func FilterMetaTransactionID(metaTxnID ethkit.Hash) ethreceipts.FilterQuery

Types

type MetaTxnResult added in v0.63.0

type MetaTxnResult struct {
	MetaTxnID sequence.MetaTxnID
	Status    sequence.MetaTxnStatus
	Reason    string
}

func FetchMetaTransactionReceipt added in v0.63.0

func FetchMetaTransactionReceipt(ctx context.Context, receiptListener *ethreceipts.ReceiptsListener, metaTxnID sequence.MetaTxnID, optTimeout ...time.Duration) (*MetaTxnResult, *ethreceipts.Receipt, ethreceipts.WaitReceiptFinalityFunc, error)

type Receipt

type Receipt struct {
	Status   Status
	Error    error
	Logs     []*types.Log
	Receipts *Receipts
}

type Receipts

type Receipts struct {
	Digest   common.Hash
	Receipts []Receipt
}

func FetchMetaTransactionReceiptByETHGetLogs added in v0.63.0

func FetchMetaTransactionReceiptByETHGetLogs(ctx context.Context, opHash common.Hash, provider ethrpc.Interface, fromBlock, toBlock *big.Int) (Receipts, *types.Receipt, error)

FetchMetaTransactionReceiptByETHGetLogs looks up the transaction that emitted Call* events for the given digest and returns all decoded Sequence receipts along with the native receipt.

The `opHash` is also known as the "MetaTxnID" but please make sure it has the "0x" prefix when passing as a common.Hash, even though sometimes we represent a MetaTxnID without the 0x prefix as a string.

NOTE: toBlock can also be nil, in which case the latest block is used.

Finally, please note that this method will not find meta-transactions if there is a native transaction which fails. In that case, the Call* events are not emitted and thus cannot be found. In such cases, you will need to look up the native transaction receipt directly. However, this is not to be confused with where a "Call" inside of the native transaction fails, but the native transaction itself succeeds which is more common and works fine.

func TransactionReceipts

func TransactionReceipts(ctx context.Context, transaction common.Hash, provider *ethrpc.Provider, chainID ...*big.Int) (Receipts, error)

func TransactionReceiptsForReceipt

func TransactionReceiptsForReceipt(ctx context.Context, receipt *types.Receipt, provider ethrpc.Interface, chainID ...*big.Int) (Receipts, error)

func (*Receipts) Find

func (r *Receipts) Find(digest common.Hash) *Receipts

func (*Receipts) IsSuccess added in v0.62.2

func (r *Receipts) IsSuccess() bool

type Status

type Status int
const (
	StatusNotExecuted Status = iota
	StatusSucceeded
	StatusFailed
	StatusAborted
)

type TokenBalance added in v0.63.1

type TokenBalance struct {
	Token   common.Address
	Account common.Address
	Balance *big.Int
}

type TokenBalances added in v0.63.1

type TokenBalances []*TokenBalance

func (TokenBalances) FilterByAccount added in v0.63.1

func (b TokenBalances) FilterByAccount(account common.Address, optToken ...common.Address) TokenBalances

func (TokenBalances) OmitZeroBalances added in v0.63.1

func (b TokenBalances) OmitZeroBalances() TokenBalances

type TokenTransfer added in v0.63.1

type TokenTransfer struct {
	Token common.Address
	From  common.Address
	To    common.Address
	Value *big.Int
	Raw   types.Log
}

type TokenTransfers added in v0.63.1

type TokenTransfers []*TokenTransfer

func DecodeTokenTransfersFromLogs added in v0.63.1

func DecodeTokenTransfersFromLogs(ctx context.Context, logs []*types.Log) (TokenTransfers, error)

func FetchReceiptTokenTransfers added in v0.63.1

func FetchReceiptTokenTransfers(ctx context.Context, provider *ethrpc.Provider, transactionHash common.Hash) (*types.Receipt, TokenTransfers, error)

FetchReceiptTokenTransfers fetches the transaction receipt for the given transaction hash and decodes any token transfer events (ERC20) that occurred within that transaction. TODOXXX: we currently only support ERC20 token transfers, but we can extend this to support ERC721 and ERC1155 as well.

func (TokenTransfers) ComputeBalanceOutputs added in v0.63.1

func (s TokenTransfers) ComputeBalanceOutputs(omitZeroBalances ...bool) TokenBalances

ComputeBalanceOutputs aggregates net balance changes per token per account from the transfers. For each transfer, it subtracts `Value` from `From` and adds `Value` to `To`. Accounts with a resulting zero balance change for a given token are omitted.

func (TokenTransfers) Delta added in v0.63.1

func (t TokenTransfers) Delta() TokenTransfers

func (TokenTransfers) FilterByAccountAddress added in v0.63.1

func (t TokenTransfers) FilterByAccountAddress(account common.Address) TokenTransfers

func (TokenTransfers) FilterByContractAddress added in v0.63.1

func (t TokenTransfers) FilterByContractAddress(contract common.Address) TokenTransfers

func (TokenTransfers) FilterByFromAddress added in v0.63.1

func (t TokenTransfers) FilterByFromAddress(from common.Address) TokenTransfers

func (TokenTransfers) FilterByToAddress added in v0.63.1

func (t TokenTransfers) FilterByToAddress(to common.Address) TokenTransfers

Jump to

Keyboard shortcuts

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