Load Wallet from Environment
Loads a wallet (more specifically a KeyPairSigner) from an environment variable. The keypair should be in the same ‘array of numbers’ format as used by solana-keygen.
Returns: KeyPairSigner
const wallet = connection.loadWalletFromEnvironment(envVariableName);Options
envVariableName:string- Name of environment variable containing the keypair (default: “PRIVATE_KEY”)
See also: Create Wallet, Load Wallet from File
Last updated on