diff --git a/single-factor-auth-web/sfa-react-auth0-github-example /src/App.tsx b/single-factor-auth-web/sfa-react-auth0-github-example /src/App.tsx index 491f508a..38b0ab19 100644 --- a/single-factor-auth-web/sfa-react-auth0-github-example /src/App.tsx +++ b/single-factor-auth-web/sfa-react-auth0-github-example /src/App.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; // Import Single Factor Auth SDK for no redirect flow import { Web3Auth } from "@web3auth/single-factor-auth"; -import { CHAIN_NAMESPACES, SafeEventEmitterProvider } from "@web3auth/base"; +import { CHAIN_NAMESPACES, IProvider } from "@web3auth/base"; import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider"; // RPC libraries for blockchain calls @@ -32,7 +32,7 @@ const chainConfig = { function App() { const [web3authSFAuth, setWeb3authSFAuth] = useState(null); const [usesSfaSDK, setUsesSfaSDK] = useState(false); - const [provider, setProvider] = useState( + const [provider, setProvider] = useState( null ); const [idToken, setIdToken] = useState(null); diff --git a/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.ethers.ts b/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.ethers.ts index 63a0c774..0a691cea 100644 --- a/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.ethers.ts +++ b/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.ethers.ts @@ -1,10 +1,10 @@ -import type { SafeEventEmitterProvider } from "@web3auth/base"; +import type { IProvider } from "@web3auth/base"; import { ethers } from "ethers"; export default class EthereumRpc { - private provider: SafeEventEmitterProvider; + private provider: IProvider; - constructor(provider: SafeEventEmitterProvider) { + constructor(provider: IProvider) { this.provider = provider; } diff --git a/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.web3.ts b/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.web3.ts index 9cc72534..8d83fe82 100644 --- a/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.web3.ts +++ b/single-factor-auth-web/sfa-react-auth0-github-example /src/evm.web3.ts @@ -1,10 +1,10 @@ -import type {SafeEventEmitterProvider} from '@web3auth/base' +import type {IProvider} from '@web3auth/base' import Web3 from 'web3' export default class EthereumRpc { - private provider: SafeEventEmitterProvider + private provider: IProvider - constructor(provider: SafeEventEmitterProvider) { + constructor(provider: IProvider) { this.provider = provider } async getAccounts(): Promise { @@ -22,7 +22,7 @@ export default class EthereumRpc { const web3 = new Web3(this.provider as any) const accounts = await web3.eth.getAccounts() const balance = await web3.eth.getBalance(accounts[0]) - return balance + return balance.toString(); } catch (error) { return error as string } @@ -61,9 +61,9 @@ export default class EthereumRpc { const txRes = await web3.eth.sendTransaction({ from: accounts[0], to: accounts[0], - value: web3.utils.toWei('0.01'), + value: web3.utils.toWei('0.01', 'ether'), }) - return txRes.transactionHash + return txRes.transactionHash.toString(); } catch (error) { return error as string }