Ethereum React Native Boilerplate Questions

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?

Hello Malik,

Thanks for your response.
Here the adresse that I want to display all the NFT images : 0x0d8acbdd88ec12165611d016bbef96960db8d42c.
I guess i will have to call the opensea API to display the images.

We cannot connect with wallet apps on a device emulator since you don’t have these apps installed in the emulator. You can skip the login by providing the hardcoded address for development purposes by changing line 30 in the MoralisDappProvider.js file as such –

<MoralisDappContext.Provider
      value={{
        walletAddress: "0x71a11bc477048cca56d645ffc66ca762f62d1c3c",
        chainId: "0x1",
      }}>
      {children}
    </MoralisDappContext.Provider>
1 Like

Looks like there are many NFTs in the wallet. I tested a few with their metadata URL IPFS links and they seem to be working. Tested these-

https://ipfs.io/ipfs/QmNZDpkfZxmmocU7VfrebQS1Gx7TBtF6MFm7jgk73wqXNN
https://ipfs.io/ipfs/QmWD4RoZ6YsB8sCbmpj16sdEVQBY4KpC8URMwg6RPG6vTg\
https://ipfs.io/ipfs/QmNwd6Lqxz2R9tDmApVGW9K4cP6WPvLCucjGsghnkfkAmq/740.png

Also, since these questions are not specific to React native I would suggest you start a new thread to discuss this further.

I wanted to run the app using expo start command. When I scan the barcode it opens my expo app successfully but then it is just stuck at the ethereum logo screen like so. Does anyone know why this is happening/how to fix it to run the proper flow of the app?

Please do not use expo to run the app. Follow the instructions in the Quick start guide in github. We will soon be pushing a change where we get rid of expo completely because of its inconsistent behaviour.

How do you find the android folder from source code in android studio?

I see on android studio that we could open (new project), (VCS), or (open).

I see in the (open) option under my folder i made for this app there is an android option (with the android symbol).

Do we choose that?

Or do we choose the other android option (which does not have the android symbol/logo showing)
NOTE: i can only embedd one image at the moment so I cant show that picture yet)

If I am way off target then I am lost as to how to open an adrodi folder from source code in the android studio.

The getNFTsForContract (I modified the useNFTBalance hook because I just needed NFTs of a given contract, not all) is giving me an incorrect number of NFTs, with some repeated.
It was working fine a couple days ago but then started giving 3 when there were 2, and now I have 5 real NFTs, it gives me 8… What’s going on?

[
    {
        "token_address": "0xe10f3580f4c1b9f88a8fbbea562622f1cf255423",
        "token_id": "2",
        "block_number_minted": "15106120",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15106120",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0x5b2518f041319fda578417a278c1bffe56a19c67",
        "token_id": "1",
        "block_number_minted": "15042289",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15042289",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0x9de0f123e228276a9ee486847512fad0fd2727eb",
        "token_id": "0",
        "block_number_minted": "15015235",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15015235",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0xe10f3580f4c1b9f88a8fbbea562622f1cf255423",
        "token_id": "0",
        "block_number_minted": "15106092",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15106092",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0xe10f3580f4c1b9f88a8fbbea562622f1cf255423",
        "token_id": "4",
        "block_number_minted": "15106155",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15106155",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0xe10f3580f4c1b9f88a8fbbea562622f1cf255423",
        "token_id": "3",
        "block_number_minted": "15106145",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15106145",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0xe10f3580f4c1b9f88a8fbbea562622f1cf255423",
        "token_id": "1",
        "block_number_minted": "15106110",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15106110",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    },
    {
        "token_address": "0x5b2518f041319fda578417a278c1bffe56a19c67",
        "token_id": "0",
        "block_number_minted": "15042287",
        "owner_of": "0x737bffc0e88285a87490f4f8124e5d32fbe6fd82",
        "block_number": "15042287",
        "amount": "1",
        "contract_type": "ERC721",
        "name": "MonsterWorldNFT",
        "symbol": "MWD-NFT",
        "token_uri": null,
        "metadata": null,
        "synced_at": null,
        "is_valid": 0,
        "syncing": 1,
        "frozen": 0
    }
]

The opened tabs at the top almost gave me an anxiety attack

1 Like

The folder structure that you showed above is right. The android folder from the source code is to be opened.