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%
650 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 String struct to TWString/UnsafeRawPointer, caller must delete it after use.10public func TWStringCreateWithNSString(_ string: String) -> UnsafeRawPointer {11    return TWStringCreateWithUTF8Bytes([CChar](string.utf8CString))12}1314/// Converts a TWString/UnsafeRawPointer (will be deleted within this call) to a String struct.15public func TWStringNSString(_ string: UnsafeRawPointer) -> String {16    defer {17        TWStringDelete(string)18    }19    return String(utf8String: TWStringUTF8Bytes(string))!20}21