From df161a5aab08905ee42eb777b799200639fcefcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Mon, 7 Jul 2025 10:52:35 +0200 Subject: [PATCH 1/2] lnc-core: update protos to match lnc v0.3.4-alpha --- lib/types/proto/lit/firewall.ts | 5 + lib/types/proto/lit/lit-sessions.ts | 1 + 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 +++++++++++++- .../proto/tapd/assetwalletrpc/assetwallet.ts | 29 ++ lib/types/proto/tapd/lightning.ts | 145 ++++++++-- lib/types/proto/tapd/mintrpc/mint.ts | 59 +++- lib/types/proto/tapd/routerrpc/router.ts | 13 +- .../proto/tapd/tapchannelrpc/tapchannel.ts | 69 ++++- lib/types/proto/tapd/tapdevrpc/tapdev.ts | 6 +- lib/types/proto/tapd/taprootassets.ts | 237 +++++++++++++++- lib/types/proto/tapd/universerpc/universe.ts | 29 +- package.json | 12 +- .../faraday.proto | 0 .../firewall.proto | 6 + .../lit-autopilot.proto | 0 .../lit-sessions.proto | 1 + .../lit-status.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 .../auctioneerrpc/auctioneer.proto | 0 .../auctioneerrpc/hashmail.proto | 0 .../{v0.6.5-beta => v0.6.6-beta}/trader.proto | 0 .../assetwalletrpc/assetwallet.proto | 36 ++- .../{v0.5.0 => v0.6.0}/mintrpc/mint.proto | 56 +++- .../priceoraclerpc/price_oracle.proto | 0 .../tapd/{v0.5.0 => v0.6.0}/rfqrpc/rfq.proto | 0 .../tapchannelrpc/tapchannel.proto | 65 +++-- .../{v0.5.0 => v0.6.0}/tapdevrpc/tapdev.proto | 8 +- .../{v0.5.0 => v0.6.0}/taprootassets.proto | 250 ++++++++++++++++- .../universerpc/universe.proto | 19 ++ 45 files changed, 1879 insertions(+), 146 deletions(-) rename protos/faraday/{v0.2.13-alpha => v0.2.16-alpha}/faraday.proto (100%) rename protos/lit/{v0.14.0-alpha => v0.15.0-alpha}/firewall.proto (96%) rename protos/lit/{v0.14.0-alpha => v0.15.0-alpha}/lit-autopilot.proto (100%) rename protos/lit/{v0.14.0-alpha => v0.15.0-alpha}/lit-sessions.proto (99%) rename protos/lit/{v0.14.0-alpha => v0.15.0-alpha}/lit-status.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%) rename protos/pool/{v0.6.5-beta => v0.6.6-beta}/auctioneerrpc/auctioneer.proto (100%) rename protos/pool/{v0.6.5-beta => v0.6.6-beta}/auctioneerrpc/hashmail.proto (100%) rename protos/pool/{v0.6.5-beta => v0.6.6-beta}/trader.proto (100%) rename protos/tapd/{v0.5.0 => v0.6.0}/assetwalletrpc/assetwallet.proto (93%) rename protos/tapd/{v0.5.0 => v0.6.0}/mintrpc/mint.proto (84%) rename protos/tapd/{v0.5.0 => v0.6.0}/priceoraclerpc/price_oracle.proto (100%) rename protos/tapd/{v0.5.0 => v0.6.0}/rfqrpc/rfq.proto (100%) rename protos/tapd/{v0.5.0 => v0.6.0}/tapchannelrpc/tapchannel.proto (76%) rename protos/tapd/{v0.5.0 => v0.6.0}/tapdevrpc/tapdev.proto (93%) rename protos/tapd/{v0.5.0 => v0.6.0}/taprootassets.proto (82%) rename protos/tapd/{v0.5.0 => v0.6.0}/universerpc/universe.proto (96%) diff --git a/lib/types/proto/lit/firewall.ts b/lib/types/proto/lit/firewall.ts index 6c0a99c..d64c5c3 100644 --- a/lib/types/proto/lit/firewall.ts +++ b/lib/types/proto/lit/firewall.ts @@ -144,6 +144,11 @@ export interface Action { errorReason: string; /** The ID of the session under which the action was performed. */ sessionId: Uint8Array | string; + /** + * The 4 byte identifier of the macaroon that was used to perform the action. + * This is derived from the last 4 bytes of the macaroon's root key ID. + */ + macaroonIdentifier: Uint8Array | string; } export interface Firewall { diff --git a/lib/types/proto/lit/lit-sessions.ts b/lib/types/proto/lit/lit-sessions.ts index 26d7522..3056343 100644 --- a/lib/types/proto/lit/lit-sessions.ts +++ b/lib/types/proto/lit/lit-sessions.ts @@ -14,6 +14,7 @@ export enum SessionState { STATE_IN_USE = 'STATE_IN_USE', STATE_REVOKED = 'STATE_REVOKED', STATE_EXPIRED = 'STATE_EXPIRED', + STATE_RESERVED = 'STATE_RESERVED', UNRECOGNIZED = 'UNRECOGNIZED' } 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/assetwalletrpc/assetwallet.ts b/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts index 57a9671..64860e1 100644 --- a/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts +++ b/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts @@ -161,6 +161,23 @@ export interface CommitVirtualPsbtsRequest { * BTC level anchor transaction. */ satPerVbyte: string | undefined; + /** + * The custom lock ID used to identify the lock lease for UTXOs that serve as + * inputs in the BTC-level anchor transaction. If left empty, LND's default + * lock ID will be used. + */ + customLockId: Uint8Array | string; + /** + * If set, the UTXOs used as inputs in the BTC-level anchor transaction will be + * locked for the specified number of seconds. If unset, LND's default lock + * expiration of 10 minutes will be applied. + */ + lockExpirationSeconds: string; + /** + * If set, the psbt funding step will be skipped. This is useful if the intent + * is to create a zero-fee transaction. + */ + skipFunding: boolean; } export interface CommitVirtualPsbtsResponse { @@ -223,6 +240,18 @@ export interface PublishAndLogRequest { * inputs that were already present in the PSBT are not locked. */ lndLockedUtxos: OutPoint[]; + /** + * If set, the anchor transaction will not be broadcast to the network. This + * is useful when an external system handles broadcasting, such as in custom + * transaction packaging workflows. + */ + skipAnchorTxBroadcast: boolean; + /** + * An optional short label for the transfer. This label can be used to track + * the progress of the transfer via the logs or an event subscription. + * Multiple transfers can share the same label. + */ + label: string; } export interface NextInternalKeyRequest { 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/mintrpc/mint.ts b/lib/types/proto/tapd/mintrpc/mint.ts index 2ba9762..3fc76e9 100644 --- a/lib/types/proto/tapd/mintrpc/mint.ts +++ b/lib/types/proto/tapd/mintrpc/mint.ts @@ -7,6 +7,7 @@ import type { ScriptKey, GroupKeyRequest, GroupVirtualTx, + ExternalKey, TapscriptFullTree, TapBranch, GroupWitness @@ -79,6 +80,8 @@ export interface UnsealedAsset { groupKeyRequest: GroupKeyRequest | undefined; /** The group virtual transaction for the asset. */ groupVirtualTx: GroupVirtualTx | undefined; + /** The byte serialized PSBT equivalent of the group virtual transaction. */ + groupVirtualPsbt: string; } export interface MintAsset { @@ -118,12 +121,21 @@ export interface MintAsset { /** * The optional key that will be used as the internal key for an asset group * created with this asset. + * + * If this field is set then external_group_key must be unset, and vice versa. */ groupInternalKey: KeyDescriptor | undefined; /** - * The optional root of a tapscript tree that will be used when constructing a - * new asset group key. This enables future issuance authorized with a script - * witness. + * An optional root of a Tapscript tree used when constructing a new asset + * group key. This allows for future asset issuance authorized using a + * script witness. + * + * If an external group key is provided, the V1 scheme for group key script + * construction will be used, which supports PSBT signing. In this scheme, + * the user-supplied Tapscript root is extended by two levels of Tapscript + * siblings that commit to the group anchor's asset ID. As a result, the + * provided Tapscript root becomes a branch within a larger Tapscript tree, + * and the final Tapscript root will differ from the one specified here. */ groupTapscriptRoot: Uint8Array | string; /** @@ -144,6 +156,29 @@ export interface MintAsset { * compatible with assets that have a JSON MetaData field. */ decimalDisplay: number; + /** + * The external group key is an optional field that allows specifying an + * external signing key for the group virtual transaction during minting. + * This key enables signing operations to be performed externally, outside + * the daemon. + * + * If this field is set then group_internal_key must be unset, and vice versa. + */ + externalGroupKey: ExternalKey | undefined; + /** + * Enabling this flag allows the creation of universe commitments for a new + * asset group. + * + * Universe commitments are minter-controlled, on-chain attestations that + * anchor and verify the state of an asset group. + * + * This flag imposes restrictions on the minting process by limiting the batch + * to assets within the same universe, meaning they share the same group key. + * This option is applicable only for the creation of a new asset group + * (i.e., the first minting tranche of an asset group) and ensures that the + * batch is limited to a single asset group. + */ + universeCommitments: boolean; } export interface MintAssetRequest { @@ -216,7 +251,7 @@ export interface FundBatchRequest { export interface FundBatchResponse { /** The funded batch. */ - batch: MintingBatch | undefined; + batch: VerboseBatch | undefined; } export interface SealBatchRequest { @@ -226,8 +261,18 @@ export interface SealBatchRequest { * possibly printed on the command line in the case of a very large batch. */ shortResponse: boolean; - /** The assetID, witness pairs that authorize asset membership in a group. */ + /** + * The assetID, witness pairs that authorize asset membership in a group. + * This field should not be used in conjunction with + * `signed_group_virtual_psbts`; use one or the other. + */ groupWitnesses: GroupWitness[]; + /** + * The base64 encoded signed group virtual PSBTs. + * This field should not be used in conjunction with `group_witnesses`; + * use one or the other. + */ + signedGroupVirtualPsbts: string[]; } export interface SealBatchResponse { @@ -277,8 +322,8 @@ export interface ListBatchRequest { */ batchKeyStr: string | undefined; /** - * If true, pending asset group information will be shown for the pending - * batch. + * If true, pending asset group details will be included for any funded, + * non-empty pending batch. Unfunded or empty batches will be excluded. */ verbose: boolean; } 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/lib/types/proto/tapd/tapchannelrpc/tapchannel.ts b/lib/types/proto/tapd/tapchannelrpc/tapchannel.ts index 17330d2..0c6a7af 100644 --- a/lib/types/proto/tapd/tapchannelrpc/tapchannel.ts +++ b/lib/types/proto/tapd/tapchannelrpc/tapchannel.ts @@ -35,6 +35,12 @@ export interface FundChannelRequest { * the funds in another way (outside the protocol). */ pushSat: string; + /** + * The group key to use for the channel. This can be used instead of the + * asset_id to allow assets from a fungible group to be used for the channel + * funding instead of just assets from a single minting tranche (asset_id). + */ + groupKey: Uint8Array | string; } export interface FundChannelResponse { @@ -82,7 +88,7 @@ export interface SendPaymentRequest { * The asset ID to use for the payment. This must be set for both invoice * and keysend payments, unless RFQ negotiation was already done beforehand * and payment_request.first_hop_custom_records already contains valid RFQ - * data. + * data. Mutually exclusive to group_key. */ assetId: Uint8Array | string; /** @@ -124,6 +130,11 @@ export interface SendPaymentRequest { * require to be paid. */ allowOverpay: boolean; + /** + * The group key which dictates which assets may be used for this payment. + * Mutually exclusive to asset_id. + */ + groupKey: Uint8Array | string; } export interface SendPaymentResponse { @@ -147,24 +158,30 @@ export interface HodlInvoice { } export interface AddInvoiceRequest { - /** The asset ID to use for the invoice. */ + /** The asset ID to use for the invoice. Mutually exclusive to group_key. */ assetId: Uint8Array | string; /** The asset amount to receive. */ assetAmount: string; /** * The node identity public key of the peer to ask for a quote for receiving - * assets and converting them from satoshis. This must be specified if - * there are multiple channels with the given asset ID. + * assets and converting them from satoshis. When specified only quotes with + * this peer will be negotiated. */ peerPubkey: Uint8Array | string; /** - * The full lnd invoice request to send. All fields (except for the value - * and the route hints) behave the same way as they do for lnd's - * lnrpc.AddInvoice RPC method (see the API docs at + * The full lnd invoice request to send. All fields behave the same way as + * they do for lnd's lnrpc.AddInvoice RPC method (see the API docs at * https://lightning.engineering/api-docs/api/lnd/lightning/add-invoice - * for more details). The value/value_msat fields will be overwritten by the - * satoshi (or milli-satoshi) equivalent of the asset amount, after - * negotiating a quote with a peer that supports the given asset ID. + * for more details). + * + * Only one of the asset_amount/value/value_msat may be set to dictate the + * value of the invoice. When using asset_amount, the value/value_msat + * fields will be overwritten by the satoshi (or milli-satoshi) equivalent + * of the asset amount, after negotiating a quote with a peer that supports + * the given asset ID. + * + * If the value/value_msat are used, we still receive assets, but they will + * exactly evaluate to the defined amount in sats/msats. */ invoiceRequest: Invoice | undefined; /** @@ -173,6 +190,12 @@ export interface AddInvoiceRequest { * invoicesrpc.SettleInvoice call to manually settle the invoice. */ hodlInvoice: HodlInvoice | undefined; + /** + * The group key which dictates which assets may be accepted for this + * invoice. If set, any asset that belongs to this group may be accepted to + * settle this invoice. Mutually exclusive to asset_id. + */ + groupKey: Uint8Array | string; } export interface AddInvoiceResponse { @@ -183,13 +206,21 @@ export interface AddInvoiceResponse { } export interface AssetPayReq { - /** The asset ID that will be used to resolve the invoice's satoshi amount. */ + /** + * The asset ID that will be used to resolve the invoice's satoshi amount. + * Mutually exclusive to group_key. + */ assetId: Uint8Array | string; /** * The normal LN invoice that whose amount will be mapped to units of the * asset ID. */ payReqString: string; + /** + * The group key that will be used to resolve the invoice's satoshi amount. + * Mutually exclusive to asset_id. + */ + groupKey: Uint8Array | string; } export interface AssetPayReqResponse { @@ -201,7 +232,9 @@ export interface AssetPayReqResponse { assetGroup: AssetGroup | undefined; /** * Genesis information for the asset ID which includes the meta hash, and - * asset ID. + * asset ID. This is only set if the payment request was decoded with an + * asset ID and not with a group key (since a group can contain assets from + * different minting events or genesis infos). */ genesisInfo: GenesisInfo | undefined; /** The normal decoded payment request. */ @@ -210,6 +243,7 @@ export interface AssetPayReqResponse { export interface TaprootAssetChannels { /** + * litcli: `ln fundchannel` * FundChannel initiates the channel funding negotiation with a peer for the * creation of a channel that contains a specified amount of a given asset. */ @@ -227,6 +261,7 @@ export interface TaprootAssetChannels { request?: DeepPartial ): Promise; /** + * litcli: `ln sendpayment` * SendPayment is a wrapper around lnd's routerrpc.SendPaymentV2 RPC method * with asset specific parameters. It allows RPC users to send asset keysend * payments (direct payments) or payments to an invoice with a specified asset @@ -238,17 +273,21 @@ export interface TaprootAssetChannels { onError?: (err: Error) => void ): void; /** + * litcli: `ln addinvoice` * AddInvoice is a wrapper around lnd's lnrpc.AddInvoice method with asset * specific parameters. It allows RPC users to create invoices that correspond - * to the specified asset amount. + * to the specified asset amount. If a peer pubkey is specified, then only that + * peer will be used for RFQ negotiations. If none is specified then RFQ quotes + * for all peers with suitable asset channels will be created. */ addInvoice( request?: DeepPartial ): Promise; /** + * litcli: `ln decodeassetinvoice` * DecodeAssetPayReq is similar to lnd's lnrpc.DecodePayReq, but it accepts an - * asset ID and returns the invoice amount expressed in asset units along side - * the normal information. + * asset ID or group key and returns the invoice amount expressed in asset + * units along side the normal information. */ decodeAssetPayReq( request?: DeepPartial diff --git a/lib/types/proto/tapd/tapdevrpc/tapdev.ts b/lib/types/proto/tapd/tapdevrpc/tapdev.ts index a37db99..a1e97a4 100644 --- a/lib/types/proto/tapd/tapdevrpc/tapdev.ts +++ b/lib/types/proto/tapd/tapdevrpc/tapdev.ts @@ -86,9 +86,13 @@ export interface ReceiveAssetEvent { export interface TapDev { /** * tapcli: `dev importproof` - * ImportProof attempts to import a proof file into the daemon. If successful, + * Deprecated, use the new taprpc.RegisterTransfer RPC instead! ImportProof + * attempts to import a proof file into the daemon. If successful, * a new asset will be inserted on disk, spendable using the specified target * script key, and internal key. + * NOTE: This RPC will be removed with the next major release. + * + * @deprecated */ importProof( request?: DeepPartial diff --git a/lib/types/proto/tapd/taprootassets.ts b/lib/types/proto/tapd/taprootassets.ts index 2f8a408..8b541f6 100644 --- a/lib/types/proto/tapd/taprootassets.ts +++ b/lib/types/proto/tapd/taprootassets.ts @@ -94,6 +94,49 @@ export enum AddrVersion { UNRECOGNIZED = 'UNRECOGNIZED' } +export enum ScriptKeyType { + /** + * SCRIPT_KEY_UNKNOWN - The type of script key is not known. This should only be stored for assets + * where we don't know the internal key of the script key (e.g. for + * imported proofs). + */ + SCRIPT_KEY_UNKNOWN = 'SCRIPT_KEY_UNKNOWN', + /** + * SCRIPT_KEY_BIP86 - The script key is a normal BIP-86 key. This means that the internal key is + * turned into a Taproot output key by applying a BIP-86 tweak to it. + */ + SCRIPT_KEY_BIP86 = 'SCRIPT_KEY_BIP86', + /** + * SCRIPT_KEY_SCRIPT_PATH_EXTERNAL - The script key is a key that contains a script path that is defined by the + * user and is therefore external to the tapd wallet. Spending this key + * requires providing a specific witness and must be signed through the vPSBT + * signing flow. + */ + SCRIPT_KEY_SCRIPT_PATH_EXTERNAL = 'SCRIPT_KEY_SCRIPT_PATH_EXTERNAL', + /** + * SCRIPT_KEY_BURN - The script key is a specific un-spendable key that indicates a burnt asset. + * Assets with this key type can never be spent again, as a burn key is a + * tweaked NUMS key that nobody knows the private key for. + */ + SCRIPT_KEY_BURN = 'SCRIPT_KEY_BURN', + /** + * SCRIPT_KEY_TOMBSTONE - The script key is a specific un-spendable key that indicates a tombstone + * output. This is only the case for zero-value assets that result from a + * non-interactive (TAP address) send where no change was left over. + */ + SCRIPT_KEY_TOMBSTONE = 'SCRIPT_KEY_TOMBSTONE', + /** + * SCRIPT_KEY_CHANNEL - The script key is used for an asset that resides within a Taproot Asset + * Channel. That means the script key is either a funding key (OP_TRUE), a + * commitment output key (to_local, to_remote, htlc), or a HTLC second-level + * transaction output key. Keys related to channels are not shown in asset + * balances (unless specifically requested) and are never used for coin + * selection. + */ + SCRIPT_KEY_CHANNEL = 'SCRIPT_KEY_CHANNEL', + UNRECOGNIZED = 'UNRECOGNIZED' +} + export enum AddrEventStatus { ADDR_EVENT_STATUS_UNKNOWN = 'ADDR_EVENT_STATUS_UNKNOWN', ADDR_EVENT_STATUS_TRANSACTION_DETECTED = 'ADDR_EVENT_STATUS_TRANSACTION_DETECTED', @@ -197,6 +240,25 @@ export interface ListAssetRequest { * inbound assets). */ includeUnconfirmedMints: boolean; + /** Only return assets with amount greater or equal to this value. */ + minAmount: string; + /** Only return assets with amount less or equal to this value. */ + maxAmount: string; + /** Only return assets that belong to the group with this key. */ + groupKey: Uint8Array | string; + /** Return all assets that use this script key. */ + scriptKey: ScriptKey | undefined; + /** Return all assets that are currently anchored on this outpoint. */ + anchorOutpoint: OutPoint | undefined; + /** + * The script key type to filter the assets by. If not set, only assets with + * a BIP-0086 script key will be returned (which is the equivalent of + * setting script_key_type.explicit_type = SCRIPT_KEY_BIP86). If the type + * is set to SCRIPT_KEY_BURN or SCRIPT_KEY_TOMBSTONE the include_spent flag + * will automatically be set to true, because assets of that type are always + * marked as spent. + */ + scriptKeyType: ScriptKeyTypeQuery | undefined; } export interface AnchorInfo { @@ -225,6 +287,8 @@ export interface AnchorInfo { tapscriptSibling: Uint8Array | string; /** The height of the block which contains the anchor transaction. */ blockHeight: number; + /** The UTC Unix timestamp of the block containing the anchor transaction. */ + blockTimestamp: string; } export interface GenesisInfo { @@ -245,8 +309,38 @@ export interface GenesisInfo { outputIndex: number; } +/** + * This message represents an external key used for deriving and managing + * hierarchical deterministic (HD) wallet addresses according to BIP-86. + */ +export interface ExternalKey { + /** + * This field specifies the extended public key derived at depth 3 of the + * BIP-86 hierarchy (e.g., m/86'/0'/0'). This key serves as the parent key for + * deriving child public keys and addresses. + */ + xpub: string; + /** + * This field specifies the fingerprint of the master key, derived from the + * first 4 bytes of the hash160 of the master public key. It is used to + * identify the master key in BIP-86 derivation schemes. + */ + masterFingerprint: Uint8Array | string; + /** + * This field specifies the extended BIP-86 derivation path used to derive a + * child key from the XPub. Starting from the base path of the XPub + * (e.g., m/86'/0'/0'), this path must contain exactly 5 components in total + * (e.g., m/86'/0'/0'/0/0), with the additional components defining specific + * child keys, such as individual addresses. + */ + derivationPath: string; +} + export interface GroupKeyRequest { - /** The internal key for the asset group before any tweaks have been applied. */ + /** + * The internal key for the asset group before any tweaks have been applied. + * If this field is set then external_key must be empty, and vice versa. + */ rawKey: KeyDescriptor | undefined; /** * The genesis of the group anchor asset, which is used to derive the single @@ -266,6 +360,15 @@ export interface GroupKeyRequest { * member of this asset group. */ newAsset: Uint8Array | string; + /** + * The external key is an optional field that allows specifying an + * external signing key for the group virtual transaction during minting. + * This key enables signing operations to be performed externally, outside + * the daemon. + * + * If this field is set then raw_key must be empty, and vice versa. + */ + externalKey: ExternalKey | undefined; } export interface TxOut { @@ -401,6 +504,7 @@ export interface Asset { */ isBurn: boolean; /** + * Deprecated, use script_key_type instead! * Indicates whether this script key has either been derived by the local * wallet or was explicitly declared to be known by using the * DeclareScriptKey RPC. Knowing the key conceptually means the key belongs @@ -412,6 +516,7 @@ export interface Asset { */ scriptKeyDeclaredKnown: boolean; /** + * Deprecated, use script_key_type instead! * Indicates whether the script key is known to have a Tapscript spend path, * meaning that the Taproot merkle root tweak is not empty. This will only * ever be true if either script_key_is_local or script_key_internals_known @@ -426,6 +531,13 @@ export interface Asset { * unknown in the current context. */ decimalDisplay: DecimalDisplay | undefined; + /** + * The type of the script key. This type is either user-declared when custom + * script keys are added, or automatically determined by the daemon for + * standard operations (e.g. BIP-86 keys, burn keys, tombstone keys, channel + * related keys). + */ + scriptKeyType: ScriptKeyType; } export interface PrevWitness { @@ -455,6 +567,12 @@ export interface ListAssetResponse { export interface ListUtxosRequest { includeLeased: boolean; + /** + * The script key type to filter the assets by. If not set, only assets with + * a BIP-0086 script key will be returned (which is the equivalent of + * setting script_key_type.explicit_type = SCRIPT_KEY_BIP86). + */ + scriptKeyType: ScriptKeyTypeQuery | undefined; } export interface ManagedUtxo { @@ -547,6 +665,15 @@ export interface ListBalancesRequest { groupKeyFilter: Uint8Array | string; /** An option to include previous leased assets in the balances. */ includeLeased: boolean; + /** + * The script key type to filter the assets by. If not set, only assets with + * a BIP-0086 script key will be returned (which is the equivalent of + * setting script_key_type.explicit_type = SCRIPT_KEY_BIP86). If the type + * is set to SCRIPT_KEY_BURN or SCRIPT_KEY_TOMBSTONE the include_spent flag + * will automatically be set to true, because assets of that type are always + * marked as spent. + */ + scriptKeyType: ScriptKeyTypeQuery | undefined; } export interface AssetBalance { @@ -638,6 +765,23 @@ export interface AssetTransfer { * unconfirmed. */ anchorTxBlockHash: ChainHash | undefined; + /** + * The block height of the blockchain block that contains the anchor + * transaction. If the anchor transaction is still unconfirmed, this value + * will be 0. + */ + anchorTxBlockHeight: number; + /** + * An optional short label for the transfer. This label can be used to track + * the progress of the transfer via the logs or an event subscription. + * Multiple transfers can share the same label. + */ + label: string; + /** + * The L1 transaction that anchors the Taproot Asset commitment where the + * asset resides. + */ + anchorTx: Uint8Array | string; } export interface TransferInput { @@ -666,6 +810,8 @@ export interface TransferOutputAnchor { merkleRoot: Uint8Array | string; tapscriptSibling: Uint8Array | string; numPassiveAssets: number; + /** pk_script is the pkscript of the anchor output. */ + pkScript: Uint8Array | string; } export interface TransferOutput { @@ -685,6 +831,7 @@ export interface TransferOutput { relativeLockTime: string; /** The delivery status of the proof associated with this output. */ proofDeliveryStatus: ProofDeliveryStatus; + assetId: Uint8Array | string; } export interface StopRequest {} @@ -800,6 +947,13 @@ export interface NewAddrRequest { addressVersion: AddrVersion; } +export interface ScriptKeyTypeQuery { + /** Query for assets of a specific script key type. */ + explicitType: ScriptKeyType | undefined; + /** Query for assets with all script key types. */ + allTypes: boolean | undefined; +} + export interface ScriptKey { /** * The full Taproot output key the asset is locked to. This is either a BIP-86 @@ -814,6 +968,13 @@ export interface ScriptKey { * empty then a BIP-86 style tweak is applied to the internal key. */ tapTweak: Uint8Array | string; + /** + * The type of the script key. This type is either user-declared when custom + * script keys are added, or automatically determined by the daemon for + * standard operations (e.g. BIP-86 keys, burn keys, tombstone keys, channel + * related keys). + */ + type: ScriptKeyType; } export interface KeyLocator { @@ -969,6 +1130,23 @@ export interface ExportProofRequest { outpoint: OutPoint | undefined; } +export interface UnpackProofFileRequest { + /** + * The raw proof file encoded as bytes. Must be a file and not just an + * individual mint/transfer proof. + */ + rawProofFile: Uint8Array | string; +} + +export interface UnpackProofFileResponse { + /** + * The individual proofs contained in the proof file, ordered by their + * appearance within the file (issuance proof first, last known transfer + * last). + */ + rawProofs: Uint8Array | string[]; +} + export interface AddrEvent { /** The time the event was created in unix timestamp seconds. */ creationTimeUnixSeconds: string; @@ -1014,6 +1192,18 @@ export interface SendAssetRequest { tapAddrs: string[]; /** The optional fee rate to use for the minting transaction, in sat/kw. */ feeRate: number; + /** + * An optional short label for the send transfer. This label can be used to + * track the progress of the transfer via the logs or an event subscription. + * Multiple transfers can share the same label. + */ + label: string; + /** + * A flag to skip the proof courier ping check. This is useful for + * testing purposes and for forced transfers when the proof courier + * is not immediately available. + */ + skipProofCourierPingCheck: boolean; } export interface PrevInputAsset { @@ -1148,6 +1338,11 @@ export interface SubscribeSendEventsRequest { * all receive events for all parcels. */ filterScriptKey: Uint8Array | string; + /** + * Filter send events by a specific label. Leave empty to not filter by + * transfer label. + */ + filterLabel: string; } export interface SendEvent { @@ -1187,6 +1382,10 @@ export interface SendEvent { transfer: AssetTransfer | undefined; /** An optional error, indicating that executing the send_state failed. */ error: string; + /** The label of the transfer. */ + transferLabel: string; + /** The next send state that will be executed. */ + nextSendState: string; } export interface AnchorTransaction { @@ -1210,6 +1409,21 @@ export interface AnchorTransaction { finalTx: Uint8Array | string; } +export interface RegisterTransferRequest { + /** The asset ID of the asset to register the transfer for. */ + assetId: Uint8Array | string; + /** The optional group key of the asset to register the transfer for. */ + groupKey: Uint8Array | string; + /** The script key of the asset to register the transfer for. */ + scriptKey: Uint8Array | string; + /** The outpoint of the transaction that was used to receive the asset. */ + outpoint: OutPoint | undefined; +} + +export interface RegisterTransferResponse { + registeredAsset: Asset | undefined; +} + export interface TaprootAssets { /** * tapcli: `assets list` @@ -1311,6 +1525,14 @@ export interface TaprootAssets { * script_key. */ exportProof(request?: DeepPartial): Promise; + /** + * tapcli: `proofs unpack` + * UnpackProofFile unpacks a proof file into a list of the individual raw + * proofs in the proof chain. + */ + unpackProofFile( + request?: DeepPartial + ): Promise; /** * tapcli: `assets send` * SendAsset uses one or multiple passed Taproot Asset address(es) to attempt @@ -1374,6 +1596,19 @@ export interface TaprootAssets { onMessage?: (msg: SendEvent) => void, onError?: (err: Error) => void ): void; + /** + * RegisterTransfer informs the daemon about a new inbound transfer that has + * happened. This is used for interactive transfers where no TAP address is + * involved and the recipient is aware of the transfer through an out-of-band + * protocol but the daemon hasn't been informed about the completion of the + * transfer. For this to work, the proof must already be in the recipient's + * local universe (e.g. through the use of the universerpc.InsertProof RPC or + * the universe proof courier and universe sync mechanisms) and this call + * simply instructs the daemon to detect the transfer as an asset it owns. + */ + registerTransfer( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/lib/types/proto/tapd/universerpc/universe.ts b/lib/types/proto/tapd/universerpc/universe.ts index c6f7d36..e0a9a59 100644 --- a/lib/types/proto/tapd/universerpc/universe.ts +++ b/lib/types/proto/tapd/universerpc/universe.ts @@ -1,5 +1,11 @@ /* eslint-disable */ -import type { AssetType, Asset } from '../taprootassets'; +import type { + AssetType, + Asset, + AssetMeta, + GenesisReveal, + GroupKeyReveal +} from '../taprootassets'; export enum ProofType { PROOF_TYPE_UNSPECIFIED = 'PROOF_TYPE_UNSPECIFIED', @@ -237,6 +243,26 @@ export interface AssetProofResponse { * multiverse. */ multiverseInclusionProof: Uint8Array | string; + /** + * The issuance related data for an issuance asset leaf. This is empty for + * any other type of asset leaf. + */ + issuanceData: IssuanceData | undefined; +} + +export interface IssuanceData { + /** The reveal meta data associated with the proof, if available. */ + metaReveal: AssetMeta | undefined; + /** + * GenesisReveal is an optional field that is the Genesis information for + * the asset. This is required for minting proofs. + */ + genesisReveal: GenesisReveal | undefined; + /** + * GroupKeyReveal is an optional field that includes the information needed + * to derive the tweaked group key. + */ + groupKeyReveal: GroupKeyReveal | undefined; } export interface AssetProof { @@ -386,6 +412,7 @@ export interface AssetStatsAsset { genesisHeight: number; genesisTimestamp: string; anchorPoint: string; + decimalDisplay: number; } export interface UniverseAssetStats { diff --git a/package.json b/package.json index cc0b91d..2683bac 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,12 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "config": { - "lnd_release_tag": "v0.18.4-beta", - "loop_release_tag": "v0.29.0-beta", - "pool_release_tag": "v0.6.5-beta", - "faraday_release_tag": "v0.2.13-alpha", - "tapd_release_tag": "v0.5.0", - "lit_release_tag": "v0.14.0-alpha", + "lnd_release_tag": "v0.19.1-beta", + "loop_release_tag": "v0.31.2-beta", + "pool_release_tag": "v0.6.6-beta", + "faraday_release_tag": "v0.2.16-alpha", + "tapd_release_tag": "v0.6.0", + "lit_release_tag": "v0.15.0-alpha", "protoc_version": "21.9" }, "scripts": { diff --git a/protos/faraday/v0.2.13-alpha/faraday.proto b/protos/faraday/v0.2.16-alpha/faraday.proto similarity index 100% rename from protos/faraday/v0.2.13-alpha/faraday.proto rename to protos/faraday/v0.2.16-alpha/faraday.proto diff --git a/protos/lit/v0.14.0-alpha/firewall.proto b/protos/lit/v0.15.0-alpha/firewall.proto similarity index 96% rename from protos/lit/v0.14.0-alpha/firewall.proto rename to protos/lit/v0.15.0-alpha/firewall.proto index 1a4dff4..c6ff006 100644 --- a/protos/lit/v0.14.0-alpha/firewall.proto +++ b/protos/lit/v0.15.0-alpha/firewall.proto @@ -209,6 +209,12 @@ message Action { The ID of the session under which the action was performed. */ bytes session_id = 11; + + /* + The 4 byte identifier of the macaroon that was used to perform the action. + This is derived from the last 4 bytes of the macaroon's root key ID. + */ + bytes macaroon_identifier = 12; } enum ActionState { diff --git a/protos/lit/v0.14.0-alpha/lit-autopilot.proto b/protos/lit/v0.15.0-alpha/lit-autopilot.proto similarity index 100% rename from protos/lit/v0.14.0-alpha/lit-autopilot.proto rename to protos/lit/v0.15.0-alpha/lit-autopilot.proto diff --git a/protos/lit/v0.14.0-alpha/lit-sessions.proto b/protos/lit/v0.15.0-alpha/lit-sessions.proto similarity index 99% rename from protos/lit/v0.14.0-alpha/lit-sessions.proto rename to protos/lit/v0.15.0-alpha/lit-sessions.proto index a32499f..1c38808 100644 --- a/protos/lit/v0.14.0-alpha/lit-sessions.proto +++ b/protos/lit/v0.15.0-alpha/lit-sessions.proto @@ -97,6 +97,7 @@ enum SessionState { STATE_IN_USE = 1; STATE_REVOKED = 2; STATE_EXPIRED = 3; + STATE_RESERVED = 4; } message AddSessionResponse { diff --git a/protos/lit/v0.14.0-alpha/lit-status.proto b/protos/lit/v0.15.0-alpha/lit-status.proto similarity index 100% rename from protos/lit/v0.14.0-alpha/lit-status.proto rename to protos/lit/v0.15.0-alpha/lit-status.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 diff --git a/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto b/protos/pool/v0.6.6-beta/auctioneerrpc/auctioneer.proto similarity index 100% rename from protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto rename to protos/pool/v0.6.6-beta/auctioneerrpc/auctioneer.proto diff --git a/protos/pool/v0.6.5-beta/auctioneerrpc/hashmail.proto b/protos/pool/v0.6.6-beta/auctioneerrpc/hashmail.proto similarity index 100% rename from protos/pool/v0.6.5-beta/auctioneerrpc/hashmail.proto rename to protos/pool/v0.6.6-beta/auctioneerrpc/hashmail.proto diff --git a/protos/pool/v0.6.5-beta/trader.proto b/protos/pool/v0.6.6-beta/trader.proto similarity index 100% rename from protos/pool/v0.6.5-beta/trader.proto rename to protos/pool/v0.6.6-beta/trader.proto diff --git a/protos/tapd/v0.5.0/assetwalletrpc/assetwallet.proto b/protos/tapd/v0.6.0/assetwalletrpc/assetwallet.proto similarity index 93% rename from protos/tapd/v0.5.0/assetwalletrpc/assetwallet.proto rename to protos/tapd/v0.6.0/assetwalletrpc/assetwallet.proto index 1fac8a5..0f521e3 100644 --- a/protos/tapd/v0.5.0/assetwalletrpc/assetwallet.proto +++ b/protos/tapd/v0.6.0/assetwalletrpc/assetwallet.proto @@ -305,6 +305,26 @@ message CommitVirtualPsbtsRequest { */ uint64 sat_per_vbyte = 7; } + + /* + The custom lock ID used to identify the lock lease for UTXOs that serve as + inputs in the BTC-level anchor transaction. If left empty, LND's default + lock ID will be used. + */ + bytes custom_lock_id = 8; + + /* + If set, the UTXOs used as inputs in the BTC-level anchor transaction will be + locked for the specified number of seconds. If unset, LND's default lock + expiration of 10 minutes will be applied. + */ + uint64 lock_expiration_seconds = 9; + + /* + If set, the psbt funding step will be skipped. This is useful if the intent + is to create a zero-fee transaction. + */ + bool skip_funding = 10; } message CommitVirtualPsbtsResponse { @@ -379,6 +399,20 @@ message PublishAndLogRequest { inputs that were already present in the PSBT are not locked. */ repeated taprpc.OutPoint lnd_locked_utxos = 5; + + /* + If set, the anchor transaction will not be broadcast to the network. This + is useful when an external system handles broadcasting, such as in custom + transaction packaging workflows. + */ + bool skip_anchor_tx_broadcast = 6; + + /* + An optional short label for the transfer. This label can be used to track + the progress of the transfer via the logs or an event subscription. + Multiple transfers can share the same label. + */ + string label = 7; } message NextInternalKeyRequest { @@ -477,4 +511,4 @@ message DeclareScriptKeyRequest { message DeclareScriptKeyResponse { taprpc.ScriptKey script_key = 1; -} \ No newline at end of file +} diff --git a/protos/tapd/v0.5.0/mintrpc/mint.proto b/protos/tapd/v0.6.0/mintrpc/mint.proto similarity index 84% rename from protos/tapd/v0.5.0/mintrpc/mint.proto rename to protos/tapd/v0.6.0/mintrpc/mint.proto index abc446b..6f998eb 100644 --- a/protos/tapd/v0.5.0/mintrpc/mint.proto +++ b/protos/tapd/v0.6.0/mintrpc/mint.proto @@ -124,6 +124,9 @@ message UnsealedAsset { // The group virtual transaction for the asset. taprpc.GroupVirtualTx group_virtual_tx = 3; + + // The byte serialized PSBT equivalent of the group virtual transaction. + string group_virtual_psbt = 4; } message MintAsset { @@ -172,13 +175,22 @@ message MintAsset { /* The optional key that will be used as the internal key for an asset group created with this asset. + + If this field is set then external_group_key must be unset, and vice versa. */ taprpc.KeyDescriptor group_internal_key = 10; /* - The optional root of a tapscript tree that will be used when constructing a - new asset group key. This enables future issuance authorized with a script - witness. + An optional root of a Tapscript tree used when constructing a new asset + group key. This allows for future asset issuance authorized using a + script witness. + + If an external group key is provided, the V1 scheme for group key script + construction will be used, which supports PSBT signing. In this scheme, + the user-supplied Tapscript root is extended by two levels of Tapscript + siblings that commit to the group anchor's asset ID. As a result, the + provided Tapscript root becomes a branch within a larger Tapscript tree, + and the final Tapscript root will differ from the one specified here. */ bytes group_tapscript_root = 11; @@ -201,6 +213,31 @@ message MintAsset { compatible with assets that have a JSON MetaData field. */ uint32 decimal_display = 13; + + /* + The external group key is an optional field that allows specifying an + external signing key for the group virtual transaction during minting. + This key enables signing operations to be performed externally, outside + the daemon. + + If this field is set then group_internal_key must be unset, and vice versa. + */ + taprpc.ExternalKey external_group_key = 14; + + /* + Enabling this flag allows the creation of universe commitments for a new + asset group. + + Universe commitments are minter-controlled, on-chain attestations that + anchor and verify the state of an asset group. + + This flag imposes restrictions on the minting process by limiting the batch + to assets within the same universe, meaning they share the same group key. + This option is applicable only for the creation of a new asset group + (i.e., the first minting tranche of an asset group) and ensures that the + batch is limited to a single asset group. + */ + bool universe_commitments = 15; } message MintAssetRequest { @@ -303,7 +340,7 @@ message FundBatchRequest { message FundBatchResponse { // The funded batch. - MintingBatch batch = 1; + VerboseBatch batch = 1; } message SealBatchRequest { @@ -315,7 +352,14 @@ message SealBatchRequest { bool short_response = 1; // The assetID, witness pairs that authorize asset membership in a group. + // This field should not be used in conjunction with + // `signed_group_virtual_psbts`; use one or the other. repeated taprpc.GroupWitness group_witnesses = 2; + + // The base64 encoded signed group virtual PSBTs. + // This field should not be used in conjunction with `group_witnesses`; + // use one or the other. + repeated string signed_group_virtual_psbts = 3; } message SealBatchResponse { @@ -376,8 +420,8 @@ message ListBatchRequest { string batch_key_str = 2; } - // If true, pending asset group information will be shown for the pending - // batch. + // If true, pending asset group details will be included for any funded, + // non-empty pending batch. Unfunded or empty batches will be excluded. bool verbose = 3; } diff --git a/protos/tapd/v0.5.0/priceoraclerpc/price_oracle.proto b/protos/tapd/v0.6.0/priceoraclerpc/price_oracle.proto similarity index 100% rename from protos/tapd/v0.5.0/priceoraclerpc/price_oracle.proto rename to protos/tapd/v0.6.0/priceoraclerpc/price_oracle.proto diff --git a/protos/tapd/v0.5.0/rfqrpc/rfq.proto b/protos/tapd/v0.6.0/rfqrpc/rfq.proto similarity index 100% rename from protos/tapd/v0.5.0/rfqrpc/rfq.proto rename to protos/tapd/v0.6.0/rfqrpc/rfq.proto diff --git a/protos/tapd/v0.5.0/tapchannelrpc/tapchannel.proto b/protos/tapd/v0.6.0/tapchannelrpc/tapchannel.proto similarity index 76% rename from protos/tapd/v0.5.0/tapchannelrpc/tapchannel.proto rename to protos/tapd/v0.6.0/tapchannelrpc/tapchannel.proto index 546d12d..cbb3ef8 100644 --- a/protos/tapd/v0.5.0/tapchannelrpc/tapchannel.proto +++ b/protos/tapd/v0.6.0/tapchannelrpc/tapchannel.proto @@ -10,7 +10,7 @@ import "routerrpc/router.proto"; import "taprootassets.proto"; service TaprootAssetChannels { - /* + /* litcli: `ln fundchannel` FundChannel initiates the channel funding negotiation with a peer for the creation of a channel that contains a specified amount of a given asset. */ @@ -26,7 +26,7 @@ service TaprootAssetChannels { rpc EncodeCustomRecords (EncodeCustomRecordsRequest) returns (EncodeCustomRecordsResponse); - /* + /* litcli: `ln sendpayment` SendPayment is a wrapper around lnd's routerrpc.SendPaymentV2 RPC method with asset specific parameters. It allows RPC users to send asset keysend payments (direct payments) or payments to an invoice with a specified asset @@ -34,17 +34,19 @@ service TaprootAssetChannels { */ rpc SendPayment (SendPaymentRequest) returns (stream SendPaymentResponse); - /* + /* litcli: `ln addinvoice` AddInvoice is a wrapper around lnd's lnrpc.AddInvoice method with asset specific parameters. It allows RPC users to create invoices that correspond - to the specified asset amount. + to the specified asset amount. If a peer pubkey is specified, then only that + peer will be used for RFQ negotiations. If none is specified then RFQ quotes + for all peers with suitable asset channels will be created. */ rpc AddInvoice (AddInvoiceRequest) returns (AddInvoiceResponse); - /* + /* litcli: `ln decodeassetinvoice` DecodeAssetPayReq is similar to lnd's lnrpc.DecodePayReq, but it accepts an - asset ID and returns the invoice amount expressed in asset units along side - the normal information. + asset ID or group key and returns the invoice amount expressed in asset + units along side the normal information. */ rpc DecodeAssetPayReq (AssetPayReq) returns (AssetPayReqResponse); } @@ -70,6 +72,11 @@ message FundChannelRequest { // is equivalent to a donation to the remote party, unless they reimburse // the funds in another way (outside the protocol). int64 push_sat = 5; + + // The group key to use for the channel. This can be used instead of the + // asset_id to allow assets from a fungible group to be used for the channel + // funding instead of just assets from a single minting tranche (asset_id). + bytes group_key = 6; } message FundChannelResponse { @@ -106,7 +113,7 @@ message SendPaymentRequest { // The asset ID to use for the payment. This must be set for both invoice // and keysend payments, unless RFQ negotiation was already done beforehand // and payment_request.first_hop_custom_records already contains valid RFQ - // data. + // data. Mutually exclusive to group_key. bytes asset_id = 1; // The asset amount to send in a keysend payment. This amount is ignored for @@ -142,6 +149,10 @@ message SendPaymentRequest { // are sent out to the network than the invoice amount plus routing fees // require to be paid. bool allow_overpay = 6; + + // The group key which dictates which assets may be used for this payment. + // Mutually exclusive to asset_id. + bytes group_key = 7; } message SendPaymentResponse { @@ -164,30 +175,41 @@ message HodlInvoice { } message AddInvoiceRequest { - // The asset ID to use for the invoice. + // The asset ID to use for the invoice. Mutually exclusive to group_key. bytes asset_id = 1; // The asset amount to receive. uint64 asset_amount = 2; // The node identity public key of the peer to ask for a quote for receiving - // assets and converting them from satoshis. This must be specified if - // there are multiple channels with the given asset ID. + // assets and converting them from satoshis. When specified only quotes with + // this peer will be negotiated. bytes peer_pubkey = 3; - // The full lnd invoice request to send. All fields (except for the value - // and the route hints) behave the same way as they do for lnd's - // lnrpc.AddInvoice RPC method (see the API docs at + // The full lnd invoice request to send. All fields behave the same way as + // they do for lnd's lnrpc.AddInvoice RPC method (see the API docs at // https://lightning.engineering/api-docs/api/lnd/lightning/add-invoice - // for more details). The value/value_msat fields will be overwritten by the - // satoshi (or milli-satoshi) equivalent of the asset amount, after - // negotiating a quote with a peer that supports the given asset ID. + // for more details). + // + // Only one of the asset_amount/value/value_msat may be set to dictate the + // value of the invoice. When using asset_amount, the value/value_msat + // fields will be overwritten by the satoshi (or milli-satoshi) equivalent + // of the asset amount, after negotiating a quote with a peer that supports + // the given asset ID. + // + // If the value/value_msat are used, we still receive assets, but they will + // exactly evaluate to the defined amount in sats/msats. lnrpc.Invoice invoice_request = 4; // If set, then this will make the invoice created a hodl invoice, which // won't be settled automatically. Instead, users will need to use the // invoicesrpc.SettleInvoice call to manually settle the invoice. HodlInvoice hodl_invoice = 5; + + // The group key which dictates which assets may be accepted for this + // invoice. If set, any asset that belongs to this group may be accepted to + // settle this invoice. Mutually exclusive to asset_id. + bytes group_key = 6; } message AddInvoiceResponse { @@ -200,11 +222,16 @@ message AddInvoiceResponse { message AssetPayReq { // The asset ID that will be used to resolve the invoice's satoshi amount. + // Mutually exclusive to group_key. bytes asset_id = 1; // The normal LN invoice that whose amount will be mapped to units of the // asset ID. string pay_req_string = 2; + + // The group key that will be used to resolve the invoice's satoshi amount. + // Mutually exclusive to asset_id. + bytes group_key = 3; } message AssetPayReqResponse { @@ -218,7 +245,9 @@ message AssetPayReqResponse { taprpc.AssetGroup asset_group = 3; // Genesis information for the asset ID which includes the meta hash, and - // asset ID. + // asset ID. This is only set if the payment request was decoded with an + // asset ID and not with a group key (since a group can contain assets from + // different minting events or genesis infos). taprpc.GenesisInfo genesis_info = 4; // The normal decoded payment request. diff --git a/protos/tapd/v0.5.0/tapdevrpc/tapdev.proto b/protos/tapd/v0.6.0/tapdevrpc/tapdev.proto similarity index 93% rename from protos/tapd/v0.5.0/tapdevrpc/tapdev.proto rename to protos/tapd/v0.6.0/tapdevrpc/tapdev.proto index b1c0f53..85624a9 100644 --- a/protos/tapd/v0.5.0/tapdevrpc/tapdev.proto +++ b/protos/tapd/v0.6.0/tapdevrpc/tapdev.proto @@ -8,11 +8,15 @@ option go_package = "github.com/lightninglabs/taproot-assets/taprpc/tapdevrpc"; service TapDev { /* tapcli: `dev importproof` - ImportProof attempts to import a proof file into the daemon. If successful, + Deprecated, use the new taprpc.RegisterTransfer RPC instead! ImportProof + attempts to import a proof file into the daemon. If successful, a new asset will be inserted on disk, spendable using the specified target script key, and internal key. + NOTE: This RPC will be removed with the next major release. */ - rpc ImportProof (ImportProofRequest) returns (ImportProofResponse); + rpc ImportProof (ImportProofRequest) returns (ImportProofResponse) { + option deprecated = true; + }; /* SubscribeSendAssetEventNtfns registers a subscription to the event diff --git a/protos/tapd/v0.5.0/taprootassets.proto b/protos/tapd/v0.6.0/taprootassets.proto similarity index 82% rename from protos/tapd/v0.5.0/taprootassets.proto rename to protos/tapd/v0.6.0/taprootassets.proto index 5fec3f4..8cb63f8 100644 --- a/protos/tapd/v0.5.0/taprootassets.proto +++ b/protos/tapd/v0.6.0/taprootassets.proto @@ -87,6 +87,13 @@ service TaprootAssets { */ rpc ExportProof (ExportProofRequest) returns (ProofFile); + /* tapcli: `proofs unpack` + UnpackProofFile unpacks a proof file into a list of the individual raw + proofs in the proof chain. + */ + rpc UnpackProofFile (UnpackProofFileRequest) + returns (UnpackProofFileResponse); + /* tapcli: `assets send` SendAsset uses one or multiple passed Taproot Asset address(es) to attempt to complete an asset send. The method returns information w.r.t the on chain @@ -135,6 +142,19 @@ service TaprootAssets { */ rpc SubscribeSendEvents (SubscribeSendEventsRequest) returns (stream SendEvent); + + /* + RegisterTransfer informs the daemon about a new inbound transfer that has + happened. This is used for interactive transfers where no TAP address is + involved and the recipient is aware of the transfer through an out-of-band + protocol but the daemon hasn't been informed about the completion of the + transfer. For this to work, the proof must already be in the recipient's + local universe (e.g. through the use of the universerpc.InsertProof RPC or + the universe proof courier and universe sync mechanisms) and this call + simply instructs the daemon to detect the transfer as an asset it owns. + */ + rpc RegisterTransfer (RegisterTransferRequest) + returns (RegisterTransferResponse); } enum AssetType { @@ -196,6 +216,29 @@ message ListAssetRequest { // confirmed (check either transfers or receives for unconfirmed outbound or // inbound assets). bool include_unconfirmed_mints = 4; + + // Only return assets with amount greater or equal to this value. + uint64 min_amount = 5; + + // Only return assets with amount less or equal to this value. + uint64 max_amount = 6; + + // Only return assets that belong to the group with this key. + bytes group_key = 7; + + // Return all assets that use this script key. + ScriptKey script_key = 8; + + // Return all assets that are currently anchored on this outpoint. + OutPoint anchor_outpoint = 9; + + // The script key type to filter the assets by. If not set, only assets with + // a BIP-0086 script key will be returned (which is the equivalent of + // setting script_key_type.explicit_type = SCRIPT_KEY_BIP86). If the type + // is set to SCRIPT_KEY_BURN or SCRIPT_KEY_TOMBSTONE the include_spent flag + // will automatically be set to true, because assets of that type are always + // marked as spent. + ScriptKeyTypeQuery script_key_type = 10; } message AnchorInfo { @@ -230,6 +273,9 @@ message AnchorInfo { // The height of the block which contains the anchor transaction. uint32 block_height = 8; + + // The UTC Unix timestamp of the block containing the anchor transaction. + int64 block_timestamp = 9; } message GenesisInfo { @@ -255,8 +301,40 @@ message GenesisInfo { uint32 output_index = 6; } +/* +This message represents an external key used for deriving and managing +hierarchical deterministic (HD) wallet addresses according to BIP-86. +*/ +message ExternalKey { + /* + This field specifies the extended public key derived at depth 3 of the + BIP-86 hierarchy (e.g., m/86'/0'/0'). This key serves as the parent key for + deriving child public keys and addresses. + */ + string xpub = 1; + + /* + This field specifies the fingerprint of the master key, derived from the + first 4 bytes of the hash160 of the master public key. It is used to + identify the master key in BIP-86 derivation schemes. + */ + bytes master_fingerprint = 2; + + /* + This field specifies the extended BIP-86 derivation path used to derive a + child key from the XPub. Starting from the base path of the XPub + (e.g., m/86'/0'/0'), this path must contain exactly 5 components in total + (e.g., m/86'/0'/0'/0/0), with the additional components defining specific + child keys, such as individual addresses. + */ + string derivation_path = 3; +} + message GroupKeyRequest { - // The internal key for the asset group before any tweaks have been applied. + /* + The internal key for the asset group before any tweaks have been applied. + If this field is set then external_key must be empty, and vice versa. + */ KeyDescriptor raw_key = 1; /* @@ -279,6 +357,16 @@ message GroupKeyRequest { member of this asset group. */ bytes new_asset = 4; + + /* + The external key is an optional field that allows specifying an + external signing key for the group virtual transaction during minting. + This key enables signing operations to be performed externally, outside + the daemon. + + If this field is set then raw_key must be empty, and vice versa. + */ + ExternalKey external_key = 5; } message TxOut { @@ -437,6 +525,7 @@ message Asset { // assets in this output are destroyed and can no longer be spent. bool is_burn = 17; + // Deprecated, use script_key_type instead! // Indicates whether this script key has either been derived by the local // wallet or was explicitly declared to be known by using the // DeclareScriptKey RPC. Knowing the key conceptually means the key belongs @@ -447,6 +536,7 @@ message Asset { // script key will be shown in the wallet balance. bool script_key_declared_known = 18; + // Deprecated, use script_key_type instead! // Indicates whether the script key is known to have a Tapscript spend path, // meaning that the Taproot merkle root tweak is not empty. This will only // ever be true if either script_key_is_local or script_key_internals_known @@ -459,6 +549,12 @@ message Asset { // field is null, it means the presence of a decimal display field is // unknown in the current context. DecimalDisplay decimal_display = 20; + + // The type of the script key. This type is either user-declared when custom + // script keys are added, or automatically determined by the daemon for + // standard operations (e.g. BIP-86 keys, burn keys, tombstone keys, channel + // related keys). + ScriptKeyType script_key_type = 21; } message PrevWitness { @@ -488,6 +584,11 @@ message ListAssetResponse { message ListUtxosRequest { bool include_leased = 1; + + // The script key type to filter the assets by. If not set, only assets with + // a BIP-0086 script key will be returned (which is the equivalent of + // setting script_key_type.explicit_type = SCRIPT_KEY_BIP86). + ScriptKeyTypeQuery script_key_type = 2; } message ManagedUtxo { @@ -585,6 +686,14 @@ message ListBalancesRequest { // An option to include previous leased assets in the balances. bool include_leased = 5; + + // The script key type to filter the assets by. If not set, only assets with + // a BIP-0086 script key will be returned (which is the equivalent of + // setting script_key_type.explicit_type = SCRIPT_KEY_BIP86). If the type + // is set to SCRIPT_KEY_BURN or SCRIPT_KEY_TOMBSTONE the include_spent flag + // will automatically be set to true, because assets of that type are always + // marked as spent. + ScriptKeyTypeQuery script_key_type = 6; } message AssetBalance { @@ -664,6 +773,20 @@ message AssetTransfer { // transaction. If this value is unset, the anchor transaction is // unconfirmed. ChainHash anchor_tx_block_hash = 7; + + // The block height of the blockchain block that contains the anchor + // transaction. If the anchor transaction is still unconfirmed, this value + // will be 0. + uint32 anchor_tx_block_height = 8; + + // An optional short label for the transfer. This label can be used to track + // the progress of the transfer via the logs or an event subscription. + // Multiple transfers can share the same label. + string label = 9; + + // The L1 transaction that anchors the Taproot Asset commitment where the + // asset resides. + bytes anchor_tx = 10; } message TransferInput { @@ -697,6 +820,9 @@ message TransferOutputAnchor { bytes tapscript_sibling = 6; uint32 num_passive_assets = 7; + + // pk_script is the pkscript of the anchor output. + bytes pk_script = 8; } enum OutputType { @@ -757,6 +883,8 @@ message TransferOutput { // The delivery status of the proof associated with this output. ProofDeliveryStatus proof_delivery_status = 11; + + bytes asset_id = 12; } message StopRequest { @@ -912,6 +1040,67 @@ message NewAddrRequest { AddrVersion address_version = 8; } +enum ScriptKeyType { + /* + The type of script key is not known. This should only be stored for assets + where we don't know the internal key of the script key (e.g. for + imported proofs). + */ + SCRIPT_KEY_UNKNOWN = 0; + + /* + The script key is a normal BIP-86 key. This means that the internal key is + turned into a Taproot output key by applying a BIP-86 tweak to it. + */ + SCRIPT_KEY_BIP86 = 1; + + /* + The script key is a key that contains a script path that is defined by the + user and is therefore external to the tapd wallet. Spending this key + requires providing a specific witness and must be signed through the vPSBT + signing flow. + */ + SCRIPT_KEY_SCRIPT_PATH_EXTERNAL = 2; + + /* + The script key is a specific un-spendable key that indicates a burnt asset. + Assets with this key type can never be spent again, as a burn key is a + tweaked NUMS key that nobody knows the private key for. + */ + SCRIPT_KEY_BURN = 3; + + /* + The script key is a specific un-spendable key that indicates a tombstone + output. This is only the case for zero-value assets that result from a + non-interactive (TAP address) send where no change was left over. + */ + SCRIPT_KEY_TOMBSTONE = 4; + + /* + The script key is used for an asset that resides within a Taproot Asset + Channel. That means the script key is either a funding key (OP_TRUE), a + commitment output key (to_local, to_remote, htlc), or a HTLC second-level + transaction output key. Keys related to channels are not shown in asset + balances (unless specifically requested) and are never used for coin + selection. + */ + SCRIPT_KEY_CHANNEL = 5; +} + +message ScriptKeyTypeQuery { + oneof type { + // Query for assets of a specific script key type. + ScriptKeyType explicit_type = 1; + + // Query for assets with all script key types. + bool all_types = 2; + + // TODO(guggero): Add a bit field that allows querying for multiple + // script key types at once. Need a way to do a WHERE ... IN () type SQL + // query that is compatible with all backends first though. + } +} + message ScriptKey { /* The full Taproot output key the asset is locked to. This is either a BIP-86 @@ -930,6 +1119,14 @@ message ScriptKey { empty then a BIP-86 style tweak is applied to the internal key. */ bytes tap_tweak = 3; + + /* + The type of the script key. This type is either user-declared when custom + script keys are added, or automatically determined by the daemon for + standard operations (e.g. BIP-86 keys, burn keys, tombstone keys, channel + related keys). + */ + ScriptKeyType type = 4; } message KeyLocator { @@ -1091,6 +1288,19 @@ message ExportProofRequest { // file? } +message UnpackProofFileRequest { + // The raw proof file encoded as bytes. Must be a file and not just an + // individual mint/transfer proof. + bytes raw_proof_file = 1; +} + +message UnpackProofFileResponse { + // The individual proofs contained in the proof file, ordered by their + // appearance within the file (issuance proof first, last known transfer + // last). + repeated bytes raw_proofs = 1; +} + enum AddrEventStatus { ADDR_EVENT_STATUS_UNKNOWN = 0; ADDR_EVENT_STATUS_TRANSACTION_DETECTED = 1; @@ -1157,6 +1367,16 @@ message SendAssetRequest { uint32 fee_rate = 2; // TODO(roasbeef): maybe in future add details re type of ProofCourier or // w/e + + // An optional short label for the send transfer. This label can be used to + // track the progress of the transfer via the logs or an event subscription. + // Multiple transfers can share the same label. + string label = 3; + + // A flag to skip the proof courier ping check. This is useful for + // testing purposes and for forced transfers when the proof courier + // is not immediately available. + bool skip_proof_courier_ping_check = 4; } message PrevInputAsset { @@ -1309,6 +1529,10 @@ message SubscribeSendEventsRequest { // Filter send events by a specific recipient script key. Leave empty to get // all receive events for all parcels. bytes filter_script_key = 1; + + // Filter send events by a specific label. Leave empty to not filter by + // transfer label. + string filter_label = 2; } enum SendState { @@ -1403,6 +1627,12 @@ message SendEvent { // An optional error, indicating that executing the send_state failed. string error = 9; + + // The label of the transfer. + string transfer_label = 10; + + // The next send state that will be executed. + string next_send_state = 11; } message AnchorTransaction { @@ -1436,3 +1666,21 @@ message AnchorTransaction { */ bytes final_tx = 6; } + +message RegisterTransferRequest { + // The asset ID of the asset to register the transfer for. + bytes asset_id = 1; + + // The optional group key of the asset to register the transfer for. + bytes group_key = 2; + + // The script key of the asset to register the transfer for. + bytes script_key = 3; + + // The outpoint of the transaction that was used to receive the asset. + taprpc.OutPoint outpoint = 4; +} + +message RegisterTransferResponse { + Asset registered_asset = 1; +} diff --git a/protos/tapd/v0.5.0/universerpc/universe.proto b/protos/tapd/v0.6.0/universerpc/universe.proto similarity index 96% rename from protos/tapd/v0.5.0/universerpc/universe.proto rename to protos/tapd/v0.6.0/universerpc/universe.proto index f719fb9..e27da19 100644 --- a/protos/tapd/v0.5.0/universerpc/universe.proto +++ b/protos/tapd/v0.6.0/universerpc/universe.proto @@ -367,6 +367,23 @@ message AssetProofResponse { // MultiverseInclusionProof is the inclusion proof for the asset leaf in the // multiverse. bytes multiverse_inclusion_proof = 6; + + // The issuance related data for an issuance asset leaf. This is empty for + // any other type of asset leaf. + IssuanceData issuance_data = 7; +} + +message IssuanceData { + // The reveal meta data associated with the proof, if available. + taprpc.AssetMeta meta_reveal = 1; + + // GenesisReveal is an optional field that is the Genesis information for + // the asset. This is required for minting proofs. + taprpc.GenesisReveal genesis_reveal = 2; + + // GroupKeyReveal is an optional field that includes the information needed + // to derive the tweaked group key. + taprpc.GroupKeyReveal group_key_reveal = 3; } message AssetProof { @@ -569,6 +586,8 @@ message AssetStatsAsset { int64 genesis_timestamp = 7; string anchor_point = 8; + + uint32 decimal_display = 9; } message UniverseAssetStats { From 48a641556f5578970328257dfd2498af66290ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Mon, 7 Jul 2025 10:53:29 +0200 Subject: [PATCH 2/2] lnc-core: update version to v0.3.4-alpha --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2683bac..9f0693d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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",