Skip to content

Releases: lightsail-network/java-stellar-sdk

1.0.0-alpha0

09 Aug 12:38
c4d124b
Compare
Choose a tag to compare
1.0.0-alpha0 Pre-release
Pre-release

🎉 We are thrilled to announce the release of version 1.0.0-alpha0 for java-stellar-sdk, which has been in development for nearly a decade. This release marks a significant milestone in our journey, as we have made substantial changes and improvements to enhance the functionality and usability of our software.

Please be aware that this release introduces breaking changes. We understand that this may cause inconvenience, but we believe these changes are necessary to rectify past design decisions and lay a solid foundation for the project's future. We have been cautious about introducing breaking changes in previous releases, but we feel this is the right time to make these important adjustments.

If you encounter any issues or have questions regarding the changes, please don't hesitate to submit an issue on our GitHub repository. Alternatively, you can reach out to me directly on the Stellar Dev Discord server. We value your feedback and are committed to addressing any concerns you may have.

Moving forward, we will be adopting semantic versioning starting from the official release of this version. This means that breaking changes will only be introduced in major version updates, providing more stability and predictability for our users.

It's important to note that this is an alpha release and should not be used in production environments. The purpose of this release is to gather feedback, identify and address any remaining issues, and ensure the stability and reliability of the software before the official release.

We appreciate your understanding and support as we work towards delivering a more robust and efficient solution. Thank you for being a part of our community, and we look forward to your continued engagement as we shape the future of this project together.

Maven Central Repository URL: https://central.sonatype.com/artifact/network.lightsail/stellar-sdk/1.0.0-alpha0

Update

  • feat: add support for Soroban PRC's getTransactions and getFeeStats API.
  • feat: add support for Horizon's transaction_async API.
  • feat: optimize RequestTimeoutException, when a timeout occurs, if the server returns some information, you can read them.
  • feat: add Asset.createNonNativeAsset(String, String) and Asset.createNativeAsset().
  • feat: add MuxedAccount class to represent a multiplexed account on Stellar's network.
  • feat: Add Server.loadAccount to load the Account object used for building transactions, supporting MuxedAccount.
  • feat: Add support for MuxedAccount to SorobanServer.getAccount.
  • feat: FeeBumpTransaction supports transactions that include Soroban operations.
  • feat: added a series of functions to parse xdr in the response.
  • fix: When calling TransactionBuilder.build(), the Soroban resource fee will be included in the fee of the built transaction.
  • fix: fix the issue where invoking SorobanServer.prepareTransaction for transactions that have already set SorobanData could result in unexpected high fees.
  • chore: Display the original definition in the XDR class documentation.
  • chore: add some examples, you can find them in the examples directory.
  • chore: bump dependencies.

Breaking changes

  • refactor!: Refactored the handling of exceptions.
    • Moved the Exception classes to the org.stellar.sdk.exception and org.stellar.sdk.federation.exception packages.
    • Most of the exceptions inherit from SdkException, and SdkException inherits from RuntimeException. Please refer to the following link to understand why we use unchecked exceptions: Why unchecked exceptions?
    • Renamed SorobanRpcErrorResponse to SorobanRpcException.
    • FormatException has been renamed to StrKeyException. When encode or decode strkey fails, StrKeyFormatException will be thrown.
    • Detailed the possible exceptions that may be thrown in the documentation.
    • In the previous code, there were instances where RuntimeException was directly thrown. We have now replaced these with more appropriate exceptions such as IllegalArgumentException.
  • refactor!: removed the check for network passphrase in Server, which means we will no longer verify if the network passphrase of transactions matches that of the Server, NetworkMismatchException has been removed.
  • refactor!: moved the Operation classes to the org.stellar.sdk.operations package.
  • refactor!: KeyPair.getSecretSeed returns null if the keypair does not contain a secret key.
  • refactor!: due to the lack of maintenance for net.i2p.crypto:eddsa, we have migrated to org.bouncycastle:bcprov-jdk18on. The constructor of KeyPair has changed, but you generally won't be affected by this change.
  • refactor!: refactor asset classes. LiquidityPoolParameters, LiquidityPoolConstantProductParameters, AssetTypePoolShare, LiquidityPoolShareChangeTrustAsset and LiquidityPoolShareTrustLineAsset have been removed. Use ChangeTrustAsset and TrustLineAsset instead.
  • refactor!: Server.submitTransactionXdr and Server.submitTransaction now return TransactionResponse instead of SubmitTransactionResponse. An exception will be thrown when the transaction submission fails. Please refer to the documentation for more information.
  • refactor!: Server.root() now returns RootRequestBuilder.
  • refactor!: In AllowTrustOperation, authorizeToMaintainLiabilities has been removed and the type of authorize has been changed to TrustLineEntryFlag. Please refer to the documentation for details.
  • refactor!: Previously, operations could be constructed through many methods; now, we have standardized them. Here is an example, please refer to the documentation for more details:
    ClawbackClaimableBalanceOperation op = ClawbackClaimableBalanceOperation.builder()
      .balanceId(balanceId)
      .sourceAccount(source)
      .build();
  • refactor!: TransactionBuilder.IncrementedSequenceNumberFunc has been removed.
  • refactor!: Transaction.Builder has been removed, use TransactionBuilder instead.
  • refactor!: Asset.getType() returns org.stellar.sdk.xdr.AssetType instead of String.
  • refactor!: FeeBumpTransaction.Builder has been removed, use FeeBumpTransaction#createWithBaseFee(String, long, Transaction) or FeeBumpTransaction#createWithFee(String, long, Transaction) instead.
  • refactor!: FeeBumpTransaction.getFeeAccount has been removed, use FeeBumpTransaction.getFeeSource instead.
  • refactor!: remove AccountConverter, this means that we no longer support disabling support for MuxedAccount.
  • refactor!: refactor the way of constructing Predicate.Or and Predicate.And. The inner inside has been removed, and in its place are left and right, used to represent two predicates.
  • refactor!: Refactored response classes.
    • Utilized wrapper classes, such as replacing int with Integer, long with Long, boolean with Boolean, etc.
    • If a field is a list, we now use List instead of arrays.
    • The types of some fields have been modified.
    • Removed some methods.
    • Some field names have been changed to maintain consistency with the Horizon API.
    • Removed all functions that return Optional value.
  • refactor!: remove rateLimitLimit, rateLimitRemaining, and rateLimitReset from the Response. Horizon does not return these fields.
  • refactor!: TransactionBuilder#TransactionBuilder(Transaction) has been removed, because the TransactionBuilder constructed from the transaction may be inconsistent with what the user expects.
  • refactor!: remove LiquidityPoolID. Use String to represent the liquidity pool ID.
  • refactor!: LiquidityPoolWithdrawOperation#LiquidityPoolWithdrawOperation(AssetAmount, AssetAmount, String) has been removed. Use LiquidityPoolWithdrawOperation#LiquidityPoolWithdrawOperation(Asset, BigDecimal, Asset, BigDecimal, BigDecimal) instead.
  • refactor!: LiquidityPoolDepositOperation#LiquidityPoolDepositOperation(AssetAmount, AssetAmount, Price, Price) has been removed. Use LiquidityPoolDepositOperation#LiquidityPoolDepositOperation(Asset, BigDecimal, Asset, BigDecimal, Price, Price) instead.
  • refactor!: the type of the following field has been changed from String to BigDecimal.
    • ChangeTrustOperation.limit
    • ClawbackOperation.amount
    • CreateAccountOperation.startingBalance
    • CreateClaimableBalanceOperation.amount
    • CreatePassiveSellOfferOperation.amount
    • LiquidityPoolDepositOperation.maxAmountA and LiquidityPoolDepositOperation.maxAmountB
    • LiquidityPoolWithdrawOperation.amount, LiquidityPoolWithdrawOperation.minAmountA, and LiquidityPoolWithdrawOperation.minAmountB
    • ManageBuyOfferOperation.amount
    • ManageSellOfferOperation.amount
    • PathPaymentStrictReceiveOperation.sendMax and PathPaymentStrictReceiveOperation.destAmount
    • PathPaymentStrictSendOperation.sendAmount and PathPaymentStrictSendOperation.destMin
    • PaymentOperation.amount
  • refactor!: TransactionPreconditions#TransactionPreconditions(LedgerBounds, Long, BigInteger, long, List, TimeBounds) has been removed, use TransactionPreconditions#TransactionPreconditions(TimeBounds, LedgerBounds, Long, BigInteger, long, List) instead.
  • refactor!: The Federation has been refactored, please use Federation#resolveAddress(String) and Federation#resolveAccountId(String, String) now.
  • refactor!: Set the default value of TransactionPreconditions.extraSigners to new ArrayList<>(), it is not nullable.

0.44.0

14 May 23:23
bb11ceb
Compare
Choose a tag to compare

This release includes support for Stellar Protocol 21.

Update

  • feat: add support for Soroban-RPC v21. (#593)
  • chore: include org.stellar.sdk.xdr in docs. (#594)

0.43.2

01 May 04:59
8fa4304
Compare
Choose a tag to compare

Changes

0.43.1

31 Mar 08:59
d4c52e1
Compare
Choose a tag to compare

Hello everyone, I would like to remind you here that the Java Stellar SDK has been transferred from @stellar to @lightsail-network. I have maintained it for a while before the transfer, and I will continue to maintain it afterwards. If you have any questions or suggestions, please feel free to raise an issue here. I will reply as soon as possible. Thank you.

Update

  • Migrate the project from stellar/java-stellar-sdk to lightsail-network/stellar-stellar-sdk.
  • Update org.stellar.sdk.responses, add missing fields. (#570)
  • Add Asset.getContractId() for calculating the id of the asset contract. (#574)
  • Publish the publication to Maven Central. (#580)
  • Build the project with JDK 21. (#580)
  • Optimize the way of parsing memo in TransactionResponse. (#582)

0.43.0

23 Jan 01:07
76b7f8e
Compare
Choose a tag to compare

Changes

  • Support resource leeway parameter when simulating Soroban transactions. (#561)
  • Support for the new, optional diagnosticEventsXdr field on the SorobanServer.sendTransaction method. (#564)
  • Remove deprecated classes and methods. (#565)
  • Fix the hashCode and equals methods in Transaction and FeeBumpTransaction. (#566)
  • Add TransactionBuilder#TransactionBuilder(Transaction) constructor. (#567)
  • Add toString, hashCode, and equals methods to most classes. (#562)
  • Bump dependencies. (#569)

Breaking changes

  • Fix the hashCode and equals methods in Transaction and FeeBumpTransaction, now they will compare based on the signatureBase(). (#566)
  • The types of the following fields have changed. (#560)
    field before now
    GetEventsRequest.startLedger String Long
    GetEventsResponse.EventInfo.ledger Integer Long
    GetLatestLedgerResponse.protocolVersion Integer Long
  • The following classes and methods have been marked as deprecated in previous releases, and now they have been removed. (#565)
    • AccountResponse.Signer#getAccountId() has been removed, use AccountResponse.Signer#getKey() instead.
    • OffersRequestBuilder#forAccount(String) has been removed, use OffersRequestBuilder#forSeller(String) instead.
    • RootResponse#getProtocolVersion() has been removed, use RootResponse#getCurrentProtocolVersion() instead.
    • SetOptionsOperationResponse#getSigner() has been removed, use SetOptionsOperationResponse#getSignerKey() instead.
    • Transaction.Builder has been removed, use TransactionBuilder instead.
    • TransactionBuilder#buildTimeBounds(long, long) has been removed, use TimeBounds#TimeBounds(long, long) instead.
    • TransactionBuilder#addTimeBounds(TimeBounds) has been removed, use TransactionBuilder#addPreconditions(TransactionPreconditions) instead.

0.42.0

15 Nov 09:13
a01c3e0
Compare
Choose a tag to compare

Changes

  • Make StrKey public, this allows users to conveniently encode and decode Stellar keys to/from strings. (#548)
  • Add support for muxed accounts in PaymentOperationResponse. (#550)
  • Improve the reliability of SSEStream. Now, it will restart when necessary. (#555)
  • Add the response code and body to SubmitTransactionUnknownResponseException. (#556)

Breaking changes

  • Update LedgerResponse and AccountResponse, remove outdated fields, and add missing fields. (#549)
  • Use Price instead of String to represent prices. Change the type of CreatePassiveSellOfferOperation.price, ManageBuyOfferOperation.price, and ManageBuyOfferOperation.price from String to Price, this fixes the issue of incorrect operations parsed in certain specific scenarios. (#554)
  • Update the SDK to the stable Protocol 20 release: #553
    • The BumpFootprintExpirationOperation is now ExtendFootprintTTLOperation and its ledgersToExpire field is now named extendTo, but it serves the same purpose.
    • The InvokeHostFunctionOperation.createTokenContractOperationBuilder is now InvokeHostFunctionOperation.createStellarAssetContractOperationBuilder.
    • SorobanDataBuilder.setRefundableFee is now setResourceFee.
    • The RPC endpoint structure has changed, check #552 for more details.

Full Changelog: 0.41.1...0.42.0

0.41.1

28 Sep 23:51
eb8eae8
Compare
Choose a tag to compare

What's Changed

  • Add org.stellar.sdk.spi.SdkProvider, users can implement this interface to provide their own implementation of the SDK. We provide an Android specific implementation, if you are integrating this SDK into an Android project, be sure to check it out. (#543)
  • Fix issues where the validity of the encoded strkey is not verified in certain scenarios. (#541)
  • Fix the issue of javadocJar not including documentation. (#539)
  • Publish sourcesJar to the GitHub Release page. (#539)

Full Changelog: 0.41.0...0.41.1

0.41.0

19 Sep 22:35
574b1f2
Compare
Choose a tag to compare

Changes

  • Add support for Soroban Preview 11. (#530)
  • New effects have been added to support Protocol 20 (Soroban) (#535):
    • ContractCredited occurs when a Stellar asset moves into its corresponding Stellar Asset Contract instance
    • ContractDebited occurs when a Stellar asset moves out of its corresponding Stellar Asset Contract instance
  • Add helper functions to sign authorization entries. (#537)

Breaking changes

  • Bump dependencies & Remove unnecessary dependencies like guava. (#523)

  • No longer provide a shadow jar that contains embedded, relocated third-party dependencies. (#528)
    Instead the default stellar-sdk.jar and the com.github.stellar:java-stellar-sdk:{version} dependency are now packaged
    as 'thin library' jar, having no embedded dependencies.

    • if your project used stellar-sdk.jar directly on classpath loader, will need to obtain the .jar for each dependency version listed in build.gradle.kts
      and include all in your project classpath, or consider downloading the 'uber' jar from the published artifacts on repo
      https://jitpack.io/com/github/stellar/java-stellar-sdk/{version}/java-stellar-sdk-{version}-uber.jar

    • if your project utilizes dependency management for build such as gradle/maven, then you can choose from the following artifacts
      using the dependency classifier:

      implementation("com.github.stellar:java-stellar-sdk:{version}") // thin jar
      implementation("com.github.stellar:java-stellar-sdk:{version}:uber") // uber jar
      implementation("com.github.stellar:java-stellar-sdk:{version}:javadoc") // javadoc jar
      implementation("com.github.stellar:java-stellar-sdk:{version}:sources") // sources jar
    • When using the 'thin' jar in dependency management, it will automatically fetch dependencies transitively.
      If your project declares dependencies that are also declared here, then your project will override
      the preferences of this project and may cause runtime conflict.

    • When using the 'uber' jar in dependency management or as .jar in classpath , be aware that it does not relocate the dependent packages.

  • Utils.claimableBalanceIdToXDR and Utils.xdrToClaimableBalanceId have been removed. (#503)

  • The types of the following fields have changed. (#498)

    field before now
    LedgerBounds.minLedger int long
    LedgerBounds.maxLedger int long
    MemoId.id long BigInteger
    TimeBounds.minTime long BigInteger
    TimeBounds.maxTime long BigInteger
    TransactionBuilder.baseFee int long
    TransactionPreconditions.TIMEOUT_INFINITE long BigInteger
    TransactionPreconditions.minSeqAge Long BigInteger
    TransactionPreconditions.minSeqLedgerGap int long

0.40.1

07 Sep 16:46
adad474
Compare
Choose a tag to compare
  • Fix the issue of unable to parse liquidity_pool_revoked effect properly. (#521)
  • Define cursor, order and limit in AssetsRequestBuilder object. (#522)
  • Add basic implementation of liquidity_pools?account (#426)
  • Add source account comparison to ClawbackClaimableBalanceOperation, LiquidityPoolWithdrawOperation, and LiquidityPoolDepositOperation for equality check. (#484)

0.41.0-beta.3

01 Sep 17:54
1461c2f
Compare
Choose a tag to compare
0.41.0-beta.3 Pre-release
Pre-release
  • Fix the bug in Transaction.isSorobanTransaction to accommodate BumpFootprintExpirationOperation. (#518)