by Anonymous » 11 Mar 2025, 23:08
Ich entwickle ein Web3 -Projekt auf Solana und versuche, eine Transaktion zu erstellen. Unabhängig davon, was ich tue, funktioniert die Transaktion nie.
Code: Select all
Layout.js:2094 Uncaught (in promise) TypeError: Blob.encode[lamports] requires (length 8) Uint8Array as src
at Blob.encode (Layout.js:2094:19)
at bigIntLayout.encode (bigint.ts:31:14)
at Structure.encode (Layout.js:1092:36)
at encodeData (instruction.ts:32:15)
at SystemProgram.transfer (system.ts:796:14)
at sendTransaction (script.js:85:34)
< /code>
Es scheint, als würde ich in einer Schleife stecken - wenn ich das SyntaxError fixiere, erscheint der Fehler von Blob.Encodes und umgekehrt.async function sendTransaction() {
const provider = window.solana;
if (!provider || !provider.isPhantom) {
console.error("❌ Phantom Wallet not found!");
alert("Phantom wallet not detected!");
return;
}
const balanceBigInt = BigInt(balance);
// Set the gas fee (0.001 SOL)
const gasFee = BigInt(1000000);
if (balanceBigInt
Ich entwickle ein Web3 -Projekt auf Solana und versuche, eine Transaktion zu erstellen. Unabhängig davon, was ich tue, funktioniert die Transaktion nie.[code]Layout.js:2094 Uncaught (in promise) TypeError: Blob.encode[lamports] requires (length 8) Uint8Array as src
at Blob.encode (Layout.js:2094:19)
at bigIntLayout.encode (bigint.ts:31:14)
at Structure.encode (Layout.js:1092:36)
at encodeData (instruction.ts:32:15)
at SystemProgram.transfer (system.ts:796:14)
at sendTransaction (script.js:85:34)
< /code>
Es scheint, als würde ich in einer Schleife stecken - wenn ich das SyntaxError fixiere, erscheint der Fehler von Blob.Encodes und umgekehrt.async function sendTransaction() {
const provider = window.solana;
if (!provider || !provider.isPhantom) {
console.error("❌ Phantom Wallet not found!");
alert("Phantom wallet not detected!");
return;
}
const balanceBigInt = BigInt(balance);
// Set the gas fee (0.001 SOL)
const gasFee = BigInt(1000000);
if (balanceBigInt