@@ -10,6 +10,7 @@ import (
1010 "github.com/lightninglabs/taproot-assets/tapcfg"
1111 "github.com/lightninglabs/taproot-assets/taprpc"
1212 "github.com/lightninglabs/taproot-assets/taprpc/mintrpc"
13+ "github.com/lightningnetwork/lnd/lnwallet/chainfee"
1314 "github.com/urfave/cli"
1415)
1516
5051 groupByGroupName = "by_group"
5152 assetIDName = "asset_id"
5253 shortResponseName = "short"
53- feeRateName = "fee_rate "
54+ feeRateName = "sat_per_vbyte "
5455 assetAmountName = "amount"
5556 burnOverrideConfirmationName = "override_confirmation_destroy_assets"
5657)
@@ -261,7 +262,7 @@ var finalizeBatchCommand = cli.Command{
261262 },
262263 cli.Uint64Flag {
263264 Name : feeRateName ,
264- Usage : "if set, the fee rate in sat/kw to use for " +
265+ Usage : "if set, the fee rate in sat/vB to use for " +
265266 "the minting transaction" ,
266267 },
267268 },
@@ -270,11 +271,20 @@ var finalizeBatchCommand = cli.Command{
270271
271272func parseFeeRate (ctx * cli.Context ) (uint32 , error ) {
272273 if ctx .IsSet (feeRateName ) {
273- feeRate := ctx .Uint64 (feeRateName )
274- if feeRate > math .MaxUint32 {
274+ userFeeRate := ctx .Uint64 (feeRateName )
275+ if userFeeRate > math .MaxUint32 {
275276 return 0 , fmt .Errorf ("fee rate exceeds 2^32" )
276277 }
277278
279+ // Convert from sat/vB to sat/kw. Round up to the fee floor if
280+ // the specified feerate is too low.
281+ feeRate := chainfee .SatPerKVByte (userFeeRate * 1000 ).
282+ FeePerKWeight ()
283+
284+ if feeRate < chainfee .FeePerKwFloor {
285+ feeRate = chainfee .FeePerKwFloor
286+ }
287+
278288 return uint32 (feeRate ), nil
279289 }
280290
@@ -531,7 +541,7 @@ var sendAssetsCommand = cli.Command{
531541 },
532542 cli.Uint64Flag {
533543 Name : feeRateName ,
534- Usage : "if set, the fee rate in sat/kw to use for " +
544+ Usage : "if set, the fee rate in sat/vB to use for " +
535545 "the anchor transaction" ,
536546 },
537547 // TODO(roasbeef): add arg for file name to write sender proof
0 commit comments