Skip to content

Commit

Permalink
add isVerified property
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Aug 12, 2024
1 parent c54013a commit 41afb9e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Sources/WalletConnectVerify/VerifyContextFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ import Foundation

class VerifyContextFactory {
public func createVerifyContext(origin: String?, domain: String, isScam: Bool?, isVerified: Bool? = nil) -> VerifyContext {
if let isVerified = isVerified, !isVerified {

guard isScam != true else {
return VerifyContext(
origin: origin,
validation: .unknown
validation: .scam
)
}

guard isScam != true else {
// If isVerified is provided and is false, return unknown
if let isVerified = isVerified, !isVerified {
return VerifyContext(
origin: origin,
validation: .scam
validation: .unknown
)
}

// Existing behavior for origin and domain validation
if let origin, let originUrl = URL(string: origin), let domainUrl = URL(string: domain) {
return VerifyContext(
origin: origin,
Expand Down

0 comments on commit 41afb9e

Please sign in to comment.