Skip to content

Commit

Permalink
feat: BumpWalletTransaction rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Feb 21, 2025
1 parent 91b5ab1 commit b18f7aa
Show file tree
Hide file tree
Showing 19 changed files with 1,139 additions and 555 deletions.
36 changes: 36 additions & 0 deletions docs/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ Returns recent transactions from a wallet.
| ------- | -------- |
| [`ListWalletTransactionsRequest`](#listwallettransactionsrequest) | [`ListWalletTransactionsResponse`](#listwallettransactionsresponse) |

#### BumpWalletTransaction

Increase the fee of a wallet transaction using RBF.

| Request | Response |
| ------- | -------- |
| [`BumpWalletTransactionRequest`](#bumpwallettransactionrequest) | [`BumpWalletTransactionResponse`](#bumpwallettransactionresponse) |

#### GetWalletCredentials

Returns the credentials of a wallet. The password will be required if the wallet is encrypted.
Expand Down Expand Up @@ -395,6 +403,34 @@ Bakes a new macaroon with the specified permissions. The macaroon can also be re



#### BumpWalletTransactionRequest




| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `id` | [`uint64`](#uint64) | | id of the wallet which the transaction belongs to |
| `sat_per_vbyte` | [`double`](#double) | | fee rate for the new transaction |
| `tx_id` | [`string`](#string) | | id of the transaction to bump |





#### BumpWalletTransactionResponse




| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `tx_id` | [`string`](#string) | | |





#### ChainSwapData


Expand Down
4 changes: 4 additions & 0 deletions internal/cln/cln.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func (c *Cln) GetTransactions(limit, offset uint64) ([]*onchain.WalletTransactio
return nil, errors.New("not implemented for cln")
}

func (c *Cln) BumpTransactionFee(txId string, feeRate float64) (string, error) {
return "", errors.New("not implemented for cln")
}

func (c *Cln) SanityCheck() (string, error) {
info, err := c.Client.Getinfo(context.Background(), &protos.GetinfoRequest{})
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions internal/lnd/lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ func (lnd *LND) GetTransactions(limit, offset uint64) ([]*onchain.WalletTransact
return nil, errors.New("not implemented for lnd")
}

func (lnd *LND) BumpTransactionFee(txId string, feeRate float64) (string, error) {
return "", errors.New("not implemented for lnd")
}

func (lnd *LND) CreateInvoice(value uint64, preimage []byte, expiry int64, memo string) (*lightning.AddInvoiceResponse, error) {
request := &lnrpc.Invoice{
Memo: memo,
Expand Down
4 changes: 4 additions & 0 deletions internal/macaroons/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ var (
Entity: "wallet",
Action: "read",
}},
"/boltzrpc.Boltz/BumpWalletTransaction": {{
Entity: "wallet",
Action: "write",
}},
"/boltzrpc.Boltz/GetWallet": {{
Entity: "wallet",
Action: "read",
Expand Down
57 changes: 57 additions & 0 deletions internal/mocks/lightning/LightningNode_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions internal/mocks/onchain/Wallet_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/onchain/onchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type Wallet interface {
GetWalletInfo() WalletInfo
Disconnect() error
GetTransactions(limit, offset uint64) ([]*WalletTransaction, error)
BumpTransactionFee(txId string, satPerVbyte float64) (string, error)
}

type ElectrumOptions struct {
Expand Down
Loading

0 comments on commit b18f7aa

Please sign in to comment.