Add types for isSmartContractWallet

This commit is contained in:
Agustin Pane 2020-07-08 16:08:08 -03:00
parent 948bb21378
commit c55c9236aa
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ export const getNetworkIdFrom = (web3Provider: Web3): Promise<number> => web3Pro
const isHardwareWallet = (walletName: string) => const isHardwareWallet = (walletName: string) =>
sameAddress(WALLET_PROVIDER.LEDGER, walletName) || sameAddress(WALLET_PROVIDER.TREZOR, walletName) sameAddress(WALLET_PROVIDER.LEDGER, walletName) || sameAddress(WALLET_PROVIDER.TREZOR, walletName)
const isSmartContractWallet = async (web3Provider: Web3, account) => { const isSmartContractWallet = async (web3Provider: Web3, account: string): Promise<boolean> => {
const contractCode = await web3Provider.eth.getCode(account) const contractCode = await web3Provider.eth.getCode(account)
return contractCode.replace(EMPTY_DATA, '').replace(/0/g, '') !== '' return contractCode.replace(EMPTY_DATA, '').replace(/0/g, '') !== ''