wallets

package
v0.0.0-...-5da754f Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWallet

func AddWallet(name string, client *lbrycrd.Client)

AddWallet adds a wallet to the loaded wallets that are to be used by dispendium

func GetBalances

func GetBalances() ([]dispendiumapi.BalanceResult, error)

GetBalances retrieves the balances for all wallet instances used by dispendium

func GetCainParams

func GetCainParams() *chaincfg.Params

GetCainParams retreives the chain params set on initialization

func RemoveWallet

func RemoveWallet(w *Wallet)

RemoveWallet removes a wallet from rotation!

func SetChainParams

func SetChainParams(params *chaincfg.Params)

SetChainParams sets the chain paramters used by dispendium for validating addresses and making calls to lbrycrd instances

Types

type Wallet

type Wallet struct {
	*lbrycrd.Client
	Name string
}

Wallet an instance of a wallet that can be used by dispendium, equivalent to a lbrycrd instance running

func ChooseWallet

func ChooseWallet() (*Wallet, error)

ChooseWallet is currently a round robin

func (*Wallet) Send

func (c *Wallet) Send(address btcutil.Address, amount btcutil.Amount) (*chainhash.Hash, error)

Send overrides the SendToAddress of the client to handle extra logic before the call.

type WalletAccount

type WalletAccount struct {
	Name      string   `json:"name"`
	Addresses []string `json:"addresses"`
}

WalletAccount accounts used by a wallet lbrycrd instance. It holds the available addresses for sending to dispendium

func GetAddresses

func GetAddresses() ([]WalletAccount, error)

GetAddresses returns the set of addresses in use for each wallet lbrycrd instance loaded into dispendium

Jump to

Keyboard shortcuts

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