payments

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPaymentsRoutes

func RegisterPaymentsRoutes(r *gin.RouterGroup, db *sqlx.DB)

func SendNewPayment added in v0.7.3

func SendNewPayment(
	wChan chan interface{},
	db *sqlx.DB,
	c *gin.Context,
	npReq NewPaymentRequest,
	reqId string,
) (err error)

SendNewPayment - send new payment A new payment can be made either by providing an invoice or by providing: dest - the identity pubkey of the payment recipient amt(number of satoshi) or amt_msat(number of millisatoshi) amt and amt_msat are mutually exclusive payments hash - the hash to use within the payment's HTLC timeout seconds is mandatory

Types

type ErrPaymentNotFound

type ErrPaymentNotFound struct {
	Identifier string
}

func (ErrPaymentNotFound) Error

func (e ErrPaymentNotFound) Error() string

type Hop

type Hop struct {
	Expiry            uint64 `json:"expiry" db:"expiry"`
	LNDShortChannelId uint64 `json:"chan_id" db:"lnd_short_channel_id"`
	PubKey            string `json:"pub_key" db:"pub_key"`
	FeeMsat           uint64 `json:"fee_msat" db:"fee_msat"`
	TlvPayload        bool   `json:"tlv_payload" db:"tlv_payload"`
	ChanCapacity      uint64 `json:"chan_capacity" db:"chan_capacity"`
	AmtToForwardMsat  uint64 `json:"amt_to_forward_msat" db:"amt_to_forward_msat"`
}

type MppRecord added in v0.7.3

type MppRecord struct {
	PaymentAddr  string
	TotalAmtMsat int64
}

type NewPaymentRequest added in v0.7.3

type NewPaymentRequest struct {
	Invoice          string  `json:"invoice"`
	TimeOutSecs      int32   `json:"timeoutSecs"`
	Dest             *[]byte `json:"dest"`
	AmtMSat          *int64  `json:"amountMsat"`
	FeeLimitMsat     *int64  `json:"feeLimitMsat"`
	AllowSelfPayment *bool   `json:"allowSelfPayment"`
}

type NewPaymentResponse added in v0.7.3

type NewPaymentResponse struct {
	ReqId          string    `json:"reqId"`
	Type           string    `json:"type"`
	Status         string    `json:"status"`
	Hash           string    `json:"hash"`
	Preimage       string    `json:"preimage"`
	PaymentRequest string    `json:"paymentRequest"`
	AmountMsat     int64     `json:"amountMsat"`
	FeeLimitMsat   int64     `json:"feeLimitMsat"`
	CreationDate   time.Time `json:"creationDate"`
	Attempt        attempt   `json:"path"`
}

type Payment

type Payment struct {
	PaymentIndex            uint64    `json:"payment_index" db:"payment_index"`
	Date                    time.Time `json:"date" db:"date"`
	DestinationPubKey       *string   `json:"destination_pub_key" db:"destination_pub_key"`
	Status                  string    `json:"status" db:"status"`
	Value                   float64   `json:"value" db:"value"`
	Fee                     float64   `json:"fee" db:"fee"`
	PPM                     float64   `json:"ppm" db:"ppm"`
	FailureReason           string    `json:"failure_reason" db:"failure_reason"`
	PaymentHash             string    `json:"payment_hash" db:"payment_hash"`
	PaymentPreimage         string    `json:"payment_preimage" db:"payment_preimage"`
	PaymentRequest          *string   `json:"payment_request" db:"payment_request"`
	IsRebalance             *bool     `json:"is_rebalance" db:"is_rebalance"`
	IsMPP                   bool      `json:"is_mpp" db:"is_mpp"`
	CountSuccessfulAttempts int       `json:"count_successful_attempts" db:"count_successful_attempts"`
	CountFailedAttempts     int       `json:"count_failed_attempts" db:"count_failed_attempts"`
	SecondsInFlight         *float32  `json:"seconds_in_flight" db:"seconds_in_flight"`
}

type PaymentDetails

type PaymentDetails struct {
	Payment
	SuccessfulRoutes []*Route `json:"successful_routes" db:"successful_routes"`
	FailedRoutes     []*Route `json:"failed_routes" db:"failed_routes"`
}

type PaymentDetailsRaw

type PaymentDetailsRaw struct {
	Payment
	SuccessfulRoutes []byte `json:"successful_routes" db:"successful_routes"`
	FailedRoutes     []byte `json:"failed_routes" db:"failed_routes"`
}

type Route

type Route struct {
	Hops          []*Hop `json:"hops" db:"hops"`
	TotalAmt      uint64 `json:"total_amt" db:"total_amt"`
	TotalFees     uint64 `json:"total_fees" db:"total_fees"`
	TotalAmtMsat  uint64 `json:"total_amt_msat" db:"total_amt_msat"`
	TotalFeesMsat uint64 `json:"total_fees_msat" db:"total_fees_msat"`
	TotalTimeLock uint64 `json:"total_time_lock" db:"total_time_lock"`
}

Jump to

Keyboard shortcuts

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