diff --git a/Sources/FCL-SDK/AppUtilities/AppUtilities.swift b/Sources/FCL-SDK/AppUtilities/AppUtilities.swift index 33a21bd..eb1efc2 100644 --- a/Sources/FCL-SDK/AppUtilities/AppUtilities.swift +++ b/Sources/FCL-SDK/AppUtilities/AppUtilities.swift @@ -14,7 +14,7 @@ public enum AppUtilities { public static func verifyAccountProof( appIdentifier: String, - accountProofData: AccountProofSignatureData, + accountProofData: AccountProofVerifiable, fclCryptoContract: Address? ) async throws -> Bool { let verifyMessage = WalletUtilities.encodeAccountProof( @@ -54,7 +54,7 @@ public enum AppUtilities { public static func verifyUserSignatures( message: String, - signatures: [FCLCompositeSignature], + signatures: [CompositeSignatureVerifiable], fclCryptoContract: Address? ) async throws -> Bool { diff --git a/Sources/FCL-SDK/Models/AccountProofData.swift b/Sources/FCL-SDK/Models/AccountProofData.swift index 6cff8dd..29cf56b 100644 --- a/Sources/FCL-SDK/Models/AccountProofData.swift +++ b/Sources/FCL-SDK/Models/AccountProofData.swift @@ -21,11 +21,17 @@ public struct FCLAccountProofData { } -public struct AccountProofSignatureData { +public protocol AccountProofVerifiable { + var address: Address { get } + var nonce: String { get } + var signatures: [CompositeSignatureVerifiable] { get } +} + +public struct AccountProofSignatureData: AccountProofVerifiable { - let address: Address - let nonce: String - let signatures: [FCLCompositeSignature] + public let address: Address + public let nonce: String + public let signatures: [CompositeSignatureVerifiable] public init( address: Address, diff --git a/Sources/FCL-SDK/Models/FCLCompositeSignature.swift b/Sources/FCL-SDK/Models/FCLCompositeSignature.swift index 5a64192..28452b6 100644 --- a/Sources/FCL-SDK/Models/FCLCompositeSignature.swift +++ b/Sources/FCL-SDK/Models/FCLCompositeSignature.swift @@ -7,7 +7,13 @@ import Foundation -public struct FCLCompositeSignature: Decodable { +public protocol CompositeSignatureVerifiable { + var address: String { get } + var keyId: Int { get } + var signature: String { get } +} + +public struct FCLCompositeSignature: CompositeSignatureVerifiable, Decodable { public let fclType: String public let fclVersion: String