consenlabs / token-core-ios

a blockchain private key management library on iOS
Apache License 2.0
879 stars 229 forks source link

通过ETH私钥导入生成新的identity可以成功,BTC私钥导入就不成功。 #97

Open wkn66 opened 3 years ago

wkn66 commented 3 years ago
    let source = WalletMeta.Source.privateKey
    var metadata = WalletMeta(source: source)
    metadata.chain = .btc
    metadata.network = Network.testnet
    metadata.segWit = .p2wpkh
    metadata.name = ""
   try?Identity.createIdentity(password: "", metadata: metadata)
    guard let wallet = try? WalletManager.importFromPrivateKey(privateKey, encryptedBy: "", metadata: metadata) else {
        print("1213")
        return 
    Identity.currentIdentity?.wallets.forEach({ (wallet) in
        print(wallet)
    })