DerivationTool
public class DerivationTool : KeyDeriving
extension DerivationTool: KeyValidation
Undocumented
-
Undocumented
Declaration
Swift
public init(networkType: NetworkType)
-
Given a seed and a number of accounts, return the associated viewing keys.
Declaration
Swift
public func deriveViewingKeys(seed: [UInt8], numberOfAccounts: Int) throws -> [String]
Parameters
seed
the seed from which to derive viewing keys.
numberOfAccounts
the number of accounts to use. Multiple accounts are not fully supported so the default value of 1 is recommended.
Return Value
the viewing keys that correspond to the seed, formatted as Strings.
-
Given a spending key, return the associated viewing key.
Declaration
Swift
public func deriveViewingKey(spendingKey: String) throws -> String
Parameters
spendingKey
the key from which to derive the viewing key.
Return Value
the viewing key that corresponds to the spending key.
-
Given a seed and a number of accounts, return the associated spending keys.
Declaration
Swift
public func deriveSpendingKeys(seed: [UInt8], numberOfAccounts: Int) throws -> [String]
Parameters
seed
the seed from which to derive spending keys.
numberOfAccounts
the number of accounts to use. Multiple accounts are not fully supported so the default value of 1 is recommended.
Return Value
the spending keys that correspond to the seed, formatted as Strings.
-
Given a seed and account index, return the associated address.
Declaration
Swift
public func deriveShieldedAddress(seed: [UInt8], accountIndex: Int) throws -> String
Parameters
seed
the seed from which to derive the address.
accountIndex
the index of the account to use for deriving the address. Multiple accounts are not fully supported so the default value of 1 is recommended.
Return Value
the address that corresponds to the seed and account index.
-
Given a viewing key string, return the associated address.
Declaration
Swift
public func deriveShieldedAddress(viewingKey: String) throws -> String
Parameters
viewingKey
the viewing key to use for deriving the address. The viewing key is tied to a specific account so no account index is required.
Return Value
the address that corresponds to the viewing key.
-
Declaration
Swift
public func deriveTransparentAddress(seed: [UInt8], account: Int = 0, index: Int = 0) throws -> String
-
Declaration
Swift
public func deriveUnifiedViewingKeysFromSeed(_ seed: [UInt8], numberOfAccounts: Int) throws -> [UnifiedViewingKey]
-
derives a Unified Address from a Unified Viewing Key
Declaration
Swift
public func deriveUnifiedAddressFromUnifiedViewingKey(_ uvk: UnifiedViewingKey) throws -> UnifiedAddress
-
Undocumented
Declaration
Swift
public func deriveTransparentAddressFromPublicKey(_ pubkey: String) throws -> String
-
Derives the transparent funds private key from the given seed
Throws
- KeyDerivationErrors.derivationError with the underlying error when it fails
- KeyDerivationErrors.unableToDerive when there’s an unknown error
Declaration
Swift
public func deriveTransparentPrivateKey(seed: [UInt8], account: Int = 0, index: Int = 0) throws -> String
-
Undocumented
Declaration
Swift
public func isValidExtendedViewingKey(_ extvk: String) throws -> Bool
-
Undocumented
Declaration
Swift
public func isValidTransparentAddress(_ tAddress: String) throws -> Bool
-
Undocumented
Declaration
Swift
public func isValidShieldedAddress(_ zAddress: String) throws -> Bool
-
Derives the transparent address from a WIF Private Key
Throws
- KeyDerivationErrors.derivationError with the underlying error when it fails
- KeyDerivationErrors.unableToDerive when there’s an unknown error
Declaration
Swift
public func deriveTransparentAddressFromPrivateKey(_ tsk: String) throws -> String