@summonlabs/use-ada-handle-resolver
v0.1.1
Published
Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
Downloads
4
Readme
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>
);
};