Skip to content
Open
Changes from 1 commit
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
60 changes: 48 additions & 12 deletions 47.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,25 +274,28 @@ 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`
### `pay_chain`

Description: Requests payment to a chain address.
Description: Requests payment to one or more chain addresses.

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",
"method": "pay_chain",
"params": {
"address": "bc1q...",
"amount": 123, // amount in sats
"recipients": [
["bc1q...", 123], // [address, amount in sats]
["bc1p...", 456] // can send to multiple addresses
],
"feerate": 10 // optional feerate in sat/vByte
}
}
```

Response:
```jsonc
{
"result_type": "pay_chain_address",
"result_type": "pay_chain",
"result": {
"txid": "0123456789abcdef...",
}
Expand Down Expand Up @@ -463,12 +466,45 @@ Response:
"result": {
"transactions": [
{
"type": "incoming", // "incoming" for received transactions, "outgoing" for sent transactions
"txid": "0123456789abcdef...",
"address": "bc1q...", // chain address
"amount": 100000, // value in sats
"spentUtxos": [ // UTXOs that belonged to the wallet and were spent in this transaction
{
"txid": "abcdef0123456789...",
"vout": 0,
"address": "bc1q...",
"amount": 150000 // value in sats
}
],
"receivedUtxos": [ // new UTXOs the wallet received from this transaction
{
"txid": "0123456789abcdef...",
"vout": 0,
"address": "bc1p...",
"amount": 49900 // value in sats (change output)
},
{
"txid": "0123456789abcdef...",
"vout": 2,
"address": "bc1q...",
"amount": 25000 // value in sats (received payment)
}
],
"confirmations": 1,
"metadata": {} // generic metadata
},
{
"txid": "fedcba9876543210...",
"spentUtxos": [], // empty - wallet didn't spend any UTXOs in this transaction
"receivedUtxos": [ // wallet received a payment
{
"txid": "fedcba9876543210...",
"vout": 1,
"address": "bc1q...",
"amount": 100000 // value in sats (pure incoming payment)
}
],
"confirmations": 6,
"metadata": {} // generic metadata
}
],
}
Expand Down Expand Up @@ -539,7 +575,7 @@ Response:
{
"result_type": "get_chain_balance",
"result": {
"balance": 100000, // user's balance in sats
"confirmed_balance": 100000, // user's balance in sats
"unconfirmed_balance": 100000, // user's unconfirmed balance in sats
}
}
Expand Down Expand Up @@ -673,7 +709,7 @@ This NIP does not specify any requirements on the type of relays used. However,
"payment_received payment_sent"
]
],
"content": "pay_invoice pay_keysend get_balance get_info make_invoice lookup_invoice list_transactions multi_pay_invoice multi_pay_keysend sign_message notifications",
"content": "pay_invoice pay_keysend get_balance get_info make_invoice lookup_invoice list_transactions multi_pay_invoice multi_pay_keysend pay_chain sign_message notifications",
"sig": "31f57b369459b5306a5353aa9e03be7fbde169bc881c3233625605dd12f53548179def16b9fe1137e6465d7e4d5bb27ce81fd6e75908c46b06269f4233c845d8"
}
```
```