Skip to content
Open
Changes from 8 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
155 changes: 155 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 @@ -393,6 +441,69 @@ Response:
}
```

### `list_chain_transactions`

Request:
```jsonc
{
"method": "list_chain_transactions",
"params": {
"from": unixtimestamp, // optional
"until": unixtimestamp, // optional
"limit": 10, // maximum number of transactions to return, optional
"offset": 0, // offset of the first transaction to return, optional
}
}
```

Response:
```jsonc
{
"result_type": "list_chain_transactions",
"result": {
"transactions": [
{
"type": "incoming", // "incoming" for received transactions, "outgoing" for sent transactions
"txid": "0123456789abcdef...",
"address": "bc1q...", // chain address
"amount": 100000, // value in sats
"confirmations": 1,
"metadata": {} // generic metadata
}
],
}
}
```

### `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 @@ -413,6 +524,27 @@ Response:
}
```

### `get_chain_balance`

Request:
```jsonc
{
"method": "get_chain_balance",
"params": {}
}
```

Response:
```jsonc
{
"result_type": "get_chain_balance",
"result": {
"balance": 100000, // user's balance in sats
Comment thread
barrydeen marked this conversation as resolved.
Outdated
"unconfirmed_balance": 100000, // user's unconfirmed balance in sats
}
}
```

### `get_info`

Request:
Expand Down Expand Up @@ -440,6 +572,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