import type { GraphAccounts } from '@graphprotocol/toolshed' import type { GraphDeploymentName, GraphDeployments } from '@graphprotocol/toolshed/deployments' import { GraphDeploymentsList } from '@graphprotocol/toolshed/deployments' import type { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider' import type { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' export type GraphDeploymentOptions = { [deployment in GraphDeploymentName]?: string } export type GraphRuntimeEnvironmentOptions = { deployments?: GraphDeploymentOptions createAddressBook?: boolean } export type GraphRuntimeEnvironment = GraphDeployments & { provider: HardhatEthersProvider chainId: number accounts: { getAccounts: () => Promise getDeployer: (accountIndex?: number) => Promise getGovernor: (accountIndex?: number) => Promise getArbitrator: (accountIndex?: number) => Promise getPauseGuardian: (accountIndex?: number) => Promise getSubgraphAvailabilityOracle: (accountIndex?: number) => Promise getGateway: (accountIndex?: number) => Promise getTestAccounts: () => Promise } } export function isGraphDeployment(deployment: unknown): deployment is GraphDeploymentName { return typeof deployment === 'string' && GraphDeploymentsList.includes(deployment as GraphDeploymentName) }