Skip to main content
Version: 6.0.3

extendExpiration

Extend unsigned transaction expiration time in seconds.

Usage​

tronWeb.transactionBuilder.extendExpiration(transaction, extension, options);

Parameters​

ArgumentDescriptionType
transactionThe transaction objectObject
extensionExtension of the expiration time in secondsInteger
optionsOptional. Options for extendExpirationobject
options.txLocalOptional. Default is false. If is true, transaction will be build locallyboolean

Returns​

Unsigned transaction object.

Note​

The Transaction hash(Transaction ID) will be changed after "extendExpiration" was executed as a new transaction object is generated. Please use the newly generated Transactions for subsequent processes like sign or broadcast.

Example​

const transaction = await tronWeb.transactionBuilder.sendTrx("TNo9e8MWQpGVqdyySxLSTw3gjgFQWE3vfg", 100, "TM2TmqauSEiRf16CyFgzHV2BVxBejY9iyR");  
const extendExpirationObj = await tronWeb.transactionBuilder.extendExpiration(transaction, 500);
const signedtxn = await tronWeb.trx.sign(extendExpirationObj, privateKey);
console.log(extendExpirationObj);
> {txID: "a33e940480202c8d38c65a571a699be4e082e40776bab0000103c8cca63f6cb4", raw_data: {}, raw_data_hex: "0a02c9bc2208a506a5de6e7a02c040d0c48fd3822e5a650801…d4fa7b33c9645a2276dc9b192902e2d186470e7b1edd2822e", visible: false}