Skip to content

Commit

Permalink
stream-payments example - use AssetTransferInterface instead of Payment
Browse files Browse the repository at this point in the history
  • Loading branch information
zulucrypto committed Aug 12, 2018
1 parent c1f5db0 commit e554211
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/stream-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
require '../vendor/autoload.php';

use \ZuluCrypto\StellarSdk\Horizon\ApiClient;
use \ZuluCrypto\StellarSdk\Model\Payment;
use \ZuluCrypto\StellarSdk\Model\AssetTransferInterface;

$client = ApiClient::newPublicClient();

$client->streamPayments('now', function(Payment $payment) {
printf('[%s] %s from %s -> %s' . PHP_EOL,
$client->streamPayments('now', function(AssetTransferInterface $assetTransfer) {
printf('[%s] [%s] %s from %s -> %s' . PHP_EOL,
(new \DateTime())->format('Y-m-d h:i:sa'),
$payment->getAmount(),
$payment->getFromAccountId(),
$payment->getToAccountId()
$assetTransfer->getAssetTransferType(),
$assetTransfer->getAssetAmount(),
$assetTransfer->getFromAccountId(),
$assetTransfer->getToAccountId()
);
});

0 comments on commit e554211

Please sign in to comment.