JSPM

soltool

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q26703F
  • License MIT

CLI tool to convert Solana keypair JSON to base58 format

Package Exports

  • soltool
  • soltool/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (soltool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

soltool

A CLI tool to convert Solana keypair JSON files to base58 format and vice versa.

Installation

npm install -g soltool

Usage

Convert keypair JSON to base58:

soltool -i keypair.json

Extract public key only:

soltool -i keypair.json --public-key

Save output to file:

soltool -i keypair.json -o keypair.txt

Convert 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