@@ -808,7 +808,8 @@ open class Contact:
808
808
return try! rustCall { uniffi_nostr_ffi_fn_clone_contact(self.pointer, $0) }
809
809
}
810
810
public convenience init(pk: PublicKey, relayUrl: String?, alias: String?) {
811
- let pointer = try! rustCall() {
811
+ let pointer =
812
+ try! rustCall() {
812
813
uniffi_nostr_ffi_fn_constructor_contact_new(
813
814
FfiConverterTypePublicKey.lower(pk),
814
815
FfiConverterOptionString.lower(relayUrl),
@@ -978,7 +979,8 @@ open class Coordinate:
978
979
return try! rustCall { uniffi_nostr_ffi_fn_clone_coordinate(self.pointer, $0) }
979
980
}
980
981
public convenience init(kind: Kind, publicKey: PublicKey) {
981
- let pointer = try! rustCall() {
982
+ let pointer =
983
+ try! rustCall() {
982
984
uniffi_nostr_ffi_fn_constructor_coordinate_new(
983
985
FfiConverterTypeKind.lower(kind),
984
986
FfiConverterTypePublicKey.lower(publicKey),$0
@@ -1199,8 +1201,9 @@ open class EncryptedSecretKey:
1199
1201
/**
1200
1202
* Encrypt secret key
1201
1203
*/
1202
- public convenience init(secretKey: SecretKey, password: String, logN: UInt8, keySecurity: KeySecurity) {
1203
- let pointer = throws try rustCallWithError(FfiConverterTypeNostrError.lift) {
1204
+ public convenience init(secretKey: SecretKey, password: String, logN: UInt8, keySecurity: KeySecurity)throws {
1205
+ let pointer =
1206
+ try rustCallWithError(FfiConverterTypeNostrError.lift) {
1204
1207
uniffi_nostr_ffi_fn_constructor_encryptedsecretkey_new(
1205
1208
FfiConverterTypeSecretKey.lower(secretKey),
1206
1209
FfiConverterString.lower(password),
@@ -1851,7 +1854,8 @@ open class EventBuilder:
1851
1854
return try! rustCall { uniffi_nostr_ffi_fn_clone_eventbuilder(self.pointer, $0) }
1852
1855
}
1853
1856
public convenience init(kind: Kind, content: String, tags: [Tag]) {
1854
- let pointer = try! rustCall() {
1857
+ let pointer =
1858
+ try! rustCall() {
1855
1859
uniffi_nostr_ffi_fn_constructor_eventbuilder_new(
1856
1860
FfiConverterTypeKind.lower(kind),
1857
1861
FfiConverterString.lower(content),
@@ -2590,8 +2594,9 @@ open class EventId:
2590
2594
public func uniffiClonePointer() -> UnsafeMutableRawPointer {
2591
2595
return try! rustCall { uniffi_nostr_ffi_fn_clone_eventid(self.pointer, $0) }
2592
2596
}
2593
- public convenience init(publicKey: PublicKey, createdAt: Timestamp, kind: Kind, tags: [Tag], content: String) {
2594
- let pointer = throws try rustCallWithError(FfiConverterTypeNostrError.lift) {
2597
+ public convenience init(publicKey: PublicKey, createdAt: Timestamp, kind: Kind, tags: [Tag], content: String)throws {
2598
+ let pointer =
2599
+ try rustCallWithError(FfiConverterTypeNostrError.lift) {
2595
2600
uniffi_nostr_ffi_fn_constructor_eventid_new(
2596
2601
FfiConverterTypePublicKey.lower(publicKey),
2597
2602
FfiConverterTypeTimestamp.lower(createdAt),
@@ -2816,8 +2821,9 @@ open class FileMetadata:
2816
2821
public func uniffiClonePointer() -> UnsafeMutableRawPointer {
2817
2822
return try! rustCall { uniffi_nostr_ffi_fn_clone_filemetadata(self.pointer, $0) }
2818
2823
}
2819
- public convenience init(url: String, mimeType: String, hash: String) {
2820
- let pointer = throws try rustCallWithError(FfiConverterTypeNostrError.lift) {
2824
+ public convenience init(url: String, mimeType: String, hash: String)throws {
2825
+ let pointer =
2826
+ try rustCallWithError(FfiConverterTypeNostrError.lift) {
2821
2827
uniffi_nostr_ffi_fn_constructor_filemetadata_new(
2822
2828
FfiConverterString.lower(url),
2823
2829
FfiConverterString.lower(mimeType),
@@ -3096,7 +3102,8 @@ open class Filter:
3096
3102
return try! rustCall { uniffi_nostr_ffi_fn_clone_filter(self.pointer, $0) }
3097
3103
}
3098
3104
public convenience init() {
3099
- let pointer = try! rustCall() {
3105
+ let pointer =
3106
+ try! rustCall() {
3100
3107
uniffi_nostr_ffi_fn_constructor_filter_new($0
3101
3108
)
3102
3109
}
@@ -3554,7 +3561,8 @@ open class ImageDimensions:
3554
3561
return try! rustCall { uniffi_nostr_ffi_fn_clone_imagedimensions(self.pointer, $0) }
3555
3562
}
3556
3563
public convenience init(width: UInt64, height: UInt64) {
3557
- let pointer = try! rustCall() {
3564
+ let pointer =
3565
+ try! rustCall() {
3558
3566
uniffi_nostr_ffi_fn_constructor_imagedimensions_new(
3559
3567
FfiConverterUInt64.lower(width),
3560
3568
FfiConverterUInt64.lower(height),$0
@@ -3703,7 +3711,8 @@ open class Keys:
3703
3711
return try! rustCall { uniffi_nostr_ffi_fn_clone_keys(self.pointer, $0) }
3704
3712
}
3705
3713
public convenience init(secretKey: SecretKey) {
3706
- let pointer = try! rustCall() {
3714
+ let pointer =
3715
+ try! rustCall() {
3707
3716
uniffi_nostr_ffi_fn_constructor_keys_new(
3708
3717
FfiConverterTypeSecretKey.lower(secretKey),$0
3709
3718
)
@@ -3971,7 +3980,8 @@ open class Kind:
3971
3980
return try! rustCall { uniffi_nostr_ffi_fn_clone_kind(self.pointer, $0) }
3972
3981
}
3973
3982
public convenience init(kind: UInt64) {
3974
- let pointer = try! rustCall() {
3983
+ let pointer =
3984
+ try! rustCall() {
3975
3985
uniffi_nostr_ffi_fn_constructor_kind_new(
3976
3986
FfiConverterUInt64.lower(kind),$0
3977
3987
)
@@ -4198,7 +4208,8 @@ open class Metadata:
4198
4208
return try! rustCall { uniffi_nostr_ffi_fn_clone_metadata(self.pointer, $0) }
4199
4209
}
4200
4210
public convenience init() {
4201
- let pointer = try! rustCall() {
4211
+ let pointer =
4212
+ try! rustCall() {
4202
4213
uniffi_nostr_ffi_fn_constructor_metadata_new($0
4203
4214
)
4204
4215
}
@@ -4638,7 +4649,8 @@ open class Nip19Event:
4638
4649
return try! rustCall { uniffi_nostr_ffi_fn_clone_nip19event(self.pointer, $0) }
4639
4650
}
4640
4651
public convenience init(eventId: EventId, author: PublicKey?, relays: [String]) {
4641
- let pointer = try! rustCall() {
4652
+ let pointer =
4653
+ try! rustCall() {
4642
4654
uniffi_nostr_ffi_fn_constructor_nip19event_new(
4643
4655
FfiConverterTypeEventId.lower(eventId),
4644
4656
FfiConverterOptionTypePublicKey.lower(author),
@@ -4830,8 +4842,9 @@ open class Nip19Profile:
4830
4842
/**
4831
4843
* New NIP19 profile
4832
4844
*/
4833
- public convenience init(publicKey: PublicKey, relays: [String]) {
4834
- let pointer = throws try rustCallWithError(FfiConverterTypeNostrError.lift) {
4845
+ public convenience init(publicKey: PublicKey, relays: [String])throws {
4846
+ let pointer =
4847
+ try rustCallWithError(FfiConverterTypeNostrError.lift) {
4835
4848
uniffi_nostr_ffi_fn_constructor_nip19profile_new(
4836
4849
FfiConverterTypePublicKey.lower(publicKey),
4837
4850
FfiConverterSequenceString.lower(relays),$0
@@ -5175,7 +5188,8 @@ open class NostrConnectMetadata:
5175
5188
* New Nostr Connect Metadata
5176
5189
*/
5177
5190
public convenience init(name: String) {
5178
- let pointer = try! rustCall() {
5191
+ let pointer =
5192
+ try! rustCall() {
5179
5193
uniffi_nostr_ffi_fn_constructor_nostrconnectmetadata_new(
5180
5194
FfiConverterString.lower(name),$0
5181
5195
)
@@ -5485,7 +5499,8 @@ open class NostrLibrary:
5485
5499
return try! rustCall { uniffi_nostr_ffi_fn_clone_nostrlibrary(self.pointer, $0) }
5486
5500
}
5487
5501
public convenience init() {
5488
- let pointer = try! rustCall() {
5502
+ let pointer =
5503
+ try! rustCall() {
5489
5504
uniffi_nostr_ffi_fn_constructor_nostrlibrary_new($0
5490
5505
)
5491
5506
}
@@ -5621,8 +5636,9 @@ open class NostrWalletConnectUri:
5621
5636
/**
5622
5637
* Create new Nostr Wallet Connect URI
5623
5638
*/
5624
- public convenience init(publicKey: PublicKey, relayUrl: String, randomSecretKey: SecretKey, lud16: String?) {
5625
- let pointer = throws try rustCallWithError(FfiConverterTypeNostrError.lift) {
5639
+ public convenience init(publicKey: PublicKey, relayUrl: String, randomSecretKey: SecretKey, lud16: String?)throws {
5640
+ let pointer =
5641
+ try rustCallWithError(FfiConverterTypeNostrError.lift) {
5626
5642
uniffi_nostr_ffi_fn_constructor_nostrwalletconnecturi_new(
5627
5643
FfiConverterTypePublicKey.lower(publicKey),
5628
5644
FfiConverterString.lower(relayUrl),
@@ -6176,7 +6192,8 @@ open class RelayInformationDocument:
6176
6192
* Create new empty [`RelayInformationDocument`]
6177
6193
*/
6178
6194
public convenience init() {
6179
- let pointer = try! rustCall() {
6195
+ let pointer =
6196
+ try! rustCall() {
6180
6197
uniffi_nostr_ffi_fn_constructor_relayinformationdocument_new($0
6181
6198
)
6182
6199
}
@@ -6687,7 +6704,8 @@ open class Request:
6687
6704
return try! rustCall { uniffi_nostr_ffi_fn_clone_request(self.pointer, $0) }
6688
6705
}
6689
6706
public convenience init(method: Method, params: RequestParams) {
6690
- let pointer = try! rustCall() {
6707
+ let pointer =
6708
+ try! rustCall() {
6691
6709
uniffi_nostr_ffi_fn_constructor_request_new(
6692
6710
FfiConverterTypeMethod.lower(method),
6693
6711
FfiConverterTypeRequestParams.lower(params),$0
@@ -7159,7 +7177,8 @@ open class ShippingMethod:
7159
7177
* Create a new shipping method
7160
7178
*/
7161
7179
public convenience init(id: String, cost: Double) {
7162
- let pointer = try! rustCall() {
7180
+ let pointer =
7181
+ try! rustCall() {
7163
7182
uniffi_nostr_ffi_fn_constructor_shippingmethod_new(
7164
7183
FfiConverterString.lower(id),
7165
7184
FfiConverterDouble.lower(cost),$0
@@ -7462,7 +7481,8 @@ open class StallData:
7462
7481
return try! rustCall { uniffi_nostr_ffi_fn_clone_stalldata(self.pointer, $0) }
7463
7482
}
7464
7483
public convenience init(id: String, name: String, description: String?, currency: String, shipping: [ShippingMethod]) {
7465
- let pointer = try! rustCall() {
7484
+ let pointer =
7485
+ try! rustCall() {
7466
7486
uniffi_nostr_ffi_fn_constructor_stalldata_new(
7467
7487
FfiConverterString.lower(id),
7468
7488
FfiConverterString.lower(name),
@@ -8430,7 +8450,8 @@ open class ZapRequestData:
8430
8450
return try! rustCall { uniffi_nostr_ffi_fn_clone_zaprequestdata(self.pointer, $0) }
8431
8451
}
8432
8452
public convenience init(publicKey: PublicKey, relays: [String]) {
8433
- let pointer = try! rustCall() {
8453
+ let pointer =
8454
+ try! rustCall() {
8434
8455
uniffi_nostr_ffi_fn_constructor_zaprequestdata_new(
8435
8456
FfiConverterTypePublicKey.lower(publicKey),
8436
8457
FfiConverterSequenceString.lower(relays),$0
@@ -17783,6 +17804,20 @@ public func giftWrap(senderKeys: Keys, receiverPubkey: PublicKey, rumor: Unsigne
17783
17804
)
17784
17805
})
17785
17806
}
17807
+ /**
17808
+ * Build Gift Wrap from Seal
17809
+ *
17810
+ * <https://github.com/nostr-protocol/nips/blob/master/59.md>
17811
+ */
17812
+ public func giftWrapFromSeal(receiver: PublicKey, seal: Event, expiration: Timestamp?)throws -> Event {
17813
+ return try FfiConverterTypeEvent.lift(try rustCallWithError(FfiConverterTypeNostrError.lift) {
17814
+ uniffi_nostr_ffi_fn_func_gift_wrap_from_seal(
17815
+ FfiConverterTypePublicKey.lower(receiver),
17816
+ FfiConverterTypeEvent.lower(seal),
17817
+ FfiConverterOptionTypeTimestamp.lower(expiration),$0
17818
+ )
17819
+ })
17820
+ }
17786
17821
public func nip04Decrypt(secretKey: SecretKey, publicKey: PublicKey, encryptedContent: String)throws -> String {
17787
17822
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNostrError.lift) {
17788
17823
uniffi_nostr_ffi_fn_func_nip04_decrypt(
@@ -17925,6 +17960,9 @@ private var initializationResult: InitializationResult {
17925
17960
if (uniffi_nostr_ffi_checksum_func_gift_wrap() != 12272) {
17926
17961
return InitializationResult.apiChecksumMismatch
17927
17962
}
17963
+ if (uniffi_nostr_ffi_checksum_func_gift_wrap_from_seal() != 39743) {
17964
+ return InitializationResult.apiChecksumMismatch
17965
+ }
17928
17966
if (uniffi_nostr_ffi_checksum_func_nip04_decrypt() != 38491) {
17929
17967
return InitializationResult.apiChecksumMismatch
17930
17968
}
0 commit comments