I stored a number of Solana transaction signatures in a text file for later processing.
I am using python and the solders sdk/api.
I converted the signature to a string using str(..). I then wrote it to a text file.
When I now read the signature back in and try to use it as a signature in
from solders.signature import Signature
from solana.rpc.api import Client
….
sig = Signature.from_string(array[ptr])
info = connection.get_transaction(sig, max_supported_transaction_version=0)
I get
Traceback (most recent call last):
File “C:UsersTimDocumentssolanaprocessSigs.py”, line 35, in
sig = Signature.from_string(array[ptr])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: string decoded to wrong size for signature
……
I dont know how to get a signature from a string other than using the from_string function.
This is the signature i am working with – its public information so no need for secrecy
2D9PVtBD6d9Nt1PcwoKiWeoQraivSEFSU9qA2X9g3sC3RQ5Vh61MsvWQcDBUQk3AAggrvbxBNdY15noCwo7HShn8
Can you help me please.
Tim.
I havent tried anything else as I was sure fron_string would work.
Tim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.