- feat: add support for Soroban PRC's
getTransactions
andgetFeeStats
API interfaces. - feat: add support for Horizon's
transactions_async
API interfaces.
Released on July 16, 2024
- feat:
SorobanServer.send_transaction
supports sending FeeBumpTransactionEnvelope. (#956) - fix: Corrected the issue where
TransactionBuilder.from_xdr
could not properly parse transactions containing Soroban operations. (#957) - fix: Corrected the issue where
FeeBumpTransactionEnvelope.from_xdr
could not properly parse transactions containing Soroban operations. (#957) - refactor:
TransactionBuilder.from_xdr
previously could returnTransactionBuilder
orFeeBumpTransactionEnvelope
. Now it will no longer returnTransactionBuilder
, but will returnTransactionEnvelope
orFeeBumpTransactionEnvelope
. (#957) - feat:
TransactionBuilder.build_fee_bump_transaction
now supports transactions containing Soroban operations. (#957) - fix: fix the issue where invoking
SorobanServer.prepare_transaction
for transactions that have already setSorobanData
could result in unexpected high fees. (#957) - chore: bump dependencies.
- refactor:
FeeBumpTransactionEnvelope.base_fee
has been removed. Please useFeeBumpTransactionEnvelope.fee instead
. Note that their meanings are different: (#957)FeeBumpTransactionEnvelope.base_fee
represented the maximum fee you were willing to pay per operation for this transaction.FeeBumpTransactionEnvelope.fee
represents the maximum fee you are willing to pay for this transaction.
- refactor:
TransactionBuilder.from_xdr
previously could returnTransactionBuilder
orFeeBumpTransactionEnvelope
. Now it will no longer returnTransactionBuilder
, but will returnTransactionEnvelope
orFeeBumpTransactionEnvelope
. (#957) - refactor:
helpers.parse_transaction_envelope_from_xdr
has been marked as deprecated. Please use the refactoredTransactionEnvelope.from_xdr
instead. (#957)
Released on May 15, 2024
- improve: The function in
stellar_xdr.scval
can acceptsc_val
ofbase64
andbytes
types. (#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/[email protected]. (#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_void
andscv.from_void
. (#863) - feat: Support for the new, optional
diagnostic_events_xdr
field on theSorobanServer.send_transaction
method. (#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_at
field toGetTransactionResponse
. (#849)
Released on Dec 16, 2023
- feat: support resource leeway parameter when simulating Soroban transactions. (#846)
- refactor: the type of
GetEventsRequest.start_ledger
has changed fromstr
toint
. (#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:
SorobanServer
uses testnet instead of futurenet by default (#831)
Released on Nov 15, 2023
- refactor: make the
parameters
parameter inTransactionBuilder.append_invoke_contract_function_op
optional. (#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-sseclient
withrequests-sse
to 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
SorobanServerAsync
to 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
examples
folder 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
aiohttp
andaiohttp-sse-client
as optional dependencies. (#765) - Publishing to PyPI with a Trusted Publisher. (#767)
- Update dependencies.
- Remove
ValueError
,TypeError
andAttributeError
fromstellar_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_bounds
has been removed, please useTransaction.preconditions.time_bounds
instead.- 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=0
in 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.xdr
package (#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=0
in 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.xdr
package (#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_bounds
is 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_0023
totrue
in 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.xdr
module 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.typed
file 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,
TypeError
will be thrown. (#542) (#544) universal_account_id
attribute has been added tostellar_sdk.MuxedAccount
andstellar_sdk.Account
, please turn to the documentation to find out more. (#548)- Improve document.
-
stellar_sdk.Server
can now only be used to send synchronous requests, if you need to send asynchronous requests, usestellar_sdk.ServerAsync
instead. (#540) -
The signature of the following function contained in
stellar_sdk.TransactionBuilder
has 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_op
instellar_sdk.TransactionBuilder
has been removed, please useappend_change_trust_op
instead. (#547) -
The initialization function for
stellar_sdk.Account
has 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.TypeError
andstellar_sdk.exceptions.AttributeError
are 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.signatures
wasstellar_sdk.xdr.DecoratedSignature
, now it isstellar_sdk.DecoratedSignature
. (#538) -
stellar_sdk.sep.federation.resolve_stellar_address
andstellar_sdk.sep.federation.resolve_account_id
can also only be used to send synchronization requests, pleasestellar_sdk.sep.federation.resolve_stellar_address_async
andstellar_sdk.sep.federation.resolve_account_id_async
to send asynchronous requests. (#540) -
stellar_sdk.sep.stellar_toml.fetch_stellar_toml
can also only be used to send synchronization requests, pleasestellar_sdk.sep.stellar_toml.fetch_stellar_toml_async
to send asynchronous requests. (#540) -
The initialization function for
stellar_sdk.SignerKey
has 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_flags
andset_flags
instellar_sdk.operation.SetOptions
have been changed tostellar_sdk.operation.AuthorizationFlag
type, previously it wasint
. (#528) -
the client's
USER_AGENT
andIDENTIFICATION_HEADERS
are 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_AGENT
andIDENTIFICATION_HEADERS
are 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.typed
file 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,
TypeError
will be thrown. (#542) (#544) universal_account_id
attribute has been added tostellar_sdk.MuxedAccount
andstellar_sdk.Account
, please turn to the documentation to find out more. (#548)- Improve document.
-
stellar_sdk.Server
can now only be used to send synchronous requests, if you need to send asynchronous requests, usestellar_sdk.ServerAsync
instead. (#540) -
The signature of the following function contained in
stellar_sdk.TransactionBuilder
has 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_op
instellar_sdk.TransactionBuilder
has been removed, please useappend_change_trust_op
instead. (#547) -
The initialization function for
stellar_sdk.Account
has 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.TypeError
andstellar_sdk.exceptions.AttributeError
are 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.signatures
wasstellar_sdk.xdr.DecoratedSignature
, now it isstellar_sdk.DecoratedSignature
. (#538) -
stellar_sdk.sep.federation.resolve_stellar_address
andstellar_sdk.sep.federation.resolve_account_id
can also only be used to send synchronization requests, pleasestellar_sdk.sep.federation.resolve_stellar_address_async
andstellar_sdk.sep.federation.resolve_account_id_async
to send asynchronous requests. (#540) -
stellar_sdk.sep.stellar_toml.fetch_stellar_toml
can also only be used to send synchronization requests, pleasestellar_sdk.sep.stellar_toml.fetch_stellar_toml_async
to send asynchronous requests. (#540) -
The initialization function for
stellar_sdk.SignerKey
has 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_flags
andset_flags
instellar_sdk.operation.SetOptions
have been changed tostellar_sdk.operation.AuthorizationFlag
type, 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.xdr
module 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
LiquidityPoolDeposit
andLiquidityPoolWithdraw
. - Introduced two new types of assets,
LiquidityPoolId
andLiquidityPoolAsset
. - The following functions have been added to
TransactionBuilder
:append_liquidity_pool_deposit_op
append_liquidity_pool_withdraw_op
append_revoke_liquidity_pool_sponsorship_op
append_change_trust_liquidity_pool_asset_op
- Introduced a
LiquidityPoolsCallBuilder
to make calls to a new endpoint, you can useServer.liquidity_pools
to build it. - Expanded the
TransactionsCallBuilder
,OperationsCallBuilder
,TradesCallBuilder
andEffectsCallBuilder
to apply to specific liquidity pools. - Expanded the
TradesCallBuilder
to support fetching liquidity pool trades and accepts a newtrade_type
filter. - 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/trades
endpoint 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_time
with 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 amemo
parameter to attach to the challenge transaction. - Updated
ChallengeTransaction
to provide amemo
property. - 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.xdr
module 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
LiquidityPoolDeposit
andLiquidityPoolWithdraw
. - Introduced two new types of assets,
LiquidityPoolId
andLiquidityPoolAsset
. - The following functions have been added to
TransactionBuilder
:append_liquidity_pool_deposit_op
append_liquidity_pool_withdraw_op
append_revoke_liquidity_pool_sponsorship_op
append_change_trust_liquidity_pool_asset_op
- Introduced a
LiquidityPoolsCallBuilder
to make calls to a new endpoint, you can useServer.liquidity_pools
to build it. - Expanded the
TransactionsCallBuilder
,OperationsCallBuilder
, andEffectsCallBuilder
to apply to specific liquidity pools. - Expanded the
TradesCallBuilder
to support fetching liquidity pool trades and accepts a newtrade_type
filter. - 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
LiquidityPoolDeposit
andLiquidityPoolWithdraw
. - Introduced two new types of assets,
LiquidityPoolId
andLiquidityPoolAsset
. - The following functions have been added to
TransactionBuilder
:append_liquidity_pool_deposit_op
append_liquidity_pool_withdraw_op
append_revoke_liquidity_pool_sponsorship_op
- Introduced a
LiquidityPoolsCallBuilder
to make calls to a new endpoint, you can useServer.liquidity_pools
to build it. - Expanded the
TransactionsCallBuilder
,OperationsCallBuilder
, andEffectsCallBuilder
to apply to specific liquidity pools. - Expanded the
TradesCallBuilder
to support fetching liquidity pool trades and accepts a newtrade_type
filter.
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_op
has 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_0023
totrue
in 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_0023
totrue
in the environment variable
-
The following fields, which were previously an
str
are now astellar_sdk.MuxedAccount
(#479):stellar_sdk.Transaction.source
stellar_sdk.FeeBumpTransaction.fee_source
stellar_sdk.operation.AccountMerge.destination
stellar_sdk.operation.PathPaymentStrictReceive.destination
stellar_sdk.operation.PathPaymentStrictSend.destination
stellar_sdk.operation.PathPayment.destination
stellar_sdk.operation.Payment.destination
stellar_sdk.operation.Clawback.from_
-
stellar_sdk.operation.Operation.source
previously returnedOptional[str]
, now it returnsOptional[stellar_sdk.MuxedAccount]
. (#479) -
stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction
previously returned a tuple, now it returnsstellar_sdk.sep.stellar_web_authentication.ChallengeTransaction
. (#454) -
The
v1
parameter in thestellar_sdk.Transaction.from_xdr_object
andstellar_sdk.Transaction.from_xdr
functions is set toTrue
by default. (#494)
stellar_sdk.Account.account_id
has been marked as deprecated, it will be removed in v5.0.0, usestellar_sdk.Account.account
instead. (#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_0023
totrue
in the environment variable
-
The following fields, which were previously an
str
are now astellar_sdk.MuxedAccount
(#479):stellar_sdk.Transaction.source
stellar_sdk.FeeBumpTransaction.fee_source
stellar_sdk.operation.AccountMerge.destination
stellar_sdk.operation.PathPaymentStrictReceive.destination
stellar_sdk.operation.PathPaymentStrictSend.destination
stellar_sdk.operation.PathPayment.destination
stellar_sdk.operation.Payment.destination
stellar_sdk.operation.Clawback.from_
-
stellar_sdk.operation.Operation.source
previously returnedOptional[str]
, now it returnsOptional[stellar_sdk.MuxedAccount]
. (#479) -
stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction
previously returned a tuple, now it returnsstellar_sdk.sep.stellar_web_authentication.ChallengeTransaction
. (#454)
stellar_sdk.Account.account_id
has been marked as deprecated, it will be removed in v5.0.0, usestellar_sdk.Account.account
instead. (#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_descriptor
fromAccountID
toOptional[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_ENABLED
has been added instellar_sdk.operation.set_options.AuthorizationFlag
. (#453)
stellar_sdk.TransactionBuilder.append_allow_trust_op
andstellar_sdk.operation.AllowTrust
have 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_ENABLED
has been added instellar_sdk.operation.set_options.Flag
. (#446)
stellar_sdk.TransactionBuilder.append_allow_trust_op
andstellar_sdk.operation.AllowTrust
have 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_ENABLED
has been added instellar_sdk.operation.set_options.AuthorizationFlag
. (#453)
stellar_sdk.TransactionBuilder.append_allow_trust_op
andstellar_sdk.operation.AllowTrust
have 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_ENABLED
has been added instellar_sdk.operation.set_options.Flag
. (#446)
stellar_sdk.TransactionBuilder.append_allow_trust_op
andstellar_sdk.operation.AllowTrust
have 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
AiohttpClient
compatible with Python 3.6 and 3.7. (#449)
Released on Mar 16, 2021
- fix: make
AiohttpClient
compatible 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_domain
parameter: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_domain
parameter: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_object
functions 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.Flag
tostellar_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_amount
andto_xdr_amount
to stellar_sdk.xdr.utils. (#419)
- Rename
stellar_sdk.operation.set_options.Flag
tostellar_sdk.operation.set_options.AuthorizationFlag
. - Remove
TYPE
field 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
language
is 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.OperationType
tostr
. (#401)
Released on Nov 07, 2020
- refactor: change the type of Operation.TYPE_CODE from
stellar_sdk.xdr.OperationType
tostr
. (#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_object
function 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_name
parameter 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_name
parameter 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_key
is changed fromXdr.types.SignerKey
tostellar_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
v1
parameter in stellar_sdk.transaction_builder.TransactionBuilder - the
v1
parameter 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
v1
parameter in stellar_sdk.transaction_builder.TransactionBuilder - the
v1
parameter in stellar_sdk.transaction.Transaction
- the
Released on Jun 14, 2020
- Set the value of the
v1
property 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.MuxedAccount
has 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.MuxedAccount
are now astr
(#319)stellar_sdk.Account.account_id
stellar_sdk.operation.Operation.source
stellar_sdk.operation.AccountMerge.destination
stellar_sdk.operation.PathPaymentStrictReceive.destination
stellar_sdk.operation.PathPaymentStrictSend.destination
stellar_sdk.operation.PathPayment.destination
stellar_sdk.operation.Payment.destination
-
The following fields, which were previously(in 2.4.x) a
stellar_sdk.muxed_account.MuxedAccount
are now astellar_sdk.Keypair
(#319)stellar_sdk.Transaction.source
stellar_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.MuxedAccount
has 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.MuxedAccount
are now astr
(#319)stellar_sdk.Account.account_id
stellar_sdk.operation.Operation.source
stellar_sdk.operation.AccountMerge.destination
stellar_sdk.operation.PathPaymentStrictReceive.destination
stellar_sdk.operation.PathPaymentStrictSend.destination
stellar_sdk.operation.PathPayment.destination
stellar_sdk.operation.Payment.destination
-
The following fields, which were previously(in 2.4.x) a
stellar_sdk.muxed_account.MuxedAccount
are now astellar_sdk.Keypair
(#319)stellar_sdk.Transaction.source
stellar_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.StreamClientError
exception 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.readline
to solve the problem thataiohttp_sse_client
cannot 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.StreamClientError
exception 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.MuxedAccount
which makes it easy to use muxed account. (#311). - Add
TransactionBuilder.build_fee_bump_transaction
which 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_account
which creates a newMuxedAccount
(#300). - Add
FeeBumpTransaction
andFeeBumpTransactionEnvelope
which makes it easy to work with fee bump transactions (#298). - Add
stellar_sdk.helpers.parse_transaction_envelope_from_xdr
which makes it easy to parseTransactionEnvelope
andFeeBumpTransactionEnvelope
(#298).
- Update XDR definitions with protocol 13.
- Extend
TransactionEnvelope
to work withTransactionEnvelope
andFeeBumpTransactionEnvelope
(#298). - Add backward compatibility support for CAP-0018 (#307).
-
The following fields, which were previously an
str
are now astellar_sdk.MuxedAccount
(#311):stellar_sdk.Account.account_id
stellar_sdk.Transaction.source
stellar_sdk.FeeBumpTransaction.fee_source
stellar_sdk.operation.Operation.source
stellar_sdk.operation.AccountMerge.destination
stellar_sdk.operation.PathPaymentStrictReceive.destination
stellar_sdk.operation.PathPaymentStrictSend.destination
stellar_sdk.operation.PathPayment.destination
stellar_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.MuxedAccount
which makes it easy to use muxed account. (#311).
-
The following fields, which were previously an
str
are now astellar_sdk.MuxedAccount
(#311):stellar_sdk.Account.account_id
stellar_sdk.Transaction.source
stellar_sdk.FeeBumpTransaction.fee_source
stellar_sdk.operation.Operation.source
stellar_sdk.operation.AccountMerge.destination
stellar_sdk.operation.AllowTrust.destination
stellar_sdk.operation.PathPaymentStrictReceive.destination
stellar_sdk.operation.PathPaymentStrictSend.destination
stellar_sdk.operation.PathPayment.destination
stellar_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_transaction
which 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_account
which creates a newMuxedAccount
(#300). - Add
FeeBumpTransaction
andFeeBumpTransactionEnvelope
which makes it easy to work with fee bump transactions (#298). - Add
stellar_sdk.helpers.parse_transaction_envelope_from_xdr
which makes it easy to parseTransactionEnvelope
andFeeBumpTransactionEnvelope
(#298).
- Update XDR definitions with protocol 13.
- Extend
TransactionEnvelope
to work withTransactionEnvelope
andFeeBumpTransactionEnvelope
(#298). - Add backward compatibility support for CAP-0018 (#307).
-
The type of
Transaction.source
changes fromKeypair
tostr
. -
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
AccountID
are now aMuxedAccount
(#300):PaymentOp.destination
PathPaymentStrictReceiveOp.destination
PathPaymentStrictSendOp.destination
OperationOp.source
Operation.destination
(forACCOUNT_MERGE
)Transaction.source
FeeBumpTransaction.feeSource
You can get the string representation by calling
StrKey.encode_muxed_account
which 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_transaction
to 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 anAccountRequiresMemoError
will be thrown.This may degrade performance, but you can skip this check by passing
skip_memo_required_check=True
toServer.submit_transaction
:server.submit_transaction(tx, skip_memo_required_check=True)
The check runs for each operation of type:
Payment
PathPaymentStrictReceive
PathPaymentStrictSend
AccountMerge
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
, andbuying
filter. Horizon 1.0 includes a new/offers
end-point, which allows you to list all offers, supporting filtering byseller
,selling
, orbuying
asset.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
signer
orasset
, this has been released in a previous patch version. Horizon 1.0 includes a new/accounts
end-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_id
is 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().signer
andserver.accounts().asset
are marked as deprecated, useserver.accounts().for_signer
andserver.accounts().for_asset
instead.
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.