code: function () {
          if(!this.sign) {
              throw new Error(this.signErrorMessage);
          }
          var Data = root.lookup("corepb.Data");
          var err = Data.verify(this.data);
          if (err) {
              throw err;
          }
          var data = Data.create(this.data);
  
          var TransactionProto = root.lookup("corepb.Transaction");
  
          var txData = {
              hash: this.hash,
              from: this.from.getAddress(),
              to: this.to.getAddress(),
              value: cryptoUtils.padToBigEndian(this.value, 128),
              nonce: this.nonce,
              timestamp: this.timestamp,
              data: data,
              chainId: this.chainID,
              gasPrice: cryptoUtils.padToBigEndian(this.gasPrice, 128),
              gasLimit: cryptoUtils.padToBigEndian(this.gasLimit, 128),
              alg: this.alg,
              sign: this.sign
          };
  
          err = TransactionProto.verify(txData);
          if (err) {
              throw err;
          }
          var tx = TransactionProto.create(txData);
  
          var txBuffer = TransactionProto.encode(tx).finish();
          return txBuffer;
      }
docs: Convert transaction to Protobuf format.
  </br><b>Note:</b> Transaction should be [sign]{@link Transaction#signTransaction} before converting.
  
  @return {Buffer} Transaction data in Protobuf format
  
  @example
  var acc = Account.NewAccount();
  
  var tx = new Transaction({
  chainID: 1,
  from: acc,
  to: "n1SAeQRVn33bamxN4ehWUT7JGdxipwn8b17",
  value: 10,
  nonce: 12,
  gasPrice: 1000000,
  gasLimit: 2000000
  });
  tx.signTransaction();
  var txHash = tx.toProto();
  // Uint8Array(127)