- refactor!: remove deprecated
StrKey.encode_muxed_accountandStrKey.decode_muxed_account, usestellar_sdk.MuxedAccountinstead. - refactor!: remove
TransactionBuilder.append_create_stellar_asset_contract_from_address_op, useTransactionBuilder.append_create_contract_opinstead. - feat!: add
max_content_sizeparameter toBaseSyncClient.get()andBaseAsyncClient.get()to prevent DoS via memory exhaustion.fetch_stellar_toml,fetch_stellar_toml_asyncand federation resolve functions now enforce response size limits. Custom client implementations must update theirget()signature to includemax_content_size: int | None = None. - fix: xdr-generator security hardening:
- validate
Opaque/Stringmax 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 in typedef and struct constructors.
- fix
CIRCLE_IMPORT_UNIONlazy import tracking. - add decoding depth limit (
DEFAULT_XDR_MAX_DEPTH = 512) to prevent stack overflow via deeply nested XDR structures.
- validate
- feat(xdr-generator): add SEP-0051 XDR-JSON support.
- feat: add
close_time,header_xdr, andmetadata_xdrtoGetLatestLedgerResponse. - chore: bump stellar-xdr to v25.0.
- fix:
get_transactionsandget_ledgerswith cursor raisesAttributeErrorfor missingend_ledger. (#1105)
- 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.
Released on September 25, 2025
- feat:
getEventsRPC method - exposeendLedgerparam. (#1081)
Released on August 15, 2025
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.
- 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)
- 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.
- 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)
This release adds support for Protocol 23.
- 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)
- 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.
Released on June 05, 2025
- feat: add
get_sac_balancetoSorobanServerandSorobanServerAsync. (#1035)
Released on April 11, 2025
- fix: fix the issue where sending assets using
Transaction.append_payment_to_contract_opfails when the sender's account is the same as the asset issuer's account. (#1029) - fix: allow
SorobanServer.get_events(),.get_transactions(), and.get_ledgers()to be paginated by making thestart_ledgerargument optional. (#1032)
Released on March 04, 2025
- feat: add
TransactionBuilder.append_payment_to_contract_opandTransactionBuilder.append_restore_asset_balance_entry_opto send assets to contract accounts without relying on Stellar RPC. (#1023) - refactor:
AssembledTransaction.simulateandAssembledTransactionAsync.simulatewill no longer restore the state for read-only transactions. (#1026)
Released on December 27, 2024
- feat: Add optional support for Shamir Secret Sharing with
Keypair.from_shamir_mnemonic_phrasesandKeypair.generate_shamir_mnemonic_phrases. (#1010)
Released on November 28, 2024
This is the first stable release that supports Protocol 22. While the network has not upgraded yet, you can start integrating the new features into your codebase if you want a head start.
If you are using this SDK to call Soroban contracts, please check stellar-contract-bindings, which can automatically generate contract binding code for you, making it incredibly easy to call contracts.
The following log is the changes since 11.1.0:
- feat: add support for Soroban PRC's
getVersionInfoAPI interfaces. (#984) - feat: Add
transaction_hashtoGetTransactionResponseandGetTransactionsResponse. (#984) - feat:
scval.from_enumandscval.to_enumnow support multiple values. (#1004) - feat: add support for Soroban PRC's
getLedgersAPI interfaces. (#992) - feat: add
stellar_sdk.contract.ContractClientandstellar_sdk.contract.ContractClientAsync, this greatly reduces the difficulty of calling contracts, and you can learn more through the documentation and examples. (#998)
- refactor!: The
EventInfo.paging_tokenfield has been marked as deprecated, use thecursorinGetEventsResponseinstead. (#984) - refactor!: The legacy
costfield has been removed fromSimulateTransactionResponse, parse it fromtransaction_datainstead. (#984) - feat!: support constructors in contract creation via
TransactionBuilder.append_create_contract_op, the signature of the function has been changed. (#979) - refactor!: Updated
signerparameter in auth to accept a callable returning (public_key, signatures) instead of just public_key. (#982)
Released on November 26, 2024
- feat:
scval.from_enumandscval.to_enumnow support multiple values. (#1004)
Released on November 23, 2024
- fix: fix a bug in
AssembledTransaction.simulate. (#1000)
Released on November 22, 2024
- feat: add
stellar_sdk.contract.ContractClientandstellar_sdk.contract.ContractClientAsync, this greatly reduces the difficulty of calling contracts, and you can learn more through the documentation and examples. (#998)
Released on November 14, 2024
Several hours ago, I released version 12.0.0-beta2, which added support for the Soroban RPC's getLedgers API interface. However, some field names in the implementation need to be renamed.
- refactor: rename
LedgerInfo.ledger_headertoLedgerInfo.header_xdr,LedgerInfo.ledger_metadatatoLedgerInfo.metadata_xdr. (#994)
Released on November 14, 2024
- feat: add support for Soroban PRC's
getLedgersAPI interfaces. (#992)
Released on November 01, 2024
- refactor: add
paging_tokenback toEventInfo. This is to ensure compatibility with older versions of Soroban-RPC. We still recommend using theGetEventsResponse.cursorfield after upgrading Soroban-RPC. (#990)
Released on October 14, 2024
This is the first release that supports Protocol 22. While the network has not upgraded yet, you can start integrating the new features into your codebase if you want a head start.
- feat: add support for Soroban PRC's
getVersionInfoAPI interfaces. (#984) - feat: Add
transaction_hashtoGetTransactionResponseandGetTransactionsResponse. (#984)
- refactor!: The
paging_tokenfield has been removed fromEventInfo, use thecursorinGetEventsResponseinstead. (Reverted in 12.0.0-beta1) (#984) - refactor!: The legacy
costfield has been removed fromSimulateTransactionResponse, parse it fromtransaction_datainstead. (#984) - feat!: support constructors in contract creation via
TransactionBuilder.append_create_contract_op, the signature of the function has been changed. (#979) - refactor!: Updated
signerparameter in auth to accept a callable returning (public_key, signatures) instead of just public_key. (#982)
Released on September 18, 2024
- feat: add support for Soroban PRC's
getTransactionsandgetFeeStatsAPI interfaces. (#960) - feat: add support for Horizon's
transactions_asyncAPI interfaces. (#961) - fix: fix
authorize_entryto use the correct public key when passingKeypairas signer. (#971) - feat: Expose
stellar_sdk.address.AddressTypefor easy importing. (#973) - chore: bump dependencies.
Released on July 16, 2024
- feat:
SorobanServer.send_transactionsupports sending FeeBumpTransactionEnvelope. (#956) - fix: Corrected the issue where
TransactionBuilder.from_xdrcould not properly parse transactions containing Soroban operations. (#957) - fix: Corrected the issue where
FeeBumpTransactionEnvelope.from_xdrcould not properly parse transactions containing Soroban operations. (#957) - refactor:
TransactionBuilder.from_xdrpreviously could returnTransactionBuilderorFeeBumpTransactionEnvelope. Now it will no longer returnTransactionBuilder, but will returnTransactionEnvelopeorFeeBumpTransactionEnvelope. (#957) - feat:
TransactionBuilder.build_fee_bump_transactionnow supports transactions containing Soroban operations. (#957) - fix: fix the issue where invoking
SorobanServer.prepare_transactionfor transactions that have already setSorobanDatacould result in unexpected high fees. (#957) - chore: bump dependencies.
- refactor:
FeeBumpTransactionEnvelope.base_feehas been removed. Please useFeeBumpTransactionEnvelope.fee instead. Note that their meanings are different: (#957)FeeBumpTransactionEnvelope.base_feerepresented the maximum fee you were willing to pay per operation for this transaction.FeeBumpTransactionEnvelope.feerepresents the maximum fee you are willing to pay for this transaction.
- refactor:
TransactionBuilder.from_xdrpreviously could returnTransactionBuilderorFeeBumpTransactionEnvelope. Now it will no longer returnTransactionBuilder, but will returnTransactionEnvelopeorFeeBumpTransactionEnvelope. (#957) - refactor:
helpers.parse_transaction_envelope_from_xdrhas been marked as deprecated. Please use the refactoredTransactionEnvelope.from_xdrinstead. (#957)
Released on May 15, 2024
- improve: The function in
stellar_xdr.scvalcan acceptsc_valofbase64andbytestypes. (#932) - feat: add support for Soroban-RPC 21. (#933)
- refactor: use
__repr__instead of__str__in classes. (#936) - feat: add a helper function to convert SCVal to native types. (#937)
- chore: updated various dependencies.
- feat: add support for Soroban-RPC 21, you need to upgrade Soroban PRC to version v21 or above. (#933)
Released on May 01, 2024
- chore: The generated XDR has been upgraded to match the upcoming Protocol 21, namely stellar/stellar-xdr@v21.1. (#927)
- chore: updated various dependencies.
Released on March 13, 2024
- feat: Add
Asset.contract_id()for calculating the id of the asset contract. (#901) - chore: throw an exception when the API does not provide streaming support. (#878)
Released on Jan 14, 2024
- feat: add
scv.to_voidandscv.from_void. (#863) - feat: Support for the new, optional
diagnostic_events_xdrfield on theSorobanServer.send_transactionmethod. (#866) - chore: update dependencies.
Released on Jan 3, 2024
- fix: fix the way of exporting modules to resolve pyright warnings. (#858)
Released on Dec 26, 2023
- fix: mark GetTransactionResponse.create_at as Optional. (#854)
Released on Dec 16, 2023
- improve: add the missing
create_atfield toGetTransactionResponse. (#849)
Released on Dec 16, 2023
- feat: support resource leeway parameter when simulating Soroban transactions. (#846)
- refactor: the type of
GetEventsRequest.start_ledgerhas changed fromstrtoint. (#847)
Released on Dec 9, 2023
- fix: fix the issue of incorrect handling of special horizon links on the Windows platform. (#825)
- chore: add support for Python 3.12. (#799)
- chore:
SorobanServeruses testnet instead of futurenet by default (#831)
Released on Nov 15, 2023
- refactor: make the
parametersparameter inTransactionBuilder.append_invoke_contract_function_opoptional. (#789) - improve: sort the dictionary based on the key when calling
scval.to_struct. (#817)
- chore: drop support for Python 3.7. (#813)
- refactor: replace
stellar-base-sseclientwithrequests-sseto improve the stability of the stream. Previously, when encountering an error, it would throw aConnectionError, but now it will throw aStreamClientError. (#814) - feat: update the SDK to the stable Protocol 20 release, this contains some breaking updates, please check #808 for more information. (#809)
Released on September 20, 2023
- feat: add helper functions to sign authorization entries. (#776)
- feat: add
SorobanServerAsyncto support asynchronous requests. (#782)
Released on September 16, 2023
- feat: add support for Soroban Preview 11 (#777)
Released on Aug 28, 2023
- fix: fix the issue where soroban data is not correctly set when building a transaction through TransactionBuilder. (#770)
Released on Aug 27, 2023
- feat: add support for Soroban Preview 10. Please check the examples in the
examplesfolder to learn how to use it.
- Runtime type checking has now been removed. Please use tools like mypy for type checking. (#706)
- Add
__hash__to the xdr classes. (#757) - Make
aiohttpandaiohttp-sse-clientas optional dependencies. (#765) - Publishing to PyPI with a Trusted Publisher. (#767)
- Update dependencies.
- Remove
ValueError,TypeErrorandAttributeErrorfromstellar_sdk.exceptions. (#763)
Released on June 22, 2023
- feat: add comparison operators to Price class. (#741)
Released on March 15, 2023
- feat: add support for SEP-0035. (#711)
- Python 3.6 is no longer supported.
Released on October 12, 2022
- docs: correct the horizon address of the public network (#611)
- deps: Update dependencies.
Released on June 13, 2022
- feat: allow custom headers to be set in
stellar_sdk.client.requests_client.RequestsClient. (#600) - feat: allow custom headers to be set in
stellar_sdk.client.aiohttp_client.AiohttpClient. (#601)
Released on June 06, 2022
Released on May 07, 2022
This release includes breaking changes.
This release adds support for Protocol 19.
It includes CAP-21 (new transaction preconditions) and CAP-40 (signed payload signers).
Transaction.time_boundshas been removed, please useTransaction.preconditions.time_boundsinstead.- No longer sets "now" as the default cursor for AiohttpClient.stream (#591)
- Some breaking updates are included in XDR, you can check the changes here.
-
Support for converting signed payloads (CAP-40) to and from their StrKey (
P...) representation, you can find the example here. -
Support for creating transactions with the new preconditions (CAP-21) via
TransactionBuilder, you can find the example here.-
TransactionBuilder.set_ledger_bounds(min_ledger: int, max_ledger: int) -
TransactionBuilder.set_min_sequence_number(min_sequence_number: int) -
TransactionBuilder.set_min_sequence_age(min_sequence_age: int) -
TransactionBuilder.set_min_sequence_ledger_gap(min_sequence_ledger_gap: int) -
TransactionBuilder.add_extra_signer(signer_key: Union[SignerKey, SignedPayloadSigner, str])
-
-
Support for Signing transactions containing the ed25519 payload extra signer, you can find the example here.
Keypair.sign_payload_decorated(data: bytes)TransactionEnvelope.sign_extra_signers_payload(signer: Union[Keypair, str])
-
Support for CAP-21 has been added to
stellar_sdk.sep.txrep.
-
feat: you can turn off runtime type checking by configuring
STELLAR_SDK_RUNTIME_TYPE_CHECKING=0in environment variables. (#589)In order to make the program more rigorous and novice friendly, we previously introduced runtime type checking, but this would cause a significant performance penalty, so now we allow users to turn it off.
-
refactor: remove runtime type checking in
stellar_sdk.xdrpackage (#584)
Released on April 24, 2022
- refactor: no longer sets "now" as the default cursor for AiohttpClient.stream (#591)
Released on April 24, 2022
- feat: add
server.offers().for_account(account_id)to retrieve the account's offers. (#590)
Released on April 20, 2022
This is a pre-release version, please do not use it in production.
-
feat: you can turn off runtime type checking by configuring
STELLAR_SDK_RUNTIME_TYPE_CHECKING=0in environment variables. (#589)In order to make the program more rigorous and novice friendly, we previously introduced runtime type checking, but this would cause a significant performance penalty, so now we allow users to turn it off.
Released on April 19, 2022
This is a pre-release version, please do not use it in production.
- refactor: remove runtime type checking in
stellar_sdk.xdrpackage (#584)
Released on April 13, 2022
This is a pre-release version, please do not use it in production.
It includes CAP-21 (new transaction preconditions) and CAP-40 (signed payload signers).
Transaction.time_boundsis moved toTransaction.preconditions.time_bounds.- Some breaking updates are included in XDR, you can check the changes here.
-
Support for converting signed payloads (CAP-40) to and from their StrKey (
P...) representation, you can find the example here. -
Support for creating transactions with the new preconditions (CAP-21) via
TransactionBuilder, you can find the example here.-
TransactionBuilder.set_ledger_bounds(min_ledger: int, max_ledger: int) -
TransactionBuilder.set_min_sequence_number(min_sequence_number: int) -
TransactionBuilder.set_min_sequence_age(min_sequence_age: int) -
TransactionBuilder.set_min_sequence_ledger_gap(min_sequence_ledger_gap: int) -
TransactionBuilder.add_extra_signer(signer_key: Union[SignerKey, SignedPayloadSigner, str])
-
-
Support for Signing transactions containing the ed25519 payload extra signer, you can find the example here.
Keypair.sign_payload_decorated(data: bytes)TransactionEnvelope.sign_extra_signers_payload(signer: Union[Keypair, str])
-
Support for CAP-21 has been added to
stellar_sdk.sep.txrep.
Released on April 24, 2022
- feat: add
server.offers().for_account(account_id)to retrieve the account's offers. (#590)
Released on April 07, 2022
- fix: fixed-length arrays pack/unpack should not include length, but the previous releases incorrectly include it. (#581)
Released on February 23, 2022
- feat: make stellar_sdk.Asset hashable. (#576)
Released on January 12, 2022
This update includes breaking changes.
This release introduces unconditional support for muxed accounts. (#574)
- In v4.0.0, we introduced opt-in support for muxed accounts,
you would need to set
ENABLE_SEP_0023totruein the environment variable to enable support for this feature. In the new release, this feature will be enabled by default. (#574)
-
Introduced a helper function which lets you pre-determine the hex claimable balance ID of a CreateClaimableBalance operation prior to submission to the network: (#575)
class Transaction: def get_claimable_balance_id(self, operation_index: int) -> str: pass
- When the user builds a transaction through TransactionBuilder but does not set TimeBounds, the SDK will give a warning. (#565)
stellar_sdk.xdrmodule adds some validation to the data. (#564)
Released on November 24, 2021
- Specify the version of urllib3 >= 1.26.7 and < 2.0.0. (#563)
Released on November 17, 2021
- feat: add a way to filter liquidity pools by participating account. (#558)
Released on November 15, 2021
- Upgrade outdated third-party dependencies.
Released on November 13, 2021
This update includes breaking changes.
- As we introduced in the 5.0.0 release log, this release contains almost no new features, but contains a lot of refactorings, which improve the quality of the code and reduce the chance of users making mistakes.
- I would like to draw your attention to the changes in
TransactionBuilder. This update changes some functions that have not been changed since v0.1.x, and I know that this change will affect many existing tutorials and programs, so please pay particular attention to this.
- Added a
py.typedfile so that mypy will know to use our type annotations, I strongly recommend that you use it in development. (#543) - Strictly check whether the type of data input by the user meets the requirements, and if it does not,
TypeErrorwill be thrown. (#542) (#544) universal_account_idattribute has been added tostellar_sdk.MuxedAccountandstellar_sdk.Account, please turn to the documentation to find out more. (#548)- Improve document.
-
stellar_sdk.Servercan now only be used to send synchronous requests, if you need to send asynchronous requests, usestellar_sdk.ServerAsyncinstead. (#540) -
The signature of the following function contained in
stellar_sdk.TransactionBuilderhas changed: (#547)- append_change_trust_op
- append_payment_op
- append_path_payment_strict_receive_op
- append_path_payment_strict_send_op
- append_manage_buy_offer_op
- append_manage_sell_offer_op
- append_create_passive_sell_offer_op
-
append_change_trust_liquidity_pool_asset_opinstellar_sdk.TransactionBuilderhas been removed, please useappend_change_trust_opinstead. (#547) -
The initialization function for
stellar_sdk.Accounthas changed, previously it wasdef __init__(self, account_id: Union[str, MuxedAccount], sequence: int)and now it isdef __init__(self, account: Union[str, MuxedAccount], sequence: int, raw_data: Dict[str, Any]). (#548) -
stellar_sdk.exceptions.ValueError,stellar_sdk.exceptions.TypeErrorandstellar_sdk.exceptions.AttributeErrorare no longer subclass ofstellar_sdk.exceptions.SdkError, they are now aliases for Python's built-in functions. (#549) -
The previous type of
stellar_sdk.BaseTransactionEnvelope.signatureswasstellar_sdk.xdr.DecoratedSignature, now it isstellar_sdk.DecoratedSignature. (#538) -
stellar_sdk.sep.federation.resolve_stellar_addressandstellar_sdk.sep.federation.resolve_account_idcan also only be used to send synchronization requests, pleasestellar_sdk.sep.federation.resolve_stellar_address_asyncandstellar_sdk.sep.federation.resolve_account_id_asyncto send asynchronous requests. (#540) -
stellar_sdk.sep.stellar_toml.fetch_stellar_tomlcan also only be used to send synchronization requests, pleasestellar_sdk.sep.stellar_toml.fetch_stellar_toml_asyncto send asynchronous requests. (#540) -
The initialization function for
stellar_sdk.SignerKeyhas changed, previously it wasdef __init__(self, signer_key: stellar_xdr.SignerKey)and now it isdef __init__(self, signer_key: bytes, signer_key_type: SignerKeyType), the attribute contained therein has been changed accordingly. (#537) -
clear_flagsandset_flagsinstellar_sdk.operation.SetOptionshave been changed tostellar_sdk.operation.AuthorizationFlagtype, previously it wasint. (#528) -
the client's
USER_AGENTandIDENTIFICATION_HEADERSare changed to "py-stellar-base" (#550) -
The types of the following attribute may have previously varied with the type of the parameters entered by the user, but now they are deterministic: (#528)
attribute current type stellar_sdk.operation.ChangeTrust.limit str stellar_sdk.operation.Clawback.amount str stellar_sdk.operation.CreateAccount.starting_balance str stellar_sdk.operation.CreateClaimableBalance.amount str stellar_sdk.operation.CreatePassiveSellOffer.amount str stellar_sdk.operation.CreatePassiveSellOffer.price Price stellar_sdk.operation.LiquidityPoolDeposit.max_amount_a str stellar_sdk.operation.LiquidityPoolDeposit.max_amount_b str stellar_sdk.operation.LiquidityPoolDeposit.min_price Price stellar_sdk.operation.LiquidityPoolDeposit.max_price Price stellar_sdk.operation.LiquidityPoolWithdraw.amount str stellar_sdk.operation.LiquidityPoolWithdraw.min_amount_a str stellar_sdk.operation.LiquidityPoolWithdraw.min_amount_b str stellar_sdk.operation.ManageBuyOffer.amount str stellar_sdk.operation.ManageBuyOffer.price Price stellar_sdk.operation.ManageSellOffer.amount str stellar_sdk.operation.ManageSellOffer.price Price stellar_sdk.operation.PathPaymentStrictReceive.send_max str stellar_sdk.operation.PathPaymentStrictReceive.dest_amount str stellar_sdk.operation.PathPaymentStrictSend.send_amount str stellar_sdk.operation.PathPaymentStrictSend.dest_min str stellar_sdk.operation.Payment.amount str
Released on November 01, 2021
This is a pre-release version, please do not use it in production.
- Added more test cases.
Released on October 29, 2021
This is a pre-release version, please do not use it in production.
- Improve documentation.
- refactor: optimize the implementation of StrKey. (#551)
Released on October 26, 2021
This update includes breaking changes. This is a pre-release version, please do not use it in production.
- refactor: the client's
USER_AGENTandIDENTIFICATION_HEADERSare changed to "py-stellar-base" (#550)
Released on October 25, 2021
This update includes breaking changes. This is a pre-release version, please do not use it in production.
As we introduced in the 5.0.0 release log, this release contains almost no new features, but contains a lot of refactorings, which improve the quality of the code and reduce the chance of users making mistakes.
- Added a
py.typedfile so that mypy will know to use our type annotations, I strongly recommend that you use it in development. (#543) - Strictly check whether the type of data input by the user meets the requirements, and if it does not,
TypeErrorwill be thrown. (#542) (#544) universal_account_idattribute has been added tostellar_sdk.MuxedAccountandstellar_sdk.Account, please turn to the documentation to find out more. (#548)- Improve document.
-
stellar_sdk.Servercan now only be used to send synchronous requests, if you need to send asynchronous requests, usestellar_sdk.ServerAsyncinstead. (#540) -
The signature of the following function contained in
stellar_sdk.TransactionBuilderhas changed: (#547)- append_change_trust_op
- append_payment_op
- append_path_payment_strict_receive_op
- append_path_payment_strict_send_op
- append_manage_buy_offer_op
- append_manage_sell_offer_op
- append_create_passive_sell_offer_op
-
append_change_trust_liquidity_pool_asset_opinstellar_sdk.TransactionBuilderhas been removed, please useappend_change_trust_opinstead. (#547) -
The initialization function for
stellar_sdk.Accounthas changed, previously it wasdef __init__(self, account_id: Union[str, MuxedAccount], sequence: int)and now it isdef __init__(self, account: Union[str, MuxedAccount], sequence: int, raw_data: Dict[str, Any]). (#548) -
stellar_sdk.exceptions.ValueError,stellar_sdk.exceptions.TypeErrorandstellar_sdk.exceptions.AttributeErrorare no longer subclass ofstellar_sdk.exceptions.SdkError, they are now aliases for Python's built-in functions. (#549) -
The previous type of
stellar_sdk.BaseTransactionEnvelope.signatureswasstellar_sdk.xdr.DecoratedSignature, now it isstellar_sdk.DecoratedSignature. (#538) -
stellar_sdk.sep.federation.resolve_stellar_addressandstellar_sdk.sep.federation.resolve_account_idcan also only be used to send synchronization requests, pleasestellar_sdk.sep.federation.resolve_stellar_address_asyncandstellar_sdk.sep.federation.resolve_account_id_asyncto send asynchronous requests. (#540) -
stellar_sdk.sep.stellar_toml.fetch_stellar_tomlcan also only be used to send synchronization requests, pleasestellar_sdk.sep.stellar_toml.fetch_stellar_toml_asyncto send asynchronous requests. (#540) -
The initialization function for
stellar_sdk.SignerKeyhas changed, previously it wasdef __init__(self, signer_key: stellar_xdr.SignerKey)and now it isdef __init__(self, signer_key: bytes, signer_key_type: SignerKeyType), the attribute contained therein has been changed accordingly. (#537) -
clear_flagsandset_flagsinstellar_sdk.operation.SetOptionshave been changed tostellar_sdk.operation.AuthorizationFlagtype, previously it wasint. (#528) -
The types of the following attribute may have previously varied with the type of the parameters entered by the user, but now they are deterministic: (#528)
attribute current type stellar_sdk.operation.ChangeTrust.limit str stellar_sdk.operation.Clawback.amount str stellar_sdk.operation.CreateAccount.starting_balance str stellar_sdk.operation.CreateClaimableBalance.amount str stellar_sdk.operation.CreatePassiveSellOffer.amount str stellar_sdk.operation.CreatePassiveSellOffer.price Price stellar_sdk.operation.LiquidityPoolDeposit.max_amount_a str stellar_sdk.operation.LiquidityPoolDeposit.max_amount_b str stellar_sdk.operation.LiquidityPoolDeposit.min_price Price stellar_sdk.operation.LiquidityPoolDeposit.max_price Price stellar_sdk.operation.LiquidityPoolWithdraw.amount str stellar_sdk.operation.LiquidityPoolWithdraw.min_amount_a str stellar_sdk.operation.LiquidityPoolWithdraw.min_amount_b str stellar_sdk.operation.ManageBuyOffer.amount str stellar_sdk.operation.ManageBuyOffer.price Price stellar_sdk.operation.ManageSellOffer.amount str stellar_sdk.operation.ManageSellOffer.price Price stellar_sdk.operation.PathPaymentStrictReceive.send_max str stellar_sdk.operation.PathPaymentStrictReceive.dest_amount str stellar_sdk.operation.PathPaymentStrictSend.send_amount str stellar_sdk.operation.PathPaymentStrictSend.dest_min str stellar_sdk.operation.Payment.amount str
Released on November 10, 2021
- Upgrade outdated third-party dependencies.
Released on October 06, 2021
This update includes breaking changes.
- This release adds support for Automated Market Makers. For details, you can refer to CAP-38 for XDR changes and this document for detailed changes to the Horizon API. (Download Horizon Liquidity Pool API.pdf)
- You can get a simple example of CAP-38 here.
- Although this update is a major version update, but only the
stellar.xdrmodule contains breaking changes, if you don’t directly rely on this module in your code, you should be able to migrate easily. - I want to make some improvements to the SDK, but I don’t want to introduce too many breaking changes in this version, so I plan to postpone it to the next major version. The next major version features will not include feature updates, I will do my best to make it easy to migrate.
- I will not be adding Stellar Protocol 18 support to v2.x. I will only provide the necessary security updates and will end support for it on 2022.01.01.
- Introduced new CAP-38 operations
LiquidityPoolDepositandLiquidityPoolWithdraw. - Introduced two new types of assets,
LiquidityPoolIdandLiquidityPoolAsset. - The following functions have been added to
TransactionBuilder:append_liquidity_pool_deposit_opappend_liquidity_pool_withdraw_opappend_revoke_liquidity_pool_sponsorship_opappend_change_trust_liquidity_pool_asset_op
- Introduced a
LiquidityPoolsCallBuilderto make calls to a new endpoint, you can useServer.liquidity_poolsto build it. - Expanded the
TransactionsCallBuilder,OperationsCallBuilder,TradesCallBuilderandEffectsCallBuilderto apply to specific liquidity pools. - Expanded the
TradesCallBuilderto support fetching liquidity pool trades and accepts a newtrade_typefilter. - Update SEP-11 to support CAP-38
Breaking changes (#512)
- This XDR file contains breaking changes, you can click here to view the changes.
Released on September 23, 2021
This is a pre-release version, please do not use it in production.
- fix: SEP-10, fix case where muxed accounts are not enabled. (#530)
Released on September 23, 2021
- fix: SEP-10, fix case where muxed accounts are not enabled. (#530)
Released on September 21, 2021
This is a pre-release version, please do not use it in production.
This beta release adds support for Automated Market Makers. For details, you can refer to CAP-38 for XDR changes and this document for detailed changes to the Horizon API.
- feat: add
/liquidity_pools/:pool_id/tradesendpoint support. (#527) - Contains the updates provided in v4.2.0 and v4.2.1.
Released on September 18, 2021
- add check for muxed accounts in
verify_challenge_transaction(). (#525) read_challenge_transaction()now checkstimebounds.min_timewith a 5-minute grace period to account for clock drift. (#526)
Released on September 17, 2021
- Updated the following SEP-10 utility functions to be compliant with the protocols (#521, stellar-protocol/#1036):
- Updated
build_challenge_transaction()to accept muxed accounts (M...) for client account IDs. - Updated
build_challenge_transaction()to accept amemoparameter to attach to the challenge transaction. - Updated
ChallengeTransactionto provide amemoproperty. - Updated
read_challenge_transaction()to validate challenge transactions with muxed accounts (M...) as the client account ID.
- Updated
Released on September 11, 2021
This update includes breaking changes.
This is a pre-release version, please do not use it in production.
- Although this update is a major version update, but only the
stellar.xdrmodule contains breaking changes, if you don’t directly rely on this module in your code, you should be able to migrate easily. - I want to make some improvements to the SDK, but I don’t want to introduce too many breaking changes in this version, so I plan to postpone it to the next major version. The next major version features will not include feature updates, I will do my best to make it easy to migrate.
- I will not be adding Stellar Protocol 18 support to v2.x. I will only provide the necessary security updates and will end support for it on 2022.01.01.
- Since Stellar Protocol 18 has not yet been deployed to the test network, I have not provided relevant examples for the time being, I will provide it later.
- Introduced new CAP-38 operations
LiquidityPoolDepositandLiquidityPoolWithdraw. - Introduced two new types of assets,
LiquidityPoolIdandLiquidityPoolAsset. - The following functions have been added to
TransactionBuilder:append_liquidity_pool_deposit_opappend_liquidity_pool_withdraw_opappend_revoke_liquidity_pool_sponsorship_opappend_change_trust_liquidity_pool_asset_op
- Introduced a
LiquidityPoolsCallBuilderto make calls to a new endpoint, you can useServer.liquidity_poolsto build it. - Expanded the
TransactionsCallBuilder,OperationsCallBuilder, andEffectsCallBuilderto apply to specific liquidity pools. - Expanded the
TradesCallBuilderto support fetching liquidity pool trades and accepts a newtrade_typefilter. - Update SEP-11 to support CAP-38
Breaking changes (#512)
- This XDR file contains breaking changes, you can click here to view the changes.
Released on September 05, 2021
This update includes breaking changes.
This is a pre-release version, please do not use it in production.
- Although this update is a major version update, it only contains a small number of breaking changes, and you should be able to migrate easily.
- I want to make some improvements to the SDK, but I don’t want to introduce too many breaking changes in this version, so I plan to postpone it to the next major version. The next major version features will not include feature updates, I will make it as easy to migrate as possible, thanks.
- I will not be adding Stellar Protocol 18 support to v2.x. I will only provide the necessary security updates and will end support for it on 2022.01.01.
- Since Stellar Protocol 18 has not yet been deployed to the test network, I have not provided relevant examples for the time being, I will provide it later.
Add (#512)
- Introduced new CAP-38 operations
LiquidityPoolDepositandLiquidityPoolWithdraw. - Introduced two new types of assets,
LiquidityPoolIdandLiquidityPoolAsset. - The following functions have been added to
TransactionBuilder:append_liquidity_pool_deposit_opappend_liquidity_pool_withdraw_opappend_revoke_liquidity_pool_sponsorship_op
- Introduced a
LiquidityPoolsCallBuilderto make calls to a new endpoint, you can useServer.liquidity_poolsto build it. - Expanded the
TransactionsCallBuilder,OperationsCallBuilder, andEffectsCallBuilderto apply to specific liquidity pools. - Expanded the
TradesCallBuilderto support fetching liquidity pool trades and accepts a newtrade_typefilter.
Breaking changes (#512)
-
This XDR file contains breaking changes, you can click here to view the changes.
-
Due to the introduction of new asset types, the signature of
TransactionBuilder.append_change_trust_ophas been changed. (c152dbb)Formerly:
def append_change_trust_op( self, asset_code: str, asset_issuer: str, limit: Union[str, Decimal] = None, source: Optional[Union[MuxedAccount, str]] = None, ) -> "TransactionBuilder": pass
Now:
def append_change_trust_op( self, asset: Union[Asset, LiquidityPoolAsset], limit: Union[str, Decimal] = None, source: Optional[Union[MuxedAccount, str]] = None, ) -> "TransactionBuilder": pass
Released on August 23, 2021
- fix: AiohttpClient.str() references missing instance attribute self.pool_size. (#511)
- refactor: use binascii.crc_hqx to calculate checksum. (#507)
- chore: upgrade package dependencies.
Released on July 28, 2021
- feat: SEP-0011, add support for the following operations: (#502)
- CreateClaimableBalance
- ClaimClaimableBalance
- BeginSponsoringFutureReserves
- EndSponsoringFutureReserves
- RevokeSponsorship
- Clawback
- ClawbackClaimableBalance
- SetTrustLineFlags
-
feat: SEP-0011, add support for the muxed account. (#503)
If you want to enable this feature, please set
ENABLE_SEP_0023totruein the environment variable; otherwise, you will encounter exceptions when processing with muxed account, check here for more detail. -
feat: SEP-0011, add comments to txrep to improve readability. (#504)
Released on June 30, 2021
This update includes breaking changes.
-
feat: add support for CAP-0027 and SEP-0023. (#479 #492 #493):
SEP-0023 is still a Draft, so currently we do not enable it by default. If you want to enable this feature, please set
ENABLE_SEP_0023totruein the environment variable
-
The following fields, which were previously an
strare now astellar_sdk.MuxedAccount(#479):stellar_sdk.Transaction.sourcestellar_sdk.FeeBumpTransaction.fee_sourcestellar_sdk.operation.AccountMerge.destinationstellar_sdk.operation.PathPaymentStrictReceive.destinationstellar_sdk.operation.PathPaymentStrictSend.destinationstellar_sdk.operation.PathPayment.destinationstellar_sdk.operation.Payment.destinationstellar_sdk.operation.Clawback.from_
-
stellar_sdk.operation.Operation.sourcepreviously returnedOptional[str], now it returnsOptional[stellar_sdk.MuxedAccount]. (#479) -
stellar_sdk.sep.stellar_web_authentication.read_challenge_transactionpreviously returned a tuple, now it returnsstellar_sdk.sep.stellar_web_authentication.ChallengeTransaction. (#454) -
The
v1parameter in thestellar_sdk.Transaction.from_xdr_objectandstellar_sdk.Transaction.from_xdrfunctions is set toTrueby default. (#494)
stellar_sdk.Account.account_idhas been marked as deprecated, it will be removed in v5.0.0, usestellar_sdk.Account.accountinstead. (#479)
If you want to enable SEP-0023 support, please set ENABLE_SEP_0023 to true in the environment variable, on Linux and MacOS, generally you can use export ENABLE_SEP_0023=true to set it.
-
MuxedAccount
from stellar_sdk import MuxedAccount account_id = "GAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSTVY" account_muxed_id = 1234 account_muxed = "MAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSAAAAAAAAAAE2LP26" # generate account_muxed muxed = MuxedAccount(account_id=account_id, account_muxed_id=1234) # account_muxed_id is optional. print(f"account_muxed: {muxed.account_muxed}") # `account_muxed` returns `None` if `account_muxed_id` is `None`. # parse account_muxed muxed = MuxedAccount.from_account(account_muxed) print(f"account_id: {muxed.account_id}\naccount_muxed_id: {muxed.account_muxed_id}")
-
Pay to muxed account
import pprint from stellar_sdk import Keypair, Server, MuxedAccount, TransactionBuilder, Network horizon_url = "https://horizon-testnet.stellar.org/" network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE alice_secret = "SAHN2RCKC5I7NFDCIUKA3BG4H4T6WMLLGSAZVDKUHF7PQXHMYWD7UAIH" bob_account = MuxedAccount( account_id="GBZSQ3YZMZEWL5ZRCEQ5CCSOTXCFCMKDGFFP4IEQN2KN6LCHCLI46UMF", account_muxed_id=1234, ) print(f"account_id_muxed: {bob_account.account_muxed}") # You can also use addresses starting with M. # bob_account = "MBZSQ3YZMZEWL5ZRCEQ5CCSOTXCFCMKDGFFP4IEQN2KN6LCHCLI46AAAAAAAAAAE2L2QE" alice_keypair = Keypair.from_secret(alice_secret) server = Server(horizon_url=horizon_url) alice_account = server.load_account(alice_keypair.public_key) transaction = TransactionBuilder( source_account=alice_account, network_passphrase=network_passphrase, base_fee=100 ) \ .append_payment_op(destination=bob_account, amount="100", asset_code="XLM") \ .build() transaction.sign(alice_keypair) resp = server.submit_transaction(transaction) pprint.pprint(resp)
Released on June 29, 2021
This update includes breaking changes.
This is a pre-release version, please do not use it in production.
-
feat: add support for CAP-0027 and SEP-0023. (#479 #492 #493):
SEP-0023 is still a Draft, so currently we do not enable it by default. If you want to enable this feature, please set
ENABLE_SEP_0023totruein the environment variable
-
The following fields, which were previously an
strare now astellar_sdk.MuxedAccount(#479):stellar_sdk.Transaction.sourcestellar_sdk.FeeBumpTransaction.fee_sourcestellar_sdk.operation.AccountMerge.destinationstellar_sdk.operation.PathPaymentStrictReceive.destinationstellar_sdk.operation.PathPaymentStrictSend.destinationstellar_sdk.operation.PathPayment.destinationstellar_sdk.operation.Payment.destinationstellar_sdk.operation.Clawback.from_
-
stellar_sdk.operation.Operation.sourcepreviously returnedOptional[str], now it returnsOptional[stellar_sdk.MuxedAccount]. (#479) -
stellar_sdk.sep.stellar_web_authentication.read_challenge_transactionpreviously returned a tuple, now it returnsstellar_sdk.sep.stellar_web_authentication.ChallengeTransaction. (#454)
stellar_sdk.Account.account_idhas been marked as deprecated, it will be removed in v5.0.0, usestellar_sdk.Account.accountinstead. (#479)
If you want to enable SEP-0023 support, please set ENABLE_SEP_0023 to true in the environment variable, on Linux and MacOS, generally you can use export ENABLE_SEP_0023=true to set it.
-
MuxedAccount
from stellar_sdk import MuxedAccount account_id = "GAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSTVY" account_muxed_id = 1234 account_muxed = "MAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSAAAAAAAAAAE2LP26" # generate account_muxed muxed = MuxedAccount(account_id=account_id, account_muxed_id=1234) # account_muxed_id is optional. print(f"account_muxed: {muxed.account_muxed}") # `account_muxed` returns `None` if `account_muxed_id` is `None`. # parse account_muxed muxed = MuxedAccount.from_account(account_muxed) print(f"account_id: {muxed.account_id}\naccount_muxed_id: {muxed.account_muxed_id}")
-
Pay to muxed account
import pprint from stellar_sdk import Keypair, Server, MuxedAccount, TransactionBuilder, Network horizon_url = "https://horizon-testnet.stellar.org/" network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE alice_secret = "SAHN2RCKC5I7NFDCIUKA3BG4H4T6WMLLGSAZVDKUHF7PQXHMYWD7UAIH" bob_account = MuxedAccount( account_id="GBZSQ3YZMZEWL5ZRCEQ5CCSOTXCFCMKDGFFP4IEQN2KN6LCHCLI46UMF", account_muxed_id=1234, ) print(f"account_id_muxed: {bob_account.account_muxed}") # You can also use addresses starting with M. # bob_account = "MBZSQ3YZMZEWL5ZRCEQ5CCSOTXCFCMKDGFFP4IEQN2KN6LCHCLI46AAAAAAAAAAE2L2QE" alice_keypair = Keypair.from_secret(alice_secret) server = Server(horizon_url=horizon_url) alice_account = server.load_account(alice_keypair.public_key) transaction = TransactionBuilder( source_account=alice_account, network_passphrase=network_passphrase, base_fee=100 ) \ .append_payment_op(destination=bob_account, amount="100", asset_code="XLM") \ .build() transaction.sign(alice_keypair) resp = server.submit_transaction(transaction) pprint.pprint(resp)
Released on June 03, 2021
- feat: add support for claimable balances endpoints. (#491)
Released on May 18, 2021
- refactor: use the pure Python implemented crc16 module instead of the C implemented. (#483)
Released on May 15, 2021
- fix: correct the type of
stellar_sdk.xdr.SponsorshipDescriptor.sponsorship_descriptorfromAccountIDtoOptional[AccountID]. (#478)
Released on May 06, 2021
- fix: fix an import related bug and optimize the import code. (#473)
- example: added clawback operation example. (#474)
Released on April 25, 2021
- fix: remove exceptions that should not be thrown in XDR. (#469)
Released on April 17, 2021
- feat: add support for Stellar Protocol 17. (#453)
-
feat: add support for CAP-35. (#453)
We have added methods to
TransactionBuilder, you can use them to construct corresponding operations, method list:- append_clawback_op
- append_clawback_claimable_balance_op
- append_set_trust_line_flags_op
-
AUTHORIZATION_CLAWBACK_ENABLEDhas been added instellar_sdk.operation.set_options.AuthorizationFlag. (#453)
stellar_sdk.TransactionBuilder.append_allow_trust_opandstellar_sdk.operation.AllowTrusthave now been marked as deprecated, they will be removed in v4.0.0. (#453)
Released on April 17, 2021
- feat: add support for Stellar Protocol 17. (#446)
-
feat: add support for CAP-35. (#446)
We have added methods to
TransactionBuilder, you can use them to construct corresponding operations, method list:- append_clawback_op
- append_clawback_claimable_balance_op
- append_set_trust_line_flags_op
-
AUTHORIZATION_CLAWBACK_ENABLEDhas been added instellar_sdk.operation.set_options.Flag. (#446)
stellar_sdk.TransactionBuilder.append_allow_trust_opandstellar_sdk.operation.AllowTrusthave now been marked as deprecated, they will be removed in v4.0.0. (#446)
Released on April 16, 2021
fix: fix the issue that not_predicate cannot be parsed normally. (#465)
Released on April 03, 2021
- feat: add support for Stellar Protocol 17. (#453)
-
feat: add support for CAP-35. (#453)
We have added methods to
TransactionBuilder, you can use them to construct corresponding operations, method list:- append_clawback_op
- append_clawback_claimable_balance_op
- append_set_trust_line_flags_op
-
AUTHORIZATION_CLAWBACK_ENABLEDhas been added instellar_sdk.operation.set_options.AuthorizationFlag. (#453)
stellar_sdk.TransactionBuilder.append_allow_trust_opandstellar_sdk.operation.AllowTrusthave now been marked as deprecated, they will be removed in v4.0.0. (#453)
Released on April 03, 2021
- feat: add support for Stellar Protocol 17. (#446)
-
feat: add support for CAP-35. (#446)
We have added methods to
TransactionBuilder, you can use them to construct corresponding operations, method list:- append_clawback_op
- append_clawback_claimable_balance_op
- append_set_trust_line_flags_op
-
AUTHORIZATION_CLAWBACK_ENABLEDhas been added instellar_sdk.operation.set_options.Flag. (#446)
stellar_sdk.TransactionBuilder.append_allow_trust_opandstellar_sdk.operation.AllowTrusthave now been marked as deprecated, they will be removed in v4.0.0. (#446)
Released on April 01, 2021
feat: SEP-10: added support for 'client_domain' ManageData operations in challenges (client attribution). (#428)
Released on April 01, 2021
feat: SEP-10: added support for 'client_domain' ManageData operations in challenges (client attribution). (#428)
Released on Mar 25, 2021
feat: SEP-10: added support for 'client_domain' ManageData operations in challenges (client attribution). (#428)
Released on Mar 16, 2021
- fix: make
AiohttpClientcompatible with Python 3.6 and 3.7. (#449)
Released on Mar 16, 2021
- fix: make
AiohttpClientcompatible with Python 3.6 and 3.7. (#449)
Released on Mar 4, 2021
- fix: throw stellar_sdk.exceptions.ConnectionError in AiohttpClient instead of the built-in ConnectionError. (#441)
Released on Mar 4, 2021
- fix: throw stellar_sdk.exceptions.ConnectionError in AiohttpClient instead of the built-in ConnectionError. (#441)
Released on Feb 28, 2021
-
Update dependencies.
The latest version of aiohttp includes security updates, this security issue has no direct impact on this SDK. (#437)
Released on Jan 20, 2021
- fix: SEP-10, removed non-null constraint for manageData op values. (#424)
Released on Jan 20, 2021
- fix: SEP-10, removed non-null constraint for manageData op values. (#424)
Released on Jan 19, 2021
-
Updates the SEP-10 utility function parameters to support SEP-10 v3.1.0.
- The following functions add the
web_auth_domainparameter:stellar_sdk.sep.stellar_web_authentication.build_challenge_transaction()stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signers()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client_master_key()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_threshold()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction()
- The following functions add the
Released on Jan 19, 2021
-
Updates the SEP-10 utility function parameters to support SEP-10 v3.1.0.
- The following functions add the
web_auth_domainparameter:stellar_sdk.sep.stellar_web_authentication.build_challenge_transaction()stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signers()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client_master_key()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_threshold()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction()
- The following functions add the
Released on Jan 06, 2021
This update include breaking changes.
The v2.x version will continue to be maintained until at least Jun 01, 2021.
I've upgraded django-polaris to stellar-sdk 3.0.0, perhaps this can be used as a reference for the upgrade.
This release brings new XDR code generated by the new XDR generator, with type hint support, if you need to use XDR objects, this release will bring a great experience improvement.
-
The old XDR code has been completely removed, and you can find the new XDR code here. (#383)
The XDR Object returned by the following functions has changed:
- Asset.to_xdr_object()
- TransactionEnvelope.to_xdr_object()
- FeeBumpTransaction.to_xdr_object()
- TransactionEnvelope.to_xdr_object()
- Keypair.xdr_public_key()
- Keypair.xdr_account_id()
- Keypair.xdr_muxed_account()
- Keypair.sign_decorated()
- Memo.to_xdr_object() (All types of Memos.)
- ClaimPredicate.to_xdr_object()
- Claimant.to_xdr_object()
- Operation.to_xdr_object() (All types of Operations.)
- Price.to_xdr_object()
- Signer.to_xdr_object()
- SignerKey.to_xdr_object()
- TimeBounds.to_xdr_object()
-
Rename the parameter name that accepts XDR Object in the
from_xdr_objectfunctions toxdr_object. (#384)This change affects the following functions:
- Asset.from_xdr_object(cls, asset_xdr_object: stellar_xdr.Asset)
- FeeBumpTransaction.from_xdr_object(cls, te_xdr_object: stellar_xdr.TransactionEnvelope, cls, te_xdr_object: stellar_xdr.TransactionEnvelope)
- Memo.from_xdr_object(cls, xdr_obj: stellar_xdr.Memo) (All types of Memos.)
- Opeartion.from_xdr_object(cls, operation_xdr_object: stellar_xdr.Operation) (All types of Operations.)
- Price.from_xdr_object(cls, price_xdr_object: stellar_xdr.Price)
- Signer.from_xdr_object(cls, signer_xdr_object: stellar_xdr.Signer)
- SignerKey.from_xdr_object(cls, xdr_object: stellar_xdr.SignerKey)
- TimeBounds.from_xdr_object(cls, time_bounds_xdr_object: stellar_xdr.TimeBounds)
- Transaction.from_xdr_object(cls, tx_xdr_object: Union[stellar_xdr.Transaction, stellar_xdr.TransactionV0], v1: bool = False)
- TransactionEnvelope.from_xdr_object(cls, te_xdr_object: stellar_xdr.TransactionEnvelope, network_passphrase: str)
-
Remove Operation.type_code(). (#390)
-
Remove deprecated classes and functions. (#389)
The following classes and functions were marked as deprecated in v2, and now we have removed them.
Classes:
-
stellar_sdk.call_builder.paths_call_builder.PathsCallBuilder
-
stellar_sdk.operation.path_payment.PathPayment
Functions:
-
stellar_sdk.call_builder.accounts_call_builder.AccountsCallBuilder.signer(self, signer: str)
-
stellar_sdk.call_builder.accounts_call_builder.AccountsCallBuilder.asset(self, asset: Asset)
-
stellar_sdk.call_builder.offers_call_builder.OffersCallBuilder.account(self, account_id: str)
-
stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client(challenge_transaction: str, server_account_id: str, domain_name: str, network_passphrase: str)
-
stellar_sdk.server.Server.paths(selfsource_account: str, destination_account: str, destination_asset: Asset, destination_amount: str)
-
stellar_sdk.transaction_builder.TransactionBuilder.append_path_payment_op(self, destination: str, send_code: str, send_issuer: Optional[str], send_max: Union[str, Decimal], dest_code: str, dest_issuer: Optional[str], dest_amount: Union[str, Decimal], path: List[Asset], source: str = None)
-
-
Rename
stellar_sdk.operation.set_options.Flagtostellar_sdk.operation.set_options.AuthorizationFlag.
- add missing
__str__and__equals__functions. (#385)
-
Parse XDR into XDR object, the resolved object has complete type hint support, and you can also analyze it through the debug tool(such as PyCharm Debugger).
from stellar_sdk.xdr import TransactionEnvelope xdr = "AAAAAgAAAAA1y7+IlEXtO3+d01lKBazo8wCpZsqsEItW7y2WHv2sOgAAAfQAD5ZNAAQJtwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAGAQSwhD6XHfd4T2PjJc088ZwWyrfxr6Tcq7baksg1EHAAAAAlNJTEFVU0QAAAAAAAAAAABgEEsIQ+lx33eE9j4yXNPPGcFsq38a+k3Ku22pLINRBwAAAAAC+vCAAAAAAAAAAAEe/aw6AAAAQEDTXnTMoAwF7zM/dWDLAmxA02mVSXdqAbUzs1N/pJtrkOwlEk021zLnjTEo/5FeYGDaNktS8RemgQDYPxoL1QY=" te = TransactionEnvelope.from_xdr(xdr) ...
Released on Jan 06, 2021
- Add
from_xdr_amountandto_xdr_amountto stellar_sdk.xdr.utils. (#419)
- Rename
stellar_sdk.operation.set_options.Flagtostellar_sdk.operation.set_options.AuthorizationFlag. - Remove
TYPEfield in Operations. (#418)
Released on Dec 22, 2020
- Upgrade dependencies so that this SDK can run on Apple M1 Chip.
Released on Dec 22, 2020
- Upgrade dependencies so that this SDK can run on Apple M1 Chip.
Released on Dec 29, 2020
- Upgrade dependencies.
Released on Nov 15, 2020
This update include breaking changes
- feat: check the mnemonic is correct before using it to generate the seed. (#406)
- A parameter named
languageis added tostellar_sdk.keypair.Keypair.from_mnemonic_phrase().
- A parameter named
Released on Nov 11, 2020
- feat: updates the SEP-10 utility function parameters and return values to support SEP-10 v3.0 (#400)
- refactor: change the type of Operation.TYPE_CODE from
stellar_sdk.xdr.OperationTypetostr. (#401)
Released on Nov 07, 2020
- refactor: change the type of Operation.TYPE_CODE from
stellar_sdk.xdr.OperationTypetostr. (#401)
Released on Nov 01, 2020
- Add mypy check and bug fix. (#398)
- Fix wrong type hinting.
Released on Oct 22, 2020
This update include breaking changes.
This is a pre-release version, please do not use it in production.
This release brings new XDR code generated by the new XDR generator, with type hint support, if you need to use XDR objects, this release will bring a great experience improvement.
-
The old XDR code has been completely removed, and you can find the new XDR code here. (#383)
The XDR Object returned by the following functions has changed:
- Asset.to_xdr_object()
- TransactionEnvelope.to_xdr_object()
- FeeBumpTransaction.to_xdr_object()
- TransactionEnvelope.to_xdr_object()
- Keypair.xdr_public_key()
- Keypair.xdr_account_id()
- Keypair.xdr_muxed_account()
- Keypair.sign_decorated()
- Memo.to_xdr_object() (All types of Memos.)
- ClaimPredicate.to_xdr_object()
- Claimant.to_xdr_object()
- Operation.to_xdr_object() (All types of Operations.)
- Price.to_xdr_object()
- Signer.to_xdr_object()
- SignerKey.to_xdr_object()
- TimeBounds.to_xdr_object()
-
Rename the field that accepts XDR Object in the
from_xdr_objectfunction toxdr_object. (#384)This change affects the following functions:
- Asset.from_xdr_object(cls, asset_xdr_object: stellar_xdr.Asset)
- FeeBumpTransaction.from_xdr_object(cls, te_xdr_object: stellar_xdr.TransactionEnvelope, cls, te_xdr_object: stellar_xdr.TransactionEnvelope)
- Memo.from_xdr_object(cls, xdr_obj: stellar_xdr.Memo) (All types of Memos.)
- Opeartion.from_xdr_object(cls, operation_xdr_object: stellar_xdr.Operation) (All types of Operations.)
- Price.from_xdr_object(cls, price_xdr_object: stellar_xdr.Price)
- Signer.from_xdr_object(cls, signer_xdr_object: stellar_xdr.Signer)
- SignerKey.from_xdr_object(cls, xdr_object: stellar_xdr.SignerKey)
- TimeBounds.from_xdr_object(cls, time_bounds_xdr_object: stellar_xdr.TimeBounds)
- Transaction.from_xdr_object(cls, tx_xdr_object: Union[stellar_xdr.Transaction, stellar_xdr.TransactionV0], v1: bool = False)
- TransactionEnvelope.from_xdr_object(cls, te_xdr_object: stellar_xdr.TransactionEnvelope, network_passphrase: str)
-
Remove Operation.type_code(), and add Operation.TYPE_CODE, it returns
stellar_sdk.xdr.OperationType. (#390) -
Remove deprecated classes and functions. (#389)
The following classes and functions were marked as deprecated in v2, and now we have removed them.
Classes:
-
stellar_sdk.call_builder.paths_call_builder.PathsCallBuilder
-
stellar_sdk.call_builder.payments_call_builder.PaymentsCallBuilder
-
stellar_sdk.operation.path_payment.PathPayment
Functions:
-
stellar_sdk.call_builder.accounts_call_builder.AccountsCallBuilder.signer(self, signer: str)
-
stellar_sdk.call_builder.accounts_call_builder.AccountsCallBuilder.asset(self, asset: Asset)
-
stellar_sdk.call_builder.offers_call_builder.OffersCallBuilder.account(self, account_id: str)
-
stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client(challenge_transaction: str, server_account_id: str, domain_name: str, network_passphrase: str)
-
stellar_sdk.server.Server.paths(selfsource_account: str, destination_account: str, destination_asset: Asset, destination_amount: str)
-
stellar_sdk.server.Server.payments(self)
-
stellar_sdk.transaction_builder.TransactionBuilder.append_path_payment_op(self, destination: str, send_code: str, send_issuer: Optional[str], send_max: Union[str, Decimal], dest_code: str, dest_issuer: Optional[str], dest_amount: Union[str, Decimal], path: List[Asset], source: str = None)
-
- add missing
__str__and__equals__functions. (#385)
-
Parse XDR into XDR object, the resolved object has complete type hint support, and you can also analyze it through the debug tool(such as PyCharm Debugger).
from stellar_sdk.xdr import TransactionEnvelope xdr = "AAAAAgAAAAA1y7+IlEXtO3+d01lKBazo8wCpZsqsEItW7y2WHv2sOgAAAfQAD5ZNAAQJtwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAGAQSwhD6XHfd4T2PjJc088ZwWyrfxr6Tcq7baksg1EHAAAAAlNJTEFVU0QAAAAAAAAAAABgEEsIQ+lx33eE9j4yXNPPGcFsq38a+k3Ku22pLINRBwAAAAAC+vCAAAAAAAAAAAEe/aw6AAAAQEDTXnTMoAwF7zM/dWDLAmxA02mVSXdqAbUzs1N/pJtrkOwlEk021zLnjTEo/5FeYGDaNktS8RemgQDYPxoL1QY=" te = TransactionEnvelope.from_xdr(xdr) ...
Released on Nov 11, 2020
This update include breaking changes
-
Updates the SEP-10 utility function parameters and return values to support SEP-10 v3.0 (#400)
-
The following functions replaced the
domain_nameparameter withhome_domains:stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signers()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client_master_key()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_threshold()stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction()
-
The following function replaced the
domain_nameparameter withhome_domain:stellar_sdk.sep.stellar_web_authentication.build_challenge_transaction()
-
stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()now returns an additional object attribute,matched_home_domain
-
Released on Oct 15, 2020
- feat: add support for SEP-0010 v2.1.0. (#380)
In SEP-10 SEP-0010 v2.1.0, the domain_name field is no longer needed, but we still keep it to reduce breaking changes.
Released on Oct 04, 2020
This update include breaking changes
- feat: add support for Stellar Protocol 14. (#367)
-
feat: add support for CAP-23. (#371)
We have added methods to
TransactionBuilder, you can use them to construct corresponding operations, method list:- append_create_claimable_balance_op
- append_claim_claimable_balance_op
We have added
ClaimPredicate, please use helper function to build ClaimPredicate, method list:- predicate_and
- predicate_or
- predicate_not
- predicate_before_absolute_time
- predicate_before_relative_time
- predicate_unconditional
The following is an example.
from stellar_sdk import Server, TransactionBuilder, Keypair, ClaimPredicate, Claimant, Asset, Network sponsor_secret = "SAOJHTVFCYVKUMPNQI7RUSI566GKWXP7RXOHP4SV6JAVUQKSIWGPZFPJ" claimant_secret = "SBOLGU7D7A7MTY4JZ3WZUKSKB6NZBQFNQG3BZT4HZW4AAVZJRG7TWXGQ" sponsor_keypair = Keypair.from_secret(sponsor_secret) claimant_keypair = Keypair.from_secret(claimant_secret) server = Server("https://horizon-testnet.stellar.org") network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE # Create Claimable Balance sponsor_account = server.load_account(sponsor_keypair.public_key) predicate_left = ClaimPredicate.predicate_before_relative_time(60 * 60 * 24 * 7) predicate_right = ClaimPredicate.predicate_not(ClaimPredicate.predicate_before_relative_time(60 * 3)) predicate = ClaimPredicate.predicate_and(predicate_left, predicate_right) claimant = Claimant(destination=claimant_keypair.public_key, predicate=predicate) create_claimable_balance_te = TransactionBuilder( source_account=sponsor_account, network_passphrase=network_passphrase ).append_create_claimable_balance_op( asset=Asset.native(), amount="100", claimants=[claimant], source=sponsor_keypair.public_key ).build() create_claimable_balance_te.sign(sponsor_keypair) create_claimable_balance_resp = server.submit_transaction(create_claimable_balance_te) print(create_claimable_balance_resp) # Claim Claimable Balance balance_id = "00000000550e14acbdafcd3089289363b3b0c8bec9b4edd87298c690655b4b2456d68ba0" claimant_account = server.load_account(claimant_keypair.public_key) claim_claimable_balance_te = TransactionBuilder( source_account=claimant_account, network_passphrase=network_passphrase ).append_claim_claimable_balance_op( balance_id=balance_id, source=claimant_keypair.public_key ).build() claim_claimable_balance_te.sign(claimant_keypair) claim_claimable_balance_resp = server.submit_transaction(claim_claimable_balance_te) print(claim_claimable_balance_resp)
-
feat: add support for CAP-33. (#372 #374)
We have added methods to
TransactionBuilder, you can use them to construct corresponding operations, method list:- append_begin_sponsoring_future_reserves_op
- append_end_sponsoring_future_reserves_op
- append_revoke_account_sponsorship_op
- append_revoke_trustline_sponsorship_op
- append_revoke_offer_sponsorship_op
- append_revoke_data_sponsorship_op
- append_revoke_claimable_balance_sponsorship_op
- append_revoke_ed25519_public_key_signer_sponsorship_op
- append_revoke_hashx_signer_sponsorship_op
- append_revoke_pre_auth_tx_signer_sponsorship_op
The following is an example.
from stellar_sdk import Server, TransactionBuilder, Keypair, Network sponsor_secret = "SAOJHTVFCYVKUMPNQI7RUSI566GKWXP7RXOHP4SV6JAVUQKSIWGPZFPJ" new_account_secret = "SCN5D72JHQAHUHGIA23SLS3LBYCPHJWD7HLYNJRBBZIG4PD74UCGQBYM" sponsor_keypair = Keypair.from_secret(sponsor_secret) newly_created_keypair = Keypair.from_secret(new_account_secret) server = Server("https://horizon-testnet.stellar.org") network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE # Sponsoring Account Creation # https://github.com/stellar/stellar-protocol/blob/master/core/cap-0033.md#example-sponsoring-account-creation sponsor_account = server.load_account(sponsor_keypair.public_key) sponsoring_account_creation_te = TransactionBuilder( source_account=sponsor_account, network_passphrase=network_passphrase ).append_begin_sponsoring_future_reserves_op( sponsored_id=newly_created_keypair.public_key, source=sponsor_keypair.public_key ).append_create_account_op( destination=newly_created_keypair.public_key, starting_balance="10", source=sponsor_keypair.public_key ).append_end_sponsoring_future_reserves_op( source=newly_created_keypair.public_key ).build() sponsoring_account_creation_te.sign(sponsor_keypair) sponsoring_account_creation_te.sign(new_account_secret) sponsoring_account_creation_resp = server.submit_transaction(sponsoring_account_creation_te) print(sponsoring_account_creation_resp) # Revoke Account Sponsorship sponsor_account = server.load_account(sponsor_keypair.public_key) revoke_account_sponsorship_te = TransactionBuilder( source_account=sponsor_account, network_passphrase=network_passphrase ).append_revoke_account_sponsorship_op( account_id=newly_created_keypair.public_key, source=sponsor_keypair.public_key ).build() revoke_account_sponsorship_te.sign(sponsor_keypair) revoke_account_sponsorship_resp = server.submit_transaction(revoke_account_sponsorship_te) print(revoke_account_sponsorship_resp)
-
feat: add support for new endpoint of Protocol 14. (#373)
The following are the newly added endpoints.
- server.claimable_balances().claimable_balance(claimable_balance_id)
- server.claimable_balances().for_asset(asset)
- server.claimable_balances().for_sponsor(sponsor)
- server.claimable_balances().for_claimant(claimant)
- server.accounts().for_sponsor(sponsor)
- server.offers().for_sponsor(sponsor)
- The type of
stellar_sdk.signer.Signer.signer_keyis changed fromXdr.types.SignerKeytostellar_sdk.signer_key.SignerKey.
Released on Aug 28, 2020
This update include breaking changes
- feat: add support for SEP-0010 v2.0.0. (#363)
Due to the addition of support for SEP-10 v2.0.0, we no longer support SEP-10 v1.x.
The domain_name parameter is required in SEP-10, and the anchor_name parameter is no longer needed, you can get these SEP-10 changes here.
There have been some breaking changes to SEP-10 related functions, the following is a breaking changes list, you can also check our latest document.
- stellar_sdk.sep.stellar_web_authentication.build_challenge_transaction (domain_name parameter is required, anchor_name parameter has been removed.)
- stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction (domain_name parameter is required)
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signers (domain_name parameter is required)
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client (domain_name parameter is required)
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client_master_key (domain_name parameter is required)
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_threshold (domain_name parameter is required)
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction (domain_name parameter is required)
Released on Aug 14, 2020
- feat: add support for parsing Stellar URI (SEP-0007). (#360)
Released on Aug 09, 2020
- feat: add support to SEP-0011 (Txrep: human-readable low-level representation of Stellar transactions). (#357)
Released on Jul 20, 2020
- feat: add support for SEP-0007 (URI Scheme to facilitate delegated signing). (#349)
Released on Jun 21, 2020
This update has breaking changes compared to 2.5.3.
For some reason, we yanked 2.6.0 on PyPi, but actually 2.6.0 can be used normally.
This update log will contain the updated content of 2.6.0.
- Optimize SEP-10, when you call
stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client_master_key, an exception will be thrown if the transaction contains extra signatures. (#338) (2.6.1) - Generate V1 transactions by default. (#337) (2.6.0)
- Allow V0 transactions to be fee bumped. (#331) (2.6.0)
- The default values of the following parameters have changed,
they used to default to False, but now they default to True. (2.6.0)
- the
v1parameter in stellar_sdk.transaction_builder.TransactionBuilder - the
v1parameter in stellar_sdk.transaction.Transaction
- the
Released on Jun 18, 2020
This update include breaking changes
- The default values of the following parameters have changed,
they used to default to False, but now they default to True.
- the
v1parameter in stellar_sdk.transaction_builder.TransactionBuilder - the
v1parameter in stellar_sdk.transaction.Transaction
- the
Released on Jun 14, 2020
- Set the value of the
v1property correctly when calling TransactionBuilder.from_xdr. (#333)
Released on Jun 03, 2020
- Optimized the way to read xdr. In 2.5.x, we will discard the id in muxed account, in this update, we will keep the id, but it is invisible to users. We recommend that all users using 2.5.x upgrade to this version. (#326)
Released on May 27, 2020
-
add
stellar_sdk.call_builder.PaymentsCallBuilder.join(#323)from stellar_sdk import Server horizon_url = "https://horizon.stellar.org/" account_id = "GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A" server = Server(horizon_url) # Set `join` to `transactions` to include the transactions which created each of the payments in the response. resp = server.payments().for_account(account_id).include_failed(False).join("transactions").call() print(resp)
Released on May 25, 2020
This update include breaking changes
In 2.4.0, we added support for Stellar Protocol 13, it also includes support for M-strkeys (SEP-0023), but now we are going to remove support for SEP-0023, because it is still a draft and may not be promoted to final, adding support for it means that users may end up storing M-strkeys, which can create a lot of problems if SEP-0023 ends up not being implemented. If you want to know more details, please click here.
-
stellar_sdk.muxed_account.MuxedAccounthas been removed. (#319) -
we will no longer accept the M-strkeys address, when resolving the XDR, if it contains a muxed account, only the G-strkeys will be resolved, and the id will be discarded.
-
The following fields, which were previously(in 2.4.x) a
stellar_sdk.muxed_account.MuxedAccountare now astr(#319)stellar_sdk.Account.account_idstellar_sdk.operation.Operation.sourcestellar_sdk.operation.AccountMerge.destinationstellar_sdk.operation.PathPaymentStrictReceive.destinationstellar_sdk.operation.PathPaymentStrictSend.destinationstellar_sdk.operation.PathPayment.destinationstellar_sdk.operation.Payment.destination
-
The following fields, which were previously(in 2.4.x) a
stellar_sdk.muxed_account.MuxedAccountare now astellar_sdk.Keypair(#319)stellar_sdk.Transaction.sourcestellar_sdk.FeeBumpTransaction.fee_source
Released on May 23, 2020
This update include breaking changes
In 2.4.0, we added support for Stellar Protocol 13, it also includes support for M-strkeys (SEP-0023), but now we are going to remove support for SEP-0023, because it is still a draft and may not be promoted to final, adding support for it means that users may end up storing M-strkeys, which can create a lot of problems if SEP-0023 ends up not being implemented. If you want to know more details, please click here.
-
stellar_sdk.muxed_account.MuxedAccounthas been removed. (#319) -
we will no longer accept the M-strkeys address, when resolving the XDR, if it contains a muxed account, only the G-strkeys will be resolved, and the id will be discarded.
-
The following fields, which were previously(in 2.4.x) a
stellar_sdk.muxed_account.MuxedAccountare now astr(#319)stellar_sdk.Account.account_idstellar_sdk.operation.Operation.sourcestellar_sdk.operation.AccountMerge.destinationstellar_sdk.operation.PathPaymentStrictReceive.destinationstellar_sdk.operation.PathPaymentStrictSend.destinationstellar_sdk.operation.PathPayment.destinationstellar_sdk.operation.Payment.destination
-
The following fields, which were previously(in 2.4.x) a
stellar_sdk.muxed_account.MuxedAccountare now astellar_sdk.Keypair(#319)stellar_sdk.Transaction.sourcestellar_sdk.FeeBumpTransaction.fee_source
Released on May 23, 2020
-
refactor: separating client GET and POST timeout values. (#315)
-
refactor: optimize the use of
stellar_sdk.client.AiohttpClient, it may throw astellar_sdk.exceptions.StreamClientErrorexception now, and you should catch it. (#317)import asyncio import logging from stellar_sdk import AiohttpClient, Server from stellar_sdk.exceptions import StreamClientError horizon_url = "https://horizon.stellar.org" async def listen_transaction(): async with Server(horizon_url, AiohttpClient()) as server: cursor = "now" while True: try: async for transaction in server.transactions().cursor(cursor).stream(): print(f"Transaction: {transaction}") except StreamClientError as e: logging.error(f'A StreamClientError was encountered while reading the SSE message, which was caused by {e.current_cursor}.') cursor = e.current_cursor if __name__ == '__main__': asyncio.run(listen_transaction())
Released on May 18, 2020
- fix: monkey patch
aiohttp.streams.StreamReader.readlineto solve the problem thataiohttp_sse_clientcannot read long stream messages.
Released on May 17, 2020
-
refactor: separating client GET and POST timeout values. (#315)
-
refactor: optimize the use of
stellar_sdk.client.AiohttpClient, it may throw astellar_sdk.exceptions.StreamClientErrorexception now, and you should catch it. (#317)import asyncio import logging from stellar_sdk import AiohttpClient, Server from stellar_sdk.exceptions import StreamClientError horizon_url = "https://horizon.stellar.org" async def listen_transaction(): async with Server(horizon_url, AiohttpClient()) as server: cursor = "now" while True: try: async for transaction in server.transactions().cursor(cursor).stream(): print(f"Transaction: {transaction}") except StreamClientError as e: logging.error(f'A StreamClientError was encountered while reading the SSE message, which was caused by {e.current_cursor}.') cursor = e.current_cursor if __name__ == '__main__': asyncio.run(listen_transaction())
Released on May 10, 2020
- fix type hint for
stellar_sdk.Server.submit_transaction(). - fix broken links in examples.
Released on May 05, 2020
This update include breaking changes.
This version brings protocol 13 support with backwards compatibility support for protocol 12.
- Add
stellar_sdk.MuxedAccountwhich makes it easy to use muxed account. (#311). - Add
TransactionBuilder.build_fee_bump_transactionwhich makes it easy to createFeeBumpTransaction, we have written an example, please click here to view it (#298). - Adds a feature flag which allow consumers of this library to create V1 (Protocol 13) transactions using the
TransactionBuilder(#298). - Add support for CAP-0027: First-class multiplexed accounts (#300).
- Add
Keypair.xdr_muxed_accountwhich creates a newMuxedAccount(#300). - Add
FeeBumpTransactionandFeeBumpTransactionEnvelopewhich makes it easy to work with fee bump transactions (#298). - Add
stellar_sdk.helpers.parse_transaction_envelope_from_xdrwhich makes it easy to parseTransactionEnvelopeandFeeBumpTransactionEnvelope(#298).
- Update XDR definitions with protocol 13.
- Extend
TransactionEnvelopeto work withTransactionEnvelopeandFeeBumpTransactionEnvelope(#298). - Add backward compatibility support for CAP-0018 (#307).
-
The following fields, which were previously an
strare now astellar_sdk.MuxedAccount(#311):stellar_sdk.Account.account_idstellar_sdk.Transaction.sourcestellar_sdk.FeeBumpTransaction.fee_sourcestellar_sdk.operation.Operation.sourcestellar_sdk.operation.AccountMerge.destinationstellar_sdk.operation.PathPaymentStrictReceive.destinationstellar_sdk.operation.PathPaymentStrictSend.destinationstellar_sdk.operation.PathPayment.destinationstellar_sdk.operation.Payment.destination
-
In this version, some changes have occurred in the XDR files. If you depend on them, please click here to view the changes.
Some examples let you quickly learn about these changes.
-
MuxedAccount
from stellar_sdk import MuxedAccount account_id = "GAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSTVY" account_id_id = 1234 account_id_muxed = "MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY" # generate account_id_muxed muxed = MuxedAccount(account_id=account_id, account_id_id=account_id_id) # account_id_id is optional. print(f"account_id_muxed: {muxed.account_id_muxed}") # parse account_id_muxed muxed = MuxedAccount.from_account(account_id_muxed) print(f"account_id: {muxed.account_id}\naccount_id_id: {muxed.account_id_id}") # without `account_id_id` muxed = MuxedAccount.from_account(account_id) print(f"account_id_muxed: {muxed.account_id_muxed}") # None
-
Pay to muxed account
import pprint from stellar_sdk import Keypair, Server, MuxedAccount, TransactionBuilder, Network horizon_url = "http://horizon-testnet.stellar.org/" network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE alice_secret = "SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" bob_account = MuxedAccount( account_id="GBVKI23OQZCANDUZ2SI7XU7W6ICYKYT74JBXDD2CYRDAFZHZNRPASSQK", account_id_id=12387, ) print(f"account_id_muxed: {bob_account.account_id_muxed}") alice_keypair = Keypair.from_secret(alice_secret) server = Server(horizon_url=horizon_url) alice_account = server.load_account(alice_keypair.public_key) transaction = TransactionBuilder( source_account=alice_account, network_passphrase=network_passphrase, base_fee=100, v1=True, # If you want to build Protocol 13 transactions, you need to set `v1` to `True` ) \ .append_payment_op(destination=bob_account, amount="100", asset_code="XLM") \ .build() transaction.sign(alice_keypair) resp = server.submit_transaction(transaction) pprint.pprint(resp)
-
Build fee bump transaction
import pprint from stellar_sdk import Keypair, Server, TransactionBuilder, Network from stellar_sdk.exceptions import BadRequestError horizon_url = "http://horizon-testnet.stellar.org/" network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE fee_source_keypair = Keypair.from_secret("SASZKBDB6PFHXN6LRH4NQNTRGLGDTI3PSUVIKMZMLTYYBB7NDVMA6DSL") inner_source_keypair = Keypair.from_secret("SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L") destination_address = "GBVKI23OQZCANDUZ2SI7XU7W6ICYKYT74JBXDD2CYRDAFZHZNRPASSQK" server = Server(horizon_url=horizon_url) inner_account = server.load_account(inner_source_keypair) inner_tx = TransactionBuilder( source_account=inner_account, network_passphrase=network_passphrase, base_fee=50, v1=True) \ .append_payment_op(destination=destination_address, amount="100", asset_code="XLM") \ .build() inner_tx.sign(inner_source_keypair) try: # This transaction will fail. tx_insufficient_fee_resp = server.submit_transaction(inner_tx) except BadRequestError as e: print(e) fee_bump_tx = TransactionBuilder.build_fee_bump_transaction( fee_source=fee_source_keypair, base_fee=200, inner_transaction_envelope=inner_tx, network_passphrase=network_passphrase ) fee_bump_tx.sign(fee_source_keypair) response = server.submit_transaction(fee_bump_tx) pprint.pprint(response)
Released on May 03, 2020
- Add
stellar_sdk.MuxedAccountwhich makes it easy to use muxed account. (#311).
-
The following fields, which were previously an
strare now astellar_sdk.MuxedAccount(#311):stellar_sdk.Account.account_idstellar_sdk.Transaction.sourcestellar_sdk.FeeBumpTransaction.fee_sourcestellar_sdk.operation.Operation.sourcestellar_sdk.operation.AccountMerge.destinationstellar_sdk.operation.AllowTrust.destinationstellar_sdk.operation.PathPaymentStrictReceive.destinationstellar_sdk.operation.PathPaymentStrictSend.destinationstellar_sdk.operation.PathPayment.destinationstellar_sdk.operation.Payment.destination
Released on May 01, 2020
- fix: typo in fetching previous page.(#312)
Released on April 26, 2020
This update include breaking changes.
This version brings protocol 13 support with backwards compatibility support for protocol 12.
- Add
TransactionBuilder.build_fee_bump_transactionwhich makes it easy to createFeeBumpTransaction, we have written an example, please click here to view it (#298). - Adds a feature flag which allow consumers of this library to create V1 (Protocol 13) transactions using the
TransactionBuilder(#298). - Add support for CAP-0027: First-class multiplexed accounts (#300).
- Add
Keypair.xdr_muxed_accountwhich creates a newMuxedAccount(#300). - Add
FeeBumpTransactionandFeeBumpTransactionEnvelopewhich makes it easy to work with fee bump transactions (#298). - Add
stellar_sdk.helpers.parse_transaction_envelope_from_xdrwhich makes it easy to parseTransactionEnvelopeandFeeBumpTransactionEnvelope(#298).
- Update XDR definitions with protocol 13.
- Extend
TransactionEnvelopeto work withTransactionEnvelopeandFeeBumpTransactionEnvelope(#298). - Add backward compatibility support for CAP-0018 (#307).
-
The type of
Transaction.sourcechanges fromKeypairtostr. -
In this version, some changes have occurred in the XDR files. If you depend on them, please click here to view the changes.
-
The following XDR fields, which were previously an
AccountIDare now aMuxedAccount(#300):PaymentOp.destinationPathPaymentStrictReceiveOp.destinationPathPaymentStrictSendOp.destinationOperationOp.sourceOperation.destination(forACCOUNT_MERGE)Transaction.sourceFeeBumpTransaction.feeSource
You can get the string representation by calling
StrKey.encode_muxed_accountwhich will return aG..orM..account.
Released on April 12, 2020
- Update dependencies.
Released on March 31, 2020
-
Add SEP0029 (memo required) support. (#291) Extends
Server.submit_transactionto always run a memo required check before sending the transaction. If any of the destinations require a memo and the transaction doesn't include one, then anAccountRequiresMemoErrorwill be thrown.This may degrade performance, but you can skip this check by passing
skip_memo_required_check=TruetoServer.submit_transaction:server.submit_transaction(tx, skip_memo_required_check=True)The check runs for each operation of type:
PaymentPathPaymentStrictReceivePathPaymentStrictSendAccountMerge
If the transaction includes a memo, then memo required checking is skipped.
See SEP-0029 for more information about memo required check.
- Optimize the processing of horizon parameters. (#289)
Released on March 12, 2020
- feat: add
stellar_sdk.operation.set_options.Flag, we can express flag more conveniently. (fdb1f7d)
Released on March 08, 2020
- fix: parameters checking rule in TimeBounds. (561f3e7)
- fix: HashMemo and ReturnHashMemo should be fixed in length (32 bytes). (22cd179)
Released on February 12, 2020
- fix: orderbook async streams (#265)
Released on February 07, 2020
Horizon v1.0.0 Compatibility.
-
Add support for top-level offers endpoint with
seller,selling, andbuyingfilter. Horizon 1.0 includes a new/offersend-point, which allows you to list all offers, supporting filtering byseller,selling, orbuyingasset.You can fetch data from this endpoint by doing
server.offers()and use any of the following filters:seller:server.offers().for_seller(account_id)buying:server.offers().for_buying(asset)selling:server.offers().for_selling(asset)offer detail:server.offers().offer(offer_id)
This introduced a breaking change since it modified the signature for the function
server.offers().Before, if you wanted to list all the offers for a given account, you'd do:
server.offers(account_id)Starting on this version you'll need to do:
server.offers().for_seller(account_id)You can do now things that were not possible before, like finding all offers for an account filtering by the selling or buying asset
server.offers().for_seller(account_id).for_buying(buying_asset).for_selling(selling_asset) -
Add support for filtering accounts by
signerorasset, this has been released in a previous patch version. Horizon 1.0 includes a new/accountsend-point, which allows you to list all accounts who have another account as a signer or hold a given asset.You can fetch data from this endpoint by doing
server.accounts()and use any of the following filters:acount detail:server.accounts().account_id(account_id), returns a single account.for signer:server.accounts().for_signer(account_id), returns accounts whereaccount_idis a signer.for asset:server.accounts().for_asset(asset), returns accounts which hold theasset.
- Fixed some documentation errors.
-
Change function signature for
server.offers. The signature for the functionserver.offers()was changed to bring support for other filters.Before, if you wanted to list all the offers for a given account, you'd do:
server.offers(account_id)Starting on this version you'll need to do:
server.offers().for_seller(account_id)
server.accounts().signerandserver.accounts().assetare marked as deprecated, useserver.accounts().for_signerandserver.accounts().for_assetinstead.
There are also some changes related to the horizon's response, currently, SDK has not added parse support to it, so please refer to this issue or release notes of Stellar horizon 1.0.0. In addition, support for parsing the horizon's responses will be added in the next major update.
Released on February 12, 2020
- fix: orderbook async streams (#265)
Released on February 03, 2020
- fix: fix bug in SEP-0010 implementation.
Released on February 02, 2020
- fix: fix bug in SEP-0010 implementation.
Released on January 31, 2020
- feat: update challenge tx helpers for SEP-0010 v1.3.0.
Released on January 04, 2020
- feat: add support for SEP-0001 (stellar.toml).
- feat: add support for SEP-0002 (Federation protocol).
- perf: adjust the client's default timeout.
Released on November 29, 2019
This is a major upgrade and is not compatible with the v1.x version, don't worry, the v1.x version will still be maintained.
Anyway, welcome to the v2.0.0 release, we have a great document to help you get started.
If you have suggestions, feel free to submit an issue or email me. Thank you for your patience as we transition!
New features:
- New API design. We refactored most of the code, there are a lot of designs in v1.x that are not reasonable, and we can't modify them smoothly, this is one of the reasons we released v2.x.
- Added type hint support.
- Added asynchronous support.