secant-ios-wallet/secant/MockedDependencies/KeyStoring.swift

39 lines
821 B
Swift
Raw Normal View History

//
// KeyStoring.swift
// secant
//
// Created by Francisco Gindre on 8/6/21.
//
import Foundation
protocol KeyStoring {
func importBirthday(_ height: BlockHeight) throws
func exportBirthday() throws -> BlockHeight
func importPhrase(bip39 phrase: String) throws
func exportPhrase() throws -> String
func areKeysPresent() throws -> Bool
/**
2021-09-14 04:15:29 -07:00
Use carefully: Deletes the seed phrase from the keychain
*/
func nukePhrase()
/**
2021-09-14 04:15:29 -07:00
Use carefully: deletes the wallet birthday from the keychain
*/
func nukeBirthday()
/**
There's no fate but what we make for ourselves - Sarah Connor
*/
func nukeWallet()
2021-09-14 04:15:29 -07:00
var keysPresent: Bool { get }
}
2021-09-14 04:15:29 -07:00
enum KeyStoringError: Error {
case alreadyImported
case uninitializedWallet
2021-09-21 13:38:36 -07:00
case storageError(Error)
}