0

I have installed the polkadot{.js} browser extension and exported an account to a json-file. I want to have that account available on a server where I have installed the @polkadot/keyring library.

Is there a way I can use the information in the exported json file to Add an account to the keyring ? so that the imported account uses the same private/public key ?

The exported JSON looks like this:

{"encoded":"e3/31ir...XXX","encoding":{"content":["pkcs8","sr25519"],"type":["scrypt","xsalsa20-poly1305"],"version":"3" }, "address":"5GTvRV9XXXX", "meta":{"genesisHash":"", "name":"Account3", "whenCreated":1676907491720}}

Want to add Account to Keyring from exported polkadot{.js} account.

yodas_dev
  • 1
  • 1
  • https://github.com/polkadot-js/build-bundle/blob/fef7a3b2e89e285b3de0e4b9c00c9f94350af3bb/bundle-polkadot-ui-keyring.js#L2640 – niklas Feb 25 '23 at 00:14
  • @niklas thanks. I will try that out. Also I found an easy way to import an account to polkadot/keyring is to just use the seed phrase like this: const PHRASE_ACCOUNT = 'XXX XXXX XXXX'; const newPair = keyring.createFromUri(PHRASE_ACCOUNT); – yodas_dev Feb 27 '23 at 14:21

0 Answers0