Documentation ¶
Overview ¶
Package invoicesrpc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig, invoice *AddInvoiceData) (*lntypes.Hash, *channeldb.Invoice, error)
- func CreateRPCFeatures(fv *lnwire.FeatureVector) map[uint32]*lnrpc.Feature
- func CreateRPCInvoice(invoice *channeldb.Invoice, activeNetParams *chaincfg.Params) (*lnrpc.Invoice, error)
- func CreateRPCRouteHints(routeHints [][]zpay32.HopHint) []*lnrpc.RouteHint
- func CreateZpay32HopHints(routeHints []*lnrpc.RouteHint) ([][]zpay32.HopHint, error)
- func DisableLog()
- func RegisterInvoicesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterInvoicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InvoicesClient) error
- func RegisterInvoicesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterInvoicesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InvoicesServer) error
- func RegisterInvoicesServer(s grpc.ServiceRegistrar, srv InvoicesServer)
- func SelectHopHints(amtMSat lnwire.MilliSatoshi, cfg *AddInvoiceConfig, ...) []func(*zpay32.Invoice)
- func UseLogger(logger bronlog.Logger)
- type AddHoldInvoiceRequest
- func (*AddHoldInvoiceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddHoldInvoiceRequest) GetCltvExpiry() uint64
- func (x *AddHoldInvoiceRequest) GetDescriptionHash() []byte
- func (x *AddHoldInvoiceRequest) GetExpiry() int64
- func (x *AddHoldInvoiceRequest) GetFallbackAddr() string
- func (x *AddHoldInvoiceRequest) GetHash() []byte
- func (x *AddHoldInvoiceRequest) GetMemo() string
- func (x *AddHoldInvoiceRequest) GetPrivate() bool
- func (x *AddHoldInvoiceRequest) GetRouteHints() []*lnrpc.RouteHint
- func (x *AddHoldInvoiceRequest) GetValue() int64
- func (x *AddHoldInvoiceRequest) GetValueMsat() int64
- func (*AddHoldInvoiceRequest) ProtoMessage()
- func (x *AddHoldInvoiceRequest) ProtoReflect() protoreflect.Message
- func (x *AddHoldInvoiceRequest) Reset()
- func (x *AddHoldInvoiceRequest) String() string
- type AddHoldInvoiceResp
- func (*AddHoldInvoiceResp) Descriptor() ([]byte, []int)deprecated
- func (x *AddHoldInvoiceResp) GetAddIndex() uint64
- func (x *AddHoldInvoiceResp) GetPaymentAddr() []byte
- func (x *AddHoldInvoiceResp) GetPaymentRequest() string
- func (*AddHoldInvoiceResp) ProtoMessage()
- func (x *AddHoldInvoiceResp) ProtoReflect() protoreflect.Message
- func (x *AddHoldInvoiceResp) Reset()
- func (x *AddHoldInvoiceResp) String() string
- type AddInvoiceConfig
- type AddInvoiceData
- type CancelInvoiceMsg
- type CancelInvoiceResp
- type Config
- type InvoicesClient
- type InvoicesServer
- type Invoices_SubscribeSingleInvoiceClient
- type Invoices_SubscribeSingleInvoiceServer
- type LookupInvoiceMsg
- func (*LookupInvoiceMsg) Descriptor() ([]byte, []int)deprecated
- func (m *LookupInvoiceMsg) GetInvoiceRef() isLookupInvoiceMsg_InvoiceRef
- func (x *LookupInvoiceMsg) GetLookupModifier() LookupModifier
- func (x *LookupInvoiceMsg) GetPaymentAddr() []byte
- func (x *LookupInvoiceMsg) GetPaymentHash() []byte
- func (x *LookupInvoiceMsg) GetSetId() []byte
- func (*LookupInvoiceMsg) ProtoMessage()
- func (x *LookupInvoiceMsg) ProtoReflect() protoreflect.Message
- func (x *LookupInvoiceMsg) Reset()
- func (x *LookupInvoiceMsg) String() string
- type LookupInvoiceMsg_PaymentAddr
- type LookupInvoiceMsg_PaymentHash
- type LookupInvoiceMsg_SetId
- type LookupModifier
- func (LookupModifier) Descriptor() protoreflect.EnumDescriptor
- func (x LookupModifier) Enum() *LookupModifier
- func (LookupModifier) EnumDescriptor() ([]byte, []int)deprecated
- func (x LookupModifier) Number() protoreflect.EnumNumber
- func (x LookupModifier) String() string
- func (LookupModifier) Type() protoreflect.EnumType
- type SettleInvoiceMsg
- type SettleInvoiceResp
- type SubscribeSingleInvoiceRequest
- func (*SubscribeSingleInvoiceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubscribeSingleInvoiceRequest) GetRHash() []byte
- func (*SubscribeSingleInvoiceRequest) ProtoMessage()
- func (x *SubscribeSingleInvoiceRequest) ProtoReflect() protoreflect.Message
- func (x *SubscribeSingleInvoiceRequest) Reset()
- func (x *SubscribeSingleInvoiceRequest) String() string
- type UnimplementedInvoicesServer
- func (UnimplementedInvoicesServer) AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error)
- func (UnimplementedInvoicesServer) CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error)
- func (UnimplementedInvoicesServer) LookupInvoiceV2(context.Context, *LookupInvoiceMsg) (*lnrpc.Invoice, error)
- func (UnimplementedInvoicesServer) SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error)
- func (UnimplementedInvoicesServer) SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error
- type UnsafeInvoicesServer
Constants ¶
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 ¶
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.
var File_invoicesrpc_invoices_proto protoreflect.FileDescriptor
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 ¶
CreateRPCRouteHints takes in the decoded form of an invoice's route hints and converts them into the lnrpc type.
func CreateZpay32HopHints ¶
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 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 RegisterInvoicesServer ¶
func RegisterInvoicesServer(s grpc.ServiceRegistrar, srv InvoicesServer)
func SelectHopHints ¶
func SelectHopHints(amtMSat lnwire.MilliSatoshi, cfg *AddInvoiceConfig, openChannels []*channeldb.OpenChannel, numMaxHophints int) []func(*zpay32.Invoice)
SelectHopHints will select up to numMaxHophints from the set of passed 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
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 3600 (1 hour). 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 }
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. 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 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 {
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) Descriptor() protoreflect.EnumDescriptor
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 (x LookupModifier) Number() protoreflect.EnumNumber
func (LookupModifier) String ¶
func (x LookupModifier) String() string
func (LookupModifier) Type ¶
func (LookupModifier) Type() protoreflect.EnumType
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. 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 (x *SubscribeSingleInvoiceRequest) ProtoReflect() protoreflect.Message
func (*SubscribeSingleInvoiceRequest) Reset ¶
func (x *SubscribeSingleInvoiceRequest) Reset()
func (*SubscribeSingleInvoiceRequest) String ¶
func (x *SubscribeSingleInvoiceRequest) String() string
type UnimplementedInvoicesServer ¶
type UnimplementedInvoicesServer struct { }
UnimplementedInvoicesServer must be embedded to have forward compatible implementations.
func (UnimplementedInvoicesServer) AddHoldInvoice ¶
func (UnimplementedInvoicesServer) AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error)
func (UnimplementedInvoicesServer) CancelInvoice ¶
func (UnimplementedInvoicesServer) CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error)
func (UnimplementedInvoicesServer) LookupInvoiceV2 ¶
func (UnimplementedInvoicesServer) LookupInvoiceV2(context.Context, *LookupInvoiceMsg) (*lnrpc.Invoice, error)
func (UnimplementedInvoicesServer) SettleInvoice ¶
func (UnimplementedInvoicesServer) SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error)
func (UnimplementedInvoicesServer) SubscribeSingleInvoice ¶
func (UnimplementedInvoicesServer) SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error
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.