build() {
    // Ensure setTimeout called or maxTime is set
    if (
      (this.timebounds === null ||
        (this.timebounds !== null && this.timebounds.maxTime === 0)) &&
      !this.timeoutSet
    ) {
      throw new Error(
        'TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).'
      );
    }

    const sequenceNumber = new BigNumber(this.source.sequenceNumber()).add(1);

    const attrs = {
      sourceAccount: Keypair.fromPublicKey(
        this.source.accountId()
      ).xdrAccountId(),
      fee: this.baseFee * this.operations.length,
      seqNum: xdr.SequenceNumber.fromString(sequenceNumber.toString()),
      memo: this.memo ? this.memo.toXDRObject() : null,
      ext: new xdr.TransactionExt(0)
    };

    if (this.timebounds) {
      if (isValidDate(this.timebounds.minTime)) {
        this.timebounds.minTime = this.timebounds.minTime.getTime() / 1000;
      }
      if (isValidDate(this.timebounds.maxTime)) {
        this.timebounds.maxTime = this.timebounds.maxTime.getTime() / 1000;
      }

      this.timebounds.minTime = UnsignedHyper.fromString(
        this.timebounds.minTime.toString()
      );
      this.timebounds.maxTime = UnsignedHyper.fromString(
        this.timebounds.maxTime.toString()
      );

      attrs.timeBounds = new xdr.TimeBounds(this.timebounds);
    }

    const xtx = new xdr.Transaction(attrs);
    xtx.operations(this.operations);

    const xenv = new xdr.TransactionEnvelope({ tx: xtx });
    const tx = new Transaction(xenv);

    this.source.incrementSequenceNumber();

    return tx;
  }
/**
   * This will build the transaction.
   * It will also increment the source account's sequence number by 1.
   * @returns {Transaction} This method will return the built {@link Transaction}.
   */
This will build the transaction.
It will also increment the source account's sequence number by 1.
@returns {Transaction} This method will return the built  Transaction.
This will build the transaction . It will also increment the source account ' s sequence number by 1 . @returns { Transaction } This method will return the built Transaction .
build() {
    if (
      (this.timebounds === null ||
        (this.timebounds !== null && this.timebounds.maxTime === 0)) &&
      !this.timeoutSet
    ) {
      throw new Error(
        'TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).'
      );
    }
    const sequenceNumber = new BigNumber(this.source.sequenceNumber()).add(1);
    const attrs = {
      sourceAccount: Keypair.fromPublicKey(
        this.source.accountId()
      ).xdrAccountId(),
      fee: this.baseFee * this.operations.length,
      seqNum: xdr.SequenceNumber.fromString(sequenceNumber.toString()),
      memo: this.memo ? this.memo.toXDRObject() : null,
      ext: new xdr.TransactionExt(0)
    };
    if (this.timebounds) {
      if (isValidDate(this.timebounds.minTime)) {
        this.timebounds.minTime = this.timebounds.minTime.getTime() / 1000;
      }
      if (isValidDate(this.timebounds.maxTime)) {
        this.timebounds.maxTime = this.timebounds.maxTime.getTime() / 1000;
      }
      this.timebounds.minTime = UnsignedHyper.fromString(
        this.timebounds.minTime.toString()
      );
      this.timebounds.maxTime = UnsignedHyper.fromString(
        this.timebounds.maxTime.toString()
      );
      attrs.timeBounds = new xdr.TimeBounds(this.timebounds);
    }
    const xtx = new xdr.Transaction(attrs);
    xtx.operations(this.operations);
    const xenv = new xdr.TransactionEnvelope({ tx: xtx });
    const tx = new Transaction(xenv);
    this.source.incrementSequenceNumber();
    return tx;
  }
build ( ) { if ( ( this . timebounds === null || ( this . timebounds !== null && this . timebounds . maxTime === 0 ) ) && ! this . timeoutSet ) { throw new Error ( 'TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).' ) ; } const sequenceNumber = new BigNumber ( this . source . sequenceNumber ( ) ) . add ( 1 ) ; const attrs = { sourceAccount : Keypair . fromPublicKey ( this . source . accountId ( ) ) . xdrAccountId ( ) , fee : this . baseFee * this . operations . length , seqNum : xdr . SequenceNumber . fromString ( sequenceNumber . toString ( ) ) , memo : this . memo ? this . memo . toXDRObject ( ) : null , ext : new xdr . TransactionExt ( 0 ) } ; if ( this . timebounds ) { if ( isValidDate ( this . timebounds . minTime ) ) { this . timebounds . minTime = this . timebounds . minTime . getTime ( ) / 1000 ; } if ( isValidDate ( this . timebounds . maxTime ) ) { this . timebounds . maxTime = this . timebounds . maxTime . getTime ( ) / 1000 ; } this . timebounds . minTime = UnsignedHyper . fromString ( this . timebounds . minTime . toString ( ) ) ; this . timebounds . maxTime = UnsignedHyper . fromString ( this . timebounds . maxTime . toString ( ) ) ; attrs . timeBounds = new xdr . TimeBounds ( this . timebounds ) ; } const xtx = new xdr . Transaction ( attrs ) ; xtx . operations ( this . operations ) ; const xenv = new xdr . TransactionEnvelope ( { tx : xtx } ) ; const tx = new Transaction ( xenv ) ; this . source . incrementSequenceNumber ( ) ; return tx ; }
This will build the transaction.
This will build the transaction .
// Ensure setTimeout called or maxTime is set