@summonlabs/use-ada-handle-resolver
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

ADA Handle resolver

This is useful hook for react based apps to resolve ADA handles as Cardano addresses

Debounced, with custom delay

Works on mainnnet and the old testnet

Example

Use it on input, and show the resolved address to an user. Address is returned as an empty string when no handle is resolved.

const BLOCKFROST_PROJECT_ID = `<project_id>`
const App = () => {

  const { address, handleInputChangeDebounced } = useAdaHandleResolver({ blockfrostProjectId: BLOCKFROST_PROJECT_ID, delay: 500 })

  return (
    <form>
      <input type={'text'} onChange={handleInputChangeDebounced} />
      {address ? `Resolved as ${address}` : ``}
    </form>
  );
};

Package Sidebar

Install

npm i @summonlabs/use-ada-handle-resolver

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

82.4 kB

Total Files

12

Last publish

Collaborators

  • dzcodes