I'm almost finished with this for electrum.
I have cython generating
std::vector<std::string> pyimport_electrum_wallet(std::string &__pyx_v_path, std::string &__pyx_v_pp)
and am calling it like
namespace bts
{
std::vector<fc::ecc:private_key> import_electrum_wallet( const fc::path& wallet_dat, const string& passphrase )
{
size_t i;
std::vector<fc::ecc::private_key> keysRet;
if (!fc::exists(wallet_dat)
return std::vector<fc::ecc::private_key>();
std::vector<string> keys = pyimport_electrum_wallet(wallet_dat.to_native_ansi_path(), passphrase);
for( i = 0; i < keys.size(); i++ )
{
fc::datastream<const char*> stream(keys[i].c_str(), keys[i].size());
fc::sha256 bits;
stream >> bits;
keysRet.push_back(fc::ecc::private_key::regenerate(bits));
}
return keysRet;
}
I'm not so sure about the C++ part. I still can't compile anything under BTS, waiting for my boost to finish upgrading to 1.53 (Gentoo...)
Also have to figure out how to do pull requests and whatnot.