Catalog npm
Back to packageRELEASE DETAILS

0.64.2

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).

Published23 Jun 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.64.2runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.64.2runtime
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-4aPsAPLWSgs3/SkH0aOp8GwHfaAkTbhe9pEHHPxbWzeQCv+tJcEOis+Zm85+kfe09ZfIUQOfc85QAjJEsqvLDQ==",
  "shasum": "e61a5e3374176c8217e6318e147d6b034f481b4a",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.64.2.tgz",
  "fileCount": 8,
  "unpackedSize": 135666,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIGMccDL7TaTysMQEnYcoriWrLGstg98h/qy96ZWJQyS+AiEAvFKV8/9GadgTwfcflredObOPRIKL8HXCjbHUAgOlYH8="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitEoXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmryQg//VxD3+iThgtDwDYD60WAT8xXrQIrt1IRjv6Vqo9wlUwFgZHj/\r\nYfwENQ+4doCkqcYEA/9GYGt+hUdEsXMBJp8W+XDhiuQsOTpUfN8sQjKBPBtE\r\nHgQizYln5Qtl01pP7dQjcaUOImzMJP16B826I55AudwV4BDpBevdkNw7AAs9\r\nbQ8bh8RYJXu/i8lTPrF/3i8VxFeENfzmluEC+XrXrFTises6PtIKgldJ46v7\r\n1nUxl3ialWnzlJaO63thuPD3aKYumblmTt0VmlvEWTDZpVn85Ig9uJWYJpbY\r\nHK0JYCoc5oEt37Qwby4fgyHZipi5O3yWOZBd3YaSnYtqueqBaYWPe2o/Li6O\r\nv9yECZOGkZENfsuFY/rgNa30GqJ3lUe4DxXDGEh81LCv7BoKcN5s1RSY9xMK\r\nYvLxw5W1jKz0CnjlBdlHmTUF6wnEFc04Tqgmmn7W9C4wb9KsMIxlkZsCInjc\r\nUV9LUxfdvnUOoY0YdAadtP0ke/fHc3dHo/FjyAQFcSnzfFDlCuJ7ZVqzy26l\r\nSjeid7JS8HjPg/EbZbm4+E1ouyF36dtmajbyxiDk90WqparHB4bQsNIYfb0J\r\n+26itOPOQpjj2DPamihGPPKOVc/si3t4slhcbRJ67P1/F3FPZbVtXr2NVkor\r\njY8DOVa6O/Wm38vplqj0TdQJ6or/vv9uZ2g=\r\n=BeL9\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:29 UTC

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

Record identity

package_version:af6a32a4fb798979b1e3a2bd01129f3bd90f93d61a9feb9c85e7649e03fa8a45

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 →