示例#1
0
 public async Task ChangeSelectedAccountAsync(string selectedAccount)
 {
     if (SelectedAccount != selectedAccount)
     {
         SelectedAccount = selectedAccount;
         if (SelectedAccountChanged != null)
         {
             await SelectedAccountChanged.Invoke(selectedAccount);
         }
     }
 }
示例#2
0
        public async Task <string> EnableProviderAsync()
        {
            var selectedAccount = await _metamaskInterop.EnableEthereumAsync();

            Enabled = !string.IsNullOrEmpty(selectedAccount);

            if (Enabled)
            {
                SelectedAccount = selectedAccount;
                if (SelectedAccountChanged != null)
                {
                    await SelectedAccountChanged.Invoke(selectedAccount);
                }
                return(selectedAccount);
            }

            return(null);
        }