The Solana network endpoint to connect to.
The secret key of the authority's wallet as a JSON string.
The public key address of the stake account.
The public key of the validator's vote account.
const endpoint = 'https://api.mainnet-beta.solana.com'
const authoritySecretString = process.env.AUTHORITY_SECRET_KEY || ''
const stakeAccountAddress = 'StakeAccountPublicKeyHere'
const validatorVoteAccount = 'ValidatorVoteAccountPublicKeyHere'
try {
const result = await delegateStake(endpoint, authoritySecretString, stakeAccountAddress, validatorVoteAccount)
console.log('Stake delegation successful:', result)
} catch (error) {
console.error('Stake delegation failed:', error)
}
Generated using TypeDoc
Delegates SOL to a validator using an existing stake account.