funder

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: BSD-3-Clause Imports: 21 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,
) error

Types

type Config

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

func ParseConfig

func ParseConfig() (Config, error)

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 WalletInfo

type WalletInfo struct {
	Name    string
	Address string
	ChainID int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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