Skip to content

Commit

Permalink
Update MetamaskBlazorInterop.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfranblanco committed Sep 8, 2022
1 parent aad4631 commit 3452274
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Nethereum.Metamask.Blazor/MetamaskBlazorInterop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.JSInterop;
using Nethereum.Hex.HexTypes;
using Nethereum.JsonRpc.Client;
using Nethereum.JsonRpc.Client.RpcMessages;
using Newtonsoft.Json;
Expand Down Expand Up @@ -71,9 +72,10 @@ public static async Task SelectedAccountChanged(string selectedAccount)
}

[JSInvokable()]
public static async Task SelectedNetworkChanged(long chainId)
public static async Task SelectedNetworkChanged(string chainId)
{
await MetamaskHostProvider.Current.ChangeSelectedNetworkAsync(chainId).ConfigureAwait(false);

await MetamaskHostProvider.Current.ChangeSelectedNetworkAsync((long)new HexBigInteger(chainId).Value).ConfigureAwait(false);
}

private T ConvertResponse<T>(string jsonResponseMessage)
Expand Down

0 comments on commit 3452274

Please sign in to comment.