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

Function getPayer

utils/utils.ts:223–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221 * Load and parse the Solana CLI config file to determine which payer to use
222 */
223export async function getPayer(): Promise<Keypair> {
224 try {
225 const config = await getConfig();
226 if (!config.keypair_path) throw new Error("Missing keypair path");
227 return await createKeypairFromFile(config.keypair_path);
228 } catch (err) {
229 console.warn(
230 "Failed to create keypair from CLI config file, falling back to new random keypair"
231 );
232 return Keypair.generate();
233 }
234}
235
236/**
237 * Create a Keypair from a secret key stored in file as bytes' array

Callers 5

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls 2

getConfigFunction · 0.85
createKeypairFromFileFunction · 0.85

Tested by

no test coverage detected