Documentation ¶
Index ¶
- type DelegateFundsOption
- func AccessManaPledgeID(nodeID string) DelegateFundsOption
- func ConsensusManaPledgeID(nodeID string) DelegateFundsOption
- func DelegateUntil(until time.Time) DelegateFundsOption
- func Destination(addr address.Address, balance map[ledgerstate.Color]uint64) DelegateFundsOption
- func Remainder(addr address.Address) DelegateFundsOption
- func WaitForConfirmation(wait bool) DelegateFundsOption
- type DelegateFundsOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DelegateFundsOption ¶
type DelegateFundsOption func(*DelegateFundsOptions) error
DelegateFundsOption is the type for the optional parameters for the DelegateFunds call.
func AccessManaPledgeID ¶
func AccessManaPledgeID(nodeID string) DelegateFundsOption
AccessManaPledgeID is an option for SendFunds call that defines the nodeID to pledge access mana to.
func ConsensusManaPledgeID ¶
func ConsensusManaPledgeID(nodeID string) DelegateFundsOption
ConsensusManaPledgeID is an option for SendFunds call that defines the nodeID to pledge consensus mana to.
func DelegateUntil ¶
func DelegateUntil(until time.Time) DelegateFundsOption
DelegateUntil is an option for the DelegateFunds call that specifies until when the delegation should last.
func Destination ¶
func Destination(addr address.Address, balance map[ledgerstate.Color]uint64) DelegateFundsOption
Destination is an option for the SendFunds call that defines a destination for funds that are supposed to be moved.
func Remainder ¶
func Remainder(addr address.Address) DelegateFundsOption
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) DelegateFundsOption
WaitForConfirmation defines if the call should wait for confirmation before it returns.
type DelegateFundsOptions ¶
type DelegateFundsOptions struct { Destinations map[address.Address]map[ledgerstate.Color]uint64 DelegateUntil time.Time RemainderAddress address.Address AccessManaPledgeID string ConsensusManaPledgeID string WaitForConfirmation bool }
DelegateFundsOptions is a struct that is used to aggregate the optional parameters provided in the DelegateFunds call.
func Build ¶
func Build(options ...DelegateFundsOption) (result *DelegateFundsOptions, err error)
Build is a utility function that constructs the DelegateFundsOptions.
func (*DelegateFundsOptions) RequiredFunds ¶
func (s *DelegateFundsOptions) RequiredFunds() map[ledgerstate.Color]uint64
RequiredFunds derives how much funds are needed based on the Destinations to fund the transfer.