Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for createFundedPsbt #169

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions lnd_methods/onchain/create_funded_psbt.d.ts
Original file line number Diff line number Diff line change
@@ -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
>;
1 change: 1 addition & 0 deletions lnd_methods/onchain/index.d.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Loading