record

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AmtOnionType is the type used in the onion to refrence the amount to
	// send to the next hop.
	AmtOnionType tlv.Type = 2

	// LockTimeTLV is the type used in the onion to refenernce the CLTV
	// value that should be used for the next hop's HTLC.
	LockTimeOnionType tlv.Type = 4

	// NextHopOnionType is the type used in the onion to reference the ID
	// of the next hop.
	NextHopOnionType tlv.Type = 6
)
View Source
const AMPOnionType tlv.Type = 10

AMPOnionType is the type used in the onion to reference the AMP fields: root_share, set_id, and child_index.

View Source
const (
	// CustomTypeStart is the start of the custom tlv type range as defined
	// in BOLT 01.
	CustomTypeStart = 65536
)
View Source
const (
	// KeySendType is the custom record identifier for keysend preimages.
	KeySendType uint64 = 5482373484
)
View Source
const MPPOnionType tlv.Type = 8

MPPOnionType is the type used in the onion to reference the MPP fields: total_amt and payment_addr.

Variables

This section is empty.

Functions

func AMPDecoder added in v0.3.0

func AMPDecoder(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

AMPDecoder reads the AMP record from the provided io.Reader.

func AMPEncoder added in v0.3.0

func AMPEncoder(w io.Writer, val interface{}, buf *[8]byte) error

AMPEncoder writes the AMP record to the provided io.Writer.

func MPPDecoder added in v0.3.0

func MPPDecoder(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

MPPDecoder reads the MPP record to the provided io.Reader.

func MPPEncoder added in v0.3.0

func MPPEncoder(w io.Writer, val interface{}, buf *[8]byte) error

MPPEncoder writes the MPP record to the provided io.Writer.

func NewAmtToFwdRecord

func NewAmtToFwdRecord(amt *uint64) tlv.Record

NewAmtToFwdRecord creates a tlv.Record that encodes the amount_to_forward (type 2) for an onion payload.

func NewLockTimeRecord

func NewLockTimeRecord(lockTime *uint32) tlv.Record

NewLockTimeRecord creates a tlv.Record that encodes the outgoing_cltv_value (type 4) for an onion payload.

func NewNextHopIDRecord

func NewNextHopIDRecord(cid *uint64) tlv.Record

NewNextHopIDRecord creates a tlv.Record that encodes the short_channel_id (type 6) for an onion payload.

Types

type AMP added in v0.3.0

type AMP struct {
	// contains filtered or unexported fields
}

AMP is a record that encodes the fields necessary for atomic multi-path payments.

func NewAMP added in v0.3.0

func NewAMP(rootShare, setID [32]byte, childIndex uint16) *AMP

NewAMP generate a new AMP record with the given root_share, set_id, and child_index.

func (*AMP) ChildIndex added in v0.3.0

func (a *AMP) ChildIndex() uint16

ChildIndex returns the child index contained in the AMP record.

func (*AMP) PayloadSize added in v0.3.0

func (a *AMP) PayloadSize() uint64

PayloadSize returns the size this record takes up in encoded form.

func (*AMP) Record added in v0.3.0

func (a *AMP) Record() tlv.Record

Record returns a tlv.Record that can be used to encode or decode this record.

func (*AMP) RootShare added in v0.3.0

func (a *AMP) RootShare() [32]byte

RootShare returns the root share contained in the AMP record.

func (*AMP) SetID added in v0.3.0

func (a *AMP) SetID() [32]byte

SetID returns the set id contained in the AMP record.

func (*AMP) String added in v0.3.0

func (a *AMP) String() string

String returns a human-readble description of the amp payload fields.

type CustomSet added in v0.3.0

type CustomSet map[uint64][]byte

CustomSet stores a set of custom key/value pairs.

func (CustomSet) Validate added in v0.3.0

func (c CustomSet) Validate() error

Validate checks that all custom records are in the custom type range.

type MPP added in v0.3.0

type MPP struct {
	// contains filtered or unexported fields
}

MPP is a record that encodes the fields necessary for multi-path payments.

func NewMPP added in v0.3.0

func NewMPP(total lnwire.MilliAtom, addr [32]byte) *MPP

NewMPP generates a new MPP record with the given total and payment address.

func (*MPP) PayloadSize added in v0.3.0

func (r *MPP) PayloadSize() uint64

PayloadSize returns the size this record takes up in encoded form.

func (*MPP) PaymentAddr added in v0.3.0

func (r *MPP) PaymentAddr() [32]byte

PaymentAddr returns the payment address contained in the MPP record.

func (*MPP) Record added in v0.3.0

func (r *MPP) Record() tlv.Record

Record returns a tlv.Record that can be used to encode or decode this record.

func (*MPP) String added in v0.3.0

func (r *MPP) String() string

String returns a human-readable representation of the mpp payload field.

func (*MPP) TotalMAtoms added in v0.3.0

func (r *MPP) TotalMAtoms() lnwire.MilliAtom

TotalMsat returns the total value of an MPP payment in matoms.

Jump to

Keyboard shortcuts

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