SuperteamDAO / solathon

☄️ High performance, easy to use and feature-rich Solana SDK for Python.
https://solathon.vercel.app
MIT License
88 stars 32 forks source link

No option to deserialize encoded transaction #84

Closed chigozie-coder closed 2 days ago

chigozie-coder commented 1 week ago

I will like to deserialize a serialized base 58 format transaction.

This is equivalent to transaction.deserialize in Solana py.

I need help thanks

mircial commented 6 days ago

Transaction.from_buffer()

chigozie-coder commented 6 days ago

Transaction.from_buffer()

Thanks, but how do I do something like this Solana py equivalent. I don't have idea how to send raw transaction. Please help. Thanks

# ... under a function
if tx_type == "legacy":
                transaction = Transaction.from_bytes(serialized_tx)
                transaction.sign([keypair], blockhash)
            else:
                return print("TX type not supported :/")

            signature = await client.send_raw_transaction(bytes(transaction))
mircial commented 6 days ago

tx = Transaction.from_buffer(serialized_tx, [keypair]) # make sure the serialized_tx is bytes type client.send_transaction(tx)

GitBolt commented 2 days ago

Did this work? @chigozie-coder If so, you can close the issue, otherwise, feel free to ask further.

chigozie-coder commented 2 days ago

It worked thanks