@@ -350,6 +350,12 @@ var setParamsCommand = cli.Command{
350
350
Usage : "the target size of total local balance in " +
351
351
"satoshis, used by easy autoloop." ,
352
352
},
353
+ cli.StringFlag {
354
+ Name : "asset_id" ,
355
+ Usage : "If set to a valid asset ID, the easyautoloop " +
356
+ "and localbalancesat flags will be set for the " +
357
+ "specified asset." ,
358
+ },
353
359
},
354
360
Action : setParams ,
355
361
}
@@ -515,14 +521,39 @@ func setParams(ctx *cli.Context) error {
515
521
flagSet = true
516
522
}
517
523
524
+ // If we are setting easy autoloop parameters, we need to ensure that
525
+ // the asset ID is set, and that we have a valid entry in our params
526
+ // map.
527
+ if ctx .IsSet ("asset_id" ) {
528
+ if params .EasyAssetParams == nil {
529
+ params .EasyAssetParams = make (
530
+ map [string ]* looprpc.EasyAssetAutoloopParams ,
531
+ )
532
+ }
533
+ if _ , ok := params .EasyAssetParams [ctx .String ("asset_id" )]; ! ok { //nolint:lll
534
+ params .EasyAssetParams [ctx .String ("asset_id" )] =
535
+ & looprpc.EasyAssetAutoloopParams {}
536
+ }
537
+ }
538
+
518
539
if ctx .IsSet ("easyautoloop" ) {
519
- params .EasyAutoloop = ctx .Bool ("easyautoloop" )
540
+ if ctx .IsSet ("asset_id" ) {
541
+ params .EasyAssetParams [ctx .String ("asset_id" )].
542
+ Enabled = ctx .Bool ("easyautoloop" )
543
+ } else {
544
+ params .EasyAutoloop = ctx .Bool ("easyautoloop" )
545
+ }
520
546
flagSet = true
521
547
}
522
548
523
549
if ctx .IsSet ("localbalancesat" ) {
524
- params .EasyAutoloopLocalTargetSat =
525
- ctx .Uint64 ("localbalancesat" )
550
+ if ctx .IsSet ("asset_id" ) {
551
+ params .EasyAssetParams [ctx .String ("asset_id" )].
552
+ LocalTargetAssetAmt = ctx .Uint64 ("localbalancesat" ) // nolint:lll
553
+ } else {
554
+ params .EasyAutoloopLocalTargetSat =
555
+ ctx .Uint64 ("localbalancesat" )
556
+ }
526
557
flagSet = true
527
558
}
528
559
0 commit comments