BuildHardhatErrorFunction: ((message: string, parent?: Error) => Error)

Type for hardhat error function callback

we use this callback to delegate the hardhat import to the final code who will use provider