Coder Social home page Coder Social logo

0xsooki / erc721-rarity-generator Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 4.0 121 KB

Generates rarity ranking based off a contract address, using Alchemy

License: MIT License

Shell 1.12% JavaScript 98.88%
alchemy erc721 erc721-tokens hacktoberfest hacktoberfest2022 web3

erc721-rarity-generator's People

Contributors

0xsooki avatar cimok2000 avatar fekete965 avatar miles170 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

erc721-rarity-generator's Issues

Calculate rarity from JSON file

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • This is a feature request only ๐Ÿ’ก
  • I am running the latest version
  • I checked the documentation
  • I checked to make sure that this feature has NOT already been requested

Why are you requesting this feature
It would be beneficial if the application could process local files:

  1. It would make the application more versatile, offline work would be supported
  2. Debugging calculations would be more straightforward (anybody could share their data and that data can be easily tested/processed by anybody to help find any issue)
  3. Testing the calculations would be finally possible (we can you mocked data)

Describe the solution you'd like
Additional menu where we could select a JSON data from within the application's folder for processing

Add pull request template

Expected Behavior

Have a pull request template so it makes contributing to this project easier

Current Behavior

Currently it does not have a pull request template

Detailed Description

Create a pull_request_template.md which includes the following text:

## Related Issues
<!-- 
Please use this format link issue numbers: Fixes #123
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword 
-->


## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] I have read the **CONTRIBUTING** document.
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

## Description

### Fixes # (issue)
(Required)Tag the issue number this PR is related to

<!-- Please do not leave this blank -->

## Screenshots/Recordings

<!--  screenshots  -->

## Added tests?

- [ ] Yes
- [ ] No, because they aren't needed

## Added to documentation?

- [ ] README
- [ ] Documentation
- [ ] No Documentation Needed

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules

Possible Implementation

  • Create a pull_request_template.md in the .github folder
  • Add the previously mentioned markdown text

Add CLI menu to the application

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • This is a feature request only ๐Ÿ’ก
  • I checked to make sure that this feature has NOT already been requested

Why are you requesting this feature
It would be nice if we could prompt the user with a few choices after connecting to the DB and setting up the base folder.
I was thinking of the following options:

  1. Generate rarity based on a contract (this would give us 2 more options)
  2. User default contract address
  3. Type contract address (this will let the user to type in a specific contract address)
  4. Set calculation method (this would give us 1 option for now, until we have the other algorithm ready)
  5. XYZ algorithm (Name TBC)
  6. Exit

Refactor codebase

Expected Behavior

Break down the src folders content into multiple files/folders to improve readability

Current Behavior

The current repo is not too understandable as everything is stored in 2-3 files

Detailed Description

Break the codebase down into smaller more understandable chunks & functions. Adding comments to document the functions are welcome as well

Insert all records in one go

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • This is a feature request only ๐Ÿ’ก
  • I checked to make sure that this feature has NOT already been requested

Why are you requesting this feature
At the moment when we save the data to the DB we do it one by one, which in my opinion is not very efficient.

Describe the solution you'd like
We should prepare all the records first, then use .insertMany to insert all the records into the DB in one go.

Add support for multiple rarity calculation methods

Expected Behaviour

Be able to select between multiple rarity calculation methods (see methods here)

Current Behaviour

As of now it only uses one method

Detailed Description

The users should be able to select between the different rarity calculation methods & generate the data based on the selected method

Possible Implementation

  • Create a rarity.js file
  • Create functions for the different methods
  • Implement these functions in the main.js file

Null trait values

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • This is bug in the application ๐Ÿ›
  • I am running the latest version
  • On develop branch

Describe the bug
When creating the data file, in the attributes section, the values belonging to trait_types always gets assigned a null value

To Reproduce \

  • Setup .env variables
  • Generate the data with npm run build
  • Check the output folder

Expected behavior \

The values of each trait should be present

Screenshots

193931960-84e7380c-2be8-4c86-83de-67de83b46227

Run addtional validation on NFTs before DB insertion

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • This is a feature request only ๐Ÿ’ก
  • I checked to make sure that this feature has NOT already been requested

Why are you requesting this feature
I think it would be worth running validation on each item before we send data to the DB.

Describe the solution you'd like
Validate the created model before populating the insertable data list.
If it passes the validation we add it to the list otherwise, we save the error in a separate list.
We will prompt the user about the occurred errors and present it to the user on demand.

Save data to database

Expected Behavior

Have the option to save the data in a database, preferably MongoDB but open to any other options

Current Behavior

Currently it only saves the data locally in a JSON file in the build folder

Detailed Description

Create the option to be able the save the generated data in a database. The file should be added to the database for later to be queried or used in applications

Possible Implementation

  • Check if the database exists locally or in the cloud
    • If it does connect to it & upload the generated data
    • Else create the database locally or in the cloud
      • Than upload the generated data

Loading indicator while the application is processing

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • This is a feature request only ๐Ÿ’ก
  • I checked to make sure that this feature has NOT already been requested

Is your feature request related to a problem? Please describe.
Without logging, we do not have any indication regarding the application's state.

Why are you requesting this feature
It would be nice to see a loader instead of all the currently processed data in the console.
We can also show the loader only in cases where we don't want logging.
The variable for logging could also come from the .env for easier handling.
I would also have some idea how we can make the CLI more user friendly.

Describe the solution you'd like
I can add a loading indicator while the application is processing NFT data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.