mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
Change web app methods do use nostrsigner: instead of intent:
This commit is contained in:
parent
07074d8ba2
commit
b21e996a89
30
100.md
30
100.md
|
@ -432,63 +432,49 @@ Android intents and browsers url has limitations, so if you are using the return
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:#Intent;scheme=nostrsigner;S.compressionType=none;S.returnType=signature;S.type=get_public_key;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:?compressionType=none;returnType=signature;type=get_public_key;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **sign_event**
|
- **sign_event**
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:${eventJson}#Intent;scheme=nostrsigner;S.compressionType=none;S.returnType=signature;S.type=sign_event;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:${eventJson}?compressionType=none;returnType=signature;type=sign_event;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **nip04_encrypt**
|
- **nip04_encrypt**
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:${plainText}#Intent;scheme=nostrsigner;S.pubKey=${hex_pub_key};S.compressionType=none;S.returnType=signature;S.type=nip04_encrypt;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:${plainText}?pubKey=${hex_pub_key};compressionType=none;returnType=signature;type=nip04_encrypt;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **nip44_encrypt**
|
- **nip44_encrypt**
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:${plainText}#Intent;scheme=nostrsigner;S.pubKey=${hex_pub_key};S.compressionType=none;S.returnType=signature;S.type=nip44_encrypt;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:${plainText}?pubKey=${hex_pub_key};compressionType=none;returnType=signature;type=nip44_encrypt;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **nip04_decrypt**
|
- **nip04_decrypt**
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:${encryptedText}#Intent;scheme=nostrsigner;S.pubKey=${hex_pub_key};S.compressionType=none;S.returnType=signature;S.type=nip04_decrypt;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:${encryptedText}?pubKey=${hex_pub_key};compressionType=none;returnType=signature;type=nip04_decrypt;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **nip44_decrypt**
|
- **nip44_decrypt**
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:${encryptedText}#Intent;scheme=nostrsigner;S.pubKey=${hex_pub_key};S.compressionType=none;S.returnType=signature;S.type=nip44_decrypt;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:${encryptedText}?pubKey=${hex_pub_key};compressionType=none;returnType=signature;type=nip44_decrypt;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- **decrypt_zap_event**
|
- **decrypt_zap_event**
|
||||||
- params:
|
- params:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const intent = `intent:${eventJson}#Intent;scheme=nostrsigner;S.compressionType=none;S.returnType=signature;S.type=decrypt_zap_event;S.callbackUrl=https://example.com/?event=;end`;
|
window.href = `nostrsigner:${eventJson}?compressionType=none;returnType=signature;type=decrypt_zap_event;callbackUrl=https://example.com/?event=`;
|
||||||
|
|
||||||
window.href = intent;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
@ -518,7 +504,7 @@ Android intents and browsers url has limitations, so if you are using the return
|
||||||
}
|
}
|
||||||
let encodedJson = encodeURIComponent(JSON.stringify(json))
|
let encodedJson = encodeURIComponent(JSON.stringify(json))
|
||||||
var newAnchor = document.createElement("a");
|
var newAnchor = document.createElement("a");
|
||||||
newAnchor.href = `intent:${encodedJson}#Intent;scheme=nostrsigner;S.compressionType=none;S.returnType=signature;S.type=sign_event;S.callbackUrl=https://example.com/?event=;end`;
|
newAnchor.href = `nostrsigner:${encodedJson}?compressionType=none;returnType=signature;type=sign_event;callbackUrl=https://example.com/?event=`;
|
||||||
newAnchor.textContent = "Open External Signer";
|
newAnchor.textContent = "Open External Signer";
|
||||||
document.body.appendChild(newAnchor)
|
document.body.appendChild(newAnchor)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user