Skip to content

Commit

Permalink
pre-release: 3.0.0-beta0
Browse files Browse the repository at this point in the history
🎉🎂
  • Loading branch information
overcat committed Oct 22, 2020
1 parent c45d087 commit ed6f5a8
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 6 deletions.
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,99 @@
Release History
==============

### Version 3.0.0-beta0

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.

#### Breaking changes
- The old XDR code has been completely removed, and you can find the new XDR code [here](https://github.com/StellarCN/py-stellar-base/tree/c45d0874db5feccefe7ba57b7141eb06e064e09b/.xdr). ([#383](https://github.com/StellarCN/py-stellar-base/pull/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 to `xdr_object`. ([#384](https://github.com/StellarCN/py-stellar-base/pull/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](https://github.com/StellarCN/py-stellar-base/pull/390))

- Remove deprecated classes and functions. ([#389](https://github.com/StellarCN/py-stellar-base/pull/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)

#### Updated

- add missing `__str__` and `__equals__` functions. ([#385](https://github.com/StellarCN/py-stellar-base/pull/385))

#### Tips

- 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).

```python
from stellar_sdk.xdr import TransactionEnvelope

xdr = "AAAAAgAAAAA1y7+IlEXtO3+d01lKBazo8wCpZsqsEItW7y2WHv2sOgAAAfQAD5ZNAAQJtwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAGAQSwhD6XHfd4T2PjJc088ZwWyrfxr6Tcq7baksg1EHAAAAAlNJTEFVU0QAAAAAAAAAAABgEEsIQ+lx33eE9j4yXNPPGcFsq38a+k3Ku22pLINRBwAAAAAC+vCAAAAAAAAAAAEe/aw6AAAAQEDTXnTMoAwF7zM/dWDLAmxA02mVSXdqAbUzs1N/pJtrkOwlEk021zLnjTEo/5FeYGDaNktS8RemgQDYPxoL1QY="
te = TransactionEnvelope.from_xdr(xdr)
...
```

### Version 2.8.1

Released on Oct 15, 2020
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Install and update using `pipenv`_ or `pip`_:

.. code-block:: text
pip install stellar-sdk==2.8.1
pip install stellar-sdk==3.0.0b0
A Simple Example
Expand Down
4 changes: 2 additions & 2 deletions docs/en/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To install py-stellar-sdk, use pipenv to install the module:

.. code-block:: text
pipenv install stellar-sdk==2.8.1
pipenv install stellar-sdk==3.0.0b0
If you're not using `pipenv <https://docs.pipenv.org/>`_, you should.
Otherwise, you can install it via plain old `pip <https://pip.pypa.io/en/stable/quickstart/>`_. More on installing Python
Expand All @@ -29,5 +29,5 @@ You can clone `the repository <https://github.com/StellarCN/py-stellar-base>`_ d
git clone https://github.com/StellarCN/py-stellar-base.git
cd py-stellar-base
git checkout 2.8.1
git checkout 3.0.0-beta0
pip install .
4 changes: 2 additions & 2 deletions docs/zh_CN/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

.. code-block:: text
pipenv install stellar-sdk==2.8.1
pipenv install stellar-sdk==3.0.0b0
我们推荐你使用 `pipenv <https://docs.pipenv.org/>`_ 来安装这个模块。当然你也可以使用 `pip <https://pip.pypa.io/en/stable/quickstart/>`_。
想要更多的了解如何安装依赖,请参阅 `Hitchhiker's Guide to Python
Expand All @@ -28,5 +28,5 @@
git clone https://github.com/StellarCN/py-stellar-base.git
cd py-stellar-base
git checkout 2.8.1
git checkout 3.0.0-beta0
pip install .
2 changes: 1 addition & 1 deletion stellar_sdk/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__description__ = "The Python Stellar SDK library provides APIs to build transactions and connect to Horizon."
__url__ = "https://github.com/StellarCN/py-stellar-base"
__issues__ = f"{__url__}/issues"
__version__ = "3.0.0.dev"
__version__ = "3.0.0.beta0"
__author__ = "Eno, overcat"
__author_email__ = "[email protected], [email protected]"
__license__ = "Apache License 2.0"

0 comments on commit ed6f5a8

Please sign in to comment.