mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
rename Nip07 to WindowNostr.
This commit is contained in:
@@ -30,7 +30,7 @@ To get the secret key in hex format, use
|
|||||||
```js
|
```js
|
||||||
import { bytesToHex, hexToBytes } from '@noble/hashes/utils' // already an installed dependency
|
import { bytesToHex, hexToBytes } from '@noble/hashes/utils' // already an installed dependency
|
||||||
|
|
||||||
let skHex = bytesToHex(sk)
|
let skHex = bytesToHex(sk)
|
||||||
let backToBytes = hexToBytes(skHex)
|
let backToBytes = hexToBytes(skHex)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -185,11 +185,11 @@ useFetchImplementation(require('node-fetch'))
|
|||||||
|
|
||||||
### Including NIP-07 types
|
### Including NIP-07 types
|
||||||
```js
|
```js
|
||||||
import { Nip07 } from 'nostr-tools/nip07'
|
import type { WindowNostr } from 'nostr-tools/nip07'
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
nostr?: Nip07;
|
nostr?: WindowNostr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
1
index.ts
1
index.ts
@@ -6,7 +6,6 @@ export * from './references.ts'
|
|||||||
|
|
||||||
export * as nip04 from './nip04.ts'
|
export * as nip04 from './nip04.ts'
|
||||||
export * as nip05 from './nip05.ts'
|
export * as nip05 from './nip05.ts'
|
||||||
export * as nip07 from './nip07.ts'
|
|
||||||
export * as nip10 from './nip10.ts'
|
export * as nip10 from './nip10.ts'
|
||||||
export * as nip11 from './nip11.ts'
|
export * as nip11 from './nip11.ts'
|
||||||
export * as nip13 from './nip13.ts'
|
export * as nip13 from './nip13.ts'
|
||||||
|
|||||||
2
nip07.ts
2
nip07.ts
@@ -1,7 +1,7 @@
|
|||||||
import { EventTemplate, NostrEvent } from './core.ts'
|
import { EventTemplate, NostrEvent } from './core.ts'
|
||||||
import { RelayRecord } from './index.ts'
|
import { RelayRecord } from './index.ts'
|
||||||
|
|
||||||
export interface Nip07 {
|
export interface WindowNostr {
|
||||||
getPublicKey(): Promise<string>
|
getPublicKey(): Promise<string>
|
||||||
signEvent(event: EventTemplate): Promise<NostrEvent>
|
signEvent(event: EventTemplate): Promise<NostrEvent>
|
||||||
getRelays(): Promise<RelayRecord>
|
getRelays(): Promise<RelayRecord>
|
||||||
|
|||||||
Reference in New Issue
Block a user