@@ -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
272288export 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
427469export 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
9371031type Builtin =
0 commit comments