deposit

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 10 Imported by: 2

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 ErrMagnetLinkChecksumInvalid = errors.New("magnet-link checksum is invalid")

Functions

This section is empty.

Types

type Conditions

type Conditions struct {
	Request
	Address Hash `json:"address"`
}

Conditions defines a conditional deposit request.

func ParseMagnetLink(s string) (*Conditions, error)

ParseMagnetLink parses the given magnet link URL.

func (dc *Conditions) AsMagnetLink() (string, error)

AsMagnetLink converts the conditions into a magnet link URL.

func (*Conditions) AsTransfer

func (dc *Conditions) AsTransfer() bundle.Transfer

AsTransfer converts the conditions into a transfer object.

func (*Conditions) Checksum

func (dc *Conditions) Checksum() (Trytes, error)

Checksum returns the checksum of the the CDR.

type Request

type Request 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
	// (if the expected amount is set and also fulfilled)
	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 *uint64 `json:"expected_amount,omitempty" bson:"expected_amount,omitempty"`
}

Request defines a new deposit request against the account.

Jump to

Keyboard shortcuts

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