invoicesrpc

package
v0.18.5-beta.rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 45 Imported by: 0

Documentation

Overview

Package invoicesrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// DefaultInvoiceExpiry is the default invoice expiry for new MPP
	// invoices.
	DefaultInvoiceExpiry = 24 * time.Hour

	// DefaultAMPInvoiceExpiry is the default invoice expiry for new AMP
	// invoices.
	DefaultAMPInvoiceExpiry = 30 * 24 * time.Hour
)

Variables

View Source
var (
	LookupModifier_name = map[int32]string{
		0: "DEFAULT",
		1: "HTLC_SET_ONLY",
		2: "HTLC_SET_BLANK",
	}
	LookupModifier_value = map[string]int32{
		"DEFAULT":        0,
		"HTLC_SET_ONLY":  1,
		"HTLC_SET_BLANK": 2,
	}
)

Enum value maps for LookupModifier.

View Source
var File_invoicesrpc_invoices_proto protoreflect.FileDescriptor
View Source
var Invoices_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "invoicesrpc.Invoices",
	HandlerType: (*InvoicesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CancelInvoice",
			Handler:    _Invoices_CancelInvoice_Handler,
		},
		{
			MethodName: "AddHoldInvoice",
			Handler:    _Invoices_AddHoldInvoice_Handler,
		},
		{
			MethodName: "SettleInvoice",
			Handler:    _Invoices_SettleInvoice_Handler,
		},
		{
			MethodName: "LookupInvoiceV2",
			Handler:    _Invoices_LookupInvoiceV2_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribeSingleInvoice",
			Handler:       _Invoices_SubscribeSingleInvoice_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "HtlcModifier",
			Handler:       _Invoices_HtlcModifier_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "invoicesrpc/invoices.proto",
}

Invoices_ServiceDesc is the grpc.ServiceDesc for Invoices service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func AddInvoice

func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
	invoice *AddInvoiceData) (*lntypes.Hash, *invoices.Invoice, error)

AddInvoice attempts to add a new invoice to the invoice database. Any duplicated invoices are rejected, therefore all invoices *must* have a unique payment preimage.

func CreateRPCBlindedPayments

func CreateRPCBlindedPayments(blindedPaths []*zpay32.BlindedPaymentPath) (
	[]*lnrpc.BlindedPaymentPath, error)

CreateRPCBlindedPayments takes a set of zpay32.BlindedPaymentPath and converts them into a set of lnrpc.BlindedPaymentPaths.

func CreateRPCFeatures

func CreateRPCFeatures(fv *lnwire.FeatureVector) map[uint32]*lnrpc.Feature

CreateRPCFeatures maps a feature vector into a list of lnrpc.Features.

func CreateRPCInvoice

func CreateRPCInvoice(invoice *invoices.Invoice,
	activeNetParams *chaincfg.Params) (*lnrpc.Invoice, error)

CreateRPCInvoice creates an *lnrpc.Invoice from the *invoices.Invoice.

func CreateRPCRouteHints

func CreateRPCRouteHints(routeHints [][]zpay32.HopHint) []*lnrpc.RouteHint

CreateRPCRouteHints takes in the decoded form of an invoice's route hints and converts them into the lnrpc type.

func CreateZpay32HopHints

func CreateZpay32HopHints(routeHints []*lnrpc.RouteHint) ([][]zpay32.HopHint, error)

CreateZpay32HopHints takes in the lnrpc form of route hints and converts them into an invoice decoded form.

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by by default until UseLogger is called.

func PopulateHopHints

func PopulateHopHints(cfg *SelectHopHintsCfg, amtMSat lnwire.MilliSatoshi,
	forcedHints [][]zpay32.HopHint) ([][]zpay32.HopHint, error)

PopulateHopHints will select up to cfg.MaxHophints from the current open channels. The set of hop hints will be returned as a slice of functional options that'll append the route hint to the set of all route hints.

TODO(roasbeef): do proper sub-set sum max hints usually << numChans.

func RegisterInvoicesHandler

func RegisterInvoicesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterInvoicesHandler registers the http handlers for service Invoices to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterInvoicesHandlerClient

func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InvoicesClient) error

RegisterInvoicesHandlerClient registers the http handlers for service Invoices to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InvoicesClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InvoicesClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "InvoicesClient" to call the correct interceptors.

func RegisterInvoicesHandlerFromEndpoint

func RegisterInvoicesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterInvoicesHandlerFromEndpoint is same as RegisterInvoicesHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterInvoicesHandlerServer

func RegisterInvoicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InvoicesServer) error

RegisterInvoicesHandlerServer registers the http handlers for service Invoices to "mux". UnaryRPC :call InvoicesServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInvoicesHandlerFromEndpoint instead.

func RegisterInvoicesJSONCallbacks

func RegisterInvoicesJSONCallbacks(registry map[string]func(ctx context.Context,
	conn *grpc.ClientConn, reqJSON string, callback func(string, error)))

func RegisterInvoicesServer

func RegisterInvoicesServer(s grpc.ServiceRegistrar, srv InvoicesServer)

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type AddHoldInvoiceRequest

type AddHoldInvoiceRequest struct {

	// An optional memo to attach along with the invoice. Used for record keeping
	// purposes for the invoice's creator, and will also be set in the description
	// field of the encoded payment request if the description_hash field is not
	// being used.
	Memo string `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"`
	// The hash of the preimage
	Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// The value of this invoice in satoshis
	//
	// The fields value and value_msat are mutually exclusive.
	Value int64 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"`
	// The value of this invoice in millisatoshis
	//
	// The fields value and value_msat are mutually exclusive.
	ValueMsat int64 `protobuf:"varint,10,opt,name=value_msat,json=valueMsat,proto3" json:"value_msat,omitempty"`
	// Hash (SHA-256) of a description of the payment. Used if the description of
	// payment (memo) is too long to naturally fit within the description field
	// of an encoded payment request.
	DescriptionHash []byte `protobuf:"bytes,4,opt,name=description_hash,json=descriptionHash,proto3" json:"description_hash,omitempty"`
	// Payment request expiry time in seconds. Default is 86400 (24 hours).
	Expiry int64 `protobuf:"varint,5,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// Fallback on-chain address.
	FallbackAddr string `protobuf:"bytes,6,opt,name=fallback_addr,json=fallbackAddr,proto3" json:"fallback_addr,omitempty"`
	// Delta to use for the time-lock of the CLTV extended to the final hop.
	CltvExpiry uint64 `protobuf:"varint,7,opt,name=cltv_expiry,json=cltvExpiry,proto3" json:"cltv_expiry,omitempty"`
	// Route hints that can each be individually used to assist in reaching the
	// invoice's destination.
	RouteHints []*lnrpc.RouteHint `protobuf:"bytes,8,rep,name=route_hints,json=routeHints,proto3" json:"route_hints,omitempty"`
	// Whether this invoice should include routing hints for private channels.
	Private bool `protobuf:"varint,9,opt,name=private,proto3" json:"private,omitempty"`
	// contains filtered or unexported fields
}

func (*AddHoldInvoiceRequest) Descriptor deprecated

func (*AddHoldInvoiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddHoldInvoiceRequest.ProtoReflect.Descriptor instead.

func (*AddHoldInvoiceRequest) GetCltvExpiry

func (x *AddHoldInvoiceRequest) GetCltvExpiry() uint64

func (*AddHoldInvoiceRequest) GetDescriptionHash

func (x *AddHoldInvoiceRequest) GetDescriptionHash() []byte

func (*AddHoldInvoiceRequest) GetExpiry

func (x *AddHoldInvoiceRequest) GetExpiry() int64

func (*AddHoldInvoiceRequest) GetFallbackAddr

func (x *AddHoldInvoiceRequest) GetFallbackAddr() string

func (*AddHoldInvoiceRequest) GetHash

func (x *AddHoldInvoiceRequest) GetHash() []byte

func (*AddHoldInvoiceRequest) GetMemo

func (x *AddHoldInvoiceRequest) GetMemo() string

func (*AddHoldInvoiceRequest) GetPrivate

func (x *AddHoldInvoiceRequest) GetPrivate() bool

func (*AddHoldInvoiceRequest) GetRouteHints

func (x *AddHoldInvoiceRequest) GetRouteHints() []*lnrpc.RouteHint

func (*AddHoldInvoiceRequest) GetValue

func (x *AddHoldInvoiceRequest) GetValue() int64

func (*AddHoldInvoiceRequest) GetValueMsat

func (x *AddHoldInvoiceRequest) GetValueMsat() int64

func (*AddHoldInvoiceRequest) ProtoMessage

func (*AddHoldInvoiceRequest) ProtoMessage()

func (*AddHoldInvoiceRequest) ProtoReflect

func (x *AddHoldInvoiceRequest) ProtoReflect() protoreflect.Message

func (*AddHoldInvoiceRequest) Reset

func (x *AddHoldInvoiceRequest) Reset()

func (*AddHoldInvoiceRequest) String

func (x *AddHoldInvoiceRequest) String() string

type AddHoldInvoiceResp

type AddHoldInvoiceResp struct {

	// A bare-bones invoice for a payment within the Lightning Network. With the
	// details of the invoice, the sender has all the data necessary to send a
	// payment to the recipient.
	PaymentRequest string `protobuf:"bytes,1,opt,name=payment_request,json=paymentRequest,proto3" json:"payment_request,omitempty"`
	// The "add" index of this invoice. Each newly created invoice will increment
	// this index making it monotonically increasing. Callers to the
	// SubscribeInvoices call can use this to instantly get notified of all added
	// invoices with an add_index greater than this one.
	AddIndex uint64 `protobuf:"varint,2,opt,name=add_index,json=addIndex,proto3" json:"add_index,omitempty"`
	// The payment address of the generated invoice. This is also called
	// the payment secret in specifications (e.g. BOLT 11). This value should
	// be used in all payments for this invoice as we require it for end to end
	// security.
	PaymentAddr []byte `protobuf:"bytes,3,opt,name=payment_addr,json=paymentAddr,proto3" json:"payment_addr,omitempty"`
	// contains filtered or unexported fields
}

func (*AddHoldInvoiceResp) Descriptor deprecated

func (*AddHoldInvoiceResp) Descriptor() ([]byte, []int)

Deprecated: Use AddHoldInvoiceResp.ProtoReflect.Descriptor instead.

func (*AddHoldInvoiceResp) GetAddIndex

func (x *AddHoldInvoiceResp) GetAddIndex() uint64

func (*AddHoldInvoiceResp) GetPaymentAddr

func (x *AddHoldInvoiceResp) GetPaymentAddr() []byte

func (*AddHoldInvoiceResp) GetPaymentRequest

func (x *AddHoldInvoiceResp) GetPaymentRequest() string

func (*AddHoldInvoiceResp) ProtoMessage

func (*AddHoldInvoiceResp) ProtoMessage()

func (*AddHoldInvoiceResp) ProtoReflect

func (x *AddHoldInvoiceResp) ProtoReflect() protoreflect.Message

func (*AddHoldInvoiceResp) Reset

func (x *AddHoldInvoiceResp) Reset()

func (*AddHoldInvoiceResp) String

func (x *AddHoldInvoiceResp) String() string

type AddInvoiceConfig

type AddInvoiceConfig struct {
	// AddInvoice is called to add the invoice to the registry.
	AddInvoice func(ctx context.Context, invoice *invoices.Invoice,
		paymentHash lntypes.Hash) (uint64, error)

	// IsChannelActive is used to generate valid hop hints.
	IsChannelActive func(chanID lnwire.ChannelID) bool

	// ChainParams are required to properly decode invoice payment requests
	// that are marshalled over rpc.
	ChainParams *chaincfg.Params

	// NodeSigner is an implementation of the MessageSigner implementation
	// that's backed by the identity private key of the running lnd node.
	NodeSigner *netann.NodeSigner

	// DefaultCLTVExpiry is the default invoice expiry if no values is
	// specified.
	DefaultCLTVExpiry uint32

	// ChanDB is a global boltdb instance which is needed to access the
	// channel graph.
	ChanDB *channeldb.ChannelStateDB

	// Graph holds a reference to the ChannelGraph database.
	Graph *channeldb.ChannelGraph

	// GenInvoiceFeatures returns a feature containing feature bits that
	// should be advertised on freshly generated invoices.
	GenInvoiceFeatures func() *lnwire.FeatureVector

	// GenAmpInvoiceFeatures returns a feature containing feature bits that
	// should be advertised on freshly generated AMP invoices.
	GenAmpInvoiceFeatures func() *lnwire.FeatureVector

	// GetAlias allows the peer's alias SCID to be retrieved for private
	// option_scid_alias channels.
	GetAlias func(lnwire.ChannelID) (lnwire.ShortChannelID, error)

	// BestHeight returns the current best block height that this node is
	// aware of.
	BestHeight func() (uint32, error)

	// QueryBlindedRoutes can be used to generate a few routes to this node
	// that can then be used in the construction of a blinded payment path.
	QueryBlindedRoutes func(lnwire.MilliSatoshi) ([]*route.Route, error)
}

AddInvoiceConfig contains dependencies for invoice creation.

type AddInvoiceData

type AddInvoiceData struct {
	// An optional memo to attach along with the invoice. Used for record
	// keeping purposes for the invoice's creator, and will also be set in
	// the description field of the encoded payment request if the
	// description_hash field is not being used.
	Memo string

	// The preimage which will allow settling an incoming HTLC payable to
	// this preimage. If Preimage is set, Hash should be nil. If both
	// Preimage and Hash are nil, a random preimage is generated.
	Preimage *lntypes.Preimage

	// The hash of the preimage. If Hash is set, Preimage should be nil.
	// This condition indicates that we have a 'hold invoice' for which the
	// htlc will be accepted and held until the preimage becomes known.
	Hash *lntypes.Hash

	// The value of this invoice in millisatoshis.
	Value lnwire.MilliSatoshi

	// Hash (SHA-256) of a description of the payment. Used if the
	// description of payment (memo) is too long to naturally fit within the
	// description field of an encoded payment request.
	DescriptionHash []byte

	// Payment request expiry time in seconds. Default is 3600 (1 hour).
	Expiry int64

	// Fallback on-chain address.
	FallbackAddr string

	// Delta to use for the time-lock of the CLTV extended to the final hop.
	CltvExpiry uint64

	// Whether this invoice should include routing hints for private
	// channels.
	Private bool

	// HodlInvoice signals that this invoice shouldn't be settled
	// immediately upon receiving the payment.
	HodlInvoice bool

	// Amp signals whether or not to create an AMP invoice.
	//
	// NOTE: Preimage should always be set to nil when this value is true.
	Amp bool

	// BlindedPathCfg holds the config values to use when constructing
	// blinded paths to add to the invoice. A non-nil BlindedPathCfg signals
	// that this invoice should disguise the location of the recipient by
	// adding blinded payment paths to the invoice instead of revealing the
	// destination node's real pub key.
	BlindedPathCfg *BlindedPathConfig

	// RouteHints are optional route hints that can each be individually
	// used to assist in reaching the invoice's destination.
	RouteHints [][]zpay32.HopHint
}

AddInvoiceData contains the required data to create a new invoice.

type BlindedPathConfig

type BlindedPathConfig struct {
	// RoutePolicyIncrMultiplier is the amount by which policy values for
	// hops in a blinded route will be bumped to avoid easy probing. For
	// example, a multiplier of 1.1 will bump all appropriate the values
	// (base fee, fee rate, CLTV delta and min HLTC) by 10%.
	RoutePolicyIncrMultiplier float64

	// RoutePolicyDecrMultiplier is the amount by which appropriate policy
	// values for hops in a blinded route will be decreased to avoid easy
	// probing. For example, a multiplier of 0.9 will reduce appropriate
	// values (like maximum HTLC) by 10%.
	RoutePolicyDecrMultiplier float64

	// MinNumPathHops is the minimum number of hops that a blinded path
	// should be. Dummy hops will be used to pad any route with a length
	// less than this.
	MinNumPathHops uint8

	// DefaultDummyHopPolicy holds the default policy values to use for
	// dummy hops in a blinded path in the case where they cant be derived
	// through other means.
	DefaultDummyHopPolicy *blindedpath.BlindedHopPolicy
}

BlindedPathConfig holds the configuration values required for blinded path generation for invoices.

type CancelInvoiceMsg

type CancelInvoiceMsg struct {

	// Hash corresponding to the (hold) invoice to cancel. When using
	// REST, this field must be encoded as base64.
	PaymentHash []byte `protobuf:"bytes,1,opt,name=payment_hash,json=paymentHash,proto3" json:"payment_hash,omitempty"`
	// contains filtered or unexported fields
}

func (*CancelInvoiceMsg) Descriptor deprecated

func (*CancelInvoiceMsg) Descriptor() ([]byte, []int)

Deprecated: Use CancelInvoiceMsg.ProtoReflect.Descriptor instead.

func (*CancelInvoiceMsg) GetPaymentHash

func (x *CancelInvoiceMsg) GetPaymentHash() []byte

func (*CancelInvoiceMsg) ProtoMessage

func (*CancelInvoiceMsg) ProtoMessage()

func (*CancelInvoiceMsg) ProtoReflect

func (x *CancelInvoiceMsg) ProtoReflect() protoreflect.Message

func (*CancelInvoiceMsg) Reset

func (x *CancelInvoiceMsg) Reset()

func (*CancelInvoiceMsg) String

func (x *CancelInvoiceMsg) String() string

type CancelInvoiceResp

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

func (*CancelInvoiceResp) Descriptor deprecated

func (*CancelInvoiceResp) Descriptor() ([]byte, []int)

Deprecated: Use CancelInvoiceResp.ProtoReflect.Descriptor instead.

func (*CancelInvoiceResp) ProtoMessage

func (*CancelInvoiceResp) ProtoMessage()

func (*CancelInvoiceResp) ProtoReflect

func (x *CancelInvoiceResp) ProtoReflect() protoreflect.Message

func (*CancelInvoiceResp) Reset

func (x *CancelInvoiceResp) Reset()

func (*CancelInvoiceResp) String

func (x *CancelInvoiceResp) String() string

type CircuitKey

type CircuitKey struct {

	// The id of the channel that the is part of this circuit.
	ChanId uint64 `protobuf:"varint,1,opt,name=chan_id,json=chanId,proto3" json:"chan_id,omitempty"`
	// The index of the incoming htlc in the incoming channel.
	HtlcId uint64 `protobuf:"varint,2,opt,name=htlc_id,json=htlcId,proto3" json:"htlc_id,omitempty"`
	// contains filtered or unexported fields
}

CircuitKey is a unique identifier for an HTLC.

func (*CircuitKey) Descriptor deprecated

func (*CircuitKey) Descriptor() ([]byte, []int)

Deprecated: Use CircuitKey.ProtoReflect.Descriptor instead.

func (*CircuitKey) GetChanId

func (x *CircuitKey) GetChanId() uint64

func (*CircuitKey) GetHtlcId

func (x *CircuitKey) GetHtlcId() uint64

func (*CircuitKey) ProtoMessage

func (*CircuitKey) ProtoMessage()

func (*CircuitKey) ProtoReflect

func (x *CircuitKey) ProtoReflect() protoreflect.Message

func (*CircuitKey) Reset

func (x *CircuitKey) Reset()

func (*CircuitKey) String

func (x *CircuitKey) String() string

type Config

type Config struct{}

Config is empty for non-invoicesrpc builds.

type HopHintInfo

type HopHintInfo struct {
	// IsPublic indicates whether a channel is advertised to the network.
	IsPublic bool

	// IsActive indicates whether the channel is online and available for
	// use.
	IsActive bool

	// FundingOutpoint is the funding txid:index for the channel.
	FundingOutpoint wire.OutPoint

	// RemotePubkey is the public key of the remote party that this channel
	// is in.
	RemotePubkey *btcec.PublicKey

	// RemoteBalance is the remote party's balance (our current incoming
	// capacity).
	RemoteBalance lnwire.MilliSatoshi

	// ShortChannelID is the short channel ID of the channel.
	ShortChannelID uint64

	// ConfirmedScidZC is the confirmed SCID of a zero-conf channel. This
	// may be used for looking up a channel in the graph.
	ConfirmedScidZC uint64

	// ScidAliasFeature denotes whether the channel has negotiated the
	// option-scid-alias feature bit.
	ScidAliasFeature bool
}

HopHintInfo contains the channel information required to create a hop hint.

type HtlcModifyRequest

type HtlcModifyRequest struct {

	// The invoice the intercepted HTLC is attempting to settle. The HTLCs in
	// the invoice are only HTLCs that have already been accepted or settled,
	// not including the current intercepted HTLC.
	Invoice *lnrpc.Invoice `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"`
	// The unique identifier of the HTLC of this intercepted HTLC.
	ExitHtlcCircuitKey *CircuitKey `protobuf:"bytes,2,opt,name=exit_htlc_circuit_key,json=exitHtlcCircuitKey,proto3" json:"exit_htlc_circuit_key,omitempty"`
	// The amount in milli-satoshi that the exit HTLC is attempting to pay.
	ExitHtlcAmt uint64 `protobuf:"varint,3,opt,name=exit_htlc_amt,json=exitHtlcAmt,proto3" json:"exit_htlc_amt,omitempty"`
	// The absolute expiry height of the exit HTLC.
	ExitHtlcExpiry uint32 `protobuf:"varint,4,opt,name=exit_htlc_expiry,json=exitHtlcExpiry,proto3" json:"exit_htlc_expiry,omitempty"`
	// The current block height.
	CurrentHeight uint32 `protobuf:"varint,5,opt,name=current_height,json=currentHeight,proto3" json:"current_height,omitempty"`
	// The wire message custom records of the exit HTLC.
	ExitHtlcWireCustomRecords map[uint64][]byte `` /* 231-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*HtlcModifyRequest) Descriptor deprecated

func (*HtlcModifyRequest) Descriptor() ([]byte, []int)

Deprecated: Use HtlcModifyRequest.ProtoReflect.Descriptor instead.

func (*HtlcModifyRequest) GetCurrentHeight

func (x *HtlcModifyRequest) GetCurrentHeight() uint32

func (*HtlcModifyRequest) GetExitHtlcAmt

func (x *HtlcModifyRequest) GetExitHtlcAmt() uint64

func (*HtlcModifyRequest) GetExitHtlcCircuitKey

func (x *HtlcModifyRequest) GetExitHtlcCircuitKey() *CircuitKey

func (*HtlcModifyRequest) GetExitHtlcExpiry

func (x *HtlcModifyRequest) GetExitHtlcExpiry() uint32

func (*HtlcModifyRequest) GetExitHtlcWireCustomRecords

func (x *HtlcModifyRequest) GetExitHtlcWireCustomRecords() map[uint64][]byte

func (*HtlcModifyRequest) GetInvoice

func (x *HtlcModifyRequest) GetInvoice() *lnrpc.Invoice

func (*HtlcModifyRequest) ProtoMessage

func (*HtlcModifyRequest) ProtoMessage()

func (*HtlcModifyRequest) ProtoReflect

func (x *HtlcModifyRequest) ProtoReflect() protoreflect.Message

func (*HtlcModifyRequest) Reset

func (x *HtlcModifyRequest) Reset()

func (*HtlcModifyRequest) String

func (x *HtlcModifyRequest) String() string

type HtlcModifyResponse

type HtlcModifyResponse struct {

	// The circuit key of the HTLC that the client wants to modify.
	CircuitKey *CircuitKey `protobuf:"bytes,1,opt,name=circuit_key,json=circuitKey,proto3" json:"circuit_key,omitempty"`
	// The modified amount in milli-satoshi that the exit HTLC is paying. This
	// value can be different from the actual on-chain HTLC amount, in case the
	// HTLC carries other valuable items, as can be the case with custom channel
	// types.
	AmtPaid *uint64 `protobuf:"varint,2,opt,name=amt_paid,json=amtPaid,proto3,oneof" json:"amt_paid,omitempty"`
	// This flag indicates whether the HTLCs associated with the invoices should
	// be cancelled. The interceptor client may set this field if some
	// unexpected behavior is encountered. Setting this will ignore the amt_paid
	// field.
	CancelSet bool `protobuf:"varint,3,opt,name=cancel_set,json=cancelSet,proto3" json:"cancel_set,omitempty"`
	// contains filtered or unexported fields
}

func (*HtlcModifyResponse) Descriptor deprecated

func (*HtlcModifyResponse) Descriptor() ([]byte, []int)

Deprecated: Use HtlcModifyResponse.ProtoReflect.Descriptor instead.

func (*HtlcModifyResponse) GetAmtPaid

func (x *HtlcModifyResponse) GetAmtPaid() uint64

func (*HtlcModifyResponse) GetCancelSet

func (x *HtlcModifyResponse) GetCancelSet() bool

func (*HtlcModifyResponse) GetCircuitKey

func (x *HtlcModifyResponse) GetCircuitKey() *CircuitKey

func (*HtlcModifyResponse) ProtoMessage

func (*HtlcModifyResponse) ProtoMessage()

func (*HtlcModifyResponse) ProtoReflect

func (x *HtlcModifyResponse) ProtoReflect() protoreflect.Message

func (*HtlcModifyResponse) Reset

func (x *HtlcModifyResponse) Reset()

func (*HtlcModifyResponse) String

func (x *HtlcModifyResponse) String() string

type InvoicesClient

type InvoicesClient interface {
	// SubscribeSingleInvoice returns a uni-directional stream (server -> client)
	// to notify the client of state transitions of the specified invoice.
	// Initially the current invoice state is always sent out.
	SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error)
	// lncli: `cancelinvoice`
	// CancelInvoice cancels a currently open invoice. If the invoice is already
	// canceled, this call will succeed. If the invoice is already settled, it will
	// fail.
	CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error)
	// lncli: `addholdinvoice`
	// AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
	// supplied in the request.
	AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error)
	// lncli: `settleinvoice`
	// SettleInvoice settles an accepted invoice. If the invoice is already
	// settled, this call will succeed.
	SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error)
	// LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
	// using either its payment hash, payment address, or set ID.
	LookupInvoiceV2(ctx context.Context, in *LookupInvoiceMsg, opts ...grpc.CallOption) (*lnrpc.Invoice, error)
	// HtlcModifier is a bidirectional streaming RPC that allows a client to
	// intercept and modify the HTLCs that attempt to settle the given invoice. The
	// server will send HTLCs of invoices to the client and the client can modify
	// some aspects of the HTLC in order to pass the invoice acceptance tests.
	HtlcModifier(ctx context.Context, opts ...grpc.CallOption) (Invoices_HtlcModifierClient, error)
}

InvoicesClient is the client API for Invoices service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewInvoicesClient

func NewInvoicesClient(cc grpc.ClientConnInterface) InvoicesClient

type InvoicesServer

type InvoicesServer interface {
	// SubscribeSingleInvoice returns a uni-directional stream (server -> client)
	// to notify the client of state transitions of the specified invoice.
	// Initially the current invoice state is always sent out.
	SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error
	// lncli: `cancelinvoice`
	// CancelInvoice cancels a currently open invoice. If the invoice is already
	// canceled, this call will succeed. If the invoice is already settled, it will
	// fail.
	CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error)
	// lncli: `addholdinvoice`
	// AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
	// supplied in the request.
	AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error)
	// lncli: `settleinvoice`
	// SettleInvoice settles an accepted invoice. If the invoice is already
	// settled, this call will succeed.
	SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error)
	// LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
	// using either its payment hash, payment address, or set ID.
	LookupInvoiceV2(context.Context, *LookupInvoiceMsg) (*lnrpc.Invoice, error)
	// HtlcModifier is a bidirectional streaming RPC that allows a client to
	// intercept and modify the HTLCs that attempt to settle the given invoice. The
	// server will send HTLCs of invoices to the client and the client can modify
	// some aspects of the HTLC in order to pass the invoice acceptance tests.
	HtlcModifier(Invoices_HtlcModifierServer) error
	// contains filtered or unexported methods
}

InvoicesServer is the server API for Invoices service. All implementations must embed UnimplementedInvoicesServer for forward compatibility

type Invoices_HtlcModifierClient

type Invoices_HtlcModifierClient interface {
	Send(*HtlcModifyResponse) error
	Recv() (*HtlcModifyRequest, error)
	grpc.ClientStream
}

type Invoices_HtlcModifierServer

type Invoices_HtlcModifierServer interface {
	Send(*HtlcModifyRequest) error
	Recv() (*HtlcModifyResponse, error)
	grpc.ServerStream
}

type Invoices_SubscribeSingleInvoiceClient

type Invoices_SubscribeSingleInvoiceClient interface {
	Recv() (*lnrpc.Invoice, error)
	grpc.ClientStream
}

type Invoices_SubscribeSingleInvoiceServer

type Invoices_SubscribeSingleInvoiceServer interface {
	Send(*lnrpc.Invoice) error
	grpc.ServerStream
}

type LookupInvoiceMsg

type LookupInvoiceMsg struct {

	// Types that are assignable to InvoiceRef:
	//
	//	*LookupInvoiceMsg_PaymentHash
	//	*LookupInvoiceMsg_PaymentAddr
	//	*LookupInvoiceMsg_SetId
	InvoiceRef     isLookupInvoiceMsg_InvoiceRef `protobuf_oneof:"invoice_ref"`
	LookupModifier LookupModifier                `` /* 136-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*LookupInvoiceMsg) Descriptor deprecated

func (*LookupInvoiceMsg) Descriptor() ([]byte, []int)

Deprecated: Use LookupInvoiceMsg.ProtoReflect.Descriptor instead.

func (*LookupInvoiceMsg) GetInvoiceRef

func (m *LookupInvoiceMsg) GetInvoiceRef() isLookupInvoiceMsg_InvoiceRef

func (*LookupInvoiceMsg) GetLookupModifier

func (x *LookupInvoiceMsg) GetLookupModifier() LookupModifier

func (*LookupInvoiceMsg) GetPaymentAddr

func (x *LookupInvoiceMsg) GetPaymentAddr() []byte

func (*LookupInvoiceMsg) GetPaymentHash

func (x *LookupInvoiceMsg) GetPaymentHash() []byte

func (*LookupInvoiceMsg) GetSetId

func (x *LookupInvoiceMsg) GetSetId() []byte

func (*LookupInvoiceMsg) ProtoMessage

func (*LookupInvoiceMsg) ProtoMessage()

func (*LookupInvoiceMsg) ProtoReflect

func (x *LookupInvoiceMsg) ProtoReflect() protoreflect.Message

func (*LookupInvoiceMsg) Reset

func (x *LookupInvoiceMsg) Reset()

func (*LookupInvoiceMsg) String

func (x *LookupInvoiceMsg) String() string

type LookupInvoiceMsg_PaymentAddr

type LookupInvoiceMsg_PaymentAddr struct {
	PaymentAddr []byte `protobuf:"bytes,2,opt,name=payment_addr,json=paymentAddr,proto3,oneof"`
}

type LookupInvoiceMsg_PaymentHash

type LookupInvoiceMsg_PaymentHash struct {
	// When using REST, this field must be encoded as base64.
	PaymentHash []byte `protobuf:"bytes,1,opt,name=payment_hash,json=paymentHash,proto3,oneof"`
}

type LookupInvoiceMsg_SetId

type LookupInvoiceMsg_SetId struct {
	SetId []byte `protobuf:"bytes,3,opt,name=set_id,json=setId,proto3,oneof"`
}

type LookupModifier

type LookupModifier int32
const (
	// The default look up modifier, no look up behavior is changed.
	LookupModifier_DEFAULT LookupModifier = 0
	// Indicates that when a look up is done based on a set_id, then only that set
	// of HTLCs related to that set ID should be returned.
	LookupModifier_HTLC_SET_ONLY LookupModifier = 1
	// Indicates that when a look up is done using a payment_addr, then no HTLCs
	// related to the payment_addr should be returned. This is useful when one
	// wants to be able to obtain the set of associated setIDs with a given
	// invoice, then look up the sub-invoices "projected" by that set ID.
	LookupModifier_HTLC_SET_BLANK LookupModifier = 2
)

func (LookupModifier) Descriptor

func (LookupModifier) Enum

func (x LookupModifier) Enum() *LookupModifier

func (LookupModifier) EnumDescriptor deprecated

func (LookupModifier) EnumDescriptor() ([]byte, []int)

Deprecated: Use LookupModifier.Descriptor instead.

func (LookupModifier) Number

func (LookupModifier) String

func (x LookupModifier) String() string

func (LookupModifier) Type

type SelectHopHintsCfg

type SelectHopHintsCfg struct {
	// IsPublicNode is returns a bool indicating whether the node with the
	// given public key is seen as a public node in the graph from the
	// graph's source node's point of view.
	IsPublicNode func(pubKey [33]byte) (bool, error)

	// FetchChannelEdgesByID attempts to lookup the two directed edges for
	// the channel identified by the channel ID.
	FetchChannelEdgesByID func(chanID uint64) (*models.ChannelEdgeInfo,
		*models.ChannelEdgePolicy, *models.ChannelEdgePolicy,
		error)

	// GetAlias allows the peer's alias SCID to be retrieved for private
	// option_scid_alias channels.
	GetAlias func(lnwire.ChannelID) (lnwire.ShortChannelID, error)

	// FetchAllChannels retrieves all open channels currently stored
	// within the database.
	FetchAllChannels func() ([]*channeldb.OpenChannel, error)

	// IsChannelActive checks whether the channel identified by the provided
	// ChannelID is considered active.
	IsChannelActive func(chanID lnwire.ChannelID) bool

	// MaxHopHints is the maximum number of hop hints we are interested in.
	MaxHopHints int
}

SelectHopHintsCfg contains the dependencies required to obtain hop hints for an invoice.

type SettleInvoiceMsg

type SettleInvoiceMsg struct {

	// Externally discovered pre-image that should be used to settle the hold
	// invoice.
	Preimage []byte `protobuf:"bytes,1,opt,name=preimage,proto3" json:"preimage,omitempty"`
	// contains filtered or unexported fields
}

func (*SettleInvoiceMsg) Descriptor deprecated

func (*SettleInvoiceMsg) Descriptor() ([]byte, []int)

Deprecated: Use SettleInvoiceMsg.ProtoReflect.Descriptor instead.

func (*SettleInvoiceMsg) GetPreimage

func (x *SettleInvoiceMsg) GetPreimage() []byte

func (*SettleInvoiceMsg) ProtoMessage

func (*SettleInvoiceMsg) ProtoMessage()

func (*SettleInvoiceMsg) ProtoReflect

func (x *SettleInvoiceMsg) ProtoReflect() protoreflect.Message

func (*SettleInvoiceMsg) Reset

func (x *SettleInvoiceMsg) Reset()

func (*SettleInvoiceMsg) String

func (x *SettleInvoiceMsg) String() string

type SettleInvoiceResp

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

func (*SettleInvoiceResp) Descriptor deprecated

func (*SettleInvoiceResp) Descriptor() ([]byte, []int)

Deprecated: Use SettleInvoiceResp.ProtoReflect.Descriptor instead.

func (*SettleInvoiceResp) ProtoMessage

func (*SettleInvoiceResp) ProtoMessage()

func (*SettleInvoiceResp) ProtoReflect

func (x *SettleInvoiceResp) ProtoReflect() protoreflect.Message

func (*SettleInvoiceResp) Reset

func (x *SettleInvoiceResp) Reset()

func (*SettleInvoiceResp) String

func (x *SettleInvoiceResp) String() string

type SubscribeSingleInvoiceRequest

type SubscribeSingleInvoiceRequest struct {

	// Hash corresponding to the (hold) invoice to subscribe to. When using
	// REST, this field must be encoded as base64url.
	RHash []byte `protobuf:"bytes,2,opt,name=r_hash,json=rHash,proto3" json:"r_hash,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribeSingleInvoiceRequest) Descriptor deprecated

func (*SubscribeSingleInvoiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use SubscribeSingleInvoiceRequest.ProtoReflect.Descriptor instead.

func (*SubscribeSingleInvoiceRequest) GetRHash

func (x *SubscribeSingleInvoiceRequest) GetRHash() []byte

func (*SubscribeSingleInvoiceRequest) ProtoMessage

func (*SubscribeSingleInvoiceRequest) ProtoMessage()

func (*SubscribeSingleInvoiceRequest) ProtoReflect

func (*SubscribeSingleInvoiceRequest) Reset

func (x *SubscribeSingleInvoiceRequest) Reset()

func (*SubscribeSingleInvoiceRequest) String

type UnimplementedInvoicesServer

type UnimplementedInvoicesServer struct {
}

UnimplementedInvoicesServer must be embedded to have forward compatible implementations.

func (UnimplementedInvoicesServer) AddHoldInvoice

func (UnimplementedInvoicesServer) CancelInvoice

func (UnimplementedInvoicesServer) HtlcModifier

func (UnimplementedInvoicesServer) LookupInvoiceV2

func (UnimplementedInvoicesServer) SettleInvoice

type UnsafeInvoicesServer

type UnsafeInvoicesServer interface {
	// contains filtered or unexported methods
}

UnsafeInvoicesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InvoicesServer will result in compilation errors.

Jump to

Keyboard shortcuts

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