0.17.0 • Published 9 months ago

@nostr-fetch/adapter-ndk v0.17.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

@nostr-fetch/adapter-ndk

This package includes the adapter for NDK(Nostr Dev Kit) which allows it to work with nostr-fetch, a utility library for fetching past events from Nostr relays.

If you want to use nostr-fetch, here is a good start point!

Example

import NDK from '@nostr-dev-kit/ndk';
import { NostrFetcher, normalizeRelayUrlSet } from 'nostr-fetch';
import { ndkAdapter } from '@nostr-fetch/adapter-ndk';

// You should normalize a set of relay URLs by `normalizeRelayUrlSet` before passing them to NDK's constructor if working with nostr-fetch!
const explicitRelays = normalizeRelayUrlSet([
    "wss://relay-jp.nostr.wirednet.jp",
    "wss://relay.damus.io",
]);

const main = async () => {
    const ndk = new NDK({ explicitRelayUrls: explicitRelays });
    await ndk.connect(); // ensure connections to the "explicit relays" before fetching events!

    const fetcher = NostrFetcher.withCustomPool(ndkAdapter(ndk));
    // ...
}

Minimum Supported Version of NDK

adapter versionNDK version
< 0.13.00.7.5
>= 0.13.0 && < 0.14.10.8.4
>= 0.14.11.0.0
0.16.0

9 months ago

0.17.0

9 months ago

0.15.1

1 year ago

0.15.0

2 years ago

0.14.0

2 years ago

0.14.1

2 years ago

0.10.0

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.12.0

2 years ago

0.13.0

2 years ago

0.12.1

2 years ago

0.13.1

2 years ago

0.12.2

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago