@@ -556,7 +556,7 @@ public protocol ClientMessageProtocol : AnyObject {
556556 */
557557 func asEnum() -> ClientMessageEnum
558558
559- func asJson() -> String
559+ func asJson() throws -> String
560560
561561}
562562
@@ -694,8 +694,8 @@ open func asEnum() -> ClientMessageEnum {
694694})
695695}
696696
697- open func asJson() -> String {
698- return try! FfiConverterString.lift(try! rustCall( ) {
697+ open func asJson()throws -> String {
698+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
699699 uniffi_nostr_ffi_fn_method_clientmessage_as_json(self.uniffiClonePointer(),$0
700700 )
701701})
@@ -1347,7 +1347,7 @@ public func FfiConverterTypeEncryptedSecretKey_lower(_ value: EncryptedSecretKey
13471347
13481348public protocol EventProtocol : AnyObject {
13491349
1350- func asJson() -> String
1350+ func asJson() throws -> String
13511351
13521352 /**
13531353 * Get event author (`pubkey` field)
@@ -1510,8 +1510,8 @@ public static func fromJson(json: String)throws -> Event {
15101510
15111511
15121512
1513- open func asJson() -> String {
1514- return try! FfiConverterString.lift(try! rustCall( ) {
1513+ open func asJson()throws -> String {
1514+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
15151515 uniffi_nostr_ffi_fn_method_event_as_json(self.uniffiClonePointer(),$0
15161516 )
15171517})
@@ -2999,7 +2999,7 @@ public func FfiConverterTypeFileMetadata_lower(_ value: FileMetadata) -> UnsafeM
29992999
30003000public protocol FilterProtocol : AnyObject {
30013001
3002- func asJson() -> String
3002+ func asJson() throws -> String
30033003
30043004 func asRecord() -> FilterRecord
30053005
@@ -3163,8 +3163,8 @@ public static func fromRecord(record: FilterRecord) -> Filter {
31633163
31643164
31653165
3166- open func asJson() -> String {
3167- return try! FfiConverterString.lift(try! rustCall( ) {
3166+ open func asJson()throws -> String {
3167+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
31683168 uniffi_nostr_ffi_fn_method_filter_as_json(self.uniffiClonePointer(),$0
31693169 )
31703170})
@@ -4114,7 +4114,7 @@ public func FfiConverterTypeKind_lower(_ value: Kind) -> UnsafeMutableRawPointer
41144114
41154115public protocol MetadataProtocol : AnyObject {
41164116
4117- func asJson() -> String
4117+ func asJson() throws -> String
41184118
41194119 func asRecord() -> MetadataRecord
41204120
@@ -4226,8 +4226,8 @@ public static func fromRecord(r: MetadataRecord) -> Metadata {
42264226
42274227
42284228
4229- open func asJson() -> String {
4230- return try! FfiConverterString.lift(try! rustCall( ) {
4229+ open func asJson()throws -> String {
4230+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
42314231 uniffi_nostr_ffi_fn_method_metadata_as_json(self.uniffiClonePointer(),$0
42324232 )
42334233})
@@ -5117,7 +5117,7 @@ public protocol NostrConnectMetadataProtocol : AnyObject {
51175117 /**
51185118 * Serialize as JSON string
51195119 */
5120- func asJson() -> String
5120+ func asJson() throws -> String
51215121
51225122 /**
51235123 * Description of the `App`
@@ -5194,8 +5194,8 @@ public convenience init(name: String) {
51945194 /**
51955195 * Serialize as JSON string
51965196 */
5197- open func asJson() -> String {
5198- return try! FfiConverterString.lift(try! rustCall( ) {
5197+ open func asJson()throws -> String {
5198+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
51995199 uniffi_nostr_ffi_fn_method_nostrconnectmetadata_as_json(self.uniffiClonePointer(),$0
52005200 )
52015201})
@@ -5950,7 +5950,7 @@ public func FfiConverterTypePublicKey_lower(_ value: PublicKey) -> UnsafeMutable
59505950
59515951public protocol RawEventProtocol : AnyObject {
59525952
5953- func asJson() -> String
5953+ func asJson() throws -> String
59545954
59555955 func asRecord() -> RawEventRecord
59565956
@@ -6016,8 +6016,8 @@ public static func fromRecord(r: RawEventRecord) -> RawEvent {
60166016
60176017
60186018
6019- open func asJson() -> String {
6020- return try! FfiConverterString.lift(try! rustCall( ) {
6019+ open func asJson()throws -> String {
6020+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
60216021 uniffi_nostr_ffi_fn_method_rawevent_as_json(self.uniffiClonePointer(),$0
60226022 )
60236023})
@@ -6396,7 +6396,7 @@ public protocol RelayMessageProtocol : AnyObject {
63966396 */
63976397 func asEnum() -> RelayMessageEnum
63986398
6399- func asJson() -> String
6399+ func asJson() throws -> String
64006400
64016401}
64026402
@@ -6560,8 +6560,8 @@ open func asEnum() -> RelayMessageEnum {
65606560})
65616561}
65626562
6563- open func asJson() -> String {
6564- return try! FfiConverterString.lift(try! rustCall( ) {
6563+ open func asJson()throws -> String {
6564+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
65656565 uniffi_nostr_ffi_fn_method_relaymessage_as_json(self.uniffiClonePointer(),$0
65666566 )
65676567})
@@ -7429,7 +7429,7 @@ public func FfiConverterTypeSingleLetterTag_lower(_ value: SingleLetterTag) -> U
74297429
74307430public protocol StallDataProtocol : AnyObject {
74317431
7432- func asJson() -> String
7432+ func asJson() throws -> String
74337433
74347434 func asRecord() -> StallDataRecord
74357435
@@ -7514,8 +7514,8 @@ public static func fromRecord(r: StallDataRecord) -> StallData {
75147514
75157515
75167516
7517- open func asJson() -> String {
7518- return try! FfiConverterString.lift(try! rustCall( ) {
7517+ open func asJson()throws -> String {
7518+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
75197519 uniffi_nostr_ffi_fn_method_stalldata_as_json(self.uniffiClonePointer(),$0
75207520 )
75217521})
@@ -8178,7 +8178,7 @@ public protocol UnsignedEventProtocol : AnyObject {
81788178 */
81798179 func addSignature(sig: String) throws -> Event
81808180
8181- func asJson() -> String
8181+ func asJson() throws -> String
81828182
81838183 func author() -> PublicKey
81848184
@@ -8266,8 +8266,8 @@ open func addSignature(sig: String)throws -> Event {
82668266})
82678267}
82688268
8269- open func asJson() -> String {
8270- return try! FfiConverterString.lift(try! rustCall( ) {
8269+ open func asJson()throws -> String {
8270+ return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift ) {
82718271 uniffi_nostr_ffi_fn_method_unsignedevent_as_json(self.uniffiClonePointer(),$0
82728272 )
82738273})
@@ -18224,7 +18224,7 @@ private var initializationResult: InitializationResult {
1822418224 if (uniffi_nostr_ffi_checksum_method_clientmessage_as_enum() != 33173) {
1822518225 return InitializationResult.apiChecksumMismatch
1822618226 }
18227- if (uniffi_nostr_ffi_checksum_method_clientmessage_as_json() != 2801 ) {
18227+ if (uniffi_nostr_ffi_checksum_method_clientmessage_as_json() != 25711 ) {
1822818228 return InitializationResult.apiChecksumMismatch
1822918229 }
1823018230 if (uniffi_nostr_ffi_checksum_method_contact_alias() != 19227) {
@@ -18266,7 +18266,7 @@ private var initializationResult: InitializationResult {
1826618266 if (uniffi_nostr_ffi_checksum_method_encryptedsecretkey_version() != 27626) {
1826718267 return InitializationResult.apiChecksumMismatch
1826818268 }
18269- if (uniffi_nostr_ffi_checksum_method_event_as_json() != 13177 ) {
18269+ if (uniffi_nostr_ffi_checksum_method_event_as_json() != 6443 ) {
1827018270 return InitializationResult.apiChecksumMismatch
1827118271 }
1827218272 if (uniffi_nostr_ffi_checksum_method_event_author() != 55205) {
@@ -18380,7 +18380,7 @@ private var initializationResult: InitializationResult {
1838018380 if (uniffi_nostr_ffi_checksum_method_filemetadata_size() != 25033) {
1838118381 return InitializationResult.apiChecksumMismatch
1838218382 }
18383- if (uniffi_nostr_ffi_checksum_method_filter_as_json() != 460 ) {
18383+ if (uniffi_nostr_ffi_checksum_method_filter_as_json() != 2504 ) {
1838418384 return InitializationResult.apiChecksumMismatch
1838518385 }
1838618386 if (uniffi_nostr_ffi_checksum_method_filter_as_record() != 10817) {
@@ -18518,7 +18518,7 @@ private var initializationResult: InitializationResult {
1851818518 if (uniffi_nostr_ffi_checksum_method_kind_as_u64() != 51642) {
1851918519 return InitializationResult.apiChecksumMismatch
1852018520 }
18521- if (uniffi_nostr_ffi_checksum_method_metadata_as_json() != 65508 ) {
18521+ if (uniffi_nostr_ffi_checksum_method_metadata_as_json() != 49741 ) {
1852218522 return InitializationResult.apiChecksumMismatch
1852318523 }
1852418524 if (uniffi_nostr_ffi_checksum_method_metadata_as_record() != 14817) {
@@ -18620,7 +18620,7 @@ private var initializationResult: InitializationResult {
1862018620 if (uniffi_nostr_ffi_checksum_method_nip21_to_nostr_uri() != 50917) {
1862118621 return InitializationResult.apiChecksumMismatch
1862218622 }
18623- if (uniffi_nostr_ffi_checksum_method_nostrconnectmetadata_as_json() != 44995 ) {
18623+ if (uniffi_nostr_ffi_checksum_method_nostrconnectmetadata_as_json() != 46001 ) {
1862418624 return InitializationResult.apiChecksumMismatch
1862518625 }
1862618626 if (uniffi_nostr_ffi_checksum_method_nostrconnectmetadata_description() != 20591) {
@@ -18659,7 +18659,7 @@ private var initializationResult: InitializationResult {
1865918659 if (uniffi_nostr_ffi_checksum_method_publickey_to_nostr_uri() != 23126) {
1866018660 return InitializationResult.apiChecksumMismatch
1866118661 }
18662- if (uniffi_nostr_ffi_checksum_method_rawevent_as_json() != 48986 ) {
18662+ if (uniffi_nostr_ffi_checksum_method_rawevent_as_json() != 12712 ) {
1866318663 return InitializationResult.apiChecksumMismatch
1866418664 }
1866518665 if (uniffi_nostr_ffi_checksum_method_rawevent_as_record() != 15974) {
@@ -18716,7 +18716,7 @@ private var initializationResult: InitializationResult {
1871618716 if (uniffi_nostr_ffi_checksum_method_relaymessage_as_enum() != 56517) {
1871718717 return InitializationResult.apiChecksumMismatch
1871818718 }
18719- if (uniffi_nostr_ffi_checksum_method_relaymessage_as_json() != 58619 ) {
18719+ if (uniffi_nostr_ffi_checksum_method_relaymessage_as_json() != 2111 ) {
1872018720 return InitializationResult.apiChecksumMismatch
1872118721 }
1872218722 if (uniffi_nostr_ffi_checksum_method_request_method() != 18547) {
@@ -18749,7 +18749,7 @@ private var initializationResult: InitializationResult {
1874918749 if (uniffi_nostr_ffi_checksum_method_singlelettertag_is_uppercase() != 50218) {
1875018750 return InitializationResult.apiChecksumMismatch
1875118751 }
18752- if (uniffi_nostr_ffi_checksum_method_stalldata_as_json() != 23354 ) {
18752+ if (uniffi_nostr_ffi_checksum_method_stalldata_as_json() != 14021 ) {
1875318753 return InitializationResult.apiChecksumMismatch
1875418754 }
1875518755 if (uniffi_nostr_ffi_checksum_method_stalldata_as_record() != 56802) {
@@ -18797,7 +18797,7 @@ private var initializationResult: InitializationResult {
1879718797 if (uniffi_nostr_ffi_checksum_method_unsignedevent_add_signature() != 65391) {
1879818798 return InitializationResult.apiChecksumMismatch
1879918799 }
18800- if (uniffi_nostr_ffi_checksum_method_unsignedevent_as_json() != 632 ) {
18800+ if (uniffi_nostr_ffi_checksum_method_unsignedevent_as_json() != 44697 ) {
1880118801 return InitializationResult.apiChecksumMismatch
1880218802 }
1880318803 if (uniffi_nostr_ffi_checksum_method_unsignedevent_author() != 15518) {
0 commit comments