txbuilder

package
v0.0.0-...-0bbac7a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBlobTx

func BuildBlobTx(txData *TxMetadata, blobRefs [][]string) (*types.BlobTx, error)

func DynFeeTx

func DynFeeTx(txData *TxMetadata) (*types.DynamicFeeTx, error)

Types

type BlobCommitment

type BlobCommitment struct {
	Blob          kzg4844.Blob
	Commitment    kzg4844.Commitment
	Proof         kzg4844.Proof
	VersionedHash common.Hash
}

func EncodeBlob

func EncodeBlob(data []byte) (*BlobCommitment, error)

type Client

type Client struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewClient

func NewClient(rpchost string) (*Client, error)

func (*Client) AwaitNextBlock

func (client *Client) AwaitNextBlock(lastBlockHeight uint64) (uint64, error)

func (*Client) AwaitTransaction

func (client *Client) AwaitTransaction(tx *types.Transaction) (*types.Receipt, uint64, error)

func (*Client) AwaitWalletNonce

func (client *Client) AwaitWalletNonce(wallet common.Address, nonce uint64, blockHeight uint64) (uint64, error)

func (*Client) GetBalanceAt

func (client *Client) GetBalanceAt(wallet common.Address) (*big.Int, error)

func (*Client) GetBlockHeight

func (client *Client) GetBlockHeight() (uint64, error)

func (*Client) GetChainId

func (client *Client) GetChainId() (*big.Int, error)

func (*Client) GetName

func (client *Client) GetName() string

func (*Client) GetNonceAt

func (client *Client) GetNonceAt(wallet common.Address) (uint64, error)

func (*Client) GetPendingNonceAt

func (client *Client) GetPendingNonceAt(wallet common.Address) (uint64, error)

func (*Client) GetRPCHost

func (client *Client) GetRPCHost() string

func (*Client) GetSuggestedFee

func (client *Client) GetSuggestedFee() (*big.Int, *big.Int, error)

func (*Client) GetTransactionReceipt

func (client *Client) GetTransactionReceipt(txHash []byte) *types.Receipt

func (*Client) SendTransaction

func (client *Client) SendTransaction(tx *types.Transaction) error

func (*Client) SubmitTransaction

func (client *Client) SubmitTransaction(txBytes []byte) *common.Hash

func (*Client) UpdateWallet

func (client *Client) UpdateWallet(wallet *Wallet) error

type TxMetadata

type TxMetadata struct {
	GasTipCap  *uint256.Int // a.k.a. maxPriorityFeePerGas
	GasFeeCap  *uint256.Int // a.k.a. maxFeePerGas
	BlobFeeCap *uint256.Int // a.k.a. maxFeePerBlobGas
	Gas        uint64
	To         *common.Address
	Value      *uint256.Int
	Data       []byte
	AccessList types.AccessList
}

type Wallet

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

func NewWallet

func NewWallet(privkey string) (*Wallet, error)

func (*Wallet) AddBalance

func (wallet *Wallet) AddBalance(amount *big.Int)

func (*Wallet) BuildBlobTx

func (wallet *Wallet) BuildBlobTx(txData *types.BlobTx) (*types.Transaction, error)

func (*Wallet) BuildDynamicFeeTx

func (wallet *Wallet) BuildDynamicFeeTx(txData *types.DynamicFeeTx) (*types.Transaction, error)

func (*Wallet) GetAddress

func (wallet *Wallet) GetAddress() common.Address

func (*Wallet) GetBalance

func (wallet *Wallet) GetBalance() *big.Int

func (*Wallet) GetChainId

func (wallet *Wallet) GetChainId() *big.Int

func (*Wallet) GetNonce

func (wallet *Wallet) GetNonce() uint64

func (*Wallet) ReplaceBlobTx

func (wallet *Wallet) ReplaceBlobTx(txData *types.BlobTx, nonce uint64) (*types.Transaction, error)

func (*Wallet) ReplaceDynamicFeeTx

func (wallet *Wallet) ReplaceDynamicFeeTx(txData *types.DynamicFeeTx, nonce uint64) (*types.Transaction, error)

func (*Wallet) SetBalance

func (wallet *Wallet) SetBalance(balance *big.Int)

func (*Wallet) SetChainId

func (wallet *Wallet) SetChainId(chainid *big.Int)

func (*Wallet) SetNonce

func (wallet *Wallet) SetNonce(nonce uint64)

func (*Wallet) SubBalance

func (wallet *Wallet) SubBalance(amount *big.Int)

Jump to

Keyboard shortcuts

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