We are excited to announce the release of version 1.0.0 of the Java Stellar SDK! This marks a significant milestone in the project's development, representing the culmination of extensive work and valuable community feedback since the alpha and beta releases.
This version is identical in functionality to 1.0.0-rc0. If you are upgrading from an older version, please make sure to review the change logs of all previous versions in our CHANGELOG.md, as there have been significant changes throughout the 1.0.0 development cycle. We would like to express our sincere gratitude to everyone who provided feedback, reported issues, and contributed to making this release possible. Your involvement has been instrumental in shaping and improving the SDK.
This release marks our official adoption of semantic versioning, providing more predictability for future updates. Breaking changes will now only be introduced in major version updates.
There are two PRs here that demonstrate how to upgrade to the latest version; you can check them out if needed:
Please continue to share your experiences and report any issues you encounter. Your feedback remains vital for the continued improvement of the SDK.
The following are the changes since version 1.0.0-beta1. If you are upgrading from an older version, please also refer to the change logs of previous versions, especially 1.0.0-alpha0.
In addition, there are two PRs here that demonstrate how to upgrade to the latest version; you can check them out if needed:
- feat: add support for Soroban PRC's
getLedgers
API interface. (#660) - fix: fix the data validation of
StrKey
class. (#664)
- refactor!: change the type of
AbstractTransaction.MIN_BASE_FEE
fromint
tolong
. (#657) - refactor!: rename
TransactionPreconditions.isValid
toTransactionPreconditions.validate
. (#666) - refactor!: if seed is not present, calling
Keypair.sign
throws IllegalStateException. (#662) - refactor!:
StrKeyException
has been removed, useIllegalArgumentException
instead. When you call functions likeKeypair.fromAccountId
, this exception will also be thrown if invalid data is passed in. (#663) - refactor!:
AssetCodeLengthInvalidException
has been removed, useIllegalArgumentException
instead. (#667) - refactor!:
MalformedAddressException
has been removed, useIllegalArgumentException
instead. (#668)
The following are the changes since version 1.0.0-beta0. If you are upgrading from an older version, please also refer to the change logs of previous versions, especially 1.0.0-alpha0.
- refactor: refactor
SSEStream
, make it more reliable. (#652) - refactor: add
pagingToken
back toGetEventsResponse.EventInfo
. This is to ensure compatibility with older versions of Soroban-RPC. We still recommend using theGetEventsResponse.cursor
field after upgrading Soroban-RPC. (#655)
This is the first release that supports Protocol 22. While the network has not upgraded yet, you can start integrating the new features into your codebase if you want a head start.
The following are the changes since version 1.0.0-alpha0. If you are upgrading from an older version, please also refer to the change logs of previous versions, especially 1.0.0-alpha0.
- feat: support constructors in contract creation via
InvokeHostFunctionOperation.createContractOperationBuilder
. - feat: add support for Soroban PRC's
getVersionInfo
API. - feat: add
txHash
toGetTransactionResponse
andGetTransactionsResponse.Transaction
.
- refactor!: remove the constructor from
KeyPair
, useKeyPair.fromSecretSeed
orKeyPair.fromAccountId
instead. - fix!: fix bug with signing auth entries in multi-sig scenarios.
- feat!: support constructors in contract creation via
InvokeHostFunctionOperation.createContractOperationBuilder
, the signature of the function has been changed. - refactor!: remove
amount
andnumAccounts
fromAssetResponse
. - refactor!: remove
cost
fromSimulateTransactionResponse
, the correct resource costs can now be retrieved from thetransactionData
. - refactor!: remove
pagingToken
fromGetEventsResponse.EventInfo
, useGetEventsResponse.cursor
instead. - refactor!: The
protocolVersion
in the response is now represented as anInteger
.
We are thrilled to announce the release of version 1.0.0-beta0 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.
- 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.
- 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.
- fix: fix
SSEStream
unpredictably throws unwantedIOException("Canceled")
. (#650)
- The generated XDR has been upgraded to match the upcoming Protocol 21, namely stellar/stellar-xdr@v21.1. (#590)
- Migrate the project from
stellar/java-stellar-sdk
tolightsail-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)
- Support resource leeway parameter when simulating Soroban transactions. (#561)
- Support for the new, optional
diagnosticEventsXdr
field on theSorobanServer.sendTransaction
method. (#564) - Remove deprecated classes and methods. (#565)
- Fix the
hashCode
andequals
methods inTransaction
andFeeBumpTransaction
. (#566) - Add
TransactionBuilder#TransactionBuilder(Transaction)
constructor. (#567) - Add
toString
,hashCode
, andequals
methods to most classes. (#562) - Bump dependencies. (#569)
- Fix the
hashCode
andequals
methods inTransaction
andFeeBumpTransaction
, now they will compare based on thesignatureBase()
. (#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, useAccountResponse.Signer#getKey()
instead.OffersRequestBuilder#forAccount(String)
has been removed, useOffersRequestBuilder#forSeller(String)
instead.RootResponse#getProtocolVersion()
has been removed, useRootResponse#getCurrentProtocolVersion()
instead.SetOptionsOperationResponse#getSigner()
has been removed, useSetOptionsOperationResponse#getSignerKey()
instead.Transaction.Builder
has been removed, useTransactionBuilder
instead.TransactionBuilder#buildTimeBounds(long, long)
has been removed, useTimeBounds#TimeBounds(long, long)
instead.TransactionBuilder#addTimeBounds(TimeBounds)
has been removed, useTransactionBuilder#addPreconditions(TransactionPreconditions)
instead.
- 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)
- Update
LedgerResponse
andAccountResponse
, remove outdated fields, and add missing fields. (#549) - Use
Price
instead ofString
to represent prices. Change the type ofCreatePassiveSellOfferOperation.price
,ManageBuyOfferOperation.price
, andManageBuyOfferOperation.price
fromString
toPrice
, 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 nowExtendFootprintTTLOperation
and itsledgersToExpire
field is now namedextendTo
, but it serves the same purpose. - The
InvokeHostFunctionOperation.createTokenContractOperationBuilder
is nowInvokeHostFunctionOperation.createStellarAssetContractOperationBuilder
. SorobanDataBuilder.setRefundableFee
is nowsetResourceFee
.- The RPC endpoint structure has changed, check #552 for more details.
- The
- 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)
- 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 instanceContractDebited
occurs when a Stellar asset moves out of its corresponding Stellar Asset Contract instance
- Add helper functions to sign authorization entries. (#537)
-
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 thecom.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 inbuild.gradle.kts
and include all in your project classpath, or consider downloading the 'uber' jar from the published artifacts on repohttps://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
andUtils.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
- Fix the bug in Transaction.isSorobanTransaction to accommodate BumpFootprintExpirationOperation. (#518)
- Add support for Soroban Preview 10. (#490)
- Correct the data type of certain fields to store the expected design values. (#497)
- Add source account comparison to
ClawbackClaimableBalanceOperation
,LiquidityPoolWithdrawOperation
, andLiquidityPoolDepositOperation
for equality check. (#484) - Add basic implementation of
liquidity_pools?account
(#426)
- 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
, andLiquidityPoolDepositOperation
for equality check. (#484)
- Add strkey support for contract ids (#471)
- Fix NPE in
KeyPair.equals()
method (#474) - Avoid to have unexpected exception on status code 429 TooManyRequests (#433)
- Add SubmitTransactionResponse.ResultCodes.innerTransactionResultCode (#466)
- Fix android crashing related to okhttp3 (#457)
- Fix the deployment CI that uploads the jar to the GitHub release [2]. (#453)
- Fix the deployment CI that uploads the jar to the GitHub release. (#452)
- Fix missing
auth_clawback_enabled
field in AccountResponse class. (#449)
- Fix bug in
KeyPair.fromSecretSeed(char[] seed)
. (#447) - Shade kotlin dependencies to prevent 'Duplicate class' errors. (#448)
- Update JDK compatibility version from Java 1.6 to Java 1.8 and bump the version of few libraries (#444):
- com.squareup.okhttp3 from
v3.11.0
tov4.10.0
. - commons-io:commons-io from
v2.6
tov2.11.0
. - junit:junit from
v4.12
tov4.13.2
. - org.threeten:threetenbp from
v1.4.4
tov1.6.0
. - org.mockito:mockito-core from
v2.21.0
tov4.6.1
. - javax.xml.bind:jaxb-api from
v2.3.0
tov2.3.1
.
- com.squareup.okhttp3 from
- Bump gson version from
v2.8.5
tov2.9.0
. (#443)
- Fix the
Sep10Challenge.verifyTransactionSignatures
method to handle/ignore signers that are not ed25519 compliant. (#440)
- Add memo to
Sep10Challenge.newChallenge()
andSep10Challenge.readChallengeTransaction
. (#435)
- Update TransactionResponse to include new Protocol 19 Preconditions (#428).
- Fix asset compare to when asset code are equals (#424).
- LiquidityPoolIDDeserializer is missing from the PageDeserializer. (#422)
- Update XDR definitions and auto-generated classes to support upcoming protocol 19 release (#416).
- Extend StrKey implementation to handle CAP 40 Payload Signer.
- Extended Transaction submission settings, additional new Preconditions can be added now, refer to CAP 21 Transaction Preconditions.
- org.stellar.sdk.Transaction.Builder
- deprecated
addTimeBounds()
useaddPreconditions()
instead - deprecated
setTimeout()
useaddPreconditions()
instead - deprecated
Transaction.Builder
use TransactionBuilder instead
- deprecated
- org.stellar.sdk.Transaction
getSignatures()
returns an ImmutableList of signatures, do NOT add signatures to the collection returned. useaddSignature(DecoratedSignature signature)
instead.
- Fixed NPE on TrustlineCreatedEffectResponse.getAsset() for liquidity pool asset type. Consolidated Asset factory creation pattern, made consistent for all asset types including native, alpha4, alpha12, liquidity pool shares. (#398).
- org.stellar.sdk.Asset.createNonNativeAsset() is now private. (#398).
- org.stellar.sdk.responses.effects.TrustlineCUDResponse, removed non-default public constructor, it wasn't needed. (#398).
- Muxed accounts are now supported by default. Previously we added opt in support for muxed accounts. But now we are changing the default behavior so that muxed accounts are rendered using their 'M' address encoding (#399).
- Fix missing Liquidity Pool ID in AccountResponse Balance (#379).
- Fix null pointer when calling ChangeTrustOperationResponse.getAsset() for LiquidityPool trust line (#378).
- Changed the access modifiers of the inner static classes of
AccountResponse
to public (#390). - Use the new ClaimableBalance Predicate AbsBeforeEpoch field to avoid parsing errors on potential large dates in AbsBefore (#394).
- Changed offer ids to be represented in requests and response models as long data type. (#386).
- Changed all MuxedId attributes to be of data type
java.math.BigInteger
in request and response models (#388).
- Fixed bug in parsing liquidity pool operation and effect responses (#373).
- Added support for 'client_domain' ManageData operations in SEP 10 challenges (#368).
- Add 5 minute grace period to SEP-10 challenge parsing function (#366).
- Add opt-in support for SEP23 M-strkeys for
MuxedAccount
s - Add
getClaimableBalanceId()
method toTransaction
class which returns the claimable balance id for a given operation. - Add support for additional _muxed and _muxed_id optional fields in Horizon's JSON responses (available since Horizon 2.4, following what's described in SEP 23).
- Added TransactionsRequestBuilder.forClaimableBalance(), and OperationsRequestBuilder.forClaimableBalance().
- Added support for new
accounts
,balances
,claimable_balances_amount
, andnum_claimable_balances
fields on Assets.
-
Operation
allow_trust
is deprecated in favor ofset_trust_line_flags
(although it will still be supported by the network) -
Effects
trustline_authorized
,trustline_authorized_to_maintain_liabilities
andtrustline_deauthorized
are deprecated in favor oftrustline_flags_updated
. Note how we intentionally didn't add a newtrustline_authorized_clawback_enabled
effect.
For uniformity, the allow_trust
operation will start producing trustline_flags_updated
from this release.
For now trustline_authorized
, trustline_authorized_to_maintain_liabilities
and trustline_deauthorized
will continue to be emitted as a result of the allow_trust
operation but in the future we may stop doing so.
Deprecated | New class |
---|---|
org.stellar.sdk.AllowTrustOperation |
org.stellar.sdk.SetTrustlineFlagsOperation |
org.stellar.sdk.responses.operations.AllowTrustOperationResponse |
org.stellar.sdk.responses.operations.SetTrustLineFlagsOperationResponse |
org.stellar.sdk.responses.effects.TrustlineAuthorizedEffectResponse |
org.stellar.sdk.responses.effects.TrustlineFlagsUpdatedEffectResponse |
org.stellar.sdk.responses.effects.TrustlineAuthorizedToMaintainLiabilitiesEffectResponse |
org.stellar.sdk.responses.effects.TrustlineFlagsUpdatedEffectResponse |
org.stellar.sdk.responses.effects.TrustlineDeauthorizedEffectResponse |
org.stellar.sdk.responses.effects.TrustlineFlagsUpdatedEffectResponse |
-
clawback
implemented inorg.stellar.sdk.ClawbackOperation
claws back a trustline from a given asset holder. -
clawback_claimable_balance
implemented inorg.stellar.sdk.ClawbackClaimableBalanceOperation
claws back a claimable balance. -
set_trust_line_flags
implemented inorg.stellar.sdk.SetTrustlineFlagsOperation
modifies a trustline's flags. This operation should be used instead oforg.stellar.sdk.AllowTrustOperation
.
-
trustline_flags_updated
implemented inorg.stellar.sdk.responses.effects.TrustlineFlagsUpdatedEffectResponse
, with the following fields:- Asset fields (like explained in the operations above):
asset_type
asset_code
asset_issuer
trustor
- account whose trustline the effect refers toauthorized_flag
- true to indicate the flag is set, field ommited if not setauthorized_to_maintain_liabilites
- true to indicate the flag is set, field ommited if not setclawback_enabled_flag
- true to indicate that the flag is set, field ommitted if not set
- Asset fields (like explained in the operations above):
-
claimable_balance_clawed_back
implemented inorg.stellar.sdk.responses.effects.ClaimableBalanceClawedBackEffectResponse
, with the following fields:balance_id
- claimable balance identifer of the claimable balance clawed back
- Updates the SEP-10 utility function parameters to support SEP-10 v3.1 (#319)
- A new required
webAuthDomain
parameter was added to the following functionsSep10Challenge#newChallenge(KeyPair, Network, String, String, String, TimeBounds)
Sep10Challenge#readChallengeTransaction(String, String, Network, String, String)
Sep10Challenge#readChallengeTransaction(String, String, Network, String[], String)
Sep10Challenge#verifyChallengeTransactionSigners(String, String, Network, String, String, Set)
Sep10Challenge#verifyChallengeTransactionSigners(String, String, Network, String[], String, Set)
Sep10Challenge#verifyChallengeTransactionThreshold(String, String, Network, String[], String, int, Set)
Sep10Challenge#verifyChallengeTransactionThreshold(String, String, Network, String, String, int, Set)
- The
webAuthDomain
parameter is expected to match the value of the Manage Data operation with the 'web_auth_domain' key, if present.
- A new required
- Fix several bugs in revoke operations. (#317)
-
The XDR classes have been regenerated using the latest version of xdrgen which provides the following two features:
- Builder static inner classes to unions and structs
- Constructors for typedefs
- Update challenge transaction helpers for SEP-0010 v3.0.0. (#308)
- Fix the decoding of
balanceId
inorg.stellar.sdk.ClaimClaimableBalanceOperation
. (#310)
- Fix NullPointerException in
org.stellar.sdk.responses.operations.RevokeSponsorshipOperationResponse
accessor methods.
-
Change the type of
offerId
from java.lang.Integer to java.lang.Long to align with the 64-bit size of offer IDs. (#303).This change affects the following fields:
- org.stellar.sdk.responses.operations.CreatePassiveSellOfferOperationResponse.offerId
- org.stellar.sdk.responses.operations.ManageBuyOfferOperationResponse.offerId
- org.stellar.sdk.responses.operations.ManageSellOfferOperationResponse.offerId
- Update challenge transaction helpers for SEP-0010 v2.1.0. (#300).
- Remove verification of domain name.
- Allow additional manage data operations that have the source account set as the server key.
- Add support for claimable balances (#295). Extend server class to allow loading claimable balances from Horizon. The following functions are available:
server.claimableBalances();
server.claimableBalances().forClaimant(claimant);
server.claimableBalances().forSponsor(sponsorId);
server.claimableBalances().forAsset(asset);
server.claimableBalances().claimableBalance(balanceId);
-
Add the following attributes to
AccountResponse
(#295):Optional<String> getSponsor()
Integer getNumSponsoring()
Integer getNumSponsored()
-
Add the optional attribute
Optional<String> getSponsor()
toAccountResponse.Signer
,AccountResponse.Balance
,ClaimableBalanceResponse
, andOfferResponse
(#295). -
Add
sponsor
filtering support foroffers
andaccounts
(#295).server.offers().forSponsor(accountID)
server.accounts().forSponsor(accountID)
-
Extend operation responses to support new operations (#295).
create_claimable_balance
with the following fields:asset
- asset available to be claimed (in canonical form),amount
- amount available to be claimed,claimants
- list of claimants with predicates (see below):destination
- destination account ID,predicate
- predicate required to claim a balance (see below).
claim_claimable_balance
with the following fields:balance_id
- unique ID of balance to be claimed,claimant
- account ID of a claimant.
begin_sponsoring_future_reserves
with the following fields:sponsored_id
- account ID for which future reserves will be sponsored.
end_sponsoring_future_reserves
with the following fields:begin_sponsor
- account sponsoring reserves.
revoke_sponsorship
with the following fields:account_id
- if account sponsorship was revoked,claimable_balance_id
- if claimable balance sponsorship was revoked,data_account_id
- if account data sponsorship was revoked,data_name
- if account data sponsorship was revoked,offer_id
- if offer sponsorship was revoked,trustline_account_id
- if trustline sponsorship was revoked,trustline_asset
- if trustline sponsorship was revoked,signer_account_id
- if signer sponsorship was revoked,signer_key
- if signer sponsorship was revoked.
-
Extend effect responses to support new effects (#295).
claimable_balance_created
with the following fields:balance_id
- unique ID of claimable balance,asset
- asset available to be claimed (in canonical form),amount
- amount available to be claimed.
claimable_balance_claimant_created
with the following fields:balance_id
- unique ID of a claimable balance,asset
- asset available to be claimed (in canonical form),amount
- amount available to be claimed,predicate
- predicate required to claim a balance (see below).
claimable_balance_claimed
with the following fields:balance_id
- unique ID of a claimable balance,asset
- asset available to be claimed (in canonical form),amount
- amount available to be claimed,
account_sponsorship_created
with the following fields:sponsor
- sponsor of an account.
account_sponsorship_updated
with the following fields:new_sponsor
- new sponsor of an account,former_sponsor
- former sponsor of an account.
account_sponsorship_removed
with the following fields:former_sponsor
- former sponsor of an account.
trustline_sponsorship_created
with the following fields:sponsor
- sponsor of a trustline.
trustline_sponsorship_updated
with the following fields:new_sponsor
- new sponsor of a trustline,former_sponsor
- former sponsor of a trustline.
trustline_sponsorship_removed
with the following fields:former_sponsor
- former sponsor of a trustline.
claimable_balance_sponsorship_created
with the following fields:sponsor
- sponsor of a claimable balance.
claimable_balance_sponsorship_updated
with the following fields:new_sponsor
- new sponsor of a claimable balance,former_sponsor
- former sponsor of a claimable balance.
claimable_balance_sponsorship_removed
with the following fields:former_sponsor
- former sponsor of a claimable balance.
signer_sponsorship_created
with the following fields:signer
- signer being sponsored.sponsor
- signer sponsor.
signer_sponsorship_updated
with the following fields:signer
- signer being sponsored.former_sponsor
- the former sponsor of the signer.new_sponsor
- the new sponsor of the signer.
signer_sponsorship_removed
with the following fields:former_sponsor
- former sponsor of a signer.
- Replace
Sep10Challenge.newChallenge()
'sString anchorName
parameter withString domainName
- Add
String domainName
parameter toSep10Challenge.readChallengeTransaction()
,Sep10Challenge.verifyChallengeTransactionSigners()
, andSep10Challenge.verifyChallengeTransactionThreshold()
SEP-10 now requires clients to verify the SIGNING_KEY
included in the TOML file of the service requiring authentication is used to sign the challenge and that the challenge's Manage Data operation key includes the requested service's home domain. These checks ensure the challenge cannot be used in a relay attack.
The breaking changes described above support the added SEP-10 2.0 requirements for both servers and clients.
- Generate V1 transaction envelopes when constructing new Transaction instances (#285).
- Allow FeeBumpTransaction instances to wrap V0 transactions (#285).
- Rollback support for SEP23 (Muxed Account StrKey) (#282).
- Update XDR definitions and auto-generated classes to support upcoming protocol 13 release (#276).
- Extend StrKey implementation to handle CAP 27 Muxed Accounts (#276).
- Update
TransactionResponse
to include new fields which are relevant to CAP 15 Fee-Bump Transactions (#275). - Update
AccountResponse.Balance
,AllowTrustOperationResponse
, and createTrustlineAuthorizedToMaintainLiabilitiesEffectResponse
to support CAP 18 Fine-Grained Control of Authorization (#274). - Add
FeeBumpTransaction
andFeeBumpTransaction.Builder
for parsing and creating CAP 15 Fee-Bump Transactions (#278). - Add methods to
Server
for submitting CAP 15 Fee-Bump Transactions (#278). - Update SEP 10 implementation to reject fee-bump transactions and transactions with multiplexed addresses ([#278] (#278)).
- Update SEP 29 implementation to handle bump transactions (#278).
-
Add SEP0029 (memo required) support. (#272)
Extends
Server.submitTransaction
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.You can skip this check by passing a true
skipMemoRequiredCheck
value toServer.submitTransaction
:server.submitTransaction(tx, true)
The check runs for each operation of type:
payment
pathPaymentStrictReceive
pathPaymentStrictSend
mergeAccount
If the transaction includes a memo, then memo required checking is skipped.
See SEP0029 for more information about memo required check.
- Update challenge transaction helpers for SEP-10 v1.3.0 (#263).
- Add support for /accounts end-point with ?signer and ?asset filters (#261).
- Add support for /offers end-point with query parameters (#261).
- Regenerate the XDR definitions to include MetaV2 support (#261).
- Horizon v0.24.0 added a
fee_charged
andmax_fee
object with information about max bid and actual fee paid for each transaction. - We are removing ``*_all_accepted_fee` fields in favor of the new keys, making it easier for people to understand the meaning the fields.
- Represent memo text contents as bytes because a memo text may not be valid UTF-8 string (#257).
- Validate name length when constructing org.stellar.sdk.ManageDataOperation instances.
- Validate home domain length when constructing org.stellar.sdk.SetOptionsOperation instances.
- Fix bug in
org.stellar.sdk.requests.OperationsRequestBuilder.operation(long operationId)
. The method submitted an HTTP request to Horizon with the following path, /operation/ , but the correct path is /operations/ - Rename
org.stellar.sdk.requests.PathsRequestBuilder
toorg.stellar.sdk.requests.StrictReceivePathsRequestBuilder
- Add
sourceAssets()
toorg.stellar.sdk.requests.StrictReceivePathsRequestBuilder
which allows a list of assets to be provided instead of a source account - Add
org.stellar.sdk.requests.StrictSendPathsRequestBuilder
which is the request builder for the /paths/strict-send endpoint - Removed deprecated classes:
org.stellar.sdk.PathPaymentOperation
andorg.stellar.sdk.responses.operations.PathPaymentOperationResponse
- The
fee_paid
field in the Horizon transaction response will be removed when Horizon 0.25 is released. Thefee_paid
field has been replaced bymax_fee
, which defines the maximum fee the source account is willing to pay, andfee_charged
, which defines the fee that was actually paid for a transaction. Consequently,getFeePaid()
has been removed fromorg.stellar.sdk.responses.Transaction
and has been replaced withgetMaxFee()
andgetFeeCharged()
.
The following methods are deprecated and will be removed in 0.11.0. Please switch to new methods and classes.
Deprecated | New method/class |
---|---|
org.stellar.sdk.PathPaymentOperation |
org.stellar.sdk.PathPaymentStrictReceiveOperation |
org.stellar.sdk.responses.operations.PathPaymentOperationResponse |
org.stellar.sdk.responses.operations.PathPaymentStrictReceiveOperationResponse |
- Add helper method to generate SEP 10 challenge
- Stellar Protocol 12 compatibility.
- Include
path
property in path payment operation responses. - Provide
includeTransactions()
method for constructing operations requests which include transaction data in the operations response. - Provide
includeTransactions()
method for constructing payments requests which include transaction data in the payments response.
- Use strings to represent account ids instead of KeyPair instances because account ids will not necessarily be valid public keys. If you try to parse an invalid public key into a KeyPair you will encounter an exception. To prevent exceptions when parsing horizon responses it is better to represent account ids as strings
- Removed deprecated methods and classes listed in the 0.7.0 changelog entry
- Configure network at the transaction and server level rather than using a singleton to determine which network to use globally.
- Implement hashCode() and equals() on Stellar classes and XDR generated classes
- Add streaming for account Offers
- Add callback to handle SSE failures
The following methods are deprecated and will be removed in 0.8.0. Please switch to new methods and classes.
Deprecated | New method/class |
---|---|
org.stellar.sdk.Server#operationFeeStats |
org.stellar.sdk.Server#feeStats |
org.stellar.sdk.requests.OperationFeeStatsRequestBuilder |
org.stellar.sdk.requests.FeeStatsRequestBuilder |
org.stellar.sdk.responses.OperationFeeStatsResponse |
org.stellar.sdk.responses.FeeStatsResponse |
org.stellar.sdk.responses.operations.CreatePassiveOfferOperationResponse |
org.stellar.sdk.responses.operations.CreatePassiveSellOfferOperationResponse |
org.stellar.sdk.responses.operations.ManageOfferOperationResponse |
org.stellar.sdk.responses.operations.ManageOfferSellOperationResponse |
org.stellar.sdk.CreatePassiveOfferOperation |
org.stellar.sdk.CreatePassiveSellOfferOperation |
org.stellar.sdk.ManageOfferOperation |
org.stellar.sdk.ManageSellOfferOperation |
- Stellar Protocol 11 compatibility (#199).
- Compatibility with Horizon API updates (#205).
- Add Support for
InflationOperation
inOperation.fromXdr
(#194). - Fixed exception thrown from
ManageOfferOperation.fromXDR
for some offers (#188). - Send Horizon client fingerprint (#190).
Server
now implementsCloseable
interface (#182).- Fixed
/order_book
endpoint streaming.
- Horizon 0.17.0 features (#180)
- Enable setting custom base fee (#177)
- Horizon 0.16.0 features (#172)
- Allow no signatures in Transaction.toEnvelopeXdr (#164)
- Fix dependencies shadowing (#173)
- Fixed streaming issues.
- Breaking change
Transaction.Builder
requiressetTimeout
method to be called. - Added Horizon 0.15.0 features.
- Improved streaming code and dependencies (thanks @jillesvangurp!).
- SEP-0005 derivation (thanks @westonal!).
- Non
ed25519
keys are now supported in all responses (fixes #126):SetOptionsOperationResponse.getSigner
is deprecated. Please useSetOptionsOperationResponse.getSignerKey
.AccountResponse.Signer.getAccountId
is deprecated. Please useAccountResponse.Signer.getKey
.
- Fixed
PathPaymentOperationResponse.getSourceAsset
method (#125).
- Fixed condition check in
TimeBounds
whenmaxTime
is equal0
.
- Protocol V10 updates:
Transaction
now has methods to create it from previously builtTransactionEnvelope
.- Improved
Server.submitTransaction
method, now throws exception for timeouts.
- Fixed
MemoReturnHash#toXdr()
method. - Patch for Horizon Timeout responses (
SubmitTransactionResponse.getEnvelopeXdr()
andSubmitTransactionResponse.getResultXdr()
).
- Full compatibility with Horizon 0.13.0 API.
- Fixed
Page.getNextPage
#66.
- Java SDK now works in Android!
Price
constructor is now public.- Added support for new endpoints and fields added in Horizon v0.12.0.
- Fixed
pad()
method inXdrInputStream
. - Added utf8 string support for
XdrDataInputStream
andXdrDataOutputStream
. - Fixed
AllowTrustOperation.Builder
forASSET_TYPE_CREDIT_ALPHANUM12
assets.
KeyPair.sign
now throwsRuntimeException
whenKeyPair
object does not contain a secret key.SubmitTransactionResponse.getOfferIdFromResult
if offer was taken andtx_result
does not contain offer ID.
- Regenerated XDR classes:
XdrDataOutputStream
class is now padding opaque data.XdrDataInputStream
class is now throwing an IOException when padding bytes are not zeros.- Made methods that shouldn't be used outside of
XdrDataOutputStream
andXdrDataInputStream
classes private. - Removed unused imports and variables.
- Added ability to set TimeBounds using Transaction.Builder
- Implemented
/order_book
and/order_book/trades
requests.
- Fixed a bug in
AssetDeserializer
. - Fixed a bug in
TransactionResponse
.
- Support for new signer types:
sha256Hash
,preAuthTx
. - Breaking change
Network
must be explicitly selected. Previously testnet was a default network.
- New location of
stellar.toml
file
- Fixed a bug in
OffersRequestBuilder.execute(URI uri)
(799f0df).
- Update and fix XDR (0b404d9).
- Added ResultCodes to SubmitTransactionResponse (79e2260).
Transaction.Builder.addOperation
is now thread safe (248a4a1).- Added
hashCode
method forAsset
classes (ab822e5). FederationResponse
constructor is now public. (c4c5a4d).- Updates to javadoc.
- Breaking change Merged java-stellar-base and java-stellar-sdk. More info in #19.