From 8127321dde5ac574af024a699f588d3dbb8e27d2 Mon Sep 17 00:00:00 2001 From: bonlime Date: Thu, 12 Feb 2026 13:45:28 +0300 Subject: [PATCH] Support latest solana package --- jito_searcher_client/jito_searcher_client/convert.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jito_searcher_client/jito_searcher_client/convert.py b/jito_searcher_client/jito_searcher_client/convert.py index 6a21f66..b3b9858 100644 --- a/jito_searcher_client/jito_searcher_client/convert.py +++ b/jito_searcher_client/jito_searcher_client/convert.py @@ -1,4 +1,10 @@ -from solana.transaction import Transaction +try: + from solana.transaction import Transaction + IS_SOLANA_TRANSACTION = True +except ModuleNotFoundError: + # this allows support of newer 0.35+ versions of solana package + from solders.transaction import Transaction + IS_SOLANA_TRANSACTION = False from solders.transaction import VersionedTransaction from jito_searcher_client.generated.packet_pb2 import Meta, Packet @@ -21,6 +27,6 @@ def tx_to_protobuf_packet(tx: Transaction) -> Packet: Note: setting packet.meta.size is required, the rest are optional """ return Packet( - data=tx.serialize(), + data=tx.serialize() if IS_SOLANA_TRANSACTION else bytes(tx), meta=Meta(size=len(tx.serialize()), addr="0.0.0.0", port=0, flags=None, sender_stake=0), )