Catalog npm
Back to packageRELEASE DETAILS

0.58.3

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

Published17 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.58.3runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.58.3runtime
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-G7GbjdgTnEgF+yLK4+bBRJAB2Ra8czLulNowWsbWTwBgtBT+DvAXB9wPKtYOgvrwDQjvO2G+MyXbZjhjrK2qDQ==",
  "shasum": "389210e340c7d346f5695a425941930e6c93e937",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.58.3.tgz",
  "fileCount": 8,
  "unpackedSize": 135666,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIE4vX145FGytX5LJArMKs0JEgTkm92f1IVrkYdlRBJm2AiEAlGbVuRm//b0dKkXTDa/e57wDtV0hfC5c0c7ufWxkDD8="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirLxqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkaA//QdGZZ7wh2QQtuLSWCGjNENMx93pTYG1fX+5DqILTlf0+qT72\r\nxRXqlUIH7JfmLYbxjbVQCCLlxn/I0ay7QH1hCQA8d4ZfR3+kt1EGee14Luh8\r\nL01fsrBxNpFJPN/j5mY3IdWj1C/EToKcjGUXgKNGY8q58t2I2yzwj/jLL6Ys\r\nfEvZsm3IQU445oiVT7j0fKQG5tD9tXQigKHlz4U6PbLuisLzc4/cWbYdtp2Z\r\ntPPgw6+0QgqhjD10rEpZcbCLxOs4ilhj4qLMGrKjx6lKD/aGHG636YeTmjZi\r\n5Kkstu0ipKT8k8GMgGn+qgbNPrV1ZfWs3NyyT5DjJLsLOlm2Op+JxsQ7rqbT\r\nFHkpfYzVF0EBCENv2siHWmpEwymPwN+5DfdPRf2sf415/FFLZEV41MIcKCCd\r\nB7o7Fcw7MgbcV4nPsNFVOCXcQaF6e7wa/64F6MVqf+qqRpzHfIWmOB9vj6bY\r\nbCqhIYc7+cA221bceu5JGvT4tOHPjnAKg57v5ntMo1jKQsHeyDUzkQBNSzAJ\r\ng+jJuMPsjWd/4VrPk2rkrHrxWmh2bzXgqFjjo8x2anZRox/lTxsks2ZWbHST\r\n9W/bMlqzQFjk8bK+nyoUQF6rMJvC3dbzatIgrvFrc1a6d4jKATxkkCfR/BbS\r\n+e1IQJNNEY7FX5tPL7vUWkjOCDEtIQyTMtk=\r\n=J9JY\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:820ee3cfbe1fee09ea1bb958625fe8e8ce008cf032b3fb08408b1cefb6a74119

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 →