kalidao / hooks

Kali DAO React Hooks
MIT License
0 stars 1 forks source link

[FEAT] add useEtherscanLink #2

Open ivelin opened 2 years ago

ivelin commented 2 years ago

Is your feature request related to a problem? Please describe. When users interact with on-chain data, they expect a friendly way to verify that it exists on-chain outside of the app UI. As a best practice, dapps provide a link to Etherscan web page with transaction data.

Describe the solution you'd like A React Hook that takes as input chain ID, transaction hash or contract address and creates a populated URL to the correct chain explorer where the transaction or address are hosted.

Describe alternatives you've considered Each app can use it's own ad hoc method for achieving this effect. I have not been able to find a common open source library with this functionality.

ivelin commented 2 years ago

@nerderlyne what do you think about this idea. Does it belong in the Kali hooks library?

nerderlyne commented 2 years ago

Need this!

It will take ->
chainId, type(tx, address), value

It will have return either -> https://{{chainExplorer}}/tx/{{txHash}} https://{{chainExplorer}}/address/{{address}}

I think we decided to build this on top of wagmi? This hook can extend useNetwork so we repeat work)

Does this sound good to you? @ivelin

nerderlyne commented 2 years ago

Need this!

It will take ->
chainId, type(tx, address), value

It will have return either -> https://{{chainExplorer}}/tx/{{txHash}} https://{{chainExplorer}}/address/{{address}}

I think we decided to build this on top of wagmi? This hook can extend useNetwork so we don't repeat work

Does this sound good to you? @ivelin

ivelin commented 2 years ago

Need this!

It will take -> chainId, type(tx, address), value

It will have return either -> https://{{chainExplorer}}/tx/{{txHash}} https://{{chainExplorer}}/address/{{address}}

I think we decided to build this on top of wagmi? This hook can extend useNetwork so we don't repeat work

Does this sound good to you? @ivelin

Yes. All sounds good to me.

ivelin commented 2 years ago

I suppose after some battle testing this hook could become PR to wagmi itself.