-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from okada-takuya/translate-nip07
Translate nip07
- Loading branch information
Showing
2 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
NIP-07 | ||
====== | ||
|
||
`window.nostr` capability for web browsers | ||
Webブラウザ向け`window.nostr`機能 | ||
------------------------------------------ | ||
|
||
`draft` `optional` | ||
|
||
The `window.nostr` object may be made available by web browsers or extensions and websites or web-apps may make use of it after checking its availability. | ||
`window.nostr`オブジェクトはWebブラウザや拡張機能により作成される。WebサイトやWebアプリケーションは利用可能性を確認した上で、このオブジェクトを利用してもよい。 | ||
|
||
That object must define the following methods: | ||
このオブジェクトは下記のメソッドを定義せねばならない: | ||
|
||
``` | ||
async window.nostr.getPublicKey(): string // returns a public key as hex | ||
async window.nostr.signEvent(event: { created_at: number, kind: number, tags: string[][], content: string }): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it | ||
``` | ||
|
||
Aside from these two basic above, the following functions can also be implemented optionally: | ||
上記2つのメソッドの他に、オプションとして下記のメソッドを定義してもよい。 | ||
``` | ||
async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies | ||
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 (deprecated) | ||
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 (deprecated) | ||
``` | ||
|
||
### Implementation | ||
### 実装 | ||
|
||
See https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions. | ||
https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions を参照する。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters