From da54eda1bfd95cdd4d2e73622ceed34884b41150 Mon Sep 17 00:00:00 2001 From: Rachel Fish Date: Fri, 27 Jun 2025 03:12:01 -0600 Subject: [PATCH] lib+protos: Bump loop to latest --- lib/types/proto/lnd/lightning.ts | 145 ++++++++-- lib/types/proto/lnd/routerrpc/router.ts | 13 +- lib/types/proto/lnd/walletrpc/walletkit.ts | 111 +++++++- lib/types/proto/loop/client.ts | 216 +++++++++++++- lib/types/proto/tapd/lightning.ts | 145 ++++++++-- lib/types/proto/tapd/routerrpc/router.ts | 13 +- package.json | 8 +- .../faraday.proto | 0 .../autopilotrpc/autopilot.proto | 0 .../chainrpc/chainnotifier.proto | 0 .../invoicesrpc/invoices.proto | 0 .../lightning.proto | 118 +++++++- .../routerrpc/router.proto | 13 +- .../signrpc/signer.proto | 0 .../walletrpc/walletkit.proto | 100 ++++++- .../walletunlocker.proto | 0 .../watchtowerrpc/watchtower.proto | 0 .../wtclientrpc/wtclient.proto | 0 .../client.proto | 263 +++++++++++++++++- .../debug.proto | 0 .../swapserverrpc/common.proto | 0 .../swapserverrpc/server.proto | 0 22 files changed, 1054 insertions(+), 91 deletions(-) rename protos/faraday/{v0.2.13-alpha => v0.2.14-alpha}/faraday.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/autopilotrpc/autopilot.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/chainrpc/chainnotifier.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/invoicesrpc/invoices.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/lightning.proto (97%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/routerrpc/router.proto (98%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/signrpc/signer.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/walletrpc/walletkit.proto (93%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/walletunlocker.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/watchtowerrpc/watchtower.proto (100%) rename protos/lnd/{v0.18.4-beta => v0.19.1-beta}/wtclientrpc/wtclient.proto (100%) rename protos/loop/{v0.29.0-beta => v0.31.2-beta}/client.proto (87%) rename protos/loop/{v0.29.0-beta => v0.31.2-beta}/debug.proto (100%) rename protos/loop/{v0.29.0-beta => v0.31.2-beta}/swapserverrpc/common.proto (100%) rename protos/loop/{v0.29.0-beta => v0.31.2-beta}/swapserverrpc/server.proto (100%) diff --git a/lib/types/proto/lnd/lightning.ts b/lib/types/proto/lnd/lightning.ts index de8a03c..e89b73c 100644 --- a/lib/types/proto/lnd/lightning.ts +++ b/lib/types/proto/lnd/lightning.ts @@ -255,7 +255,10 @@ export interface SendCustomMessageRequest { data: Uint8Array | string; } -export interface SendCustomMessageResponse {} +export interface SendCustomMessageResponse { + /** The status of the send operation. */ + status: string; +} export interface Utxo { /** The type of address */ @@ -335,11 +338,31 @@ export interface GetTransactionsRequest { endHeight: number; /** An optional filter to only include transactions relevant to an account. */ account: string; + /** + * The index of a transaction that will be used in a query to determine which + * transaction should be returned in the response. + */ + indexOffset: number; + /** + * The maximal number of transactions returned in the response to this query. + * This value should be set to 0 to return all transactions. + */ + maxTransactions: number; } export interface TransactionDetails { /** The list of transactions relevant to the wallet. */ transactions: Transaction[]; + /** + * The index of the last item in the set of returned transactions. This can be + * used to seek further, pagination style. + */ + lastIndex: string; + /** + * The index of the last item in the set of returned transactions. This can be + * used to seek backwards, pagination style. + */ + firstIndex: string; } export interface FeeLimit { @@ -843,14 +866,20 @@ export interface ConnectPeerRequest { timeout: string; } -export interface ConnectPeerResponse {} +export interface ConnectPeerResponse { + /** The status of the connect operation. */ + status: string; +} export interface DisconnectPeerRequest { /** The pubkey of the node to disconnect from */ pubKey: string; } -export interface DisconnectPeerResponse {} +export interface DisconnectPeerResponse { + /** The status of the disconnect operation. */ + status: string; +} export interface HTLC { incoming: boolean; @@ -871,6 +900,12 @@ export interface HTLC { forwardingChannel: string; /** Index identifying the htlc on the forwarding channel. */ forwardingHtlcIndex: string; + /** + * Whether the HTLC is locked in. An HTLC is considered locked in when the + * remote party has sent us the `revoke_and_ack` to irrevocably commit this + * HTLC. + */ + lockedIn: boolean; } export interface ChannelConstraints { @@ -1125,6 +1160,11 @@ export interface ChannelCloseSummary { aliasScids: string[]; /** The confirmed SCID for a zero-conf channel. */ zeroConfConfirmedScid: string; + /** + * The TLV encoded custom channel data records for this output, which might + * be set for custom channels. + */ + customChannelData: Uint8Array | string; } export enum ChannelCloseSummary_ClosureType { @@ -1295,8 +1335,8 @@ export interface GetInfoResponse { /** Whether we consider ourselves synced with the public channel graph. */ syncedToGraph: boolean; /** - * Whether the current node is connected to testnet. This field is - * deprecated and the network field should be used instead + * Whether the current node is connected to testnet or testnet4. This field is + * deprecated and the network field should be used instead. * * @deprecated */ @@ -1449,9 +1489,13 @@ export interface CloseChannelRequest { */ maxFeePerVbyte: string; /** - * If true, then the rpc call will not block while it awaits a closing txid. - * Consequently this RPC call will not return a closing txid if this value - * is set. + * If true, then the rpc call will not block while it awaits a closing txid + * to be broadcasted to the mempool. To obtain the closing tx one has to + * listen to the stream for the particular updates. Moreover if a coop close + * is specified and this flag is set to true the coop closing flow will be + * initiated even if HTLCs are active on the channel. The channel will wait + * until all HTLCs are resolved and then start the coop closing process. The + * channel will be disabled in the meantime and will disallow any new HTLCs. */ noWait: boolean; } @@ -1465,9 +1509,18 @@ export interface CloseStatusUpdate { export interface PendingUpdate { txid: Uint8Array | string; outputIndex: number; + feePerVbyte: string; + localCloseTx: boolean; } -export interface InstantUpdate {} +export interface InstantUpdate { + /** + * The number of pending HTLCs that are currently active on the channel. + * These HTLCs need to be resolved before the channel can be closed + * cooperatively. + */ + numPendingHtlcs: number; +} export interface ReadyForPsbtFunding { /** @@ -2753,7 +2806,10 @@ export interface NetworkInfo { export interface StopRequest {} -export interface StopResponse {} +export interface StopResponse { + /** The status of the stop operation. */ + status: string; +} export interface GraphTopologySubscription {} @@ -3476,9 +3532,15 @@ export interface DeleteAllPaymentsRequest { allPayments: boolean; } -export interface DeletePaymentResponse {} +export interface DeletePaymentResponse { + /** The status of the delete operation. */ + status: string; +} -export interface DeleteAllPaymentsResponse {} +export interface DeleteAllPaymentsResponse { + /** The status of the delete operation. */ + status: string; +} export interface AbandonChannelRequest { channelPoint: ChannelPoint | undefined; @@ -3491,7 +3553,10 @@ export interface AbandonChannelRequest { iKnowWhatIAmDoing: boolean; } -export interface AbandonChannelResponse {} +export interface AbandonChannelResponse { + /** The status of the abandon operation. */ + status: string; +} export interface DebugLevelRequest { show: boolean; @@ -3632,6 +3697,16 @@ export interface PolicyUpdateRequest { * retained [EXPERIMENTAL]. */ inboundFee: InboundFee | undefined; + /** + * Under unknown circumstances a channel can exist with a missing edge in + * the graph database. This can cause an 'edge not found' error when calling + * `getchaninfo` and/or cause the default channel policy to be used during + * forwards. Setting this flag will recreate the edge if not found, allowing + * updating this channel policy and fixing the missing edge problem for this + * channel permanently. For fields not set in this command, the default + * policy will be created. + */ + createMissingEdge: boolean; } export interface FailedUpdate { @@ -3798,11 +3873,16 @@ export interface RestoreChanBackupRequest { multiChanBackup: Uint8Array | string | undefined; } -export interface RestoreBackupResponse {} +export interface RestoreBackupResponse { + /** The number of channels successfully restored. */ + numRestored: number; +} export interface ChannelBackupSubscription {} -export interface VerifyChanBackupResponse {} +export interface VerifyChanBackupResponse { + chanPoints: string[]; +} export interface MacaroonPermission { /** The entity a permission grants access to. */ @@ -4078,6 +4158,24 @@ export interface RPCMiddlewareRequest { * intercept message. */ msgId: string; + /** + * The metadata pairs that were sent along with the original gRPC request via + * the golang context.Context using explicit [gRPC + * metadata](https://grpc.io/docs/guides/metadata/). Context values are not + * propagated via gRPC and so we send any pairs along explicitly here so that + * the interceptor can access them. + */ + metadataPairs: { [key: string]: MetadataValues }; +} + +export interface RPCMiddlewareRequest_MetadataPairsEntry { + key: string; + value: MetadataValues | undefined; +} + +export interface MetadataValues { + /** The set of metadata values that correspond to the metadata key. */ + values: string[]; } export interface StreamAuth { @@ -4501,10 +4599,12 @@ export interface Lightning { onError?: (err: Error) => void ): void; /** - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. + * Deprecated, use routerrpc.SendPaymentV2. SendPaymentSync is the synchronous + * non-streaming version of SendPayment. This RPC is intended to be consumed by + * clients of the REST proxy. Additionally, this RPC expects the destination's + * public key and the payment hash (if any) to be encoded as hex strings. + * + * @deprecated */ sendPaymentSync(request?: DeepPartial): Promise; /** @@ -4523,8 +4623,11 @@ export interface Lightning { onError?: (err: Error) => void ): void; /** - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. + * Deprecated, use routerrpc.SendToRouteV2. SendToRouteSync is a synchronous + * version of SendToRoute. It Will block until the payment either fails or + * succeeds. + * + * @deprecated */ sendToRouteSync( request?: DeepPartial diff --git a/lib/types/proto/lnd/routerrpc/router.ts b/lib/types/proto/lnd/routerrpc/router.ts index 9a1be56..66add01 100644 --- a/lib/types/proto/lnd/routerrpc/router.ts +++ b/lib/types/proto/lnd/routerrpc/router.ts @@ -113,10 +113,11 @@ export interface SendPaymentRequest { */ paymentRequest: string; /** - * An upper limit on the amount of time we should spend when attempting to - * fulfill the payment. This is expressed in seconds. If we cannot make a - * successful payment within this time frame, an error will be returned. - * This field must be non-zero. + * An optional limit, expressed in seconds, on the time to wait before + * attempting the first HTLC. Once HTLCs are in flight, the payment will + * not be aborted until the HTLCs are either settled or failed. If the field + * is not set or is explicitly set to zero, the default value of 60 seconds + * will be applied. */ timeoutSeconds: number; /** @@ -809,6 +810,10 @@ export interface ForwardHtlcInterceptResponse { * Any custom records that should be set on the p2p wire message message of * the resumed HTLC. This field is ignored if the action is not * RESUME_MODIFIED. + * + * This map will merge with the existing set of custom records (if any), + * replacing any conflicting types. Note that there currently is no support + * for deleting existing custom records (they can only be replaced). */ outWireCustomRecords: { [key: string]: Uint8Array | string }; } diff --git a/lib/types/proto/lnd/walletrpc/walletkit.ts b/lib/types/proto/lnd/walletrpc/walletkit.ts index f232f2f..9eb17d8 100644 --- a/lib/types/proto/lnd/walletrpc/walletkit.ts +++ b/lib/types/proto/lnd/walletrpc/walletkit.ts @@ -3,6 +3,7 @@ import type { CoinSelectionStrategy, Utxo, OutPoint, + ChannelPoint, TransactionDetails, Transaction as Transaction1 } from '../lightning'; @@ -297,7 +298,10 @@ export interface ReleaseOutputRequest { outpoint: OutPoint | undefined; } -export interface ReleaseOutputResponse {} +export interface ReleaseOutputResponse { + /** The status of the release operation. */ + status: string; +} export interface KeyReq { /** @@ -555,7 +559,10 @@ export interface ImportPublicKeyRequest { addressType: AddressType; } -export interface ImportPublicKeyResponse {} +export interface ImportPublicKeyResponse { + /** The status of the import operation. */ + status: string; +} export interface ImportTapscriptRequest { /** The internal public key, serialized as 32-byte x-only public key. */ @@ -755,6 +762,11 @@ export interface PendingSweep { budget: string; /** The deadline height used for this output when perform fee bumping. */ deadlineHeight: number; + /** + * The block height which the input's locktime will expire at. Zero if the + * input has no locktime. + */ + maturityHeight: number; } export interface PendingSweepsRequest {} @@ -768,9 +780,8 @@ export interface BumpFeeRequest { /** The input we're attempting to bump the fee of. */ outpoint: OutPoint | undefined; /** - * Optional. The deadline in number of blocks that the input should be spent - * within. When not set, for new inputs, the default value (1008) is used; - * for existing inputs, their current values will be retained. + * Optional. The conf target the underlying fee estimator will use to + * estimate the starting fee rate for the fee function. */ targetConf: number; /** @@ -798,7 +809,7 @@ export interface BumpFeeRequest { satPerVbyte: string; /** * Optional. Whether this input will be swept immediately. When set to true, - * the sweeper will sweep this input without waiting for the next batch. + * the sweeper will sweep this input without waiting for the next block. */ immediate: boolean; /** @@ -810,6 +821,13 @@ export interface BumpFeeRequest { * retained. */ budget: string; + /** + * Optional. The deadline delta in number of blocks that the output + * should be spent within. This translates internally to the width of the + * fee function that the sweeper will use to bump the fee rate. When the + * deadline is reached, ALL the budget will be spent as fees. + */ + deadlineDelta: number; } export interface BumpFeeResponse { @@ -817,6 +835,52 @@ export interface BumpFeeResponse { status: string; } +export interface BumpForceCloseFeeRequest { + /** + * The channel point which force close transaction we are attempting to + * bump the fee rate for. + */ + chanPoint: ChannelPoint | undefined; + /** + * Optional. The deadline delta in number of blocks that the anchor output + * should be spent within to bump the closing transaction. When the + * deadline is reached, ALL the budget will be spent as fees + */ + deadlineDelta: number; + /** + * Optional. The starting fee rate, expressed in sat/vbyte. This value will be + * used by the sweeper's fee function as its starting fee rate. When not set, + * the sweeper will use the estimated fee rate using the target_conf as the + * starting fee rate. + */ + startingFeerate: string; + /** + * Optional. Whether this cpfp transaction will be triggered immediately. When + * set to true, the sweeper will consider all currently registered sweeps and + * trigger new batch transactions including the sweeping of the anchor output + * related to the selected force close transaction. + */ + immediate: boolean; + /** + * Optional. The max amount in sats that can be used as the fees. For already + * registered anchor outputs if not set explicitly the old value will be used. + * For channel force closes which have no HTLCs in their commitment transaction + * this value has to be set to an appropriate amount to pay for the cpfp + * transaction of the force closed channel otherwise the fee bumping will fail. + */ + budget: string; + /** + * Optional. The conf target the underlying fee estimator will use to + * estimate the starting fee rate for the fee function. + */ + targetConf: number; +} + +export interface BumpForceCloseFeeResponse { + /** The status of the force close fee bump operation. */ + status: string; +} + export interface ListSweepsRequest { /** * Retrieve the full sweep transaction details. If false, only the sweep txids @@ -858,7 +922,10 @@ export interface LabelTransactionRequest { overwrite: boolean; } -export interface LabelTransactionResponse {} +export interface LabelTransactionResponse { + /** The status of the label operation. */ + status: string; +} export interface FundPsbtRequest { /** @@ -900,6 +967,11 @@ export interface FundPsbtRequest { * input with. */ satPerVbyte: string | undefined; + /** + * The fee rate, expressed in sat/kWU, that should be used to spend the + * input with. + */ + satPerKw: string | undefined; /** * The name of the account to fund the PSBT with. If empty, the default wallet * account is used. @@ -921,6 +993,20 @@ export interface FundPsbtRequest { changeType: ChangeAddressType; /** The strategy to use for selecting coins during funding the PSBT. */ coinSelectionStrategy: CoinSelectionStrategy; + /** The max fee to total output amount ratio that this psbt should adhere to. */ + maxFeeRatio: number; + /** + * The custom lock ID to use for the inputs in the funded PSBT. The value + * if set must be exactly 32 bytes long. If empty, the default lock ID will + * be used. + */ + customLockId: Uint8Array | string; + /** + * If set, then the inputs in the funded PSBT will be locked for the + * specified duration. The lock duration is specified in seconds. If not + * set, the default lock duration will be used. + */ + lockExpirationSeconds: string; } export interface FundPsbtResponse { @@ -1258,6 +1344,7 @@ export interface WalletKit { request?: DeepPartial ): Promise; /** + * lncli: `wallet estimatefeerate` * EstimateFee attempts to query the internal fee estimator of the wallet to * determine the fee (in sat/kw) to attach to a transaction in order to * achieve the confirmation target. @@ -1266,7 +1353,7 @@ export interface WalletKit { request?: DeepPartial ): Promise; /** - * lncli: `pendingsweeps` + * lncli: `wallet pendingsweeps` * PendingSweeps returns lists of on-chain outputs that lnd is currently * attempting to sweep within its central batching engine. Outputs with similar * fee rates are batched together in order to sweep them within a single @@ -1311,6 +1398,14 @@ export interface WalletKit { * the control of the wallet. */ bumpFee(request?: DeepPartial): Promise; + /** + * lncli: `wallet bumpforceclosefee` + * BumpForceCloseFee is an endpoint that allows users to bump the fee of a + * channel force close. This only works for channels with option_anchors. + */ + bumpForceCloseFee( + request?: DeepPartial + ): Promise; /** * lncli: `wallet listsweeps` * ListSweeps returns a list of the sweep transactions our node has produced. diff --git a/lib/types/proto/loop/client.ts b/lib/types/proto/loop/client.ts index 11e4edf..87104d2 100644 --- a/lib/types/proto/loop/client.ts +++ b/lib/types/proto/loop/client.ts @@ -384,6 +384,17 @@ export interface LoopOutRequest { * as the timeout for the payment. */ paymentTimeout: number; + /** + * The optional asset information to use for the swap. If set, the swap will + * be paid in the specified asset using the provided edge node. An Asset client + * must be connected to the loop client to use this feature. + */ + assetInfo: AssetLoopOutRequest | undefined; + /** + * The optional RFQ information to use for the swap. If set, the swap will + * use the provided RFQs to pay for the swap invoice. + */ + assetRfqInfo: AssetRfqInfo | undefined; } export interface LoopInRequest { @@ -537,11 +548,15 @@ export interface SwapStatus { outgoingChanSet: string[]; /** An optional label given to the swap on creation. */ label: string; + /** If the swap was an asset swap, the asset information will be returned. */ + assetInfo: AssetLoopOutInfo | undefined; } export interface ListSwapsRequest { /** Optional filter to only return swaps that match the filter. */ listSwapFilter: ListSwapsFilter | undefined; + /** Set a maximum number of swaps to return in the response. */ + maxSwaps: string; } export interface ListSwapsFilter { @@ -555,6 +570,10 @@ export interface ListSwapsFilter { label: string; /** If specified on creation, the last hop of the swap. */ loopInLastHop: Uint8Array | string; + /** If specified, only returns asset swaps. */ + assetSwapOnly: boolean; + /** If specified, returns swaps initiated after this Unix (ns) timestamp. */ + startTimestampNs: string; } export enum ListSwapsFilter_SwapTypeFilter { @@ -570,6 +589,8 @@ export enum ListSwapsFilter_SwapTypeFilter { export interface ListSwapsResponse { /** The list of all currently known swaps and their status. */ swaps: SwapStatus[]; + /** Timestamp to use for paging start_timestamp_ns. */ + nextStartTime: string; } export interface SwapInfoRequest { @@ -643,6 +664,11 @@ export interface QuoteRequest { * the same time. */ depositOutpoints: string[]; + /** + * The optional asset information to use for the swap. If set, the quote will + * be returned in the specified asset. + */ + assetInfo: AssetLoopOutRequest | undefined; } export interface InQuoteResponse { @@ -682,6 +708,11 @@ export interface OutQuoteResponse { cltvDelta: number; /** The confirmation target to be used for the sweep of the on-chain HTLC. */ confTarget: number; + /** + * If the request was for an asset swap, the quote will return the rfq ids + * that will be used to pay for the swap and prepay invoices. + */ + assetRfqInfo: AssetRfqInfo | undefined; } export interface ProbeRequest { @@ -766,6 +797,12 @@ export interface GetInfoResponse { loopOutStats: LoopStats | undefined; /** Statistics about loop ins. */ loopInStats: LoopStats | undefined; + /** + * The Git commit hash the Loop binary build was based on. If the build had + * uncommited changes, this field will contain the most recent commit hash, + * suffixed by "-dirty". + */ + commitHash: string; } export interface GetLiquidityParamsRequest {} @@ -898,6 +935,39 @@ export interface LiquidityParameters { account: string; /** The address type of the account specified in the account field. */ accountAddrType: AddressType; + /** + * A map of asset parameters to use for swaps. The key is the asset id and the + * value is the parameters to use for swaps in that asset. + */ + easyAssetParams: { [key: string]: EasyAssetAutoloopParams }; + /** + * Set to true to enable fast swap publication. If set, the server will + * publish the HTLC immediately after receiving the swap request. This + * setting has direct implications on the swap fees, as fast swaps may + * not be able to be batched with other swaps. + */ + fastSwapPublication: boolean; +} + +export interface LiquidityParameters_EasyAssetParamsEntry { + key: string; + value: EasyAssetAutoloopParams | undefined; +} + +export interface EasyAssetAutoloopParams { + /** + * Set to true to enable easy autoloop for this asset. If set the client will + * automatically dispatch swaps in order to meet the configured local balance + * target size. Currently only loop out is supported, meaning that easy + * autoloop can only reduce the funds that are held as balance in channels. + */ + enabled: boolean; + /** + * The local balance target size, expressed in the asset's base units. This is + * used by easy autoloop to determine how much liquidity should be maintained + * in channels. + */ + localTargetAssetAmt: string; } export interface LiquidityRule { @@ -1033,8 +1103,15 @@ export interface InstantOutResponse { export interface InstantOutQuoteRequest { /** The amount to swap in satoshis. */ amt: string; - /** The amount of reservations to use for the swap. */ + /** + * Deprecated: use 'reservation_ids' instead. + * The amount of reservations to use for the swap. + * + * @deprecated + */ numReservations: number; + /** The reservations to use for the swap. */ + reservationIds: Uint8Array | string[]; } export interface InstantOutQuoteResponse { @@ -1114,13 +1191,21 @@ export interface WithdrawDepositsRequest { destAddr: string; /** The fee rate in sat/vbyte to use for the withdrawal transaction. */ satPerVbyte: string; + /** + * The amount in satoshis that should be withdrawn from the selected deposits. + * If there is change, it will be sent back to the static address. The fees for + * the transaction are taken from the change output. If the change is below + * the dust limit, there won't be a change output and the dust goes towards + * fees. + */ + amount: string; } export interface WithdrawDepositsResponse { /** The transaction hash of the withdrawal transaction. */ withdrawalTxHash: string; - /** The pkscript of the withdrawal transaction. */ - pkScript: string; + /** The destination address of the withdrawal transaction. */ + address: string; } export interface OutPoint { @@ -1144,6 +1229,13 @@ export interface ListStaticAddressDepositsResponse { filteredDeposits: Deposit[]; } +export interface ListStaticAddressWithdrawalRequest {} + +export interface ListStaticAddressWithdrawalResponse { + /** A list of all static address withdrawals. */ + withdrawals: StaticAddressWithdrawal[]; +} + export interface ListStaticAddressSwapsRequest {} export interface ListStaticAddressSwapsResponse { @@ -1192,6 +1284,25 @@ export interface Deposit { blocksUntilExpiry: string; } +export interface StaticAddressWithdrawal { + /** The transaction id of the withdrawal transaction. */ + txId: string; + /** The selected deposits that is withdrawn from. */ + deposits: Deposit[]; + /** The sum of the deposit values that was selected for withdrawal. */ + totalDepositAmountSatoshis: string; + /** + * The actual amount that was withdrawn from the selected deposits. This value + * represents the sum of selected deposit values minus tx fees minus optional + * change output. + */ + withdrawnAmountSatoshis: string; + /** An optional change. */ + changeAmountSatoshis: string; + /** The confirmation block height of the withdrawal transaction. */ + confirmationHeight: number; +} + export interface StaticAddressLoopInSwap { /** The swap hash of the swap. It represents the unique identifier of the swap. */ swapHash: Uint8Array | string; @@ -1293,6 +1404,98 @@ export interface StaticAddressLoopInResponse { paymentTimeoutSeconds: number; } +export interface AssetLoopOutRequest { + /** + * The asset id to use to pay for the swap invoice. If set an + * asset client is needed to set to be able to pay the invoice. + */ + assetId: Uint8Array | string; + /** + * The node identity public key of the peer to ask for a quote for sending out + * the assets and converting them to satoshis. This must be specified if + * an asset id is set. + */ + assetEdgeNode: Uint8Array | string; + /** + * An optional maximum multiplier for the rfq rate. If not set, the default + * will be 1.1. This means if we request a loop out quote for 1 BTC, the off + * chain cost will be at most 1.1 BTC. + */ + maxLimitMultiplier: number; + /** An optional expiry unix timestamp for when the rfq quote should expire. */ + expiry: string; +} + +export interface AssetRfqInfo { + /** The Prepay RFQ ID to use to pay for the prepay invoice. */ + prepayRfqId: Uint8Array | string; + /** + * The maximum asset amt we'll pay for the prepay payment. This includes the + * max limit multiplier that was set in the request. + */ + maxPrepayAssetAmt: string; + /** The asset to BTC conversion rate for the prepay invoice. */ + prepayAssetRate: FixedPoint | undefined; + /** The Swap RFQ ID to use to pay for the swap invoice. */ + swapRfqId: Uint8Array | string; + /** + * The maximum asset amt we'll pay for the swap payment. This includes the + * max limit multiplier that was set in the request. + */ + maxSwapAssetAmt: string; + /** The asset to BTC conversion rate for the swap invoice. */ + swapAssetRate: FixedPoint | undefined; + /** The name of the asset to swap. */ + assetName: string; +} + +/** + * FixedPoint is a scaled integer representation of a fractional number. + * + * This type consists of two integer fields: a coefficient and a scale. + * Using this format enables precise and consistent representation of fractional + * numbers while avoiding floating-point data types, which are prone to + * precision errors. + * + * The relationship between the fractional representation and its fixed-point + * representation is expressed as: + * ``` + * V = F_c / (10^F_s) + * ``` + * where: + * + * * `V` is the fractional value. + * + * * `F_c` is the coefficient component of the fixed-point representation. It is + * the scaled-up fractional value represented as an integer. + * + * * `F_s` is the scale component. It is an integer specifying how + * many decimal places `F_c` should be divided by to obtain the fractional + * representation. + */ +export interface FixedPoint { + /** + * The coefficient is the fractional value scaled-up as an integer. This + * integer is represented as a string as it may be too large to fit in a + * uint64. + */ + coefficient: string; + /** + * The scale is the component that determines how many decimal places + * the coefficient should be divided by to obtain the fractional value. + */ + scale: number; +} + +export interface AssetLoopOutInfo { + /** The asset id that was used to pay for the swap invoice. */ + assetId: string; + /** The human readable name of the asset. */ + assetName: string; + /** The total asset offchain cost of the swap. */ + assetCostOffchain: string; +} + /** * SwapClient is a service that handles the client side process of onchain/offchain * swaps. The service is designed for a single client. @@ -1495,6 +1698,13 @@ export interface SwapClient { listStaticAddressDeposits( request?: DeepPartial ): Promise; + /** + * loop:`listwithdrawals` + * ListStaticAddressWithdrawals returns a list of static address withdrawals. + */ + listStaticAddressWithdrawals( + request?: DeepPartial + ): Promise; /** * loop:`listswaps` * ListStaticAddressSwaps returns a list of filtered static address diff --git a/lib/types/proto/tapd/lightning.ts b/lib/types/proto/tapd/lightning.ts index de8a03c..e89b73c 100644 --- a/lib/types/proto/tapd/lightning.ts +++ b/lib/types/proto/tapd/lightning.ts @@ -255,7 +255,10 @@ export interface SendCustomMessageRequest { data: Uint8Array | string; } -export interface SendCustomMessageResponse {} +export interface SendCustomMessageResponse { + /** The status of the send operation. */ + status: string; +} export interface Utxo { /** The type of address */ @@ -335,11 +338,31 @@ export interface GetTransactionsRequest { endHeight: number; /** An optional filter to only include transactions relevant to an account. */ account: string; + /** + * The index of a transaction that will be used in a query to determine which + * transaction should be returned in the response. + */ + indexOffset: number; + /** + * The maximal number of transactions returned in the response to this query. + * This value should be set to 0 to return all transactions. + */ + maxTransactions: number; } export interface TransactionDetails { /** The list of transactions relevant to the wallet. */ transactions: Transaction[]; + /** + * The index of the last item in the set of returned transactions. This can be + * used to seek further, pagination style. + */ + lastIndex: string; + /** + * The index of the last item in the set of returned transactions. This can be + * used to seek backwards, pagination style. + */ + firstIndex: string; } export interface FeeLimit { @@ -843,14 +866,20 @@ export interface ConnectPeerRequest { timeout: string; } -export interface ConnectPeerResponse {} +export interface ConnectPeerResponse { + /** The status of the connect operation. */ + status: string; +} export interface DisconnectPeerRequest { /** The pubkey of the node to disconnect from */ pubKey: string; } -export interface DisconnectPeerResponse {} +export interface DisconnectPeerResponse { + /** The status of the disconnect operation. */ + status: string; +} export interface HTLC { incoming: boolean; @@ -871,6 +900,12 @@ export interface HTLC { forwardingChannel: string; /** Index identifying the htlc on the forwarding channel. */ forwardingHtlcIndex: string; + /** + * Whether the HTLC is locked in. An HTLC is considered locked in when the + * remote party has sent us the `revoke_and_ack` to irrevocably commit this + * HTLC. + */ + lockedIn: boolean; } export interface ChannelConstraints { @@ -1125,6 +1160,11 @@ export interface ChannelCloseSummary { aliasScids: string[]; /** The confirmed SCID for a zero-conf channel. */ zeroConfConfirmedScid: string; + /** + * The TLV encoded custom channel data records for this output, which might + * be set for custom channels. + */ + customChannelData: Uint8Array | string; } export enum ChannelCloseSummary_ClosureType { @@ -1295,8 +1335,8 @@ export interface GetInfoResponse { /** Whether we consider ourselves synced with the public channel graph. */ syncedToGraph: boolean; /** - * Whether the current node is connected to testnet. This field is - * deprecated and the network field should be used instead + * Whether the current node is connected to testnet or testnet4. This field is + * deprecated and the network field should be used instead. * * @deprecated */ @@ -1449,9 +1489,13 @@ export interface CloseChannelRequest { */ maxFeePerVbyte: string; /** - * If true, then the rpc call will not block while it awaits a closing txid. - * Consequently this RPC call will not return a closing txid if this value - * is set. + * If true, then the rpc call will not block while it awaits a closing txid + * to be broadcasted to the mempool. To obtain the closing tx one has to + * listen to the stream for the particular updates. Moreover if a coop close + * is specified and this flag is set to true the coop closing flow will be + * initiated even if HTLCs are active on the channel. The channel will wait + * until all HTLCs are resolved and then start the coop closing process. The + * channel will be disabled in the meantime and will disallow any new HTLCs. */ noWait: boolean; } @@ -1465,9 +1509,18 @@ export interface CloseStatusUpdate { export interface PendingUpdate { txid: Uint8Array | string; outputIndex: number; + feePerVbyte: string; + localCloseTx: boolean; } -export interface InstantUpdate {} +export interface InstantUpdate { + /** + * The number of pending HTLCs that are currently active on the channel. + * These HTLCs need to be resolved before the channel can be closed + * cooperatively. + */ + numPendingHtlcs: number; +} export interface ReadyForPsbtFunding { /** @@ -2753,7 +2806,10 @@ export interface NetworkInfo { export interface StopRequest {} -export interface StopResponse {} +export interface StopResponse { + /** The status of the stop operation. */ + status: string; +} export interface GraphTopologySubscription {} @@ -3476,9 +3532,15 @@ export interface DeleteAllPaymentsRequest { allPayments: boolean; } -export interface DeletePaymentResponse {} +export interface DeletePaymentResponse { + /** The status of the delete operation. */ + status: string; +} -export interface DeleteAllPaymentsResponse {} +export interface DeleteAllPaymentsResponse { + /** The status of the delete operation. */ + status: string; +} export interface AbandonChannelRequest { channelPoint: ChannelPoint | undefined; @@ -3491,7 +3553,10 @@ export interface AbandonChannelRequest { iKnowWhatIAmDoing: boolean; } -export interface AbandonChannelResponse {} +export interface AbandonChannelResponse { + /** The status of the abandon operation. */ + status: string; +} export interface DebugLevelRequest { show: boolean; @@ -3632,6 +3697,16 @@ export interface PolicyUpdateRequest { * retained [EXPERIMENTAL]. */ inboundFee: InboundFee | undefined; + /** + * Under unknown circumstances a channel can exist with a missing edge in + * the graph database. This can cause an 'edge not found' error when calling + * `getchaninfo` and/or cause the default channel policy to be used during + * forwards. Setting this flag will recreate the edge if not found, allowing + * updating this channel policy and fixing the missing edge problem for this + * channel permanently. For fields not set in this command, the default + * policy will be created. + */ + createMissingEdge: boolean; } export interface FailedUpdate { @@ -3798,11 +3873,16 @@ export interface RestoreChanBackupRequest { multiChanBackup: Uint8Array | string | undefined; } -export interface RestoreBackupResponse {} +export interface RestoreBackupResponse { + /** The number of channels successfully restored. */ + numRestored: number; +} export interface ChannelBackupSubscription {} -export interface VerifyChanBackupResponse {} +export interface VerifyChanBackupResponse { + chanPoints: string[]; +} export interface MacaroonPermission { /** The entity a permission grants access to. */ @@ -4078,6 +4158,24 @@ export interface RPCMiddlewareRequest { * intercept message. */ msgId: string; + /** + * The metadata pairs that were sent along with the original gRPC request via + * the golang context.Context using explicit [gRPC + * metadata](https://grpc.io/docs/guides/metadata/). Context values are not + * propagated via gRPC and so we send any pairs along explicitly here so that + * the interceptor can access them. + */ + metadataPairs: { [key: string]: MetadataValues }; +} + +export interface RPCMiddlewareRequest_MetadataPairsEntry { + key: string; + value: MetadataValues | undefined; +} + +export interface MetadataValues { + /** The set of metadata values that correspond to the metadata key. */ + values: string[]; } export interface StreamAuth { @@ -4501,10 +4599,12 @@ export interface Lightning { onError?: (err: Error) => void ): void; /** - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. + * Deprecated, use routerrpc.SendPaymentV2. SendPaymentSync is the synchronous + * non-streaming version of SendPayment. This RPC is intended to be consumed by + * clients of the REST proxy. Additionally, this RPC expects the destination's + * public key and the payment hash (if any) to be encoded as hex strings. + * + * @deprecated */ sendPaymentSync(request?: DeepPartial): Promise; /** @@ -4523,8 +4623,11 @@ export interface Lightning { onError?: (err: Error) => void ): void; /** - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. + * Deprecated, use routerrpc.SendToRouteV2. SendToRouteSync is a synchronous + * version of SendToRoute. It Will block until the payment either fails or + * succeeds. + * + * @deprecated */ sendToRouteSync( request?: DeepPartial diff --git a/lib/types/proto/tapd/routerrpc/router.ts b/lib/types/proto/tapd/routerrpc/router.ts index 9a1be56..66add01 100644 --- a/lib/types/proto/tapd/routerrpc/router.ts +++ b/lib/types/proto/tapd/routerrpc/router.ts @@ -113,10 +113,11 @@ export interface SendPaymentRequest { */ paymentRequest: string; /** - * An upper limit on the amount of time we should spend when attempting to - * fulfill the payment. This is expressed in seconds. If we cannot make a - * successful payment within this time frame, an error will be returned. - * This field must be non-zero. + * An optional limit, expressed in seconds, on the time to wait before + * attempting the first HTLC. Once HTLCs are in flight, the payment will + * not be aborted until the HTLCs are either settled or failed. If the field + * is not set or is explicitly set to zero, the default value of 60 seconds + * will be applied. */ timeoutSeconds: number; /** @@ -809,6 +810,10 @@ export interface ForwardHtlcInterceptResponse { * Any custom records that should be set on the p2p wire message message of * the resumed HTLC. This field is ignored if the action is not * RESUME_MODIFIED. + * + * This map will merge with the existing set of custom records (if any), + * replacing any conflicting types. Note that there currently is no support + * for deleting existing custom records (they can only be replaced). */ outWireCustomRecords: { [key: string]: Uint8Array | string }; } diff --git a/package.json b/package.json index cc0b91d..755b150 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "@lightninglabs/lnc-core", - "version": "0.3.3-alpha", + "version": "0.3.4-alpha", "description": "Type definitions and utilities for Lightning Node Connect", "main": "./dist/index.js", "types": "./dist/index.d.ts", "config": { - "lnd_release_tag": "v0.18.4-beta", - "loop_release_tag": "v0.29.0-beta", + "lnd_release_tag": "v0.19.1-beta", + "loop_release_tag": "v0.31.2-beta", "pool_release_tag": "v0.6.5-beta", - "faraday_release_tag": "v0.2.13-alpha", + "faraday_release_tag": "v0.2.14-alpha", "tapd_release_tag": "v0.5.0", "lit_release_tag": "v0.14.0-alpha", "protoc_version": "21.9" diff --git a/protos/faraday/v0.2.13-alpha/faraday.proto b/protos/faraday/v0.2.14-alpha/faraday.proto similarity index 100% rename from protos/faraday/v0.2.13-alpha/faraday.proto rename to protos/faraday/v0.2.14-alpha/faraday.proto diff --git a/protos/lnd/v0.18.4-beta/autopilotrpc/autopilot.proto b/protos/lnd/v0.19.1-beta/autopilotrpc/autopilot.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/autopilotrpc/autopilot.proto rename to protos/lnd/v0.19.1-beta/autopilotrpc/autopilot.proto diff --git a/protos/lnd/v0.18.4-beta/chainrpc/chainnotifier.proto b/protos/lnd/v0.19.1-beta/chainrpc/chainnotifier.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/chainrpc/chainnotifier.proto rename to protos/lnd/v0.19.1-beta/chainrpc/chainnotifier.proto diff --git a/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto b/protos/lnd/v0.19.1-beta/invoicesrpc/invoices.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto rename to protos/lnd/v0.19.1-beta/invoicesrpc/invoices.proto diff --git a/protos/lnd/v0.18.4-beta/lightning.proto b/protos/lnd/v0.19.1-beta/lightning.proto similarity index 97% rename from protos/lnd/v0.18.4-beta/lightning.proto rename to protos/lnd/v0.19.1-beta/lightning.proto index 6449305..5ee8e67 100644 --- a/protos/lnd/v0.18.4-beta/lightning.proto +++ b/protos/lnd/v0.19.1-beta/lightning.proto @@ -274,12 +274,14 @@ service Lightning { } /* - SendPaymentSync is the synchronous non-streaming version of SendPayment. - This RPC is intended to be consumed by clients of the REST proxy. - Additionally, this RPC expects the destination's public key and the payment - hash (if any) to be encoded as hex strings. + Deprecated, use routerrpc.SendPaymentV2. SendPaymentSync is the synchronous + non-streaming version of SendPayment. This RPC is intended to be consumed by + clients of the REST proxy. Additionally, this RPC expects the destination's + public key and the payment hash (if any) to be encoded as hex strings. */ - rpc SendPaymentSync (SendRequest) returns (SendResponse); + rpc SendPaymentSync (SendRequest) returns (SendResponse) { + option deprecated = true; + } /* lncli: `sendtoroute` Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional @@ -293,10 +295,13 @@ service Lightning { } /* - SendToRouteSync is a synchronous version of SendToRoute. It Will block - until the payment either fails or succeeds. + Deprecated, use routerrpc.SendToRouteV2. SendToRouteSync is a synchronous + version of SendToRoute. It Will block until the payment either fails or + succeeds. */ - rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse); + rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) { + option deprecated = true; + } /* lncli: `addinvoice` AddInvoice attempts to add a new invoice to the invoice database. Any @@ -643,6 +648,8 @@ message SendCustomMessageRequest { } message SendCustomMessageResponse { + // The status of the send operation. + string status = 1; } message Utxo { @@ -755,11 +762,35 @@ message GetTransactionsRequest { // An optional filter to only include transactions relevant to an account. string account = 3; + + /* + The index of a transaction that will be used in a query to determine which + transaction should be returned in the response. + */ + uint32 index_offset = 4; + + /* + The maximal number of transactions returned in the response to this query. + This value should be set to 0 to return all transactions. + */ + uint32 max_transactions = 5; } message TransactionDetails { // The list of transactions relevant to the wallet. repeated Transaction transactions = 1; + + /* + The index of the last item in the set of returned transactions. This can be + used to seek further, pagination style. + */ + uint64 last_index = 2; + + /* + The index of the last item in the set of returned transactions. This can be + used to seek backwards, pagination style. + */ + uint64 first_index = 3; } message FeeLimit { @@ -1317,6 +1348,8 @@ message ConnectPeerRequest { uint64 timeout = 3; } message ConnectPeerResponse { + // The status of the connect operation. + string status = 1; } message DisconnectPeerRequest { @@ -1324,6 +1357,8 @@ message DisconnectPeerRequest { string pub_key = 1; } message DisconnectPeerResponse { + // The status of the disconnect operation. + string status = 1; } message HTLC { @@ -1346,6 +1381,13 @@ message HTLC { // Index identifying the htlc on the forwarding channel. uint64 forwarding_htlc_index = 7; + + /* + Whether the HTLC is locked in. An HTLC is considered locked in when the + remote party has sent us the `revoke_and_ack` to irrevocably commit this + HTLC. + */ + bool locked_in = 8; } enum CommitmentType { @@ -1716,6 +1758,10 @@ message ChannelCloseSummary { // The confirmed SCID for a zero-conf channel. uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; + + // The TLV encoded custom channel data records for this output, which might + // be set for custom channels. + bytes custom_channel_data = 16; } enum ResolutionType { @@ -1966,8 +2012,8 @@ message GetInfoResponse { bool synced_to_graph = 18; /* - Whether the current node is connected to testnet. This field is - deprecated and the network field should be used instead + Whether the current node is connected to testnet or testnet4. This field is + deprecated and the network field should be used instead. */ bool testnet = 10 [deprecated = true]; @@ -2111,9 +2157,13 @@ message CloseChannelRequest { // NOTE: This field is only respected if we're the initiator of the channel. uint64 max_fee_per_vbyte = 7; - // If true, then the rpc call will not block while it awaits a closing txid. - // Consequently this RPC call will not return a closing txid if this value - // is set. + // If true, then the rpc call will not block while it awaits a closing txid + // to be broadcasted to the mempool. To obtain the closing tx one has to + // listen to the stream for the particular updates. Moreover if a coop close + // is specified and this flag is set to true the coop closing flow will be + // initiated even if HTLCs are active on the channel. The channel will wait + // until all HTLCs are resolved and then start the coop closing process. The + // channel will be disabled in the meantime and will disallow any new HTLCs. bool no_wait = 8; } @@ -2128,9 +2178,15 @@ message CloseStatusUpdate { message PendingUpdate { bytes txid = 1; uint32 output_index = 2; + int64 fee_per_vbyte = 3; + bool local_close_tx = 4; } message InstantUpdate { + // The number of pending HTLCs that are currently active on the channel. + // These HTLCs need to be resolved before the channel can be closed + // cooperatively. + int32 num_pending_htlcs = 1; } message ReadyForPsbtFunding { @@ -3542,6 +3598,8 @@ message NetworkInfo { message StopRequest { } message StopResponse { + // The status of the stop operation. + string status = 1; } message GraphTopologySubscription { @@ -4366,9 +4424,13 @@ message DeleteAllPaymentsRequest { } message DeletePaymentResponse { + // The status of the delete operation. + string status = 1; } message DeleteAllPaymentsResponse { + // The status of the delete operation. + string status = 1; } message AbandonChannelRequest { @@ -4385,6 +4447,8 @@ message AbandonChannelRequest { } message AbandonChannelResponse { + // The status of the abandon operation. + string status = 1; } message DebugLevelRequest { @@ -4544,6 +4608,15 @@ message PolicyUpdateRequest { // Optional inbound fee. If unset, the previously set value will be // retained [EXPERIMENTAL]. InboundFee inbound_fee = 10; + + // Under unknown circumstances a channel can exist with a missing edge in + // the graph database. This can cause an 'edge not found' error when calling + // `getchaninfo` and/or cause the default channel policy to be used during + // forwards. Setting this flag will recreate the edge if not found, allowing + // updating this channel policy and fixing the missing edge problem for this + // channel permanently. For fields not set in this command, the default + // policy will be created. + bool create_missing_edge = 11; } enum UpdateFailure { @@ -4724,12 +4797,15 @@ message RestoreChanBackupRequest { } } message RestoreBackupResponse { + // The number of channels successfully restored. + uint32 num_restored = 1; } message ChannelBackupSubscription { } message VerifyChanBackupResponse { + repeated string chan_points = 1; } message MacaroonPermission { @@ -5052,6 +5128,22 @@ message RPCMiddlewareRequest { intercept message. */ uint64 msg_id = 7; + + /* + The metadata pairs that were sent along with the original gRPC request via + the golang context.Context using explicit [gRPC + metadata](https://grpc.io/docs/guides/metadata/). Context values are not + propagated via gRPC and so we send any pairs along explicitly here so that + the interceptor can access them. + */ + map metadata_pairs = 9; +} + +message MetadataValues { + /* + The set of metadata values that correspond to the metadata key. + */ + repeated string values = 1; } message StreamAuth { diff --git a/protos/lnd/v0.18.4-beta/routerrpc/router.proto b/protos/lnd/v0.19.1-beta/routerrpc/router.proto similarity index 98% rename from protos/lnd/v0.18.4-beta/routerrpc/router.proto rename to protos/lnd/v0.19.1-beta/routerrpc/router.proto index 92da751..2c2622a 100644 --- a/protos/lnd/v0.18.4-beta/routerrpc/router.proto +++ b/protos/lnd/v0.19.1-beta/routerrpc/router.proto @@ -227,10 +227,11 @@ message SendPaymentRequest { string payment_request = 5; /* - An upper limit on the amount of time we should spend when attempting to - fulfill the payment. This is expressed in seconds. If we cannot make a - successful payment within this time frame, an error will be returned. - This field must be non-zero. + An optional limit, expressed in seconds, on the time to wait before + attempting the first HTLC. Once HTLCs are in flight, the payment will + not be aborted until the HTLCs are either settled or failed. If the field + is not set or is explicitly set to zero, the default value of 60 seconds + will be applied. */ int32 timeout_seconds = 6; @@ -1063,6 +1064,10 @@ message ForwardHtlcInterceptResponse { // Any custom records that should be set on the p2p wire message message of // the resumed HTLC. This field is ignored if the action is not // RESUME_MODIFIED. + // + // This map will merge with the existing set of custom records (if any), + // replacing any conflicting types. Note that there currently is no support + // for deleting existing custom records (they can only be replaced). map out_wire_custom_records = 8; } diff --git a/protos/lnd/v0.18.4-beta/signrpc/signer.proto b/protos/lnd/v0.19.1-beta/signrpc/signer.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/signrpc/signer.proto rename to protos/lnd/v0.19.1-beta/signrpc/signer.proto diff --git a/protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto b/protos/lnd/v0.19.1-beta/walletrpc/walletkit.proto similarity index 93% rename from protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto rename to protos/lnd/v0.19.1-beta/walletrpc/walletkit.proto index ec33024..b50d2d6 100644 --- a/protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto +++ b/protos/lnd/v0.19.1-beta/walletrpc/walletkit.proto @@ -222,14 +222,14 @@ service WalletKit { */ rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse); - /* + /* lncli: `wallet estimatefeerate` EstimateFee attempts to query the internal fee estimator of the wallet to determine the fee (in sat/kw) to attach to a transaction in order to achieve the confirmation target. */ rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse); - /* lncli: `pendingsweeps` + /* lncli: `wallet pendingsweeps` PendingSweeps returns lists of on-chain outputs that lnd is currently attempting to sweep within its central batching engine. Outputs with similar fee rates are batched together in order to sweep them within a single @@ -273,6 +273,13 @@ service WalletKit { */ rpc BumpFee (BumpFeeRequest) returns (BumpFeeResponse); + /* lncli: `wallet bumpforceclosefee` + BumpForceCloseFee is an endpoint that allows users to bump the fee of a + channel force close. This only works for channels with option_anchors. + */ + rpc BumpForceCloseFee (BumpForceCloseFeeRequest) + returns (BumpForceCloseFeeResponse); + /* lncli: `wallet listsweeps` ListSweeps returns a list of the sweep transactions our node has produced. Note that these sweeps may not be confirmed yet, as we record sweeps on @@ -407,6 +414,8 @@ message ReleaseOutputRequest { } message ReleaseOutputResponse { + // The status of the release operation. + string status = 1; } message KeyReq { @@ -692,6 +701,8 @@ message ImportPublicKeyRequest { AddressType address_type = 2; } message ImportPublicKeyResponse { + // The status of the import operation. + string status = 1; } message ImportTapscriptRequest { @@ -1161,6 +1172,12 @@ message PendingSweep { The deadline height used for this output when perform fee bumping. */ uint32 deadline_height = 14; + + /* + The block height which the input's locktime will expire at. Zero if the + input has no locktime. + */ + uint32 maturity_height = 15; } message PendingSweepsRequest { @@ -1177,9 +1194,8 @@ message BumpFeeRequest { // The input we're attempting to bump the fee of. lnrpc.OutPoint outpoint = 1; - // Optional. The deadline in number of blocks that the input should be spent - // within. When not set, for new inputs, the default value (1008) is used; - // for existing inputs, their current values will be retained. + // Optional. The conf target the underlying fee estimator will use to + // estimate the starting fee rate for the fee function. uint32 target_conf = 2; /* @@ -1206,7 +1222,7 @@ message BumpFeeRequest { /* Optional. Whether this input will be swept immediately. When set to true, - the sweeper will sweep this input without waiting for the next batch. + the sweeper will sweep this input without waiting for the next block. */ bool immediate = 6; @@ -1219,6 +1235,12 @@ message BumpFeeRequest { retained. */ uint64 budget = 7; + + // Optional. The deadline delta in number of blocks that the output + // should be spent within. This translates internally to the width of the + // fee function that the sweeper will use to bump the fee rate. When the + // deadline is reached, ALL the budget will be spent as fees. + uint32 deadline_delta = 8; } message BumpFeeResponse { @@ -1226,6 +1248,51 @@ message BumpFeeResponse { string status = 1; } +message BumpForceCloseFeeRequest { + // The channel point which force close transaction we are attempting to + // bump the fee rate for. + lnrpc.ChannelPoint chan_point = 1; + + // Optional. The deadline delta in number of blocks that the anchor output + // should be spent within to bump the closing transaction. When the + // deadline is reached, ALL the budget will be spent as fees + uint32 deadline_delta = 2; + + /* + Optional. The starting fee rate, expressed in sat/vbyte. This value will be + used by the sweeper's fee function as its starting fee rate. When not set, + the sweeper will use the estimated fee rate using the target_conf as the + starting fee rate. + */ + uint64 starting_feerate = 3; + + /* + Optional. Whether this cpfp transaction will be triggered immediately. When + set to true, the sweeper will consider all currently registered sweeps and + trigger new batch transactions including the sweeping of the anchor output + related to the selected force close transaction. + */ + bool immediate = 4; + + /* + Optional. The max amount in sats that can be used as the fees. For already + registered anchor outputs if not set explicitly the old value will be used. + For channel force closes which have no HTLCs in their commitment transaction + this value has to be set to an appropriate amount to pay for the cpfp + transaction of the force closed channel otherwise the fee bumping will fail. + */ + uint64 budget = 5; + + // Optional. The conf target the underlying fee estimator will use to + // estimate the starting fee rate for the fee function. + uint32 target_conf = 6; +} + +message BumpForceCloseFeeResponse { + // The status of the force close fee bump operation. + string status = 1; +} + message ListSweepsRequest { /* Retrieve the full sweep transaction details. If false, only the sweep txids @@ -1271,6 +1338,8 @@ message LabelTransactionRequest { } message LabelTransactionResponse { + // The status of the label operation. + string status = 1; } // The possible change address types for default accounts and single imported @@ -1341,6 +1410,12 @@ message FundPsbtRequest { input with. */ uint64 sat_per_vbyte = 4; + + /* + The fee rate, expressed in sat/kWU, that should be used to spend the + input with. + */ + uint64 sat_per_kw = 11; } /* @@ -1364,6 +1439,19 @@ message FundPsbtRequest { // The strategy to use for selecting coins during funding the PSBT. lnrpc.CoinSelectionStrategy coin_selection_strategy = 10; + + // The max fee to total output amount ratio that this psbt should adhere to. + double max_fee_ratio = 12; + + // The custom lock ID to use for the inputs in the funded PSBT. The value + // if set must be exactly 32 bytes long. If empty, the default lock ID will + // be used. + bytes custom_lock_id = 13; + + // If set, then the inputs in the funded PSBT will be locked for the + // specified duration. The lock duration is specified in seconds. If not + // set, the default lock duration will be used. + uint64 lock_expiration_seconds = 14; } message FundPsbtResponse { /* diff --git a/protos/lnd/v0.18.4-beta/walletunlocker.proto b/protos/lnd/v0.19.1-beta/walletunlocker.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/walletunlocker.proto rename to protos/lnd/v0.19.1-beta/walletunlocker.proto diff --git a/protos/lnd/v0.18.4-beta/watchtowerrpc/watchtower.proto b/protos/lnd/v0.19.1-beta/watchtowerrpc/watchtower.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/watchtowerrpc/watchtower.proto rename to protos/lnd/v0.19.1-beta/watchtowerrpc/watchtower.proto diff --git a/protos/lnd/v0.18.4-beta/wtclientrpc/wtclient.proto b/protos/lnd/v0.19.1-beta/wtclientrpc/wtclient.proto similarity index 100% rename from protos/lnd/v0.18.4-beta/wtclientrpc/wtclient.proto rename to protos/lnd/v0.19.1-beta/wtclientrpc/wtclient.proto diff --git a/protos/loop/v0.29.0-beta/client.proto b/protos/loop/v0.31.2-beta/client.proto similarity index 87% rename from protos/loop/v0.29.0-beta/client.proto rename to protos/loop/v0.31.2-beta/client.proto index 7867782..b1247e9 100644 --- a/protos/loop/v0.29.0-beta/client.proto +++ b/protos/loop/v0.31.2-beta/client.proto @@ -175,6 +175,12 @@ service SwapClient { rpc ListStaticAddressDeposits (ListStaticAddressDepositsRequest) returns (ListStaticAddressDepositsResponse); + /* loop:`listwithdrawals` + ListStaticAddressWithdrawals returns a list of static address withdrawals. + */ + rpc ListStaticAddressWithdrawals (ListStaticAddressWithdrawalRequest) + returns (ListStaticAddressWithdrawalResponse); + /* loop:`listswaps` ListStaticAddressSwaps returns a list of filtered static address swaps. @@ -336,6 +342,19 @@ message LoopOutRequest { as the timeout for the payment. */ uint32 payment_timeout = 19; + + /* + The optional asset information to use for the swap. If set, the swap will + be paid in the specified asset using the provided edge node. An Asset client + must be connected to the loop client to use this feature. + */ + AssetLoopOutRequest asset_info = 20; + + /* + The optional RFQ information to use for the swap. If set, the swap will + use the provided RFQs to pay for the swap invoice. + */ + AssetRfqInfo asset_rfq_info = 21; } /* @@ -539,6 +558,9 @@ message SwapStatus { // An optional label given to the swap on creation. string label = 15; + + // If the swap was an asset swap, the asset information will be returned. + AssetLoopOutInfo asset_info = 19; } enum SwapType { @@ -659,6 +681,9 @@ enum FailureReason { message ListSwapsRequest { // Optional filter to only return swaps that match the filter. ListSwapsFilter list_swap_filter = 1; + + // Set a maximum number of swaps to return in the response. + uint64 max_swaps = 2; } message ListSwapsFilter { @@ -685,6 +710,12 @@ message ListSwapsFilter { // If specified on creation, the last hop of the swap. bytes loop_in_last_hop = 5; + + // If specified, only returns asset swaps. + bool asset_swap_only = 6; + + // If specified, returns swaps initiated after this Unix (ns) timestamp. + int64 start_timestamp_ns = 7; } message ListSwapsResponse { @@ -692,6 +723,9 @@ message ListSwapsResponse { The list of all currently known swaps and their status. */ repeated SwapStatus swaps = 1; + + // Timestamp to use for paging start_timestamp_ns. + int64 next_start_time = 2; } message SwapInfoRequest { @@ -793,6 +827,12 @@ message QuoteRequest { the same time. */ repeated string deposit_outpoints = 8; + + /* + The optional asset information to use for the swap. If set, the quote will + be returned in the specified asset. + */ + AssetLoopOutRequest asset_info = 9; } message InQuoteResponse { @@ -856,6 +896,12 @@ message OutQuoteResponse { The confirmation target to be used for the sweep of the on-chain HTLC. */ int32 conf_target = 6; + + /* + If the request was for an asset swap, the quote will return the rfq ids + that will be used to pay for the swap and prepay invoices. + */ + AssetRfqInfo asset_rfq_info = 7; } message ProbeRequest { @@ -1014,6 +1060,13 @@ message GetInfoResponse { Statistics about loop ins. */ LoopStats loop_in_stats = 8; + + /* + The Git commit hash the Loop binary build was based on. If the build had + uncommited changes, this field will contain the most recent commit hash, + suffixed by "-dirty". + */ + string commit_hash = 9; } message GetLiquidityParamsRequest { @@ -1176,6 +1229,37 @@ message LiquidityParameters { The address type of the account specified in the account field. */ AddressType account_addr_type = 24; + + /* + A map of asset parameters to use for swaps. The key is the asset id and the + value is the parameters to use for swaps in that asset. + */ + map easy_asset_params = 25; + + /* + * Set to true to enable fast swap publication. If set, the server will + * publish the HTLC immediately after receiving the swap request. This + * setting has direct implications on the swap fees, as fast swaps may + * not be able to be batched with other swaps. + */ + bool fast_swap_publication = 26; +} + +message EasyAssetAutoloopParams { + /* + Set to true to enable easy autoloop for this asset. If set the client will + automatically dispatch swaps in order to meet the configured local balance + target size. Currently only loop out is supported, meaning that easy + autoloop can only reduce the funds that are held as balance in channels. + */ + bool enabled = 1; + + /* + The local balance target size, expressed in the asset's base units. This is + used by easy autoloop to determine how much liquidity should be maintained + in channels. + */ + uint64 local_target_asset_amt = 2; } enum LiquidityRuleType { @@ -1456,9 +1540,15 @@ message InstantOutQuoteRequest { uint64 amt = 1; /* + Deprecated: use 'reservation_ids' instead. The amount of reservations to use for the swap. */ - int32 num_reservations = 2; + int32 num_reservations = 2 [deprecated = true]; + + /* + The reservations to use for the swap. + */ + repeated bytes reservation_ids = 3; } message InstantOutQuoteResponse { @@ -1592,6 +1682,15 @@ message WithdrawDepositsRequest { The fee rate in sat/vbyte to use for the withdrawal transaction. */ int64 sat_per_vbyte = 4; + + /* + The amount in satoshis that should be withdrawn from the selected deposits. + If there is change, it will be sent back to the static address. The fees for + the transaction are taken from the change output. If the change is below + the dust limit, there won't be a change output and the dust goes towards + fees. + */ + int64 amount = 5; } message WithdrawDepositsResponse { @@ -1601,9 +1700,9 @@ message WithdrawDepositsResponse { string withdrawal_tx_hash = 1; /* - The pkscript of the withdrawal transaction. + The destination address of the withdrawal transaction. */ - string pk_script = 2; + string address = 2; } message OutPoint { @@ -1642,6 +1741,16 @@ message ListStaticAddressDepositsResponse { repeated Deposit filtered_deposits = 1; } +message ListStaticAddressWithdrawalRequest { +} + +message ListStaticAddressWithdrawalResponse { + /* + A list of all static address withdrawals. + */ + repeated StaticAddressWithdrawal withdrawals = 1; +} + message ListStaticAddressSwapsRequest { } @@ -1803,6 +1912,40 @@ message Deposit { int64 blocks_until_expiry = 6; } +message StaticAddressWithdrawal { + /* + The transaction id of the withdrawal transaction. + */ + string tx_id = 1; + + /* + The selected deposits that is withdrawn from. + */ + repeated Deposit deposits = 2; + + /* + The sum of the deposit values that was selected for withdrawal. + */ + int64 total_deposit_amount_satoshis = 3; + + /* + The actual amount that was withdrawn from the selected deposits. This value + represents the sum of selected deposit values minus tx fees minus optional + change output. + */ + int64 withdrawn_amount_satoshis = 4; + + /* + An optional change. + */ + int64 change_amount_satoshis = 5; + + /* + The confirmation block height of the withdrawal transaction. + */ + uint32 confirmation_height = 6; +} + message StaticAddressLoopInSwap { /* The swap hash of the swap. It represents the unique identifier of the swap. @@ -2000,3 +2143,117 @@ message StaticAddressLoopInResponse { */ uint32 payment_timeout_seconds = 11; } + +message AssetLoopOutRequest { + /* + The asset id to use to pay for the swap invoice. If set an + asset client is needed to set to be able to pay the invoice. + */ + bytes asset_id = 1; + + /* + The node identity public key of the peer to ask for a quote for sending out + the assets and converting them to satoshis. This must be specified if + an asset id is set. + */ + bytes asset_edge_node = 2; + + /* + An optional maximum multiplier for the rfq rate. If not set, the default + will be 1.1. This means if we request a loop out quote for 1 BTC, the off + chain cost will be at most 1.1 BTC. + */ + double max_limit_multiplier = 3; + + /* + An optional expiry unix timestamp for when the rfq quote should expire. + */ + int64 expiry = 4; +} + +message AssetRfqInfo { + /* + The Prepay RFQ ID to use to pay for the prepay invoice. + */ + bytes prepay_rfq_id = 1; + + /* + The maximum asset amt we'll pay for the prepay payment. This includes the + max limit multiplier that was set in the request. + */ + uint64 max_prepay_asset_amt = 2; + + /* + The asset to BTC conversion rate for the prepay invoice. + */ + FixedPoint prepay_asset_rate = 6; + + /* + The Swap RFQ ID to use to pay for the swap invoice. + */ + bytes swap_rfq_id = 3; + + /* + The maximum asset amt we'll pay for the swap payment. This includes the + max limit multiplier that was set in the request. + */ + uint64 max_swap_asset_amt = 4; + + /* + The asset to BTC conversion rate for the swap invoice. + */ + FixedPoint swap_asset_rate = 7; + + /* + The name of the asset to swap. + */ + string asset_name = 5; +} + +// FixedPoint is a scaled integer representation of a fractional number. +// +// This type consists of two integer fields: a coefficient and a scale. +// Using this format enables precise and consistent representation of fractional +// numbers while avoiding floating-point data types, which are prone to +// precision errors. +// +// The relationship between the fractional representation and its fixed-point +// representation is expressed as: +// ``` +// V = F_c / (10^F_s) +// ``` +// where: +// +// * `V` is the fractional value. +// +// * `F_c` is the coefficient component of the fixed-point representation. It is +// the scaled-up fractional value represented as an integer. +// +// * `F_s` is the scale component. It is an integer specifying how +// many decimal places `F_c` should be divided by to obtain the fractional +// representation. +message FixedPoint { + // The coefficient is the fractional value scaled-up as an integer. This + // integer is represented as a string as it may be too large to fit in a + // uint64. + string coefficient = 1; + + // The scale is the component that determines how many decimal places + // the coefficient should be divided by to obtain the fractional value. + uint32 scale = 2; +} + +message AssetLoopOutInfo { + /* + The asset id that was used to pay for the swap invoice. + */ + string asset_id = 1; + /* + The human readable name of the asset. + */ + string asset_name = 2; + /* + The total asset offchain cost of the swap. + */ + uint64 asset_cost_offchain = 3; +} diff --git a/protos/loop/v0.29.0-beta/debug.proto b/protos/loop/v0.31.2-beta/debug.proto similarity index 100% rename from protos/loop/v0.29.0-beta/debug.proto rename to protos/loop/v0.31.2-beta/debug.proto diff --git a/protos/loop/v0.29.0-beta/swapserverrpc/common.proto b/protos/loop/v0.31.2-beta/swapserverrpc/common.proto similarity index 100% rename from protos/loop/v0.29.0-beta/swapserverrpc/common.proto rename to protos/loop/v0.31.2-beta/swapserverrpc/common.proto diff --git a/protos/loop/v0.29.0-beta/swapserverrpc/server.proto b/protos/loop/v0.31.2-beta/swapserverrpc/server.proto similarity index 100% rename from protos/loop/v0.29.0-beta/swapserverrpc/server.proto rename to protos/loop/v0.31.2-beta/swapserverrpc/server.proto