Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web3 for Deno RTE --> web3.ts #3700

Closed
michael-spengler opened this issue Aug 24, 2020 · 19 comments
Closed

Web3 for Deno RTE --> web3.ts #3700

michael-spengler opened this issue Aug 24, 2020 · 19 comments
Labels
Discussion Feature Request Stale Has not received enough activity

Comments

@michael-spengler
Copy link

I'd like to use web3 in a https://deno.land/ project. Are there any good recommendations out there yet? :)

The concrete question is:
How can I connect to the Ethereum Network from an https://deno.land/ project?

@michael-spengler michael-spengler changed the title Web 3 for Deno RTE Web3 for Deno RTE --> web3.ts Aug 25, 2020
@michael-spengler
Copy link
Author

I drafted https://deno.land/x/web3 plus the corresponding repo web3.ts - If you like it we can of course move the repo into the ethereum org.

@GregTheGreek
Copy link
Contributor

@michael-spengler cool!

Just a little FYI, we've converted all our configs and compilers etc... to TypeScript 🎊 we're slowly navigating our way through a full migration so we don't can have native deceleration files instead of the current broken ones.

@GregTheGreek
Copy link
Contributor

GregTheGreek commented Aug 28, 2020

To answer your question:

I haven't used Deno much more then when I saw the demo a few years back at websummit(?). We currently don't have the bandwidth to explore this, but if it's something you want we can provide some assistance.

@michael-spengler
Copy link
Author

Hi Greg The Greek :) Thank you for your response.

I'll explore some options potentially leveraging
https://medium.com/samsung-internet-dev/using-node-modules-in-deno-2885600ed7a9 resp. https://jspm.org/ and
https://stackoverflow.com/questions/61821038/how-to-use-npm-module-in-deno

If some funding via https://gitcoin.co/ would be beneficial from your perspective let me know. In this case feel free to put some fair price tag proposals on the issue or onto specific elements of it.

@michael-spengler
Copy link
Author

Some more info which might be helpful along this journey: michael-spengler/wwi18seac#8 (comment)

Plus the link to the Deno community in Discord: https://discord.gg/deno Feel free to join.

@GregTheGreek
Copy link
Contributor

@michael-spengler since deno isn't on our roadmap I'm not sure if we'll be able to provide and gitcoin grants at this time.

@michael-spengler
Copy link
Author

@GregTheGreek O.K. We'll see what we can do on our side for the Deno Web3 enablement. We can leave the issue open if you like as I can give some updates on the corresponding progress during the upcoming weeks.

@GregTheGreek GregTheGreek added the work-in-progress Prevents stalebot from closing a pr label Sep 4, 2020
@Soremwar
Copy link

Soremwar commented Sep 13, 2020

Hi there

Im currently working in a port of Web3 1.1.12 (some really good progress made already) to support Deno natively.

Maybe your TypeScript implementation (I assume web3 2.0 or higher) will be easier to use natively in Deno through tools like Skypack or Denoify.

You can track current progress here: (Credits were due)
https://github.com/deno-npm/deno_npm
And here
https://deno.land/x?query=npm+web3

@GregTheGreek
Copy link
Contributor

we aren't actively maintiang 2.0 anymore.

We have a 1.4.0 branch (probably >1 month away) thats fully written in es6 to make everyone's life a bit easier :) After that will be typescript!

@philknows philknows added Stale Has not received enough activity and removed work-in-progress Prevents stalebot from closing a pr labels Aug 3, 2021
@chovyprognos
Copy link

no progress on this? i'dalso like to use web3 inside deno

@talentlessguy
Copy link

@chovyprognos try with esm.sh, i think it should import it fine

@chovyprognos
Copy link

@talentlessguy error: Uncaught TypeError: Cannot read properties of undefined (reading 'Rand')

https://stackoverflow.com/questions/69567044/how-do-i-import-web3-from-esm-sh-into-a-deno-deps-ts-file

@michael-spengler
Copy link
Author

@Soremwar & @GregTheGreek:
We have in the meantime worked with an ethereum-node-gateway-microservice which is of course not too cool. So we would reconsider this issue.

Have you heard of any successful usage of web3 in deno - resp. which tricks are needed to make it work?

trying it via

import web3 from 'https://cdn.skypack.dev/web3 

currently leads to
.
.
.

Screenshot 2021-10-24 at 14 12 21

@Soremwar
Copy link

@michael-spengler Not really, thought the Node compatibility layer is seeing some rapid development from the mantainers who are currently very interested in attracting lib developers into the Deno ecosystem

I do see a quick way to solve this though, if the Web3 mantainers were to provide an ESM build of Web3JS for the browser it would likely just work on Deno, since most of the crypto APIs are available now

@michael-spengler
Copy link
Author

@Soremwar Thank you.
We'll explore https://github.com/nolanlawson/cjs-to-es6 ...

@talentlessguy
Copy link

there's also lebab

https://github.com/lebab/lebab

@michael-spengler
Copy link
Author

@talentlessguy @Soremwar @GregTheGreek @chovyprognos @ntrotner:

Good News:
Especially thanks to the hint from @talentlessguy we managed to come up with a pretty good solution in our opinion:
https://deno.land/x/web3

Enjoy the features and feel free to raise issues. We want to continue to support web3.

@talentlessguy
Copy link

https://esm.sh/web3 works as well btw, in v55 it got fixed

@michael-spengler
Copy link
Author

michael-spengler commented Nov 7, 2021

@talentlessguy: Thank you. Two aspects we currently consider:

  1. TypeSafety
  2. Independence from esm.sh, skypack.dev et al.

It seems interesting how those things will evolve in the future. Will there be Deno Modules which just serve as a wrapper or will people just get used to writing things like import ... from "...esm.sh/..."? Feedback is always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Feature Request Stale Has not received enough activity
Projects
None yet
Development

No branches or pull requests

6 participants