nostr-tools 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +4 -2
- package/README.md +11 -1
- package/justfile +3 -0
- package/lib/nostr.bundle.js +416 -1198
- package/lib/nostr.bundle.js.map +4 -4
- package/lib/nostr.cjs.js +23 -17
- package/lib/nostr.cjs.js.map +2 -2
- package/lib/nostr.esm.js +23 -17
- package/lib/nostr.esm.js.map +2 -2
- package/package.json +15 -14
- package/pool.test.js +11 -1
- package/pool.ts +23 -15
- package/relay.ts +3 -3
- package/lib/nostr.js.map +0 -7
- package/magic.ts +0 -140
package/README.md
CHANGED
|
@@ -128,7 +128,7 @@ import 'websocket-polyfill'
|
|
|
128
128
|
### Interacting with multiple relays
|
|
129
129
|
|
|
130
130
|
```js
|
|
131
|
-
import {
|
|
131
|
+
import {SimplePool} from 'nostr-tools'
|
|
132
132
|
|
|
133
133
|
const pool = new SimplePool()
|
|
134
134
|
|
|
@@ -158,6 +158,11 @@ let events = await pool.list(relays, [{kinds: [0, 1]}])
|
|
|
158
158
|
let event = await pool.get(relays, {
|
|
159
159
|
ids: ['44e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245']
|
|
160
160
|
})
|
|
161
|
+
|
|
162
|
+
let relaysForEvent = pool.seenOn(
|
|
163
|
+
'44e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245'
|
|
164
|
+
)
|
|
165
|
+
// relaysForEvent will be an array of URLs from relays a given event was seen on
|
|
161
166
|
```
|
|
162
167
|
|
|
163
168
|
### Querying profile data from a NIP-05 address
|
|
@@ -288,6 +293,11 @@ Please consult the tests or [the source code](https://github.com/fiatjaf/nostr-t
|
|
|
288
293
|
</script>
|
|
289
294
|
```
|
|
290
295
|
|
|
296
|
+
## Plumbing
|
|
297
|
+
|
|
298
|
+
1. Install [`just`](https://just.systems/)
|
|
299
|
+
2. `just -l`
|
|
300
|
+
|
|
291
301
|
## License
|
|
292
302
|
|
|
293
303
|
Public domain.
|