Skip to content

Commit

Permalink
Added example of setting a sequence number on a transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
zulucrypto committed Sep 22, 2018
1 parent 7395221 commit c0f626f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/transaction-set-sequence-number.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

require '../vendor/autoload.php';

use \phpseclib\Math\BigInteger;

use \ZuluCrypto\StellarSdk\Keypair;
use \ZuluCrypto\StellarSdk\Server;
use \ZuluCrypto\StellarSdk\Xdr\XdrBuffer;
use \ZuluCrypto\StellarSdk\XdrModel\TransactionEnvelope;

// GD4JRFLPF4AGYQTLCMZ7Q7DRLGQZQTGWOOKDUCNRVKG66G5ZVYYFT76M
$sourceKeypair = Keypair::newFromSeed('SAA2U5UFW65DW3MLVX734BUQIHAWANQNBLTFT47X2NVVBCN7X6QC5AOG');

// GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6
$destinationKeypair = Keypair::newFromSeed('SBGWSG6BTNCKCOB3DIFBGCVMUPQFYPA2G4O34RMTB343OYPXU5DJDVMN');


$builder = Server::testNet()
->buildTransaction($sourceKeypair)
->addLumenPayment($destinationKeypair, 100);

$builder->setSequenceNumber(new BigInteger(123));

print "Sequence number: " . $builder->getSequenceNumber() . "\n";

0 comments on commit c0f626f

Please sign in to comment.