const web3 = require("@solana/web3.js");
const bs58 = require("bs58");

const connection = new web3.Connection('YOUR_CHAINSTACK_ENDPOINT');

const privateKey = new Uint8Array(bs58.decode('YOUR_PRIVATE_KEY'));
const account = web3.Keypair.fromSecretKey(privateKey);
const account2 = web3.Keypair.generate();

(async () => {
  const transaction = new web3.Transaction().add(
    web3.SystemProgram.transfer({
      fromPubkey: account.publicKey,
      toPubkey: account2.publicKey,
      lamports: web3.LAMPORTS_PER_SOL * 0.001,
    }),
  );
  const signature = await web3.sendAndConfirmTransaction(
    connection,
    transaction,
    [account],
  );
})();
const web3 = require("@solana/web3.js");
const bs58 = require("bs58");

const connection = new web3.Connection('YOUR_CHAINSTACK_ENDPOINT');

const privateKey = new Uint8Array(bs58.decode('YOUR_PRIVATE_KEY'));
const account = web3.Keypair.fromSecretKey(privateKey);
const account2 = web3.Keypair.generate();

(async () => {
  const transaction = new web3.Transaction().add(
    web3.SystemProgram.transfer({
      fromPubkey: account.publicKey,
      toPubkey: account2.publicKey,
      lamports: web3.LAMPORTS_PER_SOL * 0.001,
    }),
  );
  const signature = await web3.sendAndConfirmTransaction(
    connection,
    transaction,
    [account],
  );
})();