broadcast_transaction
Function
Description
Set chain ID to 369 (PulseChain)
Check if auto gas is not enabled
Apply the estimated gas required to the transaction
Apply median gas strategy to the transaction
Apply the gas multiplier to the transaction
Set max attempts
Sign the transaction
Send the signed raw transaction to the RPC server and get back a transaction hash
If it fails check for a few errors and act accordingly
If nonce is too low then get the current nonce and try again
If unable to replace the current transaction/nonce then increase the gas by 3.69% and try again
If the transaction is already known then proceed as normal
If no transaction hash was set, it’s because this function was previously interrupted, we loop and check when the transaction/nonce has been confirmed or else start from the beginning and rebroadcast the transaction
Wait for the transaction receipt for 10 seconds, it will throw an exception if it’s still pending
If there are attempts remaining then rebroadcast the transaction and check again
Return the transaction receipt if everything is ok