open-rarity icon indicating copy to clipboard operation
open-rarity copied to clipboard

Replicate the product on Javascript

Open richawo opened this issue 2 years ago • 23 comments

It's been amazing to use so far on Python. That said, is it possible to recreate it on JS too?

It would also be great if we could still use NPM / Yarn to handle the packages similarly to pip.

Thanks

richawo avatar Sep 15 '22 22:09 richawo

is it possible to recreate it on JS too? -> Great idea @RichardAwoyemi. On JS native support , we have something in work that will help you - stay tuned! I will update the ticket once it's available.

it would also be great if we could still use NPM / Yarn to handle the packages similarly to pip. -> you mean add support like it's described here https://classic.yarnpkg.com/en/package/python.node?

impreso avatar Sep 15 '22 23:09 impreso

A TypeScript release would be amazing. I intend to use this on Rareboy.com

samstr avatar Sep 18 '22 12:09 samstr

subscribe

is it possible to recreate it on JS too? -> Great idea @RichardAwoyemi. On JS native support , we have something in work that will help you - stay tuned! I will update the ticket once it's available.

it would also be great if we could still use NPM / Yarn to handle the packages similarly to pip. -> you mean add support like it's described here https://classic.yarnpkg.com/en/package/python.node?

Awesome any ETA on JS version?

emorling avatar Sep 19 '22 16:09 emorling

While we are researching Node/JS support, will cloud endpoint API suffice your needs @emorling @samstr @RichardAwoyemi ?

impreso avatar Sep 19 '22 17:09 impreso

While we are researching Node/JS support, will cloud endpoint API suffice your needs @emorling @samstr @RichardAwoyemi ?

Yes, but it depends on the rate limit. Will we be sending in all the metadata for a single collection in one request?

emorling avatar Sep 19 '22 19:09 emorling

@emorling no metadata needed for this particular endpoint

impreso avatar Sep 20 '22 22:09 impreso

I had assumed the logic would be client side, rather than an API endpoint. It would be nice to prepare metadata as a local object/json and simply run it through a function to generate scores. Some projects I plan to generate with haven't minted yet, and I assume the endpoint would just take a contractAddress and give the openrarity from an already minted collection?

samstr avatar Sep 20 '22 22:09 samstr

@samstr great idea!

API endpoint was developed for simplicity of the data access and is complementary to the open-source library.

For not minted contracts you could just pipe collection data from metadata into OpenRarity models, you don't need to read from blockchain to construct the data. Check out these developer docs on how we do it in Python: https://openrarity.gitbook.io/developers/quick-guides/integrating-openrarity-in-your-application.

If you have the bandwidth to build this tool, we will be glad to figure out how to land the PR.

impreso avatar Sep 20 '22 22:09 impreso

i'd be happy to jump in and contribute to the js version as well if needed.

and yes @impreso, an API endpoint would be a good start, and then eventually moving into standalone npm would be a great.

jeevanpillay0000 avatar Sep 21 '22 12:09 jeevanpillay0000

Hi all, that was a fun week for the OpenRarity team here, thanks for all the support and love from the community. We are carefully listening for all feedback that ya'll give and actively working on our next release.

Here is promised update with the OpenSea API that provides rarity data right now on the Assets API endpoint . We are still figuring out how to support other languages than python, but this should give you a straight integration point for TS.

One idea we had is to ship an OpenRarity docker image with an exposed REST endpoint to support all languages out there. Thoughts on this technical direction?

impreso avatar Sep 24 '22 06:09 impreso

Hey @impreso, I’m impressed by your progress and devotion to this topic. I think a Docker Image would be great, and Iook forward to exploring the endpoints

emorling avatar Sep 24 '22 06:09 emorling

Hi all, that was a fun week for the OpenRarity team here, thanks for all the support and love from the community. We are carefully listening for all feedback that ya'll give and actively working on our next release.

Here is promised update with the OpenSea API that provides rarity data right now on the Assets API endpoint . We are still figuring out how to support other languages than python, but this should give you a straight integration point for TS.

One idea we had is to ship an OpenRarity docker image with an exposed REST endpoint to support all languages out there. Thoughts on this technical direction?

Sorry I've been slow to respond in this thread but your efforts have been amazing @impreso! Wouldn't we need an OS API key to get the current Asset modal via the current endpoints?

The exposed docker endpoint would be a massive help. That way we could interact with it directly via js, or any other language.

richawo avatar Sep 24 '22 07:09 richawo

If you offered a CLI rather than an SDK for each language that would be the best IMO.

gregorym avatar Sep 24 '22 16:09 gregorym

If you offered a CLI rather than an SDK for each language that would be the best IMO.

That would not suffice for my use cases, when providing Rarity in a web site or chrome extension.

emorling avatar Sep 25 '22 13:09 emorling

If you offered a CLI rather than an SDK for each language that would be the best IMO.

That would not suffice for my use cases, when providing Rarity in a web site or chrome extension.

Ok but that's not everyone's use case. If you have a website, you can run the cli server side and expose it on your website. Same with a chrome extension.

gregorym avatar Sep 25 '22 15:09 gregorym

https://github.com/kongnet/openrarity

openRerity core algorithm JS implementation

100k tokens benchmark test

/* gen Collection items: 100,000 Rarity calc time: 651 ms -- Mac M2

{ v: 1.010524265698629, toeknId: 53076, rank: 1 }, { v: 1.009992300140172, toeknId: 10548, rank: 2 }, '.....', { v: 0.9894947869513546, toeknId: 44396, rank: 100000 } */

kongnet avatar Sep 26 '22 05:09 kongnet

@gregorym When you say CLI , what do you mean? CLI +Docker container that is running locally or some other architecture in mind?

impreso avatar Sep 27 '22 17:09 impreso

Is this still on the roadmap? Would love to implement in a web app

HIT2022 avatar Oct 19 '22 20:10 HIT2022

Yes , absolutely. The team is heads down implementing the TS version of the OpenRarity library. @dadashi to comment on this

impreso avatar Oct 20 '22 19:10 impreso

@HIT2022 yes we're actively working on this. Can you speak more to how you plan on using it in your web app? Are you planning to use it in the browser or backend?

dadashi avatar Oct 21 '22 00:10 dadashi

+1

Absolutely looking for this and eagerly waiting for a first party implementation (to avoid deviations).

Target use case is both for using in browser as well as in ts scripts to generate rarity of unreleased collections.

Edit: Happy to beta test a version or provide feedback on API implementation if necessary!

akshatmittal avatar Oct 27 '22 15:10 akshatmittal

Any updates on the JS version?

danielmedvec avatar Nov 10 '22 04:11 danielmedvec

👀 gm gm

vikiival avatar Jul 31 '24 11:07 vikiival