-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
430 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Superciety\ElrondSdk\Api\Entities; | ||
|
||
use Illuminate\Support\Collection; | ||
use Superciety\ElrondSdk\Api\ApiTransformable; | ||
use Superciety\ElrondSdk\Api\Entities\TransactionLogEvent; | ||
use Superciety\ElrondSdk\Domain\Address; | ||
|
||
final class TransactionLog | ||
{ | ||
use ApiTransformable; | ||
|
||
public function __construct( | ||
public string $id, | ||
public Address $address, | ||
public Collection $events, | ||
) { | ||
} | ||
|
||
protected static function transformResponse(array $res): array | ||
{ | ||
return array_merge($res, [ | ||
'address' => isset($res['address']) ? Address::fromBech32($res['address']) : null, | ||
'events' => isset($res['events']) ? TransactionLogEvent::fromApiResponseMany($res['events']) : collect(), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Superciety\ElrondSdk\Api\Entities; | ||
|
||
use Illuminate\Support\Collection; | ||
use Superciety\ElrondSdk\Api\ApiTransformable; | ||
use Superciety\ElrondSdk\Domain\Address; | ||
use Superciety\ElrondSdk\Utils\Decoder; | ||
|
||
final class TransactionLogEvent | ||
{ | ||
use ApiTransformable; | ||
|
||
public function __construct( | ||
public Address $address, | ||
public string $identifier, | ||
public Collection $topics, | ||
public ?string $data = null, | ||
) { | ||
} | ||
|
||
protected static function transformResponse(array $res): array | ||
{ | ||
return array_merge($res, [ | ||
'address' => isset($res['address']) ? Address::fromBech32($res['address']) : null, | ||
'topics' => isset($res['topics']) ? collect($res['topics']) : [], | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.