funder

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: BSD-3-Clause Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedFunding                = errors.New("failed funding")
	ErrFailedFundingWithSwarmToken  = errors.New("failed funding with swarm token")
	ErrFailedFundingWithNativeToken = errors.New("failed funding with native token")
)

Functions

func Fund

func Fund(
	ctx context.Context,
	cfg Config,
	nl NodeLister,
	fundingWallet *wallet.Wallet,
	options ...FunderOptions,
) error

func Stake added in v0.0.2

func Stake(ctx context.Context, cfg Config, nl NodeLister, options ...FunderOptions) error

Types

type Config

type Config struct {
	Namespace         string
	Addresses         []string
	ChainNodeEndpoint string
	WalletKey         string // Hex encoded key
	MinAmounts        MinAmounts
}

type FunderOptions added in v0.1.0

type FunderOptions func(*Options)

func WithLoggerOption added in v0.1.0

func WithLoggerOption(log logging.Logger) FunderOptions

WithLoggerOption sets the logger to be used by the funder

func WithWalletOptions added in v0.4.0

func WithWalletOptions(opts ...wallet.Option) FunderOptions

WithWalletOptions sets options for the wallet the funder creates. They are ignored when a wallet is passed to Fund.

type MinAmounts

type MinAmounts struct {
	NativeCoin float64 // on mainnet this is xDAI
	SwarmToken float64 // on mainnet this is xBZZ
}

type NamespaceNodes

type NamespaceNodes struct {
	Name        string
	NodeWallets []WalletInfo
}

type NodeInfo

type NodeInfo struct {
	Name    string
	Address string
}

type NodeLister

type NodeLister interface {
	List(ctx context.Context, namespace string) ([]NodeInfo, error)
}

type Options added in v0.1.0

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

Options represents funder options

func DefaultOptions added in v0.1.0

func DefaultOptions() *Options

DefaultOptions returns default options

type WalletInfo

type WalletInfo struct {
	Name    string
	Address string
	ChainID int64
}

func NewWalletInfo added in v0.2.2

func NewWalletInfo(name, address string, chainID int64) WalletInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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