Skip to content

Commit

Permalink
feat: bumpfee cli command
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Feb 21, 2025
1 parent 24f5fc0 commit f221a8f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cmd/boltzcli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,12 @@ var walletCommands = &cli.Command{
Action: requireNArgs(1, listTransactions),
Flags: []cli.Flag{jsonFlag, &cli.BoolFlag{Name: "exclude-swap-related", Usage: "Exclude swap related transactions"}},
},
{
Name: "bumpfee",
ArgsUsage: "name txid fee-rate",
Usage: "Bump the fee of a transaction",
Action: requireNArgs(3, bumpFee),
},
{
Name: "subaccounts",
Usage: "Show the subaccounts of a wallet",
Expand Down Expand Up @@ -2036,6 +2042,29 @@ func listTransactions(ctx *cli.Context) error {
return nil
}

func bumpFee(ctx *cli.Context) error {
client := getClient(ctx)
walletId, err := getWalletId(ctx, ctx.Args().First())
if err != nil {
return fmt.Errorf("wallet not found: %s", err)
}
txid := ctx.Args().Get(1)
feeRate, err := strconv.ParseFloat(ctx.Args().Get(2), 64)
if err != nil {
return fmt.Errorf("invalid fee rate: %s", err)
}
response, err := client.BumpWalletTransaction(&boltzrpc.BumpWalletTransactionRequest{
Id: *walletId,
TxId: txid,
SatPerVbyte: feeRate,
})
if err != nil {
return err
}
printJson(response)
return nil
}

var formatMacaroonCommand = &cli.Command{
Name: "formatmacaroon",
Category: "Debug",
Expand Down

0 comments on commit f221a8f

Please sign in to comment.