Catalog npm
Back to packageRELEASE DETAILS

0.97.9

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.97.9runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.97.9runtime
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-idUEyWb/Nwc9ReCgJ+fnKj30nhWR/GC46btyO45Tox6rANf7s0peyvrGto1sEceM4FSZmwL63IZ0mTApee/rew==",
  "shasum": "caa40673253f0435fde26e51bd476cdf8a8e2940",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.97.9.tgz",
  "fileCount": 8,
  "unpackedSize": 159276,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCDzE8lZC4bxu516QI/dgw3M1L1w2jIdonB1TQvUMoBqgIhANny5PD0UdyCYSapQdFeX5/vgevgPZ2oKLH6bnxH9sbQ"
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8qaWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0bA//RIu0l+DXJp5t+r5zMrJSrXWxn84wPTQhiOr5rlQmegBgYfLb\r\nyUffo1qyp4vDdSFc3db9rjRv3qR2EDZt71QQgGh6idIlp1Lo8VZiCZlK6/F5\r\nro+Lj7yzVrXD4P2F1QNqW1NSHeSht6nvjRu/RDsjrADi+4mdMlEkydHmEf9s\r\nafGqHAvdYkIieL05YokLA9m19u72RA5wp1uwe6Fo6TgPk6jIY2SRqlSEFYES\r\n3/U2VgNQwxP2T2yK/O6cy0qGjBGpCEI1YeCoeYqMx5ryerHVZYZzOY8qWIak\r\nIP52aBv+P3j5mknN9UKK7wz+f9RTmgRYX+tJLDioE3M8pt4Kmjdf9WrlXCsd\r\n3ieVev/lBDWSlXn7XR1RlDaPnFLYquS6mu3zs2SvkLXewpsZslBE0OMXIbte\r\nG3cW7fCNQ9cJ9X4NcQAfwj+7ihRod1KPlnoc8l+SSiaRZ9T35hFIg0i49Amb\r\nwI4gd3ZBwsmrHLNJpGA1LU5OQp1y74g99jLp5QCAnoL/3egnLtGzMefFhd8o\r\nJ1YWvSylVAvB57DyaPYabZXSdF9dPwusmOc8G1lHgUqSK3vaIjVt3vHX6grz\r\nXvDHSF8ArTvctg4tTWReM6YoHSbwBa1bQTfjXJ7ydVrwm/Yb1lb2AT/hlRwv\r\nqQoqKnwpz8Icn4EZmPRfetkuu7eF51CNJec=\r\n=u5HX\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:5508bd9182b5445688da92489b4e87fa439bde44ea32b529db224a01f64e6de7

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 →