Esempio n. 1
0
        public async ValueTask <bool> EnableEthereumAsync()
        {
            var result = await _metamaskInterop.EnableEthereumAsync();

            IsEthereumEnabled = result;
            if (EthereumEnabled != null)
            {
                await EthereumEnabled.Invoke(result);
            }
            return(result);
        }
Esempio n. 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);
        }