lnurl withdraw + lnurl pay

This commit is contained in:
hatim boufnichel 2022-11-19 23:02:05 +01:00
parent 6f531cf69f
commit 91d67ab4ee
48 changed files with 2287 additions and 32905 deletions

File diff suppressed because it is too large Load diff

View file

@ -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', ...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', ...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', ...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', ...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', ...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', ...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', ...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,22 +161,77 @@ 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', ...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')
app.post('/api/user/lnurl_channel', async (req, res) => {
if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented')
app.get('/api/user/lnurl_withdraw/link', async (req, res) => {
try {
if (!methods.GetOpenChannelLNURL) throw new Error('method: GetOpenChannelLNURL is not implemented')
if (!methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented')
const authContext = await opts.UserAuthGuard(req.headers['authorization'])
const query = req.query
const params = req.params
const response = await methods.GetOpenChannelLNURL({ ...authContext, ...query, ...params })
res.json({ status: 'OK', result: response })
const response = await methods.GetLnurlWithdrawLink({ ...authContext, ...query, ...params })
res.json({status: 'OK', ...response})
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented')
app.get('/api/guest/lnurl_withdraw/info', async (req, res) => {
try {
if (!methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented')
const authContext = await opts.GuestAuthGuard(req.headers['authorization'])
const query = req.query
const params = req.params
const response = await methods.GetLnurlWithdrawInfo({ ...authContext, ...query, ...params })
res.json({status: 'OK', ...response})
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented')
app.get('/api/guest/lnurl_withdraw/handle', async (req, res) => {
try {
if (!methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented')
const authContext = await opts.GuestAuthGuard(req.headers['authorization'])
const query = req.query
const params = req.params
await methods.HandleLnurlWithdraw({ ...authContext, ...query, ...params })
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.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented')
app.get('/api/guest/lnurl_pay/info', async (req, res) => {
try {
if (!methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented')
const authContext = await opts.GuestAuthGuard(req.headers['authorization'])
const query = req.query
const params = req.params
const response = await methods.GetLnurlPayInfo({ ...authContext, ...query, ...params })
res.json({status: 'OK', ...response})
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented')
app.get('/api/guest/lnurl_pay/handle', async (req, res) => {
try {
if (!methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented')
const authContext = await opts.GuestAuthGuard(req.headers['authorization'])
const query = req.query
const params = req.params
const response = await methods.HandleLnurlPay({ ...authContext, ...query, ...params })
res.json({status: 'OK', ...response})
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented')
app.post('/api/user/lnurl_channel/url', async (req, res) => {
try {
if (!methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented')
const authContext = await opts.UserAuthGuard(req.headers['authorization'])
const query = req.query
const params = req.params
const response = await methods.GetLNURLChannelLink({ ...authContext, ...query, ...params })
res.json({status: 'OK', ...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

@ -11,144 +11,229 @@ export type ClientParams = {
encryptCallback: (plain: any) => Promise<any>
decryptCallback: (encrypted: any) => Promise<any>
deviceId: string
checkResult?: true
}
export default (params: ClientParams) => ({
Health: async (): Promise<ResultError | { status: 'OK' }> => {
Health: async (): Promise<ResultError | ({ status: 'OK' })> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
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' }
},
EncryptionExchange: async (request: Types.EncryptionExchangeRequest): Promise<ResultError | { status: 'OK' }> => {
EncryptionExchange: async (request: Types.EncryptionExchangeRequest): Promise<ResultError | ({ status: 'OK' })> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
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' }
},
LndGetInfo: async (request: Types.LndGetInfoRequest): Promise<ResultError | { status: 'OK', result: Types.LndGetInfoResponse }> => {
LndGetInfo: async (request: Types.LndGetInfoRequest): Promise<ResultError | ({ status: 'OK' }& Types.LndGetInfoResponse)> => {
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') {
const result = await params.decryptCallback(data.result)
if (data.status === 'OK') {
const result = await params.decryptCallback(data)
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LndGetInfoResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
AddUser: async (request: Types.AddUserRequest): Promise<ResultError | { status: 'OK', result: Types.AddUserResponse }> => {
AddUser: async (request: Types.AddUserRequest): Promise<ResultError | ({ status: 'OK' }& Types.AddUserResponse)> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.AddUserResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
AuthUser: async (request: Types.AuthUserRequest): Promise<ResultError | { status: 'OK', result: Types.AuthUserResponse }> => {
AuthUser: async (request: Types.AuthUserRequest): Promise<ResultError | ({ status: 'OK' }& Types.AuthUserResponse)> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.AuthUserResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
NewAddress: async (request: Types.NewAddressRequest): Promise<ResultError | { status: 'OK', result: Types.NewAddressResponse }> => {
NewAddress: async (request: Types.NewAddressRequest): Promise<ResultError | ({ status: 'OK' }& Types.NewAddressResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.NewAddressResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
PayAddress: async (request: Types.PayAddressRequest): Promise<ResultError | { status: 'OK', result: Types.PayAddressResponse }> => {
PayAddress: async (request: Types.PayAddressRequest): Promise<ResultError | ({ status: 'OK' }& Types.PayAddressResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.PayAddressResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
NewInvoice: async (request: Types.NewInvoiceRequest): Promise<ResultError | { status: 'OK', result: Types.NewInvoiceResponse }> => {
NewInvoice: async (request: Types.NewInvoiceRequest): Promise<ResultError | ({ status: 'OK' }& Types.NewInvoiceResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.NewInvoiceResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
PayInvoice: async (request: Types.PayInvoiceRequest): Promise<ResultError | { status: 'OK', result: Types.PayInvoiceResponse }> => {
PayInvoice: async (request: Types.PayInvoiceRequest): Promise<ResultError | ({ status: 'OK' }& Types.PayInvoiceResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.PayInvoiceResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
OpenChannel: async (request: Types.OpenChannelRequest): Promise<ResultError | { status: 'OK', result: Types.OpenChannelResponse }> => {
OpenChannel: async (request: Types.OpenChannelRequest): Promise<ResultError | ({ status: 'OK' }& Types.OpenChannelResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
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') {
const result = data.result
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.OpenChannelResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
GetOpenChannelLNURL: async (): Promise<ResultError | { status: 'OK', result: Types.GetOpenChannelLNURLResponse }> => {
GetLnurlWithdrawLink: async (): Promise<ResultError | ({ status: 'OK' }& Types.LnurlLinkResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
let finalRoute = '/api/user/lnurl_channel'
let finalRoute = '/api/user/lnurl_withdraw/link'
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') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LnurlLinkResponseValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
GetLnurlWithdrawInfo: async (query: Types.GetLnurlWithdrawInfo_Query): Promise<ResultError | ({ status: 'OK' }& Types.LnurlWithdrawInfoResponse)> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
let finalRoute = '/api/guest/lnurl_withdraw/info'
const q = (new URLSearchParams(query)).toString()
finalRoute = finalRoute + (q === '' ? '' : '?' + q)
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') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LnurlWithdrawInfoResponseValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
HandleLnurlWithdraw: async (query: Types.HandleLnurlWithdraw_Query): Promise<ResultError | ({ status: 'OK' })> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
let finalRoute = '/api/guest/lnurl_withdraw/handle'
const q = (new URLSearchParams(query)).toString()
finalRoute = finalRoute + (q === '' ? '' : '?' + q)
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') {
return data
}
return { status: 'ERROR', reason: 'invalid response' }
},
GetLnurlPayInfo: async (query: Types.GetLnurlPayInfo_Query): Promise<ResultError | ({ status: 'OK' }& Types.LnurlPayInfoResponse)> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
let finalRoute = '/api/guest/lnurl_pay/info'
const q = (new URLSearchParams(query)).toString()
finalRoute = finalRoute + (q === '' ? '' : '?' + q)
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') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LnurlPayInfoResponseValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
HandleLnurlPay: async (query: Types.HandleLnurlPay_Query): Promise<ResultError | ({ status: 'OK' }& Types.HandleLnurlPayResponse)> => {
const auth = await params.retrieveGuestAuth()
if (auth === null) throw new Error('retrieveGuestAuth() returned null')
let finalRoute = '/api/guest/lnurl_pay/handle'
const q = (new URLSearchParams(query)).toString()
finalRoute = finalRoute + (q === '' ? '' : '?' + q)
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') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.HandleLnurlPayResponseValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
GetLNURLChannelLink: async (): Promise<ResultError | ({ status: 'OK' }& Types.LnurlLinkResponse)> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
let finalRoute = '/api/user/lnurl_channel/url'
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') {
const result = data.result
const error = Types.GetOpenChannelLNURLResponseValidate(result)
if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message }
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LnurlLinkResponseValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},

View file

@ -60,11 +60,42 @@ export type OpenChannel_Query = {
export type OpenChannel_RouteParams = {
}
export type OpenChannel_Context = OpenChannel_Query & OpenChannel_RouteParams & UserContext
export type GetOpenChannelLNURL_Query = {
export type GetLnurlWithdrawLink_Query = {
}
export type GetOpenChannelLNURL_RouteParams = {
export type GetLnurlWithdrawLink_RouteParams = {
}
export type GetOpenChannelLNURL_Context = GetOpenChannelLNURL_Query & GetOpenChannelLNURL_RouteParams & UserContext
export type GetLnurlWithdrawLink_Context = GetLnurlWithdrawLink_Query & GetLnurlWithdrawLink_RouteParams & UserContext
export type GetLnurlWithdrawInfo_Query = {
k1?: string
}
export type GetLnurlWithdrawInfo_RouteParams = {
}
export type GetLnurlWithdrawInfo_Context = GetLnurlWithdrawInfo_Query & GetLnurlWithdrawInfo_RouteParams & GuestContext
export type HandleLnurlWithdraw_Query = {
k1?: string
pr?: string
}
export type HandleLnurlWithdraw_RouteParams = {
}
export type HandleLnurlWithdraw_Context = HandleLnurlWithdraw_Query & HandleLnurlWithdraw_RouteParams & GuestContext
export type GetLnurlPayInfo_Query = {
k1?: string
}
export type GetLnurlPayInfo_RouteParams = {
}
export type GetLnurlPayInfo_Context = GetLnurlPayInfo_Query & GetLnurlPayInfo_RouteParams & GuestContext
export type HandleLnurlPay_Query = {
k1?: string
amount?: string
}
export type HandleLnurlPay_RouteParams = {
}
export type HandleLnurlPay_Context = HandleLnurlPay_Query & HandleLnurlPay_RouteParams & GuestContext
export type GetLNURLChannelLink_Query = {
}
export type GetLNURLChannelLink_RouteParams = {
}
export type GetLNURLChannelLink_Context = GetLNURLChannelLink_Query & GetLNURLChannelLink_RouteParams & UserContext
export type ServerMethods = {
Health?: (ctx: Health_Context) => Promise<void>
EncryptionExchange?: (ctx: EncryptionExchange_Context, req: EncryptionExchangeRequest) => Promise<void>
@ -76,7 +107,12 @@ export type ServerMethods = {
NewInvoice?: (ctx: NewInvoice_Context, req: NewInvoiceRequest) => Promise<NewInvoiceResponse>
PayInvoice?: (ctx: PayInvoice_Context, req: PayInvoiceRequest) => Promise<PayInvoiceResponse>
OpenChannel?: (ctx: OpenChannel_Context, req: OpenChannelRequest) => Promise<OpenChannelResponse>
GetOpenChannelLNURL?: (ctx: GetOpenChannelLNURL_Context) => Promise<GetOpenChannelLNURLResponse>
GetLnurlWithdrawLink?: (ctx: GetLnurlWithdrawLink_Context) => Promise<LnurlLinkResponse>
GetLnurlWithdrawInfo?: (ctx: GetLnurlWithdrawInfo_Context) => Promise<LnurlWithdrawInfoResponse>
HandleLnurlWithdraw?: (ctx: HandleLnurlWithdraw_Context) => Promise<void>
GetLnurlPayInfo?: (ctx: GetLnurlPayInfo_Context) => Promise<LnurlPayInfoResponse>
HandleLnurlPay?: (ctx: HandleLnurlPay_Context) => Promise<HandleLnurlPayResponse>
GetLNURLChannelLink?: (ctx: GetLNURLChannelLink_Context) => Promise<LnurlLinkResponse>
}
export enum AddressType {
@ -93,6 +129,202 @@ export type OptionsBaseMessage = {
allOptionalsAreSet?: true
}
export type NewInvoiceRequest = {
amountSats: number
memo: string
}
export const NewInvoiceRequestOptionalFields: [] = []
export type NewInvoiceRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
amountSats_CustomCheck?: (v: number) => boolean
memo_CustomCheck?: (v: string) => boolean
}
export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.amountSats !== 'number') return new Error(`${path}.amountSats: is not a number`)
if (opts.amountSats_CustomCheck && !opts.amountSats_CustomCheck(o.amountSats)) return new Error(`${path}.amountSats: custom check failed`)
if (typeof o.memo !== 'string') return new Error(`${path}.memo: is not a string`)
if (opts.memo_CustomCheck && !opts.memo_CustomCheck(o.memo)) return new Error(`${path}.memo: custom check failed`)
return null
}
export type LnurlWithdrawInfoResponse = {
tag: string
callback: string
k1: string
defaultDescription: string
minWithdrawable: number
maxWithdrawable: number
balanceCheck: string
payLink: string
}
export const LnurlWithdrawInfoResponseOptionalFields: [] = []
export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
tag_CustomCheck?: (v: string) => boolean
callback_CustomCheck?: (v: string) => boolean
k1_CustomCheck?: (v: string) => boolean
defaultDescription_CustomCheck?: (v: string) => boolean
minWithdrawable_CustomCheck?: (v: number) => boolean
maxWithdrawable_CustomCheck?: (v: number) => boolean
balanceCheck_CustomCheck?: (v: string) => boolean
payLink_CustomCheck?: (v: string) => boolean
}
export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`)
if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`)
if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`)
if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`)
if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`)
if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`)
if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`)
if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`)
if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`)
if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`)
if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`)
if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`)
if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`)
if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`)
if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`)
if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`)
return null
}
export type HandleLnurlPayResponse = {
pr: string
routes: Empty[]
}
export const HandleLnurlPayResponseOptionalFields: [] = []
export type HandleLnurlPayResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
pr_CustomCheck?: (v: string) => boolean
routes_ItemOptions?: EmptyOptions
routes_CustomCheck?: (v: Empty[]) => boolean
}
export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.pr !== 'string') return new Error(`${path}.pr: is not a string`)
if (opts.pr_CustomCheck && !opts.pr_CustomCheck(o.pr)) return new Error(`${path}.pr: custom check failed`)
if (!Array.isArray(o.routes)) return new Error(`${path}.routes: is not an array`)
for (let index = 0; index < o.routes.length; index++) {
const routesErr = EmptyValidate(o.routes[index], opts.routes_ItemOptions, `${path}.routes[${index}]`)
if (routesErr !== null) return routesErr
}
if (opts.routes_CustomCheck && !opts.routes_CustomCheck(o.routes)) return new Error(`${path}.routes: custom check failed`)
return null
}
export type LndGetInfoResponse = {
alias: string
}
export const LndGetInfoResponseOptionalFields: [] = []
export type LndGetInfoResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
alias_CustomCheck?: (v: string) => boolean
}
export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.alias !== 'string') return new Error(`${path}.alias: is not a string`)
if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`)
return null
}
export type NewAddressRequest = {
addressType: AddressType
}
export const NewAddressRequestOptionalFields: [] = []
export type NewAddressRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
addressType_CustomCheck?: (v: AddressType) => boolean
}
export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`)
if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`)
return null
}
export type PayAddressResponse = {
txId: string
}
export const PayAddressResponseOptionalFields: [] = []
export type PayAddressResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
txId_CustomCheck?: (v: string) => boolean
}
export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.txId !== 'string') return new Error(`${path}.txId: is not a string`)
if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`)
return null
}
export type LnurlPayInfoResponse = {
tag: string
callback: string
maxSendable: number
minSendable: number
metadata: string
}
export const LnurlPayInfoResponseOptionalFields: [] = []
export type LnurlPayInfoResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
tag_CustomCheck?: (v: string) => boolean
callback_CustomCheck?: (v: string) => boolean
maxSendable_CustomCheck?: (v: number) => boolean
minSendable_CustomCheck?: (v: number) => boolean
metadata_CustomCheck?: (v: string) => boolean
}
export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`)
if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`)
if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`)
if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`)
if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`)
if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`)
if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`)
if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`)
if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`)
if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`)
return null
}
export type Empty = {
}
export const EmptyOptionalFields: [] = []
@ -106,24 +338,6 @@ export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string =
return null
}
export type LndGetInfoRequest = {
node_id: number
}
export const LndGetInfoRequestOptionalFields: [] = []
export type LndGetInfoRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
node_id_CustomCheck?: (v: number) => boolean
}
export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.node_id !== 'number') return new Error(`${path}.node_id: is not a number`)
if (opts.node_id_CustomCheck && !opts.node_id_CustomCheck(o.node_id)) return new Error(`${path}.node_id: custom check failed`)
return null
}
export type NewAddressResponse = {
address: string
}
@ -142,48 +356,63 @@ export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddr
return null
}
export type PayAddressRequest = {
address: string
amout_sats: number
target_conf: number
export type OpenChannelRequest = {
destination: string
fundingAmount: number
pushAmount: number
closeAddress: string
}
export const PayAddressRequestOptionalFields: [] = []
export type PayAddressRequestOptions = OptionsBaseMessage & {
export const OpenChannelRequestOptionalFields: [] = []
export type OpenChannelRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
address_CustomCheck?: (v: string) => boolean
amout_sats_CustomCheck?: (v: number) => boolean
target_conf_CustomCheck?: (v: number) => boolean
destination_CustomCheck?: (v: string) => boolean
fundingAmount_CustomCheck?: (v: number) => boolean
pushAmount_CustomCheck?: (v: number) => boolean
closeAddress_CustomCheck?: (v: string) => boolean
}
export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => {
export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`)
if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`)
if (typeof o.destination !== 'string') return new Error(`${path}.destination: is not a string`)
if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`)
if (typeof o.amout_sats !== 'number') return new Error(`${path}.amout_sats: is not a number`)
if (opts.amout_sats_CustomCheck && !opts.amout_sats_CustomCheck(o.amout_sats)) return new Error(`${path}.amout_sats: custom check failed`)
if (typeof o.fundingAmount !== 'number') return new Error(`${path}.fundingAmount: is not a number`)
if (opts.fundingAmount_CustomCheck && !opts.fundingAmount_CustomCheck(o.fundingAmount)) return new Error(`${path}.fundingAmount: custom check failed`)
if (typeof o.target_conf !== 'number') return new Error(`${path}.target_conf: is not a number`)
if (opts.target_conf_CustomCheck && !opts.target_conf_CustomCheck(o.target_conf)) return new Error(`${path}.target_conf: custom check failed`)
if (typeof o.pushAmount !== 'number') return new Error(`${path}.pushAmount: is not a number`)
if (opts.pushAmount_CustomCheck && !opts.pushAmount_CustomCheck(o.pushAmount)) return new Error(`${path}.pushAmount: custom check failed`)
if (typeof o.closeAddress !== 'string') return new Error(`${path}.closeAddress: is not a string`)
if (opts.closeAddress_CustomCheck && !opts.closeAddress_CustomCheck(o.closeAddress)) return new Error(`${path}.closeAddress: custom check failed`)
return null
}
export type PayAddressResponse = {
tx_id: string
export type AddUserRequest = {
callbackUrl: string
name: string
secret: string
}
export const PayAddressResponseOptionalFields: [] = []
export type PayAddressResponseOptions = OptionsBaseMessage & {
export const AddUserRequestOptionalFields: [] = []
export type AddUserRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
tx_id_CustomCheck?: (v: string) => boolean
callbackUrl_CustomCheck?: (v: string) => boolean
name_CustomCheck?: (v: string) => boolean
secret_CustomCheck?: (v: string) => boolean
}
export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => {
export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestOptions = {}, path: string = 'AddUserRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.tx_id !== 'string') return new Error(`${path}.tx_id: is not a string`)
if (opts.tx_id_CustomCheck && !opts.tx_id_CustomCheck(o.tx_id)) return new Error(`${path}.tx_id: custom check failed`)
if (typeof o.callbackUrl !== 'string') return new Error(`${path}.callbackUrl: is not a string`)
if (opts.callbackUrl_CustomCheck && !opts.callbackUrl_CustomCheck(o.callbackUrl)) return new Error(`${path}.callbackUrl: custom check failed`)
if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`)
if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`)
if (typeof o.secret !== 'string') return new Error(`${path}.secret: is not a string`)
if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`)
return null
}
@ -211,84 +440,43 @@ export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoic
return null
}
export type OpenChannelResponse = {
channel_id: string
export type PayInvoiceResponse = {
preimage: string
}
export const OpenChannelResponseOptionalFields: [] = []
export type OpenChannelResponseOptions = OptionsBaseMessage & {
export const PayInvoiceResponseOptionalFields: [] = []
export type PayInvoiceResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
channel_id_CustomCheck?: (v: string) => boolean
preimage_CustomCheck?: (v: string) => boolean
}
export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::root.'): Error | null => {
export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`)
if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`)
if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`)
if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`)
return null
}
export type GetOpenChannelLNURLResponse = {
export type LnurlLinkResponse = {
lnurl: string
k1: string
}
export const GetOpenChannelLNURLResponseOptionalFields: [] = []
export type GetOpenChannelLNURLResponseOptions = OptionsBaseMessage & {
export const LnurlLinkResponseOptionalFields: [] = []
export type LnurlLinkResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
lnurl_CustomCheck?: (v: string) => boolean
k1_CustomCheck?: (v: string) => boolean
}
export const GetOpenChannelLNURLResponseValidate = (o?: GetOpenChannelLNURLResponse, opts: GetOpenChannelLNURLResponseOptions = {}, path: string = 'GetOpenChannelLNURLResponse::root.'): Error | null => {
export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`)
if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`)
return null
}
export type AddUserResponse = {
user_id: string
auth_token: string
}
export const AddUserResponseOptionalFields: [] = []
export type AddUserResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
user_id_CustomCheck?: (v: string) => boolean
auth_token_CustomCheck?: (v: string) => boolean
}
export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`)
if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`)
if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`)
if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`)
return null
}
export type EncryptionExchangeRequest = {
public_key: string
device_id: string
}
export const EncryptionExchangeRequestOptionalFields: [] = []
export type EncryptionExchangeRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
public_key_CustomCheck?: (v: string) => boolean
device_id_CustomCheck?: (v: string) => boolean
}
export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.public_key !== 'string') return new Error(`${path}.public_key: is not a string`)
if (opts.public_key_CustomCheck && !opts.public_key_CustomCheck(o.public_key)) return new Error(`${path}.public_key: custom check failed`)
if (typeof o.device_id !== 'string') return new Error(`${path}.device_id: is not a string`)
if (opts.device_id_CustomCheck && !opts.device_id_CustomCheck(o.device_id)) return new Error(`${path}.device_id: custom check failed`)
if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`)
if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`)
return null
}
@ -311,20 +499,43 @@ export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvo
return null
}
export type PayInvoiceResponse = {
preimage: string
export type OpenChannelResponse = {
channelId: string
}
export const PayInvoiceResponseOptionalFields: [] = []
export type PayInvoiceResponseOptions = OptionsBaseMessage & {
export const OpenChannelResponseOptionalFields: [] = []
export type OpenChannelResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
preimage_CustomCheck?: (v: string) => boolean
channelId_CustomCheck?: (v: string) => boolean
}
export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => {
export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`)
if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`)
if (typeof o.channelId !== 'string') return new Error(`${path}.channelId: is not a string`)
if (opts.channelId_CustomCheck && !opts.channelId_CustomCheck(o.channelId)) return new Error(`${path}.channelId: custom check failed`)
return null
}
export type AddUserResponse = {
userId: string
authToken: string
}
export const AddUserResponseOptionalFields: [] = []
export type AddUserResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
userId_CustomCheck?: (v: string) => boolean
authToken_CustomCheck?: (v: string) => boolean
}
export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.userId !== 'string') return new Error(`${path}.userId: is not a string`)
if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`)
if (typeof o.authToken !== 'string') return new Error(`${path}.authToken: is not a string`)
if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: custom check failed`)
return null
}
@ -352,140 +563,94 @@ export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserReque
return null
}
export type LndGetInfoResponse = {
alias: string
}
export const LndGetInfoResponseOptionalFields: [] = []
export type LndGetInfoResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
alias_CustomCheck?: (v: string) => boolean
}
export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.alias !== 'string') return new Error(`${path}.alias: is not a string`)
if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`)
return null
}
export type NewAddressRequest = {
address_type: AddressType
}
export const NewAddressRequestOptionalFields: [] = []
export type NewAddressRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
address_type_CustomCheck?: (v: AddressType) => boolean
}
export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (!enumCheckAddressType(o.address_type)) return new Error(`${path}.address_type: is not a valid AddressType`)
if (opts.address_type_CustomCheck && !opts.address_type_CustomCheck(o.address_type)) return new Error(`${path}.address_type: custom check failed`)
return null
}
export type NewInvoiceRequest = {
amount_sats: number
}
export const NewInvoiceRequestOptionalFields: [] = []
export type NewInvoiceRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
amount_sats_CustomCheck?: (v: number) => boolean
}
export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.amount_sats !== 'number') return new Error(`${path}.amount_sats: is not a number`)
if (opts.amount_sats_CustomCheck && !opts.amount_sats_CustomCheck(o.amount_sats)) return new Error(`${path}.amount_sats: custom check failed`)
return null
}
export type OpenChannelRequest = {
destination: string
funding_amount: number
push_amount: number
close_address: string
}
export const OpenChannelRequestOptionalFields: [] = []
export type OpenChannelRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
destination_CustomCheck?: (v: string) => boolean
funding_amount_CustomCheck?: (v: number) => boolean
push_amount_CustomCheck?: (v: number) => boolean
close_address_CustomCheck?: (v: string) => boolean
}
export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.destination !== 'string') return new Error(`${path}.destination: is not a string`)
if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`)
if (typeof o.funding_amount !== 'number') return new Error(`${path}.funding_amount: is not a number`)
if (opts.funding_amount_CustomCheck && !opts.funding_amount_CustomCheck(o.funding_amount)) return new Error(`${path}.funding_amount: custom check failed`)
if (typeof o.push_amount !== 'number') return new Error(`${path}.push_amount: is not a number`)
if (opts.push_amount_CustomCheck && !opts.push_amount_CustomCheck(o.push_amount)) return new Error(`${path}.push_amount: custom check failed`)
if (typeof o.close_address !== 'string') return new Error(`${path}.close_address: is not a string`)
if (opts.close_address_CustomCheck && !opts.close_address_CustomCheck(o.close_address)) return new Error(`${path}.close_address: custom check failed`)
return null
}
export type AddUserRequest = {
callback_url: string
name: string
secret: string
}
export const AddUserRequestOptionalFields: [] = []
export type AddUserRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
callback_url_CustomCheck?: (v: string) => boolean
name_CustomCheck?: (v: string) => boolean
secret_CustomCheck?: (v: string) => boolean
}
export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestOptions = {}, path: string = 'AddUserRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.callback_url !== 'string') return new Error(`${path}.callback_url: is not a string`)
if (opts.callback_url_CustomCheck && !opts.callback_url_CustomCheck(o.callback_url)) return new Error(`${path}.callback_url: custom check failed`)
if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`)
if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`)
if (typeof o.secret !== 'string') return new Error(`${path}.secret: is not a string`)
if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`)
return null
}
export type AuthUserResponse = {
user_id: string
auth_token: string
userId: string
authToken: string
}
export const AuthUserResponseOptionalFields: [] = []
export type AuthUserResponseOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
user_id_CustomCheck?: (v: string) => boolean
auth_token_CustomCheck?: (v: string) => boolean
userId_CustomCheck?: (v: string) => boolean
authToken_CustomCheck?: (v: string) => boolean
}
export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`)
if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`)
if (typeof o.userId !== 'string') return new Error(`${path}.userId: is not a string`)
if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`)
if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`)
if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`)
if (typeof o.authToken !== 'string') return new Error(`${path}.authToken: is not a string`)
if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: custom check failed`)
return null
}
export type EncryptionExchangeRequest = {
publicKey: string
deviceId: string
}
export const EncryptionExchangeRequestOptionalFields: [] = []
export type EncryptionExchangeRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
publicKey_CustomCheck?: (v: string) => boolean
deviceId_CustomCheck?: (v: string) => boolean
}
export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.publicKey !== 'string') return new Error(`${path}.publicKey: is not a string`)
if (opts.publicKey_CustomCheck && !opts.publicKey_CustomCheck(o.publicKey)) return new Error(`${path}.publicKey: custom check failed`)
if (typeof o.deviceId !== 'string') return new Error(`${path}.deviceId: is not a string`)
if (opts.deviceId_CustomCheck && !opts.deviceId_CustomCheck(o.deviceId)) return new Error(`${path}.deviceId: custom check failed`)
return null
}
export type LndGetInfoRequest = {
nodeId: number
}
export const LndGetInfoRequestOptionalFields: [] = []
export type LndGetInfoRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
nodeId_CustomCheck?: (v: number) => boolean
}
export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.nodeId !== 'number') return new Error(`${path}.nodeId: is not a number`)
if (opts.nodeId_CustomCheck && !opts.nodeId_CustomCheck(o.nodeId)) return new Error(`${path}.nodeId: custom check failed`)
return null
}
export type PayAddressRequest = {
address: string
amoutSats: number
targetConf: number
}
export const PayAddressRequestOptionalFields: [] = []
export type PayAddressRequestOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
address_CustomCheck?: (v: string) => boolean
amoutSats_CustomCheck?: (v: number) => boolean
targetConf_CustomCheck?: (v: number) => boolean
}
export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`)
if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`)
if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`)
if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`)
if (typeof o.targetConf !== 'number') return new Error(`${path}.targetConf: is not a number`)
if (opts.targetConf_CustomCheck && !opts.targetConf_CustomCheck(o.targetConf)) return new Error(`${path}.targetConf: custom check failed`)
return null
}

View file

@ -1,122 +0,0 @@
// @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

@ -1,76 +0,0 @@
// @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

@ -3,18 +3,18 @@
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { Invoices } from "./invoices";
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 { Invoices } from "./invoices.js";
import type { LookupInvoiceMsg } from "./invoices.js";
import type { SettleInvoiceResp } from "./invoices.js";
import type { SettleInvoiceMsg } from "./invoices.js";
import type { AddHoldInvoiceResp } from "./invoices.js";
import type { AddHoldInvoiceRequest } from "./invoices.js";
import type { CancelInvoiceResp } from "./invoices.js";
import type { CancelInvoiceMsg } from "./invoices.js";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { Invoice } from "./lightning";
import type { SubscribeSingleInvoiceRequest } from "./invoices";
import type { Invoice } from "./lightning.js";
import type { SubscribeSingleInvoiceRequest } from "./invoices.js";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
/**

View file

@ -1,318 +0,0 @@
// @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 {};

View file

@ -1,495 +0,0 @@
// @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,7 +1,7 @@
// @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";
import { Invoice } from "./lightning.js";
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
@ -13,7 +13,7 @@ import type { PartialMessage } 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";
import { RouteHint } from "./lightning.js";
/**
* @generated from protobuf message invoicesrpc.CancelInvoiceMsg
*/

File diff suppressed because it is too large Load diff

View file

@ -1,901 +0,0 @@
// @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

@ -3,133 +3,133 @@
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { Lightning } from "./lightning";
import type { LookupHtlcResponse } from "./lightning";
import type { LookupHtlcRequest } from "./lightning";
import type { ListAliasesResponse } from "./lightning";
import type { ListAliasesRequest } from "./lightning";
import type { CustomMessage } from "./lightning";
import type { SubscribeCustomMessagesRequest } from "./lightning";
import type { SendCustomMessageResponse } from "./lightning";
import type { SendCustomMessageRequest } from "./lightning";
import type { RPCMiddlewareRequest } from "./lightning";
import type { RPCMiddlewareResponse } from "./lightning";
import type { CheckMacPermResponse } from "./lightning";
import type { CheckMacPermRequest } from "./lightning";
import type { ListPermissionsResponse } from "./lightning";
import type { ListPermissionsRequest } from "./lightning";
import type { DeleteMacaroonIDResponse } from "./lightning";
import type { DeleteMacaroonIDRequest } from "./lightning";
import type { ListMacaroonIDsResponse } from "./lightning";
import type { ListMacaroonIDsRequest } from "./lightning";
import type { BakeMacaroonResponse } from "./lightning";
import type { BakeMacaroonRequest } from "./lightning";
import type { ChannelBackupSubscription } from "./lightning";
import type { RestoreBackupResponse } from "./lightning";
import type { RestoreChanBackupRequest } from "./lightning";
import type { VerifyChanBackupResponse } from "./lightning";
import type { ChanBackupSnapshot } from "./lightning";
import type { ChanBackupExportRequest } from "./lightning";
import type { ChannelBackup } from "./lightning";
import type { ExportChannelBackupRequest } from "./lightning";
import type { ForwardingHistoryResponse } from "./lightning";
import type { ForwardingHistoryRequest } from "./lightning";
import type { PolicyUpdateResponse } from "./lightning";
import type { PolicyUpdateRequest } from "./lightning";
import type { FeeReportResponse } from "./lightning";
import type { FeeReportRequest } from "./lightning";
import type { DebugLevelResponse } from "./lightning";
import type { DebugLevelRequest } from "./lightning";
import type { GraphTopologyUpdate } from "./lightning";
import type { GraphTopologySubscription } from "./lightning";
import type { StopResponse } from "./lightning";
import type { StopRequest } from "./lightning";
import type { NetworkInfo } from "./lightning";
import type { NetworkInfoRequest } from "./lightning";
import type { QueryRoutesResponse } from "./lightning";
import type { QueryRoutesRequest } from "./lightning";
import type { NodeInfo } from "./lightning";
import type { NodeInfoRequest } from "./lightning";
import type { ChannelEdge } from "./lightning";
import type { ChanInfoRequest } from "./lightning";
import type { NodeMetricsResponse } from "./lightning";
import type { NodeMetricsRequest } from "./lightning";
import type { ChannelGraph } from "./lightning";
import type { ChannelGraphRequest } from "./lightning";
import type { DeleteAllPaymentsResponse } from "./lightning";
import type { DeleteAllPaymentsRequest } from "./lightning";
import type { DeletePaymentResponse } from "./lightning";
import type { DeletePaymentRequest } from "./lightning";
import type { ListPaymentsResponse } from "./lightning";
import type { ListPaymentsRequest } from "./lightning";
import type { PayReq } from "./lightning";
import type { PayReqString } from "./lightning";
import type { InvoiceSubscription } from "./lightning";
import type { PaymentHash } from "./lightning";
import type { ListInvoiceResponse } from "./lightning";
import type { ListInvoiceRequest } from "./lightning";
import type { AddInvoiceResponse } from "./lightning";
import type { Invoice } from "./lightning";
import type { SendToRouteRequest } from "./lightning";
import type { SendResponse } from "./lightning";
import type { SendRequest } from "./lightning";
import type { AbandonChannelResponse } from "./lightning";
import type { AbandonChannelRequest } from "./lightning";
import type { CloseStatusUpdate } from "./lightning";
import type { CloseChannelRequest } from "./lightning";
import type { ChannelAcceptRequest } from "./lightning";
import type { ChannelAcceptResponse } from "./lightning";
import { Lightning } from "./lightning.js";
import type { LookupHtlcResponse } from "./lightning.js";
import type { LookupHtlcRequest } from "./lightning.js";
import type { ListAliasesResponse } from "./lightning.js";
import type { ListAliasesRequest } from "./lightning.js";
import type { CustomMessage } from "./lightning.js";
import type { SubscribeCustomMessagesRequest } from "./lightning.js";
import type { SendCustomMessageResponse } from "./lightning.js";
import type { SendCustomMessageRequest } from "./lightning.js";
import type { RPCMiddlewareRequest } from "./lightning.js";
import type { RPCMiddlewareResponse } from "./lightning.js";
import type { CheckMacPermResponse } from "./lightning.js";
import type { CheckMacPermRequest } from "./lightning.js";
import type { ListPermissionsResponse } from "./lightning.js";
import type { ListPermissionsRequest } from "./lightning.js";
import type { DeleteMacaroonIDResponse } from "./lightning.js";
import type { DeleteMacaroonIDRequest } from "./lightning.js";
import type { ListMacaroonIDsResponse } from "./lightning.js";
import type { ListMacaroonIDsRequest } from "./lightning.js";
import type { BakeMacaroonResponse } from "./lightning.js";
import type { BakeMacaroonRequest } from "./lightning.js";
import type { ChannelBackupSubscription } from "./lightning.js";
import type { RestoreBackupResponse } from "./lightning.js";
import type { RestoreChanBackupRequest } from "./lightning.js";
import type { VerifyChanBackupResponse } from "./lightning.js";
import type { ChanBackupSnapshot } from "./lightning.js";
import type { ChanBackupExportRequest } from "./lightning.js";
import type { ChannelBackup } from "./lightning.js";
import type { ExportChannelBackupRequest } from "./lightning.js";
import type { ForwardingHistoryResponse } from "./lightning.js";
import type { ForwardingHistoryRequest } from "./lightning.js";
import type { PolicyUpdateResponse } from "./lightning.js";
import type { PolicyUpdateRequest } from "./lightning.js";
import type { FeeReportResponse } from "./lightning.js";
import type { FeeReportRequest } from "./lightning.js";
import type { DebugLevelResponse } from "./lightning.js";
import type { DebugLevelRequest } from "./lightning.js";
import type { GraphTopologyUpdate } from "./lightning.js";
import type { GraphTopologySubscription } from "./lightning.js";
import type { StopResponse } from "./lightning.js";
import type { StopRequest } from "./lightning.js";
import type { NetworkInfo } from "./lightning.js";
import type { NetworkInfoRequest } from "./lightning.js";
import type { QueryRoutesResponse } from "./lightning.js";
import type { QueryRoutesRequest } from "./lightning.js";
import type { NodeInfo } from "./lightning.js";
import type { NodeInfoRequest } from "./lightning.js";
import type { ChannelEdge } from "./lightning.js";
import type { ChanInfoRequest } from "./lightning.js";
import type { NodeMetricsResponse } from "./lightning.js";
import type { NodeMetricsRequest } from "./lightning.js";
import type { ChannelGraph } from "./lightning.js";
import type { ChannelGraphRequest } from "./lightning.js";
import type { DeleteAllPaymentsResponse } from "./lightning.js";
import type { DeleteAllPaymentsRequest } from "./lightning.js";
import type { DeletePaymentResponse } from "./lightning.js";
import type { DeletePaymentRequest } from "./lightning.js";
import type { ListPaymentsResponse } from "./lightning.js";
import type { ListPaymentsRequest } from "./lightning.js";
import type { PayReq } from "./lightning.js";
import type { PayReqString } from "./lightning.js";
import type { InvoiceSubscription } from "./lightning.js";
import type { PaymentHash } from "./lightning.js";
import type { ListInvoiceResponse } from "./lightning.js";
import type { ListInvoiceRequest } from "./lightning.js";
import type { AddInvoiceResponse } from "./lightning.js";
import type { Invoice } from "./lightning.js";
import type { SendToRouteRequest } from "./lightning.js";
import type { SendResponse } from "./lightning.js";
import type { SendRequest } from "./lightning.js";
import type { AbandonChannelResponse } from "./lightning.js";
import type { AbandonChannelRequest } from "./lightning.js";
import type { CloseStatusUpdate } from "./lightning.js";
import type { CloseChannelRequest } from "./lightning.js";
import type { ChannelAcceptRequest } from "./lightning.js";
import type { ChannelAcceptResponse } from "./lightning.js";
import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { FundingStateStepResp } from "./lightning";
import type { FundingTransitionMsg } from "./lightning";
import type { BatchOpenChannelResponse } from "./lightning";
import type { BatchOpenChannelRequest } from "./lightning";
import type { OpenStatusUpdate } from "./lightning";
import type { ChannelPoint } from "./lightning";
import type { OpenChannelRequest } from "./lightning";
import type { ClosedChannelsResponse } from "./lightning";
import type { ClosedChannelsRequest } from "./lightning";
import type { ChannelEventUpdate } from "./lightning";
import type { ChannelEventSubscription } from "./lightning";
import type { ListChannelsResponse } from "./lightning";
import type { ListChannelsRequest } from "./lightning";
import type { PendingChannelsResponse } from "./lightning";
import type { PendingChannelsRequest } from "./lightning";
import type { GetRecoveryInfoResponse } from "./lightning";
import type { GetRecoveryInfoRequest } from "./lightning";
import type { GetInfoResponse } from "./lightning";
import type { GetInfoRequest } from "./lightning";
import type { PeerEvent } from "./lightning";
import type { PeerEventSubscription } from "./lightning";
import type { ListPeersResponse } from "./lightning";
import type { ListPeersRequest } from "./lightning";
import type { DisconnectPeerResponse } from "./lightning";
import type { DisconnectPeerRequest } from "./lightning";
import type { ConnectPeerResponse } from "./lightning";
import type { ConnectPeerRequest } from "./lightning";
import type { VerifyMessageResponse } from "./lightning";
import type { VerifyMessageRequest } from "./lightning";
import type { SignMessageResponse } from "./lightning";
import type { SignMessageRequest } from "./lightning";
import type { NewAddressResponse } from "./lightning";
import type { NewAddressRequest } from "./lightning";
import type { SendManyResponse } from "./lightning";
import type { SendManyRequest } from "./lightning";
import type { Transaction } from "./lightning";
import type { FundingStateStepResp } from "./lightning.js";
import type { FundingTransitionMsg } from "./lightning.js";
import type { BatchOpenChannelResponse } from "./lightning.js";
import type { BatchOpenChannelRequest } from "./lightning.js";
import type { OpenStatusUpdate } from "./lightning.js";
import type { ChannelPoint } from "./lightning.js";
import type { OpenChannelRequest } from "./lightning.js";
import type { ClosedChannelsResponse } from "./lightning.js";
import type { ClosedChannelsRequest } from "./lightning.js";
import type { ChannelEventUpdate } from "./lightning.js";
import type { ChannelEventSubscription } from "./lightning.js";
import type { ListChannelsResponse } from "./lightning.js";
import type { ListChannelsRequest } from "./lightning.js";
import type { PendingChannelsResponse } from "./lightning.js";
import type { PendingChannelsRequest } from "./lightning.js";
import type { GetRecoveryInfoResponse } from "./lightning.js";
import type { GetRecoveryInfoRequest } from "./lightning.js";
import type { GetInfoResponse } from "./lightning.js";
import type { GetInfoRequest } from "./lightning.js";
import type { PeerEvent } from "./lightning.js";
import type { PeerEventSubscription } from "./lightning.js";
import type { ListPeersResponse } from "./lightning.js";
import type { ListPeersRequest } from "./lightning.js";
import type { DisconnectPeerResponse } from "./lightning.js";
import type { DisconnectPeerRequest } from "./lightning.js";
import type { ConnectPeerResponse } from "./lightning.js";
import type { ConnectPeerRequest } from "./lightning.js";
import type { VerifyMessageResponse } from "./lightning.js";
import type { VerifyMessageRequest } from "./lightning.js";
import type { SignMessageResponse } from "./lightning.js";
import type { SignMessageRequest } from "./lightning.js";
import type { NewAddressResponse } from "./lightning.js";
import type { NewAddressRequest } from "./lightning.js";
import type { SendManyResponse } from "./lightning.js";
import type { SendManyRequest } from "./lightning.js";
import type { Transaction } from "./lightning.js";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { ListUnspentResponse } from "./lightning";
import type { ListUnspentRequest } from "./lightning";
import type { SendCoinsResponse } from "./lightning";
import type { SendCoinsRequest } from "./lightning";
import type { EstimateFeeResponse } from "./lightning";
import type { EstimateFeeRequest } from "./lightning";
import type { TransactionDetails } from "./lightning";
import type { GetTransactionsRequest } from "./lightning";
import type { ChannelBalanceResponse } from "./lightning";
import type { ChannelBalanceRequest } from "./lightning";
import type { ListUnspentResponse } from "./lightning.js";
import type { ListUnspentRequest } from "./lightning.js";
import type { SendCoinsResponse } from "./lightning.js";
import type { SendCoinsRequest } from "./lightning.js";
import type { EstimateFeeResponse } from "./lightning.js";
import type { EstimateFeeRequest } from "./lightning.js";
import type { TransactionDetails } from "./lightning.js";
import type { GetTransactionsRequest } from "./lightning.js";
import type { ChannelBalanceResponse } from "./lightning.js";
import type { ChannelBalanceRequest } from "./lightning.js";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { WalletBalanceResponse } from "./lightning";
import type { WalletBalanceRequest } from "./lightning";
import type { WalletBalanceResponse } from "./lightning.js";
import type { WalletBalanceRequest } from "./lightning.js";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
//

9340
proto/lnd/lightning.d.ts vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,390 +0,0 @@
// @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>;
}

View file

@ -1,238 +0,0 @@
// @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

@ -3,40 +3,40 @@
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { Router } from "./router";
import type { UpdateChanStatusResponse } from "./router";
import type { UpdateChanStatusRequest } from "./router";
import type { ForwardHtlcInterceptRequest } from "./router";
import type { ForwardHtlcInterceptResponse } from "./router";
import { Router } from "./router.js";
import type { UpdateChanStatusResponse } from "./router.js";
import type { UpdateChanStatusRequest } from "./router.js";
import type { ForwardHtlcInterceptRequest } from "./router.js";
import type { ForwardHtlcInterceptResponse } from "./router.js";
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 { PaymentStatus } from "./router.js";
import type { HtlcEvent } from "./router.js";
import type { SubscribeHtlcEventsRequest } from "./router.js";
import type { BuildRouteResponse } from "./router.js";
import type { BuildRouteRequest } from "./router.js";
import type { QueryProbabilityResponse } from "./router.js";
import type { QueryProbabilityRequest } from "./router.js";
import type { SetMissionControlConfigResponse } from "./router.js";
import type { SetMissionControlConfigRequest } from "./router.js";
import type { GetMissionControlConfigResponse } from "./router.js";
import type { GetMissionControlConfigRequest } from "./router.js";
import type { XImportMissionControlResponse } from "./router.js";
import type { XImportMissionControlRequest } from "./router.js";
import type { QueryMissionControlResponse } from "./router.js";
import type { QueryMissionControlRequest } from "./router.js";
import type { ResetMissionControlResponse } from "./router.js";
import type { ResetMissionControlRequest } from "./router.js";
import type { HTLCAttempt } from "./lightning.js";
import type { SendToRouteResponse } from "./router.js";
import type { SendToRouteRequest } from "./router.js";
import type { RouteFeeResponse } from "./router.js";
import type { RouteFeeRequest } from "./router.js";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { TrackPaymentsRequest } from "./router";
import type { TrackPaymentRequest } from "./router";
import type { TrackPaymentsRequest } from "./router.js";
import type { TrackPaymentRequest } from "./router.js";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { Payment } from "./lightning";
import type { SendPaymentRequest } from "./router";
import type { Payment } from "./lightning.js";
import type { SendPaymentRequest } from "./router.js";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
/**

1649
proto/lnd/router.d.ts vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
// @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";
import { Payment } from "./lightning.js";
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
@ -13,13 +13,13 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { ChannelPoint } from "./lightning";
import { HTLCAttempt } from "./lightning";
import { Failure_FailureCode } from "./lightning";
import { Failure } from "./lightning";
import { Route } from "./lightning";
import { FeatureBit } from "./lightning";
import { RouteHint } from "./lightning";
import { ChannelPoint } from "./lightning.js";
import { HTLCAttempt } from "./lightning.js";
import { Failure_FailureCode } from "./lightning.js";
import { Failure } from "./lightning.js";
import { Route } from "./lightning.js";
import { FeatureBit } from "./lightning.js";
import { RouteHint } from "./lightning.js";
/**
* @generated from protobuf message routerrpc.SendPaymentRequest
*/

Binary file not shown.

View file

@ -114,9 +114,38 @@ service LightningPub {
option (http_method) = "post";
option (http_route) = "/api/user/open/channel";
}
rpc GetOpenChannelLNURL(structs.Empty) returns (structs.GetOpenChannelLNURLResponse){
rpc GetLnurlWithdrawLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "get";
option (http_route) = "/api/user/lnurl_withdraw/link";
}
rpc GetLnurlWithdrawInfo(structs.Empty) returns (structs.LnurlWithdrawInfoResponse){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_withdraw/info";
option (query) = {items: ["k1"]};
}
rpc HandleLnurlWithdraw(structs.Empty) returns (structs.Empty){
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_withdraw/handle";
option (query) = {items: ["k1", "pr"]};
}
rpc GetLnurlPayInfo(structs.Empty)returns (structs.LnurlPayInfoResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_pay/info";
option (query) = {items: ["k1"]};
}
rpc HandleLnurlPay(structs.Empty)returns (structs.HandleLnurlPayResponse) {
option (auth_type) = "Guest";
option (http_method) = "get";
option (http_route) = "/api/guest/lnurl_pay/handle";
option (query) = {items: ["k1", "amount"]};
}
rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){
option (auth_type) = "User";
option (http_method) = "post";
option (http_route) = "/api/user/lnurl_channel";
option (http_route) = "/api/user/lnurl_channel/url";
}
}

View file

@ -8,12 +8,12 @@ message Empty {}
message EncryptionExchangeRequest {
string public_key = 1;
string device_id = 2;
string publicKey = 1;
string deviceId = 2;
}
message LndGetInfoRequest {
int64 node_id = 1;
int64 nodeId = 1;
}
message LndGetInfoResponse {
@ -25,23 +25,24 @@ enum AddressType {
TAPROOT_PUBKEY = 2;
}
message NewAddressRequest {
AddressType address_type = 1;
AddressType addressType = 1;
}
message NewAddressResponse{
string address = 1;
}
message PayAddressRequest{
string address = 1;
int64 amout_sats = 2;
int64 target_conf = 3;
int64 amoutSats = 2;
int64 targetConf = 3;
}
message PayAddressResponse{
string tx_id = 1;
string txId = 1;
}
message NewInvoiceRequest{
int64 amount_sats = 1;
int64 amountSats = 1;
string memo = 2;
}
message NewInvoiceResponse{
@ -59,28 +60,50 @@ message PayInvoiceResponse{
message OpenChannelRequest{
string destination = 1;
int64 funding_amount = 2;
int64 push_amount = 3;
string close_address = 4;
int64 fundingAmount = 2;
int64 pushAmount = 3;
string closeAddress = 4;
}
message OpenChannelResponse{
string channel_id = 1;
string channelId = 1;
}
message GetOpenChannelLNURLResponse{
message LnurlLinkResponse{
string lnurl = 1;
string k1 = 2;
}
message LnurlWithdrawInfoResponse {
string tag = 1;
string callback = 2;
string k1 = 3;
string defaultDescription = 4;
int64 minWithdrawable = 5; // millisatoshi - unsafe overflow possible, but very unlikely
int64 maxWithdrawable = 6; // millisatoshi - unsafe overflow possible, but very unlikely
string balanceCheck = 7;
string payLink = 8;
}
message LnurlPayInfoResponse {
string tag = 1;
string callback = 2;
int64 maxSendable = 3; // millisatoshi - unsafe overflow possible, but very unlikely
int64 minSendable = 4; // millisatoshi - unsafe overflow possible, but very unlikely
string metadata = 5;
}
message HandleLnurlPayResponse {
string pr = 1;
repeated Empty routes = 2;
}
message AddUserRequest{
string callback_url = 1;
string callbackUrl = 1;
string name = 2;
string secret = 3;
}
message AddUserResponse{
string user_id = 1;
string auth_token = 2;
string userId = 1;
string authToken = 2;
}
message AuthUserRequest{
@ -89,6 +112,6 @@ message AuthUserRequest{
}
message AuthUserResponse{
string user_id = 1;
string auth_token = 2;
}
string userId = 1;
string authToken = 2;
}