From 6d84ba938b6a4bc859f21a66023b98d50f2d0058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Kn=C3=A1b?= Date: Thu, 9 May 2024 11:11:22 +0200 Subject: [PATCH] Add types for getPendingSweeps --- lnd_methods/onchain/get_pending_sweeps.d.ts | 47 +++++++++++++++++++++ lnd_methods/onchain/index.d.ts | 1 + 2 files changed, 48 insertions(+) create mode 100644 lnd_methods/onchain/get_pending_sweeps.d.ts diff --git a/lnd_methods/onchain/get_pending_sweeps.d.ts b/lnd_methods/onchain/get_pending_sweeps.d.ts new file mode 100644 index 0000000..f878e57 --- /dev/null +++ b/lnd_methods/onchain/get_pending_sweeps.d.ts @@ -0,0 +1,47 @@ +import { + AuthenticatedLightningArgs, + AuthenticatedLightningMethod, +} from '../../typescript'; + +export type GetPendingSweepsArgs = AuthenticatedLightningArgs; + +export interface Sweep { + /** Total Sweep Broadcast Attempts Count Number */ + broadcasts_count: number; + /** Current Chain Fee Rate Tokens Per VByte Number */ + current_fee_rate?: number; + /** Requested Chain Fee Rate Tokens per VByte Number */ + initial_fee_rate?: number; + /** Requested Waiting For Batching Bool */ + is_batching: boolean; + /** Maximum Total Fee Tokens Allowed Number */ + max_fee?: number; + /** Targeted Maximum Confirmation Height Number */ + max_height?: number; + /** Sweep Outpoint Tokens Value Number */ + tokens: number; + /** Sweeping Outpoint Transaction Id Hex String */ + transaction_id: string; + /** Sweeping Outpoint Transaction Output Index Number */ + transaction_vout: number; + /** Outpoint Constraint Script Type String */ + type: string; +} + +export interface GetPendingSweepsResult { + sweeps: Sweep[]; +} + +/** + * Get pending self-transfer spends + * + * Requires `onchain:read` permission + * + * Requires LND built with `walletrpc` build tag + * + * This method is not supported in LND 0.17.5 or below + */ +export const getPendingSweeps: AuthenticatedLightningMethod< + GetPendingSweepsArgs, + GetPendingSweepsResult +>; diff --git a/lnd_methods/onchain/index.d.ts b/lnd_methods/onchain/index.d.ts index de721df..c903d4f 100644 --- a/lnd_methods/onchain/index.d.ts +++ b/lnd_methods/onchain/index.d.ts @@ -15,6 +15,7 @@ export * from './get_chain_transactions'; export * from './get_locked_utxos'; export * from './get_master_public_keys'; export * from './get_pending_chain_balance'; +export * from './get_pending_sweeps'; export * from './get_sweep_transactions'; export * from './get_utxos'; export * from './lock_utxo';