@@ -4393,8 +4393,19 @@ public func FfiConverterTypeEvent_lower(_ value: Event) -> UnsafeMutableRawPoint
43934393
43944394public protocol EventBuilderProtocol: AnyObject {
43954395
4396- func none() async
4396+ /**
4397+ * Allow self-tagging
4398+ *
4399+ * When this mode is enabled, any `p` tags referencing the author’s public key will not be discarded.
4400+ */
4401+ func allowSelfTagging() -> EventBuilder
43974402
4403+ /**
4404+ * Build an unsigned event
4405+ *
4406+ * By default, this method removes any `p` tags that match the author's public key.
4407+ * To allow self-tagging, call [`EventBuilder::allow_self_tagging`] first.
4408+ */
43984409 func build(publicKey: PublicKey) -> UnsignedEvent
43994410
44004411 /**
@@ -4409,8 +4420,18 @@ public protocol EventBuilderProtocol: AnyObject {
44094420 */
44104421 func pow(difficulty: UInt8) -> EventBuilder
44114422
4423+ /**
4424+ * Build, sign and return [`Event`]
4425+ *
4426+ * Check [`EventBuilder::build`] to learn more.
4427+ */
44124428 func sign(signer: NostrSigner) async throws -> Event
44134429
4430+ /**
4431+ * Build, sign and return [`Event`] using [`Keys`] signer
4432+ *
4433+ * Check [`EventBuilder::build`] to learn more.
4434+ */
44144435 func signWithKeys(keys: Keys) throws -> Event
44154436
44164437 /**
@@ -5265,24 +5286,24 @@ public static func zapReceipt(bolt11: String, preimage: String?, zapRequest: Eve
52655286
52665287
52675288
5268- open func none()async {
5269- return
5270- try! await uniffiRustCallAsync(
5271- rustFutureFunc: {
5272- uniffi_nostr_sdk_ffi_fn_method_eventbuilder__none(
5273- self.uniffiClonePointer()
5274-
5275- )
5276- },
5277- pollFunc: ffi_nostr_sdk_ffi_rust_future_poll_void,
5278- completeFunc: ffi_nostr_sdk_ffi_rust_future_complete_void,
5279- freeFunc: ffi_nostr_sdk_ffi_rust_future_free_void,
5280- liftFunc: { $0 },
5281- errorHandler: nil
5282-
5283- )
5289+ /**
5290+ * Allow self-tagging
5291+ *
5292+ * When this mode is enabled, any `p` tags referencing the author’s public key will not be discarded.
5293+ */
5294+ open func allowSelfTagging() -> EventBuilder {
5295+ return try! FfiConverterTypeEventBuilder_lift(try! rustCall() {
5296+ uniffi_nostr_sdk_ffi_fn_method_eventbuilder_allow_self_tagging(self.uniffiClonePointer(),$0
5297+ )
5298+ })
52845299}
52855300
5301+ /**
5302+ * Build an unsigned event
5303+ *
5304+ * By default, this method removes any `p` tags that match the author's public key.
5305+ * To allow self-tagging, call [`EventBuilder::allow_self_tagging`] first.
5306+ */
52865307open func build(publicKey: PublicKey) -> UnsignedEvent {
52875308 return try! FfiConverterTypeUnsignedEvent_lift(try! rustCall() {
52885309 uniffi_nostr_sdk_ffi_fn_method_eventbuilder_build(self.uniffiClonePointer(),
@@ -5315,6 +5336,11 @@ open func pow(difficulty: UInt8) -> EventBuilder {
53155336})
53165337}
53175338
5339+ /**
5340+ * Build, sign and return [`Event`]
5341+ *
5342+ * Check [`EventBuilder::build`] to learn more.
5343+ */
53185344open func sign(signer: NostrSigner)async throws -> Event {
53195345 return
53205346 try await uniffiRustCallAsync(
@@ -5332,6 +5358,11 @@ open func sign(signer: NostrSigner)async throws -> Event {
53325358 )
53335359}
53345360
5361+ /**
5362+ * Build, sign and return [`Event`] using [`Keys`] signer
5363+ *
5364+ * Check [`EventBuilder::build`] to learn more.
5365+ */
53355366open func signWithKeys(keys: Keys)throws -> Event {
53365367 return try FfiConverterTypeEvent_lift(try rustCallWithError(FfiConverterTypeNostrSdkError_lift) {
53375368 uniffi_nostr_sdk_ffi_fn_method_eventbuilder_sign_with_keys(self.uniffiClonePointer(),
@@ -5673,16 +5704,20 @@ public protocol EventsProtocol: AnyObject {
56735704 /**
56745705 * Merge events collections into a single one.
56755706 *
5676- * Collection is converted to unbounded if one of the merge `Events` have a different hash.
5677- * In other words, the filters limit is respected only if the `Events` are related to the same
5707+ * This method consumes the object, making it unavailable for further use.
5708+ *
5709+ * Collection is converted to unbounded if one of the merge `Events` has a different hash.
5710+ * In other words, the filter limit is respected only if the `Events` are related to the same
56785711 * list of filters.
56795712 */
5680- func merge(other: Events) -> Events
5713+ func merge(other: Events) throws -> Events
56815714
56825715 /**
5683- * Convert collection to vector of events.
5716+ * Convert the collection to vector of events.
5717+ *
5718+ * This method consumes the object, making it unavailable for further use.
56845719 */
5685- func toVec() -> [Event]
5720+ func toVec() throws -> [Event]
56865721
56875722}
56885723
@@ -5782,23 +5817,27 @@ open func len() -> UInt64 {
57825817 /**
57835818 * Merge events collections into a single one.
57845819 *
5785- * Collection is converted to unbounded if one of the merge `Events` have a different hash.
5786- * In other words, the filters limit is respected only if the `Events` are related to the same
5820+ * This method consumes the object, making it unavailable for further use.
5821+ *
5822+ * Collection is converted to unbounded if one of the merge `Events` has a different hash.
5823+ * In other words, the filter limit is respected only if the `Events` are related to the same
57875824 * list of filters.
57885825 */
5789- open func merge(other: Events) -> Events {
5790- return try! FfiConverterTypeEvents_lift(try! rustCall( ) {
5826+ open func merge(other: Events)throws -> Events {
5827+ return try FfiConverterTypeEvents_lift(try rustCallWithError(FfiConverterTypeNostrSdkError_lift ) {
57915828 uniffi_nostr_sdk_ffi_fn_method_events_merge(self.uniffiClonePointer(),
57925829 FfiConverterTypeEvents_lower(other),$0
57935830 )
57945831})
57955832}
57965833
57975834 /**
5798- * Convert collection to vector of events.
5835+ * Convert the collection to vector of events.
5836+ *
5837+ * This method consumes the object, making it unavailable for further use.
57995838 */
5800- open func toVec() -> [Event] {
5801- return try! FfiConverterSequenceTypeEvent.lift(try! rustCall( ) {
5839+ open func toVec()throws -> [Event] {
5840+ return try FfiConverterSequenceTypeEvent.lift(try rustCallWithError(FfiConverterTypeNostrSdkError_lift ) {
58025841 uniffi_nostr_sdk_ffi_fn_method_events_to_vec(self.uniffiClonePointer(),$0
58035842 )
58045843})
@@ -32264,10 +32303,10 @@ private let initializationResult: InitializationResult = {
3226432303 if (uniffi_nostr_sdk_ffi_checksum_method_event_verify_signature() != 21120) {
3226532304 return InitializationResult.apiChecksumMismatch
3226632305 }
32267- if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder__none () != 7372 ) {
32306+ if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_allow_self_tagging () != 57727 ) {
3226832307 return InitializationResult.apiChecksumMismatch
3226932308 }
32270- if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_build() != 46818 ) {
32309+ if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_build() != 10100 ) {
3227132310 return InitializationResult.apiChecksumMismatch
3227232311 }
3227332312 if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_custom_created_at() != 20379) {
@@ -32276,10 +32315,10 @@ private let initializationResult: InitializationResult = {
3227632315 if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_pow() != 47148) {
3227732316 return InitializationResult.apiChecksumMismatch
3227832317 }
32279- if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_sign() != 18580 ) {
32318+ if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_sign() != 24133 ) {
3228032319 return InitializationResult.apiChecksumMismatch
3228132320 }
32282- if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_sign_with_keys() != 51348 ) {
32321+ if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_sign_with_keys() != 46872 ) {
3228332322 return InitializationResult.apiChecksumMismatch
3228432323 }
3228532324 if (uniffi_nostr_sdk_ffi_checksum_method_eventbuilder_tags() != 22610) {
@@ -32309,10 +32348,10 @@ private let initializationResult: InitializationResult = {
3230932348 if (uniffi_nostr_sdk_ffi_checksum_method_events_len() != 22082) {
3231032349 return InitializationResult.apiChecksumMismatch
3231132350 }
32312- if (uniffi_nostr_sdk_ffi_checksum_method_events_merge() != 7543 ) {
32351+ if (uniffi_nostr_sdk_ffi_checksum_method_events_merge() != 57155 ) {
3231332352 return InitializationResult.apiChecksumMismatch
3231432353 }
32315- if (uniffi_nostr_sdk_ffi_checksum_method_events_to_vec() != 15668 ) {
32354+ if (uniffi_nostr_sdk_ffi_checksum_method_events_to_vec() != 14351 ) {
3231632355 return InitializationResult.apiChecksumMismatch
3231732356 }
3231832357 if (uniffi_nostr_sdk_ffi_checksum_method_filemetadata_aes_256_gcm() != 15419) {
0 commit comments