Skip to content

Commit

Permalink
Merge pull request #184 from bkiac/update-types
Browse files Browse the repository at this point in the history
Update types
  • Loading branch information
alexbosworth authored Sep 5, 2024
2 parents c6e4ef5 + 05dd9e2 commit 2dd809f
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lnd_methods/invoices/create_invoice.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions lnd_methods/offchain/subscribe_to_past_payment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 3 additions & 1 deletion lnd_methods/offchain/subscribe_to_pay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
141 changes: 138 additions & 3 deletions lnd_methods/offchain/subscribe_to_payments.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2dd809f

Please sign in to comment.