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

Events not coming in with Trust Wallet #925

Closed
MythicalToken opened this issue Apr 16, 2020 · 9 comments
Closed

Events not coming in with Trust Wallet #925

MythicalToken opened this issue Apr 16, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@MythicalToken
Copy link

I hope this is the right repo, i haven't used Trust Wallet before and am unsure about all its components.

My dApp (https://myth.cash) is not loading any events, you can check this by opening any page other than the startsite, they all have some kind of tables that should display events but don't. I've tried to connect sentry to get any way to catch errors but all i get is: TypeError: Failed to fetch

The website works as it should with MetaMask a user noticed this for me.

Any ideas how i could fix this behaviour? Or what the actual issue is behind that?

@MythicalToken MythicalToken added the bug Something isn't working label Apr 16, 2020
@vikmeup
Copy link
Contributor

vikmeup commented Apr 16, 2020

You should be using your own web3 provider for events or any other activity.

Read more details here: trustwallet/trust-web3-provider#58 (comment)

@vikmeup vikmeup closed this as completed Apr 16, 2020
@MythicalToken
Copy link
Author

I do, i am using web3.js, i only want my dapp to work in your browser. So far i don't even know how to debug it

@MythicalToken
Copy link
Author

MythicalToken commented Apr 16, 2020

I now tried using nodesmith.io.
Again it works with the Browser/Metamask and not with Trustwallet.

Edit:// In case it isn't obvious, i am not using the injected web3.js, never have. I bring my own web3.js and now also tried to use a third party provider. Both don't work Trustwallet.

No idea why you closed the ticket really

@vikmeup
Copy link
Contributor

vikmeup commented Apr 16, 2020

No idea why you closed the ticket really

this repo not related to the problem. For any issues you can create discussion on https://community.trustwallet.com/c/feedback/2 or https://github.com/trustwallet/trust-web3-provider

@MythicalToken show me example of your code that does not work

Trust Wallet
Let us know how you like our Wallet and if you find any issues. How have your experiences with our customer support been? Is our App easy to use? Is our website useful? Let us know about any problems you encounter with our App below as well. Our official support team is here to help!
GitHub
Web3 javascript wrapper provider for iOS and Android platforms. - trustwallet/trust-web3-provider

@MythicalToken
Copy link
Author

MythicalToken commented Apr 16, 2020

Contracts.contract("KEY", General.address).events.DiceRolled({
  fromBlock: 0
}, function(error, event){})
.on('data', function(event){
   Dice.add_line(event)
})

Does not work. Contracts.contract is returning:

web3.eth.Contract(ABI, ADDRESS, {
  from: FROM,
  gasPrice: GAS
});

As already said i never used trustwallet, so i really have no idea which repo/component is the right one to ask for help. Obviously it is not here but on that forum where i can't post anyway, but have to wait for the support ticket :/

Edit:// Pretty sure the ticket form is the wrong place as well, there is no option that fits my question

@vikmeup
Copy link
Contributor

vikmeup commented Apr 16, 2020

Edit:// In case it isn't obvious, i am not using the injected web3.js, never have. I bring my own web3.js and now also tried to use a third party provider. Both don't work Trustwallet.

if you are using your own provider - why there is should be an issue on the wallet side? As mentioned before, use your own provider for such calls (which ever node you use, nodesmith, infura and etc)

Only use injected provider for sign message and transactions.

@MythicalToken
Copy link
Author

Your wallet contains a browser doesn't it? So if the issue only happens with that specific browser where else should i look for the problem?

@vikmeup
Copy link
Contributor

vikmeup commented Apr 16, 2020

Please read explanation by MetaMask: https://medium.com/metamask/no-longer-injecting-web3-js-4a899ad6e59e.

Solution / Explanation from the article: use your own provider for anything not related to signing. If it works today - it does not mean it will work tomorrow, so if you follow this solution it will always work for you, independent from the wallet or the browser you use.

Medium
This is one of the breaking changes we’re making to the MetaMask inpage provider on December 16, 2019.

@MythicalToken
Copy link
Author

I tried to understand all this now but i don't get it.

So MetaMask does not ship with web3 anymore, got it, no problem i use my own, have been the whole time. I have to use their provider to gain access to accounts, again obvious, so i am using that. So far this setup works with trustwallet too. I can read & write methods with both.

No where does the article you are linking suggest to use my own provider, in fact they even say:

You can still bring your own convenience library and use it with the MetaMask inpage provider, whether ethers.js, web3.js, or something else.

So either the thing you are telling me is that your (trustwallets) default provider is simply not supporting events (then no idea what this would have to do with Metamask) or i simply do not understand what you are talking about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants