generatechildwallet

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

README

generate_child_wallet Task

Description

The generate_child_wallet task is designed to create a new, funded child wallet. This task is especially useful in scenarios requiring the setup of additional wallets for transaction testing, smart contract interactions, or other Ethereum network activities.

Configuration Parameters

  • privateKey: The private key of the parent wallet used for funding the new child wallet.

  • walletSeed: A seed phrase used for generating the child wallet. This allows for deterministic wallet creation.

  • randomSeed: If set to true, the task generates the child wallet using a random seed, resulting in a non-deterministic wallet.

  • prefundAmount: The amount of cryptocurrency to be transferred to the child wallet during prefunding.

  • prefundMinBalance: The minimum balance threshold in the parent wallet required to execute the prefunding. Prefunding occurs only if the parent wallet's balance is above this amount.

  • prefundFeeCap: The maximum fee cap for the prefunding transaction to the child wallet.

  • prefundTipCap: The tip cap for the prefunding transaction, determining the priority fee.

  • walletAddressResultVar: The name of the variable to store the address of the newly created child wallet. This can be used for reference in subsequent tasks.

  • walletPrivateKeyResultVar: The name of the variable to store the private key of the new child wallet. This ensures the child wallet can be accessed and used in later tasks.

Defaults

Default settings for the generate_child_wallet task:

- name: generate_child_wallet
  config:
    privateKey: ""
    walletSeed: ""
    randomSeed: false
    prefundAmount: "1000000000000000000"
    prefundMinBalance: "500000000000000000"
    prefundFeeCap: "500000000000"
    prefundTipCap: "1000000000"
    walletAddressResultVar: ""
    walletPrivateKeyResultVar: ""

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "generate_child_wallet"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Generates a funded child wallet.",
		Category:    "wallet",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "childWallet",
				Type:        "object",
				Description: "Summary of the generated child wallet including address and balance.",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error)

Types

type Config

type Config struct {
	PrivateKey string `yaml:"privateKey" json:"privateKey" require:"A" desc:"Private key of the parent wallet used to fund the child wallet."`
	WalletSeed string `yaml:"walletSeed" json:"walletSeed" desc:"Seed used to derive the child wallet address deterministically."`
	RandomSeed bool   `yaml:"randomSeed" json:"randomSeed" desc:"If true, generate a random seed for the child wallet."`

	PrefundFeeCap     *big.Int `yaml:"prefundFeeCap" json:"prefundFeeCap" desc:"Maximum fee cap (in wei) for the prefunding transaction."`
	PrefundTipCap     *big.Int `yaml:"prefundTipCap" json:"prefundTipCap" desc:"Maximum priority tip (in wei) for the prefunding transaction."`
	PrefundAmount     *big.Int `yaml:"prefundAmount" json:"prefundAmount" desc:"Amount (in wei) to transfer to the child wallet."`
	PrefundMinBalance *big.Int `yaml:"prefundMinBalance" json:"prefundMinBalance" desc:"Minimum balance (in wei) before triggering a prefund."`

	KeepFunding bool `` /* 141-byte string literal not displayed */

	WalletAddressResultVar    string `yaml:"walletAddressResultVar" json:"walletAddressResultVar" deprecated:"true" desc:"Deprecated: Use task outputs instead."`
	WalletPrivateKeyResultVar string `` /* 128-byte string literal not displayed */
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Summary

type Summary struct {
	Address        string `json:"address"`
	PrivKey        string `json:"privkey"`
	PendingNonce   uint64 `json:"pendingNonce"`
	ConfirmedNonce uint64 `json:"confirmedNonce"`
	Balance        string `json:"balance"`
}

type Task

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

func (*Task) Config

func (t *Task) Config() interface{}

func (*Task) Execute

func (t *Task) Execute(ctx context.Context) error

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Timeout

func (t *Task) Timeout() time.Duration

Jump to

Keyboard shortcuts

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