Skip to content

Commit

Permalink
prepare for release 1.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Sep 5, 2024
1 parent 7c37e04 commit 162fa42
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# [Stellar SDK for PHP](https://github.com/Soneso/stellar-php-sdk)

![v1.5.5](https://img.shields.io/badge/v1.5.5-green.svg)
![v1.5.6](https://img.shields.io/badge/v1.5.6-green.svg)

The Soneso open source Stellar SDK for PHP provides APIs to build and sign transactions, connect and query [Horizon](https://github.com/stellar/horizon).

Expand Down
6 changes: 6 additions & 0 deletions Soneso/StellarSDK/CreateClaimableBalanceOperationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class CreateClaimableBalanceOperationBuilder
private string $amount;
private ?MuxedAccount $sourceAccount = null;

/**
* Constructor.
* @param array<Claimant> $claimants the claimants that can claim the claimable balance.
* @param Asset $asset the asset to claim.
* @param string $amount amount of the asset to claim.
*/
public function __construct(array $claimants, Asset $asset, string $amount) {
$this->claimants = $claimants;
$this->asset = $asset;
Expand Down
2 changes: 1 addition & 1 deletion Soneso/StellarSDK/StellarSDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
class StellarSDK
{

public const VERSION_NR = "1.5.5";
public const VERSION_NR = "1.5.6";
public static string $PUBLIC_NET_HORIZON_URL = "https://horizon.stellar.org";
public static string $TEST_NET_HORIZON_URL = "https://horizon-testnet.stellar.org";
public static string $FUTURE_NET_HORIZON_URL = "https://horizon-futurenet.stellar.org";
Expand Down
34 changes: 33 additions & 1 deletion soroban.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ Find the complete code [here](https://github.com/Soneso/stellar-php-sdk/blob/mai

You can find the working code and more in the [Soroban Test](https://github.com/Soneso/stellar-php-sdk/tree/main/Soneso/StellarSDKTests/SorobanTest.php), [Soroban Auth Test](https://github.com/Soneso/stellar-php-sdk/blob/main/Soneso/StellarSDKTests/SorobanAuthTest.php) and [Atomic Swap Test](https://github.com/Soneso/stellar-php-sdk/blob/main/Soneso/StellarSDKTests/SorobanAtomicSwapTest.php) of the PHP SDK. The wasm byte-code files can be found in the [test/wasm](https://github.com/Soneso/stellar-php-sdk/tree/main/Soneso/StellarSDKTests/wasm/) folder.

Because Soroban and the PHP SDK support for Soroban are in development, errors may occur. For a better understanding of an error you can enable the ```SorobanServer``` logging:
For a better understanding of an error you can enable the ```SorobanServer``` logging:

```php
$server->enableLogging = true;
Expand All @@ -408,3 +408,35 @@ This will log the responses received from the Soroban-RPC server.

If you find any issues please report them [here](https://github.com/Soneso/stellar-php-sdk/issues). It will help us to improve the SDK.

### Soroban contract parser

The 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:

```php
$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:
```php
$contractInfo = $server->loadContractInfoForContractId($contractId);
```

By wasm id:
```php
$contractInfo = $server->loadContractInfoForWasmId($contractWasmId);
```

The parser returns a `SorobanContractInfo` object containing the parsed data.
In [SorobanParserTest.php](https://github.com/Soneso/stellar-php-sdk/blob/main/Soneso/StellarSDKTests/SorobanParserTest.php) you can find a detailed example of how you can access the parsed data.

0 comments on commit 162fa42

Please sign in to comment.