Releases: Soneso/stellar-php-sdk
Protocol 22-rc3 support
This release adds support for Protocol 22-rc3 and maintains backwards compatibility for Protocol 21 and Protocol 22-rc2.
See also: #46
Changes:
- The
createdAt
field fromTransactionInfo
is now an int again. - The field
pagingToken
fromEventInfo
is not nullable any more and will be filled for any version.
If you upgrade from the latest stable release (1.5.6) please read the info in release 1.6.0beta1 first.
Protocol 22 support
This release adds support for Protocol 22 and maintains backwards compatibility for Protocol 21.
See also: #44
To maintain compatibility for Protocol 21 until Protocol 22 is released you have to consider following braking changes if you are using this version of the SDK:
Horizon:
- The deprecated fields
amount
andnumAccounts
have been removed fromAssetResponse
- The deprecated field
validAfter
has been removed fromTransactionResponse
Soroban:
- The legacy field
cost
has been removed fromSimulateTransactionResponse
- The
createdAt
field fromTransactionInfo
is now aString
. It wasint
before.
Other tips for migrating to Protocol 22:
- Soroban: The field
pagingToken
fromEventInfo
will not be filled any more starting with Protocol 22. Instead, the new fieldcursor
inGetEventsResponse
will be filled starting with Protocol 22. - Soroban: The new field
txHash
inGetTransactionResponse
andTransactionInfo
will be filled starting with Protocol 22. - Soroban: You can use the new
CreateContractWithConstructorHostFunction
class to create contracts that have a constructor.
Soroban Contract Parser
This release adds a soroban contract parser allows you to access the contract info stored in the contract bytecode.
You can access the environment metadata, contract spec and contract meta.
The environment metadata holds the interface version that should match the version of the soroban environment host functions supported.
The contract spec contains a XdrSCSpecEntry
for every function, struct, and union exported by the contract.
In the contract meta, contracts may store any metadata in the entries that can be used by applications and tooling off-network.
You can access the parser directly if you have the contract bytecode:
$contractByteCode = file_get_contents("path to .wasm file");
$contractInfo = SorobanContractParser::parseContractByteCode($contractByteCode);
Or you can use SorobanServer
methods to load the contract code form the network and parse it.
By contract id:
$contractInfo = $server->loadContractInfoForContractId($contractId);
By wasm id:
$contractInfo = $server->loadContractInfoForWasmId($contractWasmId);
The parser returns a SorobanContractInfo
object containing the parsed data.
In SorobanParserTest.php you can find a detailed example of how you can access the parsed data.
SEP-6 & SEP-24 improvements
- SEP-06: allow extra fields to be added in the deposit and withdrawal requests.
- SEP-06: add the new
userActionRequired
field to the transaction response object. - SEP-24: add the new
userActionRequired
field to the transaction response object. - other improvements: add memo utility methods, fix path payments variable names, add ide helpers for more type safety
Update for Horizon API historical data changes
Due to recent changes in the Stellar Development Foundation’s Horizon API, historical data will now be limited to one year. (https://stellar.org/blog/foundation-news/sdf-s-horizon-limiting-data-to-1-year)
As a result, some claimable balance responses may return a null value for the lastModifiedTime field.
To prevent parsing issues made the lastModifiedTime field optional.
Horizon v2.31.0 and RPC v21.4.0 updates
Updates for Horizon v2.31.0
(see: #42)
- The new Horizon API endpoint: POST
/transactions_async
has been added.
It is now covered in the sdk by following new methods:
$sdk->submitAsyncTransaction(...)
$sdk->submitAsyncTransactionEnvelopeXdrBase64(...)
see also: SubmitAsyncTransactionTest.php
- Error schema change: POST
/transactions
now includes a the hash in its timeout response:
HorizonErrorResponseExtras
has been extended. It now provides `$txHash if the hash is available in the error response.
Updates for RPC v21.4.0
(see: #42)
- added support for the new endpoints:
getTransactions
,getFeeStats
andgetVersionInfo
. - fixed
getEvents
pagination options
Update SEP-12 support
- added the new
transaction_id
request parameter to get and put customer requests.
Improve http exceptions handling
The obsolete option 'http_errors' => false,
has been removed from the GuzzleHttp\Client initialisations.
See also: #29
HorizonErrorResponse
now also provides an $extrasJson
array if available
See also: testHorizonRequestException
Usability improvements
- improve type safety by adding ide helper comments for arrays
- improve guzzle error handling for sep-31, sep-38. sep-10, sep-08 & sep-30
Soroban & SEP-11 improvements
1. Soroban Server improvements:
- add
getAccount
andgetContractData
methods - add missing fields
oldestLedger
andlatestLedger
to the get health response - add useful xdr conversion:
getKeyXdr
forLedgerEntry
- add useful xdr conversions:
getXdrTransactionEnvelope
,getXdrTransactionResult
,getXdrTransactionMeta
forGetTransactionResponse
- add missing field
txHash
toEventInfo
- add useful xdr conversion:
getValueXdr
toEventInfo
- add useful xdr conversion:
getErrorXdrTransactionResult
forSendTransactionResponse
- add useful xdr conversion:
getResultValue
forSimulateTransactionResult
2. SEP-11 (TxRep):
- add soroban support
3. XDR helper methods
- multiple useful additional helper methods in the soroban and classic XDR classes.
Protocol 21 Support
adds support for protocol 21. See #41
SEP-006 Improvements
- improve sep-06 info response parsing