Ethereum React Native Boilerplate Questions

I managed to solve this problem on the emulator, but on the real phone it remained

okay sir thank you, i also got issues when running the app on a physical and emulator, the issue is that once finished loading all the 10 account with 1000ETH each, the app never build on my phone

Did you follow the steps that were laid out in the github readme?
Running yarn android does not work.

Try -
Android:

  • Command yarn start
  • Open android folder from source code in Android Studio. Click “Run app” button to open either emulator or physical device. To see if devices are available, run command adb devices in your terminal.
1 Like

I’m facing the same issue in browser I see 404 error.

As mentioned above, it is an issue from Walletconnect and we are looking into it.

Confirmation window not opening in meta mask wallet.
I tried to call a payable contract function. On clicking the button the metamask app is opening, but the confirmation window is not.

Hi,

I’m working on a Dapp to show NFT’s of a given adresse. I have an issue with some NFT images that I cannot display because in the Moralis API json, the image url isn broken. Is there any solution to display those NFT images ?

Thank you in advance.
Hassan.

How can I get data of my tokens? Apparently the only way is creating a function that prints it and calling that function right? I don’t understand how to implement the Moralis.Web3API.native.runContractFunction in React. I tried creating a hook but since the NFT page is already using another hook I can’t use another one.

The best I got was a pending promise with:

code: 141
error: “Web3 API error while calling /:address/function”.

Hi,

Are you looking for React or React Native specific code?

You can do it this way to fetch prices –

import { useMoralisWeb3Api } from "react-moralis";  
const { token } = useMoralisWeb3Api();
const chain = "0x1";
  return token
      .getTokenPrice({ chain, address: tokenAddress })
      .then((result) => result);

Some NFTs do not have the proper image URLs because the metadata isn’t right from the blockchain itself. However, if the info is incorrect from our side, we can double-check it from our side. You can provide the NFT address.

Thanks

React. What I was looking for was to get data on a ERC721 token, by calling a function that prints data. But I don’t get how to implement it inside the NFTBalances component. Either I get “Warning: Can’t perform a React state update on an unmounted component. (…)”, get a rejected promise or just undefined.

It’s working on the Admin panel, but for some reason I can’t implement it on React.

On the meantime, I replaced it with a fetch call using the curl parameters and works fine. Is there any problem on getting it like that (besides the inconvenience)?

async function API() {
  const url = 'https://deep-index.moralis.io/api/v2/<Contract address>/function?chain=bsc%20testnet&function_name=getInfo';
  fetch(url, {
    method: "POST",
    withCredentials: true,
    headers: {
      "accept": "application/json",
      "X-API-Key": <my key>,
      "Content-Type": "application/json"
    },
    body: '{"abi": <my ABI>, "params": <my params>}'
  }).then(response => response.json())
    .then(data => console.log(data));
}```

Hey @iPictorial @Krishna if you add the changes in this pull request you should get past the confirmation model not showing up in MetaMask.

Hey @malik & @gen are there issue with the react native logins not showing up in the Moralis dashboard? I am trying to authentice sessions so I don’t have to login in each time. But the issue is that every time I login via MetaMask, the Session’s table is not populated with the new session for my emulated device. However, when I played around with the Connect to the SDK project, my login for both email and wallet logins show up. Thanks again!

Hi Sorry to bother you. please help me.
We use Moralis for our project. we tried this function(runContractFunction). It works for us on Javascript.
https://docs.moralis.io/moralis-server/web3-sdk/native

And then, we tried it on typescript, but it does not work. It seems the types of ABI is not defined.
It is difficult for us to define type of ABI in this moralis. please tell me the way or document to use runContractFunction on typescript.
We often use web3.js, ether.js and useDapps, but we want to use Moralis this time.

Best regards.

Hello.

I am using the visual studio code on windows 10

I am on the section > ( Boilerplate Quick Start Walkthrough)

I am trying to clone the boilerplate git but get the below error. Why is this?

Just a quick question. How easy is the boilerplate dex to add a small extra fee for your platform? I know this was possible when using the 1inch API but is it supported via the plugin?

You have to use the git command.

git clone ethereum-boilerplate/ethereum-react-native-boilerplate

I will investigate this and come to you. Sessions are handled a little differently on mobile because of local storage and wallet connect integration. Ideally, they should show up in the table. I will get back to you on this one.

@MarkyMarx Is this related to react native specifically? BEcause this thread revolves around only react native.

Hi I am trying to create a react-native app using Moralis. I am using just a standard iPhone emulator for testing purposes. When utilizing the WalletConnect it is properly displaying all the wallets you can sign in with however when I click on for example MetaMask it just opens safari and I cannot connect a wallet. My question is essentially how do you connect a wallet for testing purposes using an emulated iPhone?