1.0.0-alpha0
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
andgetFeeStats
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)
andAsset.createNativeAsset()
. - feat: add
MuxedAccount
class to represent a multiplexed account on Stellar's network. - feat: Add
Server.loadAccount
to load theAccount
object used for building transactions, supportingMuxedAccount
. - feat: Add support for
MuxedAccount
toSorobanServer.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 thefee
of the built transaction. - fix: fix the issue where invoking
SorobanServer.prepareTransaction
for transactions that have already setSorobanData
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
andorg.stellar.sdk.federation.exception
packages. - Most of the exceptions inherit from
SdkException
, andSdkException
inherits fromRuntimeException
. Please refer to the following link to understand why we use unchecked exceptions: Why unchecked exceptions? - Renamed
SorobanRpcErrorResponse
toSorobanRpcException
. FormatException
has been renamed toStrKeyException
. 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 asIllegalArgumentException
.
- Moved the Exception classes to the
- 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 theServer
,NetworkMismatchException
has been removed. - refactor!: moved the Operation classes to the
org.stellar.sdk.operations
package. - refactor!:
KeyPair.getSecretSeed
returnsnull
if the keypair does not contain a secret key. - refactor!: due to the lack of maintenance for
net.i2p.crypto:eddsa
, we have migrated toorg.bouncycastle:bcprov-jdk18on
. The constructor ofKeyPair
has changed, but you generally won't be affected by this change. - refactor!: refactor asset classes.
LiquidityPoolParameters
,LiquidityPoolConstantProductParameters
,AssetTypePoolShare
,LiquidityPoolShareChangeTrustAsset
andLiquidityPoolShareTrustLineAsset
have been removed. UseChangeTrustAsset
andTrustLineAsset
instead. - refactor!:
Server.submitTransactionXdr
andServer.submitTransaction
now returnTransactionResponse
instead ofSubmitTransactionResponse
. An exception will be thrown when the transaction submission fails. Please refer to the documentation for more information. - refactor!:
Server.root()
now returnsRootRequestBuilder
. - refactor!: In
AllowTrustOperation
,authorizeToMaintainLiabilities
has been removed and the type ofauthorize
has been changed toTrustLineEntryFlag
. 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, useTransactionBuilder
instead. - refactor!:
Asset.getType()
returnsorg.stellar.sdk.xdr.AssetType
instead ofString
. - refactor!:
FeeBumpTransaction.Builder
has been removed, useFeeBumpTransaction#createWithBaseFee(String, long, Transaction)
orFeeBumpTransaction#createWithFee(String, long, Transaction)
instead. - refactor!:
FeeBumpTransaction.getFeeAccount
has been removed, useFeeBumpTransaction.getFeeSource
instead. - refactor!: remove
AccountConverter
, this means that we no longer support disabling support for MuxedAccount. - refactor!: refactor the way of constructing
Predicate.Or
andPredicate.And
. Theinner
inside has been removed, and in its place areleft
andright
, used to represent two predicates. - refactor!: Refactored response classes.
- Utilized wrapper classes, such as replacing
int
withInteger
,long
withLong
,boolean
withBoolean
, etc. - If a field is a list, we now use
List
instead ofarrays
. - 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.
- Utilized wrapper classes, such as replacing
- refactor!: remove
rateLimitLimit
,rateLimitRemaining
, andrateLimitReset
from theResponse
. 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
. UseString
to represent the liquidity pool ID. - refactor!:
LiquidityPoolWithdrawOperation#LiquidityPoolWithdrawOperation(AssetAmount, AssetAmount, String)
has been removed. UseLiquidityPoolWithdrawOperation#LiquidityPoolWithdrawOperation(Asset, BigDecimal, Asset, BigDecimal, BigDecimal)
instead. - refactor!:
LiquidityPoolDepositOperation#LiquidityPoolDepositOperation(AssetAmount, AssetAmount, Price, Price)
has been removed. UseLiquidityPoolDepositOperation#LiquidityPoolDepositOperation(Asset, BigDecimal, Asset, BigDecimal, Price, Price)
instead. - refactor!: the type of the following field has been changed from
String
toBigDecimal
.ChangeTrustOperation.limit
ClawbackOperation.amount
CreateAccountOperation.startingBalance
CreateClaimableBalanceOperation.amount
CreatePassiveSellOfferOperation.amount
LiquidityPoolDepositOperation.maxAmountA
andLiquidityPoolDepositOperation.maxAmountB
LiquidityPoolWithdrawOperation.amount
,LiquidityPoolWithdrawOperation.minAmountA
, andLiquidityPoolWithdrawOperation.minAmountB
ManageBuyOfferOperation.amount
ManageSellOfferOperation.amount
PathPaymentStrictReceiveOperation.sendMax
andPathPaymentStrictReceiveOperation.destAmount
PathPaymentStrictSendOperation.sendAmount
andPathPaymentStrictSendOperation.destMin
PaymentOperation.amount
- refactor!:
TransactionPreconditions#TransactionPreconditions(LedgerBounds, Long, BigInteger, long, List, TimeBounds)
has been removed, useTransactionPreconditions#TransactionPreconditions(TimeBounds, LedgerBounds, Long, BigInteger, long, List)
instead. - refactor!: The
Federation
has been refactored, please useFederation#resolveAddress(String)
andFederation#resolveAccountId(String, String)
now. - refactor!: Set the default value of
TransactionPreconditions.extraSigners
tonew ArrayList<>()
, it is not nullable.