Skip to content

Releases: Soneso/stellar-php-sdk

Protocol 22-rc3 support

04 Nov 13:56
Compare
Choose a tag to compare

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 from TransactionInfo is now an int again.
  • The field pagingToken from EventInfo 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

24 Oct 12:58
Compare
Choose a tag to compare

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 and numAccounts have been removed from AssetResponse
  • The deprecated field validAfter has been removed from TransactionResponse

Soroban:

  • The legacy field cost has been removed from SimulateTransactionResponse
  • The createdAt field from TransactionInfo is now a String. It was int before.

Other tips for migrating to Protocol 22:

  • Soroban: The field pagingToken from EventInfo will not be filled any more starting with Protocol 22. Instead, the new field cursor in GetEventsResponse will be filled starting with Protocol 22.
  • Soroban: The new field txHash in GetTransactionResponse and TransactionInfo 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

05 Sep 10:32
Compare
Choose a tag to compare

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

24 Aug 11:17
Compare
Choose a tag to compare
  • 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

09 Aug 11:06
Compare
Choose a tag to compare

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

25 Jul 11:14
Compare
Choose a tag to compare

Updates for Horizon v2.31.0
(see: #42)

  1. 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

  1. 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 and getVersionInfo.
  • fixed getEvents pagination options

Update SEP-12 support

  • added the new transaction_idrequest 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

06 Jul 18:03
Compare
Choose a tag to compare
  • 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

09 Jun 20:07
Compare
Choose a tag to compare

1. Soroban Server improvements:

  • add getAccountand getContractData methods
  • add missing fields oldestLedger and latestLedger to the get health response
  • add useful xdr conversion: getKeyXdr for LedgerEntry
  • add useful xdr conversions: getXdrTransactionEnvelope, getXdrTransactionResult, getXdrTransactionMeta for GetTransactionResponse
  • add missing field txHash to EventInfo
  • add useful xdr conversion: getValueXdr to EventInfo
  • add useful xdr conversion: getErrorXdrTransactionResult for SendTransactionResponse
  • add useful xdr conversion: getResultValue for SimulateTransactionResult

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

13 May 16:09
Compare
Choose a tag to compare

adds support for protocol 21. See #41

SEP-006 Improvements

07 May 21:56
Compare
Choose a tag to compare
  • improve sep-06 info response parsing