@@ -556,7 +556,7 @@ public protocol ClientMessageProtocol : AnyObject {
556
556
*/
557
557
func asEnum() -> ClientMessageEnum
558
558
559
- func asJson() -> String
559
+ func asJson() throws -> String
560
560
561
561
}
562
562
@@ -694,8 +694,8 @@ open func asEnum() -> ClientMessageEnum {
694
694
})
695
695
}
696
696
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 ) {
699
699
uniffi_nostr_ffi_fn_method_clientmessage_as_json(self.uniffiClonePointer(),$0
700
700
)
701
701
})
@@ -1347,7 +1347,7 @@ public func FfiConverterTypeEncryptedSecretKey_lower(_ value: EncryptedSecretKey
1347
1347
1348
1348
public protocol EventProtocol : AnyObject {
1349
1349
1350
- func asJson() -> String
1350
+ func asJson() throws -> String
1351
1351
1352
1352
/**
1353
1353
* Get event author (`pubkey` field)
@@ -1510,8 +1510,8 @@ public static func fromJson(json: String)throws -> Event {
1510
1510
1511
1511
1512
1512
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 ) {
1515
1515
uniffi_nostr_ffi_fn_method_event_as_json(self.uniffiClonePointer(),$0
1516
1516
)
1517
1517
})
@@ -2999,7 +2999,7 @@ public func FfiConverterTypeFileMetadata_lower(_ value: FileMetadata) -> UnsafeM
2999
2999
3000
3000
public protocol FilterProtocol : AnyObject {
3001
3001
3002
- func asJson() -> String
3002
+ func asJson() throws -> String
3003
3003
3004
3004
func asRecord() -> FilterRecord
3005
3005
@@ -3163,8 +3163,8 @@ public static func fromRecord(record: FilterRecord) -> Filter {
3163
3163
3164
3164
3165
3165
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 ) {
3168
3168
uniffi_nostr_ffi_fn_method_filter_as_json(self.uniffiClonePointer(),$0
3169
3169
)
3170
3170
})
@@ -4114,7 +4114,7 @@ public func FfiConverterTypeKind_lower(_ value: Kind) -> UnsafeMutableRawPointer
4114
4114
4115
4115
public protocol MetadataProtocol : AnyObject {
4116
4116
4117
- func asJson() -> String
4117
+ func asJson() throws -> String
4118
4118
4119
4119
func asRecord() -> MetadataRecord
4120
4120
@@ -4226,8 +4226,8 @@ public static func fromRecord(r: MetadataRecord) -> Metadata {
4226
4226
4227
4227
4228
4228
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 ) {
4231
4231
uniffi_nostr_ffi_fn_method_metadata_as_json(self.uniffiClonePointer(),$0
4232
4232
)
4233
4233
})
@@ -5117,7 +5117,7 @@ public protocol NostrConnectMetadataProtocol : AnyObject {
5117
5117
/**
5118
5118
* Serialize as JSON string
5119
5119
*/
5120
- func asJson() -> String
5120
+ func asJson() throws -> String
5121
5121
5122
5122
/**
5123
5123
* Description of the `App`
@@ -5194,8 +5194,8 @@ public convenience init(name: String) {
5194
5194
/**
5195
5195
* Serialize as JSON string
5196
5196
*/
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 ) {
5199
5199
uniffi_nostr_ffi_fn_method_nostrconnectmetadata_as_json(self.uniffiClonePointer(),$0
5200
5200
)
5201
5201
})
@@ -5950,7 +5950,7 @@ public func FfiConverterTypePublicKey_lower(_ value: PublicKey) -> UnsafeMutable
5950
5950
5951
5951
public protocol RawEventProtocol : AnyObject {
5952
5952
5953
- func asJson() -> String
5953
+ func asJson() throws -> String
5954
5954
5955
5955
func asRecord() -> RawEventRecord
5956
5956
@@ -6016,8 +6016,8 @@ public static func fromRecord(r: RawEventRecord) -> RawEvent {
6016
6016
6017
6017
6018
6018
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 ) {
6021
6021
uniffi_nostr_ffi_fn_method_rawevent_as_json(self.uniffiClonePointer(),$0
6022
6022
)
6023
6023
})
@@ -6396,7 +6396,7 @@ public protocol RelayMessageProtocol : AnyObject {
6396
6396
*/
6397
6397
func asEnum() -> RelayMessageEnum
6398
6398
6399
- func asJson() -> String
6399
+ func asJson() throws -> String
6400
6400
6401
6401
}
6402
6402
@@ -6560,8 +6560,8 @@ open func asEnum() -> RelayMessageEnum {
6560
6560
})
6561
6561
}
6562
6562
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 ) {
6565
6565
uniffi_nostr_ffi_fn_method_relaymessage_as_json(self.uniffiClonePointer(),$0
6566
6566
)
6567
6567
})
@@ -7429,7 +7429,7 @@ public func FfiConverterTypeSingleLetterTag_lower(_ value: SingleLetterTag) -> U
7429
7429
7430
7430
public protocol StallDataProtocol : AnyObject {
7431
7431
7432
- func asJson() -> String
7432
+ func asJson() throws -> String
7433
7433
7434
7434
func asRecord() -> StallDataRecord
7435
7435
@@ -7514,8 +7514,8 @@ public static func fromRecord(r: StallDataRecord) -> StallData {
7514
7514
7515
7515
7516
7516
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 ) {
7519
7519
uniffi_nostr_ffi_fn_method_stalldata_as_json(self.uniffiClonePointer(),$0
7520
7520
)
7521
7521
})
@@ -8178,7 +8178,7 @@ public protocol UnsignedEventProtocol : AnyObject {
8178
8178
*/
8179
8179
func addSignature(sig: String) throws -> Event
8180
8180
8181
- func asJson() -> String
8181
+ func asJson() throws -> String
8182
8182
8183
8183
func author() -> PublicKey
8184
8184
@@ -8266,8 +8266,8 @@ open func addSignature(sig: String)throws -> Event {
8266
8266
})
8267
8267
}
8268
8268
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 ) {
8271
8271
uniffi_nostr_ffi_fn_method_unsignedevent_as_json(self.uniffiClonePointer(),$0
8272
8272
)
8273
8273
})
@@ -18224,7 +18224,7 @@ private var initializationResult: InitializationResult {
18224
18224
if (uniffi_nostr_ffi_checksum_method_clientmessage_as_enum() != 33173) {
18225
18225
return InitializationResult.apiChecksumMismatch
18226
18226
}
18227
- if (uniffi_nostr_ffi_checksum_method_clientmessage_as_json() != 2801 ) {
18227
+ if (uniffi_nostr_ffi_checksum_method_clientmessage_as_json() != 25711 ) {
18228
18228
return InitializationResult.apiChecksumMismatch
18229
18229
}
18230
18230
if (uniffi_nostr_ffi_checksum_method_contact_alias() != 19227) {
@@ -18266,7 +18266,7 @@ private var initializationResult: InitializationResult {
18266
18266
if (uniffi_nostr_ffi_checksum_method_encryptedsecretkey_version() != 27626) {
18267
18267
return InitializationResult.apiChecksumMismatch
18268
18268
}
18269
- if (uniffi_nostr_ffi_checksum_method_event_as_json() != 13177 ) {
18269
+ if (uniffi_nostr_ffi_checksum_method_event_as_json() != 6443 ) {
18270
18270
return InitializationResult.apiChecksumMismatch
18271
18271
}
18272
18272
if (uniffi_nostr_ffi_checksum_method_event_author() != 55205) {
@@ -18380,7 +18380,7 @@ private var initializationResult: InitializationResult {
18380
18380
if (uniffi_nostr_ffi_checksum_method_filemetadata_size() != 25033) {
18381
18381
return InitializationResult.apiChecksumMismatch
18382
18382
}
18383
- if (uniffi_nostr_ffi_checksum_method_filter_as_json() != 460 ) {
18383
+ if (uniffi_nostr_ffi_checksum_method_filter_as_json() != 2504 ) {
18384
18384
return InitializationResult.apiChecksumMismatch
18385
18385
}
18386
18386
if (uniffi_nostr_ffi_checksum_method_filter_as_record() != 10817) {
@@ -18518,7 +18518,7 @@ private var initializationResult: InitializationResult {
18518
18518
if (uniffi_nostr_ffi_checksum_method_kind_as_u64() != 51642) {
18519
18519
return InitializationResult.apiChecksumMismatch
18520
18520
}
18521
- if (uniffi_nostr_ffi_checksum_method_metadata_as_json() != 65508 ) {
18521
+ if (uniffi_nostr_ffi_checksum_method_metadata_as_json() != 49741 ) {
18522
18522
return InitializationResult.apiChecksumMismatch
18523
18523
}
18524
18524
if (uniffi_nostr_ffi_checksum_method_metadata_as_record() != 14817) {
@@ -18620,7 +18620,7 @@ private var initializationResult: InitializationResult {
18620
18620
if (uniffi_nostr_ffi_checksum_method_nip21_to_nostr_uri() != 50917) {
18621
18621
return InitializationResult.apiChecksumMismatch
18622
18622
}
18623
- if (uniffi_nostr_ffi_checksum_method_nostrconnectmetadata_as_json() != 44995 ) {
18623
+ if (uniffi_nostr_ffi_checksum_method_nostrconnectmetadata_as_json() != 46001 ) {
18624
18624
return InitializationResult.apiChecksumMismatch
18625
18625
}
18626
18626
if (uniffi_nostr_ffi_checksum_method_nostrconnectmetadata_description() != 20591) {
@@ -18659,7 +18659,7 @@ private var initializationResult: InitializationResult {
18659
18659
if (uniffi_nostr_ffi_checksum_method_publickey_to_nostr_uri() != 23126) {
18660
18660
return InitializationResult.apiChecksumMismatch
18661
18661
}
18662
- if (uniffi_nostr_ffi_checksum_method_rawevent_as_json() != 48986 ) {
18662
+ if (uniffi_nostr_ffi_checksum_method_rawevent_as_json() != 12712 ) {
18663
18663
return InitializationResult.apiChecksumMismatch
18664
18664
}
18665
18665
if (uniffi_nostr_ffi_checksum_method_rawevent_as_record() != 15974) {
@@ -18716,7 +18716,7 @@ private var initializationResult: InitializationResult {
18716
18716
if (uniffi_nostr_ffi_checksum_method_relaymessage_as_enum() != 56517) {
18717
18717
return InitializationResult.apiChecksumMismatch
18718
18718
}
18719
- if (uniffi_nostr_ffi_checksum_method_relaymessage_as_json() != 58619 ) {
18719
+ if (uniffi_nostr_ffi_checksum_method_relaymessage_as_json() != 2111 ) {
18720
18720
return InitializationResult.apiChecksumMismatch
18721
18721
}
18722
18722
if (uniffi_nostr_ffi_checksum_method_request_method() != 18547) {
@@ -18749,7 +18749,7 @@ private var initializationResult: InitializationResult {
18749
18749
if (uniffi_nostr_ffi_checksum_method_singlelettertag_is_uppercase() != 50218) {
18750
18750
return InitializationResult.apiChecksumMismatch
18751
18751
}
18752
- if (uniffi_nostr_ffi_checksum_method_stalldata_as_json() != 23354 ) {
18752
+ if (uniffi_nostr_ffi_checksum_method_stalldata_as_json() != 14021 ) {
18753
18753
return InitializationResult.apiChecksumMismatch
18754
18754
}
18755
18755
if (uniffi_nostr_ffi_checksum_method_stalldata_as_record() != 56802) {
@@ -18797,7 +18797,7 @@ private var initializationResult: InitializationResult {
18797
18797
if (uniffi_nostr_ffi_checksum_method_unsignedevent_add_signature() != 65391) {
18798
18798
return InitializationResult.apiChecksumMismatch
18799
18799
}
18800
- if (uniffi_nostr_ffi_checksum_method_unsignedevent_as_json() != 632 ) {
18800
+ if (uniffi_nostr_ffi_checksum_method_unsignedevent_as_json() != 44697 ) {
18801
18801
return InitializationResult.apiChecksumMismatch
18802
18802
}
18803
18803
if (uniffi_nostr_ffi_checksum_method_unsignedevent_author() != 15518) {
0 commit comments