Skip to content

Commit a2e8c8f

Browse files
committed
Support for other injected wallets when using MetaMaskWallet
Tested with Rabby + WalletProvider.MetaMaskWallet
1 parent b372d0a commit a2e8c8f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Assets/Thirdweb/Runtime/Unity/Wallets/Core/MetaMaskWallet.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static async Task<MetaMaskWallet> Create(ThirdwebClient client, BigIntege
4545
if (metaMaskInstance.IsMetaMaskAvailable())
4646
{
4747
ThirdwebDebug.Log("MetaMask is available. Enabling Ethereum...");
48-
var isEnabled = await metaMaskInstance.EnableEthereumAsync();
48+
var isEnabled = await metaMaskInstance.EnableEthereumAsync(activeChainId);
4949
ThirdwebDebug.Log($"Ethereum enabled: {isEnabled}");
5050
if (isEnabled && !string.IsNullOrEmpty(metaMaskInstance.GetAddress()))
5151
{

Assets/Thirdweb/Runtime/Unity/Wallets/Core/WebGLMetaMask.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ private void Awake()
6767
}
6868
}
6969

70-
public async Task<bool> EnableEthereumAsync()
70+
public async Task<bool> EnableEthereumAsync(BigInteger chainId)
7171
{
72+
_activeChainId = chainId;
7273
_enableEthereumTaskCompletionSource = new TaskCompletionSource<bool>();
7374

7475
#if UNITY_WEBGL && !UNITY_EDITOR

0 commit comments

Comments
 (0)