solana-keypair-export
v1.0.5
Published
Convert Solana keypair JSON to Base58 format for Phantom
Maintainers
Readme
solana-keypair-export
This package does exactly one thing: it reads a Solana keypair JSON file and spits out a base58-encoded private key string you can paste into Phantom wallet's import flow.
That’s it. No CLI flags. No validation. If you give it garbage, it gives you garbage back.
I built it because I couldn’t find one, didn’t feel like overthinking it, and wanted to be able to grab it from whatever machine I was stuck on. Now it’s floating around the internet, and somehow it’s your problem too.
Install
npm install solana-keypair-exportUsage
const getPrivateKey = require('solana-keypair-export');
const privateKey = getPrivateKey('./path/to/your/keypair.json');
console.log(privateKey);That’s it. It reads the file, converts the bytes, and gives you a base58 string you can paste straight into Phantom wallet’s import screen. If it breaks, well, maybe don’t give it garbage input.
License
Public domain, basically. CC0.
Use it, fork it, forget it existed, up to you.
