@iPictorial Can you give more details about what you are trying to do? Thanks!
Hi there I am running into problems trying to authenticate with walletconnect and moralis. In the boilerplate code it appears that the walletconnect connector can be passed directly to the moralis authenticate function as a provider; however when I try to do this I get a Typescript error saying âArgument of type â{ connector: WalletConnect; }â is not assignable to parameter of type âAuthenticateOptionsâ.â I can only pass âwcâ or âwalletconnectâ as providers.
I can use the connect function on the connector with no issues, but I need the user to be authenticated with moralis. Any help or ideas would help thanks!
Hey ĂŹ Iâm trying to sync my smart contract with moralis. What should i put on topic and abi if my smart contract does not have an event defined?
i was following the moralis video for syncing the smart contract .
thatâs my contract, a simple mint erc721 contract
pragma solidity ^0.8.0;
import âgithub.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721URIStorage.solâ;
import âgithub.com/OpenZeppelin/openzeppelin-contracts/contracts/utils/Counters.solâ;
contract My_NFT is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721("NFT", "Collections1") {}
function mintToken(string memory tokenURI)
public
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(msg.sender, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
}
Iâm trying to run the boilerplate app on my Android phone and keep running into problems.
I run npx yarn start
for the Metro bundler and yarn start
after installing dependencies. The app loads on my phone but only partially it seems. The Moralis logo and animation behind it show and the green Login button shows. However, the eth.png background doesnât want to load and after I successfully sign a message with my wallet (metamask/trust wallet) it wonât kick me back into the app and when I manually switch windows back it immediately crashes every time.
Console errors occur simultaneously with crash:
[Thu Jan 13 2022 17:42:37.841] LOG BALANCE {"balance": "0"}
[Thu Jan 13 2022 17:42:42.951] WARN Possible Unhandled Promise Rejection (id: 0):
Error: Unable to open url.
_callee2$@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:329092:73
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25365:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25535:32
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25365:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25437:30
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:25447:21
tryCallOne@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27452:16
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27553:27
_callTimer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:30992:17
_callImmediatesPass@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:31031:17
callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:31248:33
__callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2688:35
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2474:34
__guard**@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2671:15
flushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2473:21
flushedQueue@[native code]
invokeCallbackAndReturnFlushedQueue@[native code]
I have now been trying to get RN + web3 setup for several days now and iâm hoping to get some help if anyone recognizes what my problem may be. Thanks!
Try to replace eth.png with another logo of your choice âŚ
I am facing the next issue to integrate wallectConnectâs âconnectorâ object with Moralis authenticate function.
I understand that moralis authenticate function requires the certain format to be passed in and team has modified the walletConnectâs source code to make it suited. So, I replaced the default wallectconnect lib with the "./frontend/WalletConnect.
The I followed the sample code "./frontend/Components/CryptoAuth.js ( https://github.com/gen02-dev/ethereum-react-native-cli-boilerplate) passing the âconnectorâ object into authenticate(). But it turns out the error
Non ethereum enabled browser
It will be appreciated if you could give me a hint that where did I miss out.
You could also have a look at my repo branch#5 (5.Moralis_WalletConnect) if you have time. The authenticate() call is in ./screens/main.tsx
Many thanks!
Does anybody find the clue about this issue?
any updates? spent on this issue around 20 hours and I donât want to live anymore
i am leaved comments in enableViaWalletConnect function (which overrides Moralis.enable function. And every time when it is called - there empty object instead of connector.
Thanks for the support. I am looking forward to the solution. I have spent two days but still cannot get the clue.
@happyeric77 My bad, I forgot to fork your repo instead before I made some progress. Can you give me write permission to the repo? Iâll push a branch for the fixes. Thanks.
Thank you so much, I have invited you as the collaborator for the repo.
@happyeric77 Thanks! I created a brach named fix-walletconnect
. When you checkout this branch, make sure to delete node_modules
. Then run yarn install
again and run the app with yarn ios
. Below is the screenshot after I believe I fixed it:
@gen Thanks so much! I just have a try and it works! AMAZING AGAIN!
I also briefly checked the diff but I could not really see what was the cause of that issue. I realized:
- The App is wrapped one more layer by MoralisDappProvider
- Some npm packages have been changed.
It will be appreciated if you do not mind letting me know what is the key taking effect to fix it.
@happyeric77 What fixed it is downgrading moralis
from "moralis": "0.0.183"
to "moralis": "0.0.99"
. This of course is not ideal since we would like to use the latest moralis
version as much as possible. This fix should be temporary until we find the best solution. I also refactored your code to limit some errors you might encounter in the future so you can focus on creating your dapp.
Has anyone been able to get ENS reverse lookup working?