Skip to content
Open
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions 47.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,31 @@ pubkey should be used.
Errors:
- `PAYMENT_FAILED`: The payment failed. This may be due to a timeout, exhausting all routes, insufficient capacity or similar.

### `pay_chain_address`

Description: Requests payment to a chain address.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should happen if the backend is not able to pay all adresses but only some (e.g. too few funds)?
Might add a line saying something alike: All given addresses have to be paid in a single transaction or the request gets failed.
This should give the client the explicit guarantee that the transaction will happen as requested.

Request:
```jsonc
{
"method": "pay_chain_address",
Comment thread
barrydeen marked this conversation as resolved.
Outdated
"params": {
"address": "bc1q...",
Comment thread
barrydeen marked this conversation as resolved.
Outdated
"amount": 123, // amount in sats
}
}
```

Response:
```jsonc
{
"result_type": "pay_chain_address",
"result": {
"txid": "0123456789abcdef...",
}
}
```

### `make_invoice`

Request:
Expand Down Expand Up @@ -346,6 +371,29 @@ Response:
Errors:
- `NOT_FOUND`: The invoice could not be found by the given parameters.

### `make_chain_address`

Request:
```jsonc
{
"method": "make_chain_address",
"params": {
"type": "p2tr", // optional - (p2tr, p2wpkh etc)
}
}
```

Response:
```jsonc
{
"result_type": "make_chain_address",
"result": {
"address": "bc1q...", // chain address
"type": "p2tr", // (p2tr, p2wpkh etc)
}
}
```

### `list_transactions`

Lists invoices and payments. If `type` is not specified, both invoices and payments are returned.
Expand Down Expand Up @@ -377,6 +425,7 @@ Response:
{
"type": "incoming", // "incoming" for invoices, "outgoing" for payments
"invoice": "string", // encoded invoice, optional
"txid": "string", // transaction id for on-chain, optional
Comment thread
barrydeen marked this conversation as resolved.
Outdated
"description": "string", // invoice's description, optional
"description_hash": "string", // invoice's description hash, optional
"preimage": "string", // payment's preimage, optional if unpaid
Expand All @@ -393,6 +442,35 @@ Response:
}
```

### `list_utxos`

Request:
```jsonc
{
"method": "list_utxos",
"params": {
"min_confirmations": 1, // minimum number of confirmations, optional
}
}
```

Response:
```jsonc
{
"result_type": "list_utxos",
"result": {
"utxos": [
{
"txid": "0123456789abcdef...",
"vout": 0,
"amount": 123, // value in sats
"confirmations": 1,
}
],
}
}
```

### `get_balance`

Request:
Expand All @@ -409,6 +487,7 @@ Response:
"result_type": "get_balance",
"result": {
"balance": 10000, // user's balance in msats
"unconfirmed_balance": 10000, // optional, user's unconfirmed balance in msats
Comment thread
barrydeen marked this conversation as resolved.
Outdated
}
}
```
Expand Down Expand Up @@ -440,6 +519,29 @@ Response:
}
```

### `sign_psbt`

Request:
```jsonc
{
"method": "sign_psbt",
"params": {
"psbt": "cHNidP8BAHICAAAAA...", // base64 encoded psbt
"input_index": 0, // index of the input to sign, optional
}
}
```

Response:
```jsonc
{
"result_type": "sign_psbt",
"result": {
"psbt": "cHNidP8BAHIC...", // base64 encoded signed psbt
}
}
```

## Notifications

### `payment_received`
Expand Down