txbuilder

package
v0.0.0-...-7345e76 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrivateKeysAnvil = [3]*ecdsa.PrivateKey{}

Functions

func GetWallet

func GetWallet(mnemonic string, accountID int) (*hdwallet.Wallet, accounts.Account, error)

func NewWorldABI

func NewWorldABI(contract []byte) abi.ABI

func StringToSlice

func StringToSlice(stringID string) ([32]byte, error)

This is needed when encoding the params to interact with a contract

Types

type AbiStruct

type AbiStruct []struct {
	Inputs []struct {
		InternalType string `json:"internalType"`
		Name         string `json:"name"`
		Type         string `json:"type"`
	} `json:"inputs"`
	Name      string `json:"name"`
	Type      string `json:"type"`
	Anonymous bool   `json:"anonymous,omitempty"`
	Outputs   []struct {
		InternalType string `json:"internalType"`
		Name         string `json:"name"`
		Type         string `json:"type"`
	} `json:"outputs,omitempty"`
	StateMutability string `json:"stateMutability,omitempty"`
}

type Contract

type Contract struct {
	ABI abi.ABI
	// contains filtered or unexported fields
}

func NewContract

func NewContract(address string, abi abi.ABI) Contract

type TxBuilder

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

func NexTxBuilder

func NexTxBuilder(
	contracts map[string]Contract,
	endpoint string,
	mnemonic string,
	customGasLimit map[string]uint64,
	defaultGasLimit uint64,
	faucetPrivKey *ecdsa.PrivateKey,
) *TxBuilder

func NexTxBuilderWithClient

func NexTxBuilderWithClient(
	contracts map[string]Contract,
	rpcClient *ethclient.EthClient,
	mnemonic string,
	customGasLimit map[string]uint64,
	defaultGasLimit uint64,
	faucetPrivKey *ecdsa.PrivateKey,
) *TxBuilder

func (*TxBuilder) CallFaucet

func (t *TxBuilder) CallFaucet(addr string, amount *big.Int) (common.Hash, error)

func (*TxBuilder) FundAnAccount

func (t *TxBuilder) FundAnAccount(accountID int) (common.Hash, error)

func (*TxBuilder) GetGasLimit

func (t *TxBuilder) GetGasLimit(method string) uint64

func (*TxBuilder) InteractWithContract

func (t *TxBuilder) InteractWithContract(
	contractName string,
	accountID int,
	value *big.Int,
	message string,
	args ...interface{},
) (common.Hash, error)

func (*TxBuilder) SendTransaction

func (t *TxBuilder) SendTransaction(contractName string, address common.Address, privateKey *ecdsa.PrivateKey, value *big.Int, message string, args ...interface{}) (common.Hash, error)

func (*TxBuilder) SetTxCheckRetry

func (t *TxBuilder) SetTxCheckRetry(value uint32)

func (*TxBuilder) SetTxCheckWaitTime

func (t *TxBuilder) SetTxCheckWaitTime(value time.Duration)

func (*TxBuilder) TransactionReceipt

func (t *TxBuilder) TransactionReceipt(hash common.Hash) *types.Receipt

func (*TxBuilder) WasTransactionSuccessful

func (t *TxBuilder) WasTransactionSuccessful(hash common.Hash) (bool, error)

func (*TxBuilder) WasTxIncludedAndSuccessful

func (t *TxBuilder) WasTxIncludedAndSuccessful(hash common.Hash) (bool, error)

Jump to

Keyboard shortcuts

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