Skip to content

v0.38.0

Choose a tag to compare

@michaelhly michaelhly released this 22 Jun 01:50
· 42 commits to master since this release

[0.38.0] - 2026-06-21

This release replaces the library's deprecated NamedTuple types with Pydantic models. The deprecated types still work, so most code keeps running unchanged — see the migration notes below for the two cases that need attention.

Pydantic model migration

  • Add Pydantic model equivalents of every deprecated NamedTuple, under the same names in new models modules (solana.rpc.models, solana.models, spl.token.models, spl.memo.models). They keep the same field names, defaults, and descriptions, so migrating is just an import-path change (#656).
  • Add PydanticModel.from_namedtuple, a helper that coerces a deprecated NamedTuple (or an existing model) into the new Pydantic model to ease migration at API boundaries (#656).
  • Deprecate all NamedTuple classes (params/options/info types in solana and spl). They now emit a DeprecationWarning pointing to the new models module and are flagged by type checkers, but remain fully functional for backwards compatibility (#655).
  • Instruction builders and RPC client methods accept both the deprecated NamedTuple and the new Pydantic model for their params/options arguments, so existing call sites keep working (#659), (#660), (#662), (#664), (#666), (#667).
  • BREAKING: Functions that returned deprecated NamedTuple instances now return the new Pydantic models at runtime. This affects all decode_* instruction helpers in spl.token.instructions and spl.memo.instructions, and Token.get_mint_info() / Token.get_account_info() (sync and async). Pydantic models are not tuples, so code relying on tuple behavior — positional unpacking (a, b = decode_transfer(ix)), integer indexing (info[0]), or isinstance(x, tuple) — will break. Access fields by name instead (#660), (#666).
  • Migrated internal call sites and documentation off the deprecated NamedTuple types to the new Pydantic models (#668).

Added

  • Add a rate_limit parameter to AsyncClient and AsyncHTTPProvider to cap outgoing requests per second. Defaults to 0 (disabled), so existing behavior is unchanged (#653).

Changed

  • BREAKING: Remove the remaining legacy Transaction / Message support from the client API. Client.send_transaction / AsyncClient.send_transaction and simulate_transaction now accept only VersionedTransaction (no longer Union[Transaction, VersionedTransaction]), and get_fee_for_message now takes MessageV0 instead of VersionedMessage. The SimulateLegacyTransaction request path was removed, so passing a legacy Transaction to simulate_transaction no longer works at runtime. Use MessageV0 / VersionedTransaction instead (#669).

Dependencies

  • Add aiolimiter (>=1.1.0) for AsyncClient rate limiting (#653).

New Contributors

Full Changelog: https://github.com/michaelhly/solana-py/blob/master/CHANGELOG.md