@@ -24,6 +24,8 @@ var staticAddressCommands = cli.Command{
2424 Subcommands : []cli.Command {
2525 newStaticAddressCommand ,
2626 listUnspentCommand ,
27+ listDepositsCommand ,
28+ listStaticAddressSwapsCommand ,
2729 withdrawalCommand ,
2830 summaryCommand ,
2931 },
@@ -206,6 +208,36 @@ func withdraw(ctx *cli.Context) error {
206208 return nil
207209}
208210
211+ var listDepositsCommand = cli.Command {
212+ Name : "listdeposits" ,
213+ Usage : "Display a summary of static address related information." ,
214+ Description : `
215+ ` ,
216+ Flags : []cli.Flag {
217+ cli.StringFlag {
218+ Name : "filter" ,
219+ Usage : "specify a filter to only display deposits in " +
220+ "the specified state. Leaving out the filter " +
221+ "returns all deposits.\n The state can be one " +
222+ "of the following: \n " +
223+ "deposited\n withdrawing\n withdrawn\n " +
224+ "loopingin\n loopedin\n " +
225+ "publish_expired_deposit\n " +
226+ "sweep_htlc_timeout\n htlc_timeout_swept\n " +
227+ "wait_for_expiry_sweep\n expired\n failed\n ." ,
228+ },
229+ },
230+ Action : listDeposits ,
231+ }
232+
233+ var listStaticAddressSwapsCommand = cli.Command {
234+ Name : "listswaps" ,
235+ Usage : "Display a summary of static address related information." ,
236+ Description : `
237+ ` ,
238+ Action : listStaticAddressSwaps ,
239+ }
240+
209241var summaryCommand = cli.Command {
210242 Name : "summary" ,
211243 ShortName : "s" ,
@@ -231,10 +263,10 @@ var summaryCommand = cli.Command{
231263 Action : summary ,
232264}
233265
234- func summary (ctx * cli.Context ) error {
266+ func listDeposits (ctx * cli.Context ) error {
235267 ctxb := context .Background ()
236268 if ctx .NArg () > 0 {
237- return cli .ShowCommandHelp (ctx , "summary " )
269+ return cli .ShowCommandHelp (ctx , "listdeposits " )
238270 }
239271
240272 client , cleanup , err := getClient (ctx )
@@ -285,8 +317,8 @@ func summary(ctx *cli.Context) error {
285317 filterState = looprpc .DepositState_UNKNOWN_STATE
286318 }
287319
288- resp , err := client .GetStaticAddressSummary (
289- ctxb , & looprpc.StaticAddressSummaryRequest {
320+ resp , err := client .ListStaticAddressDeposits (
321+ ctxb , & looprpc.ListStaticAddressDepositsRequest {
290322 StateFilter : filterState ,
291323 },
292324 )
@@ -299,6 +331,54 @@ func summary(ctx *cli.Context) error {
299331 return nil
300332}
301333
334+ func listStaticAddressSwaps (ctx * cli.Context ) error {
335+ ctxb := context .Background ()
336+ if ctx .NArg () > 0 {
337+ return cli .ShowCommandHelp (ctx , "listswaps" )
338+ }
339+
340+ client , cleanup , err := getClient (ctx )
341+ if err != nil {
342+ return err
343+ }
344+ defer cleanup ()
345+
346+ resp , err := client .ListStaticAddressSwaps (
347+ ctxb , & looprpc.ListStaticAddressSwapsRequest {},
348+ )
349+ if err != nil {
350+ return err
351+ }
352+
353+ printRespJSON (resp )
354+
355+ return nil
356+ }
357+
358+ func summary (ctx * cli.Context ) error {
359+ ctxb := context .Background ()
360+ if ctx .NArg () > 0 {
361+ return cli .ShowCommandHelp (ctx , "summary" )
362+ }
363+
364+ client , cleanup , err := getClient (ctx )
365+ if err != nil {
366+ return err
367+ }
368+ defer cleanup ()
369+
370+ resp , err := client .GetStaticAddressSummary (
371+ ctxb , & looprpc.StaticAddressSummaryRequest {},
372+ )
373+ if err != nil {
374+ return err
375+ }
376+
377+ printRespJSON (resp )
378+
379+ return nil
380+ }
381+
302382func utxosToOutpoints (utxos []string ) ([]* looprpc.OutPoint , error ) {
303383 outpoints := make ([]* looprpc.OutPoint , 0 , len (utxos ))
304384 if len (utxos ) == 0 {
@@ -382,8 +462,8 @@ func staticAddressLoopIn(ctx *cli.Context) error {
382462 }
383463
384464 // Get the amount we need to quote for.
385- summaryResp , err := client .GetStaticAddressSummary (
386- ctxb , & looprpc.StaticAddressSummaryRequest {
465+ summaryResp , err := client .ListStaticAddressDeposits (
466+ ctxb , & looprpc.ListStaticAddressDepositsRequest {
387467 StateFilter : looprpc .DepositState_DEPOSITED ,
388468 },
389469 )
0 commit comments