@@ -57,6 +57,11 @@ type WalletKitClient interface {
5757
5858 EstimateFee (ctx context.Context , confTarget int32 ) (chainfee.SatPerKWeight ,
5959 error )
60+
61+ // ListSweeps returns a list of sweep transaction ids known to our node.
62+ // Note that this function only looks up transaction ids, and does not
63+ // query our wallet for the full set of transactions.
64+ ListSweeps (ctx context.Context ) ([]string , error )
6065}
6166
6267type walletKitClient struct {
@@ -319,3 +324,26 @@ func (m *walletKitClient) EstimateFee(ctx context.Context, confTarget int32) (
319324
320325 return chainfee .SatPerKWeight (resp .SatPerKw ), nil
321326}
327+
328+ // ListSweeps returns a list of sweep transaction ids known to our node.
329+ // Note that this function only looks up transaction ids (Verbose=false), and
330+ // does not query our wallet for the full set of transactions.
331+ func (m * walletKitClient ) ListSweeps (ctx context.Context ) ([]string , error ) {
332+ rpcCtx , cancel := context .WithTimeout (ctx , rpcTimeout )
333+ defer cancel ()
334+
335+ resp , err := m .client .ListSweeps (
336+ m .walletKitMac .WithMacaroonAuth (rpcCtx ),
337+ & walletrpc.ListSweepsRequest {
338+ Verbose : false ,
339+ },
340+ )
341+ if err != nil {
342+ return nil , err
343+ }
344+
345+ // Since we have requested the abbreviated response from lnd, we can
346+ // just get our response to a list of sweeps and return it.
347+ sweeps := resp .GetTransactionIds ()
348+ return sweeps .TransactionIds , nil
349+ }
0 commit comments