Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 8092

Failing to deserialize a tx from rpc, Error deserializing transaction: Reached end of buffer unexpectedly

$
0
0

Hey guys I'm just trying to deserialize a tx from an rpc.

const subscriptionMessage = JSON.stringify({        jsonrpc: "2.0",        id: 1,        method: "blockSubscribe",        params: [            { mentionsAccountOrProgram: PROGRAM.toBase58() },            {                commitment: "confirmed",                encoding: "base64",                showRewards: false,                transactionDetails: "full",                maxSupportedTransactionVersion: 0            }        ]    });    websocket.send(subscriptionMessage);    console.log(`Subscribed to blocks mentioning program: ${PROGRAM.toBase58()}`);    websocket.on('message', (message) => {        lastMessageTime = Date.now();        const data = JSON.parse(message);        if (data.method === 'blockNotification'&& data.params && data.params.result) {            const blockData = data.params.result;            if (blockData.value && blockData.value.block) {                const block = blockData.value.block;                if (block.transactions) {                    for (const tx of block.transactions) {                        if (tx.transaction) {                            try {                                console.log(tx.transaction[0], "tx");                                const base64String = tx.transaction[0];                                const txDataDecoded = Buffer.from(base64String, 'base64');                                const message = VersionedMessage.deserialize(txDataDecoded);                                const transaction = new VersionedTransaction(message);                                break;

tx content before the script :AdoO54ZrgpKOP5piKI6/o2c3MqvkJZ6jPb4cTL000C6uPL0FwyGImTgIKZIzC3ahGOlc5546yjW9HubDMvvYBguAAQAIDUdK1S33ODtEFV0FhvFIIRmBwzsbsd1iR6QaSbT67vz2Ew2qvCHWXIcnOnLbsfqD5AlToROWezlfCwy2VeykAUetEeak/ClEpPqCUb74FUJuG/soxrZkZndgfGrZ9WamRp0qaaFOhjKT8Ii4rQc+M0iYurSGIGimlRvdW3V7AmzP8tUM6Kn8LEtLFfyfEi8i9oj3FnhbAYuUuwLm00gm/8qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WdNGRZLdRClawG9MSXgYtpRBnaRsl4Y1Y9NWhdeET57fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqQFW4PaTZlrPRNsVaL8XW6pRicuX9dL/O2VdK7b9bRiwOoZeae4PVIDKvPZjV+TcLxjVjUXB6nSJ+zcj2Xk8cqYGp9UXGSxcUSGMyUw9SvF/WNruCJuh/UTj29mKAAAAAKzxNusB/BxOiD0jyLWESrWaN/Zq3VfF6aw7U+BZ01xkT+Sj+n/0tVzTBfO3UEf/BGbKBxzOtgw6FumqX0kfnuECBQYAAQAGBwgACQwKAgYDBAEABwgLDAkYZgY9EgHa6+pAYJxCYQEAAABB2RwAAAAAAA==

I'm getting this errorError deserializing transaction: Reached end of buffer unexpectedly

Cannot find a lot of docs either on this topic if you have some tips ! thankssss


Viewing all articles
Browse latest Browse all 8092

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>