- Additional support for BumpSequenceOp: it is now read correctly when listing operations
- Convenience method for checking if an account is valid:
Account::isValidAccount
- Convenience method for checking if an account exists on the network (is funded):
Server::accountExists
getTransactionHash()
is now supported on all operations (if Horizon includes it in the response)- HTTP Client can now be retrieved and overridden for testing or if you want to use a custom one
TransactionBuilder
now always uses aBigInteger
internally when working with account sequence numbers- Reduced the number of times an API call is made to Horizon to get the account's sequence number. Thanks to @rhysied for pointing out this issue!
Maintenance release
- TransactionBuilder setMemo() now returns the TransactionBuilder
- Improved error reporting and error messages
- Fixed stream payments example
Added support for BumpSequenceOp
Note that this is for forward compatibility. This operation is not yet available in the Stellar test or production networks.
Use empty()
instead of count()
for checking if operationResultCodes
are present (thanks @omarfurrer)
Fix "Only variables should be passed by reference" notice in several XdrDecoder / XdrEncoder methods (thanks @natrod)
Initial support for parsing binary XDR into PHP objects.
See examples/transaction-add-signature.php
To sign existing XDR:
$server = Server::testNet();
$transactionEnvelope = TransactionEnvelope::fromXdr(new XdrBuffer($xdr));
$transactionEnvelope->sign($keypair, $server);
$server->submitB64Transaction($transactionEnvelope->toBase64());
This release adds parsing of the Transaction response so you can get detailed information on the result of each operation.
- When submitting a transaction, you will now get back an instance of
PostTransactionResponse
- If a transaction fails due to a failing operation, a
PostTransactionException
is now thrown
These two new classes have methods for retrieveing details about each operation within the transaction.
In addition, the text transaction result and operation results from the Horizon response are now included (thanks @omarfurrer)
Breaking Changes / Incompatibilities
- Refactored
getPayments
andstreamPayments
to return a newAssetTransferInterface
instead of aPayment
object. See details below.
This release is to refactor how payments are handled. The Horizon /accounts/<account ID>/payments
endpoint
returns a variety of operations, all of which represent XLM or another asset being transferred:
- Payment
- Path payment
- Create account
- Merge account
Methods that previously returned a Payment
will now return AssetTransferInterface
To migrate your code:
- Replace any calls to
$payment->getType()
with$payment->getAssetTransferType()
. This will return a string describing the operation type - Replace
$payment->getAmount()
with$payment->getAssetAmount()
Breaking Changes / Incompatibilities
- Removed previously deprecated
CreateAccountXdrOperation
New Features / Fixes:
- "Create Account" operations are no longer included when streaming payments.
Previously, they would cause a crash since they could not be decoded to
Payment
objects. - Fixes and clarifications on several of the "getting started" examples
Account::getData
has been improved to base64-decode the account data automatically- Added
Payment::getTransactionHash()
(contributed by @cballou) - Several improvements to signature handling so that pre-authorized transactions can be submitted
- Fixed an issue encoding variable length opaque structures
- Fees are now calculated correctly for transactions with multiple operations
Keypair
objects can now be created from public keys (a secret key is no longer required). SeeKeypair::newFromPublicKey
- Fix to
ManageDataOp
XDR encoding
- Fixed an issue where the private key was used instead of the public key when building signer XDR
Breaking Changes / Incompatibilities
- IMPORTANT: arguments to
PaymentOp
have changed (the destination is now the first argument and source is an optional argument) Server->getAccount()
now returnsnull
if an account is not found. Previously, it threw an exception.CreateAccountXdrOperation
has been deprecated and replaced withCreateAccountOp
. It will be removed in version 1.2.0PaymentOp::newNativePayment
now hassourceAccountId
as an optional argument that comes lastPaymentOp::newCustomPayment
now hassourceAccountId
as an optional argument that comes lastTransactionBuilder::addCustomAssetPaymentOp
now hassourceAccountId
as an optional argument that comes last
New Features
- All operations are now supported by
TransactionBuilder
- Better error handling with
HorizonException
class that provides detailed information pulled from Horizon's REST API error messages. - Added
StellarAmount
class for working with numbers that may exceed PHP integer limits - General improvements to large number checks and more tests added
- Initial beta version