sendoptions

package
Version: v0.7.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SendFundsOption

type SendFundsOption func(*SendFundsOptions) error

SendFundsOption is the type for the optional parameters for the SendFunds call.

func AccessManaPledgeID

func AccessManaPledgeID(nodeID string) SendFundsOption

AccessManaPledgeID is an option for SendFunds call that defines the nodeID to pledge access mana to.

func ConsensusManaPledgeID

func ConsensusManaPledgeID(nodeID string) SendFundsOption

ConsensusManaPledgeID is an option for SendFunds call that defines the nodeID to pledge consensus mana to.

func Destination

func Destination(addr address.Address, amount uint64, optionalColor ...ledgerstate.Color) SendFundsOption

Destination is an option for the SendFunds call that defines a destination for funds that are supposed to be moved.

func Fallback

func Fallback(addy ledgerstate.Address, deadline time.Time) SendFundsOption

Fallback defines the parameters for conditional sending: fallback address and fallback deadline. If the output is not spent by the recipient within the fallback deadline, only fallback address is able to unlock it.

func LockUntil

func LockUntil(until time.Time) SendFundsOption

LockUntil is an option for SendFunds call that defines if the created outputs should be locked until a certain time.

func Remainder

func Remainder(addr address.Address) SendFundsOption

Remainder is an option for the SendsFunds call that allows us to specify the remainder address that is supposed to be used in the corresponding transaction.

func WaitForConfirmation

func WaitForConfirmation(wait bool) SendFundsOption

WaitForConfirmation defines if the call should wait for confirmation before it returns.

type SendFundsOptions

type SendFundsOptions struct {
	Destinations          map[address.Address]map[ledgerstate.Color]uint64
	RemainderAddress      address.Address
	LockUntil             time.Time
	FallbackAddress       ledgerstate.Address
	FallbackDeadline      time.Time
	AccessManaPledgeID    string
	ConsensusManaPledgeID string
	WaitForConfirmation   bool
}

SendFundsOptions is a struct that is used to aggregate the optional parameters provided in the SendFunds call.

func Build

func Build(options ...SendFundsOption) (result *SendFundsOptions, err error)

Build is a utility function that constructs the SendFundsOptions.

func (*SendFundsOptions) RequiredFunds

func (s *SendFundsOptions) RequiredFunds() map[ledgerstate.Color]uint64

RequiredFunds derives how much funds are needed based on the Destinations to fund the transfer.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL