yenom / BitcoinKit

Bitcoin protocol toolkit for Swift
MIT License
842 stars 262 forks source link

How to import a wallet through a private key string? #192

Open shmxybfq opened 5 years ago

shmxybfq commented 5 years ago

What problem does this feture solve?

Describe what you've considered?

Code sample / Spec

I have a private key string "Ky7VymVZ6fugetBJZkr7bEhWsYTXdGU3JmV8cSgG9ZRXThf8g2u4",I need import it,but i not found a suitable method. thanks.

Sajjon commented 5 years ago

That is a WIF, so you can use this init: https://github.com/yenom/BitcoinKit/blob/master/Sources/BitcoinKit/Core/Keys/PrivateKey.swift#L82