Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@lightningpolar/tapd-api",
"version": "0.7.0-alpha",
"version": "0.7.2",
"description": "Bitcoin Taproot Assets Protocol API client for Lightning Labs tapd daemon",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"config": {
"tapd_release_tag": "v0.7.0",
"lnd_release_tag": "v0.20.0-beta"
"tapd_release_tag": "v0.7.2",
"lnd_release_tag": "v0.21.0-beta.rc1"
},
"files": [
"dist",
Expand Down
137 changes: 135 additions & 2 deletions protos/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,18 @@ service Lightning {
rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest)
returns (stream CustomMessage);

/* lncli: `sendonion`
SendOnionMessage sends an onion message to a peer.
*/
rpc SendOnionMessage (SendOnionMessageRequest)
returns (SendOnionMessageResponse);

/* lncli: `subscribeonion`
SubscribeOnionMessages subscribes to a stream of incoming onion messages.
*/
rpc SubscribeOnionMessages (SubscribeOnionMessagesRequest)
returns (stream OnionMessageUpdate);

/* lncli: `listaliases`
ListAliases returns the set of all aliases that have ever existed with
their confirmed SCID (if it exists) and/or the base SCID (in the case of
Expand Down Expand Up @@ -642,7 +654,8 @@ message CustomMessage {
}

message SendCustomMessageRequest {
// Peer to send the message to
// Peer to which the message will be sent. Represented as a byte-encoded
// public key
bytes peer = 1;

// Message type. This value needs to be in the custom range (>= 32768).
Expand All @@ -660,6 +673,67 @@ message SendCustomMessageResponse {
string status = 1;
}

message SubscribeOnionMessagesRequest {
}

message OnionMessageUpdate {
// Peer from which this message originates. Represented as a byte-encoded
// public key.
bytes peer = 1;

// PathKey is used to derive the blinded node id by tweaking the hop's
// static public key. The hop uses the corresponding blinded private key
// together with the sender's ephemeral key to perform ECDH and obtain the
// shared secret for decrypting the onion payload. Separately, for
// decrypting `encrypted_recipient_data`, the recipient performs ECDH
// between its static node private key and the path_key to derive the
// decryption key.
bytes path_key = 2;

// Serialized Sphinx onion packet (BOLT 4) containing the layered, per-hop
// encrypted payloads and routing instructions used to forward this message
// along its designated path.
bytes onion = 3;

// reply_path is the blinded path that should be used when replying to a
// received message.
BlindedPath reply_path = 4;

// encrypted_recipient_data is the encrypted data that contains the
// forwarding information for an onion message. It contains either
// next_node_id or short_channel_id for each non-final node. It MAY contain
// the path_id for the final node.
bytes encrypted_recipient_data = 5;

// Custom onion message tlv records. These are customized fields that are
// not defined by LND and cannot be extracted.
map<uint64, bytes> custom_records = 6;
}

message SendOnionMessageRequest {
// Peer to send the message to
bytes peer = 1;

// PathKey is used to derive the blinded node id by tweaking the hop's
// static public key. The hop uses the corresponding blinded private key
// together with the sender's ephemeral key to perform ECDH and obtain the
// shared secret for decrypting the onion payload. Separately, for
// decrypting `encrypted_recipient_data`, the recipient performs ECDH
// between its static node private key and the path_key to derive the
// decryption key.
bytes path_key = 2;

// Serialized Sphinx onion packet (BOLT 4) containing the layered, per-hop
// encrypted payloads and routing instructions used to forward this message
// along its designated path.
bytes onion = 3;
}

message SendOnionMessageResponse {
// The status of the onion message send operation.
string status = 1;
}

message Utxo {
// The type of address
AddressType address_type = 1;
Expand Down Expand Up @@ -1159,6 +1233,9 @@ message EstimateFeeRequest {

// The strategy to use for selecting coins during fees estimation.
CoinSelectionStrategy coin_selection_strategy = 5;

// A list of selected inputs for the transaction.
repeated OutPoint inputs = 6;
}

message EstimateFeeResponse {
Expand All @@ -1171,6 +1248,9 @@ message EstimateFeeResponse {

// The fee rate in satoshi/vbyte.
uint64 sat_per_vbyte = 3;

// A list of selected inputs for the transaction the estimate is for.
repeated OutPoint inputs = 4;
}

message SendManyRequest {
Expand Down Expand Up @@ -1436,10 +1516,18 @@ enum CommitmentType {

/*
A channel that uses musig2 for the funding output, and the new tapscript
features where relevant.
features where relevant. This is the staging version using development
scripts.
*/
SIMPLE_TAPROOT = 5;

/*
A channel that uses musig2 for the funding output, and the new tapscript
features where relevant. This is the production version using final scripts
and feature bits 80/81.
*/
SIMPLE_TAPROOT_FINAL = 7;

/*
Identical to the SIMPLE_TAPROOT channel type, but with extra functionality.
This channel type also commits to additional meta data in the tapscript
Expand Down Expand Up @@ -1978,6 +2066,13 @@ message PeerEvent {

message GetInfoRequest {
}
enum GraphCacheStatus {
GRAPH_CACHE_STATUS_DISABLED = 0;
GRAPH_CACHE_STATUS_LOADING = 1;
GRAPH_CACHE_STATUS_LOADED = 2;
GRAPH_CACHE_STATUS_FAILED = 3;
}

message GetInfoResponse {
// The version of the LND software that the node is running.
string version = 14;
Expand Down Expand Up @@ -2052,9 +2147,19 @@ message GetInfoResponse {

// Indicates whether final htlc resolutions are stored on disk.
bool store_final_htlc_resolutions = 22;

// Whether the wallet is fully synced to the best chain. This indicates the
// wallet's internal sync state with the backing chain source.
bool wallet_synced = 23;

// The current status of the in-memory graph cache.
GraphCacheStatus graph_cache_status = 24;
}

message GetDebugInfoRequest {
// If set to true, the log file content will be included in the response.
// By default, only the config information is returned.
bool include_log = 1;
}

message GetDebugInfoResponse {
Expand Down Expand Up @@ -2890,6 +2995,24 @@ message PendingChannelsResponse {
// The raw hex encoded bytes of the closing transaction. Included if
// include_raw_tx in the request is true.
string closing_tx_hex = 5;

/*
Remaining number of confirmations until the channel closure is
considered final and removed from waiting close. Channel closes
require multiple confirmations for reorg protection — the exact
number scales with channel capacity. A closing transaction that
gets reorganized out of the chain resets this counter. When the
closing transaction is not yet confirmed, this value equals the
total number of confirmations required.
*/
uint32 blocks_til_close_confirmed = 6;

/*
The block height at which the closing transaction was first confirmed.
This will be zero if the closing transaction has not yet confirmed, or
if this information is not available for older channels.
*/
uint32 close_height = 7;
}

message Commitments {
Expand Down Expand Up @@ -2994,6 +3117,10 @@ message PendingChannelsResponse {
message ChannelEventSubscription {
}

message ChannelCommitUpdate {
Channel channel = 1;
}

message ChannelEventUpdate {
oneof channel {
Channel open_channel = 1;
Expand All @@ -3003,6 +3130,7 @@ message ChannelEventUpdate {
PendingUpdate pending_open_channel = 6;
ChannelPoint fully_resolved_channel = 7;
ChannelPoint channel_funding_timeout = 8;
ChannelCommitUpdate updated_channel = 9;
}

enum UpdateType {
Expand All @@ -3013,6 +3141,7 @@ message ChannelEventUpdate {
PENDING_OPEN_CHANNEL = 4;
FULLY_RESOLVED_CHANNEL = 5;
CHANNEL_FUNDING_TIMEOUT = 6;
CHANNEL_UPDATE = 7;
}

UpdateType type = 5;
Expand Down Expand Up @@ -4461,6 +4590,10 @@ message ListPaymentsRequest {
// If set, returns all payments with a creation date less than or equal to
// it. Measured in seconds since the unix epoch.
uint64 creation_date_end = 7;

// If set, omit hop-level route data for HTLC attempts to reduce query
// cost and response size.
bool omit_hops = 8;
}

message ListPaymentsResponse {
Expand Down
8 changes: 8 additions & 0 deletions protos/priceoraclerpc/price_oracle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ message QueryAssetRatesRequest {
// is available. The maximum length of this field is 32'768 bytes. This
// field will only be set by tapd v0.7.0 and later.
string metadata = 9;

// node_id is the 33-byte public key of the local node making the
// request to the price oracle. This identifies the tapd node that is
// querying rates, as opposed to the counterparty_id field which
// identifies the peer on the other side of the transaction. This field
// is set by default and can be disabled via the
// --experimental.rfq.priceoracledisablenodeid configuration option.
bytes node_id = 10;
}

// QueryAssetRatesOkResponse is the successful response to a
Expand Down
57 changes: 53 additions & 4 deletions protos/routerrpc/router.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ option go_package = "github.com/lightningnetwork/lnd/lnrpc/routerrpc";
// Router is a service that offers advanced interaction with the router
// subsystem of the daemon.
service Router {
/*
/* lncli: `sendpayment`
SendPaymentV2 attempts to route a payment described by the passed
PaymentRequest to the final destination. The call returns a stream of
payment updates. When using this RPC, make sure to set a fee limit, as the
Expand All @@ -53,7 +53,7 @@ service Router {
*/
rpc TrackPayments (TrackPaymentsRequest) returns (stream lnrpc.Payment);

/*
/* lncli: `estimateroutefee`
EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
may cost to send an HTLC to the target end destination.
*/
Expand All @@ -70,7 +70,7 @@ service Router {
option deprecated = true;
}

/*
/* lncli: `sendtoroute`
SendToRouteV2 attempts to make a payment via the specified route. This
method differs from SendPayment in that it allows users to specify a full
route manually. This can be used for things like rebalancing, and atomic
Expand Down Expand Up @@ -202,6 +202,18 @@ service Router {
*/
rpc XFindBaseLocalChanAlias (FindBaseAliasRequest)
returns (FindBaseAliasResponse);

/* lncli: `deletefwdhistory`
DeleteForwardingHistory allows the caller to delete forwarding history
events with a timestamp at or before a specified time. This is useful
for implementing data retention policies for privacy purposes. The call
deletes events in batches and returns statistics including the total number
of events deleted and the aggregate fees earned from those events. The
deletion is performed in a transaction-safe manner with configurable batch
sizes to avoid holding large database locks.
*/
rpc DeleteForwardingHistory (DeleteForwardingHistoryRequest)
returns (DeleteForwardingHistoryResponse);
}

message SendPaymentRequest {
Expand Down Expand Up @@ -911,6 +923,11 @@ enum FailureDetail {
INVALID_KEYSEND = 20;
MPP_IN_PROGRESS = 21;
CIRCULAR_ROUTE = 22;
INVOICE_ALREADY_SETTLED = 23;
HTLC_INVOICE_TYPE_MISMATCH = 24;
AMP_ERROR = 25;
AMP_RECONSTRUCTION = 26;
EXTERNAL_VALIDATION_FAILED = 27;
}

enum PaymentState {
Expand Down Expand Up @@ -1133,4 +1150,36 @@ message FindBaseAliasRequest {
message FindBaseAliasResponse {
// The base scid that resulted from the base scid look up.
uint64 base = 1;
}
}

message DeleteForwardingHistoryRequest {
// Specify the cutoff time for deletion using one of the following options.
// Events with a timestamp at or before the cutoff are deleted.
oneof time_spec {
// Absolute Unix timestamp (seconds). Events at or before this time
// are deleted.
uint64 delete_before_time = 1;

// Relative duration string indicating how far back to delete, e.g.
// "-30d" deletes events at or before 30 days ago.
// Standard Go: "-24h", "-1.5h"
// Custom units: "-1d", "-1w", "-1M", "-1y"
// Supported: ns, us/µs, ms, s, m, h, d (days), w (weeks),
// M (months=30.44d), y (years=365.25d).
// Use negative values to specify time in the past.
string delete_before_duration = 2;
}
}

message DeleteForwardingHistoryResponse {
// Number of forwarding events deleted.
uint64 events_deleted = 1;

// Total fees earned from deleted events (in millisatoshis).
// This is the sum of (amt_in - amt_out) for all deleted events, which
// can be used for accounting purposes.
int64 total_fee_msat = 2;

// Status message.
string status = 3;
}
15 changes: 15 additions & 0 deletions protos/universerpc/universe.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ service Universe {
*/
rpc DeleteAssetRoot (DeleteRootQuery) returns (DeleteRootResponse);

/* tapcli: `universe delete-leaf`
DeleteAssetLeaf deletes a single Universe leaf, identified by its
universe ID and leaf key (outpoint + script key).
*/
rpc DeleteAssetLeaf (DeleteAssetLeafRequest)
returns (DeleteAssetLeafResponse);

/* tapcli: `universe keys`
AssetLeafKeys queries for the set of Universe keys associated with a given
asset_id or group_key. Each key takes the form: (outpoint, script_key),
Expand Down Expand Up @@ -316,6 +323,14 @@ message DeleteRootQuery {
message DeleteRootResponse {
}

message DeleteAssetLeafRequest {
// The universe key identifying the leaf to delete.
UniverseKey key = 1;
}

message DeleteAssetLeafResponse {
}

message Outpoint {
// The output as a hex encoded (and reversed!) string.
string hash_str = 1;
Expand Down
Loading