Coder Social home page Coder Social logo

hooks's People

Contributors

github-actions[bot] avatar ivelin avatar nerderlyne avatar

Watchers

 avatar

Forkers

ivelin

hooks's Issues

[FEAT] add useChainGuard hook

Is your feature request related to a problem? Please describe.
When users are connected on one ETH chain they are allowed to submit an on-chain transactions in Kali UI to a Kali DAO that is hosted on a different chain. For example vote or propose tx. The transaction is accepted and the gas fee is paid, but the desired result is not achieved.

Describe the solution you'd like
This React Hook would allow UI pages with contract write transactions to ensure that the user is connected to the same chain where the DAO is hosted.

Describe alternatives you've considered
We discussed with @nerderlyne and @audssy the alternative to build visual React components, such as MUI buttons, that have built in chain guard functionality. However that would limit the ability of designers to experiment with different UI component libraries. Hence the decision to expose chain guard logic as a react hook that is independent of visualization libraries.

Additional context
Prior work on this topic here:
kalidao/kali-ui#252

[FEAT] useDaoContext hook

Is your feature request related to a problem? Please describe.
When users navigate into pages that offer information and transactions in the context of a Kali DAO, they usually need to know the chain id and address of the DAO in order to fetch the correct underlying data and respectively submit contract write transactions correctly. This information is also used to make sure that the user is connected to the chain where the DAO is hosted before submitting a contract write transaction.

The hook can also offer a method to create a URL pre-populated with the DAO context parameters to be used in links to pages with a specific DAO context.

Describe the solution you'd like
Provide a react hook that extracts chain ID and address from router router correctly. Each app may provide its own configuration settings how the hook should map router params to values.

Describe alternatives you've considered
Currently each app handles its own way of parameterizing DAO context for pages, extract the context and create links. It makes it error prone and repetitive, especially when apps want to cross-link to each other's pages. For example when a SporosDAO app page (DAO projects) wants to link to a Kali DAO page (DAO registration page).

[FEAT] add useEtherscanLink

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.