Catalog npm
Back to packageRELEASE DETAILS

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

Published26 May 2022
Direct dependencies6
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 10

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xflair/contracts-registry
Environment
{
  "local_name": "@0xflair/contracts-registry",
  "alias": false,
  "peer_metadata": null
}
^0.48.4runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.48.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
@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
}
^17.0.2peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^17.0.2peer
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-dynFEMCei7xUgtETeqq88WezrIAZvsxCU1OR+/momKn2QMk24a2+W/umKAhcm2a7/gJlwx5yudfqWiCgozpzDA==",
  "shasum": "2b321ac410c8be03939da6a1e51b1445398e0d17",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.48.4.tgz",
  "fileCount": 8,
  "unpackedSize": 119346,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCSakfK/PzDGghklDFHsdkx+NXzGtdHsnFcrfCJ/xvV3wIhAKBBXGhgKYOj9dQ0WVy+OuZkdg0ImwzDVjpLiMlqitdU"
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJij9eKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpD7BAAiIFJnEdOaM4H+j7ZKzATf2CgZ4bj1R4e+YRfzZg879GEOhW+\r\nI8rrNhxfUc6KBvXAYH0Vw0hfqvNUmx/jsAxpYtQiHazo4EKpwgw8VqEhBR3v\r\nEUdqVDnkWUymC8nAIXMnELjraatXnDwHw4pP20I8YAG7QGgfPWitxF/TBAj7\r\n7HA4uKs3TW1UWgul/mUt4LmBcQqZnDqmJgWNqf5C0h5Ii+zHEaLGz9gX/DuN\r\nZL/nKm4LUC0L0bSWzj/bamTYarS9nBVqBmw7dUOg0o+Ew3E7O16XeUMHS+dc\r\nzjYJroDwgWzIiqZibjYh6SeFU3C2DFO8jeLha55r7a0+PUcE66/ZPjsbiNWZ\r\nEHH8avDPAd6a+sZqFhltRpczscld85G60kj28eLx2t/Xpx9JtOmaEySm22Me\r\n83YqmoCIsUbPbCUnLc9VXIa/cekV+PmjCRGdps9SrkAW4bagyZqEKNt958q3\r\nR+03PKpBOGNjoHXnvGCK9KQ9H1qh/JHbU7WP/l3y6Oy+Aj5Q9XWu8f7aOk2Y\r\nPXvWsd4ifc3QijBjx65fny7SJito3R9O1Cdvds0G3Rj9T0cHB7CV1ZdeRWIj\r\nLFlb8F703nF9VOSq13iQ8R7O/F8f8MnKHuP+rBi+3a3ycW0qkgB3Tx9vFCTS\r\n0iWoiFVcqqebl71hB8ajDfsLdL5aHUwG6jI=\r\n=EfqC\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:e337d5d97283c310838e16d6aa4ef93df56fc375539d09d998581cb5553429bb

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 →