manarefresher

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0, BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Parameters = struct {
	RefreshInterval uint `default:"25" usage:"interval for refreshing delegated mana (minutes)"`
}{}

Parameters contains the configuration parameters used by the manarefresher plugin.

Functions

func DelegatedOutputs

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

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

func DelegationAddress

func DelegationAddress() (ledgerstate.Address, error)

DelegationAddress returns the current mana delegation address of the node.

func Plugin

func Plugin() *node.Plugin

Plugin gets the plugin instance.

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() ledgerstate.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 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