Skip to Content
DocumentationWalletsLoad Wallet from File

Load Wallet from File

Loads a wallet (more specifically a KeyPairSigner) from a file. The file should be in the same format as files created by the solana-keygen command.

Returns: Promise<KeyPairSigner>

const wallet = await connection.loadWalletFromFile(keyPairPath);

Options

  • keyPairPath: string (optional) - Path to load keypair from file. Defaults to ~/.config/solana/id.json

See also: Create Wallet, Load Wallet from Environment

Last updated on