soltool
v1.1.1
Published
CLI tool to convert Solana keypair JSON to base58 format
Maintainers
Readme
soltool
A CLI tool to convert Solana keypair JSON files to base58 format and vice versa.
Installation
npm install -g soltoolUsage
Convert keypair JSON to base58:
soltool -i keypair.jsonExtract public key only:
soltool -i keypair.json --public-keySave output to file:
soltool -i keypair.json -o keypair.txtConvert base58 back to JSON:
const { base58ToJson } = require("soltool");
// Convert base58 string to JSON
const base58String = "2NEpo7TZRRrLZSi2U";
const jsonData = base58ToJson(base58String);
console.log(jsonData);Options
-i, --input <path>: Input keypair JSON file path (required)-o, --output <path>: Output file path (optional)-p, --public-key: Display public key only--help: Display help information--version: Display version information
Input Format
The input JSON file should contain an array of 64 numbers representing the Solana keypair bytes:
[
124, 201, 5, 69, ..., 233 // 64 numbers total
]API Reference
base58ToJson(base58String)
Converts a base58-encoded string back to its original JSON format.
- Parameters:
base58String(string): The base58-encoded string to decode
- Returns: The decoded JSON data
- Throws: Error if the input is invalid or cannot be decoded
License
MIT
