diff --git a/src/transaction.js b/src/transaction.js index 986260770..5791c4cde 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -39,6 +39,9 @@ export class Transaction { } this._networkPassphrase = networkPassphrase; + // temp hack + envelope = envelope.value(); + // since this transaction is immutable, save the tx this.tx = envelope.tx(); this.source = StrKey.encodeEd25519PublicKey( @@ -243,7 +246,9 @@ export class Transaction { toEnvelope() { const tx = this.tx; const signatures = this.signatures; - const envelope = new xdr.TransactionEnvelope({ tx, signatures }); + const envelope = new xdr.TransactionEnvelope.envelopeTypeTx( + new xdr.TransactionV1Envelope({ tx, signatures }) + ); return envelope; } diff --git a/src/transaction_builder.js b/src/transaction_builder.js index d5fdd2339..a17c10a40 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -208,13 +208,14 @@ export class TransactionBuilder { 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 xenv = xdr.TransactionEnvelope.envelopeTypeTx(new xdr.TransactionV1Envelope({ tx: xtx })); const tx = new Transaction(xenv, this.networkPassphrase); this.source.incrementSequenceNumber();