@@ -108,7 +108,7 @@ export class Transaction extends BaseTransaction {
108108 fee : parsedTx . operations [ 2 ] . amount . value ,
109109 senderPublicKeyHex : senderPublicKeyHex ,
110110 transactionType : transactionType ,
111- expiryTime : Number ( parsedTx . metadata . created_at_time + ( MAX_INGRESS_TTL - PERMITTED_DRIFT ) ) ,
111+ expiryTime : Number ( parsedTx . metadata . ingress_end ?? parsedTx . metadata . created_at_time + MAX_INGRESS_TTL ) ,
112112 memo : parsedTx . metadata . memo ,
113113 } ;
114114
@@ -225,6 +225,7 @@ export class Transaction extends BaseTransaction {
225225 ) as CborUnsignedTransaction ;
226226 const update = unsignedTransaction . updates [ 0 ] ;
227227 const httpCanisterUpdate = ( update as unknown as [ string , HttpCanisterUpdate ] ) [ 1 ] ;
228+ httpCanisterUpdate . ingress_expiry = BigInt ( unsignedTransaction . ingress_expiries [ 0 ] ) ;
228229 return await this . getParsedTransactionFromUpdate ( httpCanisterUpdate , false ) ;
229230 }
230231
@@ -284,6 +285,7 @@ export class Transaction extends BaseTransaction {
284285 metadata : {
285286 created_at_time : args . createdAtTime . timestampNanos ,
286287 memo : Number ( args . memo . memo ) ,
288+ ingress_end : Number ( httpCanisterUpdate . ingress_expiry ) + PERMITTED_DRIFT ,
287289 } ,
288290 account_identifier_signers : accountIdentifierSigners ,
289291 } ;
@@ -294,6 +296,7 @@ export class Transaction extends BaseTransaction {
294296 async parseSignedTransaction ( rawTransaction : string ) : Promise < ParsedTransaction > {
295297 const signedTransaction = this . _utils . cborDecode ( this . _utils . blobFromHex ( rawTransaction ) ) ;
296298 const httpCanisterUpdate = ( signedTransaction as UpdateEnvelope ) . content as HttpCanisterUpdate ;
299+ httpCanisterUpdate . ingress_expiry = BigInt ( ( signedTransaction as UpdateEnvelope ) . content . ingress_expiry ) ;
297300 return await this . getParsedTransactionFromUpdate ( httpCanisterUpdate , true ) ;
298301 }
299302
0 commit comments