manarefresher

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0, BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Parameters = &ParametersDefinition{}

Parameters contains the configuration used by the manaRefresher plugin.

View Source
var (
	// Plugin is the plugin instance of the manarefresher plugin.
	Plugin *node.Plugin
)

Functions

func DelegatedOutputs

func DelegatedOutputs() (delegated devnetvm.Outputs, err error)

DelegatedOutputs returns all confirmed, unspent outputs that are delegated to the node.

func DelegationAddress

func DelegationAddress() (devnetvm.Address, error)

DelegationAddress returns the current mana delegation address of the node.

func TotalDelegatedFunds

func TotalDelegatedFunds() (amount uint64)

TotalDelegatedFunds returns the amount of funds delegated to the node.

Types

type DelegationReceiver

type DelegationReceiver struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DelegationReceiver checks for delegation outputs on the wallet address and keeps the most recent delegated balance.

func (*DelegationReceiver) Address

func (d *DelegationReceiver) Address() devnetvm.Address

Address returns the receive address of the delegation receiver.

func (*DelegationReceiver) Scan

Scan scans for unspent delegation outputs on the delegation receiver address.

func (*DelegationReceiver) TotalDelegatedFunds

func (d *DelegationReceiver) TotalDelegatedFunds() uint64

TotalDelegatedFunds returns the total amount of funds currently delegated to this node.

type ParametersDefinition added in v0.7.4

type ParametersDefinition struct {
	// RefreshInterval defines the interval for refreshing delegated mana.
	RefreshInterval time.Duration `default:"25m" usage:"interval for refreshing delegated mana (minutes)"`
}

ParametersDefinition contains the definition of the parameters used by the manaRefresher plugin.

type Refresher

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

Refresher is a component that takes care of refreshing the mana delegated to the node.

func NewRefresher

func NewRefresher(wallet *wallet, receiver *DelegationReceiver) *Refresher

NewRefresher creates a new Refresher object.

func (*Refresher) Refresh

func (r *Refresher) Refresh() (err error)

Refresh scans the tangle for delegated outputs, and refreshes the node's mana by moving those.

Jump to

Keyboard shortcuts

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