{"id":26473638,"url":"https://github.com/nazarkhatsko/nesthers","last_synced_at":"2026-04-07T21:31:11.434Z","repository":{"id":155353564,"uuid":"632614272","full_name":"nazarkhatsko/nesthers","owner":"nazarkhatsko","description":"Nesthers is a convenient integration of the ethers.js library for NestJS","archived":false,"fork":false,"pushed_at":"2023-12-17T19:55:51.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T11:59:27.773Z","etag":null,"topics":["backend","dapps","ethereum","ethersjs","lib","nestjs","nestjs-module","nodejs","npm-package","typescript","web3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nazarkhatsko.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}},"created_at":"2023-04-25T19:19:49.000Z","updated_at":"2024-01-08T20:40:03.000Z","dependencies_parsed_at":"2023-11-22T21:25:32.747Z","dependency_job_id":"7ea5f239-1c52-4887-8646-8872e7a74194","html_url":"https://github.com/nazarkhatsko/nesthers","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.17647058823529416","last_synced_commit":"e9eed576fa3766140515d8413a59ef13de9a2559"},"previous_names":["nazarkhatsko/nestethers","nazarkhatsko/nesthers"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nazarkhatsko/nesthers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazarkhatsko%2Fnesthers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazarkhatsko%2Fnesthers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazarkhatsko%2Fnesthers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazarkhatsko%2Fnesthers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazarkhatsko","download_url":"https://codeload.github.com/nazarkhatsko/nesthers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazarkhatsko%2Fnesthers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31530640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["backend","dapps","ethereum","ethersjs","lib","nestjs","nestjs-module","nodejs","npm-package","typescript","web3"],"created_at":"2025-03-19T22:11:35.711Z","updated_at":"2026-04-07T21:31:11.242Z","avatar_url":"https://github.com/nazarkhatsko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nesthers\n\n\n## Description\n\nThe Nesthers Module is a convenient integration of the [ethers.js](https://github.com/ethers-io/ethers.js) library into NestJS applications. This module aims to simplify the interaction with Ethereum blockchain features such as smart contracts, wallets, events, and more, providing a seamless and developer-friendly experience within the NestJS framework.\n\n\n## Installation\n\nInstall the module via npm:\n\n```sh\nnpm install nesthers\n```\n\nInstall the module via yarn:\n\n```sh\nyarn add nesthers\n```\n\n\n## Features\n- **Connection Configuration:** Configure the Ethereum provider to connect to your preferred network (e.g., mainnet, testnet).\n- **Wallet Management:** Manage Ethereum wallets effortlessly for secure transactions.\n- **Smart Contract Interaction:** Easily interact with Ethereum smart contracts using the provided service methods.\n- **Event Handling:** Streamline the handling of Ethereum events for real-time updates.\n- **Block Handling:** Streamline the handling of Ethereum blocks for real-time updates.\n\n\n## Usage\n1. Module initialization\n```ts\nimport { Module } from \"@nestjs/common\";\nimport { EthersModule, JsonRpcConnection } from \"nesthers\";\n\n@Module({\n  imports: [\n    EthersModule.forRoot({\n      connection: {\n        name: \"Connection\", // is option\n        instace: new JsonRpcConnection({\n          url: \"\u003cURL\u003e\",\n        }),\n        wallets: [], // is option\n        contracts: [], // is option\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n2. Inject Connection\n```ts\nimport { Injectable } from \"@nestjs/common\";\nimport { InjectConnection, JsonRpcConnection } from \"nesthers\";\n\n@Injectable()\nexport class AppService {\n  constructor(\n    @InjectConnection(\"Conection\") // name is option\n    private readonly connection: JsonRpcConnection,\n  ) {}\n}\n```\n3. WalletBuilder\n```ts\nimport { WalletBuilder, Wallet } from \"nesthers\";\n\n@WalletBuilder({\n  privateKey: \"0x0...\",\n})\nexport class AliceWallet extends Wallet {\n  // you can add your own functionality here\n}\n```\n4. InjectWallet\n```ts\nimport { Injectable } from \"@nestjs/common\";\nimport { InjectWallet } from \"nesthers\";\nimport { AliceWallet } from \"./wallets/alice.wallet\";\n\n@Injectable()\nexport class AppService {\n  constructor(\n    @InjectWallet(AliceWallet.name) // name is require\n    private readonly alice: AliceWallet,\n  ) {}\n}\n```\n5. ContractBuilder\n```ts\nimport { ContractBuilder, Contract } from \"nesthers\";\n\n@ContractBuilder({\n  address: \"0x0...\",\n  abi: [\n    {\n      \"constant\": true,\n      \"inputs\": [],\n      \"name\": \"name\",\n      ...\n    },\n    ...\n  ],\n})\nexport class TokenContract extends Contract {\n  // you can add your own functionality here\n}\n```\n6. InjectContract\n```ts\nimport { Injectable } from \"@nestjs/common\";\nimport { InjectContract } from \"nesthers\";\nimport { TokenContract } from \"./contracts/token.contract\";\n\n@Injectable()\nexport class AppService {\n  constructor(\n    @InjectContract(TokenContract.name) // name is require\n    private readonly token: TokenContract,\n  ) {}\n}\n```\n7. OnBlock\n```ts\nimport { Injectable } from \"@nestjs/common\";\nimport { OnBlock, Arg } from \"nesthers\";\n\n@Injectable()\nexport class AppService {\n  @OnBlock({})\n  newBlockHandler(@Arg(\"hash\") hash: string) {\n    console.log(hash);\n  }\n}\n```\n8. OnEvent\n```ts\nimport { Injectable } from \"@nestjs/common\";\nimport { OnEvent, Arg } from \"nesthers\";\n\n@Injectable()\nexport class AppService {\n  @OnEvent({\n    address: \"0x0...\",\n    topics: [ /* args */ ],\n  })\n  newEventHandler(@Arg(\"hash\") hash: string) {\n    console.log(hash);\n  }\n}\n```\n\n\n## License\n\nnesthers is [MIT licensed](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazarkhatsko%2Fnesthers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazarkhatsko%2Fnesthers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazarkhatsko%2Fnesthers/lists"}