Override current network

Let’s say we have application which works in BSC network.
I need to get all user’s NFTs from ETH network and show in my application, is it possible to override network setting for that reason?

User logins via <ConnectButton /> from web3uikit

I’m getting NFTs in the following way (<NFT /> is from web3uikit also):

...
{() => getNFTBalances({params: {chain: "rinkeby"}})}
...
{data && data.result.map((nft) => {
            return <NFT
            chain="rinkeby"
            address={currentUserAddress}
            tokenId={nft.token_id}
            metadata={nft.metadata}
            name={nft.name}
            />
        })}

When i’m in Rinkeby it works well, but if i change network to BSC testnet (in metamask, not in my code) its not working anymore.
Is there any way to retrieve NFTs from the other network? I’m not going to do something with them, just retrieve them and show on the page while user connected to BSC network

Thanks for your help :slight_smile:

1 Like

hey dont think you can do this. blockhains cannot communicate with each other. so you cant accest the data on one blockchain (say etthereum) on another (like bsc in your case) the best way to handle this in your case is to just display the nft’s a user has on that network and when they change networks it will reload there ntf’s to display the ones they own on the chain they changed to.

there could be another way you could do this is if you stored the information of the NFT’s off chain and the use the data to display them on your client atrifically like it will display the NFT’s you have but artifically in the sense you wont be able to intract with them. but i dont see the point in this. a user should not be able to see there ntf’s from another blockchain on a different blockahin because they wont be able to interact with them. it could also confuse the user incase they see their ntf from eth on binancesmart chain thinking they can interact with them

yeah, you’re totally right about all things you said and i understand that usually they are from the same network, but users will be aware that they are in BSC and NFTs are from ETH, thats a point.
i thought there is some way to do this, anyway, thanks for your answer :slight_smile:

You can just query for the user’s NFTs using the API with Ethereum as the chain and the current logged in wallet, and show them if any exist. You could do this for any other chain if the API you’re using supports it.

That’s why you can specify the chain in getNFTBalances.

1 Like