Catalog npm
Back to packageRELEASE DETAILS

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

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.59.4runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.59.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-6ZIBEcg5GNIfXBV77aO4+FmjJC//DD4wRjOFdDdOs7lxQAlBLXQRYCTvh80+SMA8R09bKHLW/RO+3oih6Hg8MQ==",
  "shasum": "bbc132273e9a37ac4aa5e6eec553b7b808238cc9",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.59.4.tgz",
  "fileCount": 8,
  "unpackedSize": 135666,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQDuUpOjTY3KiM8HtDRnzU4lL903v2XscMJYNqlbLQVmbAIgUtdO5bpSjlJL2jEpHyUQHQU68AXEfiNe4GxONMsKfYU="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirNQ/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUBw/6A3oLVPszhYvk10g08fabs8mkrQCUkjI8jpuUdDPvAUiQoj0F\r\nA7lkqsOwvExbmfhmFjWq6nKOiePoWWOcQIDroM8fHc6VeVojN9NGs8XcyMIn\r\nWZobLYmFKyLqk+8SGF4OQ0nl1fhu/QOTcgKMmJpM9k49PJdcT606XHCYZH7y\r\n8MLTU5dDmZ/dn8Aee7m8M20BU4Mgps9M5AYkLL8+WX7NIsGR7ZjYNxwdRHS4\r\nHQB2mTfMDobZvqBeE2vFXfwDZIrW2N5TmV4qEaNwxAqi+01Vj/AsN+ttcttG\r\nPtfUq+72kdpmPpvE5qOdND8Bf63NOEcLN5wz+a1+w91jk3blhl93IEmdXNol\r\nf62lG44mBpfkvFOqm8GF8GOto0zrjOL0EUBJLQoO2xWlAlKiDr5CdMeTU9RI\r\nC+aggeZl4uuLSKwqv9AQ/ayEUiTyjmQat8LIUbYdG/9mad9rmY03OJZXOMJ8\r\nKQAoaEPP6s2Wqz+7RxMhvyna/fCHdVQvd2rfvseRa8tCdVbW8dSZkXCFmPV6\r\ndWTJy3A1tzLzNdu3wuzc2DjX34H3CknzyBaMfr66PDkJ+mt1ALO9gCSemBSE\r\na2ZQWlbxVZR08bYF5wRviZ/3kY/a0sM8cjN5Zyc9NUCheWRI+y3R1YvF4tIj\r\n5WYS+/448aYiYtcJn7kC203KgYAjPd1QzWg=\r\n=Xrh+\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:7347ccd077f3c24fb2fa3a8fccfef5d9170e024b48d20049bbd6d0fc7a33dac2

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 →