-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Web3Auth/encapsulate_torusnetwork
refactor: use latest version of torusutils and update features
- Loading branch information
Showing
19 changed files
with
296 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Foundation | ||
|
||
public enum SFAError: Error, Equatable { | ||
case MFAAlreadyEnabled | ||
} | ||
|
||
extension SFAError: LocalizedError { | ||
public var errorDescription: String? { | ||
switch self { | ||
case .MFAAlreadyEnabled: | ||
return "User has already enabled MFA" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import BigInt | ||
import Foundation | ||
import TorusUtils | ||
|
||
public class SessionData: Codable { | ||
let privateKey: String | ||
let publicAddress: String | ||
let signatures: TorusKey.SessionData? | ||
let userInfo: UserInfo? | ||
|
||
init(privateKey: String, publicAddress: String, signatures: TorusKey.SessionData? = nil, userInfo: UserInfo? = nil) { | ||
self.privateKey = privateKey | ||
self.publicAddress = publicAddress | ||
self.signatures = signatures | ||
self.userInfo = userInfo | ||
} | ||
|
||
public func getPrivateKey() -> String { | ||
return privateKey | ||
} | ||
|
||
public func getPublicAddress() -> String { | ||
return publicAddress | ||
} | ||
|
||
public func getUserInfo() -> UserInfo? { | ||
return userInfo | ||
} | ||
|
||
public func getSignatures() -> TorusKey.SessionData? { | ||
return self.signatures | ||
} | ||
} |
Oops, something went wrong.