Compare commits

...

13 Commits

Author SHA1 Message Date
Barry Deen 5fd6571e70
Merge 4472f8b64e into 7dec812f99 2025-08-12 22:27:17 +00:00
Awiteb 7dec812f99
nip22: fix example type for external URL (#2011) 2025-08-11 17:26:05 -04:00
Yoji Shidara 739f3c5263
NIP-24: Fix heading levels (#2009) 2025-08-11 19:37:53 +09:00
Yoji Shidara 8830525250
NIP-21: Fix markup issue by closing backtick (#2008) 2025-08-11 19:35:36 +09:00
Barry Deen 4472f8b64e multiple inputs/outputs to chain txns, feerate, confirmed bal 2025-06-17 14:13:32 -04:00
Barry Deen 9c8e54d74f unix timestamp, add address 2025-03-10 21:35:08 -04:00
Barry Deen 6da591280c decouple chain methods from lightning 2025-02-25 12:09:25 -05:00
Barry Deen d10ce4cc4a input index is optional 2025-02-23 19:28:21 -05:00
Barry Deen 3bcfc6214a add optional to address type 2025-02-23 19:23:01 -05:00
Barry Deen 89e07e5812 disabled formatter 2025-02-23 19:21:13 -05:00
Barry Deen 888e132169 optional psbt index 2025-02-23 13:46:16 -05:00
Barry Deen 081f7707d5 list utxos, sign psbt, confirmed balanced 2025-02-23 13:44:50 -05:00
Barry Deen 29970b47bf add on-chain payments to nwc 2025-02-23 12:50:22 -05:00
4 changed files with 203 additions and 15 deletions

2
21.md
View File

@ -21,7 +21,7 @@ The identifiers that come after are expected to be the same as those defined in
### Linking HTML pages to Nostr entities
`<link>` tags with `rel="alternate"` can be used to associate webpages to Nostr events, in cases where the same content is served via the two mediums (for example, a web server that exposes Markdown articles both as HTML pages and as `kind:30023' events served under itself as a relay or through some other relay). For example:
`<link>` tags with `rel="alternate"` can be used to associate webpages to Nostr events, in cases where the same content is served via the two mediums (for example, a web server that exposes Markdown articles both as HTML pages and as `kind:30023` events served under itself as a relay or through some other relay). For example:
```
<head>

8
22.md
View File

@ -143,13 +143,13 @@ A comment on a website's url looks like this:
"tags": [
// referencing the root url
["I", "https://abc.com/articles/1"],
// the root "kind": for an url, the kind is its domain
["K", "https://abc.com"],
// the root "kind": for an url
["K", "web"],
// the parent reference (same as root for top-level comments)
["i", "https://abc.com/articles/1"],
// the parent "kind": for an url, the kind is its domain
["k", "https://abc.com"]
// the parent "kind": for an url
["k", "web"]
]
// other fields
}

13
24.md
View File

@ -8,8 +8,7 @@ Extra metadata fields and tags
This NIP keeps track of extra optional fields that can added to events which are not defined anywhere else but have become _de facto_ standards and other minor implementation possibilities that do not deserve their own NIP and do not have a place in other NIPs.
kind 0
======
### kind 0
These are extra fields not specified in NIP-01 that may be present in the stringified JSON of metadata events:
@ -19,24 +18,22 @@ These are extra fields not specified in NIP-01 that may be present in the string
- `bot`: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.
- `birthday`: an object representing the author's birth date. The format is { "year": number, "month": number, "day": number }. Each field MAY be omitted.
### Deprecated fields
#### Deprecated fields
These are fields that should be ignored or removed when found in the wild:
- `displayName`: use `display_name` instead.
- `username`: use `name` instead.
kind 3
======
### kind 3
These are extra fields not specified in NIP-02 that may be present in the stringified JSON of follow events:
### Deprecated fields
#### Deprecated fields
- `{<relay-url>: {"read": <true|false>, "write": <true|false>}, ...}`: an object of relays used by a user to read/write. [NIP-65](65.md) should be used instead.
tags
====
### tags
These tags may be present in multiple event kinds. Whenever a different meaning is not specified by some more specific NIP, they have the following meanings:

195
47.md
View File

@ -314,6 +314,34 @@ 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`
Description: Requests payment to one or more chain addresses.
Request:
```jsonc
{
"method": "pay_chain",
"params": {
"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",
"result": {
"txid": "0123456789abcdef...",
}
}
```
### `make_invoice`
Request:
@ -388,6 +416,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.
@ -436,6 +487,102 @@ 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": [
{
"txid": "0123456789abcdef...",
"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
}
],
}
}
```
### `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:
@ -456,6 +603,27 @@ Response:
}
```
### `get_chain_balance`
Request:
```jsonc
{
"method": "get_chain_balance",
"params": {}
}
```
Response:
```jsonc
{
"result_type": "get_chain_balance",
"result": {
"confirmed_balance": 100000, // user's balance in sats
"unconfirmed_balance": 100000, // user's unconfirmed balance in sats
}
}
```
### `get_info`
Request:
@ -483,6 +651,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`
@ -629,7 +820,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"
}
```
```