Catalog npm
Back to packageRELEASE DETAILS

0.96.4

npm

@0xflair/react-openzeppelin

Ready-made React hooks on top of OpenZeppelin smart contracts. This library is built on top of amazing [wagmi](https://wagmi.sh).

Published9 Aug 2022
Direct dependencies9
Transitive dependenciesNot calculated

README

Current package documentation

Flair SDK: react-openzeppelin

Ready-made React hooks on top of OpenZeppelin smart contracts. This library is built on top of amazing wagmi.

Getting Started

Installation

npm install @0xflair/react-openzeppelin

The dependencies:

  • ethers: ^5.6.5
  • wagmi: ^0.3.5

Hooks

useOzHasRole

Check if a certain address has a specific Openzeppelin's AccessControl role or not.

import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
import { useOzHasRole } from "@0xflair/react-openzeppelin";

const { data, error, isLoading } = useOzHasRole({
  // You contract address that is using Openzeppelin's AccessControl
  contractAddress: "0x111111111111111111111111111111",

  // The address to check if it has the role or not
  address: "0x222222222222222222222222222222",

  // The role hash you want to check
  role: keccak256(toUtf8Bytes("MINTER_ROLE")),
});

useOzRoleGranter

Assign a certain role to a specific address.

useOzRoleRenouncer

Renounce a certain role from an already granted address.

useOzOwner

Check if a certain address is owner based on Openzeppelin's Ownable.

Missing something?

This library is a work in progress and we'll be adding new hooks as we need them. If there's a method you want to see as a simple hook feel free to open an issue or better create a PR :)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 13

Native requirements
9 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xflair/contracts-registry
Environment
{
  "local_name": "@0xflair/contracts-registry",
  "alias": false,
  "peer_metadata": null
}
^0.96.4runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.96.4runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^5.6.5runtime
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^0.3.5runtime
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^18.0.10development
@types/react-dom
Environment
{
  "local_name": "@types/react-dom",
  "alias": false,
  "peer_metadata": null
}
^18.0.5development
@0xflair/contracts-registry
Environment
{
  "local_name": "@0xflair/contracts-registry",
  "alias": false,
  "peer_metadata": null
}
0.*peer
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
0.*peer
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^5.6.5peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^16 || ^17 || ^18peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^16 || ^17 || ^18peer
react-query
Environment
{
  "local_name": "react-query",
  "alias": false,
  "peer_metadata": null
}
*peer
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^0.3.5peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-IJ5B3jd8ZddKP3P7bUvWgB6jhjbQWmIPNzOtcLCgH006P/8wM4OJXpCoV7POGwoUllLSRMbAWa5sdDxeaSu+FA==",
  "shasum": "aeba9e6f32a35668b930a76f452d664599c68d3f",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.96.4.tgz",
  "fileCount": 8,
  "unpackedSize": 159276,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIHiuz0um60P90mrUGmYnvvvaMyfUxMFSqY5H1qUGO/d3AiEArvxkmGALMM+0WGT14iUpd4dPDhzQCD0HWTeoYtYv/mI="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8ikVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovvg//Z6i0WQX8FJEKLjMN4C2pyruwx7HE8Iop/dt6Bg4DnNuxQu9P\r\nFLHbCMVExef7YI+Z9nzk0SwTlUjamEzo7fXuB82fW8pxzxXPzw1ztas3190q\r\nBXoCPzqnC5erTfQHn2vL/JCXrhJzDK9QacWgfxEl77FXo6ZRHTsfrTjaRFZY\r\nGKAskxa+ZYjMIRgzHXACKgqEMS1qIL1kcIn4fSOH4bsp6SleDgHHv56y2sDG\r\nbjW2ucImuIdZIzJDrLqVcKDYgUnhMHbAOqck+g0qvOa9UgBBNozRhysWmAZ/\r\npaCzBmpM63ZuqhqFbo4U07wsCHfqYv+OtPGv+8oWRCGjJRssfQhdBIROzSj4\r\njg9N2ouUguiMHOz4afWBwk8ecfUdyXAotulQb5dDJfYrn1sQjc9yx0agkded\r\nBZ60HUrSTcdBkEcRvGnyRpz9S3IXq1eObGy7XvwLLh3l4AE2NeGR7VZGpJgV\r\n8+HzTqD6SNAcFd8EX7FLNxj/1XdASEYtRTHxlcF6CxxmbtFXl/srUgpq9q7y\r\nGFMeTWeQiz+plR4e/GnjahZvQqU85B0GwgkpRNfKHSKsqM6ZBDnL34pN3LBX\r\n2++2zVJrLOF7Bxo05yxsUeRqIMj+qLqP5UlshsNq6dOgdD6CjppR+y072/+c\r\ngLirauShNaGDn44hwnCpHdmwji+N5G2dxpU=\r\n=UR9k\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
0xflair/typescript-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:30 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2cbb32a291597dfd7377b53c47362e168bd4e02db702c22b9dec03cb87eedcf4

Other collected versions

0.123.227 Nov0.123.112 Nov0.123.08 Nov0.122.228 Oct0.122.128 Oct0.122.028 OctView all collected versions →