• Creates a stake account on the Solana blockchain.

    Parameters

    • endpoint: string

      The Solana network endpoint to connect to.

    • authoritySecretString: string

      The secret string of the authority's keypair.

    • stakeAccountAddress: string

      The public key of the stake account.

    • amount: number

      The amount in SOL to be staked.

    Returns Promise<string>

    • A promise that resolves with the transaction signature.

    Throws

    • Throws an error if the transaction fails.

    Example

    const endpoint = 'https://api.mainnet-beta.solana.com';
    const authoritySecretString = '[1,2,3,...]'; // Replace with actual secret key array
    const stakeAccountAddress = 'YourStakeAccountPublicKeyHere';
    const amount = 1; // Amount in SOL to be staked

    createStakeAccount(endpoint, authoritySecretString, stakeAccountAddress, amount)
    .then(signature => console.log('Transaction Signature:', signature))
    .catch(error => console.error('Error:', error));

Generated using TypeDoc