Open asotirov opened 3 years ago
God bless you for this one, this non-mnemoric google login on keplr been slowing me down, same problem on AKASH CLI too
I've been using the following @cosmjs
method to init a base wallet successfully. Hope it helps.
import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing'
const KEPLR_PRIVATE_KEY = "keplr_private_key_without_0x"
const uint8arr = new Uint8Array(Buffer.from(KEPLR_PRIVATE_KEY, 'hex'));
const wallet = await DirectSecp256k1Wallet.fromKey(uint8arr, prefix)
Right now you cannot use the private key from the Keplr extension to be imported in TerraStation.
This is important, because Keplr accounts which have used Google login to generate access to Keplr extension do not have their mnemonics. However, they do have the private key which should be good enough for everything in the Cosmos universe. Maybe add a simple form that allows to input a private key, account alias, terra address and password and it will import an account from the hex encoded private key (such as the one Keplr provides)
Here is how to generate the TerraPrivate key from the Keplr hex encoded private key.
The encrypt method is this one https://github.com/terra-money/station/blob/f55a28de9812f72bb36f9072cb86e54f4e64efc7/src/utils/terra-keystore.ts#L6