Catalog npm
Back to packageRELEASE DETAILS

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

Published3 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.51.4runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.51.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-QcAsx8Q4CSfCE9Dfg/3pLNbn1OFIZWjfuQt3aWyKWlsQI5Af1FJCwmx8hG3O5FU8goggK4t+82vNhTO03dcx1g==",
  "shasum": "7e507869962579bda762e6d09c4bcbbf1542a8e4",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.51.4.tgz",
  "fileCount": 8,
  "unpackedSize": 149701,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDeR2xTpCOGRmRrVF1a0YkCu7z0mbeWwsEDSkn2N4cleQIhALkP2HuopVlFClXq8pXGWXzXGzOUO2vr7/w3CHcead5e"
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimmw5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1gw//f/+vpk0TiqiDwMJgpYCPWovuUoY68j63Zn2bIfoPE5/HsrtT\r\nDXu7cjprysmEt0zijcQkBIL9hM+1Cvl2ZunsdZ4nD0CsN++P6FgWzeBJREah\r\ne07mz1vJCUYcvnFlUkZRHByD4e5+2Uwl+Q49ZhBhYlELvM/Kul6f84r3Lxce\r\n8FKo9qWKmxdofT38NwtolYdsz2COc1Xg3SEFE0pZdKwczcL5LNw7+ANarPz/\r\nSIXczDLJtPydGhm2QFDt2S2uIdYhNHqyxnyZK5m0Wvo2ytNZR5gxW+0PWVk+\r\nnbBmY0A+hR1Gx+NWwzqDCjmjAmdQwBVFdmDFJdA0sxytfchIOXeb+OOfPygK\r\nk/WaR26pPimxlFrAQyKQMsmK1EoCmDrrex/At2723faoDVliThQINzEMLV9U\r\npCjTmQnH/DG/sj4k1oHKmb9KoJIv3oGJdbrnUqPqu39Z0wRQqUGuuwUaJ7CE\r\nbEXWyO1gyQXWeNJEwKqi+jvFi2ZJ4Zh2AhmkcD775MUDAf0izbmW8v181/xV\r\n9i1KjzCklB3ty+vepv8nipHG4hrIncTKx+SWQygAWIP55eDn1/EYJIYuiMuF\r\n4QmeasvgdUprZmSXwywpA+ctyOgLULOavLdkTk57eJx3xQ/liLhJMI17QEZw\r\nforduBfjgZl8IAmQfCrDd6o2YAj+M73eHF4=\r\n=OUtc\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:5ac7efec45ca93b58945b7c5bf9ec0ab8af98e00be9a7c742cd3da5ad61932bc

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 →