Skip to content

Support for Native program Instruction data deserializing #128

@ivan-ngchakming

Description

@ivan-ngchakming

Is adding support for deserialising natively supported instructions such as VoteInstruction and StakeInstruction in the scope of this project?

I have been implementing these in pure python, but I figured it would be much easier to implement and maintain if we can have a rust implementation ported over to python.

from solders.program import VoteInstruction

data = 'Fk63PNurEM8dBP96VYhmcQTRu79bjo9...'
data_bytes = base58.b58decode(data)
VoteInstruction.from_bytes(data_bytes)
>>> VoteStateUpdate(lockouts=[Lockout(slot=285226003, confirmation_count=31), Lockout(slot=285226004, confirmation_count=30), ...], root=285226002, hash=Hash(
    C1tP73LqZd84tyEgxxjNzkMoCpQsddGzDXnrbSy36J9t,
), timestamp=1724365361)

Happy to open PRs if this is in the scope of this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions