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 utxo_selection types #162

Merged
merged 2 commits into from
Apr 24, 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
5 changes: 5 additions & 0 deletions lnd_methods/onchain/fund_psbt.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
AuthenticatedLightningArgs,
AuthenticatedLightningMethod,
UtxoSelection,
} from '../../typescript';
import {MergeExclusive} from 'type-fest';

Expand Down Expand Up @@ -57,6 +58,8 @@ export type FundPsbtResult = {
}[];
/** Unsigned PSBT Hex */
psbt: string;
/** Select UTXOs Using Method String */
utxo_selection?: UtxoSelection;
};

/**
Expand All @@ -73,6 +76,8 @@ export type FundPsbtResult = {
* This method is not supported in LND 0.11.1 and below
*
* Specifying 0 for `min_confirmations` is not supported in LND 0.13.0 and below
*
* `utxo_selection` is not supported in LND 0.17.5 and below
*/
export const fundPsbt: AuthenticatedLightningMethod<
FundPsbtArgs,
Expand Down
5 changes: 5 additions & 0 deletions lnd_methods/onchain/get_chain_fee_estimate.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
AuthenticatedLightningArgs,
AuthenticatedLightningMethod,
UtxoSelection,
} from '../../typescript';

export type GetChainFeeEstimateArgs = AuthenticatedLightningArgs<{
Expand All @@ -14,6 +15,8 @@ export type GetChainFeeEstimateArgs = AuthenticatedLightningArgs<{
target_confirmations?: number;
/** Minimum Confirmations for UTXO Selection */
utxo_confirmations?: number;
/** Select UTXOs Using Method String */
utxo_selection?: UtxoSelection;
}>;

export type GetChainFeeEstimateResult = {
Expand All @@ -27,6 +30,8 @@ export type GetChainFeeEstimateResult = {
* Get a chain fee estimate for a prospective chain send
*
* Requires `onchain:read` permission
*
* `utxo_selection` is not supported in LND 0.17.5 and below
*/
export const getChainFeeEstimate: AuthenticatedLightningMethod<
GetChainFeeEstimateArgs,
Expand Down
5 changes: 5 additions & 0 deletions lnd_methods/onchain/send_to_chain_address.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AuthenticatedLightningArgs,
AuthenticatedLightningMethod,
LightningError,
UtxoSelection,
} from '../../typescript';
import {MergeExclusive} from 'type-fest';

Expand Down Expand Up @@ -38,6 +39,8 @@ export type SendToChainAddressArgs = AuthenticatedLightningArgs<
target_confirmations?: number;
/** Minimum Confirmations for UTXO Selection */
utxo_confirmations?: number;
/** Select UTXOs Using Method String */
utxo_selection?: UtxoSelection;
} & ExpectedNoTokensSpecifiedWhenSendingAllFunds &
ExpectedLogFunctionForChainSendSocketAnnounce
>;
Expand All @@ -61,6 +64,8 @@ export type SendToChainAddressResult = {
* Requires `onchain:write` permission
*
* `utxo_confirmations` is not supported on LND 0.11.1 or below
*
* `utxo_selection` is not supported in LND 0.17.5 and below
*/
export const sendToChainAddress: AuthenticatedLightningMethod<
SendToChainAddressArgs,
Expand Down
5 changes: 5 additions & 0 deletions lnd_methods/onchain/send_to_chain_addresses.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AuthenticatedLightningArgs,
AuthenticatedLightningMethod,
LightningError,
UtxoSelection,
} from '../../typescript';
import {MergeExclusive} from 'type-fest';

Expand Down Expand Up @@ -32,6 +33,8 @@ export type SendToChainAddressesArgs = AuthenticatedLightningArgs<
target_confirmations?: number;
/** Minimum Confirmations for UTXO Selection */
utxo_confirmations?: number;
/** Select UTXOs Using Method String */
utxo_selection?: UtxoSelection;
} & ExpectedLogForChainSendWebSocketAnnouncement
>;

Expand All @@ -54,6 +57,8 @@ export type SendToChainAddressesResult = {
* Requires `onchain:write` permission
*
* `utxo_confirmations` is not supported on LND 0.11.1 or below
*
* `utxo_selection` is not supported in LND 0.17.5 and below
*/
export const sendToChainAddresses: AuthenticatedLightningMethod<
SendToChainAddressesArgs,
Expand Down
5 changes: 5 additions & 0 deletions lnd_methods/onchain/send_to_chain_output_scripts.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
AuthenticatedLightningArgs,
AuthenticatedLightningMethod,
UtxoSelection,
} from '../../typescript';
import {MergeExclusive} from 'type-fest';

Expand All @@ -17,6 +18,8 @@ export type SendToChainOutputScriptsArgs = AuthenticatedLightningArgs<{
}[];
/** Minimum Confirmations for UTXO Selection Number */
utxo_confirmations?: number;
/** Select UTXOs Using Method String */
utxo_selection?: UtxoSelection;
}>;

export type SendToChainOutputScriptsResult = {
Expand All @@ -40,6 +43,8 @@ export type SendToChainOutputScriptsResult = {
* Requires `onchain:write` permission
*
* Requires LND compiled with `walletrpc` build tag
*
* `utxo_selection` is not supported in LND 0.17.5 and below
*/
export const sendToChainOutputScripts: AuthenticatedLightningMethod<
SendToChainOutputScriptsArgs,
Expand Down
2 changes: 2 additions & 0 deletions typescript/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ export type RouteNode = {
export type Route = RouteNode[]

export type Routes = Route[]

export type UtxoSelection = "largest" | "random";
Loading