wallet

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(clientPool *execution.Pool, logger logrus.FieldLogger) *Manager

func (*Manager) GetWalletByAddress

func (manager *Manager) GetWalletByAddress(address common.Address) *Wallet

func (*Manager) GetWalletByPrivkey

func (manager *Manager) GetWalletByPrivkey(privkey *ecdsa.PrivateKey) (*Wallet, error)

func (*Manager) GetWalletPoolByPrivkey

func (manager *Manager) GetWalletPoolByPrivkey(privkey *ecdsa.PrivateKey, walletCount uint64, childSeed string) (*WalletPool, error)

type SendTransactionOptions added in v0.0.12

type SendTransactionOptions struct {
	Clients            []*execution.Client
	ClientsStartOffset int

	OnConfirm TxConfirmFn
	LogFn     TxLogFn

	MaxRebroadcasts     int
	RebroadcastInterval time.Duration
}

type Summary added in v0.0.10

type Summary struct {
	Address          string   `json:"address" yaml:"address"`
	PrivKey          string   `json:"privkey" yaml:"privkey"`
	PendingBalance   *big.Int `json:"pendingBalance" yaml:"pendingBalance"`
	PendingNonce     uint64   `json:"pendingNonce" yaml:"pendingNonce"`
	ConfirmedBalance *big.Int `json:"confirmedBalance" yaml:"confirmedBalance"`
	ConfirmedNonce   uint64   `json:"confirmedNonce" yaml:"confirmedNonce"`
}

type TxConfirmFn added in v0.0.12

type TxConfirmFn func(tx *types.Transaction, receipt *types.Receipt, err error)

type TxLogFn added in v0.0.12

type TxLogFn func(client *execution.Client, retry int, rebroadcast int, err error)

type Wallet

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

func (*Wallet) AwaitReady

func (wallet *Wallet) AwaitReady(ctx context.Context) error

func (*Wallet) AwaitTransaction

func (wallet *Wallet) AwaitTransaction(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)

func (*Wallet) BuildTransaction

func (wallet *Wallet) BuildTransaction(ctx context.Context, buildFn func(ctx context.Context, nonce uint64, signer bind.SignerFn) (*types.Transaction, error)) (*types.Transaction, error)

func (*Wallet) GetAddress

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

func (*Wallet) GetBalance

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

func (*Wallet) GetNonce

func (wallet *Wallet) GetNonce() uint64

func (*Wallet) GetPendingBalance

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

func (*Wallet) GetPrivateKey

func (wallet *Wallet) GetPrivateKey() *ecdsa.PrivateKey

func (*Wallet) GetReadableBalance

func (wallet *Wallet) GetReadableBalance(unitDigits, maxPreCommaDigitsBeforeTrim, digits int, addPositiveSign, trimAmount bool) string

func (*Wallet) GetSummary added in v0.0.10

func (wallet *Wallet) GetSummary() *Summary

func (*Wallet) ResyncState

func (wallet *Wallet) ResyncState()

func (*Wallet) SendTransaction added in v0.0.12

func (wallet *Wallet) SendTransaction(ctx context.Context, tx *types.Transaction, options *SendTransactionOptions) error

func (*Wallet) UseNextNonce added in v0.0.12

func (wallet *Wallet) UseNextNonce(increase bool) uint64

type WalletPool

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

func (*WalletPool) EnsureFunding

func (pool *WalletPool) EnsureFunding(ctx context.Context, minBalance, refillAmount, gasFeeCap, gasTipCap *big.Int, pendingLimit uint64) error

func (*WalletPool) GetChildWallet

func (pool *WalletPool) GetChildWallet(index uint64) *Wallet

func (*WalletPool) GetChildWallets

func (pool *WalletPool) GetChildWallets() []*Wallet

func (*WalletPool) GetNextChildWallet

func (pool *WalletPool) GetNextChildWallet() *Wallet

func (*WalletPool) GetRootWallet

func (pool *WalletPool) GetRootWallet() *Wallet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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