Catalog npm
Back to packageRELEASE DETAILS

0.65.1

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

Published28 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.65.1runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.65.1runtime
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-24tcLDvTrW1r7yjbzwO0JpvD0qK3Fo4JRZuwSw7k6J6y4nXxFZm1IO4jPQHgaF1aE7p2X1P+NVqlolaQxItEtQ==",
  "shasum": "78e34953012dca55683b7e44cdf2a53cfa0a9e2c",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.65.1.tgz",
  "fileCount": 8,
  "unpackedSize": 136145,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDUzxmMYD6/J3+Cco9ea0AZ8cmgJ+Pz+mF9OeT3cJvqnQIhAPQFwuCWN0ZZuqFpoiI7l4ZQbVAHJUlCGEs3K4+wYfVk"
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuyiZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHww/+NXwo7kuO+E0TKLdztTCaJKeuxzr3qpJSFZXKW7Iu7cGXT1uy\r\n4+lmCi/U9Kquvfsf6x5FsydnrfheMAaXbLAn84CxOoxuaDYb03w6QPGLKdDL\r\nefS/+5Rfu30Ep/IGlEBe6ldx/L/Nr/nY6Qp4LbDLH5I4zK6F0Ls+tQJYI4yn\r\nsx70D/c7aLZ6c++N2ItbG2ZzxbcQs+5crw/Q+axbK9NceA6zPs9tbU1CFi4K\r\nmrJlpzzoIiJudO2S0Mi0UJrf0ScT421Fc/TxNiEfBSlOGqGVMl2OE77NzXbP\r\nNxeYwjFt7CLDnfcq7/MrRQ2qY77/f5x8H6acWGMbDCJ0NZ9pYdYclUag+u2t\r\nmhb/FT0bnhDJAl0jpLCdc6Iithe6/e6a/JctWzfmxi3OfN2lz2w/syirMF/B\r\n2MNykH8AyEV2zByr+sKlc8IoxbCqs9iwuGlufy5UQERvvyHsDPSqNtT/xLKp\r\nx2mztRkvwrjAcNROT8bNfBeSeiYlAMb2vUvLgsSCmYmJxRen8hGAr0D1yGZj\r\najrW1BhrNLa1FCljuVa5ckTiA69I5sh1Npfsz9qzNnv8EHLLSiOyCc9LIfBL\r\nlkP47ot2GZfot9Tz9PcceCEu1noef2uUhrA/TKJ3ewj81rkYD52RzUCFac5m\r\nfKndG2G0CGNn7mez/xERHA+39r6JvQiVFzw=\r\n=gXbh\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:4004bf393374b554e869c25353239a7d9c86148f108deb80e003ffcae692300a

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 →