sendoptions

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 1

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 Context added in v0.9.5

func Context(ctx context.Context) SendFundsOption

Context is an option for SendFunds call that allows to specify a context that is used in case of waiting for transaction acceptance.

func Destination

func Destination(addr address.Address, amount uint64, optionalColor ...devnetvm.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 devnetvm.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 Sources added in v0.9.5

func Sources(addr ...address.Address) SendFundsOption

Sources is an option for the SendFunds call that allows to specify the addresses from which the outputs for the transfer should be sourced.

func UsePendingOutputs added in v0.8.0

func UsePendingOutputs(usePendingOutputs bool) SendFundsOption

UsePendingOutputs defines if we can collect outputs that are still pending confirmation.

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[devnetvm.Color]uint64
	RemainderAddress      address.Address
	LockUntil             time.Time
	FallbackAddress       devnetvm.Address
	FallbackDeadline      time.Time
	AccessManaPledgeID    string
	ConsensusManaPledgeID string
	WaitForConfirmation   bool
	UsePendingOutputs     bool
	SourceAddresses       []address.Address
	Context               context.Context
}

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[devnetvm.Color]uint64

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

Jump to

Keyboard shortcuts

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