web3.unity
web3.unity copied to clipboard
Wrong network when login
Hello, I have code to login in unity using metamask. Login is work, but I set chain-ID to binance testnet (97) and metamask didn't select binance tesnet network.
Debug.Log("Login...");
var projectConfig = ProjectConfigUtilities.Load();
var web3Builder = new Web3Builder(projectConfig).Configure(services =>
{
services
.UseUnityEnvironment()
.UseMultiCall()
.UseRpcProvider();
#if UNITY_WEBGL && !UNITY_EDITOR
services.UseMetaMask().UseMetaMaskSigner().UseMetaMaskTransactionExecutor();
#else
Debug.LogError("Metamask browser connection, currently, only works on WebGL Builds (not in editor).");
#endif
});
var web3 = await web3Builder.LaunchAsync();
if(web3 == null)
{
Debug.LogError("Login failed");
return default;
}
Hi @IsnaniWidhiHidayat, thank you for using our SDK. Currently our Metamask implementation currently only supports Ethereum network but we're working hard on supporting more networks and chains.