-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Some intents are not created and transactions are being timed out / not being included in the blockchain.
To avoid this, please add priority fee to the transaction.
example of adding priority fee (the optimal amount is likely different, I haven't tested it):
// Build your transaction
const transaction = new TransactionBuilder(sourceAccount, {
fee: '100', // Default fee
networkPassphrase: Networks.TESTNET
})
.addOperation(/* your operation */)
.setTimeout(30)
.build();
// Simulate first
const simulation = await server.simulateTransaction(transaction);
// Get the minimum resource fee required
const minResourceFee = simulation.minResourceFee;
// Set a higher fee for priority (base fee + resource fee + priority boost)
const priorityFee = '10000'; // Higher priority fee in stroops
const totalFee = (BigInt(priorityFee) + BigInt(minResourceFee)).toString();
// Rebuild transaction with the higher fee
const priorityTransaction = new TransactionBuilder(sourceAccount, {
fee: totalFee,
networkPassphrase: Networks.TESTNET
})
.addOperation(/* your operation */)
.setTimeout(30)
.build();
// Sign and submit
// ...
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels