UNPKG

@abstract-foundation/agw-client

Version:
20 lines 744 B
import { FeatureFlagRegistryAbi } from "./abis/FeatureFlagRegistryAbi.js"; import { FEATURE_FLAG_REGISTRY_ADDRESS } from "./constants.js"; export async function isFeatureFlagEnabled(client, account, featureFlag) { try { const enabled = await client.readContract({ address: FEATURE_FLAG_REGISTRY_ADDRESS, abi: FeatureFlagRegistryAbi, functionName: "isFeatureFlagEnabled", args: [featureFlag, account], }); return enabled; } catch (error) { // if flag status can not be determined, default to disabled to // ensure the flow is not blocked console.error(error); return false; } } //# sourceMappingURL=featureFlagRegistry.js.map