{"id":18291815,"url":"https://github.com/prantadas/mint-an-nft","last_synced_at":"2025-04-09T07:52:27.136Z","repository":{"id":209189016,"uuid":"626495436","full_name":"PrantaDas/mint-an-nft","owner":"PrantaDas","description":"The project showcases how to use the Web3 library to interact with an Ethereum smart contract. It includes sample code to connect to a local Ethereum blockchain, subscribe to pending transactions, fetch the creator's address of a smart contract, and listen to the 'Transfer' event and buy the desired Token before the targeted wallet","archived":false,"fork":false,"pushed_at":"2023-11-25T17:43:31.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T02:16:42.038Z","etag":null,"topics":["ethereum","nft","web3js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrantaDas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11T15:23:46.000Z","updated_at":"2024-08-25T07:21:16.000Z","dependencies_parsed_at":"2023-11-25T17:52:45.894Z","dependency_job_id":null,"html_url":"https://github.com/PrantaDas/mint-an-nft","commit_stats":null,"previous_names":["prantadas/mint-an-nft"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Fmint-an-nft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Fmint-an-nft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Fmint-an-nft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrantaDas%2Fmint-an-nft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrantaDas","download_url":"https://codeload.github.com/PrantaDas/mint-an-nft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999850,"owners_count":21031044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ethereum","nft","web3js"],"created_at":"2024-11-05T14:15:17.509Z","updated_at":"2025-04-09T07:52:27.084Z","avatar_url":"https://github.com/PrantaDas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web3 Ethereum Smart Contract Interaction\n\nThis project demonstrates interaction with an Ethereum smart contract using the Web3 library and Node.js. It includes functionalities to connect to a local Ethereum blockchain, subscribe to pending transactions, fetch the creator's address of a smart contract, and listen to the 'Transfer' event.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Functions](#functions)\n- [Examples](#examples)\n- [Contributing](#contributing)\n\n\n## Introduction\n\nThe project showcases how to use the Web3 library to interact with an Ethereum smart contract. It includes sample code to connect to a local Ethereum blockchain, subscribe to pending transactions, fetch the creator's address of a smart contract, and listen to the 'Transfer' event and buy the desired `Token` before the targeted `wallet`\n\n## Prerequisites\n\nBefore using this project, ensure you have the following prerequisites installed:\n\n- Node.js: [Download Node.js](https://nodejs.org/)\n\n## Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone  https://github.com/PrantaDas/mint-an-nft.git\n    ```\n\n2. Change to the project directory:\n\n    ```bash\n    cd mint-an-nft\n    ```\n\n3. Install dependencies:\n\n    ```bash\n    npm install or yarn\n    ```\n\n## Usage\n\n1. Set up your Ethereum blockchain (e.g., Ganache) and update the WebSocket provider address in the `web3` initialization:\n\n    ```javascript\n    const web3 = new Web3('ws://your-ethereum-node-ip:7545');\n    ```\n\n2. Specify the contract address and ABI in the `abi.json` file and update the `.env` file with the contract address and default wallet address.\n\n3. Customize the `wallet` variable with the desired wallet address.\n\n4. Run the script:\n\n    ```bash\n    node index.js\n    ```\n\n## Functions\n\n- `getContractCreatorAddress()`: Fetch the creator's address of the smart contract.\n- Subscription to pending transactions.\n- Logging transaction data and executing the mint function if the transaction is from a specified wallet.\n- Subscription to the 'Transfer' event of the smart contract.\n\n## Examples\n\nCheck the `examples` directory for usage examples and sample scripts.\n\n## Contributing\n\nFeel free to contribute to the project by opening issues or submitting pull requests. Please adhere to the [Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-community-code-of-conduct).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantadas%2Fmint-an-nft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantadas%2Fmint-an-nft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantadas%2Fmint-an-nft/lists"}