Skip to content

Commit 5d5e888

Browse files
authored
Merge pull request #34 from lightninglabs/2024-02-bump-version-to-v.0.3.1-alpha
lnc-core: update version to `v0.3.1-alpha`
2 parents b27c6e8 + ea36a08 commit 5d5e888

File tree

31 files changed

+606
-112
lines changed

31 files changed

+606
-112
lines changed

lib/types/proto/lit/lit-status.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ export interface SubServerStatus {
2424
* starting up properly.
2525
*/
2626
error: string;
27+
/**
28+
* custom_status details a custom state that the sub-server has entered,
29+
* which is unique to the sub-server, and which is not the standard
30+
* disabled, running or errored state.
31+
*/
32+
customStatus: string;
2733
}
2834

2935
/** The Status server can be used to query the state of various LiT sub-servers. */

lib/types/proto/lnd/walletrpc/walletkit.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@ export interface ListSweepsRequest {
677677
* replaced-by-fee, so will not be included in this output.
678678
*/
679679
verbose: boolean;
680+
/**
681+
* The start height to use when fetching sweeps. If not specified (0), the
682+
* result will start from the earliest sweep. If set to -1 the result will
683+
* only include unconfirmed sweeps (at the time of the call).
684+
*/
685+
startHeight: number;
680686
}
681687

682688
export interface ListSweepsResponse {

lib/types/proto/loop/client.ts

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ export enum FailureReason {
9898
* because the amount extended by an external loop in htlc is insufficient.
9999
*/
100100
FAILURE_REASON_INCORRECT_AMOUNT = 'FAILURE_REASON_INCORRECT_AMOUNT',
101+
/**
102+
* FAILURE_REASON_ABANDONED - FAILURE_REASON_ABANDONED indicates that a swap permanently failed because
103+
* the client manually abandoned the swap.
104+
*/
105+
FAILURE_REASON_ABANDONED = 'FAILURE_REASON_ABANDONED',
106+
/**
107+
* FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE - FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE indicates that a swap
108+
* wasn't published due to insufficient confirmed balance.
109+
*/
110+
FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE = 'FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE',
101111
UNRECOGNIZED = 'UNRECOGNIZED'
102112
}
103113

@@ -267,6 +277,12 @@ export interface LoopOutRequest {
267277
account: string;
268278
/** The address type of the account specified in the account field. */
269279
accountAddrType: AddressType;
280+
/**
281+
* A flag indicating whether the defined destination address does not belong to
282+
* the wallet. This is used to flag whether this loop out swap could have its
283+
* associated sweep batched.
284+
*/
285+
isExternalAddr: boolean;
270286
}
271287

272288
export interface LoopInRequest {
@@ -422,7 +438,33 @@ export interface SwapStatus {
422438
label: string;
423439
}
424440

425-
export interface ListSwapsRequest {}
441+
export interface ListSwapsRequest {
442+
/** Optional filter to only return swaps that match the filter. */
443+
listSwapFilter: ListSwapsFilter | undefined;
444+
}
445+
446+
export interface ListSwapsFilter {
447+
/** The type of the swap. */
448+
swapType: ListSwapsFilter_SwapTypeFilter;
449+
/** If set, only pending swaps are returned. */
450+
pendingOnly: boolean;
451+
/** If specified on creation, the outgoing channel set of the swap. */
452+
outgoingChanSet: string[];
453+
/** Label of swap to filter for. */
454+
label: string;
455+
/** If specified on creation, the last hop of the swap. */
456+
loopInLastHop: Uint8Array | string;
457+
}
458+
459+
export enum ListSwapsFilter_SwapTypeFilter {
460+
/** ANY - ANY indicates that no filter is applied. */
461+
ANY = 'ANY',
462+
/** LOOP_OUT - LOOP_OUT indicates an loop out swap (off-chain to on-chain). */
463+
LOOP_OUT = 'LOOP_OUT',
464+
/** LOOP_IN - LOOP_IN indicates a loop in swap (on-chain to off-chain). */
465+
LOOP_IN = 'LOOP_IN',
466+
UNRECOGNIZED = 'UNRECOGNIZED'
467+
}
426468

427469
export interface ListSwapsResponse {
428470
/** The list of all currently known swaps and their status. */
@@ -814,6 +856,44 @@ export interface SuggestSwapsResponse {
814856
disqualified: Disqualified[];
815857
}
816858

859+
export interface AbandonSwapRequest {
860+
/**
861+
* The swap identifier which currently is the hash that locks the HTLCs. When
862+
* using REST, this field must be encoded as URL safe base64.
863+
*/
864+
id: Uint8Array | string;
865+
/**
866+
* A flag that tries to ensure that the client understands that they are
867+
* risking loss of funds by abandoning a swap. This could happen if an
868+
* abandoned swap would wait on a timeout sweep by the client.
869+
*/
870+
iKnowWhatIAmDoing: boolean;
871+
}
872+
873+
export interface AbandonSwapResponse {}
874+
875+
export interface ListReservationsRequest {}
876+
877+
export interface ListReservationsResponse {
878+
/** The list of all currently known reservations and their status. */
879+
reservations: ClientReservation[];
880+
}
881+
882+
export interface ClientReservation {
883+
/** The reservation id that identifies this reservation. */
884+
reservationId: Uint8Array | string;
885+
/** The state the reservation is in. */
886+
state: string;
887+
/** The amount that the reservation is for. */
888+
amount: string;
889+
/** The transaction id of the reservation. */
890+
txId: Uint8Array | string;
891+
/** The vout of the reservation. */
892+
vout: number;
893+
/** The expiry of the reservation. */
894+
expiry: number;
895+
}
896+
817897
/**
818898
* SwapClient is a service that handles the client side process of onchain/offchain
819899
* swaps. The service is designed for a single client.
@@ -857,6 +937,13 @@ export interface SwapClient {
857937
* SwapInfo returns all known details about a single swap.
858938
*/
859939
swapInfo(request?: DeepPartial<SwapInfoRequest>): Promise<SwapStatus>;
940+
/**
941+
* loop: `abandonswap`
942+
* AbandonSwap allows the client to abandon a swap.
943+
*/
944+
abandonSwap(
945+
request?: DeepPartial<AbandonSwapRequest>
946+
): Promise<AbandonSwapResponse>;
860947
/**
861948
* loop: `terms`
862949
* LoopOutTerms returns the terms that the server enforces for a loop out swap.
@@ -932,6 +1019,13 @@ export interface SwapClient {
9321019
suggestSwaps(
9331020
request?: DeepPartial<SuggestSwapsRequest>
9341021
): Promise<SuggestSwapsResponse>;
1022+
/**
1023+
* loop: `listreservations`
1024+
* ListReservations returns a list of all reservations the server opened to us.
1025+
*/
1026+
listReservations(
1027+
request?: DeepPartial<ListReservationsRequest>
1028+
): Promise<ListReservationsResponse>;
9351029
}
9361030

9371031
type Builtin =

lib/types/proto/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@ export const subscriptionMethods = [
7070
'poolrpc.ChannelAuctioneer.SubscribeBatchAuction',
7171
'poolrpc.ChannelAuctioneer.SubscribeSidecar',
7272
'poolrpc.HashMail.RecvStream',
73-
'taprpc.TaprootAssets.SubscribeSendAssetEventNtfns'
73+
'taprpc.TaprootAssets.SubscribeSendAssetEventNtfns',
74+
'taprpc.TaprootAssets.SubscribeReceiveAssetEventNtfns'
7475
];

lib/types/proto/tapd/assetwalletrpc/assetwallet.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable */
22
import type {
3+
OutPoint,
34
KeyDescriptor,
45
ScriptKey,
56
SendAssetResponse
@@ -59,13 +60,6 @@ export interface PrevId {
5960
scriptKey: Uint8Array | string;
6061
}
6162

62-
export interface OutPoint {
63-
/** Raw bytes representing the transaction id. */
64-
txid: Uint8Array | string;
65-
/** The index of the output on the transaction. */
66-
outputIndex: number;
67-
}
68-
6963
export interface SignVirtualPsbtRequest {
7064
/**
7165
* The PSBT of the virtual transaction that should be signed. The PSBT must
@@ -109,6 +103,7 @@ export interface NextScriptKeyResponse {
109103
export interface ProveAssetOwnershipRequest {
110104
assetId: Uint8Array | string;
111105
scriptKey: Uint8Array | string;
106+
outpoint: OutPoint | undefined;
112107
}
113108

114109
export interface ProveAssetOwnershipResponse {
@@ -175,6 +170,7 @@ export interface AssetWallet {
175170
request?: DeepPartial<NextScriptKeyRequest>
176171
): Promise<NextScriptKeyResponse>;
177172
/**
173+
* tapcli: `proofs proveownership`
178174
* ProveAssetOwnership creates an ownership proof embedded in an asset
179175
* transition proof. That ownership proof is a signed virtual transaction
180176
* spending the asset with a valid witness to prove the prover owns the keys
@@ -184,6 +180,7 @@ export interface AssetWallet {
184180
request?: DeepPartial<ProveAssetOwnershipRequest>
185181
): Promise<ProveAssetOwnershipResponse>;
186182
/**
183+
* tapcli: `proofs verifyownership`
187184
* VerifyAssetOwnership verifies the asset ownership proof embedded in the
188185
* given transition proof of an asset and returns true if the proof is valid.
189186
*/

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

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-disable */
2-
import type { AssetType, AssetVersion, AssetMeta } from '../taprootassets';
2+
import type { AssetVersion, AssetType, AssetMeta } from '../taprootassets';
33

44
export enum BatchState {
55
BATCH_STATE_UNKNOWN = 'BATCH_STATE_UNKNOWN',
6-
BATCH_STATE_PEDNING = 'BATCH_STATE_PEDNING',
6+
BATCH_STATE_PENDING = 'BATCH_STATE_PENDING',
77
BATCH_STATE_FROZEN = 'BATCH_STATE_FROZEN',
88
BATCH_STATE_COMMITTED = 'BATCH_STATE_COMMITTED',
99
BATCH_STATE_BROADCAST = 'BATCH_STATE_BROADCAST',
@@ -14,7 +14,9 @@ export enum BatchState {
1414
UNRECOGNIZED = 'UNRECOGNIZED'
1515
}
1616

17-
export interface MintAsset {
17+
export interface PendingAsset {
18+
/** The version of asset to mint. */
19+
assetVersion: AssetVersion;
1820
/** The type of the asset to be created. */
1921
assetType: AssetType;
2022
/** The name, or "tag" of the asset. This will affect the final asset ID. */
@@ -29,25 +31,59 @@ export interface MintAsset {
2931
* AssetType is Collectible, then this field cannot be set.
3032
*/
3133
amount: string;
34+
/**
35+
* If true, then the asset will be created with a new group key, which allows
36+
* for future asset issuance.
37+
*/
38+
newGroupedAsset: boolean;
3239
/** The specific group key this asset should be minted with. */
3340
groupKey: Uint8Array | string;
3441
/**
3542
* The name of the asset in the batch that will anchor a new asset group.
3643
* This asset will be minted with the same group key as the anchor asset.
3744
*/
3845
groupAnchor: string;
46+
}
47+
48+
export interface MintAsset {
3949
/** The version of asset to mint. */
4050
assetVersion: AssetVersion;
51+
/** The type of the asset to be created. */
52+
assetType: AssetType;
53+
/** The name, or "tag" of the asset. This will affect the final asset ID. */
54+
name: string;
55+
/**
56+
* A blob that resents metadata related to the asset. This will affect the
57+
* final asset ID.
58+
*/
59+
assetMeta: AssetMeta | undefined;
60+
/**
61+
* The total amount of units of the new asset that should be created. If the
62+
* AssetType is Collectible, then this field cannot be set.
63+
*/
64+
amount: string;
65+
/**
66+
* If true, then the asset will be created with a group key, which allows for
67+
* future asset issuance.
68+
*/
69+
newGroupedAsset: boolean;
70+
/**
71+
* If true, then a group key or group anchor can be set to mint this asset into
72+
* an existing asset group.
73+
*/
74+
groupedAsset: boolean;
75+
/** The specific group key this asset should be minted with. */
76+
groupKey: Uint8Array | string;
77+
/**
78+
* The name of the asset in the batch that will anchor a new asset group.
79+
* This asset will be minted with the same group key as the anchor asset.
80+
*/
81+
groupAnchor: string;
4182
}
4283

4384
export interface MintAssetRequest {
4485
/** The asset to be minted. */
4586
asset: MintAsset | undefined;
46-
/**
47-
* If true, then the asset will be created with a group key, which allows for
48-
* future asset issuance.
49-
*/
50-
enableEmission: boolean;
5187
/**
5288
* If true, then the assets currently in the batch won't be returned in the
5389
* response. This is mainly to avoid a lot of data being transmitted and
@@ -68,10 +104,15 @@ export interface MintingBatch {
68104
* batched into the same minting transaction.
69105
*/
70106
batchKey: Uint8Array | string;
71-
/** The assets that are part of the batch. */
72-
assets: MintAsset[];
107+
/**
108+
* The transaction ID of the batch. Only populated if the batch has been
109+
* committed.
110+
*/
111+
batchTxid: string;
73112
/** The state of the batch. */
74113
state: BatchState;
114+
/** The assets that are part of the batch. */
115+
assets: PendingAsset[];
75116
}
76117

77118
export interface FinalizeBatchRequest {

0 commit comments

Comments
 (0)