|
| 1 | +// This file is automatically generated, so please do not edit it. |
| 2 | +// Generated by `flutter_rust_bridge`@ 2.0.0. |
| 3 | + |
| 4 | +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import |
| 5 | + |
| 6 | +import '../../../frb_generated.dart'; |
| 7 | +import '../event.dart'; |
| 8 | +import '../key.dart'; |
| 9 | +import '../key/public_key.dart'; |
| 10 | +import '../signer.dart'; |
| 11 | +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; |
| 12 | +import 'tag.dart'; |
| 13 | +import 'unsigned.dart'; |
| 14 | + |
| 15 | +// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<_EventBuilder>> |
| 16 | +abstract class EventBuilder implements RustOpaqueInterface { |
| 17 | + /// Build unsigned event |
| 18 | + UnsignedEvent build({required PublicKey publicKey}); |
| 19 | + |
| 20 | + /// Set a custom `created_at` UNIX timestamp |
| 21 | + EventBuilder customCreatedAt({required BigInt createdAt}); |
| 22 | + |
| 23 | + /// New event builder |
| 24 | + factory EventBuilder({required int kind, required String content}) => |
| 25 | + NostrSdk.instance.api.crateApiProtocolEventBuilderEventBuilderNew( |
| 26 | + kind: kind, content: content); |
| 27 | + |
| 28 | + /// Set POW difficulty |
| 29 | + /// |
| 30 | + /// Only values `> 0` are accepted! |
| 31 | + EventBuilder pow({required int difficulty}); |
| 32 | + |
| 33 | + /// Build, sign and return event |
| 34 | + Future<Event> sign({required NostrSigner signer}); |
| 35 | + |
| 36 | + /// Build, sign and return event using keys signer |
| 37 | + Event signWithKeys({required Keys keys}); |
| 38 | + |
| 39 | + /// Add tag |
| 40 | + EventBuilder tag({required Tag tag}); |
| 41 | + |
| 42 | + /// Add tags |
| 43 | + /// |
| 44 | + /// This method extends the current tags (if any). |
| 45 | + EventBuilder tags({required List<Tag> tags}); |
| 46 | + |
| 47 | + /// Text note |
| 48 | + /// |
| 49 | + /// <https://github.com/nostr-protocol/nips/blob/master/01.md> |
| 50 | + static EventBuilder textNote({required String content}) => |
| 51 | + NostrSdk.instance.api |
| 52 | + .crateApiProtocolEventBuilderEventBuilderTextNote(content: content); |
| 53 | +} |
0 commit comments