The Solana network endpoint to connect to.
The secret key of the sender's wallet as an array of numbers.
The public key of the recipient's wallet.
The amount of lamports to transfer.
const run = async () => {
const endpoint = 'https://api.mainnet-beta.solana.com';
const fromWalletSecretKey = [/* Your Secret Key Array Elements */];
const toWalletAddress = 'RecipientPublicKeyHere';
const transferAmount = 1000000; // Amount in lamports
try {
const result = await solanaTransfer(endpoint, fromWalletSecretKey, toWalletAddress, transferAmount);
console.log('Transaction successful:', result);
} catch (error) {
console.error('Transaction failed:', error);
}
}
run();
Generated using TypeDoc
Transfers SOL from one wallet to another on the Solana blockchain.