bmsutils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventNotFind error = errors.New("could not found event")
)

Functions

func CreateDynamicTx

func CreateDynamicTx(backend Backend, opts *bind.TransactOpts, to *common.Address, input []byte) (*types.Transaction, error)

func EnrollErrors

func EnrollErrors(aBIs ...*abi.ABI)

func FindEventLog

func FindEventLog(logs []*types.Log, aBI *abi.ABI, name string) ([]*types.Log, error)

func FindEventLogWithABI

func FindEventLogWithABI(logs []*types.Log, aBI *abi.ABI, name string) (abi.Event, []*types.Log, error)

func SendDynamicTx

func SendDynamicTx(backend Backend, opts *bind.TransactOpts, to *common.Address, input []byte) (*types.Transaction, error)

func ToEther

func ToEther(x interface{}) decimal.Decimal

func ToRevert

func ToRevert(input error) error

func ToWei

func ToWei(x interface{}) *big.Int

func UnpackEvents

func UnpackEvents[T any](aBI *abi.ABI, name string, receipts ...*types.Receipt) ([]*T, error)

func UnpackEventsIntoMap

func UnpackEventsIntoMap(aBI *abi.ABI, name string, receipts ...*types.Receipt) ([]map[string]interface{}, error)

Types

type Backend

type Backend interface {
	bind.ContractBackend
}

type Contract

type Contract[T any] struct {
	// contains filtered or unexported fields
}

func DeployContract

func DeployContract[T any](address common.Address, tx *types.Transaction, contract *T, err error) (*Contract[T], *types.Transaction, error)

func NewContract

func NewContract[T any](address common.Address, backend bind.ContractBackend) *Contract[T]

func (*Contract[T]) ABI

func (contract *Contract[T]) ABI() *abi.ABI

func (*Contract[T]) Address

func (contract *Contract[T]) Address() common.Address

func (*Contract[T]) Funcs

func (contract *Contract[T]) Funcs() *T

func (*Contract[T]) SetABI

func (contract *Contract[T]) SetABI(abi *abi.ABI) *Contract[T]

func (*Contract[T]) SetABIWithError

func (contract *Contract[T]) SetABIWithError(abi *abi.ABI, err error) (*Contract[T], error)

type RevertError

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

func (*RevertError) Error

func (err *RevertError) Error() string

type Sig

type Sig [4]byte

type TxPool

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

func NewTxPool

func NewTxPool(client bind.DeployBackend) *TxPool

func (*TxPool) AllReceiptStatusSuccessful

func (txs *TxPool) AllReceiptStatusSuccessful(ctx context.Context) error

func (*TxPool) Append

func (txs *TxPool) Append(tx *types.Transaction) *types.Transaction

func (*TxPool) Clear

func (txs *TxPool) Clear() error

func (*TxPool) Exec

func (txs *TxPool) Exec(tx *types.Transaction, err error) error

func (*TxPool) WaitMined

func (txs *TxPool) WaitMined(ctx context.Context) ([]*types.Receipt, error)

Jump to

Keyboard shortcuts

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