# DerivationTool

    public class DerivationTool : KeyDeriving

    extension DerivationTool: KeyValidation

Undocumented

- `init(networkType:)`

  Undocumented

  #### Declaration

  Swift

      public init(networkType: NetworkType)

- `deriveViewingKeys(seed:numberOfAccounts:)`

  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.

- `deriveViewingKey(spendingKey:)`

  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.

- `deriveSpendingKeys(seed:numberOfAccounts:)`

  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.

- `deriveShieldedAddress(seed:accountIndex:)`

  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.

- `deriveShieldedAddress(viewingKey:)`

  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.

- `deriveTransparentAddress(seed:account:index:)`

  #### Declaration

  Swift

      public func deriveTransparentAddress(seed: [UInt8], account: Int = 0, index: Int = 0) throws -> String

- `deriveUnifiedViewingKeysFromSeed(_:numberOfAccounts:)`

  #### Declaration

  Swift

      public func deriveUnifiedViewingKeysFromSeed(_ seed: [UInt8], numberOfAccounts: Int) throws -> [UnifiedViewingKey]

- `deriveUnifiedAddressFromUnifiedViewingKey(_:)`

  derives a Unified Address from a Unified Viewing Key

  #### Declaration

  Swift

      public func deriveUnifiedAddressFromUnifiedViewingKey(_ uvk: UnifiedViewingKey) throws -> UnifiedAddress

- `deriveTransparentAddressFromPublicKey(_:)`

  Undocumented

  #### Declaration

  Swift

      public func deriveTransparentAddressFromPublicKey(_ pubkey: String) throws -> String

- `deriveTransparentPrivateKey(seed:account:index:)`

  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

- `isValidExtendedViewingKey(_:)`

  Undocumented

  #### Declaration

  Swift

      public func isValidExtendedViewingKey(_ extvk: String) throws -> Bool

- `isValidTransparentAddress(_:)`

  Undocumented

  #### Declaration

  Swift

      public func isValidTransparentAddress(_ tAddress: String) throws -> Bool

- `isValidShieldedAddress(_:)`

  Undocumented

  #### Declaration

  Swift

      public func isValidShieldedAddress(_ zAddress: String) throws -> Bool

- `deriveTransparentAddressFromPrivateKey(_:)`

  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

© 2022 Francisco Gindre and Jack Grigg. All rights reserved. (Last updated: 2022-04-07)

Generated by jazzy ♪♫ v0.14.2, a Realm project.