Can anyone provide a ed25519verify sample

when i try the following code, my transaction is already get rejected by the logic. I don’t know where is the mistake

let teal= “#pragma version 4\n” +
“txn TxID\n” +
“arg 0\n” +
“addr BJRLVGSFC4IDXEB2B3GJ62QRJAHDDZW7JBWLSUFQ2DUD3IRNC4DHX6XELM\n” +
“ed25519verify”;

let results = await algodClient.compile(teal).do();
const program = new Uint8Array(Buffer.from(results.result , "base64"));


let m ="manage erode connect disagree scene auction close oil assume yard ride rapid brush assume gossip match find south deposit snake access endless stove absent ski"
let hp = algosdk.mnemonicToSecretKey(m);

try {
const lsig = algosdk.makeLogicSig(program);
const sender = lsig.address();
const receiver = “6MNC6JZIQLEDRAPGGTO464O4HQ6B5KAF6YXIX52MSVODE2DC33LOI3NY7M”;
const amount = 0;
const closeToRemaninder = undefined;
const note = undefined;

   const params = await algodClient.getTransactionParams().do();
   const txn = algosdk.makePaymentTxnWithSuggestedParams(sender, receiver, amount, closeToRemaninder, note, params);
   console.log("transaction id", txn.txID());

   const signature = algosdk.tealSign(hp.sk, new Uint8Array(txn.rawTxID()), hp.addr);
   const args = [signature];
   const lsig2 = algosdk.makeLogicSig(program, args);
   const rawSignedTxn = algosdk.signLogicSigTransactionObject(txn, lsig2);


   const tx = await algodClient.sendRawTransaction(rawSignedTxn.blob).do();

} catch (error) {
console.log(error);
}

Here is your example, slightly modified:

ed25519_sample.js

// Use PureStake API V2 server
const x_api_key = 'B3SU4KcVKi94Jap2VXkK83xx38bsv95K5UZm2lab'; 

const token = 
	{
		'X-API-Key': x_api_key
	};
const server = "https://testnet-algorand.api.purestake.io/ps2";
const serverIdx = "https://testnet-algorand.api.purestake.io/idx2";
const port = "";

// Instantiate the algod wrapper
let algodClient = new algosdk.Algodv2(token, server, port);
let indexerClient = new algosdk.Indexer(token, serverIdx, port);

// Function used to wait for a tx confirmation
async function waitForConfirmation(algodclient, txId) {
	let response = await algodclient.status().do();
	let lastround = response["last-round"];
	while (true) {
		const pendingInfo = await algodclient.pendingTransactionInformation(txId).do();
		if (pendingInfo["confirmed-round"] !== null && pendingInfo["confirmed-round"] > 0) {
			//Got the completed Transaction
			console.log("Transaction " + txId + " confirmed in round " + pendingInfo["confirmed-round"]);
			break;
		}
		lastround++;
		await algodclient.statusAfterBlock(lastround).do();
	}
};

// Sample program for ed25519verify
async function ed25519verify_sample() {
	let teal= `
#pragma version 3
txn TxID
arg 0
addr BJRLVGSFC4IDXEB2B3GJ62QRJAHDDZW7JBWLSUFQ2DUD3IRNC4DHX6XELM
ed25519verify
`;

	let results = await algodClient.compile(teal).do();
	//const program = new Uint8Array(Buffer.from(results.result , "base64"));
	let buff = base64js.toByteArray(results.result);
	let program = new Uint8Array(buff);

	let m ="manage erode connect disagree scene auction close oil assume yard ride rapid brush assume gossip match find south deposit snake access endless stove absent ski"
	let hp = algosdk.mnemonicToSecretKey(m);

	let lsig = algosdk.makeLogicSig(program);
	let sender = lsig.address();
	let receiver = "6MNC6JZIQLEDRAPGGTO464O4HQ6B5KAF6YXIX52MSVODE2DC33LOI3NY7M";
	let amount = 0;
	let closeToRemaninder = undefined;
	let note = undefined;

	let params = await algodClient.getTransactionParams().do();
	let txn = algosdk.makePaymentTxnWithSuggestedParams(sender, receiver, amount, closeToRemaninder, note, params);
	console.log("transaction id", txn.txID());

	let signature = algosdk.tealSignFromProgram(hp.sk, new Uint8Array(txn.rawTxID()), program);
	let args = [signature];
	let lsig2 = algosdk.makeLogicSig(program, args);
	let rawSignedTxn = algosdk.signLogicSigTransactionObject(txn, lsig2);
	let tx = await algodClient.sendRawTransaction(rawSignedTxn.blob).do();
	console.log('transaction id: ', tx.txId);
	await waitForConfirmation(algodClient, tx.txId);
}

ed25519verify_sample();

The corresponding ed25519_sample.html

<!DOCTYPE html>
<html>	
<head>
	<meta charset="utf-8">
	<meta name="version" value="0.0.1">
    <script src="./js_libs/algosdk.min.js"></script>
	<script src="./js_libs/base64js.min.js"></script>
	<script src="ed25519_sample.js"></script>
	<title>ed25519 sample</title>
</head>

<body>
<p>ed25519 sample</p>
</body>
</html>

The js_libs/base64js.min.js file is taked from GitHub - beatgammit/base64-js: Base64 encoding/decoding in pure JS

txid of the transaction:
77Q4AC5O7EEJ2YUAHNVTSWZCUEM42G5SAISPVADVF3GV4TLCS7FA

Also, the sender address, BGYGHOCUKVRRMFXJDSGFZ66DMYI663S3QFOPK2SHS2WT7WM5U3VKAO6WAA was “filled up” with 10 Algos.

You can rerun the example from within a browser.