Documentation ¶
Index ¶
Constants ¶
View Source
const ( MagnetLinkTimeoutField = "timeout_at" MagnetLinkMultiUseField = "multi_use" MagnetLinkExpectedAmountField = "expected_amount" MagnetLinkFormat = "iota://%s%s/?%s=%d&%s=%d&%s=%d" )
Defines the names of the condition fields in a magnet link.
Variables ¶
View Source
var ErrAddressInvalid = errors.New("invalid address")
ErrAddressInvalid is returned when an address is invalid when parsed from a serialized form.
View Source
var ErrInvalidDepositAddressOptions = errors.New("invalid address options are invalid")
View Source
var ErrMagnetLinkChecksumInvalid = errors.New("magnet-link checksum is invalid")
Functions ¶
func ValidateConditions ¶
func ValidateConditions(conds *Conditions) error
ValidateConditions validates the deposit conditions.
Types ¶
type CDA ¶
type CDA struct { Conditions Address Hash `json:"address"` }
CDA defines a conditional deposit address.
func ParseMagnetLink ¶
ParseMagnetLink parses the given magnet link URL.
func (*CDA) AsMagnetLink ¶
AsMagnetLink converts the conditions into a magnet link URL.
func (*CDA) AsTransfer ¶
AsTransfer converts the conditional deposit address into a transfer object.
type Conditions ¶
type Conditions struct { // The time after this deposit address becomes invalid. TimeoutAt *time.Time `json:"timeout_at,omitempty" bson:"timeout_at,omitempty"` // Whether to expect multiple deposits to this address in the given timeout. // If this flag is false, the deposit address is considered // in the input selection as soon as one deposit is available. // ExpectedAmount and MultiUse are mutually exclusive: MultiUse must be false if an ExpectedAmount over 0 is set. MultiUse bool `json:"multi_use,omitempty" bson:"multi_use,omitempty"` // The expected amount which gets deposited. // If the timeout is hit, the address is automatically // considered in the input selection. // ExpectedAmount and MultiUse are mutually exclusive: MultiUse must be false if an ExpectedAmount over 0 is set. ExpectedAmount *uint64 `json:"expected_amount,omitempty" bson:"expected_amount,omitempty"` }
Conditions define conditions for a new deposit address generated by an account.
Click to show internal directories.
Click to hide internal directories.