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%
622 B · 21 lines swift
Raw Blame History
1import WalletCoreC2import Foundation3// SPDX-License-Identifier: Apache-2.04//5// Copyright © 2017 Trust Wallet.67import Foundation89/// Converts a Data struct to TWData/UnsafeRawPointer caller must delete it after use.10public func TWDataCreateWithNSData(_ data: Data) -> UnsafeRawPointer {11    return TWDataCreateWithBytes([UInt8](data), data.count)12}1314/// Converts a TWData/UnsafeRawPointer (will be deleted within this call) to a Data struct.15public func TWDataNSData(_ data: UnsafeRawPointer) -> Data {16    defer {17        TWDataDelete(data)18    }19    return Data(bytes: TWDataBytes(data), count: TWDataSize(data))20}21