Skip to content

Commit

Permalink
Merge pull request #34 from lightninglabs/2024-02-bump-version-to-v.0…
Browse files Browse the repository at this point in the history
….3.1-alpha

lnc-core: update version to `v0.3.1-alpha`
  • Loading branch information
ViktorTigerstrom authored Feb 21, 2024
2 parents b27c6e8 + ea36a08 commit 5d5e888
Show file tree
Hide file tree
Showing 31 changed files with 606 additions and 112 deletions.
6 changes: 6 additions & 0 deletions lib/types/proto/lit/lit-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export interface SubServerStatus {
* starting up properly.
*/
error: string;
/**
* custom_status details a custom state that the sub-server has entered,
* which is unique to the sub-server, and which is not the standard
* disabled, running or errored state.
*/
customStatus: string;
}

/** The Status server can be used to query the state of various LiT sub-servers. */
Expand Down
6 changes: 6 additions & 0 deletions lib/types/proto/lnd/walletrpc/walletkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ export interface ListSweepsRequest {
* replaced-by-fee, so will not be included in this output.
*/
verbose: boolean;
/**
* The start height to use when fetching sweeps. If not specified (0), the
* result will start from the earliest sweep. If set to -1 the result will
* only include unconfirmed sweeps (at the time of the call).
*/
startHeight: number;
}

export interface ListSweepsResponse {
Expand Down
96 changes: 95 additions & 1 deletion lib/types/proto/loop/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ export enum FailureReason {
* because the amount extended by an external loop in htlc is insufficient.
*/
FAILURE_REASON_INCORRECT_AMOUNT = 'FAILURE_REASON_INCORRECT_AMOUNT',
/**
* FAILURE_REASON_ABANDONED - FAILURE_REASON_ABANDONED indicates that a swap permanently failed because
* the client manually abandoned the swap.
*/
FAILURE_REASON_ABANDONED = 'FAILURE_REASON_ABANDONED',
/**
* FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE - FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE indicates that a swap
* wasn't published due to insufficient confirmed balance.
*/
FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE = 'FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE',
UNRECOGNIZED = 'UNRECOGNIZED'
}

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

export interface LoopInRequest {
Expand Down Expand Up @@ -422,7 +438,33 @@ export interface SwapStatus {
label: string;
}

export interface ListSwapsRequest {}
export interface ListSwapsRequest {
/** Optional filter to only return swaps that match the filter. */
listSwapFilter: ListSwapsFilter | undefined;
}

export interface ListSwapsFilter {
/** The type of the swap. */
swapType: ListSwapsFilter_SwapTypeFilter;
/** If set, only pending swaps are returned. */
pendingOnly: boolean;
/** If specified on creation, the outgoing channel set of the swap. */
outgoingChanSet: string[];
/** Label of swap to filter for. */
label: string;
/** If specified on creation, the last hop of the swap. */
loopInLastHop: Uint8Array | string;
}

export enum ListSwapsFilter_SwapTypeFilter {
/** ANY - ANY indicates that no filter is applied. */
ANY = 'ANY',
/** LOOP_OUT - LOOP_OUT indicates an loop out swap (off-chain to on-chain). */
LOOP_OUT = 'LOOP_OUT',
/** LOOP_IN - LOOP_IN indicates a loop in swap (on-chain to off-chain). */
LOOP_IN = 'LOOP_IN',
UNRECOGNIZED = 'UNRECOGNIZED'
}

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

export interface AbandonSwapRequest {
/**
* The swap identifier which currently is the hash that locks the HTLCs. When
* using REST, this field must be encoded as URL safe base64.
*/
id: Uint8Array | string;
/**
* A flag that tries to ensure that the client understands that they are
* risking loss of funds by abandoning a swap. This could happen if an
* abandoned swap would wait on a timeout sweep by the client.
*/
iKnowWhatIAmDoing: boolean;
}

export interface AbandonSwapResponse {}

export interface ListReservationsRequest {}

export interface ListReservationsResponse {
/** The list of all currently known reservations and their status. */
reservations: ClientReservation[];
}

export interface ClientReservation {
/** The reservation id that identifies this reservation. */
reservationId: Uint8Array | string;
/** The state the reservation is in. */
state: string;
/** The amount that the reservation is for. */
amount: string;
/** The transaction id of the reservation. */
txId: Uint8Array | string;
/** The vout of the reservation. */
vout: number;
/** The expiry of the reservation. */
expiry: number;
}

/**
* SwapClient is a service that handles the client side process of onchain/offchain
* swaps. The service is designed for a single client.
Expand Down Expand Up @@ -857,6 +937,13 @@ export interface SwapClient {
* SwapInfo returns all known details about a single swap.
*/
swapInfo(request?: DeepPartial<SwapInfoRequest>): Promise<SwapStatus>;
/**
* loop: `abandonswap`
* AbandonSwap allows the client to abandon a swap.
*/
abandonSwap(
request?: DeepPartial<AbandonSwapRequest>
): Promise<AbandonSwapResponse>;
/**
* loop: `terms`
* LoopOutTerms returns the terms that the server enforces for a loop out swap.
Expand Down Expand Up @@ -932,6 +1019,13 @@ export interface SwapClient {
suggestSwaps(
request?: DeepPartial<SuggestSwapsRequest>
): Promise<SuggestSwapsResponse>;
/**
* loop: `listreservations`
* ListReservations returns a list of all reservations the server opened to us.
*/
listReservations(
request?: DeepPartial<ListReservationsRequest>
): Promise<ListReservationsResponse>;
}

type Builtin =
Expand Down
3 changes: 2 additions & 1 deletion lib/types/proto/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ export const subscriptionMethods = [
'poolrpc.ChannelAuctioneer.SubscribeBatchAuction',
'poolrpc.ChannelAuctioneer.SubscribeSidecar',
'poolrpc.HashMail.RecvStream',
'taprpc.TaprootAssets.SubscribeSendAssetEventNtfns'
'taprpc.TaprootAssets.SubscribeSendAssetEventNtfns',
'taprpc.TaprootAssets.SubscribeReceiveAssetEventNtfns'
];
11 changes: 4 additions & 7 deletions lib/types/proto/tapd/assetwalletrpc/assetwallet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable */
import type {
OutPoint,
KeyDescriptor,
ScriptKey,
SendAssetResponse
Expand Down Expand Up @@ -59,13 +60,6 @@ export interface PrevId {
scriptKey: Uint8Array | string;
}

export interface OutPoint {
/** Raw bytes representing the transaction id. */
txid: Uint8Array | string;
/** The index of the output on the transaction. */
outputIndex: number;
}

export interface SignVirtualPsbtRequest {
/**
* The PSBT of the virtual transaction that should be signed. The PSBT must
Expand Down Expand Up @@ -109,6 +103,7 @@ export interface NextScriptKeyResponse {
export interface ProveAssetOwnershipRequest {
assetId: Uint8Array | string;
scriptKey: Uint8Array | string;
outpoint: OutPoint | undefined;
}

export interface ProveAssetOwnershipResponse {
Expand Down Expand Up @@ -175,6 +170,7 @@ export interface AssetWallet {
request?: DeepPartial<NextScriptKeyRequest>
): Promise<NextScriptKeyResponse>;
/**
* tapcli: `proofs proveownership`
* ProveAssetOwnership creates an ownership proof embedded in an asset
* transition proof. That ownership proof is a signed virtual transaction
* spending the asset with a valid witness to prove the prover owns the keys
Expand All @@ -184,6 +180,7 @@ export interface AssetWallet {
request?: DeepPartial<ProveAssetOwnershipRequest>
): Promise<ProveAssetOwnershipResponse>;
/**
* tapcli: `proofs verifyownership`
* VerifyAssetOwnership verifies the asset ownership proof embedded in the
* given transition proof of an asset and returns true if the proof is valid.
*/
Expand Down
61 changes: 51 additions & 10 deletions lib/types/proto/tapd/mintrpc/mint.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable */
import type { AssetType, AssetVersion, AssetMeta } from '../taprootassets';
import type { AssetVersion, AssetType, AssetMeta } from '../taprootassets';

export enum BatchState {
BATCH_STATE_UNKNOWN = 'BATCH_STATE_UNKNOWN',
BATCH_STATE_PEDNING = 'BATCH_STATE_PEDNING',
BATCH_STATE_PENDING = 'BATCH_STATE_PENDING',
BATCH_STATE_FROZEN = 'BATCH_STATE_FROZEN',
BATCH_STATE_COMMITTED = 'BATCH_STATE_COMMITTED',
BATCH_STATE_BROADCAST = 'BATCH_STATE_BROADCAST',
Expand All @@ -14,7 +14,9 @@ export enum BatchState {
UNRECOGNIZED = 'UNRECOGNIZED'
}

export interface MintAsset {
export interface PendingAsset {
/** The version of asset to mint. */
assetVersion: AssetVersion;
/** The type of the asset to be created. */
assetType: AssetType;
/** The name, or "tag" of the asset. This will affect the final asset ID. */
Expand All @@ -29,25 +31,59 @@ export interface MintAsset {
* AssetType is Collectible, then this field cannot be set.
*/
amount: string;
/**
* If true, then the asset will be created with a new group key, which allows
* for future asset issuance.
*/
newGroupedAsset: boolean;
/** The specific group key this asset should be minted with. */
groupKey: Uint8Array | string;
/**
* The name of the asset in the batch that will anchor a new asset group.
* This asset will be minted with the same group key as the anchor asset.
*/
groupAnchor: string;
}

export interface MintAsset {
/** The version of asset to mint. */
assetVersion: AssetVersion;
/** The type of the asset to be created. */
assetType: AssetType;
/** The name, or "tag" of the asset. This will affect the final asset ID. */
name: string;
/**
* A blob that resents metadata related to the asset. This will affect the
* final asset ID.
*/
assetMeta: AssetMeta | undefined;
/**
* The total amount of units of the new asset that should be created. If the
* AssetType is Collectible, then this field cannot be set.
*/
amount: string;
/**
* If true, then the asset will be created with a group key, which allows for
* future asset issuance.
*/
newGroupedAsset: boolean;
/**
* If true, then a group key or group anchor can be set to mint this asset into
* an existing asset group.
*/
groupedAsset: boolean;
/** The specific group key this asset should be minted with. */
groupKey: Uint8Array | string;
/**
* The name of the asset in the batch that will anchor a new asset group.
* This asset will be minted with the same group key as the anchor asset.
*/
groupAnchor: string;
}

export interface MintAssetRequest {
/** The asset to be minted. */
asset: MintAsset | undefined;
/**
* If true, then the asset will be created with a group key, which allows for
* future asset issuance.
*/
enableEmission: boolean;
/**
* If true, then the assets currently in the batch won't be returned in the
* response. This is mainly to avoid a lot of data being transmitted and
Expand All @@ -68,10 +104,15 @@ export interface MintingBatch {
* batched into the same minting transaction.
*/
batchKey: Uint8Array | string;
/** The assets that are part of the batch. */
assets: MintAsset[];
/**
* The transaction ID of the batch. Only populated if the batch has been
* committed.
*/
batchTxid: string;
/** The state of the batch. */
state: BatchState;
/** The assets that are part of the batch. */
assets: PendingAsset[];
}

export interface FinalizeBatchRequest {
Expand Down
Loading

0 comments on commit 5d5e888

Please sign in to comment.