payments

package
v0.13.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 24 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(
	eventChannel 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:"lndShortChannelId" db:"lnd_short_channel_id"`
	PubKey            string `json:"pubKey" db:"pub_key"`
	FeeMsat           uint64 `json:"feeMsat" db:"fee_msat"`
	TlvPayload        bool   `json:"tlvPayload" db:"tlv_payload"`
	ChanCapacity      uint64 `json:"chanCapacity" db:"chan_capacity"`
	AmtToForwardMsat  uint64 `json:"amtToForwardMsat" 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 {
	NodeId           int     `json:"nodeId"`
	Invoice          *string `json:"invoice"`
	TimeOutSecs      int32   `json:"timeoutSecs"`
	Dest             *string `json:"dest"`
	AmtMSat          *int64  `json:"amtMSat"`
	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"`
	FailureReason  string    `json:"failureReason"`
	Hash           string    `json:"hash"`
	Preimage       string    `json:"preimage"`
	PaymentRequest string    `json:"paymentRequest"`
	AmountMsat     int64     `json:"amountMsat"`
	FeeLimitMsat   int64     `json:"feeLimitMsat"`
	FeePaidMsat    int64     `json:"feePaidMsat"`
	CreationDate   time.Time `json:"creationDate"`
	Attempt        attempt   `json:"path"`
}

type Payment

type Payment struct {
	PaymentIndex            uint64    `json:"paymentIndex" db:"payment_index"`
	Date                    time.Time `json:"date" db:"date"`
	DestinationPubKey       *string   `json:"destinationPubKey" 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:"failureReason" db:"failure_reason"`
	PaymentHash             string    `json:"paymentHash" db:"payment_hash"`
	PaymentPreimage         string    `json:"paymentPreimage" db:"payment_preimage"`
	PaymentRequest          *string   `json:"paymentRequest" db:"payment_request"`
	IsRebalance             *bool     `json:"isREebalance" db:"is_rebalance"`
	IsMPP                   bool      `json:"isMpp" db:"is_mpp"`
	CountSuccessfulAttempts int       `json:"countSuccessful_attempts" db:"count_successful_attempts"`
	CountFailedAttempts     int       `json:"countFailedAttempts" db:"count_failed_attempts"`
	SecondsInFlight         *float32  `json:"secondsInFlight" db:"seconds_in_flight"`
}

type PaymentDetails

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

type PaymentDetailsRaw

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

type Route

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

Jump to

Keyboard shortcuts

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