keys.ts 229 B

123456789
  1. import fs from "node:fs";
  2. import { Keypair } from "@solana/web3.js";
  3. export function loadKeypair(path: string) {
  4. return Keypair.fromSecretKey(
  5. new Uint8Array(JSON.parse(fs.readFileSync(path, "utf8")) as number[]),
  6. );
  7. }