Documentation ¶
Index ¶
- type SendFundsOption
- func AccessManaPledgeID(nodeID string) SendFundsOption
- func ConsensusManaPledgeID(nodeID string) SendFundsOption
- func Context(ctx context.Context) SendFundsOption
- func Destination(addr address.Address, amount uint64, optionalColor ...devnetvm.Color) SendFundsOption
- func Fallback(addy devnetvm.Address, deadline time.Time) SendFundsOption
- func LockUntil(until time.Time) SendFundsOption
- func Remainder(addr address.Address) SendFundsOption
- func Sources(addr ...address.Address) SendFundsOption
- func UsePendingOutputs(usePendingOutputs bool) SendFundsOption
- func WaitForConfirmation(wait bool) SendFundsOption
- type SendFundsOptions
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 ¶
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 ¶
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 ¶
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.