0

please help me with my problem : I am creating a website with blockchain. Now I need to get my transaction results into etherscan.io to my website with a link for this transaction and all these by using etherscan API. EXAMPLE: I need to have same this link on my website after any transaction is done. https://rinkeby.etherscan.io/tx/0x6750e4e507916b37716077bc24737dce133f53718e2d6eb435d2d999e7278b60

thanks all ^^

1 Answer 1

1

see if the transaction hash is generated it means it is successful transaction and in order to get transaction hash you can use " let txConfirm = await provider.getTransaction(FUNCTION_NAME.hash) " and just concat the result after generating transaction hash i.e in my case txConfirm to the "https://rinkeby.etherscan.io/tx/".concat(txConfirm)

2
  • please get me more explanation about FUNCTION_NAME.hash ?
    – Anas Ahmed
    Jun 30 at 13:25
  • When you send a transaction in you app, you get a "transaction receipt". This transaction receipt is an object that contains a transactionHash. In order to generate a link to the Etherscan explorer, you just need to concatenate the base url "rinkeby.etherscan.io/tx" with your transaction hash.
    – Antonio U
    Jul 1 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.