diff --git a/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift b/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift index f16e6300..1684d31d 100644 --- a/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift +++ b/Sources/XMTP/Messages/EncryptedPrivateKeyBundle.swift @@ -8,7 +8,7 @@ typealias EncryptedPrivateKeyBundle = Xmtp_MessageContents_EncryptedPrivateKeyBundle extension EncryptedPrivateKeyBundle { - func decrypted(with key: SigningKey, preEnableIdentityCallback: (() async throws -> Void)? = nil) async throws -> PrivateKeyBundle { + func decrypted(with key: SigningKey, preEnableIdentityCallback: PreEventCallback? = nil) async throws -> PrivateKeyBundle { try await preEnableIdentityCallback?() let signature = try await key.sign(message: Signature.enableIdentityText(key: v1.walletPreKey)) let message = try Crypto.decrypt(signature.rawDataWithNormalizedRecovery, v1.ciphertext) diff --git a/Sources/XMTP/Messages/PrivateKeyBundle.swift b/Sources/XMTP/Messages/PrivateKeyBundle.swift index 0e64ffa5..e6f21ade 100644 --- a/Sources/XMTP/Messages/PrivateKeyBundle.swift +++ b/Sources/XMTP/Messages/PrivateKeyBundle.swift @@ -20,7 +20,7 @@ extension PrivateKeyBundle { self.v1 = v1 } - func encrypted(with key: SigningKey, preEnableIdentityCallback: (() async throws -> Void)? = nil) async throws -> EncryptedPrivateKeyBundle { + func encrypted(with key: SigningKey, preEnableIdentityCallback: PreEventCallback? = nil) async throws -> EncryptedPrivateKeyBundle { let bundleBytes = try serializedData() let walletPreKey = try Crypto.secureRandomBytes(count: 32)