Skip to content

Commit

Permalink
commands: add rbfpsbt command
Browse files Browse the repository at this point in the history
  • Loading branch information
jp1ac4 committed Nov 21, 2023
1 parent 4dc39fa commit fff63a3
Show file tree
Hide file tree
Showing 5 changed files with 600 additions and 1 deletion.
19 changes: 19 additions & 0 deletions doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Commands must be sent as valid JSONRPC 2.0 requests, ending with a `\n`.
| [`listspendtxs`](#listspendtxs) | List all stored Spend transactions |
| [`delspendtx`](#delspendtx) | Delete a stored Spend transaction |
| [`broadcastspend`](#broadcastspend) | Finalize a stored Spend PSBT, and broadcast it |
| [`rbfpsbt`](#rbfpsbt) | Create a new RBF Spend transaction |
| [`startrescan`](#startrescan) | Start rescanning the block chain from a given date |
| [`listconfirmed`](#listconfirmed) | List of confirmed transactions of incoming and outgoing funds |
| [`listtransactions`](#listtransactions) | List of transactions with the given txids |
Expand Down Expand Up @@ -249,6 +250,24 @@ This command does not return anything for now.
| Field | Type | Description |
| -------------- | --------- | ---------------------------------------------------- |

### `rbfpsbt`

TODO: Add comment that increasing the fee on a self-send may add other coins to the transaction.

#### Request

| Field | Type | Description |
| -------- | ------ | ---------------------------------------------------------------------------------------- |
| `txid` | string | Hex encoded txid of the Spend transaction to be replaced. |
| `feerate` | integer | Target feerate for the transaction, in satoshis per virtual byte. |
| `is_cancel` | bool | If `false`, the non-change outputs of the transaction to be replaced will be preserved. If `true`, non-change outputs will be removed and the only output of the replacement transaction will be change. |

#### Response

| Field | Type | Description |
| -------------- | --------- | ---------------------------------------------------- |
| `psbt` | string | PSBT of the spending transaction, encoded as base64. |

### `startrescan`

#### Request
Expand Down
Loading

0 comments on commit fff63a3

Please sign in to comment.