transaction

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package transaction provides utilities for blockchain transaction operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call[T any](s Session, calldata []byte, unpack func([]byte) (T, error)) (T, error)

Call performs a call to the contract using the provided session and calldata, returning the unpacked result.

func DefaultUnpacker

func DefaultUnpacker([]byte) (byte, error)

DefaultUnpacker is a default implementation that returns zero values.

func Transact

func Transact[T any](
	interaction Interaction,
	s Session,
	calldata []byte,
	unpack func([]byte,
	) (T, error)) (*types.Transaction, error)

Transact is an abstraction for the bind.Transact function, allowing for a more generic transaction interface.

Types

type Interaction

type Interaction interface {
	BaseTxSetup() (*bind.TransactOpts, error)
	Safe() bool
}

Interaction defines the methods required for a transaction interaction.

type Session

type Session interface {
	CallOpts() *bind.CallOpts
	Instance() *bind.BoundContract
}

Session defines the methods required for a session in a transaction interaction.

type TxOptsBuilderFunc

type TxOptsBuilderFunc func() (*bind.TransactOpts, error)

TxOptsBuilderFunc defines a function type that returns a transaction options builder.

Jump to

Keyboard shortcuts

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