Repository navigation
v0.38.0
[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 newmodelsmodules (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 deprecatedNamedTuple(or an existing model) into the new Pydantic model to ease migration at API boundaries (#656). - Deprecate all
NamedTupleclasses (params/options/info types insolanaandspl). They now emit aDeprecationWarningpointing to the newmodelsmodule and are flagged by type checkers, but remain fully functional for backwards compatibility (#655). - Instruction builders and RPC client methods accept both the deprecated
NamedTupleand 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
NamedTupleinstances now return the new Pydantic models at runtime. This affects alldecode_*instruction helpers inspl.token.instructionsandspl.memo.instructions, andToken.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]), orisinstance(x, tuple)— will break. Access fields by name instead (#660), (#666). - Migrated internal call sites and documentation off the deprecated
NamedTupletypes to the new Pydantic models (#668).
Added
- Add a
rate_limitparameter toAsyncClientandAsyncHTTPProviderto cap outgoing requests per second. Defaults to0(disabled), so existing behavior is unchanged (#653).
Changed
- BREAKING: Remove the remaining legacy
Transaction/Messagesupport from the client API.Client.send_transaction/AsyncClient.send_transactionandsimulate_transactionnow accept onlyVersionedTransaction(no longerUnion[Transaction, VersionedTransaction]), andget_fee_for_messagenow takesMessageV0instead ofVersionedMessage. TheSimulateLegacyTransactionrequest path was removed, so passing a legacyTransactiontosimulate_transactionno longer works at runtime. UseMessageV0/VersionedTransactioninstead (#669).
Dependencies
- Add
aiolimiter(>=1.1.0) forAsyncClientrate limiting (#653).
New Contributors
Full Changelog: https://github.com/michaelhly/solana-py/blob/master/CHANGELOG.md