initial nosrt integration

This commit is contained in:
hatim boufnichel 2022-11-15 22:35:24 +01:00
parent 947cf34ff4
commit 50ba34e050
44 changed files with 40869 additions and 7913 deletions

View file

@ -2,7 +2,7 @@
import express, { Response, json, urlencoded } from 'express'
import cors from 'cors'
import * as Types from './types'
import * as Types from './types.js'
export type Logger = { log: (v: any) => void, error: (v: any) => void }
export type ServerOptions = {
allowCors?: true
@ -21,7 +21,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const logger = opts.logger || { log: console.log, error: console.error }
const app = express()
if (opts.allowCors) {
app.use(cors())
app.use(cors())
}
app.use(json())
app.use(urlencoded({ extended: true }))
@ -33,7 +33,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
await methods.Health({ ...authContext, ...query, ...params })
res.json({status: 'OK'})
res.json({ status: 'OK' })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.EncryptionExchange) throw new Error('method: EncryptionExchange is not implemented')
@ -47,7 +47,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
await methods.EncryptionExchange({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK'})
res.json({ status: 'OK' })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.LndGetInfo) throw new Error('method: LndGetInfo is not implemented')
@ -63,7 +63,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.LndGetInfo({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: await opts.encryptCallback(encryptionDeviceId, response)})
res.json({ status: 'OK', result: await opts.encryptCallback(encryptionDeviceId, response) })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.AddUser) throw new Error('method: AddUser is not implemented')
@ -77,7 +77,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.AddUser({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.AuthUser) throw new Error('method: AuthUser is not implemented')
@ -91,7 +91,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.AuthUser({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.NewAddress) throw new Error('method: NewAddress is not implemented')
@ -105,7 +105,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.NewAddress({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.PayAddress) throw new Error('method: PayAddress is not implemented')
@ -119,7 +119,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.PayAddress({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.NewInvoice) throw new Error('method: NewInvoice is not implemented')
@ -133,7 +133,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.NewInvoice({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.PayInvoice) throw new Error('method: PayInvoice is not implemented')
@ -147,7 +147,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.PayInvoice({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.OpenChannel) throw new Error('method: OpenChannel is not implemented')
@ -161,7 +161,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.OpenChannel({ ...authContext, ...query, ...params }, request)
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.GetOpenChannelLNURL) throw new Error('method: GetOpenChannelLNURL is not implemented')
@ -172,11 +172,11 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
const query = req.query
const params = req.params
const response = await methods.GetOpenChannelLNURL({ ...authContext, ...query, ...params })
res.json({status: 'OK', result: response})
res.json({ status: 'OK', result: response })
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (opts.staticFiles) {
app.use(express.static(opts.staticFiles))
app.use(express.static(opts.staticFiles))
}
var server: { close: () => void } | undefined
return {

View file

@ -1,6 +1,6 @@
// This file was autogenerated from a .proto file, DO NOT EDIT!
import axios from 'axios'
import * as Types from './types'
import * as Types from './types.js'
export type ResultError = { status: 'ERROR', reason: string }
export type ClientParams = {
@ -19,7 +19,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/health'
const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
return data
}
return { status: 'ERROR', reason: 'invalid response' }
@ -30,7 +30,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/encryption/exchange'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
return data
}
return { status: 'ERROR', reason: 'invalid response' }
@ -39,9 +39,9 @@ export default (params: ClientParams) => ({
const auth = await params.retrieveAdminAuth()
if (auth === null) throw new Error('retrieveAdminAuth() returned null')
let finalRoute = '/api/lnd/getinfo'
const { data } = await axios.post(params.baseUrl + finalRoute, await params.encryptCallback(request), { headers: { 'authorization': auth, 'x-e2ee-device-id-x': params.deviceId } })
const { data } = await axios.post(params.baseUrl + finalRoute, await params.encryptCallback(request), { headers: { 'authorization': auth, 'x-e2ee-device-id-x': params.deviceId } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = await params.decryptCallback(data.result)
const error = Types.LndGetInfoResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -54,7 +54,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/add'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.AddUserResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -67,7 +67,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/auth'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.AuthUserResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -80,7 +80,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/chain/new'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.NewAddressResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -93,7 +93,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/chain/pay'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.PayAddressResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -106,7 +106,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/invoice/new'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.NewInvoiceResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -119,7 +119,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/invoice/pay'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.PayInvoiceResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -132,7 +132,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/open/channel'
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.OpenChannelResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
@ -145,7 +145,7 @@ export default (params: ClientParams) => ({
let finalRoute = '/api/user/lnurl_channel'
const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
if (data.status === 'OK') {
const result = data.result
const error = Types.GetOpenChannelLNURLResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }

122
proto/lnd/invoices.client.d.ts vendored Normal file
View file

@ -0,0 +1,122 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import type { LookupInvoiceMsg } from "./invoices";
import type { SettleInvoiceResp } from "./invoices";
import type { SettleInvoiceMsg } from "./invoices";
import type { AddHoldInvoiceResp } from "./invoices";
import type { AddHoldInvoiceRequest } from "./invoices";
import type { CancelInvoiceResp } from "./invoices";
import type { CancelInvoiceMsg } from "./invoices";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { Invoice } from "./lightning";
import type { SubscribeSingleInvoiceRequest } from "./invoices";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
/**
* Invoices is a service that can be used to create, accept, settle and cancel
* invoices.
*
* @generated from protobuf service invoicesrpc.Invoices
*/
export interface IInvoicesClient {
/**
*
* 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.
*
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
*/
subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall<SubscribeSingleInvoiceRequest, Invoice>;
/**
*
* 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.
*
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
*/
cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall<CancelInvoiceMsg, CancelInvoiceResp>;
/**
*
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
* supplied in the request.
*
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
*/
addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall<AddHoldInvoiceRequest, AddHoldInvoiceResp>;
/**
*
* SettleInvoice settles an accepted invoice. If the invoice is already
* settled, this call will succeed.
*
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
*/
settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall<SettleInvoiceMsg, SettleInvoiceResp>;
/**
*
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
* using either its payment hash, payment address, or set ID.
*
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
*/
lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall<LookupInvoiceMsg, Invoice>;
}
/**
* Invoices is a service that can be used to create, accept, settle and cancel
* invoices.
*
* @generated from protobuf service invoicesrpc.Invoices
*/
export declare class InvoicesClient implements IInvoicesClient, ServiceInfo {
private readonly _transport;
typeName: any;
methods: any;
options: any;
constructor(_transport: RpcTransport);
/**
*
* 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.
*
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
*/
subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall<SubscribeSingleInvoiceRequest, Invoice>;
/**
*
* 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.
*
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
*/
cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall<CancelInvoiceMsg, CancelInvoiceResp>;
/**
*
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
* supplied in the request.
*
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
*/
addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall<AddHoldInvoiceRequest, AddHoldInvoiceResp>;
/**
*
* SettleInvoice settles an accepted invoice. If the invoice is already
* settled, this call will succeed.
*
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
*/
settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall<SettleInvoiceMsg, SettleInvoiceResp>;
/**
*
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
* using either its payment hash, payment address, or set ID.
*
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
*/
lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall<LookupInvoiceMsg, Invoice>;
}

View file

@ -0,0 +1,76 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
import { Invoices } from "./invoices.js";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
/**
* Invoices is a service that can be used to create, accept, settle and cancel
* invoices.
*
* @generated from protobuf service invoicesrpc.Invoices
*/
export class InvoicesClient {
constructor(_transport) {
this._transport = _transport;
this.typeName = Invoices.typeName;
this.methods = Invoices.methods;
this.options = Invoices.options;
}
/**
*
* 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.
*
* @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
*/
subscribeSingleInvoice(input, options) {
const method = this.methods[0], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
*
* 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.
*
* @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp);
*/
cancelInvoice(input, options) {
const method = this.methods[1], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
* supplied in the request.
*
* @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp);
*/
addHoldInvoice(input, options) {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SettleInvoice settles an accepted invoice. If the invoice is already
* settled, this call will succeed.
*
* @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp);
*/
settleInvoice(input, options) {
const method = this.methods[3], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced
* using either its payment hash, payment address, or set ID.
*
* @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice);
*/
lookupInvoiceV2(input, options) {
const method = this.methods[4], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
}

View file

@ -1,4 +1,4 @@
// @generated by protobuf-ts 2.5.0
// @generated by protobuf-ts 2.8.1 with parameter long_type_number
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";

318
proto/lnd/invoices.d.ts vendored Normal file
View file

@ -0,0 +1,318 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { RouteHint } from "./lightning";
/**
* @generated from protobuf message invoicesrpc.CancelInvoiceMsg
*/
export interface CancelInvoiceMsg {
/**
* Hash corresponding to the (hold) invoice to cancel. When using
* REST, this field must be encoded as base64.
*
* @generated from protobuf field: bytes payment_hash = 1;
*/
paymentHash: Uint8Array;
}
/**
* @generated from protobuf message invoicesrpc.CancelInvoiceResp
*/
export interface CancelInvoiceResp {
}
/**
* @generated from protobuf message invoicesrpc.AddHoldInvoiceRequest
*/
export interface AddHoldInvoiceRequest {
/**
*
* 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.
*
* @generated from protobuf field: string memo = 1;
*/
memo: string;
/**
* The hash of the preimage
*
* @generated from protobuf field: bytes hash = 2;
*/
hash: Uint8Array;
/**
*
* The value of this invoice in satoshis
*
* The fields value and value_msat are mutually exclusive.
*
* @generated from protobuf field: int64 value = 3;
*/
value: number;
/**
*
* The value of this invoice in millisatoshis
*
* The fields value and value_msat are mutually exclusive.
*
* @generated from protobuf field: int64 value_msat = 10;
*/
valueMsat: number;
/**
*
* 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.
*
* @generated from protobuf field: bytes description_hash = 4;
*/
descriptionHash: Uint8Array;
/**
* Payment request expiry time in seconds. Default is 3600 (1 hour).
*
* @generated from protobuf field: int64 expiry = 5;
*/
expiry: number;
/**
* Fallback on-chain address.
*
* @generated from protobuf field: string fallback_addr = 6;
*/
fallbackAddr: string;
/**
* Delta to use for the time-lock of the CLTV extended to the final hop.
*
* @generated from protobuf field: uint64 cltv_expiry = 7;
*/
cltvExpiry: number;
/**
*
* Route hints that can each be individually used to assist in reaching the
* invoice's destination.
*
* @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 8;
*/
routeHints: RouteHint[];
/**
* Whether this invoice should include routing hints for private channels.
*
* @generated from protobuf field: bool private = 9;
*/
private: boolean;
}
/**
* @generated from protobuf message invoicesrpc.AddHoldInvoiceResp
*/
export interface AddHoldInvoiceResp {
/**
*
* 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.
*
* @generated from protobuf field: string payment_request = 1;
*/
paymentRequest: string;
/**
*
* 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.
*
* @generated from protobuf field: uint64 add_index = 2;
*/
addIndex: number;
/**
*
* 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.
*
* @generated from protobuf field: bytes payment_addr = 3;
*/
paymentAddr: Uint8Array;
}
/**
* @generated from protobuf message invoicesrpc.SettleInvoiceMsg
*/
export interface SettleInvoiceMsg {
/**
* Externally discovered pre-image that should be used to settle the hold
* invoice.
*
* @generated from protobuf field: bytes preimage = 1;
*/
preimage: Uint8Array;
}
/**
* @generated from protobuf message invoicesrpc.SettleInvoiceResp
*/
export interface SettleInvoiceResp {
}
/**
* @generated from protobuf message invoicesrpc.SubscribeSingleInvoiceRequest
*/
export interface SubscribeSingleInvoiceRequest {
/**
* Hash corresponding to the (hold) invoice to subscribe to. When using
* REST, this field must be encoded as base64url.
*
* @generated from protobuf field: bytes r_hash = 2;
*/
rHash: Uint8Array;
}
/**
* @generated from protobuf message invoicesrpc.LookupInvoiceMsg
*/
export interface LookupInvoiceMsg {
/**
* @generated from protobuf oneof: invoice_ref
*/
invoiceRef: {
oneofKind: "paymentHash";
/**
* When using REST, this field must be encoded as base64.
*
* @generated from protobuf field: bytes payment_hash = 1;
*/
paymentHash: Uint8Array;
} | {
oneofKind: "paymentAddr";
/**
* @generated from protobuf field: bytes payment_addr = 2;
*/
paymentAddr: Uint8Array;
} | {
oneofKind: "setId";
/**
* @generated from protobuf field: bytes set_id = 3;
*/
setId: Uint8Array;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf field: invoicesrpc.LookupModifier lookup_modifier = 4;
*/
lookupModifier: LookupModifier;
}
/**
* @generated from protobuf enum invoicesrpc.LookupModifier
*/
export declare enum LookupModifier {
/**
* The default look up modifier, no look up behavior is changed.
*
* @generated from protobuf enum value: DEFAULT = 0;
*/
DEFAULT = 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.
*
* @generated from protobuf enum value: HTLC_SET_ONLY = 1;
*/
HTLC_SET_ONLY = 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.
*
* @generated from protobuf enum value: HTLC_SET_BLANK = 2;
*/
HTLC_SET_BLANK = 2
}
declare class CancelInvoiceMsg$Type extends MessageType<CancelInvoiceMsg> {
constructor();
create(value?: PartialMessage<CancelInvoiceMsg>): CancelInvoiceMsg;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceMsg): CancelInvoiceMsg;
internalBinaryWrite(message: CancelInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.CancelInvoiceMsg
*/
export declare const CancelInvoiceMsg: CancelInvoiceMsg$Type;
declare class CancelInvoiceResp$Type extends MessageType<CancelInvoiceResp> {
constructor();
create(value?: PartialMessage<CancelInvoiceResp>): CancelInvoiceResp;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceResp): CancelInvoiceResp;
internalBinaryWrite(message: CancelInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.CancelInvoiceResp
*/
export declare const CancelInvoiceResp: CancelInvoiceResp$Type;
declare class AddHoldInvoiceRequest$Type extends MessageType<AddHoldInvoiceRequest> {
constructor();
create(value?: PartialMessage<AddHoldInvoiceRequest>): AddHoldInvoiceRequest;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceRequest): AddHoldInvoiceRequest;
internalBinaryWrite(message: AddHoldInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceRequest
*/
export declare const AddHoldInvoiceRequest: AddHoldInvoiceRequest$Type;
declare class AddHoldInvoiceResp$Type extends MessageType<AddHoldInvoiceResp> {
constructor();
create(value?: PartialMessage<AddHoldInvoiceResp>): AddHoldInvoiceResp;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceResp): AddHoldInvoiceResp;
internalBinaryWrite(message: AddHoldInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceResp
*/
export declare const AddHoldInvoiceResp: AddHoldInvoiceResp$Type;
declare class SettleInvoiceMsg$Type extends MessageType<SettleInvoiceMsg> {
constructor();
create(value?: PartialMessage<SettleInvoiceMsg>): SettleInvoiceMsg;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceMsg): SettleInvoiceMsg;
internalBinaryWrite(message: SettleInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.SettleInvoiceMsg
*/
export declare const SettleInvoiceMsg: SettleInvoiceMsg$Type;
declare class SettleInvoiceResp$Type extends MessageType<SettleInvoiceResp> {
constructor();
create(value?: PartialMessage<SettleInvoiceResp>): SettleInvoiceResp;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceResp): SettleInvoiceResp;
internalBinaryWrite(message: SettleInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.SettleInvoiceResp
*/
export declare const SettleInvoiceResp: SettleInvoiceResp$Type;
declare class SubscribeSingleInvoiceRequest$Type extends MessageType<SubscribeSingleInvoiceRequest> {
constructor();
create(value?: PartialMessage<SubscribeSingleInvoiceRequest>): SubscribeSingleInvoiceRequest;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeSingleInvoiceRequest): SubscribeSingleInvoiceRequest;
internalBinaryWrite(message: SubscribeSingleInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.SubscribeSingleInvoiceRequest
*/
export declare const SubscribeSingleInvoiceRequest: SubscribeSingleInvoiceRequest$Type;
declare class LookupInvoiceMsg$Type extends MessageType<LookupInvoiceMsg> {
constructor();
create(value?: PartialMessage<LookupInvoiceMsg>): LookupInvoiceMsg;
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupInvoiceMsg): LookupInvoiceMsg;
internalBinaryWrite(message: LookupInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
* @generated MessageType for protobuf message invoicesrpc.LookupInvoiceMsg
*/
export declare const LookupInvoiceMsg: LookupInvoiceMsg$Type;
/**
* @generated ServiceType for protobuf service invoicesrpc.Invoices
*/
export declare const Invoices: any;
export {};

495
proto/lnd/invoices.js Normal file
View file

@ -0,0 +1,495 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
import { Invoice } from "./lightning.js";
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { RouteHint } from "./lightning.js";
/**
* @generated from protobuf enum invoicesrpc.LookupModifier
*/
export var LookupModifier;
(function (LookupModifier) {
/**
* The default look up modifier, no look up behavior is changed.
*
* @generated from protobuf enum value: DEFAULT = 0;
*/
LookupModifier[LookupModifier["DEFAULT"] = 0] = "DEFAULT";
/**
*
* 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.
*
* @generated from protobuf enum value: HTLC_SET_ONLY = 1;
*/
LookupModifier[LookupModifier["HTLC_SET_ONLY"] = 1] = "HTLC_SET_ONLY";
/**
*
* 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.
*
* @generated from protobuf enum value: HTLC_SET_BLANK = 2;
*/
LookupModifier[LookupModifier["HTLC_SET_BLANK"] = 2] = "HTLC_SET_BLANK";
})(LookupModifier || (LookupModifier = {}));
// @generated message type with reflection information, may provide speed optimized methods
class CancelInvoiceMsg$Type extends MessageType {
constructor() {
super("invoicesrpc.CancelInvoiceMsg", [
{ no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
]);
}
create(value) {
const message = { paymentHash: new Uint8Array(0) };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* bytes payment_hash */ 1:
message.paymentHash = reader.bytes();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* bytes payment_hash = 1; */
if (message.paymentHash.length)
writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.CancelInvoiceMsg
*/
export const CancelInvoiceMsg = new CancelInvoiceMsg$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CancelInvoiceResp$Type extends MessageType {
constructor() {
super("invoicesrpc.CancelInvoiceResp", []);
}
create(value) {
const message = {};
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
return target ?? this.create();
}
internalBinaryWrite(message, writer, options) {
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.CancelInvoiceResp
*/
export const CancelInvoiceResp = new CancelInvoiceResp$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AddHoldInvoiceRequest$Type extends MessageType {
constructor() {
super("invoicesrpc.AddHoldInvoiceRequest", [
{ no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 4, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 6, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 8, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint },
{ no: 9, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value) {
const message = { memo: "", hash: new Uint8Array(0), value: 0, valueMsat: 0, descriptionHash: new Uint8Array(0), expiry: 0, fallbackAddr: "", cltvExpiry: 0, routeHints: [], private: false };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string memo */ 1:
message.memo = reader.string();
break;
case /* bytes hash */ 2:
message.hash = reader.bytes();
break;
case /* int64 value */ 3:
message.value = reader.int64().toNumber();
break;
case /* int64 value_msat */ 10:
message.valueMsat = reader.int64().toNumber();
break;
case /* bytes description_hash */ 4:
message.descriptionHash = reader.bytes();
break;
case /* int64 expiry */ 5:
message.expiry = reader.int64().toNumber();
break;
case /* string fallback_addr */ 6:
message.fallbackAddr = reader.string();
break;
case /* uint64 cltv_expiry */ 7:
message.cltvExpiry = reader.uint64().toNumber();
break;
case /* repeated lnrpc.RouteHint route_hints */ 8:
message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* bool private */ 9:
message.private = reader.bool();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* string memo = 1; */
if (message.memo !== "")
writer.tag(1, WireType.LengthDelimited).string(message.memo);
/* bytes hash = 2; */
if (message.hash.length)
writer.tag(2, WireType.LengthDelimited).bytes(message.hash);
/* int64 value = 3; */
if (message.value !== 0)
writer.tag(3, WireType.Varint).int64(message.value);
/* int64 value_msat = 10; */
if (message.valueMsat !== 0)
writer.tag(10, WireType.Varint).int64(message.valueMsat);
/* bytes description_hash = 4; */
if (message.descriptionHash.length)
writer.tag(4, WireType.LengthDelimited).bytes(message.descriptionHash);
/* int64 expiry = 5; */
if (message.expiry !== 0)
writer.tag(5, WireType.Varint).int64(message.expiry);
/* string fallback_addr = 6; */
if (message.fallbackAddr !== "")
writer.tag(6, WireType.LengthDelimited).string(message.fallbackAddr);
/* uint64 cltv_expiry = 7; */
if (message.cltvExpiry !== 0)
writer.tag(7, WireType.Varint).uint64(message.cltvExpiry);
/* repeated lnrpc.RouteHint route_hints = 8; */
for (let i = 0; i < message.routeHints.length; i++)
RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
/* bool private = 9; */
if (message.private !== false)
writer.tag(9, WireType.Varint).bool(message.private);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceRequest
*/
export const AddHoldInvoiceRequest = new AddHoldInvoiceRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AddHoldInvoiceResp$Type extends MessageType {
constructor() {
super("invoicesrpc.AddHoldInvoiceResp", [
{ no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 3, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
]);
}
create(value) {
const message = { paymentRequest: "", addIndex: 0, paymentAddr: new Uint8Array(0) };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string payment_request */ 1:
message.paymentRequest = reader.string();
break;
case /* uint64 add_index */ 2:
message.addIndex = reader.uint64().toNumber();
break;
case /* bytes payment_addr */ 3:
message.paymentAddr = reader.bytes();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* string payment_request = 1; */
if (message.paymentRequest !== "")
writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest);
/* uint64 add_index = 2; */
if (message.addIndex !== 0)
writer.tag(2, WireType.Varint).uint64(message.addIndex);
/* bytes payment_addr = 3; */
if (message.paymentAddr.length)
writer.tag(3, WireType.LengthDelimited).bytes(message.paymentAddr);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceResp
*/
export const AddHoldInvoiceResp = new AddHoldInvoiceResp$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SettleInvoiceMsg$Type extends MessageType {
constructor() {
super("invoicesrpc.SettleInvoiceMsg", [
{ no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
]);
}
create(value) {
const message = { preimage: new Uint8Array(0) };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* bytes preimage */ 1:
message.preimage = reader.bytes();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* bytes preimage = 1; */
if (message.preimage.length)
writer.tag(1, WireType.LengthDelimited).bytes(message.preimage);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.SettleInvoiceMsg
*/
export const SettleInvoiceMsg = new SettleInvoiceMsg$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SettleInvoiceResp$Type extends MessageType {
constructor() {
super("invoicesrpc.SettleInvoiceResp", []);
}
create(value) {
const message = {};
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
return target ?? this.create();
}
internalBinaryWrite(message, writer, options) {
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.SettleInvoiceResp
*/
export const SettleInvoiceResp = new SettleInvoiceResp$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SubscribeSingleInvoiceRequest$Type extends MessageType {
constructor() {
super("invoicesrpc.SubscribeSingleInvoiceRequest", [
{ no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
]);
}
create(value) {
const message = { rHash: new Uint8Array(0) };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* bytes r_hash */ 2:
message.rHash = reader.bytes();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* bytes r_hash = 2; */
if (message.rHash.length)
writer.tag(2, WireType.LengthDelimited).bytes(message.rHash);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.SubscribeSingleInvoiceRequest
*/
export const SubscribeSingleInvoiceRequest = new SubscribeSingleInvoiceRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LookupInvoiceMsg$Type extends MessageType {
constructor() {
super("invoicesrpc.LookupInvoiceMsg", [
{ no: 1, name: "payment_hash", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ },
{ no: 2, name: "payment_addr", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ },
{ no: 3, name: "set_id", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ },
{ no: 4, name: "lookup_modifier", kind: "enum", T: () => ["invoicesrpc.LookupModifier", LookupModifier] }
]);
}
create(value) {
const message = { invoiceRef: { oneofKind: undefined }, lookupModifier: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* bytes payment_hash */ 1:
message.invoiceRef = {
oneofKind: "paymentHash",
paymentHash: reader.bytes()
};
break;
case /* bytes payment_addr */ 2:
message.invoiceRef = {
oneofKind: "paymentAddr",
paymentAddr: reader.bytes()
};
break;
case /* bytes set_id */ 3:
message.invoiceRef = {
oneofKind: "setId",
setId: reader.bytes()
};
break;
case /* invoicesrpc.LookupModifier lookup_modifier */ 4:
message.lookupModifier = reader.int32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* bytes payment_hash = 1; */
if (message.invoiceRef.oneofKind === "paymentHash")
writer.tag(1, WireType.LengthDelimited).bytes(message.invoiceRef.paymentHash);
/* bytes payment_addr = 2; */
if (message.invoiceRef.oneofKind === "paymentAddr")
writer.tag(2, WireType.LengthDelimited).bytes(message.invoiceRef.paymentAddr);
/* bytes set_id = 3; */
if (message.invoiceRef.oneofKind === "setId")
writer.tag(3, WireType.LengthDelimited).bytes(message.invoiceRef.setId);
/* invoicesrpc.LookupModifier lookup_modifier = 4; */
if (message.lookupModifier !== 0)
writer.tag(4, WireType.Varint).int32(message.lookupModifier);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message invoicesrpc.LookupInvoiceMsg
*/
export const LookupInvoiceMsg = new LookupInvoiceMsg$Type();
/**
* @generated ServiceType for protobuf service invoicesrpc.Invoices
*/
export const Invoices = new ServiceType("invoicesrpc.Invoices", [
{ name: "SubscribeSingleInvoice", serverStreaming: true, options: {}, I: SubscribeSingleInvoiceRequest, O: Invoice },
{ name: "CancelInvoice", options: {}, I: CancelInvoiceMsg, O: CancelInvoiceResp },
{ name: "AddHoldInvoice", options: {}, I: AddHoldInvoiceRequest, O: AddHoldInvoiceResp },
{ name: "SettleInvoice", options: {}, I: SettleInvoiceMsg, O: SettleInvoiceResp },
{ name: "LookupInvoiceV2", options: {}, I: LookupInvoiceMsg, O: Invoice }
]);

View file

@ -1,4 +1,4 @@
// @generated by protobuf-ts 2.5.0
// @generated by protobuf-ts 2.8.1 with parameter long_type_number
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable
import { Invoice } from "./lightning";
@ -59,7 +59,7 @@ export interface AddHoldInvoiceRequest {
*
* @generated from protobuf field: int64 value = 3;
*/
value: bigint;
value: number;
/**
*
* The value of this invoice in millisatoshis
@ -68,7 +68,7 @@ export interface AddHoldInvoiceRequest {
*
* @generated from protobuf field: int64 value_msat = 10;
*/
valueMsat: bigint;
valueMsat: number;
/**
*
* Hash (SHA-256) of a description of the payment. Used if the description of
@ -83,7 +83,7 @@ export interface AddHoldInvoiceRequest {
*
* @generated from protobuf field: int64 expiry = 5;
*/
expiry: bigint;
expiry: number;
/**
* Fallback on-chain address.
*
@ -95,7 +95,7 @@ export interface AddHoldInvoiceRequest {
*
* @generated from protobuf field: uint64 cltv_expiry = 7;
*/
cltvExpiry: bigint;
cltvExpiry: number;
/**
*
* Route hints that can each be individually used to assist in reaching the
@ -133,7 +133,7 @@ export interface AddHoldInvoiceResp {
*
* @generated from protobuf field: uint64 add_index = 2;
*/
addIndex: bigint;
addIndex: number;
/**
*
* The payment address of the generated invoice. This value should be used
@ -316,18 +316,18 @@ class AddHoldInvoiceRequest$Type extends MessageType<AddHoldInvoiceRequest> {
super("invoicesrpc.AddHoldInvoiceRequest", [
{ no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 4, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 6, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 8, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint },
{ no: 9, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
]);
}
create(value?: PartialMessage<AddHoldInvoiceRequest>): AddHoldInvoiceRequest {
const message = { memo: "", hash: new Uint8Array(0), value: 0n, valueMsat: 0n, descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false };
const message = { memo: "", hash: new Uint8Array(0), value: 0, valueMsat: 0, descriptionHash: new Uint8Array(0), expiry: 0, fallbackAddr: "", cltvExpiry: 0, routeHints: [], private: false };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<AddHoldInvoiceRequest>(this, message, value);
@ -345,22 +345,22 @@ class AddHoldInvoiceRequest$Type extends MessageType<AddHoldInvoiceRequest> {
message.hash = reader.bytes();
break;
case /* int64 value */ 3:
message.value = reader.int64().toBigInt();
message.value = reader.int64().toNumber();
break;
case /* int64 value_msat */ 10:
message.valueMsat = reader.int64().toBigInt();
message.valueMsat = reader.int64().toNumber();
break;
case /* bytes description_hash */ 4:
message.descriptionHash = reader.bytes();
break;
case /* int64 expiry */ 5:
message.expiry = reader.int64().toBigInt();
message.expiry = reader.int64().toNumber();
break;
case /* string fallback_addr */ 6:
message.fallbackAddr = reader.string();
break;
case /* uint64 cltv_expiry */ 7:
message.cltvExpiry = reader.uint64().toBigInt();
message.cltvExpiry = reader.uint64().toNumber();
break;
case /* repeated lnrpc.RouteHint route_hints */ 8:
message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options));
@ -387,22 +387,22 @@ class AddHoldInvoiceRequest$Type extends MessageType<AddHoldInvoiceRequest> {
if (message.hash.length)
writer.tag(2, WireType.LengthDelimited).bytes(message.hash);
/* int64 value = 3; */
if (message.value !== 0n)
if (message.value !== 0)
writer.tag(3, WireType.Varint).int64(message.value);
/* int64 value_msat = 10; */
if (message.valueMsat !== 0n)
if (message.valueMsat !== 0)
writer.tag(10, WireType.Varint).int64(message.valueMsat);
/* bytes description_hash = 4; */
if (message.descriptionHash.length)
writer.tag(4, WireType.LengthDelimited).bytes(message.descriptionHash);
/* int64 expiry = 5; */
if (message.expiry !== 0n)
if (message.expiry !== 0)
writer.tag(5, WireType.Varint).int64(message.expiry);
/* string fallback_addr = 6; */
if (message.fallbackAddr !== "")
writer.tag(6, WireType.LengthDelimited).string(message.fallbackAddr);
/* uint64 cltv_expiry = 7; */
if (message.cltvExpiry !== 0n)
if (message.cltvExpiry !== 0)
writer.tag(7, WireType.Varint).uint64(message.cltvExpiry);
/* repeated lnrpc.RouteHint route_hints = 8; */
for (let i = 0; i < message.routeHints.length; i++)
@ -425,12 +425,12 @@ class AddHoldInvoiceResp$Type extends MessageType<AddHoldInvoiceResp> {
constructor() {
super("invoicesrpc.AddHoldInvoiceResp", [
{ no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 3, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
]);
}
create(value?: PartialMessage<AddHoldInvoiceResp>): AddHoldInvoiceResp {
const message = { paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) };
const message = { paymentRequest: "", addIndex: 0, paymentAddr: new Uint8Array(0) };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<AddHoldInvoiceResp>(this, message, value);
@ -445,7 +445,7 @@ class AddHoldInvoiceResp$Type extends MessageType<AddHoldInvoiceResp> {
message.paymentRequest = reader.string();
break;
case /* uint64 add_index */ 2:
message.addIndex = reader.uint64().toBigInt();
message.addIndex = reader.uint64().toNumber();
break;
case /* bytes payment_addr */ 3:
message.paymentAddr = reader.bytes();
@ -466,7 +466,7 @@ class AddHoldInvoiceResp$Type extends MessageType<AddHoldInvoiceResp> {
if (message.paymentRequest !== "")
writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest);
/* uint64 add_index = 2; */
if (message.addIndex !== 0n)
if (message.addIndex !== 0)
writer.tag(2, WireType.Varint).uint64(message.addIndex);
/* bytes payment_addr = 3; */
if (message.paymentAddr.length)

1481
proto/lnd/lightning.client.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,901 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3)
// tslint:disable
import { Lightning } from "./lightning.js";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
//
// Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/**
* Lightning is the main RPC server of the daemon.
*
* @generated from protobuf service lnrpc.Lightning
*/
export class LightningClient {
constructor(_transport) {
this._transport = _transport;
this.typeName = Lightning.typeName;
this.methods = Lightning.methods;
this.options = Lightning.options;
}
/**
* lncli: `walletbalance`
* WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
* confirmed unspent outputs and all unconfirmed unspent outputs under control
* of the wallet.
*
* @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse);
*/
walletBalance(input, options) {
const method = this.methods[0], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `channelbalance`
* ChannelBalance returns a report on the total funds across all open channels,
* categorized in local/remote, pending local/remote and unsettled local/remote
* balances.
*
* @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse);
*/
channelBalance(input, options) {
const method = this.methods[1], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listchaintxns`
* GetTransactions returns a list describing all the known transactions
* relevant to the wallet.
*
* @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails);
*/
getTransactions(input, options) {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `estimatefee`
* EstimateFee asks the chain backend to estimate the fee rate and total fees
* for a transaction that pays to multiple specified outputs.
*
* When using REST, the `AddrToAmount` map type can be set by appending
* `&AddrToAmount[<address>]=<amount_to_send>` to the URL. Unfortunately this
* map type doesn't appear in the REST API documentation because of a bug in
* the grpc-gateway library.
*
* @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse);
*/
estimateFee(input, options) {
const method = this.methods[3], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `sendcoins`
* SendCoins executes a request to send coins to a particular address. Unlike
* SendMany, this RPC call only allows creating a single output at a time. If
* neither target_conf, or sat_per_vbyte are set, then the internal wallet will
* consult its fee model to determine a fee for the default confirmation
* target.
*
* @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse);
*/
sendCoins(input, options) {
const method = this.methods[4], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listunspent`
* Deprecated, use walletrpc.ListUnspent instead.
*
* ListUnspent returns a list of all utxos spendable by the wallet with a
* number of confirmations between the specified minimum and maximum.
*
* @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse);
*/
listUnspent(input, options) {
const method = this.methods[5], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribeTransactions creates a uni-directional stream from the server to
* the client in which any newly discovered transactions relevant to the
* wallet are sent over.
*
* @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction);
*/
subscribeTransactions(input, options) {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `sendmany`
* SendMany handles a request for a transaction that creates multiple specified
* outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then
* the internal wallet will consult its fee model to determine a fee for the
* default confirmation target.
*
* @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse);
*/
sendMany(input, options) {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `newaddress`
* NewAddress creates a new address under control of the local wallet.
*
* @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse);
*/
newAddress(input, options) {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `signmessage`
* SignMessage signs a message with this node's private key. The returned
* signature string is `zbase32` encoded and pubkey recoverable, meaning that
* only the message digest and signature are needed for verification.
*
* @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse);
*/
signMessage(input, options) {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `verifymessage`
* VerifyMessage verifies a signature over a msg. The signature must be
* zbase32 encoded and signed by an active node in the resident node's
* channel database. In addition to returning the validity of the signature,
* VerifyMessage also returns the recovered pubkey from the signature.
*
* @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse);
*/
verifyMessage(input, options) {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `connect`
* ConnectPeer attempts to establish a connection to a remote peer. This is at
* the networking level, and is used for communication between nodes. This is
* distinct from establishing a channel with a peer.
*
* @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse);
*/
connectPeer(input, options) {
const method = this.methods[11], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `disconnect`
* DisconnectPeer attempts to disconnect one peer from another identified by a
* given pubKey. In the case that we currently have a pending or active channel
* with the target peer, then this action will be not be allowed.
*
* @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse);
*/
disconnectPeer(input, options) {
const method = this.methods[12], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listpeers`
* ListPeers returns a verbose listing of all currently active peers.
*
* @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse);
*/
listPeers(input, options) {
const method = this.methods[13], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribePeerEvents creates a uni-directional stream from the server to
* the client in which any events relevant to the state of peers are sent
* over. Events include peers going online and offline.
*
* @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent);
*/
subscribePeerEvents(input, options) {
const method = this.methods[14], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `getinfo`
* GetInfo returns general information concerning the lightning node including
* it's identity pubkey, alias, the chains it is connected to, and information
* concerning the number of open+pending channels.
*
* @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse);
*/
getInfo(input, options) {
const method = this.methods[15], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* * lncli: `getrecoveryinfo`
* GetRecoveryInfo returns information concerning the recovery mode including
* whether it's in a recovery mode, whether the recovery is finished, and the
* progress made so far.
*
* @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse);
*/
getRecoveryInfo(input, options) {
const method = this.methods[16], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
// TODO(roasbeef): merge with below with bool?
/**
* lncli: `pendingchannels`
* PendingChannels returns a list of all the channels that are currently
* considered "pending". A channel is pending if it has finished the funding
* workflow and is waiting for confirmations for the funding txn, or is in the
* process of closure, either initiated cooperatively or non-cooperatively.
*
* @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse);
*/
pendingChannels(input, options) {
const method = this.methods[17], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listchannels`
* ListChannels returns a description of all the open channels that this node
* is a participant in.
*
* @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse);
*/
listChannels(input, options) {
const method = this.methods[18], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribeChannelEvents creates a uni-directional stream from the server to
* the client in which any updates relevant to the state of the channels are
* sent over. Events include new active channels, inactive channels, and closed
* channels.
*
* @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate);
*/
subscribeChannelEvents(input, options) {
const method = this.methods[19], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `closedchannels`
* ClosedChannels returns a description of all the closed channels that
* this node was a participant in.
*
* @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse);
*/
closedChannels(input, options) {
const method = this.methods[20], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
* call is meant to be consumed by clients to the REST proxy. As with all
* other sync calls, all byte slices are intended to be populated as hex
* encoded strings.
*
* @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint);
*/
openChannelSync(input, options) {
const method = this.methods[21], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `openchannel`
* OpenChannel attempts to open a singly funded channel specified in the
* request to a remote peer. Users are able to specify a target number of
* blocks that the funding transaction should be confirmed in, or a manual fee
* rate to us for the funding transaction. If neither are specified, then a
* lax block confirmation target is used. Each OpenStatusUpdate will return
* the pending channel ID of the in-progress channel. Depending on the
* arguments specified in the OpenChannelRequest, this pending channel ID can
* then be used to manually progress the channel funding flow.
*
* @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate);
*/
openChannel(input, options) {
const method = this.methods[22], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `batchopenchannel`
* BatchOpenChannel attempts to open multiple single-funded channels in a
* single transaction in an atomic way. This means either all channel open
* requests succeed at once or all attempts are aborted if any of them fail.
* This is the safer variant of using PSBTs to manually fund a batch of
* channels through the OpenChannel RPC.
*
* @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse);
*/
batchOpenChannel(input, options) {
const method = this.methods[23], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* FundingStateStep is an advanced funding related call that allows the caller
* to either execute some preparatory steps for a funding workflow, or
* manually progress a funding workflow. The primary way a funding flow is
* identified is via its pending channel ID. As an example, this method can be
* used to specify that we're expecting a funding flow for a particular
* pending channel ID, for which we need to use specific parameters.
* Alternatively, this can be used to interactively drive PSBT signing for
* funding for partially complete funding transactions.
*
* @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp);
*/
fundingStateStep(input, options) {
const method = this.methods[24], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* ChannelAcceptor dispatches a bi-directional streaming RPC in which
* OpenChannel requests are sent to the client and the client responds with
* a boolean that tells LND whether or not to accept the channel. This allows
* node operators to specify their own criteria for accepting inbound channels
* through a single persistent connection.
*
* @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest);
*/
channelAcceptor(options) {
const method = this.methods[25], opt = this._transport.mergeOptions(options);
return stackIntercept("duplex", this._transport, method, opt);
}
/**
* lncli: `closechannel`
* CloseChannel attempts to close an active channel identified by its channel
* outpoint (ChannelPoint). The actions of this method can additionally be
* augmented to attempt a force close after a timeout period in the case of an
* inactive peer. If a non-force close (cooperative closure) is requested,
* then the user can specify either a target number of blocks until the
* closure transaction is confirmed, or a manual fee rate. If neither are
* specified, then a default lax, block confirmation target is used.
*
* @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate);
*/
closeChannel(input, options) {
const method = this.methods[26], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `abandonchannel`
* AbandonChannel removes all channel state from the database except for a
* close summary. This method can be used to get rid of permanently unusable
* channels due to bugs fixed in newer versions of lnd. This method can also be
* used to remove externally funded channels where the funding transaction was
* never broadcast. Only available for non-externally funded channels in dev
* build.
*
* @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse);
*/
abandonChannel(input, options) {
const method = this.methods[27], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `sendpayment`
* Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a
* bi-directional streaming RPC for sending payments through the Lightning
* Network. A single RPC invocation creates a persistent bi-directional
* stream allowing clients to rapidly send payments through the Lightning
* Network with a single persistent connection.
*
* @deprecated
* @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse);
*/
sendPayment(options) {
const method = this.methods[28], opt = this._transport.mergeOptions(options);
return stackIntercept("duplex", this._transport, method, opt);
}
/**
*
* SendPaymentSync is the synchronous non-streaming version of SendPayment.
* This RPC is intended to be consumed by clients of the REST proxy.
* Additionally, this RPC expects the destination's public key and the payment
* hash (if any) to be encoded as hex strings.
*
* @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse);
*/
sendPaymentSync(input, options) {
const method = this.methods[29], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `sendtoroute`
* Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional
* streaming RPC for sending payment through the Lightning Network. This
* method differs from SendPayment in that it allows users to specify a full
* route manually. This can be used for things like rebalancing, and atomic
* swaps.
*
* @deprecated
* @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse);
*/
sendToRoute(options) {
const method = this.methods[30], opt = this._transport.mergeOptions(options);
return stackIntercept("duplex", this._transport, method, opt);
}
/**
*
* SendToRouteSync is a synchronous version of SendToRoute. It Will block
* until the payment either fails or succeeds.
*
* @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse);
*/
sendToRouteSync(input, options) {
const method = this.methods[31], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `addinvoice`
* 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.
*
* @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse);
*/
addInvoice(input, options) {
const method = this.methods[32], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listinvoices`
* ListInvoices returns a list of all the invoices currently stored within the
* database. Any active debug invoices are ignored. It has full support for
* paginated responses, allowing users to query for specific invoices through
* their add_index. This can be done by using either the first_index_offset or
* last_index_offset fields included in the response as the index_offset of the
* next request. By default, the first 100 invoices created will be returned.
* Backwards pagination is also supported through the Reversed flag.
*
* @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse);
*/
listInvoices(input, options) {
const method = this.methods[33], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `lookupinvoice`
* LookupInvoice attempts to look up an invoice according to its payment hash.
* The passed payment hash *must* be exactly 32 bytes, if not, an error is
* returned.
*
* @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice);
*/
lookupInvoice(input, options) {
const method = this.methods[34], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribeInvoices returns a uni-directional stream (server -> client) for
* notifying the client of newly added/settled invoices. The caller can
* optionally specify the add_index and/or the settle_index. If the add_index
* is specified, then we'll first start by sending add invoice events for all
* invoices with an add_index greater than the specified value. If the
* settle_index is specified, the next, we'll send out all settle events for
* invoices with a settle_index greater than the specified value. One or both
* of these fields can be set. If no fields are set, then we'll only send out
* the latest add/settle events.
*
* @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice);
*/
subscribeInvoices(input, options) {
const method = this.methods[35], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `decodepayreq`
* DecodePayReq takes an encoded payment request string and attempts to decode
* it, returning a full description of the conditions encoded within the
* payment request.
*
* @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq);
*/
decodePayReq(input, options) {
const method = this.methods[36], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listpayments`
* ListPayments returns a list of all outgoing payments.
*
* @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse);
*/
listPayments(input, options) {
const method = this.methods[37], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* DeletePayment deletes an outgoing payment from DB. Note that it will not
* attempt to delete an In-Flight payment, since that would be unsafe.
*
* @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse);
*/
deletePayment(input, options) {
const method = this.methods[38], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* DeleteAllPayments deletes all outgoing payments from DB. Note that it will
* not attempt to delete In-Flight payments, since that would be unsafe.
*
* @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse);
*/
deleteAllPayments(input, options) {
const method = this.methods[39], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `describegraph`
* DescribeGraph returns a description of the latest graph state from the
* point of view of the node. The graph information is partitioned into two
* components: all the nodes/vertexes, and all the edges that connect the
* vertexes themselves. As this is a directed graph, the edges also contain
* the node directional specific routing policy which includes: the time lock
* delta, fee information, etc.
*
* @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph);
*/
describeGraph(input, options) {
const method = this.methods[40], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `getnodemetrics`
* GetNodeMetrics returns node metrics calculated from the graph. Currently
* the only supported metric is betweenness centrality of individual nodes.
*
* @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse);
*/
getNodeMetrics(input, options) {
const method = this.methods[41], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `getchaninfo`
* GetChanInfo returns the latest authenticated network announcement for the
* given channel identified by its channel ID: an 8-byte integer which
* uniquely identifies the location of transaction's funding output within the
* blockchain.
*
* @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge);
*/
getChanInfo(input, options) {
const method = this.methods[42], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `getnodeinfo`
* GetNodeInfo returns the latest advertised, aggregated, and authenticated
* channel information for the specified node identified by its public key.
*
* @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo);
*/
getNodeInfo(input, options) {
const method = this.methods[43], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `queryroutes`
* QueryRoutes attempts to query the daemon's Channel Router for a possible
* route to a target destination capable of carrying a specific amount of
* satoshis. The returned route contains the full details required to craft and
* send an HTLC, also including the necessary information that should be
* present within the Sphinx packet encapsulated within the HTLC.
*
* When using REST, the `dest_custom_records` map type can be set by appending
* `&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`
* to the URL. Unfortunately this map type doesn't appear in the REST API
* documentation because of a bug in the grpc-gateway library.
*
* @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse);
*/
queryRoutes(input, options) {
const method = this.methods[44], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `getnetworkinfo`
* GetNetworkInfo returns some basic stats about the known channel graph from
* the point of view of the node.
*
* @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo);
*/
getNetworkInfo(input, options) {
const method = this.methods[45], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `stop`
* StopDaemon will send a shutdown request to the interrupt handler, triggering
* a graceful shutdown of the daemon.
*
* @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse);
*/
stopDaemon(input, options) {
const method = this.methods[46], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribeChannelGraph launches a streaming RPC that allows the caller to
* receive notifications upon any changes to the channel graph topology from
* the point of view of the responding node. Events notified include: new
* nodes coming online, nodes updating their authenticated attributes, new
* channels being advertised, updates in the routing policy for a directional
* channel edge, and when channels are closed on-chain.
*
* @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate);
*/
subscribeChannelGraph(input, options) {
const method = this.methods[47], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `debuglevel`
* DebugLevel allows a caller to programmatically set the logging verbosity of
* lnd. The logging can be targeted according to a coarse daemon-wide logging
* level, or in a granular fashion to specify the logging for a target
* sub-system.
*
* @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse);
*/
debugLevel(input, options) {
const method = this.methods[48], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `feereport`
* FeeReport allows the caller to obtain a report detailing the current fee
* schedule enforced by the node globally for each channel.
*
* @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse);
*/
feeReport(input, options) {
const method = this.methods[49], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `updatechanpolicy`
* UpdateChannelPolicy allows the caller to update the fee schedule and
* channel policies for all channels globally, or a particular channel.
*
* @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse);
*/
updateChannelPolicy(input, options) {
const method = this.methods[50], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `fwdinghistory`
* ForwardingHistory allows the caller to query the htlcswitch for a record of
* all HTLCs forwarded within the target time range, and integer offset
* within that time range, for a maximum number of events. If no maximum number
* of events is specified, up to 100 events will be returned. If no time-range
* is specified, then events will be returned in the order that they occured.
*
* A list of forwarding events are returned. The size of each forwarding event
* is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
* As a result each message can only contain 50k entries. Each response has
* the index offset of the last entry. The index offset can be provided to the
* request to allow the caller to skip a series of records.
*
* @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse);
*/
forwardingHistory(input, options) {
const method = this.methods[51], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `exportchanbackup`
* ExportChannelBackup attempts to return an encrypted static channel backup
* for the target channel identified by it channel point. The backup is
* encrypted with a key generated from the aezeed seed of the user. The
* returned backup can either be restored using the RestoreChannelBackup
* method once lnd is running, or via the InitWallet and UnlockWallet methods
* from the WalletUnlocker service.
*
* @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup);
*/
exportChannelBackup(input, options) {
const method = this.methods[52], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* ExportAllChannelBackups returns static channel backups for all existing
* channels known to lnd. A set of regular singular static channel backups for
* each channel are returned. Additionally, a multi-channel backup is returned
* as well, which contains a single encrypted blob containing the backups of
* each channel.
*
* @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot);
*/
exportAllChannelBackups(input, options) {
const method = this.methods[53], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* VerifyChanBackup allows a caller to verify the integrity of a channel backup
* snapshot. This method will accept either a packed Single or a packed Multi.
* Specifying both will result in an error.
*
* @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse);
*/
verifyChanBackup(input, options) {
const method = this.methods[54], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `restorechanbackup`
* RestoreChannelBackups accepts a set of singular channel backups, or a
* single encrypted multi-chan backup and attempts to recover any funds
* remaining within the channel. If we are able to unpack the backup, then the
* new channel will be shown under listchannels, as well as pending channels.
*
* @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse);
*/
restoreChannelBackups(input, options) {
const method = this.methods[55], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribeChannelBackups allows a client to sub-subscribe to the most up to
* date information concerning the state of all channel backups. Each time a
* new channel is added, we return the new set of channels, along with a
* multi-chan backup containing the backup info for all channels. Each time a
* channel is closed, we send a new update, which contains new new chan back
* ups, but the updated set of encrypted multi-chan backups with the closed
* channel(s) removed.
*
* @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot);
*/
subscribeChannelBackups(input, options) {
const method = this.methods[56], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `bakemacaroon`
* BakeMacaroon allows the creation of a new macaroon with custom read and
* write permissions. No first-party caveats are added since this can be done
* offline.
*
* @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse);
*/
bakeMacaroon(input, options) {
const method = this.methods[57], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listmacaroonids`
* ListMacaroonIDs returns all root key IDs that are in use.
*
* @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse);
*/
listMacaroonIDs(input, options) {
const method = this.methods[58], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `deletemacaroonid`
* DeleteMacaroonID deletes the specified macaroon ID and invalidates all
* macaroons derived from that ID.
*
* @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse);
*/
deleteMacaroonID(input, options) {
const method = this.methods[59], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `listpermissions`
* ListPermissions lists all RPC method URIs and their required macaroon
* permissions to access them.
*
* @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse);
*/
listPermissions(input, options) {
const method = this.methods[60], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* CheckMacaroonPermissions checks whether a request follows the constraints
* imposed on the macaroon and that the macaroon is authorized to follow the
* provided permissions.
*
* @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse);
*/
checkMacaroonPermissions(input, options) {
const method = this.methods[61], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A
* gRPC middleware is software component external to lnd that aims to add
* additional business logic to lnd by observing/intercepting/validating
* incoming gRPC client requests and (if needed) replacing/overwriting outgoing
* messages before they're sent to the client. When registering the middleware
* must identify itself and indicate what custom macaroon caveats it wants to
* be responsible for. Only requests that contain a macaroon with that specific
* custom caveat are then sent to the middleware for inspection. The other
* option is to register for the read-only mode in which all requests/responses
* are forwarded for interception to the middleware but the middleware is not
* allowed to modify any responses. As a security measure, _no_ middleware can
* modify responses for requests made with _unencumbered_ macaroons!
*
* @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest);
*/
registerRPCMiddleware(options) {
const method = this.methods[62], opt = this._transport.mergeOptions(options);
return stackIntercept("duplex", this._transport, method, opt);
}
/**
* lncli: `sendcustom`
* SendCustomMessage sends a custom peer message.
*
* @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse);
*/
sendCustomMessage(input, options) {
const method = this.methods[63], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* lncli: `subscribecustom`
* SubscribeCustomMessages subscribes to a stream of incoming custom peer
* messages.
*
* @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage);
*/
subscribeCustomMessages(input, options) {
const method = this.methods[64], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* lncli: `listaliases`
* ListAliases returns the set of all aliases that have ever existed with
* their confirmed SCID (if it exists) and/or the base SCID (in the case of
* zero conf).
*
* @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse);
*/
listAliases(input, options) {
const method = this.methods[65], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse);
*/
lookupHtlc(input, options) {
const method = this.methods[66], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
}

View file

@ -1,4 +1,4 @@
// @generated by protobuf-ts 2.5.0
// @generated by protobuf-ts 2.8.1 with parameter long_type_number
// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";

9340
proto/lnd/lightning.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

14457
proto/lnd/lightning.js Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

390
proto/lnd/router.client.d.ts vendored Normal file
View file

@ -0,0 +1,390 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import type { UpdateChanStatusResponse } from "./router";
import type { UpdateChanStatusRequest } from "./router";
import type { ForwardHtlcInterceptRequest } from "./router";
import type { ForwardHtlcInterceptResponse } from "./router";
import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { PaymentStatus } from "./router";
import type { HtlcEvent } from "./router";
import type { SubscribeHtlcEventsRequest } from "./router";
import type { BuildRouteResponse } from "./router";
import type { BuildRouteRequest } from "./router";
import type { QueryProbabilityResponse } from "./router";
import type { QueryProbabilityRequest } from "./router";
import type { SetMissionControlConfigResponse } from "./router";
import type { SetMissionControlConfigRequest } from "./router";
import type { GetMissionControlConfigResponse } from "./router";
import type { GetMissionControlConfigRequest } from "./router";
import type { XImportMissionControlResponse } from "./router";
import type { XImportMissionControlRequest } from "./router";
import type { QueryMissionControlResponse } from "./router";
import type { QueryMissionControlRequest } from "./router";
import type { ResetMissionControlResponse } from "./router";
import type { ResetMissionControlRequest } from "./router";
import type { HTLCAttempt } from "./lightning";
import type { SendToRouteResponse } from "./router";
import type { SendToRouteRequest } from "./router";
import type { RouteFeeResponse } from "./router";
import type { RouteFeeRequest } from "./router";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { TrackPaymentsRequest } from "./router";
import type { TrackPaymentRequest } from "./router";
import type { Payment } from "./lightning";
import type { SendPaymentRequest } from "./router";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
/**
* Router is a service that offers advanced interaction with the router
* subsystem of the daemon.
*
* @generated from protobuf service routerrpc.Router
*/
export interface IRouterClient {
/**
*
* SendPaymentV2 attempts to route a payment described by the passed
* PaymentRequest to the final destination. The call returns a stream of
* payment updates.
*
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
*/
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment>;
/**
*
* TrackPaymentV2 returns an update stream for the payment identified by the
* payment hash.
*
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
*/
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment>;
/**
*
* TrackPayments returns an update stream for every payment that is not in a
* terminal state. Note that if payments are in-flight while starting a new
* subscription, the start of the payment stream could produce out-of-order
* and/or duplicate events. In order to get updates for every in-flight
* payment attempt make sure to subscribe to this method before initiating any
* payments.
*
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
*/
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment>;
/**
*
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
* may cost to send an HTLC to the target end destination.
*
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
*/
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse>;
/**
*
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
* the specified route. This method differs from SendPayment in that it
* allows users to specify a full route manually. This can be used for
* things like rebalancing, and atomic swaps. It differs from the newer
* SendToRouteV2 in that it doesn't return the full HTLC information.
*
* @deprecated
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
*/
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse>;
/**
*
* SendToRouteV2 attempts to make a payment via the specified route. This
* method differs from SendPayment in that it allows users to specify a full
* route manually. This can be used for things like rebalancing, and atomic
* swaps.
*
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
*/
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt>;
/**
*
* ResetMissionControl clears all mission control state and starts with a clean
* slate.
*
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
*/
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse>;
/**
*
* QueryMissionControl exposes the internal mission control state to callers.
* It is a development feature.
*
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
*/
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse>;
/**
*
* XImportMissionControl is an experimental API that imports the state provided
* to the internal mission control's state, using all results which are more
* recent than our existing values. These values will only be imported
* in-memory, and will not be persisted across restarts.
*
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
*/
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse>;
/**
*
* GetMissionControlConfig returns mission control's current config.
*
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
*/
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse>;
/**
*
* SetMissionControlConfig will set mission control's config, if the config
* provided is valid.
*
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
*/
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse>;
/**
*
* QueryProbability returns the current success probability estimate for a
* given node pair and amount.
*
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
*/
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse>;
/**
*
* BuildRoute builds a fully specified route based on a list of hop public
* keys. It retrieves the relevant channel policies from the graph in order to
* calculate the correct fees and time locks.
*
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
*/
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse>;
/**
*
* SubscribeHtlcEvents creates a uni-directional stream from the server to
* the client which delivers a stream of htlc events.
*
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
*/
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent>;
/**
*
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
* described by the passed PaymentRequest to the final destination. The call
* returns a stream of payment status updates.
*
* @deprecated
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
*/
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus>;
/**
*
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
* the payment identified by the payment hash.
*
* @deprecated
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
*/
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus>;
/**
* *
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
* Forwarded HTLC requests are sent to the client and the client responds with
* a boolean that tells LND if this htlc should be intercepted.
* In case of interception, the htlc can be either settled, cancelled or
* resumed later by using the ResolveHoldForward endpoint.
*
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
*/
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>;
/**
*
* UpdateChanStatus attempts to manually set the state of a channel
* (enabled, disabled, or auto). A manual "disable" request will cause the
* channel to stay disabled until a subsequent manual request of either
* "enable" or "auto".
*
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
*/
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse>;
}
/**
* Router is a service that offers advanced interaction with the router
* subsystem of the daemon.
*
* @generated from protobuf service routerrpc.Router
*/
export declare class RouterClient implements IRouterClient, ServiceInfo {
private readonly _transport;
typeName: any;
methods: any;
options: any;
constructor(_transport: RpcTransport);
/**
*
* SendPaymentV2 attempts to route a payment described by the passed
* PaymentRequest to the final destination. The call returns a stream of
* payment updates.
*
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
*/
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment>;
/**
*
* TrackPaymentV2 returns an update stream for the payment identified by the
* payment hash.
*
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
*/
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment>;
/**
*
* TrackPayments returns an update stream for every payment that is not in a
* terminal state. Note that if payments are in-flight while starting a new
* subscription, the start of the payment stream could produce out-of-order
* and/or duplicate events. In order to get updates for every in-flight
* payment attempt make sure to subscribe to this method before initiating any
* payments.
*
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
*/
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment>;
/**
*
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
* may cost to send an HTLC to the target end destination.
*
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
*/
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse>;
/**
*
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
* the specified route. This method differs from SendPayment in that it
* allows users to specify a full route manually. This can be used for
* things like rebalancing, and atomic swaps. It differs from the newer
* SendToRouteV2 in that it doesn't return the full HTLC information.
*
* @deprecated
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
*/
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse>;
/**
*
* SendToRouteV2 attempts to make a payment via the specified route. This
* method differs from SendPayment in that it allows users to specify a full
* route manually. This can be used for things like rebalancing, and atomic
* swaps.
*
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
*/
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt>;
/**
*
* ResetMissionControl clears all mission control state and starts with a clean
* slate.
*
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
*/
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse>;
/**
*
* QueryMissionControl exposes the internal mission control state to callers.
* It is a development feature.
*
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
*/
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse>;
/**
*
* XImportMissionControl is an experimental API that imports the state provided
* to the internal mission control's state, using all results which are more
* recent than our existing values. These values will only be imported
* in-memory, and will not be persisted across restarts.
*
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
*/
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse>;
/**
*
* GetMissionControlConfig returns mission control's current config.
*
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
*/
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse>;
/**
*
* SetMissionControlConfig will set mission control's config, if the config
* provided is valid.
*
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
*/
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse>;
/**
*
* QueryProbability returns the current success probability estimate for a
* given node pair and amount.
*
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
*/
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse>;
/**
*
* BuildRoute builds a fully specified route based on a list of hop public
* keys. It retrieves the relevant channel policies from the graph in order to
* calculate the correct fees and time locks.
*
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
*/
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse>;
/**
*
* SubscribeHtlcEvents creates a uni-directional stream from the server to
* the client which delivers a stream of htlc events.
*
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
*/
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent>;
/**
*
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
* described by the passed PaymentRequest to the final destination. The call
* returns a stream of payment status updates.
*
* @deprecated
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
*/
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus>;
/**
*
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
* the payment identified by the payment hash.
*
* @deprecated
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
*/
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus>;
/**
* *
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
* Forwarded HTLC requests are sent to the client and the client responds with
* a boolean that tells LND if this htlc should be intercepted.
* In case of interception, the htlc can be either settled, cancelled or
* resumed later by using the ResolveHoldForward endpoint.
*
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
*/
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>;
/**
*
* UpdateChanStatus attempts to manually set the state of a channel
* (enabled, disabled, or auto). A manual "disable" request will cause the
* channel to stay disabled until a subsequent manual request of either
* "enable" or "auto".
*
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
*/
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse>;
}

238
proto/lnd/router.client.js Normal file
View file

@ -0,0 +1,238 @@
// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
// tslint:disable
import { Router } from "./router.js";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
/**
* Router is a service that offers advanced interaction with the router
* subsystem of the daemon.
*
* @generated from protobuf service routerrpc.Router
*/
export class RouterClient {
constructor(_transport) {
this._transport = _transport;
this.typeName = Router.typeName;
this.methods = Router.methods;
this.options = Router.options;
}
/**
*
* SendPaymentV2 attempts to route a payment described by the passed
* PaymentRequest to the final destination. The call returns a stream of
* payment updates.
*
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
*/
sendPaymentV2(input, options) {
const method = this.methods[0], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
*
* TrackPaymentV2 returns an update stream for the payment identified by the
* payment hash.
*
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
*/
trackPaymentV2(input, options) {
const method = this.methods[1], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
*
* TrackPayments returns an update stream for every payment that is not in a
* terminal state. Note that if payments are in-flight while starting a new
* subscription, the start of the payment stream could produce out-of-order
* and/or duplicate events. In order to get updates for every in-flight
* payment attempt make sure to subscribe to this method before initiating any
* payments.
*
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
*/
trackPayments(input, options) {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
*
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
* may cost to send an HTLC to the target end destination.
*
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
*/
estimateRouteFee(input, options) {
const method = this.methods[3], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
* the specified route. This method differs from SendPayment in that it
* allows users to specify a full route manually. This can be used for
* things like rebalancing, and atomic swaps. It differs from the newer
* SendToRouteV2 in that it doesn't return the full HTLC information.
*
* @deprecated
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
*/
sendToRoute(input, options) {
const method = this.methods[4], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SendToRouteV2 attempts to make a payment via the specified route. This
* method differs from SendPayment in that it allows users to specify a full
* route manually. This can be used for things like rebalancing, and atomic
* swaps.
*
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
*/
sendToRouteV2(input, options) {
const method = this.methods[5], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* ResetMissionControl clears all mission control state and starts with a clean
* slate.
*
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
*/
resetMissionControl(input, options) {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* QueryMissionControl exposes the internal mission control state to callers.
* It is a development feature.
*
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
*/
queryMissionControl(input, options) {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* XImportMissionControl is an experimental API that imports the state provided
* to the internal mission control's state, using all results which are more
* recent than our existing values. These values will only be imported
* in-memory, and will not be persisted across restarts.
*
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
*/
xImportMissionControl(input, options) {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* GetMissionControlConfig returns mission control's current config.
*
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
*/
getMissionControlConfig(input, options) {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SetMissionControlConfig will set mission control's config, if the config
* provided is valid.
*
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
*/
setMissionControlConfig(input, options) {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* QueryProbability returns the current success probability estimate for a
* given node pair and amount.
*
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
*/
queryProbability(input, options) {
const method = this.methods[11], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* BuildRoute builds a fully specified route based on a list of hop public
* keys. It retrieves the relevant channel policies from the graph in order to
* calculate the correct fees and time locks.
*
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
*/
buildRoute(input, options) {
const method = this.methods[12], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
/**
*
* SubscribeHtlcEvents creates a uni-directional stream from the server to
* the client which delivers a stream of htlc events.
*
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
*/
subscribeHtlcEvents(input, options) {
const method = this.methods[13], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
*
* Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
* described by the passed PaymentRequest to the final destination. The call
* returns a stream of payment status updates.
*
* @deprecated
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
*/
sendPayment(input, options) {
const method = this.methods[14], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
*
* Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
* the payment identified by the payment hash.
*
* @deprecated
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
*/
trackPayment(input, options) {
const method = this.methods[15], opt = this._transport.mergeOptions(options);
return stackIntercept("serverStreaming", this._transport, method, opt, input);
}
/**
* *
* HtlcInterceptor dispatches a bi-directional streaming RPC in which
* Forwarded HTLC requests are sent to the client and the client responds with
* a boolean that tells LND if this htlc should be intercepted.
* In case of interception, the htlc can be either settled, cancelled or
* resumed later by using the ResolveHoldForward endpoint.
*
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
*/
htlcInterceptor(options) {
const method = this.methods[16], opt = this._transport.mergeOptions(options);
return stackIntercept("duplex", this._transport, method, opt);
}
/**
*
* UpdateChanStatus attempts to manually set the state of a channel
* (enabled, disabled, or auto). A manual "disable" request will cause the
* channel to stay disabled until a subsequent manual request of either
* "enable" or "auto".
*
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
*/
updateChanStatus(input, options) {
const method = this.methods[17], opt = this._transport.mergeOptions(options);
return stackIntercept("unary", this._transport, method, opt, input);
}
}

View file

@ -1,4 +1,4 @@
// @generated by protobuf-ts 2.5.0
// @generated by protobuf-ts 2.8.1 with parameter long_type_number
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";

1649
proto/lnd/router.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

2519
proto/lnd/router.js Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// @generated by protobuf-ts 2.5.0
// @generated by protobuf-ts 2.8.1 with parameter long_type_number
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
// tslint:disable
import { Payment } from "./lightning";
@ -38,7 +38,7 @@ export interface SendPaymentRequest {
*
* @generated from protobuf field: int64 amt = 2;
*/
amt: bigint;
amt: number;
/**
*
* Number of millisatoshis to send.
@ -47,7 +47,7 @@ export interface SendPaymentRequest {
*
* @generated from protobuf field: int64 amt_msat = 12;
*/
amtMsat: bigint;
amtMsat: number;
/**
* The hash to use within the payment's HTLC
*
@ -100,7 +100,7 @@ export interface SendPaymentRequest {
*
* @generated from protobuf field: int64 fee_limit_sat = 7;
*/
feeLimitSat: bigint;
feeLimitSat: number;
/**
*
* The maximum number of millisatoshis that will be paid as a fee of the
@ -113,7 +113,7 @@ export interface SendPaymentRequest {
*
* @generated from protobuf field: int64 fee_limit_msat = 13;
*/
feeLimitMsat: bigint;
feeLimitMsat: number;
/**
*
* Deprecated, use outgoing_chan_ids. The channel id of the channel that must
@ -131,7 +131,7 @@ export interface SendPaymentRequest {
*
* @generated from protobuf field: repeated uint64 outgoing_chan_ids = 19;
*/
outgoingChanIds: bigint[];
outgoingChanIds: number[];
/**
*
* The pubkey of the last hop of the route. If empty, any hop may be used.
@ -210,7 +210,7 @@ export interface SendPaymentRequest {
*
* @generated from protobuf field: uint64 max_shard_size_msat = 21;
*/
maxShardSizeMsat: bigint;
maxShardSizeMsat: number;
/**
*
* If set, an AMP-payment will be attempted.
@ -276,7 +276,7 @@ export interface RouteFeeRequest {
*
* @generated from protobuf field: int64 amt_sat = 2;
*/
amtSat: bigint;
amtSat: number;
}
/**
* @generated from protobuf message routerrpc.RouteFeeResponse
@ -289,7 +289,7 @@ export interface RouteFeeResponse {
*
* @generated from protobuf field: int64 routing_fee_msat = 1;
*/
routingFeeMsat: bigint;
routingFeeMsat: number;
/**
*
* An estimate of the worst case time delay that can occur. Note that callers
@ -298,7 +298,7 @@ export interface RouteFeeResponse {
*
* @generated from protobuf field: int64 time_lock_delay = 2;
*/
timeLockDelay: bigint;
timeLockDelay: number;
}
/**
* @generated from protobuf message routerrpc.SendToRouteRequest
@ -428,7 +428,7 @@ export interface PairData {
*
* @generated from protobuf field: int64 fail_time = 1;
*/
failTime: bigint;
failTime: number;
/**
*
* Lowest amount that failed to forward rounded to whole sats. This may be
@ -436,7 +436,7 @@ export interface PairData {
*
* @generated from protobuf field: int64 fail_amt_sat = 2;
*/
failAmtSat: bigint;
failAmtSat: number;
/**
*
* Lowest amount that failed to forward in millisats. This may be
@ -444,25 +444,25 @@ export interface PairData {
*
* @generated from protobuf field: int64 fail_amt_msat = 4;
*/
failAmtMsat: bigint;
failAmtMsat: number;
/**
* Time of last success.
*
* @generated from protobuf field: int64 success_time = 5;
*/
successTime: bigint;
successTime: number;
/**
* Highest amount that we could successfully forward rounded to whole sats.
*
* @generated from protobuf field: int64 success_amt_sat = 6;
*/
successAmtSat: bigint;
successAmtSat: number;
/**
* Highest amount that we could successfully forward in millisats.
*
* @generated from protobuf field: int64 success_amt_msat = 7;
*/
successAmtMsat: bigint;
successAmtMsat: number;
}
/**
* @generated from protobuf message routerrpc.GetMissionControlConfigRequest
@ -513,7 +513,7 @@ export interface MissionControlConfig {
*
* @generated from protobuf field: uint64 half_life_seconds = 1;
*/
halfLifeSeconds: bigint;
halfLifeSeconds: number;
/**
*
* The probability of success mission control should assign to hop in a route
@ -550,7 +550,7 @@ export interface MissionControlConfig {
*
* @generated from protobuf field: uint64 minimum_failure_relax_interval = 5;
*/
minimumFailureRelaxInterval: bigint;
minimumFailureRelaxInterval: number;
}
/**
* @generated from protobuf message routerrpc.QueryProbabilityRequest
@ -573,7 +573,7 @@ export interface QueryProbabilityRequest {
*
* @generated from protobuf field: int64 amt_msat = 3;
*/
amtMsat: bigint;
amtMsat: number;
}
/**
* @generated from protobuf message routerrpc.QueryProbabilityResponse
@ -603,7 +603,7 @@ export interface BuildRouteRequest {
*
* @generated from protobuf field: int64 amt_msat = 1;
*/
amtMsat: bigint;
amtMsat: number;
/**
*
* CLTV delta from the current height that should be used for the timelock
@ -671,7 +671,7 @@ export interface HtlcEvent {
*
* @generated from protobuf field: uint64 incoming_channel_id = 1;
*/
incomingChannelId: bigint;
incomingChannelId: number;
/**
*
* The short channel id that the outgoing htlc left our node on. This value
@ -679,7 +679,7 @@ export interface HtlcEvent {
*
* @generated from protobuf field: uint64 outgoing_channel_id = 2;
*/
outgoingChannelId: bigint;
outgoingChannelId: number;
/**
*
* Incoming id is the index of the incoming htlc in the incoming channel.
@ -687,7 +687,7 @@ export interface HtlcEvent {
*
* @generated from protobuf field: uint64 incoming_htlc_id = 3;
*/
incomingHtlcId: bigint;
incomingHtlcId: number;
/**
*
* Outgoing id is the index of the outgoing htlc in the outgoing channel.
@ -695,14 +695,14 @@ export interface HtlcEvent {
*
* @generated from protobuf field: uint64 outgoing_htlc_id = 4;
*/
outgoingHtlcId: bigint;
outgoingHtlcId: number;
/**
*
* The time in unix nanoseconds that the event occurred.
*
* @generated from protobuf field: uint64 timestamp_ns = 5;
*/
timestampNs: bigint;
timestampNs: number;
/**
*
* The event type indicates whether the htlc was part of a send, receive or
@ -796,13 +796,13 @@ export interface HtlcInfo {
*
* @generated from protobuf field: uint64 incoming_amt_msat = 3;
*/
incomingAmtMsat: bigint;
incomingAmtMsat: number;
/**
* The amount of the outgoing htlc.
*
* @generated from protobuf field: uint64 outgoing_amt_msat = 4;
*/
outgoingAmtMsat: bigint;
outgoingAmtMsat: number;
}
/**
* @generated from protobuf message routerrpc.ForwardEvent
@ -915,13 +915,13 @@ export interface CircuitKey {
*
* @generated from protobuf field: uint64 chan_id = 1;
*/
chanId: bigint;
chanId: number;
/**
* / The index of the incoming htlc in the incoming channel.
*
* @generated from protobuf field: uint64 htlc_id = 2;
*/
htlcId: bigint;
htlcId: number;
}
/**
* @generated from protobuf message routerrpc.ForwardHtlcInterceptRequest
@ -940,7 +940,7 @@ export interface ForwardHtlcInterceptRequest {
*
* @generated from protobuf field: uint64 incoming_amount_msat = 5;
*/
incomingAmountMsat: bigint;
incomingAmountMsat: number;
/**
* The incoming htlc expiry.
*
@ -963,13 +963,13 @@ export interface ForwardHtlcInterceptRequest {
*
* @generated from protobuf field: uint64 outgoing_requested_chan_id = 7;
*/
outgoingRequestedChanId: bigint;
outgoingRequestedChanId: number;
/**
* The outgoing htlc amount.
*
* @generated from protobuf field: uint64 outgoing_amount_msat = 3;
*/
outgoingAmountMsat: bigint;
outgoingAmountMsat: number;
/**
* The outgoing htlc expiry.
*
@ -1261,17 +1261,17 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
constructor() {
super("routerrpc.SendPaymentRequest", [
{ no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 3, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
{ no: 20, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 5, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 6, name: "timeout_seconds", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
{ no: 7, name: "fee_limit_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 7, name: "fee_limit_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 8, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
{ no: 19, name: "outgoing_chan_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 19, name: "outgoing_chan_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 14, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 9, name: "cltv_limit", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
{ no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint },
@ -1280,13 +1280,13 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
{ no: 16, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] },
{ no: 17, name: "max_parts", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 18, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
{ no: 21, name: "max_shard_size_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 21, name: "max_shard_size_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 22, name: "amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
{ no: 23, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }
]);
}
create(value?: PartialMessage<SendPaymentRequest>): SendPaymentRequest {
const message = { dest: new Uint8Array(0), amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: 0n, feeLimitMsat: 0n, outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: 0n, amp: false, timePref: 0 };
const message = { dest: new Uint8Array(0), amt: 0, amtMsat: 0, paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: 0, feeLimitMsat: 0, outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: 0, amp: false, timePref: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<SendPaymentRequest>(this, message, value);
@ -1301,10 +1301,10 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
message.dest = reader.bytes();
break;
case /* int64 amt */ 2:
message.amt = reader.int64().toBigInt();
message.amt = reader.int64().toNumber();
break;
case /* int64 amt_msat */ 12:
message.amtMsat = reader.int64().toBigInt();
message.amtMsat = reader.int64().toNumber();
break;
case /* bytes payment_hash */ 3:
message.paymentHash = reader.bytes();
@ -1322,10 +1322,10 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
message.timeoutSeconds = reader.int32();
break;
case /* int64 fee_limit_sat */ 7:
message.feeLimitSat = reader.int64().toBigInt();
message.feeLimitSat = reader.int64().toNumber();
break;
case /* int64 fee_limit_msat */ 13:
message.feeLimitMsat = reader.int64().toBigInt();
message.feeLimitMsat = reader.int64().toNumber();
break;
case /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING];*/ 8:
message.outgoingChanId = reader.uint64().toString();
@ -1333,9 +1333,9 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
case /* repeated uint64 outgoing_chan_ids */ 19:
if (wireType === WireType.LengthDelimited)
for (let e = reader.int32() + reader.pos; reader.pos < e;)
message.outgoingChanIds.push(reader.uint64().toBigInt());
message.outgoingChanIds.push(reader.uint64().toNumber());
else
message.outgoingChanIds.push(reader.uint64().toBigInt());
message.outgoingChanIds.push(reader.uint64().toNumber());
break;
case /* bytes last_hop_pubkey */ 14:
message.lastHopPubkey = reader.bytes();
@ -1366,7 +1366,7 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
message.noInflightUpdates = reader.bool();
break;
case /* uint64 max_shard_size_msat */ 21:
message.maxShardSizeMsat = reader.uint64().toBigInt();
message.maxShardSizeMsat = reader.uint64().toNumber();
break;
case /* bool amp */ 22:
message.amp = reader.bool();
@ -1406,10 +1406,10 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
if (message.dest.length)
writer.tag(1, WireType.LengthDelimited).bytes(message.dest);
/* int64 amt = 2; */
if (message.amt !== 0n)
if (message.amt !== 0)
writer.tag(2, WireType.Varint).int64(message.amt);
/* int64 amt_msat = 12; */
if (message.amtMsat !== 0n)
if (message.amtMsat !== 0)
writer.tag(12, WireType.Varint).int64(message.amtMsat);
/* bytes payment_hash = 3; */
if (message.paymentHash.length)
@ -1427,10 +1427,10 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
if (message.timeoutSeconds !== 0)
writer.tag(6, WireType.Varint).int32(message.timeoutSeconds);
/* int64 fee_limit_sat = 7; */
if (message.feeLimitSat !== 0n)
if (message.feeLimitSat !== 0)
writer.tag(7, WireType.Varint).int64(message.feeLimitSat);
/* int64 fee_limit_msat = 13; */
if (message.feeLimitMsat !== 0n)
if (message.feeLimitMsat !== 0)
writer.tag(13, WireType.Varint).int64(message.feeLimitMsat);
/* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; */
if (message.outgoingChanId !== "0")
@ -1471,7 +1471,7 @@ class SendPaymentRequest$Type extends MessageType<SendPaymentRequest> {
if (message.noInflightUpdates !== false)
writer.tag(18, WireType.Varint).bool(message.noInflightUpdates);
/* uint64 max_shard_size_msat = 21; */
if (message.maxShardSizeMsat !== 0n)
if (message.maxShardSizeMsat !== 0)
writer.tag(21, WireType.Varint).uint64(message.maxShardSizeMsat);
/* bool amp = 22; */
if (message.amp !== false)
@ -1595,11 +1595,11 @@ class RouteFeeRequest$Type extends MessageType<RouteFeeRequest> {
constructor() {
super("routerrpc.RouteFeeRequest", [
{ no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 2, name: "amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 2, name: "amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<RouteFeeRequest>): RouteFeeRequest {
const message = { dest: new Uint8Array(0), amtSat: 0n };
const message = { dest: new Uint8Array(0), amtSat: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<RouteFeeRequest>(this, message, value);
@ -1614,7 +1614,7 @@ class RouteFeeRequest$Type extends MessageType<RouteFeeRequest> {
message.dest = reader.bytes();
break;
case /* int64 amt_sat */ 2:
message.amtSat = reader.int64().toBigInt();
message.amtSat = reader.int64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -1632,7 +1632,7 @@ class RouteFeeRequest$Type extends MessageType<RouteFeeRequest> {
if (message.dest.length)
writer.tag(1, WireType.LengthDelimited).bytes(message.dest);
/* int64 amt_sat = 2; */
if (message.amtSat !== 0n)
if (message.amtSat !== 0)
writer.tag(2, WireType.Varint).int64(message.amtSat);
let u = options.writeUnknownFields;
if (u !== false)
@ -1648,12 +1648,12 @@ export const RouteFeeRequest = new RouteFeeRequest$Type();
class RouteFeeResponse$Type extends MessageType<RouteFeeResponse> {
constructor() {
super("routerrpc.RouteFeeResponse", [
{ no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<RouteFeeResponse>): RouteFeeResponse {
const message = { routingFeeMsat: 0n, timeLockDelay: 0n };
const message = { routingFeeMsat: 0, timeLockDelay: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<RouteFeeResponse>(this, message, value);
@ -1665,10 +1665,10 @@ class RouteFeeResponse$Type extends MessageType<RouteFeeResponse> {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* int64 routing_fee_msat */ 1:
message.routingFeeMsat = reader.int64().toBigInt();
message.routingFeeMsat = reader.int64().toNumber();
break;
case /* int64 time_lock_delay */ 2:
message.timeLockDelay = reader.int64().toBigInt();
message.timeLockDelay = reader.int64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -1683,10 +1683,10 @@ class RouteFeeResponse$Type extends MessageType<RouteFeeResponse> {
}
internalBinaryWrite(message: RouteFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* int64 routing_fee_msat = 1; */
if (message.routingFeeMsat !== 0n)
if (message.routingFeeMsat !== 0)
writer.tag(1, WireType.Varint).int64(message.routingFeeMsat);
/* int64 time_lock_delay = 2; */
if (message.timeLockDelay !== 0n)
if (message.timeLockDelay !== 0)
writer.tag(2, WireType.Varint).int64(message.timeLockDelay);
let u = options.writeUnknownFields;
if (u !== false)
@ -2083,16 +2083,16 @@ export const PairHistory = new PairHistory$Type();
class PairData$Type extends MessageType<PairData> {
constructor() {
super("routerrpc.PairData", [
{ no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<PairData>): PairData {
const message = { failTime: 0n, failAmtSat: 0n, failAmtMsat: 0n, successTime: 0n, successAmtSat: 0n, successAmtMsat: 0n };
const message = { failTime: 0, failAmtSat: 0, failAmtMsat: 0, successTime: 0, successAmtSat: 0, successAmtMsat: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<PairData>(this, message, value);
@ -2104,22 +2104,22 @@ class PairData$Type extends MessageType<PairData> {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* int64 fail_time */ 1:
message.failTime = reader.int64().toBigInt();
message.failTime = reader.int64().toNumber();
break;
case /* int64 fail_amt_sat */ 2:
message.failAmtSat = reader.int64().toBigInt();
message.failAmtSat = reader.int64().toNumber();
break;
case /* int64 fail_amt_msat */ 4:
message.failAmtMsat = reader.int64().toBigInt();
message.failAmtMsat = reader.int64().toNumber();
break;
case /* int64 success_time */ 5:
message.successTime = reader.int64().toBigInt();
message.successTime = reader.int64().toNumber();
break;
case /* int64 success_amt_sat */ 6:
message.successAmtSat = reader.int64().toBigInt();
message.successAmtSat = reader.int64().toNumber();
break;
case /* int64 success_amt_msat */ 7:
message.successAmtMsat = reader.int64().toBigInt();
message.successAmtMsat = reader.int64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -2134,22 +2134,22 @@ class PairData$Type extends MessageType<PairData> {
}
internalBinaryWrite(message: PairData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* int64 fail_time = 1; */
if (message.failTime !== 0n)
if (message.failTime !== 0)
writer.tag(1, WireType.Varint).int64(message.failTime);
/* int64 fail_amt_sat = 2; */
if (message.failAmtSat !== 0n)
if (message.failAmtSat !== 0)
writer.tag(2, WireType.Varint).int64(message.failAmtSat);
/* int64 fail_amt_msat = 4; */
if (message.failAmtMsat !== 0n)
if (message.failAmtMsat !== 0)
writer.tag(4, WireType.Varint).int64(message.failAmtMsat);
/* int64 success_time = 5; */
if (message.successTime !== 0n)
if (message.successTime !== 0)
writer.tag(5, WireType.Varint).int64(message.successTime);
/* int64 success_amt_sat = 6; */
if (message.successAmtSat !== 0n)
if (message.successAmtSat !== 0)
writer.tag(6, WireType.Varint).int64(message.successAmtSat);
/* int64 success_amt_msat = 7; */
if (message.successAmtMsat !== 0n)
if (message.successAmtMsat !== 0)
writer.tag(7, WireType.Varint).int64(message.successAmtMsat);
let u = options.writeUnknownFields;
if (u !== false)
@ -2311,15 +2311,15 @@ export const SetMissionControlConfigResponse = new SetMissionControlConfigRespon
class MissionControlConfig$Type extends MessageType<MissionControlConfig> {
constructor() {
super("routerrpc.MissionControlConfig", [
{ no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 2, name: "hop_probability", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
{ no: 3, name: "weight", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ },
{ no: 4, name: "maximum_payment_results", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<MissionControlConfig>): MissionControlConfig {
const message = { halfLifeSeconds: 0n, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0n };
const message = { halfLifeSeconds: 0, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<MissionControlConfig>(this, message, value);
@ -2331,7 +2331,7 @@ class MissionControlConfig$Type extends MessageType<MissionControlConfig> {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint64 half_life_seconds */ 1:
message.halfLifeSeconds = reader.uint64().toBigInt();
message.halfLifeSeconds = reader.uint64().toNumber();
break;
case /* float hop_probability */ 2:
message.hopProbability = reader.float();
@ -2343,7 +2343,7 @@ class MissionControlConfig$Type extends MessageType<MissionControlConfig> {
message.maximumPaymentResults = reader.uint32();
break;
case /* uint64 minimum_failure_relax_interval */ 5:
message.minimumFailureRelaxInterval = reader.uint64().toBigInt();
message.minimumFailureRelaxInterval = reader.uint64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -2358,7 +2358,7 @@ class MissionControlConfig$Type extends MessageType<MissionControlConfig> {
}
internalBinaryWrite(message: MissionControlConfig, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint64 half_life_seconds = 1; */
if (message.halfLifeSeconds !== 0n)
if (message.halfLifeSeconds !== 0)
writer.tag(1, WireType.Varint).uint64(message.halfLifeSeconds);
/* float hop_probability = 2; */
if (message.hopProbability !== 0)
@ -2370,7 +2370,7 @@ class MissionControlConfig$Type extends MessageType<MissionControlConfig> {
if (message.maximumPaymentResults !== 0)
writer.tag(4, WireType.Varint).uint32(message.maximumPaymentResults);
/* uint64 minimum_failure_relax_interval = 5; */
if (message.minimumFailureRelaxInterval !== 0n)
if (message.minimumFailureRelaxInterval !== 0)
writer.tag(5, WireType.Varint).uint64(message.minimumFailureRelaxInterval);
let u = options.writeUnknownFields;
if (u !== false)
@ -2388,11 +2388,11 @@ class QueryProbabilityRequest$Type extends MessageType<QueryProbabilityRequest>
super("routerrpc.QueryProbabilityRequest", [
{ no: 1, name: "from_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 2, name: "to_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 3, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 3, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<QueryProbabilityRequest>): QueryProbabilityRequest {
const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: 0n };
const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<QueryProbabilityRequest>(this, message, value);
@ -2410,7 +2410,7 @@ class QueryProbabilityRequest$Type extends MessageType<QueryProbabilityRequest>
message.toNode = reader.bytes();
break;
case /* int64 amt_msat */ 3:
message.amtMsat = reader.int64().toBigInt();
message.amtMsat = reader.int64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -2431,7 +2431,7 @@ class QueryProbabilityRequest$Type extends MessageType<QueryProbabilityRequest>
if (message.toNode.length)
writer.tag(2, WireType.LengthDelimited).bytes(message.toNode);
/* int64 amt_msat = 3; */
if (message.amtMsat !== 0n)
if (message.amtMsat !== 0)
writer.tag(3, WireType.Varint).int64(message.amtMsat);
let u = options.writeUnknownFields;
if (u !== false)
@ -2501,7 +2501,7 @@ export const QueryProbabilityResponse = new QueryProbabilityResponse$Type();
class BuildRouteRequest$Type extends MessageType<BuildRouteRequest> {
constructor() {
super("routerrpc.BuildRouteRequest", [
{ no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 2, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
{ no: 3, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
{ no: 4, name: "hop_pubkeys", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ },
@ -2509,7 +2509,7 @@ class BuildRouteRequest$Type extends MessageType<BuildRouteRequest> {
]);
}
create(value?: PartialMessage<BuildRouteRequest>): BuildRouteRequest {
const message = { amtMsat: 0n, finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) };
const message = { amtMsat: 0, finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<BuildRouteRequest>(this, message, value);
@ -2521,7 +2521,7 @@ class BuildRouteRequest$Type extends MessageType<BuildRouteRequest> {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* int64 amt_msat */ 1:
message.amtMsat = reader.int64().toBigInt();
message.amtMsat = reader.int64().toNumber();
break;
case /* int32 final_cltv_delta */ 2:
message.finalCltvDelta = reader.int32();
@ -2548,7 +2548,7 @@ class BuildRouteRequest$Type extends MessageType<BuildRouteRequest> {
}
internalBinaryWrite(message: BuildRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* int64 amt_msat = 1; */
if (message.amtMsat !== 0n)
if (message.amtMsat !== 0)
writer.tag(1, WireType.Varint).int64(message.amtMsat);
/* int32 final_cltv_delta = 2; */
if (message.finalCltvDelta !== 0)
@ -2649,11 +2649,11 @@ export const SubscribeHtlcEventsRequest = new SubscribeHtlcEventsRequest$Type();
class HtlcEvent$Type extends MessageType<HtlcEvent> {
constructor() {
super("routerrpc.HtlcEvent", [
{ no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 6, name: "event_type", kind: "enum", T: () => ["routerrpc.HtlcEvent.EventType", HtlcEvent_EventType] },
{ no: 7, name: "forward_event", kind: "message", oneof: "event", T: () => ForwardEvent },
{ no: 8, name: "forward_fail_event", kind: "message", oneof: "event", T: () => ForwardFailEvent },
@ -2664,7 +2664,7 @@ class HtlcEvent$Type extends MessageType<HtlcEvent> {
]);
}
create(value?: PartialMessage<HtlcEvent>): HtlcEvent {
const message = { incomingChannelId: 0n, outgoingChannelId: 0n, incomingHtlcId: 0n, outgoingHtlcId: 0n, timestampNs: 0n, eventType: 0, event: { oneofKind: undefined } };
const message = { incomingChannelId: 0, outgoingChannelId: 0, incomingHtlcId: 0, outgoingHtlcId: 0, timestampNs: 0, eventType: 0, event: { oneofKind: undefined } };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<HtlcEvent>(this, message, value);
@ -2676,19 +2676,19 @@ class HtlcEvent$Type extends MessageType<HtlcEvent> {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint64 incoming_channel_id */ 1:
message.incomingChannelId = reader.uint64().toBigInt();
message.incomingChannelId = reader.uint64().toNumber();
break;
case /* uint64 outgoing_channel_id */ 2:
message.outgoingChannelId = reader.uint64().toBigInt();
message.outgoingChannelId = reader.uint64().toNumber();
break;
case /* uint64 incoming_htlc_id */ 3:
message.incomingHtlcId = reader.uint64().toBigInt();
message.incomingHtlcId = reader.uint64().toNumber();
break;
case /* uint64 outgoing_htlc_id */ 4:
message.outgoingHtlcId = reader.uint64().toBigInt();
message.outgoingHtlcId = reader.uint64().toNumber();
break;
case /* uint64 timestamp_ns */ 5:
message.timestampNs = reader.uint64().toBigInt();
message.timestampNs = reader.uint64().toNumber();
break;
case /* routerrpc.HtlcEvent.EventType event_type */ 6:
message.eventType = reader.int32();
@ -2742,19 +2742,19 @@ class HtlcEvent$Type extends MessageType<HtlcEvent> {
}
internalBinaryWrite(message: HtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint64 incoming_channel_id = 1; */
if (message.incomingChannelId !== 0n)
if (message.incomingChannelId !== 0)
writer.tag(1, WireType.Varint).uint64(message.incomingChannelId);
/* uint64 outgoing_channel_id = 2; */
if (message.outgoingChannelId !== 0n)
if (message.outgoingChannelId !== 0)
writer.tag(2, WireType.Varint).uint64(message.outgoingChannelId);
/* uint64 incoming_htlc_id = 3; */
if (message.incomingHtlcId !== 0n)
if (message.incomingHtlcId !== 0)
writer.tag(3, WireType.Varint).uint64(message.incomingHtlcId);
/* uint64 outgoing_htlc_id = 4; */
if (message.outgoingHtlcId !== 0n)
if (message.outgoingHtlcId !== 0)
writer.tag(4, WireType.Varint).uint64(message.outgoingHtlcId);
/* uint64 timestamp_ns = 5; */
if (message.timestampNs !== 0n)
if (message.timestampNs !== 0)
writer.tag(5, WireType.Varint).uint64(message.timestampNs);
/* routerrpc.HtlcEvent.EventType event_type = 6; */
if (message.eventType !== 0)
@ -2793,12 +2793,12 @@ class HtlcInfo$Type extends MessageType<HtlcInfo> {
super("routerrpc.HtlcInfo", [
{ no: 1, name: "incoming_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "outgoing_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 3, name: "incoming_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 3, name: "incoming_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<HtlcInfo>): HtlcInfo {
const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: 0n, outgoingAmtMsat: 0n };
const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: 0, outgoingAmtMsat: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<HtlcInfo>(this, message, value);
@ -2816,10 +2816,10 @@ class HtlcInfo$Type extends MessageType<HtlcInfo> {
message.outgoingTimelock = reader.uint32();
break;
case /* uint64 incoming_amt_msat */ 3:
message.incomingAmtMsat = reader.uint64().toBigInt();
message.incomingAmtMsat = reader.uint64().toNumber();
break;
case /* uint64 outgoing_amt_msat */ 4:
message.outgoingAmtMsat = reader.uint64().toBigInt();
message.outgoingAmtMsat = reader.uint64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -2840,10 +2840,10 @@ class HtlcInfo$Type extends MessageType<HtlcInfo> {
if (message.outgoingTimelock !== 0)
writer.tag(2, WireType.Varint).uint32(message.outgoingTimelock);
/* uint64 incoming_amt_msat = 3; */
if (message.incomingAmtMsat !== 0n)
if (message.incomingAmtMsat !== 0)
writer.tag(3, WireType.Varint).uint64(message.incomingAmtMsat);
/* uint64 outgoing_amt_msat = 4; */
if (message.outgoingAmtMsat !== 0n)
if (message.outgoingAmtMsat !== 0)
writer.tag(4, WireType.Varint).uint64(message.outgoingAmtMsat);
let u = options.writeUnknownFields;
if (u !== false)
@ -3188,12 +3188,12 @@ export const PaymentStatus = new PaymentStatus$Type();
class CircuitKey$Type extends MessageType<CircuitKey> {
constructor() {
super("routerrpc.CircuitKey", [
{ no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
{ no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }
]);
}
create(value?: PartialMessage<CircuitKey>): CircuitKey {
const message = { chanId: 0n, htlcId: 0n };
const message = { chanId: 0, htlcId: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<CircuitKey>(this, message, value);
@ -3205,10 +3205,10 @@ class CircuitKey$Type extends MessageType<CircuitKey> {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* uint64 chan_id */ 1:
message.chanId = reader.uint64().toBigInt();
message.chanId = reader.uint64().toNumber();
break;
case /* uint64 htlc_id */ 2:
message.htlcId = reader.uint64().toBigInt();
message.htlcId = reader.uint64().toNumber();
break;
default:
let u = options.readUnknownField;
@ -3223,10 +3223,10 @@ class CircuitKey$Type extends MessageType<CircuitKey> {
}
internalBinaryWrite(message: CircuitKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* uint64 chan_id = 1; */
if (message.chanId !== 0n)
if (message.chanId !== 0)
writer.tag(1, WireType.Varint).uint64(message.chanId);
/* uint64 htlc_id = 2; */
if (message.htlcId !== 0n)
if (message.htlcId !== 0)
writer.tag(2, WireType.Varint).uint64(message.htlcId);
let u = options.writeUnknownFields;
if (u !== false)
@ -3243,11 +3243,11 @@ class ForwardHtlcInterceptRequest$Type extends MessageType<ForwardHtlcInterceptR
constructor() {
super("routerrpc.ForwardHtlcInterceptRequest", [
{ no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey },
{ no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 6, name: "incoming_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 2, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
{ no: 7, name: "outgoing_requested_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
{ no: 7, name: "outgoing_requested_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ },
{ no: 4, name: "outgoing_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
{ no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } },
{ no: 9, name: "onion_blob", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
@ -3255,7 +3255,7 @@ class ForwardHtlcInterceptRequest$Type extends MessageType<ForwardHtlcInterceptR
]);
}
create(value?: PartialMessage<ForwardHtlcInterceptRequest>): ForwardHtlcInterceptRequest {
const message = { incomingAmountMsat: 0n, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0n, outgoingAmountMsat: 0n, outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0), autoFailHeight: 0 };
const message = { incomingAmountMsat: 0, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0, outgoingAmountMsat: 0, outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0), autoFailHeight: 0 };
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
reflectionMergePartial<ForwardHtlcInterceptRequest>(this, message, value);
@ -3270,7 +3270,7 @@ class ForwardHtlcInterceptRequest$Type extends MessageType<ForwardHtlcInterceptR
message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey);
break;
case /* uint64 incoming_amount_msat */ 5:
message.incomingAmountMsat = reader.uint64().toBigInt();
message.incomingAmountMsat = reader.uint64().toNumber();
break;
case /* uint32 incoming_expiry */ 6:
message.incomingExpiry = reader.uint32();
@ -3279,10 +3279,10 @@ class ForwardHtlcInterceptRequest$Type extends MessageType<ForwardHtlcInterceptR
message.paymentHash = reader.bytes();
break;
case /* uint64 outgoing_requested_chan_id */ 7:
message.outgoingRequestedChanId = reader.uint64().toBigInt();
message.outgoingRequestedChanId = reader.uint64().toNumber();
break;
case /* uint64 outgoing_amount_msat */ 3:
message.outgoingAmountMsat = reader.uint64().toBigInt();
message.outgoingAmountMsat = reader.uint64().toNumber();
break;
case /* uint32 outgoing_expiry */ 4:
message.outgoingExpiry = reader.uint32();
@ -3328,7 +3328,7 @@ class ForwardHtlcInterceptRequest$Type extends MessageType<ForwardHtlcInterceptR
if (message.incomingCircuitKey)
CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* uint64 incoming_amount_msat = 5; */
if (message.incomingAmountMsat !== 0n)
if (message.incomingAmountMsat !== 0)
writer.tag(5, WireType.Varint).uint64(message.incomingAmountMsat);
/* uint32 incoming_expiry = 6; */
if (message.incomingExpiry !== 0)
@ -3337,10 +3337,10 @@ class ForwardHtlcInterceptRequest$Type extends MessageType<ForwardHtlcInterceptR
if (message.paymentHash.length)
writer.tag(2, WireType.LengthDelimited).bytes(message.paymentHash);
/* uint64 outgoing_requested_chan_id = 7; */
if (message.outgoingRequestedChanId !== 0n)
if (message.outgoingRequestedChanId !== 0)
writer.tag(7, WireType.Varint).uint64(message.outgoingRequestedChanId);
/* uint64 outgoing_amount_msat = 3; */
if (message.outgoingAmountMsat !== 0n)
if (message.outgoingAmountMsat !== 0)
writer.tag(3, WireType.Varint).uint64(message.outgoingAmountMsat);
/* uint32 outgoing_expiry = 4; */
if (message.outgoingExpiry !== 0)