• Creates a transaction to transfer SOL from Solana to the NeonEVM chain.

    This function generates a transaction for transferring SOL from the Solana blockchain to the NeonEVM chain that uses SOL as the gas token. The NeonEVM can have different chains with different gas tokens (multi-token gas feature). The transaction wraps the SOL token, approves it, and then deposits it to the Neon balance.

    For more information, see the NeonEVM Documentation.

    Parameters

    Returns Promise<Transaction>

    • A Promise that resolves to the generated Solana transaction.
    const connection = new Connection("https://api.devnet.solana.com");
    const solanaWallet = new PublicKey("your_solana_wallet_public_key");
    const neonWallet = "your_neon_wallet_address";
    const neonEvmProgram = new PublicKey("neon_evm_program_public_key");
    const neonTokenMint = new PublicKey("neon_token_mint_public_key");
    const splToken: SPLToken = {
    address: "erc20_token_address",
    address_spl: "address_spl_value",
    chainId: 245022927,
    decimals: 9,
    logoURI: "logo_url",
    name: "SOL Token",
    symbol: "SOL",
    };

    const transaction = await solanaSOLTransferTransaction({
    connection,
    solanaWallet,
    neonWallet,
    neonEvmProgram,
    neonTokenMint,
    splToken,
    amount: 2,
    chainId: 245022927
    });
    console.log("Transaction created successfully:", transaction);