@@ -14,6 +14,7 @@ import {
1414 isTrezorEnabled ,
1515 isLedgerEnabled ,
1616} from '../config/hardwareWalletsConfig' ;
17+ import { TIME_TO_LIVE } from '../config/txnsConfig' ;
1718import {
1819 getHardwareWalletTransportChannel ,
1920 getExtendedPublicKeyChannel ,
@@ -1151,13 +1152,14 @@ export default class HardwareWalletsStore extends Store {
11511152 }
11521153
11531154 const { isMainnet } = this . environment ;
1155+ const ttl = this . _getTtl ( ) ;
11541156
11551157 try {
11561158 const signedTransaction = await signTransactionTrezorChannel . request ( {
11571159 inputs : inputsData ,
11581160 outputs : outputsData ,
11591161 fee : formattedAmountToLovelace ( fee . toString ( ) ) . toString ( ) ,
1160- ttl : '150000000' ,
1162+ ttl : ttl . toString ( ) ,
11611163 networkId : isMainnet
11621164 ? HW_SHELLEY_CONFIG . NETWORK . MAINNET . networkId
11631165 : HW_SHELLEY_CONFIG . NETWORK . TESTNET . networkId ,
@@ -1290,9 +1292,8 @@ export default class HardwareWalletsStore extends Store {
12901292 } ) ;
12911293
12921294 const certificatesData = await Promise . all ( _certificatesData ) ;
1293-
12941295 const fee = formattedAmountToLovelace ( flatFee . toString ( ) ) ;
1295- const ttl = 150000000 ;
1296+ const ttl = this . _getTtl ( ) ;
12961297 const withdrawals = [ ] ;
12971298 const metadataHashHex = null ;
12981299 const { isMainnet } = this . environment ;
@@ -1738,6 +1739,13 @@ export default class HardwareWalletsStore extends Store {
17381739 return type ;
17391740 } ;
17401741
1742+ _getTtl = ( ) : number => {
1743+ const { networkTip } = this . stores . networkStatus ;
1744+ const absoluteSlotNumber = get ( networkTip , 'absoluteSlotNumber' , 0 ) ;
1745+ const ttl = absoluteSlotNumber + TIME_TO_LIVE ;
1746+ return ttl ;
1747+ } ;
1748+
17411749 _setHardwareWalletLocalData = async ( {
17421750 walletId,
17431751 data,
0 commit comments