Catalog npm
Back to packageRELEASE DETAILS

0.123.0

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

Published8 Nov 2022
Direct dependencies10
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 15

Native requirements
10 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xflair/contracts-registry
Environment
{
  "local_name": "@0xflair/contracts-registry",
  "alias": false,
  "peer_metadata": null
}
^0.123.0runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.123.0runtime
@wagmi/core
Environment
{
  "local_name": "@wagmi/core",
  "alias": false,
  "peer_metadata": null
}
^0.2.5runtime
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": {
    "optional": true
  }
}
*peer
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
*peer
@wagmi/core
Environment
{
  "local_name": "@wagmi/core",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
*peer
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
*peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
^16 || ^17 || ^18peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
^16 || ^17 || ^18peer
react-query
Environment
{
  "local_name": "react-query",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
*peer
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
*peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-GiseMfWrFUsdE1cwb49MKWWuwTulyEJ4mXcTWaIEe3X8hhJNrJNZ2MHWYsOi48dLFHQq71xll0rIfH9op6dC5A==",
  "shasum": "e5f5e5369fdbe467a31982e6d917af4b3ba7c8ab",
  "tarball": "https://registry.npmjs.org/@0xflair/react-openzeppelin/-/react-openzeppelin-0.123.0.tgz",
  "fileCount": 8,
  "unpackedSize": 153410,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIBXQMYh/XS+QSV6FTbiLgQX4FN3aDG9XLvJvoqeTAlq/AiEAsunqzeUNnSxkBJ5AozUlTJUTBvo8BlkZD6vJ+PMM+lE="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjapO0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+Cw/9GBbyKJKGRWcJHY0nAQcQsF3p+7mPRRkBkJasjSneYTSyaCW3\r\n9hF32WzzATc9zIa+HjG1kppWq603TIp1bNYuhpZ1uD7KIjVP9LKCEHEInt99\r\nT7j7EWTgcUcVG5kZrxjfKXeBA4KHOMKUkEPH4QHdeXeC2IAep27LpSKWqE7T\r\nyZLFgNrszlG+5xHxOw4cti1PdjHe23Y4zkrAtxA1qsZ5lkQkiIl1JS7ilokS\r\nM0pUd+P+7wH95ZN+8hOtf9Ac51P5KQ/p8TXkeAzWh52S8fCA4yFV5vza4HxW\r\ny2ZrMy5G08xnQTDFhdD65v4KxFTNIJrFOXfuZ9Xj19J8WxmgPXTpLiqtZ7RS\r\nKtTfAwChhxG5Q2UDtGgQHzcT0+8JrZ6Cm7WBEYov9EplPuI6IbNncijGfSu9\r\nHQJmpiuvuhCA0q8YL0E+QyCe3CEaKtomYghwD1UkIkdpiOLi8bFmyn0PoDyT\r\nJR32tJYsoazfLRbM9tDN/IKazcTSJWgWmBqd4SAim6Ls1CpDbcifGCXy4KG7\r\nVNlMafg837EGSPO8EuWISVXAZQ2tvLgOavBbF+w0aUUQZth0dlNtSUSsEgGJ\r\nh73W3NaSYihOLDCnW9PrhPzI/aHG/sPEYdrarg8zqOzse1iLm1aPbk/vvSGO\r\nawILpzr/mNrxFyiYW+sQ/j1vIamqhjmjSxo=\r\n=wepJ\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:30 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:1072c5c9d16dfcf08f6c9dcfce770727f178afd9cf4f330e983db66d4b2c704b

Other collected versions

0.123.227 Nov0.123.112 Nov0.122.228 Oct0.122.128 Oct0.122.028 Oct0.121.227 OctView all collected versions →