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

Improvement in typescript and web3 #67

Closed
ondratra opened this issue Jul 30, 2018 · 2 comments
Closed

Improvement in typescript and web3 #67

ondratra opened this issue Jul 30, 2018 · 2 comments

Comments

@ondratra
Copy link

ondratra commented Jul 30, 2018

I propose changes to generated code:

  • export default instead of plain export in generated classes
  • replace web3.eth.contract(contractAbi).at(address) with new web3.eth.Contract(contractAbi, address) in generated classes
    -> support for web3 1.x
  • create new exposed function abi2wrapper(abi: Object, options: Object): string that convert single ABI to TS wrapper class and will contain most of processFile()'s source code (calling generateSource)
@krzkaczor
Copy link
Member

Hey!
Sorry to keep you waiting, I somehow missed this issue.

I think all of these problems will be solved when typechain starts to support user-provided templates but here's my reasoning:

  1. https://blog.neufund.org/why-we-have-banned-default-exports-and-you-should-do-the-same-d51fdc2cf2ad
  2. Support for 1.x is discussed in: Support for web3 1.0.0 #25
  3. The problem here is how to link generated files with the runtime. I think runtime path has to be part of options object here.

This was referenced Aug 15, 2018
@krzkaczor
Copy link
Member

3 is covered by #72 Thanks! Others are already discussed so I am gonna close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants