SPB Git

spb/os-vault Public

Self-custody, multi-chain crypto wallet for macOS. One recovery phrase, six chain families, zero API keys — nothing leaves your Mac.

Swift 96% Shell 3.4% Makefile 0.6%
1.4 KB · 53 lines swift
Raw Blame History
1import WalletCoreC2import Foundation3// SPDX-License-Identifier: Apache-2.04//5// Copyright © 2017 Trust Wallet.6//7// This is a GENERATED FILE, changes made here WILL BE LOST.8//910import Foundation1112/// Represents a derivation path index in C++ with value and hardened flag.13public final class DerivationPathIndex {1415    /// Returns numeric value of an Index.16    ///17    /// - Parameter index: Index to get the numeric value of.18    public var value: UInt32 {19        return TWDerivationPathIndexValue(rawValue)20    }2122    /// Returns hardened flag of an Index.23    ///24    /// - Parameter index: Index to get hardened flag.25    /// - Returns: true if hardened, false otherwise.26    public var hardened: Bool {27        return TWDerivationPathIndexHardened(rawValue)28    }2930    /// Returns the string description of a derivation path index.31    ///32    /// - Parameter path: Index to get the address of.33    /// - Returns: The string description of the derivation path index.34    public var description: String {35        return TWStringNSString(TWDerivationPathIndexDescription(rawValue))36    }3738    let rawValue: OpaquePointer3940    init(rawValue: OpaquePointer) {41        self.rawValue = rawValue42    }4344    public init(value: UInt32, hardened: Bool) {45        rawValue = TWDerivationPathIndexCreate(value, hardened)46    }4748    deinit {49        TWDerivationPathIndexDelete(rawValue)50    }5152}53