( filePath: string )
| 237 | * Create a Keypair from a secret key stored in file as bytes' array |
| 238 | */ |
| 239 | export 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 |
no outgoing calls
no test coverage detected