forked from nostr-dev-kit/ndk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize which relays are set on zap requests
- Loading branch information
Showing
14 changed files
with
296 additions
and
172 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@nostr-dev-kit/ndk": patch | ||
--- | ||
|
||
fix bug where queued items were not getting processed (e.g. zap fetches) |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@nostr-dev-kit/ndk": patch | ||
--- | ||
|
||
Breaking change: event.zap is now removed, use ndk.zap(event) instead |
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 |
---|---|---|
|
@@ -323,16 +323,18 @@ await ndk.publish(event); | |
|
||
```ts | ||
// Find the first event from @jack, and react/like it. | ||
const event = await ndk.fetchEvent({ author: "[email protected]" })[0]; | ||
const jack = await ndk.getUserFromNip05("[email protected]"); | ||
const event = await ndk.fetchEvent({ authors: [jack.pubkey] })[0]; | ||
await event.react("🤙"); | ||
``` | ||
|
||
### Zap an event | ||
|
||
```ts | ||
// Find the first event from @jack, and zap it. | ||
const event = await ndk.fetchEvent({ author: "[email protected]" })[0]; | ||
await event.zap(1337, "Zapping your post!"); // Returns a bolt11 payment request | ||
const jack = await ndk.getUserFromNip05("[email protected]"); | ||
const event = await ndk.fetchEvent({ authors: [jack.pubkey] })[0]; | ||
await ndk.zap(event, 1337, "Zapping your post!"); // Returns a bolt11 payment request | ||
``` | ||
|
||
## Architecture decisions & suggestions | ||
|
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
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
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
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
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
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
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
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
Oops, something went wrong.