MCPcopy Create free account
hub / github.com/ExtropyIO/SolanaBootcamp / createKeypairFromFile

Function createKeypairFromFile

utils/utils.ts:239–245  ·  view source on GitHub ↗
(
  filePath: string
)

Source from the content-addressed store, hash-verified

237 * Create a Keypair from a secret key stored in file as bytes' array
238 */
239export async function createKeypairFromFile(
240 filePath: string
241): Promise<Keypair> {
242 const secretKeyString = await fs.readFile(filePath, { encoding: "utf8" });
243 const secretKey = Uint8Array.from(JSON.parse(secretKeyString));
244 return Keypair.fromSecretKey(secretKey);
245}
246
247/**
248 * Function to get user's input from the CLI

Callers 2

checkBinaryExistsFunction · 0.85
getPayerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected