2022-04-12 01:02:36 -07:00
|
|
|
//
|
2022-11-14 10:36:51 -08:00
|
|
|
// DerivationToolInterface.swift
|
2022-04-12 01:02:36 -07:00
|
|
|
// secant-testnet
|
|
|
|
//
|
2022-11-14 10:36:51 -08:00
|
|
|
// Created by Lukáš Korba on 12.11.2022.
|
2022-04-12 01:02:36 -07:00
|
|
|
//
|
|
|
|
|
2022-11-14 10:36:51 -08:00
|
|
|
import ComposableArchitecture
|
2022-04-12 01:02:36 -07:00
|
|
|
import ZcashLightClientKit
|
|
|
|
|
2022-11-14 10:36:51 -08:00
|
|
|
extension DependencyValues {
|
|
|
|
var derivationTool: DerivationToolClient {
|
|
|
|
get { self[DerivationToolClient.self] }
|
|
|
|
set { self[DerivationToolClient.self] = newValue }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct DerivationToolClient {
|
2022-11-22 02:32:48 -08:00
|
|
|
/// Given a seed and a number of accounts, return the associated spending keys.
|
|
|
|
/// - Parameter seed: the seed from which to derive spending keys.
|
|
|
|
/// - Parameter accountIndex: Index of account to use. Multiple accounts are not fully
|
|
|
|
/// supported so the default value of 0 is recommended.
|
|
|
|
/// - Returns: the spending keys that correspond to the seed, formatted as Strings.
|
|
|
|
var deriveSpendingKey: ([UInt8], Int) throws -> UnifiedSpendingKey
|
|
|
|
|
|
|
|
/// Checks validity of the transparent address.
|
|
|
|
var isValidTransparentAddress: (String) throws -> Bool
|
|
|
|
|
|
|
|
/// Checks validity of the shielded address.
|
|
|
|
var isValidSaplingAddress: (String) throws -> Bool
|
|
|
|
|
|
|
|
/// Checks if given address is a valid zcash address.
|
2022-11-14 10:36:51 -08:00
|
|
|
var isValidZcashAddress: (String) throws -> Bool
|
2022-04-12 01:02:36 -07:00
|
|
|
}
|