generatechildwallet

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 10 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.",
		Config:      DefaultConfig(),
		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"`
	WalletSeed string `yaml:"walletSeed" json:"walletSeed"`
	RandomSeed bool   `yaml:"randomSeed" json:"randomSeed"`

	PrefundFeeCap     *big.Int `yaml:"prefundFeeCap" json:"prefundFeeCap"`
	PrefundTipCap     *big.Int `yaml:"prefundTipCap" json:"prefundTipCap"`
	PrefundAmount     *big.Int `yaml:"prefundAmount" json:"prefundAmount"`
	PrefundMinBalance *big.Int `yaml:"prefundMinBalance" json:"prefundMinBalance"`

	WalletAddressResultVar    string `yaml:"walletAddressResultVar" json:"walletAddressResultVar"`
	WalletPrivateKeyResultVar string `yaml:"walletPrivateKeyResultVar" json:"walletPrivateKeyResultVar"`
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Task

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

func (*Task) Config

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

func (*Task) Description

func (t *Task) Description() string

func (*Task) Execute

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

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Logger

func (t *Task) Logger() logrus.FieldLogger

func (*Task) Name

func (t *Task) Name() string

func (*Task) Timeout

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

func (*Task) Title

func (t *Task) Title() string

Jump to

Keyboard shortcuts

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