diff --git a/lnd_methods/onchain/create_funded_psbt.d.ts b/lnd_methods/onchain/create_funded_psbt.d.ts new file mode 100644 index 0000000..11d9d8b --- /dev/null +++ b/lnd_methods/onchain/create_funded_psbt.d.ts @@ -0,0 +1,58 @@ +import type { + AuthenticatedLightningArgs, + AuthenticatedLightningMethod, +} from '../../typescript'; + +export type CreateFundedPsbtArgs = AuthenticatedLightningArgs<{ + /** Chain Fee Tokens Per Virtual Byte Number */ + fee_tokens_per_vbyte?: number; + inputs?: Array<{ + /** Sequence Number */ + sequence?: number; + /** Unspent Transaction Id Hex String */ + transaction_id: string; + /** Unspent Transaction Output Index Number */ + transaction_vout: number; + }>; + /** Select Inputs With Minimum Confirmations Number */ + min_confirmations?: number; + outputs?: Array<{ + /** Use This Output For Change Bool */ + is_change?: boolean; + /** Output Script Hex String> */ + script: string; + /** Send Tokens Tokens Number */ + tokens: number; + }>; + /** Blocks To Wait for Confirmation Number */ + target_confirmations?: number; + /** Spendable Lock Time on Transaction Number */ + timelock?: number; + /** Select Inputs Using Selection Methodology Type String */ + utxo_selection?: string; + /** Transaction Version Number */ + version?: number; +}>; + +export interface CreateFundedPsbtResult { + /** Unsigned PSBT Hex String */ + psbt: string; +} + +/** + * Create an unsigned funded PSBT given inputs or outputs + * + * When specifying local inputs, they must be locked before using + * + * `utxo_selection` methods: 'largest', 'random' + * + * Requires `onchain:write` permission + * + * Requires LND built with `walletrpc` tag + * + * This method is not supported on LND 0.17.5 or below + */ +export const createFundedPsbt: AuthenticatedLightningMethod< + CreateFundedPsbtArgs, + CreateFundedPsbtResult +>; diff --git a/lnd_methods/onchain/index.d.ts b/lnd_methods/onchain/index.d.ts index 74e4eff..233f8de 100644 --- a/lnd_methods/onchain/index.d.ts +++ b/lnd_methods/onchain/index.d.ts @@ -1,6 +1,7 @@ export * from './broadcast_chain_transaction'; export * from './cancel_pending_channel'; export * from './close_channel'; +export * from './create_funded_psbt'; export * from './delete_chain_transaction'; export * from './fund_pending_channels'; export * from './fund_psbt';