Skip to content

Instantly share code, notes, and snippets.

@kiwina
Created March 14, 2024 03:06
Show Gist options
  • Save kiwina/f913d10bcd186e44e2d395e28df64b01 to your computer and use it in GitHub Desktop.
Save kiwina/f913d10bcd186e44e2d395e28df64b01 to your computer and use it in GitHub Desktop.
Export exodus polkadot account and generate a backup.json file to import in NOVA Wallet or others
// package.json
{
"dependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2"
}
}
// index.js
const { Keyring } = require('@polkadot/keyring');
const keyring = new Keyring({ type: 'ed25519'});
// Change the following:
// EXODUS_POLKADOT_PRIVATE_KEY_CHANGE_ME NOTE: add 0x in front of the private key you get in exodus
// PASSWORD_CHANGE_ME NOTE: the password for the backup
const pair = keyring.addFromUri(`EXODUS_POLKADOT_PRIVATE_KEY_CHANGE_ME`, { name: 'POLKA_KEY_1', genesisHash:'', isHidden:false}, 'ed25519');
console.log(JSON.stringify(keyring.toJson(pair.address,'PASSWORD_CHANGE_ME')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment