Releases: StellarCN/py-stellar-base
Releases · StellarCN/py-stellar-base
15.0.0-beta0
Update
- Add CAP-71 (Protocol 27) Soroban authorization support across the high-level API. (#1189)
- New credential types (from the Protocol 27 XDR):
SOROBAN_CREDENTIALS_ADDRESS_V2(CAP-71-02) — same fields as the legacySOROBAN_CREDENTIALS_ADDRESS, but the signed payload is bound to the signer's address.SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES(CAP-71-01) — delegated / multi-party signing via a (possibly nested) tree of delegate signatures.
stellar_sdk.auth.authorize_entry(andstellar_sdk.auth.build_authorization_preimage):- Sign all three address-based credential types, selecting the signature payload from the credential type: legacy
ADDRESSkeeps the non-address-bound preimage;ADDRESS_V2andADDRESS_WITH_DELEGATESuse the address-boundENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESSpreimage.authorize_entrypreviously returned entries with non-ADDRESScredentials unchanged, without signing them. authorize_entrygains a keyword-onlyfor_addressparameter that writes the signature into a specific (possibly nested) delegate node. All signers of one delegated entry sign the same payload, bound to the top-level address, and must use the samevalid_until_ledger_sequence.
- Sign all three address-based credential types, selecting the signature payload from the credential type: legacy
stellar_sdk.auth.authorize_invocation:- Still builds legacy
ADDRESSentries by default, so its output stays valid on every network regardless of Protocol 27 activation. - Gains a keyword-only
credentials_typeparameter to opt in toADDRESS_V2. The default will flip to V2 once Protocol 28 makes it mandatory.
- Still builds legacy
- New
stellar_sdk.auth.build_with_delegates_entry/stellar_sdk.auth.DelegateSignaturewrap anADDRESS/ADDRESS_V2entry together with delegate signers (CAP-71-01), sorting each delegates level by address and rejecting duplicates, as the protocol requires. AssembledTransaction:sign_auth_entriesandneeds_non_invoker_signing_by(and the async variants) handle all address-based credential types; V2 entries previously crashed withAssertionError.- SEP-45 (
stellar_sdk.sep.stellar_soroban_web_authentication): challenge parsing and building acceptADDRESS_V2entries in addition to the legacy type; delegated entries are rejected.
- New credential types (from the Protocol 27 XDR):
- chore: upgrade generated XDR definitions to Protocol 27. (#1186)
14.1.0
Update
- Add SEP-46 contract metadata, SEP-47 contract interface discovery, and SEP-48 contract interface specification introspection APIs for Soroban contract Wasm, including
ContractMeta,ContractSpec,ContractInfo, andSorobanServer[Async].get_contract_*helpers. - Add an Agent Skills compatible
stellar-sdkskill with Claude Code plugin marketplace metadata and topic references for transactions, Horizon, Soroban, XDR/SCVal, async workflows, SEP integrations, security, and troubleshooting.
14.0.0
Breaking changes
- Redesign
stellar_sdk.authso any account contract (default Stellar Account, BLS, WebAuthn, threshold, etc.) can authorize Soroban entries. (#1160)stellar_sdk.auth.authorize_entry(entry, signer, valid_until_ledger_sequence, network_passphrase): thesignercallable is nowCallable[[HashIDPreimage], SCVal](aliasstellar_sdk.auth.AuthorizationSigner) and returns the signatureSCValaccepted by the account contract. It was previouslyCallable[[HashIDPreimage], tuple[str, bytes]]returning(public_key, signature). Passing aKeypaircontinues to produce the default Stellar Account signature shape.stellar_sdk.auth.authorize_invocation(signer, address, valid_until_ledger_sequence, invocation, network_passphrase): the second positional parameter was renamed frompublic_keytoaddress. It accepts only classic account (G...) or contract (C...) addresses, including matchingAddressinstances. It remains optional whensigneris aKeypair.AssembledTransaction.sign_auth_entries(auth_entries_signer, address=None, valid_until_ledger_sequence=None)andAssembledTransactionAsync.sign_auth_entries(...):auth_entries_signernow also accepts anAuthorizationSignercallable. The newaddressparameter selects whichG...orC...entries to sign, is required for non-Keypairsigners, and is inferred from the keypair otherwise. The parameter order is now(signer, address, valid_until_ledger_sequence).AssembledTransaction.sign()andAssembledTransactionAsync.sign()now refuse to sign the transaction envelope while any non-invoker authorization entry is still unsigned, includingC...contract account entries.- New public helpers:
AuthorizationSigner,authorization_payload_hash(preimage), andbuild_authorization_preimage(entry, valid_until_ledger_sequence, network_passphrase).
- Add
max_content_sizetoBaseSyncClient.get()andBaseAsyncClient.get()to prevent memory exhaustion from oversized responses. Custom client implementations must update theirget()signature to includemax_content_size: int | None = None.fetch_stellar_toml,fetch_stellar_toml_async, and federation resolve functions now enforce response size limits. (#1131) - Remove deprecated
StrKey.encode_muxed_accountandStrKey.decode_muxed_account; usestellar_sdk.MuxedAccountinstead. (#1135) - Remove
TransactionBuilder.append_create_stellar_asset_contract_from_address_op; useTransactionBuilder.append_create_contract_opinstead. (#1127) - Drop support for PyPy 3.10. (#1159)
Update
- Upgrade generated Stellar XDR definitions to Protocol 26 through
stellar-xdrv26.0. (#1149) - Improve the
stellar_sdk.contract.AssembledTransactionauthorization lifecycle for contract account authorization. (#1162)- Add
AssembledTransaction.authorize(...)andAssembledTransactionAsync.authorize(...)as clearer aliases for signing Soroban authorization entries. They supportvalid_for_ledger_countfor relative authorization expiration. - Add
AssembledTransaction.prepare()andAssembledTransactionAsync.prepare()to re-simulate and prepare the current built transaction after authorization entries have changed. sign_and_submit()now automatically prepares when aC...contract account authorization was signed, while ordinaryG...account authorizations keep the existing single-simulation flow.- Raise
NeedsPreparationErrorwhen exporting XDR, reading the result, checking read-call status, or signing the transaction envelope before required preparation has happened.
- Add
- Expose
addl_resources(ResourceLeeway) andauth_mode(AuthMode) parameters onAssembledTransaction,AssembledTransactionAsync,ContractClient.invoke, andContractClientAsync.invoke. They are forwarded to the assembled transaction's internal simulation calls, includingsimulate(),prepare(), and post-restore re-simulation. The innerRestoreFootprinttransaction created by automatic state restoration intentionally does not receive them. (#1164) - Add
close_time,header_xdr, andmetadata_xdrtoGetLatestLedgerResponse. (#1136) - Add SEP-0051 XDR-JSON support to the XDR generator. (#1134)
- Sort
SCMapentries by key inscval.to_mapfollowing Soroban runtime ordering. (#1141)
Fixes
- Correct equality checks for
SignedPayloadSignerandSignerKey. (#1153) - Harden XDR parsing and generation:
- validate
OpaqueandStringmax sizes on unpack. - add remaining-input-length checks for variable-length arrays.
- raise on unmatched union discriminants in
pack(). - raise on unknown union discriminants in
unpack(). - check for trailing data in
from_xdr_bytes(). - add length validation for opaque/string typedef and struct constructors.
- fix
CIRCLE_IMPORT_UNIONlazy import tracking. - add decoding depth limit (
DEFAULT_XDR_MAX_DEPTH = 512) to prevent stack overflow from deeply nested XDR.
- validate
Maintenance
- Migrate the Python XDR generator from
xdrgeninto this SDK. (#1113) - Regenerate XDR classes using the latest generator. (#1137)
- Add XDR-JSON tests and a script to compare Python XDR-JSON output against the Rust Stellar CLI. (#1139, #1140)
- Add SBOM submission workflow for PG Atlas. (#1143)
- Update dependencies and test tooling, including Python 3.14 updates.
13.2.1
13.2.0
Update:
- feat: add SEP-45 (Stellar Web Authentication for Contract Accounts) support. Check
stellar_sdk.sep.stellar_soroban_web_authenticationfor more details. - fix: remove
diagnostic_events_xdrfromstellar_sdk.soroban_rpc.Events, usestellar_sdk.soroban_rpc.GetTransactionResponse.diagnostic_events_xdrandstellar_sdk.soroban_rpc.Transaction.diagnostic_events_xdrinstead. (#1086) - chore: drop support for Python 3.9.
- chore: update outdated documentation.
13.1.0
13.0.0
This release adds support for Protocol 23.
This release contains the exact same content as 13.0.0-beta1. Below is the changelog since 12.3.0.
Update:
- feat: add liquidity pool and claimable balance support to
StrKey. (#1060) - feat: add med25519 public keys to
StrKey. (#1061) - feat: add muxed account, liquidity pool and claimable balance support to
Address. (#1062) - feat: implement message signing and verification according to SEP-53, check
Keypair.sign_messageandKeypair.verify_messagefor more details. (#1067) - feat: add a
poll_transactionfunction to Soroban RPC client. (#1038) - refactor: use
tomllibinstead oftomllibrary in Python 3.11 and above. (#1047) - refactor: optimize the user experience of
call_builder.stream. (#1050) - fix: add error handling for incomplete federation responses. (#1051)
- feat: add support for non-root authorization in
SorobanServer[Async].simulate_transaction. (#1069) - feat: update transaction meta handling to support v4 in protocol 23. (#1074)
- fix: correct comparison for
Uint32inxdr.AuthenticatedMessage. (#1076)
Breaking changes
- chore!: upgrade generated XDR definitions to Protocol 23. (#1057)
- chore!: drop support for Python 3.8. (#1065)
- refactor!: rename
read_bytestodisk_read_bytesinSorobanDataBuilderand related methods. (#1058)- In
SorobanDataBuilder, all occurrences ofread_byteshave been replaced withdisk_read_bytes. This includes method names, variable names, etc. TransactionBuilder.append_payment_to_contract_opnow usesdisk_read_bytesinstead ofread_bytesin its function signature.TransactionBuilder.append_restore_asset_balance_entry_opnow usesdisk_read_bytesinstead ofread_bytesin its function signature.
- In
- refactor!:
StrKey.decode_muxed_accountandStrKey.encode_muxed_accounthave been marked as deprecated, please usestellar_sdk.MuxedAccountinstead. They will be removed in the next major release. (#1061) - refactor!: when an invalid account ID is passed into the
MuxedAccount.from_account, it raises aValueErrornow. (#1063) - feat!: adapt to the changes in the Stellar Soroban RPC v23
getEventsinterface. (#1070)- drop
paging_tokenfromEventInfo, usecursorinGetEventsResponseinstead. in_successful_contract_callinEventInfohas been marked as deprecated now.- add
operation_indexandtransaction_indextoEventInfo. - add
oldest_ledger,latest_ledger_close_timeandoldest_ledger_close_timetoGetEventsResponse.
- drop
- feat!: adapt to the changes in the Stellar RPC Soroban v23
getTransactionandgetTransactionsinterface. (#1068)diagnosticEventsinGetTransactionsResponse.transactionshas been marked as deprecated now, useGetTransactionsResponse.transactions[{id}].eventsinstead.
Full Changelog: 12.3.0...13.0.0
13.0.0-beta1
Update:
- feat: update transaction meta handling to support v4 in protocol 23. (#1074)
- fix: correct comparison for
Uint32inxdr.AuthenticatedMessage. (#1076) - fix: fix muxed account handling in
Addressclass. (#1077)
Full Changelog: 13.0.0-beta0...13.0.0-beta1
13.0.0-beta0
This release adds support for Protocol 23.
Update:
- feat: add liquidity pool and claimable balance support to
StrKey. (#1060) - feat: add med25519 public keys to
StrKey. (#1061) - feat: add muxed account, liquidity pool and claimable balance support to
Address. (#1062) - feat: implement message signing and verification according to SEP-53, check
Keypair.sign_messageandKeypair.verify_messagefor more details. (#1067) - feat: add a
poll_transactionfunction to Soroban RPC client. (#1038) - refactor: use
tomllibinstead oftomllibrary in Python 3.11 and above. (#1047) - refactor: optimize the user experience of
call_builder.stream. (#1050) - fix: add error handling for incomplete federation responses. (#1051)
- feat: add support for non-root authorization in
SorobanServer[Async].simulate_transaction. (#1069)
Breaking changes
- chore!: upgrade generated XDR definitions to Protocol 23. (#1057)
- chore!: drop support for Python 3.8. (#1065)
- refactor!: rename
read_bytestodisk_read_bytesinSorobanDataBuilderand related methods. (#1058)- In
SorobanDataBuilder, all occurrences ofread_byteshave been replaced withdisk_read_bytes. This includes method names, variable names, etc. TransactionBuilder.append_payment_to_contract_opnow usesdisk_read_bytesinstead ofread_bytesin its function signature.TransactionBuilder.append_restore_asset_balance_entry_opnow usesdisk_read_bytesinstead ofread_bytesin its function signature.
- In
- refactor!:
StrKey.decode_muxed_accountandStrKey.encode_muxed_accounthave been marked as deprecated, please usestellar_sdk.MuxedAccountinstead. They will be removed in the next major release. (#1061) - refactor!: when an invalid account ID is passed into the
MuxedAccount.from_account, it raises aValueErrornow. (#1063) - feat!: adapt to the changes in the Stellar Soroban RPC v23
getEventsinterface. (#1070)- drop
paging_tokenfromEventInfo, usecursorinGetEventsResponseinstead. in_successful_contract_callinEventInfohas been marked as deprecated now.- add
operation_indexandtransaction_indextoEventInfo. - add
oldest_ledger,latest_ledger_close_timeandoldest_ledger_close_timetoGetEventsResponse.
- drop
- feat!: adapt to the changes in the Stellar RPC Soroban v23
getTransactionandgetTransactionsinterface. (#1068)diagnosticEventsinGetTransactionsResponse.transactionshas been marked as deprecated now, useGetTransactionsResponse.transactions[{id}].eventsinstead.