Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LightningClient

Hierarchy

  • Client
    • LightningClient

Implements

Index

Constructors

constructor

  • new LightningClient(address: string, credentials: ChannelCredentials, options?: undefined | object): LightningClient

Methods

abandonChannel

addInvoice

  • addInvoice(request: Invoice, callback: (error: ServiceError | null, response: AddInvoiceResponse) => void): ClientUnaryCall
  • addInvoice(request: Invoice, metadata: Metadata, callback: (error: ServiceError | null, response: AddInvoiceResponse) => void): ClientUnaryCall
  • addInvoice(request: Invoice, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: AddInvoiceResponse) => void): ClientUnaryCall

bakeMacaroon

channelAcceptor

channelBalance

close

  • close(): void

closeChannel

closedChannels

connectPeer

debugLevel

decodePayReq

  • decodePayReq(request: PayReqString, callback: (error: ServiceError | null, response: PayReq) => void): ClientUnaryCall
  • decodePayReq(request: PayReqString, metadata: Metadata, callback: (error: ServiceError | null, response: PayReq) => void): ClientUnaryCall
  • decodePayReq(request: PayReqString, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: PayReq) => void): ClientUnaryCall
  • Parameters

    • request: PayReqString
    • callback: (error: ServiceError | null, response: PayReq) => void
        • (error: ServiceError | null, response: PayReq): void
        • Parameters

          • error: ServiceError | null
          • response: PayReq

          Returns void

    Returns ClientUnaryCall

  • Parameters

    • request: PayReqString
    • metadata: Metadata
    • callback: (error: ServiceError | null, response: PayReq) => void
        • (error: ServiceError | null, response: PayReq): void
        • Parameters

          • error: ServiceError | null
          • response: PayReq

          Returns void

    Returns ClientUnaryCall

  • Parameters

    • request: PayReqString
    • metadata: Metadata
    • options: Partial<CallOptions>
    • callback: (error: ServiceError | null, response: PayReq) => void
        • (error: ServiceError | null, response: PayReq): void
        • Parameters

          • error: ServiceError | null
          • response: PayReq

          Returns void

    Returns ClientUnaryCall

deleteAllPayments

describeGraph

  • describeGraph(request: ChannelGraphRequest, callback: (error: ServiceError | null, response: ChannelGraph) => void): ClientUnaryCall
  • describeGraph(request: ChannelGraphRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ChannelGraph) => void): ClientUnaryCall
  • describeGraph(request: ChannelGraphRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ChannelGraph) => void): ClientUnaryCall

disconnectPeer

estimateFee

exportAllChannelBackups

exportChannelBackup

feeReport

forwardingHistory

fundingStateStep

getChanInfo

  • getChanInfo(request: ChanInfoRequest, callback: (error: ServiceError | null, response: ChannelEdge) => void): ClientUnaryCall
  • getChanInfo(request: ChanInfoRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ChannelEdge) => void): ClientUnaryCall
  • getChanInfo(request: ChanInfoRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ChannelEdge) => void): ClientUnaryCall

getChannel

  • getChannel(): Channel
  • Return the underlying channel object for the specified client

    Returns Channel

    The channel

getInfo

  • getInfo(request: GetInfoRequest, callback: (error: ServiceError | null, response: GetInfoResponse) => void): ClientUnaryCall
  • getInfo(request: GetInfoRequest, metadata: Metadata, callback: (error: ServiceError | null, response: GetInfoResponse) => void): ClientUnaryCall
  • getInfo(request: GetInfoRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetInfoResponse) => void): ClientUnaryCall

getNetworkInfo

  • getNetworkInfo(request: NetworkInfoRequest, callback: (error: ServiceError | null, response: NetworkInfo) => void): ClientUnaryCall
  • getNetworkInfo(request: NetworkInfoRequest, metadata: Metadata, callback: (error: ServiceError | null, response: NetworkInfo) => void): ClientUnaryCall
  • getNetworkInfo(request: NetworkInfoRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: NetworkInfo) => void): ClientUnaryCall

getNodeInfo

  • getNodeInfo(request: NodeInfoRequest, callback: (error: ServiceError | null, response: NodeInfo) => void): ClientUnaryCall
  • getNodeInfo(request: NodeInfoRequest, metadata: Metadata, callback: (error: ServiceError | null, response: NodeInfo) => void): ClientUnaryCall
  • getNodeInfo(request: NodeInfoRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: NodeInfo) => void): ClientUnaryCall

getTransactions

listChannels

listInvoices

listPayments

listPeers

listUnspent

lookupInvoice

  • lookupInvoice(request: PaymentHash, callback: (error: ServiceError | null, response: Invoice) => void): ClientUnaryCall
  • lookupInvoice(request: PaymentHash, metadata: Metadata, callback: (error: ServiceError | null, response: Invoice) => void): ClientUnaryCall
  • lookupInvoice(request: PaymentHash, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Invoice) => void): ClientUnaryCall
  • Parameters

    • request: PaymentHash
    • callback: (error: ServiceError | null, response: Invoice) => void
        • (error: ServiceError | null, response: Invoice): void
        • Parameters

          • error: ServiceError | null
          • response: Invoice

          Returns void

    Returns ClientUnaryCall

  • Parameters

    • request: PaymentHash
    • metadata: Metadata
    • callback: (error: ServiceError | null, response: Invoice) => void
        • (error: ServiceError | null, response: Invoice): void
        • Parameters

          • error: ServiceError | null
          • response: Invoice

          Returns void

    Returns ClientUnaryCall

  • Parameters

    • request: PaymentHash
    • metadata: Metadata
    • options: Partial<CallOptions>
    • callback: (error: ServiceError | null, response: Invoice) => void
        • (error: ServiceError | null, response: Invoice): void
        • Parameters

          • error: ServiceError | null
          • response: Invoice

          Returns void

    Returns ClientUnaryCall

makeBidiStreamRequest

  • makeBidiStreamRequest<RequestType, ResponseType>(method: string, serialize: serialize<RequestType>, deserialize: deserialize<ResponseType>, metadata?: Metadata | null, options?: CallOptions | null): ClientDuplexStream<RequestType, ResponseType>
  • Make a bidirectional stream request with this method on the given channel.

    Type parameters

    • RequestType

    • ResponseType

    Parameters

    • method: string

      The name of the method to request

    • serialize: serialize<RequestType>

      The serialization function for inputs

    • deserialize: deserialize<ResponseType>

      The deserialization function for outputs

    • Optional metadata: Metadata | null

      Array of metadata key/value pairs to add to the call

    • Optional options: CallOptions | null

      Options map

    Returns ClientDuplexStream<RequestType, ResponseType>

    An event emitter for stream related events

makeClientStreamRequest

  • makeClientStreamRequest<RequestType, ResponseType>(method: string, serialize: serialize<RequestType>, deserialize: deserialize<ResponseType>, metadata: Metadata | null, options: CallOptions | null, callback: requestCallback<ResponseType>): ClientWritableStream<RequestType>
  • Make a client stream request to the given method, using the given serialize and deserialize functions, with the given argument.

    Type parameters

    • RequestType

    • ResponseType

    Parameters

    • method: string

      The name of the method to request

    • serialize: serialize<RequestType>

      The serialization function for inputs

    • deserialize: deserialize<ResponseType>

      The deserialization function for outputs

    • metadata: Metadata | null

      Array of metadata key/value pairs to add to the call

    • options: CallOptions | null

      Options map

    • callback: requestCallback<ResponseType>

      The callback to for when the response is received

    Returns ClientWritableStream<RequestType>

    An event emitter for stream related events

makeServerStreamRequest

  • makeServerStreamRequest<RequestType, ResponseType>(method: string, serialize: serialize<RequestType>, deserialize: deserialize<ResponseType>, argument: RequestType, metadata?: Metadata | null, options?: CallOptions | null): ClientReadableStream<ResponseType>
  • Make a server stream request to the given method, with the given serialize and deserialize function, using the given argument

    Type parameters

    • RequestType

    • ResponseType

    Parameters

    • method: string

      The name of the method to request

    • serialize: serialize<RequestType>

      The serialization function for inputs

    • deserialize: deserialize<ResponseType>

      The deserialization function for outputs

    • argument: RequestType

      The argument to the call. Should be serializable with serialize

    • Optional metadata: Metadata | null

      Array of metadata key/value pairs to add to the call

    • Optional options: CallOptions | null

      Options map

    Returns ClientReadableStream<ResponseType>

    An event emitter for stream related events

makeUnaryRequest

  • makeUnaryRequest<RequestType, ResponseType>(method: string, serialize: serialize<RequestType>, deserialize: deserialize<ResponseType>, argument: RequestType | null, metadata: Metadata | null, options: CallOptions | null, callback: requestCallback<ResponseType>): ClientUnaryCall
  • Make a unary request to the given method, using the given serialize and deserialize functions, with the given argument.

    Type parameters

    • RequestType

    • ResponseType

    Parameters

    • method: string

      The name of the method to request

    • serialize: serialize<RequestType>

      The serialization function for inputs

    • deserialize: deserialize<ResponseType>

      The deserialization function for outputs

    • argument: RequestType | null

      The argument to the call. Should be serializable with serialize

    • metadata: Metadata | null

      Metadata to add to the call

    • options: CallOptions | null

      Options map

    • callback: requestCallback<ResponseType>

      The callback to for when the response is received

    Returns ClientUnaryCall

    An event emitter for stream related events

newAddress

openChannel

openChannelSync

  • openChannelSync(request: OpenChannelRequest, callback: (error: ServiceError | null, response: ChannelPoint) => void): ClientUnaryCall
  • openChannelSync(request: OpenChannelRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ChannelPoint) => void): ClientUnaryCall
  • openChannelSync(request: OpenChannelRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ChannelPoint) => void): ClientUnaryCall

pendingChannels

queryRoutes

restoreChannelBackups

sendCoins

sendMany

sendPayment

sendPaymentSync

  • sendPaymentSync(request: SendRequest, callback: (error: ServiceError | null, response: SendResponse) => void): ClientUnaryCall
  • sendPaymentSync(request: SendRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SendResponse) => void): ClientUnaryCall
  • sendPaymentSync(request: SendRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SendResponse) => void): ClientUnaryCall

sendToRoute

sendToRouteSync

  • sendToRouteSync(request: SendToRouteRequest, callback: (error: ServiceError | null, response: SendResponse) => void): ClientUnaryCall
  • sendToRouteSync(request: SendToRouteRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SendResponse) => void): ClientUnaryCall
  • sendToRouteSync(request: SendToRouteRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SendResponse) => void): ClientUnaryCall

signMessage

stopDaemon

  • stopDaemon(request: StopRequest, callback: (error: ServiceError | null, response: StopResponse) => void): ClientUnaryCall
  • stopDaemon(request: StopRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StopResponse) => void): ClientUnaryCall
  • stopDaemon(request: StopRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StopResponse) => void): ClientUnaryCall

subscribeChannelBackups

subscribeChannelEvents

subscribeChannelGraph

subscribeInvoices

subscribePeerEvents

subscribeTransactions

updateChannelPolicy

verifyChanBackup

verifyMessage

waitForReady

  • waitForReady(deadline: Deadline, callback: (error: Error | null) => void): void
  • Wait for the client to be ready. The callback will be called when the client has successfully connected to the server, and it will be called with an error if the attempt to connect to the server has unrecoverablly failed or if the deadline expires. This function will make the channel start connecting if it has not already done so.

    Parameters

    • deadline: Deadline

      When to stop waiting for a connection.

    • callback: (error: Error | null) => void

      The callback to call when done attempting to connect.

        • (error: Error | null): void
        • Parameters

          • error: Error | null

          Returns void

    Returns void

walletBalance

Generated using TypeDoc