From 86966ff9f750b691aa6c8b7513246ac4842c618f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Kn=C3=A1b?= Date: Thu, 5 Sep 2024 16:50:04 +0200 Subject: [PATCH 1/2] Add is_encrypting_routes --- lnd_methods/invoices/create_invoice.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lnd_methods/invoices/create_invoice.d.ts b/lnd_methods/invoices/create_invoice.d.ts index 1cb1f31b..54664976 100644 --- a/lnd_methods/invoices/create_invoice.d.ts +++ b/lnd_methods/invoices/create_invoice.d.ts @@ -13,6 +13,8 @@ export type CreateInvoiceArgs = AuthenticatedLightningArgs<{ description_hash?: string; /** Expires At ISO 8601 Date */ expires_at?: string; + /** Use Blinded Paths For Inbound Routes */ + is_encrypting_routes?: boolean; /** Is Fallback Address Included */ is_fallback_included?: boolean; /** Is Fallback Address Nested */ From 05dd9e2dea8a1079403e38e8015ef5f2b4c02fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Kn=C3=A1b?= Date: Thu, 5 Sep 2024 17:03:42 +0200 Subject: [PATCH 2/2] Update subscribe types --- .../offchain/subscribe_to_past_payment.d.ts | 2 + lnd_methods/offchain/subscribe_to_pay.d.ts | 4 +- .../offchain/subscribe_to_payments.d.ts | 141 +++++++++++++++++- 3 files changed, 143 insertions(+), 4 deletions(-) diff --git a/lnd_methods/offchain/subscribe_to_past_payment.d.ts b/lnd_methods/offchain/subscribe_to_past_payment.d.ts index 2730190b..fb252c0e 100644 --- a/lnd_methods/offchain/subscribe_to_past_payment.d.ts +++ b/lnd_methods/offchain/subscribe_to_past_payment.d.ts @@ -58,6 +58,8 @@ export type SubscribeToPastPaymentConfirmedEvent = { export type SubscribeToPastPaymentFailedEvent = { /** Payment Hash Hex */ id: string; + /** Payment Canceled */ + is_canceled: boolean; /** Failed Due To Lack of Balance */ is_insufficient_balance: boolean; /** Failed Due to Payment Rejected At Destination */ diff --git a/lnd_methods/offchain/subscribe_to_pay.d.ts b/lnd_methods/offchain/subscribe_to_pay.d.ts index ea39848a..bdf689c2 100644 --- a/lnd_methods/offchain/subscribe_to_pay.d.ts +++ b/lnd_methods/offchain/subscribe_to_pay.d.ts @@ -140,7 +140,9 @@ export type SubscribeToPayConfirmedEvent = { export type SubscribeToPayFailedEvent = { /** Payment Hash Hex */ id: string; - /** Failed Due To Lack of Balance Bool> */ + /** Payment Canceled */ + is_canceled: boolean; + /** Failed Due To Lack of Balance */ is_insufficient_balance: boolean; /** Failed Due to Invalid Payment Bool> */ is_invalid_payment: boolean; diff --git a/lnd_methods/offchain/subscribe_to_payments.d.ts b/lnd_methods/offchain/subscribe_to_payments.d.ts index 0cc33009..9d01c270 100644 --- a/lnd_methods/offchain/subscribe_to_payments.d.ts +++ b/lnd_methods/offchain/subscribe_to_payments.d.ts @@ -7,10 +7,145 @@ import type {SubscribeToPastPaymentsPaymentEvent} from './subscribe_to_past_paym export type SubscribeToPaymentsArgs = AuthenticatedLightningArgs; -export type SubscribeToPaymentsErrorEvent = LightningError; +/** A confirmed payment event + * @event 'confirmed' + */ +export interface SubscribeToPaymentsConfirmedEvent { + /** Payment Confirmed At ISO 8601 Date String */ + confirmed_at: string; + /** Payment Created At ISO 8601 Date String */ + created_at: string; + /** Payment Destination Hex String */ + destination: string; + /** Total Fee Tokens Paid Rounded Down Number */ + fee: number; + /** Total Fee Millitokens Paid String */ + fee_mtokens: string; + /** Payment Hash Hex String */ + id: string; + /** Total Millitokens Paid String */ + mtokens: string; + /** Payment paths */ + paths?: Array<{ + /** Total Fee Tokens Paid Number */ + fee: number; + /** Total Fee Millitokens Paid String */ + fee_mtokens: string; + /** Hops in the path */ + hops: Array<{ + /** Standard Format Channel Id String */ + channel: string; + /** Channel Capacity Tokens Number */ + channel_capacity: number; + /** Fee Tokens Rounded Down Number */ + fee: number; + /** Fee Millitokens String */ + fee_mtokens: string; + /** Forward Tokens Number */ + forward: number; + /** Forward Millitokens String */ + forward_mtokens: string; + /** Public Key Hex String */ + public_key: string; + /** Timeout Block Height Number */ + timeout: number; + }>; + /** Total Millitokens Paid String */ + mtokens: string; + /** Total Fee Tokens Paid Rounded Up Number */ + safe_fee: number; + /** Total Tokens Paid, Rounded Up Number */ + safe_tokens: number; + /** Expiration Block Height Number */ + timeout: number; + }>; + /** BOLT 11 Encoded Payment Request String */ + request?: string; + /** Total Fee Tokens Paid Rounded Up Number */ + safe_fee: number; + /** Total Tokens Paid, Rounded Up Number */ + safe_tokens: number; + /** Payment Preimage Hex String */ + secret: string; + /** Expiration Block Height Number */ + timeout: number; + /** Total Tokens Paid Rounded Down Number */ + tokens: number; +} + +/** A failed payment event + * @event 'failed' + */ +export interface SubscribeToPaymentsFailedEvent { + /** Payment Hash Hex String */ + id: string; + /** Payment Canceled Bool */ + is_canceled: boolean; + /** Failed Due To Lack of Balance Bool */ + is_insufficient_balance: boolean; + /** Failed Due to Payment Rejected At Destination Bool */ + is_invalid_payment: boolean; + /** Failed Due to Pathfinding Timeout Bool */ + is_pathfinding_timeout: boolean; + /** Failed Due to Absence of Path Through Graph Bool */ + is_route_not_found: boolean; +} -export type SubscribeToPaymentsPaymentEvent = - SubscribeToPastPaymentsPaymentEvent; +/** A paying (in-progress) payment event + * @event 'paying' + */ +export interface SubscribeToPaymentsPayingEvent { + /** Payment Created At ISO 8601 Date String */ + created_at: string; + /** Payment Destination Hex String */ + destination: string; + /** Payment Hash Hex String */ + id: string; + /** Total Millitokens Pending String */ + mtokens: string; + /** Payment paths */ + paths?: Array<{ + /** Total Fee Tokens Pending Number */ + fee: number; + /** Total Fee Millitokens Pending String */ + fee_mtokens: string; + /** Hops in the path */ + hops: Array<{ + /** Standard Format Channel Id String */ + channel: string; + /** Channel Capacity Tokens Number */ + channel_capacity: number; + /** Fee Tokens Rounded Down Number */ + fee: number; + /** Fee Millitokens String */ + fee_mtokens: string; + /** Forward Tokens Number */ + forward: number; + /** Forward Millitokens String */ + forward_mtokens: string; + /** Public Key Hex String */ + public_key: string; + /** Timeout Block Height Number */ + timeout: number; + }>; + /** Total Millitokens Pending String */ + mtokens: string; + /** Total Fee Tokens Pending Rounded Up Number */ + safe_fee: number; + /** Total Tokens Pending, Rounded Up Number */ + safe_tokens: number; + /** Expiration Block Height Number */ + timeout: number; + }>; + /** BOLT 11 Encoded Payment Request String */ + request?: string; + /** Total Tokens Pending, Rounded Up Number */ + safe_tokens: number; + /** Expiration Block Height Number */ + timeout?: number; + /** Total Tokens Pending Rounded Down Number */ + tokens: number; +} /** * Subscribe to outgoing payments