Pycharm Javascript / Typescript window object
Hello. I want to create simple frontend for my smart contracts with javascript / typescript. I use PyCharm Professional.
I have access to the window object but when I try to access window.ethereum I have Unresolved variable. In vs code everything works out of the box. Do I miss any configuration?
Thanks a lot!
请先登录再写评论。
`ethereum` isn't a property of the standard `window` object: https://developer.mozilla.org/en-US/docs/Web/API/Window.
Where is it defined? If you Ctrl-click on it in VSCode, where are you navigated?
Which dependencies are installed in your project?
Thanks for the reply. I have just solved it. I cannot recreate the issue because I have deleted everything and started from scratch.
Yes `ethereum` is not part of standard window object. If you install metamask extension for your browser the ethereum is injected into window.
I have created new node project in pycharm and additionally installed @metamask/sdk. The ethereum property is there. Hope this will help someone in the future.