|
| 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 '../key/public_key.dart'; |
| 8 | +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; |
| 9 | +import 'tag.dart'; |
| 10 | + |
| 11 | +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from` |
| 12 | + |
| 13 | +// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<_EventId>> |
| 14 | +abstract class EventId implements RustOpaqueInterface { |
| 15 | + /// Parse from bytes |
| 16 | + static EventId fromSlice({required List<int> bytes}) => NostrSdk.instance.api |
| 17 | + .crateApiProtocolEventIdEventIdFromSlice(bytes: bytes); |
| 18 | + |
| 19 | + factory EventId( |
| 20 | + {required PublicKey publicKey, |
| 21 | + required BigInt createdAt, |
| 22 | + required int kind, |
| 23 | + required List<Tag> tags, |
| 24 | + required String content}) => |
| 25 | + NostrSdk.instance.api.crateApiProtocolEventIdEventIdNew( |
| 26 | + publicKey: publicKey, |
| 27 | + createdAt: createdAt, |
| 28 | + kind: kind, |
| 29 | + tags: tags, |
| 30 | + content: content); |
| 31 | + |
| 32 | + /// Try to parse event ID from `hex`, `bech32` or [NIP21](https://github.com/nostr-protocol/nips/blob/master/21.md) uri |
| 33 | + static EventId parse({required String id}) => |
| 34 | + NostrSdk.instance.api.crateApiProtocolEventIdEventIdParse(id: id); |
| 35 | + |
| 36 | + /// Serialize to bech32 |
| 37 | + String toBech32(); |
| 38 | + |
| 39 | + /// Get bytes |
| 40 | + Uint8List toBytes(); |
| 41 | + |
| 42 | + /// Serialize to hex |
| 43 | + String toHex(); |
| 44 | + |
| 45 | + /// Serialize as nostr URI |
| 46 | + String toNostrUri(); |
| 47 | +} |
0 commit comments