Skip to content

Commit 6753e1a

Browse files
committed
Expose EventBuilder::gift_wrap
1 parent 0cea884 commit 6753e1a

File tree

5 files changed

+384
-218
lines changed

5 files changed

+384
-218
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* Expose `Client::fetch_events` ([Yuki Kishimoto])
3737
* Expose `EventBuilder::seal` ([Yuki Kishimoto])
3838
* Expose `EventBuilder::gift_wrap_from_seal` ([Yuki Kishimoto])
39+
* Expose `EventBuilder::gift_wrap` ([Yuki Kishimoto])
3940

4041
### Fixed
4142

lib/src/rust/api/protocol/event/builder.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ abstract class EventBuilder implements RustOpaqueInterface {
2020
/// Set a custom `created_at` UNIX timestamp
2121
EventBuilder customCreatedAt({required BigInt createdAt});
2222

23+
/// Gift Wrap
24+
///
25+
/// <https://github.com/nostr-protocol/nips/blob/master/59.md>
26+
static Future<Event> giftWrap(
27+
{required NostrSigner signer,
28+
required PublicKey receiver,
29+
required UnsignedEvent rumor,
30+
required List<Tag> extraTags}) =>
31+
NostrSdk.instance.api.crateApiProtocolEventBuilderEventBuilderGiftWrap(
32+
signer: signer,
33+
receiver: receiver,
34+
rumor: rumor,
35+
extraTags: extraTags);
36+
2337
/// Gift Wrap from seal
2438
///
2539
/// <https://github.com/nostr-protocol/nips/blob/master/59.md>
@@ -46,10 +60,10 @@ abstract class EventBuilder implements RustOpaqueInterface {
4660
/// <https://github.com/nostr-protocol/nips/blob/master/59.md>
4761
static Future<EventBuilder> seal(
4862
{required NostrSigner signer,
49-
required PublicKey receiverPubkey,
63+
required PublicKey receiver,
5064
required UnsignedEvent rumor}) =>
5165
NostrSdk.instance.api.crateApiProtocolEventBuilderEventBuilderSeal(
52-
signer: signer, receiverPubkey: receiverPubkey, rumor: rumor);
66+
signer: signer, receiver: receiver, rumor: rumor);
5367

5468
/// Build, sign and return event
5569
Future<Event> sign({required NostrSigner signer});

0 commit comments

Comments
 (0)