invoicesrpc

package
v0.15.10001 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 39 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,
		},
	},
	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, *channeldb.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 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 *channeldb.Invoice,
	activeNetParams *chaincfg.Params) (*lnrpc.Invoice, error)

CreateRPCInvoice creates an *lnrpc.Invoice from the *channeldb.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 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(invoice *channeldb.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)
}

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

	// 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 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 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 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)
	// 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)
	// 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)
	// 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 refrenced
	// using either its payment hash, payment address, or set ID.
	LookupInvoiceV2(ctx context.Context, in *LookupInvoiceMsg, opts ...grpc.CallOption) (*lnrpc.Invoice, 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
	// 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)
	// AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
	// supplied in the request.
	AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error)
	// 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 refrenced
	// using either its payment hash, payment address, or set ID.
	LookupInvoiceV2(context.Context, *LookupInvoiceMsg) (*lnrpc.Invoice, error)
	// contains filtered or unexported methods
}

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

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) (*channeldb.ChannelEdgeInfo,
		*channeldb.ChannelEdgePolicy, *channeldb.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) 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