Compare commits

...

8 Commits

Author SHA1 Message Date
fiatjaf
9d527dba15 nip37: non-harmful editable short notes. 2024-11-05 12:37:14 -03:00
Vitor Pamplona
c275ae74eb Merge pull request #1367 from greenart7c3/nip_55_flags
NIP-55: Add intent flags to open the signer once when sending multiple events
2024-11-01 08:54:46 -04:00
greenart7c3
03a555beb5 Add result from multiple intents 2024-11-01 08:24:52 -03:00
greenart7c3
93e6c3880b Add launchMode for signers 2024-11-01 08:16:06 -03:00
greenart7c3
061d2ac47d Add intent flags 2024-11-01 08:03:30 -03:00
Asai Toshiya
5bcb2d834a Revert "Merge pull request #1558 from coracle-social/quote-a"
This reverts commit 4aa46562eb, reversing
changes made to 8e2523e331.
2024-11-01 08:22:50 +09:00
hodlbod
4aa46562eb Merge pull request #1558 from coracle-social/quote-a
Add explicit support for address quotes
2024-10-31 14:13:48 -07:00
Jon Staab
c0568fe8cc Add explicit support for address quotes 2024-10-31 10:09:43 -07:00
2 changed files with 67 additions and 0 deletions

38
37.md Normal file
View File

@@ -0,0 +1,38 @@
NIP-37
======
Editable Short Notes
--------------------
`draft` `optional`
This NIP describes a flow for clients that want to support editable short notes without breaking the experience of clients that don't and keeping `kind:1` a safe place.
The idea is that editable notes are published as `kind:31000` notes that follow all the same rules of `kind:1`, except for the fact that they can be replaceable anytime.
```jsonc
{
"kind": 31000,
"created_at": 1730820000,
"content": "I like dogs",
"tags": [
["d", "c2huy3f"],
// other kind1 tags
]
}
```
Clients that want to support edits would automatically only publish `kind:31000` notes, then immediately publish `kind:1` notes that quote the `kind:31000` note.
```jsonc
{
"kind": 1,
"created_at": 1730820000,
"content": "naddr1...",
"tags": [
["q", "31000:...:c2huy3f"]
]
}
```
Clients that support this NIP would then fetch the `kind:31000` and display it normally in place of the `kind:1`. Other clients would display the editable event embedded inside the `kind:1`.

29
55.md
View File

@@ -72,6 +72,35 @@ Set the Signer package name:
intent.`package` = "com.example.signer"
```
If you are sending multiple intents without awaiting you can add some intent flags to sign all events without opening multiple times the signer
```kotlin
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP)
```
If you are developing a signer application them you need to add this to your AndroidManifest.xml so clients can use the intent flags above
```kotlin
android:launchMode="singleTop"
```
Signer MUST answer multiple permissions with an array of results
```kotlin
val results = listOf(
Result(
package = signerPackageName,
result = eventSignture,
id = intentId
)
)
val json = results.toJson()
intent.putExtra("results", json)
```
Send the Intent:
```kotlin