Skip to content

fix: replace removed solana.transaction imports with solders - #156

Open
Haaaarry wants to merge 1 commit into
niceberginc:mainfrom
Haaaarry:fix-solana-transaction-imports
Open

fix: replace removed solana.transaction imports with solders#156
Haaaarry wants to merge 1 commit into
niceberginc:mainfrom
Haaaarry:fix-solana-transaction-imports

Conversation

@Haaaarry

Copy link
Copy Markdown

Fixes #135.

Problem

solana-py 0.35 removed the solana.transaction module (Transaction, Signature, and AccountMeta moved to solders). Two files still import from it, so importing the package fails with ModuleNotFoundError: No module named 'solana.transaction':

  • agentipy/utils/moonshot/utils.pyfrom solana.transaction import Signature
  • agentipy/tools/use_moonshot.pyfrom solana.transaction import AccountMeta

Change

  • Signature -> solders.signature.Signature
  • AccountMeta -> solders.instruction.AccountMeta

Both targets are already covered by the project's solders dependency (^0.21.0,<0.24.0), and these files already import other types from solders.*.

Verification

  • python -m py_compile passes for both files.
  • Confirmed against solders==0.23.0 that Signature.from_string(...) and AccountMeta(pubkey=..., is_signer=..., is_writable=...) behave as the code expects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: No module named 'solana.transaction'

1 participant