Socket
Socket
Sign inDemoInstall

@metaphor-xyz/ens-claim

Package Overview
Dependencies
75
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @metaphor-xyz/ens-claim

React hooks and components that help notify users to claim their $ENS airdrop.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ens-claim

This package provides React hooks and components helpful in notifying users of products that they have unclaimed $ENS tokens from the ENS DAO airdrop, and directing them to claim those tokens.

Installation

npm install --save @metaphor-xyz/ens-claim

or

yarn save @metaphor-xyz/ens-claim

Usage

ENSClaimButton

The ENSClaimButton renders a button, if and only if the user's wallet as an open $ENS claim available, that when clicked shows a modal explaining how to claim the tokens.

import { BaseProvider } from 'ethers';
import { ENSClaimButton } from '@metaphor-xyz/ens-claim';

function SomeComponent({ address, provider }: { address: string, provider: BaseProvider }) {
  return <ENSClaimButton
    address={address}
    provider={provider} // optional
    delegate='metaphor.xyz' // optional, ENS name for default delegate
  />;
}

Claim ENS button Claim ENS modal

useENSClaim

If you would like to create your own button, the useENSClaim hook tells you whether or not an address has ENS tokens to claim.

function SomeComponent() {
  const { hasClaim } = useENSClaim();

  if (!hasClaim) {
    return null;
  }

  // ... render notification
}

License

MIT

TODO

There are a few possible improvements for the library:

  • Show the user their $ENS claim balance. This is very easy to do, but not sure if it's a good idea or not.
  • Perform the claim in-place for the user. This wouldn't be very responsible to do without also implementing the Snapshot voting for constitution ratification, until that process is over at least.

FAQs

Last updated on 14 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc