Skip to content

Commit

Permalink
Merge pull request #162 from bkiac/update-types
Browse files Browse the repository at this point in the history
Add utxo_selection types
  • Loading branch information
alexbosworth authored Apr 24, 2024
2 parents 03f7396 + 115662f commit f3c7ba4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
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";

0 comments on commit f3c7ba4

Please sign in to comment.