Skip to content

Commit 1367fe0

Browse files
authored
Merge pull request #26 from lightninglabs/2023-08-update-to-lnc-core-v0.2.6-alpha
Update to lnc-core v0.2.6-alpha
2 parents 0698f63 + 579401b commit 1367fe0

File tree

28 files changed

+467
-41
lines changed

28 files changed

+467
-41
lines changed

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ After specifying the latest versions, run the following commands in the root
3636
dir of the project.
3737

3838
```sh
39+
# install package dependencies
40+
yarn
3941
# download new proto files
4042
yarn run update-protos
4143
# generate Typescript definitions from the updated protos

lib/types/proto/loop/client.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
/* eslint-disable */
22
import type { RouteHint } from './swapserverrpc/common';
33

4+
/**
5+
* `AddressType` has to be one of:
6+
*
7+
* - `unknown`: Unknown address type
8+
* - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 1)
9+
*/
10+
export enum AddressType {
11+
ADDRESS_TYPE_UNKNOWN = 'ADDRESS_TYPE_UNKNOWN',
12+
TAPROOT_PUBKEY = 'TAPROOT_PUBKEY',
13+
UNRECOGNIZED = 'UNRECOGNIZED'
14+
}
15+
416
export enum SwapType {
517
/** LOOP_OUT - LOOP_OUT indicates an loop out swap (off-chain to on-chain) */
618
LOOP_OUT = 'LOOP_OUT',
@@ -247,6 +259,14 @@ export interface LoopOutRequest {
247259
* triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
248260
*/
249261
initiator: string;
262+
/**
263+
* An alternative destination address source for the swap. This field
264+
* represents the name of the account in the backing lnd instance.
265+
* Refer to lnd's wallet import functions for reference.
266+
*/
267+
account: string;
268+
/** The address type of the account specified in the account field. */
269+
accountAddrType: AddressType;
250270
}
251271

252272
export interface LoopInRequest {
@@ -557,6 +577,8 @@ export interface LsatToken {
557577
* file name of the token where it's stored on the file system.
558578
*/
559579
storageName: string;
580+
/** The l402 ID of the token. */
581+
id: string;
560582
}
561583

562584
export interface LoopStats {
@@ -715,6 +737,14 @@ export interface LiquidityParameters {
715737
* autoloop to determine how much liquidity should be maintained in channels.
716738
*/
717739
easyAutoloopLocalTargetSat: string;
740+
/**
741+
* An alternative destination address source for the swap. This field
742+
* represents the name of the account in the backing lnd instance.
743+
* Refer to lnd's wallet import functions for reference.
744+
*/
745+
account: string;
746+
/** The address type of the account specified in the account field. */
747+
accountAddrType: AddressType;
718748
}
719749

720750
export interface LiquidityRule {

lib/types/proto/tapd/mintrpc/mint.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ export interface CancelBatchResponse {
8282

8383
export interface ListBatchRequest {
8484
/**
85-
* The optional batch key of the batch to list. When using REST this field
86-
* must be encoded as base64url.
85+
* The optional batch key of the batch to list, specified as raw bytes
86+
* (gRPC only).
8787
*/
88-
batchKey: Uint8Array | string;
88+
batchKey: Uint8Array | string | undefined;
89+
/**
90+
* The optional batch key of the batch to list, specified as a hex
91+
* encoded string (use this for REST).
92+
*/
93+
batchKeyStr: string | undefined;
8994
}
9095

9196
export interface ListBatchResponse {

lib/types/proto/tapd/taprootassets.ts

Lines changed: 90 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export enum AssetType {
1818

1919
export enum AssetMetaType {
2020
/**
21-
* MTEA_TYPE_OPAQUE - Opaque is used for asset meta blobs that have no true structure and instead
21+
* META_TYPE_OPAQUE - Opaque is used for asset meta blobs that have no true structure and instead
2222
* should be interpreted as opaque blobs.
2323
*/
24-
MTEA_TYPE_OPAQUE = 'MTEA_TYPE_OPAQUE',
24+
META_TYPE_OPAQUE = 'META_TYPE_OPAQUE',
2525
UNRECOGNIZED = 'UNRECOGNIZED'
2626
}
2727

@@ -92,7 +92,7 @@ export interface AnchorInfo {
9292
/** The txid of the above transaction. */
9393
anchorTxid: string;
9494
/** The block hash the contains the anchor transaction above. */
95-
anchorBlockHash: Uint8Array | string;
95+
anchorBlockHash: string;
9696
/** The outpoint (txid:vout) that stores the Taproot Asset commitment. */
9797
anchorOutpoint: string;
9898
/** The raw internal key that was used to create the anchor Taproot output key. */
@@ -109,6 +109,8 @@ export interface AnchorInfo {
109109
* anchor output.
110110
*/
111111
tapscriptSibling: Uint8Array | string;
112+
/** The height of the block which contains the anchor transaction. */
113+
blockHeight: number;
112114
}
113115

114116
export interface GenesisInfo {
@@ -497,8 +499,70 @@ export interface ProofFile {
497499
genesisPoint: string;
498500
}
499501

500-
export interface ProofVerifyResponse {
502+
export interface DecodedProof {
503+
/** The index depth of the decoded proof, with 0 being the latest proof. */
504+
proofAtDepth: number;
505+
/** The total number of proofs contained in the raw proof. */
506+
numberOfProofs: number;
507+
/** The asset referenced in the proof. */
508+
asset: Asset | undefined;
509+
/** The reveal meta data associated with the proof, if available. */
510+
metaReveal: AssetMeta | undefined;
511+
/**
512+
* The merkle proof for AnchorTx used to prove its
513+
* inclusion within BlockHeader.
514+
*/
515+
txMerkleProof: Uint8Array | string;
516+
/**
517+
* The TaprootProof proving the new inclusion of the
518+
* resulting asset within AnchorTx.
519+
*/
520+
inclusionProof: Uint8Array | string;
521+
/**
522+
* The set of TaprootProofs proving the exclusion of
523+
* the resulting asset from all other Taproot outputs within AnchorTx.
524+
*/
525+
exclusionProofs: Uint8Array | string[];
526+
/**
527+
* An optional TaprootProof needed if this asset is
528+
* the result of a split. SplitRootProof proves inclusion of the root
529+
* asset of the split.
530+
*/
531+
splitRootProof: Uint8Array | string;
532+
/**
533+
* The number of additional nested full proofs for any inputs found within
534+
* the resulting asset.
535+
*/
536+
numAdditionalInputs: number;
537+
/**
538+
* ChallengeWitness is an optional virtual transaction witness that serves
539+
* as an ownership proof for the asset. If this is non-nil, then it is a
540+
* valid transfer witness for a 1-input, 1-output virtual transaction that
541+
* spends the asset in this proof and sends it to the NUMS key, to prove
542+
* that the creator of the proof is able to produce a valid signature to
543+
* spend the asset.
544+
*/
545+
challengeWitness: Uint8Array | string[];
546+
}
547+
548+
export interface VerifyProofResponse {
501549
valid: boolean;
550+
decodedProof: DecodedProof | undefined;
551+
}
552+
553+
export interface DecodeProofRequest {
554+
/** The raw proof in bytes to decode, which may contain multiple proofs. */
555+
rawProof: Uint8Array | string;
556+
/** The index depth of the decoded proof, with 0 being the latest proof. */
557+
proofAtDepth: number;
558+
/** An option to include previous witnesses in decoding. */
559+
withPrevWitnesses: boolean;
560+
/** An option to attempt to retrieve the meta data associated with the proof. */
561+
withMetaReveal: boolean;
562+
}
563+
564+
export interface DecodeProofResponse {
565+
decodedProof: DecodedProof | undefined;
502566
}
503567

504568
export interface ExportProofRequest {
@@ -569,6 +633,14 @@ export interface SendAssetResponse {
569633
transfer: AssetTransfer | undefined;
570634
}
571635

636+
export interface GetInfoRequest {}
637+
638+
export interface GetInfoResponse {
639+
version: string;
640+
lndVersion: string;
641+
network: string;
642+
}
643+
572644
export interface SubscribeSendAssetEventNtfnsRequest {}
573645

574646
export interface SendAssetEvent {
@@ -694,7 +766,15 @@ export interface TaprootAssets {
694766
* VerifyProof attempts to verify a given proof file that claims to be anchored
695767
* at the specified genesis point.
696768
*/
697-
verifyProof(request?: DeepPartial<ProofFile>): Promise<ProofVerifyResponse>;
769+
verifyProof(request?: DeepPartial<ProofFile>): Promise<VerifyProofResponse>;
770+
/**
771+
* tarocli: `proofs decode`
772+
* DecodeProof attempts to decode a given proof file into human readable
773+
* format.
774+
*/
775+
decodeProof(
776+
request?: DeepPartial<DecodeProofRequest>
777+
): Promise<DecodeProofResponse>;
698778
/**
699779
* tapcli: `proofs export`
700780
* ExportProof exports the latest raw proof file anchored at the specified
@@ -720,6 +800,11 @@ export interface TaprootAssets {
720800
sendAsset(
721801
request?: DeepPartial<SendAssetRequest>
722802
): Promise<SendAssetResponse>;
803+
/**
804+
* tapcli: `getinfo`
805+
* GetInfo returns the information for the node.
806+
*/
807+
getInfo(request?: DeepPartial<GetInfoRequest>): Promise<GetInfoResponse>;
723808
/**
724809
* SubscribeSendAssetEventNtfns registers a subscription to the event
725810
* notification stream which relates to the asset sending process.

lib/types/proto/tapd/universerpc/universe.ts

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export enum AssetQuerySort {
2020
SORT_BY_ASSET_NAME = 'SORT_BY_ASSET_NAME',
2121
SORT_BY_ASSET_ID = 'SORT_BY_ASSET_ID',
2222
SORT_BY_ASSET_TYPE = 'SORT_BY_ASSET_TYPE',
23+
SORT_BY_TOTAL_SYNCS = 'SORT_BY_TOTAL_SYNCS',
24+
SORT_BY_TOTAL_PROOFS = 'SORT_BY_TOTAL_PROOFS',
25+
SORT_BY_GENESIS_HEIGHT = 'SORT_BY_GENESIS_HEIGHT',
2326
UNRECOGNIZED = 'UNRECOGNIZED'
2427
}
2528

@@ -45,13 +48,16 @@ export interface MerkleSumNode {
4548
}
4649

4750
export interface ID {
48-
/** The 32-byte asset ID. */
51+
/** The 32-byte asset ID specified as raw bytes (gRPC only). */
4952
assetId: Uint8Array | string | undefined;
50-
/** The 32-byte asset ID encoded as a hex string. */
53+
/** The 32-byte asset ID encoded as a hex string (use this for REST). */
5154
assetIdStr: string | undefined;
52-
/** The 32-byte asset group key. */
55+
/** The 32-byte asset group key specified as raw bytes (gRPC only). */
5356
groupKey: Uint8Array | string | undefined;
54-
/** The 32-byte asset group key encoded as hex string. */
57+
/**
58+
* The 32-byte asset group key encoded as hex string (use this for
59+
* REST).
60+
*/
5561
groupKeyStr: string | undefined;
5662
}
5763

@@ -89,6 +95,13 @@ export interface QueryRootResponse {
8995
assetRoot: UniverseRoot | undefined;
9096
}
9197

98+
export interface DeleteRootQuery {
99+
/** An ID value to uniquely identify a Universe root. */
100+
id: ID | undefined;
101+
}
102+
103+
export interface DeleteRootResponse {}
104+
92105
export interface Outpoint {
93106
/** The output as a hex encoded (and reversed!) string. */
94107
hashStr: string;
@@ -151,6 +164,19 @@ export interface AssetProof {
151164
assetLeaf: AssetLeaf | undefined;
152165
}
153166

167+
export interface InfoRequest {}
168+
169+
export interface InfoResponse {
170+
/**
171+
* A pseudo-random runtime ID for the current instance of the Universe
172+
* server, changes with each restart. Mainly used to identify identical
173+
* servers when they are exposed under different hostnames/ports.
174+
*/
175+
runtimeId: string;
176+
/** The number of assets known to this Universe server. */
177+
numAssets: string;
178+
}
179+
154180
export interface SyncTarget {
155181
id: ID | undefined;
156182
}
@@ -226,10 +252,13 @@ export interface AssetStatsQuery {
226252

227253
export interface AssetStatsSnapshot {
228254
assetId: Uint8Array | string;
255+
groupKey: Uint8Array | string;
256+
genesisPoint: string;
229257
totalSupply: string;
230258
assetName: string;
231259
assetType: AssetType;
232260
genesisHeight: number;
261+
genesisTimestamp: string;
233262
totalSyncs: string;
234263
totalProofs: string;
235264
}
@@ -238,6 +267,22 @@ export interface UniverseAssetStats {
238267
assetStats: AssetStatsSnapshot[];
239268
}
240269

270+
export interface QueryEventsRequest {
271+
startTimestamp: string;
272+
endTimestamp: string;
273+
}
274+
275+
export interface QueryEventsResponse {
276+
events: GroupedUniverseEvents[];
277+
}
278+
279+
export interface GroupedUniverseEvents {
280+
/** The date the events occurred on, formatted as YYYY-MM-DD. */
281+
date: string;
282+
syncEvents: string;
283+
newProofEvents: string;
284+
}
285+
241286
export interface Universe {
242287
/**
243288
* tapcli: `universe roots`
@@ -255,6 +300,14 @@ export interface Universe {
255300
queryAssetRoots(
256301
request?: DeepPartial<AssetRootQuery>
257302
): Promise<QueryRootResponse>;
303+
/**
304+
* tapcli: `universe delete`
305+
* DeleteAssetRoot deletes the Universe root for a specific asset, including
306+
* all asoociated universe keys, leaves, and events.
307+
*/
308+
deleteAssetRoot(
309+
request?: DeepPartial<DeleteRootQuery>
310+
): Promise<DeleteRootResponse>;
258311
/**
259312
* tapcli: `universe keys`
260313
* AssetLeafKeys queries for the set of Universe keys associated with a given
@@ -292,6 +345,11 @@ export interface Universe {
292345
* updated asset_id/group_key.
293346
*/
294347
insertProof(request?: DeepPartial<AssetProof>): Promise<AssetProofResponse>;
348+
/**
349+
* tapcli: `universe info`
350+
* Info returns a set of information about the current state of the Universe.
351+
*/
352+
info(request?: DeepPartial<InfoRequest>): Promise<InfoResponse>;
295353
/**
296354
* tapcli: `universe sync`
297355
* SyncUniverse takes host information for a remote Universe server, then
@@ -329,7 +387,7 @@ export interface Universe {
329387
): Promise<DeleteFederationServerResponse>;
330388
/**
331389
* tapcli: `universe stats`
332-
* UniverseStats returns a set of aggregrate statistics for the current state
390+
* UniverseStats returns a set of aggregate statistics for the current state
333391
* of the Universe. Stats returned include: total number of syncs, total
334392
* number of proofs, and total number of known assets.
335393
*/
@@ -344,6 +402,14 @@ export interface Universe {
344402
queryAssetStats(
345403
request?: DeepPartial<AssetStatsQuery>
346404
): Promise<UniverseAssetStats>;
405+
/**
406+
* tapcli `universe stats events`
407+
* QueryEvents returns the number of sync and proof events for a given time
408+
* period, grouped by day.
409+
*/
410+
queryEvents(
411+
request?: DeepPartial<QueryEventsRequest>
412+
): Promise<QueryEventsResponse>;
347413
}
348414

349415
type Builtin =

0 commit comments

Comments
 (0)