{"id":50157916,"url":"https://github.com/hashgraph/hedera-hardhat-hethers","last_synced_at":"2026-05-24T13:30:51.841Z","repository":{"id":55048187,"uuid":"481256865","full_name":"hashgraph/hedera-hardhat-hethers","owner":"hashgraph","description":"DEPRECATED Hardhat plugin for integration with hethers.js.","archived":false,"fork":false,"pushed_at":"2025-05-31T00:14:58.000Z","size":1083,"stargazers_count":7,"open_issues_count":7,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-06T17:55:45.370Z","etag":null,"topics":["deprecated","deprecated-repo","deprecated-repository","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashgraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-13T14:47:01.000Z","updated_at":"2025-05-29T15:49:21.000Z","dependencies_parsed_at":"2025-05-29T16:48:36.826Z","dependency_job_id":null,"html_url":"https://github.com/hashgraph/hedera-hardhat-hethers","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hashgraph/hedera-hardhat-hethers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fhedera-hardhat-hethers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fhedera-hardhat-hethers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fhedera-hardhat-hethers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fhedera-hardhat-hethers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashgraph","download_url":"https://codeload.github.com/hashgraph/hedera-hardhat-hethers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fhedera-hardhat-hethers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33436554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T13:13:05.286Z","status":"ssl_error","status_checked_at":"2026-05-24T13:13:03.728Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deprecated","deprecated-repo","deprecated-repository","hacktoberfest"],"created_at":"2026-05-24T13:30:51.038Z","updated_at":"2026-05-24T13:30:51.836Z","avatar_url":"https://github.com/hashgraph.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⛔️ DEPRECATED\n\nDeprecation of Hethers.js by October 20, 2023\\\nAs we continue to evolve the Hedera ecosystem, we are committed to ensuring that our developer tools and resources remain easy to use and up-to-date. With this goal in mind, the Hethers.js library will be deprecated by October 20, 2023\nIf you are currently using or planned to use Hethers in your projects, please consider instead [ethers.js](https://docs.ethers.org/v6/) or [web3js](https://web3js.org/) in combination with [hedera-json-rpc-relay](https://github.com/hashgraph/hedera-json-rpc-relay) before the deprecation date. For ED25519 focused scenarios the [hedera-sdk-js](https://github.com/hashgraph/hedera-sdk-js) may be utilized\n\n---\n[![No Maintenance Intended](https://unmaintained.tech/badge.svg)]()\n[![npm](https://img.shields.io/npm/v/@hashgraph/hardhat-hethers.svg)](https://www.npmjs.com/package/@hashgraph/hardhat-hethers) [![hardhat](https://hardhat.org/buidler-plugin-badge.svg?1)](https://hardhat.org)[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n# @hashgraph/hardhat-hethers\n\n[Hardhat](https://hardhat.org) plugin for integration with [hethers.js](https://github.com/hashgraph/hethers.js).\n\n## What\n\nThis plugin brings to Hardhat the Hedera library `hethers.js`, which allows you to interact with the Hedera hashgraph in a simple way.\n\n## Installation\n\n```bash\nnpm install --save-dev '@hashgraph/hardhat-hethers'\n```\n\nAnd add the following statement to your `hardhat.config.js`:\n\n```js\nrequire(\"@hashgraph/hardhat-hethers\");\n```\n\nOr if you're using `Typescript`:\n\n```typescript\nimport \"@hashgraph/hardhat-hethers\";\n```\n\n## Configuration\n\nThis plugin extends the `HardhatConfig` object with `hedera` and updates the type of the `networks` field.\n\nHere is an example network configuration in `hardhat.config.js`:\n\n```js\nmodule.exports = {\n  defaultNetwork: 'testnet',  // The selected default network. It has to match the name of one of the configured networks.\n  hedera: {\n    gasLimit: 300000, // Default gas limit. It is added to every contract transaction, but can be overwritten if required.\n    networks: {\n      testnet: {      // The name of the network, e.g. mainnet, testnet, previewnet, customNetwork\n        accounts: [   // An array of predefined Externally Owned Accounts\n          {\n            \"account\": '0.0.123',\n            \"privateKey\": '0x...'\n          },\n          ...\n        ]\n      },\n      previewnet: {\n        accounts: [\n          {\n            \"account\": '0.0.123',\n            \"privateKey\": '0x...'\n          },\n          ...\n        ]\n      },\n      \n      // Custom networks require additional configuration - for conesensusNodes and mirrorNodeUrl\n      // The following is an integration example for the local-hedera package\n      customNetwork: {\n        consensusNodes: [\n          {\n            url: '127.0.0.1:50211',\n            nodeId: '0.0.3'\n          }\n        ],\n        mirrorNodeUrl: 'http://127.0.0.1:5551',\n        chainId: 0,\n        accounts: [\n          {\n            'account': '0.0.1002',\n            'privateKey': '0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6'\n          },\n          {\n            'account': '0.0.1003',\n            'privateKey': '0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628'\n          },\n        ]\n      },\n      ...\n    }\n  }\n};\n```\n\nThe following networks have their respective settings pre-defined. You will only need to specify the accounts when using `testnet`, `mainnet`, `previewnet` or `local`. For any other networks the full configuration needs to be provided, as in the `customNetwork` example above.\n\nRead more about Externally Owned Accounts [here](https://docs.hedera.com/hethers/application-programming-interface/signers#externallyownedaccount).\n\n\n## Tasks\n\nThis plugin creates no additional tasks.\n\n## Environment extensions\n\nThis plugin adds a `hethers` object to the Hardhat Runtime Environment.\n\nThis object has the [same API](https://docs.hedera.com/hethers/) as `hethers.js`, with some extra Hardhat-specific functionality.\n\n### Provider object\n\nA `provider` field is added to `hethers`, which is an [`hethers.providers.BaseProvider`](https://docs.hedera.com/hethers/application-programming-interface/providers/provider/base-provider) automatically connected to the selected network.\n\n### Helpers\n\nThese helpers are added to the `hethers` object:\n\n#### Interfaces\n```typescript\ninterface Libraries {\n  [libraryName: string]: string;\n}\n\ninterface FactoryOptions {\n  signer?: hethers.Signer;\n  libraries?: Libraries;\n}\n\ninterface HederaAccount {\n    account?: string;\n    address?: string;\n    alias?: string;\n    privateKey: string;\n}\n\ninterface HederaNodeConfig {\n    url: string;\n    nodeId: string;\n}\n\ninterface HederaNetwork {\n    accounts: Array\u003cHederaAccount\u003e;\n    nodeId?: string;\n    consensusNodes?: Array\u003cHederaNodeConfig\u003e;\n    mirrorNodeUrl?: string;\n    chainId?: number;\n}\n\ninterface HederaNetworks {\n    [name: string]: HederaNetwork\n}\n\ninterface HederaConfig {\n    gasLimit: number;\n    networks: HederaNetworks;\n}\n\n```\n\n#### Functions\n- `function getSigners() =\u003e Promise\u003chethers.Signer[]\u003e;`\n```typescript\nconst signers = await hre.hethers.getSingers();\n```\n\n- `function getSigner(identifier: any) =\u003e Promise\u003chethers.Signer\u003e;`\n```typescript\nconst signer = await hre.hethers.getSigner({\n    \"account\": \"0.0.123\",\n    \"privateKey\": \"0x...\"\n});\n```\n\n- `function getContractFactory(name: string, signer?: hethers.Signer): Promise\u003chethers.ContractFactory\u003e;`\n```typescript\nconst contractFactoryWithDefaultSigner = await hre.hethers.getContractFactory('Greeter');\nconst signer = (await hre.getSigners())[1];\n\nconst contractFactoryWithCustomSigner = await hre.hethers.getContractFactory('Greeter', signer);\n```\n\n- `function getContractFactory(name: string, factoryOptions: FactoryOptions): Promise\u003chethers.ContractFactory\u003e;`\n```typescript\nconst libraryFactory = await hre.hethers.getContractFactory(\"contracts/TestContractLib.sol:TestLibrary\");\nconst library = await libraryFactory.deploy();\n\nconst contract = await hre.hethers.getContractFactory(\"Greeter\", {\n    libraries: {\n        \"contracts/Greeter.sol:TestLibrary\": library.address\n    }\n});\n```\n\n- `function getContractFactory(abi: any[], bytecode: hethers.utils.BytesLike, signer?: hethers.Signer): Promise\u003chethers.ContractFactory\u003e;`\n```typescript\nconst greeterArtifact = await hre.artifacts.readArtifact(\"Greeter\");\n\nconst contract = await hre.hethers.getContractFactory(greeterArtifact.abi, greeterArtifact.bytecode);\n```\n\n- `function getContractAt(name: string, address: string, signer?: hethers.Signer): Promise\u003chethers.Contract\u003e;`\n```typescript\nconst Greeter = await hre.hethers.getContractFactory(\"Greeter\");\nconst deployedGreeter = await Greeter.deploy();\n\nconst contract = await hre.hethers.getContractAt(\"Greeter\", deployedGreeter.address);\n```\n\n- `function getContractAt(abi: any[], address: string, signer?: hethers.Signer): Promise\u003chethers.Contract\u003e;`\n```typescript\nconst greeterArtifact = await hre.artifacts.readArtifact(\"Greeter\");\n\nconst contract = await hre.hethers.getContractAt(greeterArtifact.abi, deployedGreeter.address);\n```\n\n- `function getContractFactoryFromArtifact(artifact: Artifact, signer?: hethers.Signer): Promise\u003cethers.ContractFactory\u003e;`\n```typescript\nconst greeterArtifact = await hre.artifacts.readArtifact(\"Greeter\");\n\nconst contractFactoryFromArtifact = await hre.hethers.getContractFactoryFromArtifact(greeterArtifact);\n```\n\n- `function getContractFactoryFromArtifact(artifact: Artifact, factoryOptions: FactoryOptions): Promise\u003chethers.ContractFactory\u003e;`\n```typescript\nconst greeterArtifact = await hre.artifacts.readArtifact(\"Greeter\");\nconst libraryFactory = await hre.hethers.getContractFactory(\n    \"contracts/TestContractLib.sol:TestLibrary\"\n);\nconst library = await libraryFactory.deploy();\n\nconst contract = await hre.hethers.getContractFactory(greeterArtifact, {\n    libraries: {\n        \"contracts/TestContractLib.sol:TestLibrary\": library.address\n    }\n});\n```\n\n- `function getContractAtFromArtifact(artifact: Artifact, address: string, signer?: hethers.Signer): Promise\u003chethers.Contract\u003e;`\n```typescript\nconst Greeter = await hre.hethers.getContractFactory(\"Greeter\");\nconst deployedGreeter = await Greeter.deploy();\nconst greeterArtifact = await hre.artifacts.readArtifact(\"Greeter\");\n\nconst contract = await hre.getContractAtFromArtifact(greeterArtifact, deployedGreeter.address);\n```\n\nThe [`Contract's`](https://docs.hedera.com/hethers/application-programming-interface/contract-interaction/contract) and [`ContractFactory's`](https://docs.hedera.com/hethers/application-programming-interface/contract-interaction/contractfactory) returned by these helpers are connected to the first [signer](https://docs.hedera.com/hethers/application-programming-interface/signers#wallet) returned by `getSigners` by default.\n\n## Usage\n\nThere are no additional steps you need to take for this plugin to work.\n\nInstall it and access hethers through the Hardhat Runtime Environment anywhere you need it (tasks, scripts, tests, etc). For example, in your `hardhat.config.js`:\n\n```typescript\nrequire(\"@hashgraph/hardhat-hethers\");\n\n// task action function receives the Hardhat Runtime Environment as second argument\ntask('getBalance', 'Prints the the balance of \"0.0.29631749\"', async (_, {hethers}) =\u003e {\n    const balance = (await hethers.provider.getBalance('0.0.29631749')).toString();\n    console.log(`Balance of \"0.0.29631749\": ${balance} tinybars`);\n});\n\nmodule.exports = {};\n```\n\nAnd then run `npx hardhat getBalance` to try it.\n\nRead the documentation on the [Hardhat Runtime Environment](https://hardhat.org/advanced/hardhat-runtime-environment.html) to learn how to access the HRE in different ways to use hethers.js from anywhere the HRE is accessible.\n\n### Library linking\n\nSome contracts need to be linked with libraries before they are deployed. You can pass the addresses of their libraries to the `getContractFactory` function with an object like this:\n\n```typescript\nconst contractFactory = await this.env.hethers.getContractFactory(\"Example\", {\n    libraries: {\n        ExampleLib: \"0x...\",\n    },\n});\n```\n\nThis allows you to create a contract factory for the `Example` contract and link its `ExampleLib` library references to the address `\"0x...\"`.\n\nTo create a contract factory, all libraries must be linked. An error will be thrown informing you of any missing library.\n\n## Troubleshooting\n\n### Events are not being emitted\n\nHethers.js polls the network to check if some event was emitted (except when a `WebSocketProvider` is used; see below). This polling is done every 4 seconds. If you have a script or test that is not emitting an event, it's likely that the execution is finishing before the event is detected by the polling mechanism.\n\nIf you are connecting to a Hardhat node using a `WebSocketProvider`, events should be emitted immediately. But keep in mind that you'll have to create this provider manually, since Hardhat only supports configuring networks via http. That is, you can't add a `localhost` network with a URL like `ws://localhost:8545`.\n\n## Contributing\n\nContributions are welcome. Please see the\n[contributing guide](https://github.com/hashgraph/.github/blob/main/CONTRIBUTING.md)\nto see how you can get involved.\n\n## Code of Conduct\n\nThis project is governed by the\n[Contributor Covenant Code of Conduct](https://github.com/hashgraph/.github/blob/main/CODE_OF_CONDUCT.md). By\nparticipating, you are expected to uphold this code of conduct. Please report unacceptable behavior\nto [oss@hedera.com](mailto:oss@hedera.com).\n\n## License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashgraph%2Fhedera-hardhat-hethers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashgraph%2Fhedera-hardhat-hethers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashgraph%2Fhedera-hardhat-hethers/lists"}