UNPKG

@citizenwallet/sdk

Version:

An sdk to easily work with citizen wallet.

20 lines 1.1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PROFILE_ADMIN_ROLE = exports.MINTER_ROLE = void 0; exports.isFunctionInABI = isFunctionInABI; exports.hasRole = hasRole; const ethers_1 = require("ethers"); const IAccessControlUpgradeable_abi_json_1 = __importDefault(require("../abi/IAccessControlUpgradeable.abi.json")); exports.MINTER_ROLE = "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6"; exports.PROFILE_ADMIN_ROLE = "0x224b562a599bb6f57441f98a50de513dff0de3d9b620f342c27a4e4a898ce8e2"; function isFunctionInABI(func, abi) { return abi.some((item) => item.type === "function" && item.name === func); } async function hasRole(tokenAddress, role, account, provider) { const tokenContract = new ethers_1.ethers.Contract(tokenAddress, IAccessControlUpgradeable_abi_json_1.default, provider); return await tokenContract.getFunction("hasRole")(role, account); } //# sourceMappingURL=crypto.js.map