mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-18 20:48:50 +00:00
Compare commits
1 Commits
profile-hy
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cafdbb0cf |
34
55.md
34
55.md
@@ -107,6 +107,13 @@ Send the Intent:
|
||||
launcher.launch(intent)
|
||||
```
|
||||
|
||||
### Initiating a connection
|
||||
|
||||
- Client send a get_public_key `Intent`
|
||||
- Signer responds with the user `pubkey` and it's `packageName`
|
||||
- Client saves the `pubkey` and `packageName` somewhere and NEVER calls `get_public_key` again
|
||||
- Client now can send `content resolvers` and `Intents` for the other methods
|
||||
|
||||
#### Methods
|
||||
|
||||
- **get_public_key**
|
||||
@@ -299,33 +306,6 @@ Clients SHOULD save the user pubkey locally and avoid calling the `get_public_ke
|
||||
|
||||
#### Methods
|
||||
|
||||
- **get_public_key**
|
||||
- params:
|
||||
|
||||
```kotlin
|
||||
val result = context.contentResolver.query(
|
||||
Uri.parse("content://com.example.signer.GET_PUBLIC_KEY"),
|
||||
listOf(hex_pub_key),
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
```
|
||||
- result:
|
||||
- Will return the **pubkey** in the result column
|
||||
|
||||
```kotlin
|
||||
if (result == null) return
|
||||
|
||||
if (it.getColumnIndex("rejected") > -1) return
|
||||
|
||||
if (result.moveToFirst()) {
|
||||
val index = it.getColumnIndex("result")
|
||||
if (index < 0) return
|
||||
val pubkey = it.getString(index)
|
||||
}
|
||||
```
|
||||
|
||||
- **sign_event**
|
||||
- params:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user