From 3787479521c67c388568ce4c4845216621fdb464 Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo Date: Sun, 10 Sep 2023 21:42:15 -0300 Subject: [PATCH] #199 - fix typing issues --- src/components/ConnectWalletButton.tsx | 6 +++--- src/components/Migration/EvmQuickMigrate.tsx | 4 ++-- src/components/Migration/EvmWorkflow.tsx | 2 +- src/components/NFTOriginVerifier.tsx | 2 +- src/components/Recovery.tsx | 4 ++-- src/components/TokenSelectors/EvmTokenPicker.tsx | 2 +- src/components/TransactionProgress.tsx | 2 +- src/components/Transfer/AddToMetamask.tsx | 2 +- src/hooks/useAllowance.ts | 2 +- src/hooks/useCheckIfWormholeWrapped.ts | 6 +++--- src/hooks/useEvmMetadata.ts | 2 +- src/hooks/useFetchForeignAsset.ts | 6 +++--- src/hooks/useFetchTargetAsset.ts | 8 ++++---- src/hooks/useGetIsTransferCompleted.ts | 6 +++--- src/hooks/useGetSourceParsedTokenAccounts.ts | 2 +- src/hooks/useGetTargetParsedTokenAccounts.ts | 4 ++-- src/hooks/useHandleAttest.tsx | 6 +++--- src/hooks/useHandleCreateWrapped.tsx | 6 +++--- src/hooks/useHandleNFTRedeem.tsx | 2 +- src/hooks/useHandleNFTTransfer.tsx | 2 +- src/hooks/useHandleRedeem.tsx | 6 +++--- src/hooks/useHandleTransfer.tsx | 6 +++--- src/hooks/useIsWalletReady.ts | 4 ++-- src/hooks/useOriginalAsset.ts | 8 ++++---- src/hooks/useSyncTargetAddress.ts | 4 ++-- src/hooks/useTransactionFees.tsx | 4 ++-- 26 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/components/ConnectWalletButton.tsx b/src/components/ConnectWalletButton.tsx index c191f17f8..801a859af 100644 --- a/src/components/ConnectWalletButton.tsx +++ b/src/components/ConnectWalletButton.tsx @@ -16,13 +16,13 @@ import { useSelector } from "react-redux"; import { RootState } from "../store"; const ConnectWalletButton = ({ chainId }: { chainId: ChainId }) => { - const wallet = useWallet(chainId); + const wallet = useWallet(chainId as any); const changeWallet = useChangeWallet(); const unsetWalletFromChain = useUnsetWalletFromChain(); const [isDialogOpen, setIsDialogOpen] = useState(false); const [error, setError] = useState(); const { wallets: availableWallets, isDetectingWallets } = - useWalletsForChainWithStatus(chainId); + useWalletsForChainWithStatus(chainId as any); const sourceChain = useSelector( (state: RootState) => state.transfer.sourceChain ); @@ -62,7 +62,7 @@ const ConnectWalletButton = ({ chainId }: { chainId: ChainId }) => { try { if (!wallet) return; await wallet.disconnect(); - unsetWalletFromChain(chainId); + unsetWalletFromChain(chainId as any); setError(undefined); } catch (err: any) { console.error(err); diff --git a/src/components/Migration/EvmQuickMigrate.tsx b/src/components/Migration/EvmQuickMigrate.tsx index ff1ed41ba..1dc40ae53 100644 --- a/src/components/Migration/EvmQuickMigrate.tsx +++ b/src/components/Migration/EvmQuickMigrate.tsx @@ -99,7 +99,7 @@ function EvmMigrationLineItem({ }) { const classes = useStyles(); const { enqueueSnackbar } = useSnackbar(); - const { signer, signerAddress } = useEthereumProvider(chainId); + const { signer, signerAddress } = useEthereumProvider(chainId as any); const poolInfo = useEthereumMigratorInformation( migratorAddress, signer, @@ -272,7 +272,7 @@ const getAddressBalances = async ( export default function EvmQuickMigrate({ chainId }: { chainId: ChainId }) { const classes = useStyles(); - const { signer, signerAddress } = useEthereumProvider(chainId); + const { signer, signerAddress } = useEthereumProvider(chainId as any); const { isReady } = useIsWalletReady(chainId); const migrationMap = useMemo(() => getMigrationAssetMap(chainId), [chainId]); const eligibleTokens = useMemo( diff --git a/src/components/Migration/EvmWorkflow.tsx b/src/components/Migration/EvmWorkflow.tsx index 12716e86c..6f6682d12 100644 --- a/src/components/Migration/EvmWorkflow.tsx +++ b/src/components/Migration/EvmWorkflow.tsx @@ -32,7 +32,7 @@ export default function EvmWorkflow({ }) { const classes = useStyles(); const { enqueueSnackbar } = useSnackbar(); - const { signer, signerAddress } = useEthereumProvider(chainId); + const { signer, signerAddress } = useEthereumProvider(chainId as any); const { isReady } = useIsWalletReady(chainId); const [toggleRefresh, setToggleRefresh] = useState(false); const forceRefresh = useCallback( diff --git a/src/components/NFTOriginVerifier.tsx b/src/components/NFTOriginVerifier.tsx index 9b6760422..5f99e5214 100644 --- a/src/components/NFTOriginVerifier.tsx +++ b/src/components/NFTOriginVerifier.tsx @@ -82,7 +82,7 @@ export default function NFTOriginVerifier() { const classes = useStyles(); const isBeta = useBetaContext(); const [lookupChain, setLookupChain] = useState(CHAIN_ID_ETH); - const { provider, signerAddress } = useEthereumProvider(lookupChain); + const { provider, signerAddress } = useEthereumProvider(lookupChain as any); const { isReady, statusMessage } = useIsWalletReady(lookupChain); const [lookupAsset, setLookupAsset] = useState(""); const [lookupTokenId, setLookupTokenId] = useState(""); diff --git a/src/components/Recovery.tsx b/src/components/Recovery.tsx index a8c2444bb..77b9405c9 100644 --- a/src/components/Recovery.tsx +++ b/src/components/Recovery.tsx @@ -574,7 +574,7 @@ export default function Recovery() { const dispatch = useDispatch(); const [recoverySourceChain, setRecoverySourceChain] = useState(CHAIN_ID_SOLANA); - const { provider } = useEthereumProvider(recoverySourceChain); + const { provider } = useEthereumProvider(recoverySourceChain as any); const [type, setType] = useState<"Token" | "NFT">("Token"); const isNFT = useMemo(() => type === "NFT", [type]); const [recoverySourceTx, setRecoverySourceTx] = useState(""); @@ -645,7 +645,7 @@ export default function Recovery() { const tokenBridgeAddress = getTokenBridgeAddressForChain(CHAIN_ID_INJECTIVE); const tokenId = await queryExternalIdInjective( - client, + client as any, tokenBridgeAddress, parsedPayload.originAddress ); diff --git a/src/components/TokenSelectors/EvmTokenPicker.tsx b/src/components/TokenSelectors/EvmTokenPicker.tsx index f59f86481..f5873f877 100644 --- a/src/components/TokenSelectors/EvmTokenPicker.tsx +++ b/src/components/TokenSelectors/EvmTokenPicker.tsx @@ -62,7 +62,7 @@ export default function EvmTokenPicker( chainId, nft, } = props; - const { provider, signerAddress } = useEthereumProvider(chainId); + const { provider, signerAddress } = useEthereumProvider(chainId as any); const { isReady } = useIsWalletReady(chainId); const selectedTokenAccount: NFTParsedTokenAccount | undefined = useSelector( nft diff --git a/src/components/TransactionProgress.tsx b/src/components/TransactionProgress.tsx index 8fca77324..4557e9d84 100644 --- a/src/components/TransactionProgress.tsx +++ b/src/components/TransactionProgress.tsx @@ -44,7 +44,7 @@ export default function TransactionProgress({ isSendComplete: boolean; }) { const classes = useStyles(); - const { provider } = useEthereumProvider(chainId); + const { provider } = useEthereumProvider(chainId as any); const [currentBlock, setCurrentBlock] = useState(0); useEffect(() => { if (isSendComplete || !tx) return; diff --git a/src/components/Transfer/AddToMetamask.tsx b/src/components/Transfer/AddToMetamask.tsx index dd44d98e2..79b96f653 100644 --- a/src/components/Transfer/AddToMetamask.tsx +++ b/src/components/Transfer/AddToMetamask.tsx @@ -41,7 +41,7 @@ export default function AddToMetamask() { const tbtcAsset = THRESHOLD_TBTC_CONTRACTS[targetChain]; const { provider, signerAddress, evmChainId, wallet } = - useEthereumProvider(targetChain); + useEthereumProvider(targetChain as any); const hasCorrectEvmNetwork = evmChainId === getEvmChainId(targetChain); const handleClick = useCallback(() => { if (provider && targetAsset && signerAddress && hasCorrectEvmNetwork) { diff --git a/src/hooks/useAllowance.ts b/src/hooks/useAllowance.ts index a16014068..9aa274b81 100644 --- a/src/hooks/useAllowance.ts +++ b/src/hooks/useAllowance.ts @@ -36,7 +36,7 @@ export default function useAllowance( const isTBTC = useSelector(selectTransferIsTBTC); const sourceChain = useSelector(selectTransferSourceChain); const isApproveProcessing = useSelector(selectTransferIsApproving); - const { signer } = useEthereumProvider(chainId); + const { signer } = useEthereumProvider(chainId as any); const sufficientAllowance = !isEVMChain(chainId) || sourceIsNative || diff --git a/src/hooks/useCheckIfWormholeWrapped.ts b/src/hooks/useCheckIfWormholeWrapped.ts index 03598f8fb..2e5482360 100644 --- a/src/hooks/useCheckIfWormholeWrapped.ts +++ b/src/hooks/useCheckIfWormholeWrapped.ts @@ -102,7 +102,7 @@ function useCheckIfWormholeWrapped(nft?: boolean) { const setSourceWormholeWrappedInfo = nft ? setNFTSourceWormholeWrappedInfo : setTransferSourceWormholeWrappedInfo; - const { provider } = useEthereumProvider(sourceChain); + const { provider } = useEthereumProvider(sourceChain as any); const { accountId: nearAccountId } = useNearContext(); const isRecovery = useSelector( nft ? selectNFTIsRecovery : selectTransferIsRecovery @@ -271,7 +271,7 @@ function useCheckIfWormholeWrapped(nft?: boolean) { ); const wrappedInfo = makeStateSafe( await getOriginalAssetAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, BigInt(sourceAsset) ) @@ -304,7 +304,7 @@ function useCheckIfWormholeWrapped(nft?: boolean) { try { const client = getInjectiveWasmClient(); const wrappedInfo = makeStateSafe( - await getOriginalAssetInjective(sourceAsset, client) + await getOriginalAssetInjective(sourceAsset, client as any) ); if (!cancelled) { dispatch(setSourceWormholeWrappedInfo(wrappedInfo)); diff --git a/src/hooks/useEvmMetadata.ts b/src/hooks/useEvmMetadata.ts index 83c106ddb..e83735a9a 100644 --- a/src/hooks/useEvmMetadata.ts +++ b/src/hooks/useEvmMetadata.ts @@ -57,7 +57,7 @@ function useEvmMetadata( chainId: ChainId ): DataWrapper> { const { isReady } = useIsWalletReady(chainId, false); - const { provider } = useEthereumProvider(chainId); + const { provider } = useEthereumProvider(chainId as any); const [isFetching, setIsFetching] = useState(false); const [error, setError] = useState(""); diff --git a/src/hooks/useFetchForeignAsset.ts b/src/hooks/useFetchForeignAsset.ts index 435f3153a..c55a621e0 100644 --- a/src/hooks/useFetchForeignAsset.ts +++ b/src/hooks/useFetchForeignAsset.ts @@ -66,7 +66,7 @@ function useFetchForeignAsset( originAsset: string, foreignChain: ChainId ): DataWrapper { - const { provider, evmChainId } = useEthereumProvider(originChain); + const { provider, evmChainId } = useEthereumProvider(originChain as any); const { isReady } = useIsWalletReady(foreignChain, false); const correctEvmNetwork = getEvmChainId(foreignChain); const hasCorrectEvmNetwork = evmChainId === correctEvmNetwork; @@ -208,7 +208,7 @@ function useFetchForeignAsset( ALGORAND_HOST.algodPort ); return getForeignAssetAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, originChain, originAssetHex @@ -232,7 +232,7 @@ function useFetchForeignAsset( const client = getInjectiveWasmClient(); return getForeignAssetInjective( getTokenBridgeAddressForChain(foreignChain), - client, + client as any, originChain, hexToUint8Array(originAssetHex) ); diff --git a/src/hooks/useFetchTargetAsset.ts b/src/hooks/useFetchTargetAsset.ts index 299093c8a..84dc373dd 100644 --- a/src/hooks/useFetchTargetAsset.ts +++ b/src/hooks/useFetchTargetAsset.ts @@ -114,7 +114,7 @@ function useFetchTargetAsset(nft?: boolean) { const isTBTC = useSelector(selectTransferIsTBTC); const activeStep = useSelector(selectTransferActiveStep); const setTargetAsset = nft ? setNFTTargetAsset : setTransferTargetAsset; - const { provider, evmChainId } = useEthereumProvider(targetChain); + const { provider, evmChainId } = useEthereumProvider(targetChain as any); const correctEvmNetwork = getEvmChainId(targetChain); const hasCorrectEvmNetwork = evmChainId === correctEvmNetwork; const { accountId: nearAccountId } = useNearContext(); @@ -288,7 +288,7 @@ function useFetchTargetAsset(nft?: boolean) { const tokenBridgeAddress = getTokenBridgeAddressForChain(CHAIN_ID_INJECTIVE); const tokenId = await queryExternalIdInjective( - client, + client as any, tokenBridgeAddress, originAsset || "" ); @@ -580,7 +580,7 @@ function useFetchTargetAsset(nft?: boolean) { ALGORAND_HOST.algodPort ); const asset = await getForeignAssetAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, originChain, originAsset @@ -654,7 +654,7 @@ function useFetchTargetAsset(nft?: boolean) { const client = getInjectiveWasmClient(); const asset = await getForeignAssetInjective( getTokenBridgeAddressForChain(targetChain), - client, + client as any, originChain, hexToUint8Array(originAsset) ); diff --git a/src/hooks/useGetIsTransferCompleted.ts b/src/hooks/useGetIsTransferCompleted.ts index 0bebe96ba..da852e704 100644 --- a/src/hooks/useGetIsTransferCompleted.ts +++ b/src/hooks/useGetIsTransferCompleted.ts @@ -68,7 +68,7 @@ export default function useGetIsTransferCompleted( const targetChain = useSelector(selectTransferTargetChain); const { isReady } = useIsWalletReady(targetChain, false); - const { provider, evmChainId } = useEthereumProvider(targetChain); + const { provider, evmChainId } = useEthereumProvider(targetChain as any); const { accountId: nearAccountId } = useNearContext(); const signedVAA = useTransferSignedVAA(); @@ -215,7 +215,7 @@ export default function useGetIsTransferCompleted( ALGORAND_HOST.algodPort ); transferCompleted = await getIsTransferCompletedAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, signedVAA ); @@ -253,7 +253,7 @@ export default function useGetIsTransferCompleted( transferCompleted = await getIsTransferCompletedInjective( getTokenBridgeAddressForChain(targetChain), signedVAA, - client + client as any ); } catch (error) { console.error(error); diff --git a/src/hooks/useGetSourceParsedTokenAccounts.ts b/src/hooks/useGetSourceParsedTokenAccounts.ts index 6feb2f7b8..6f5f25159 100644 --- a/src/hooks/useGetSourceParsedTokenAccounts.ts +++ b/src/hooks/useGetSourceParsedTokenAccounts.ts @@ -1193,7 +1193,7 @@ function useGetAvailableTokens(nft: boolean = false) { nft ? selectNFTSourceChain : selectTransferSourceChain ); const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); - const { provider, signerAddress } = useEthereumProvider(lookupChain); + const { provider, signerAddress } = useEthereumProvider(lookupChain as any); const { address: algoAccount } = useAlgorandWallet(); const { accountId: nearAccountId } = useNearContext(); const { account: aptosAddress } = useAptosContext(); diff --git a/src/hooks/useGetTargetParsedTokenAccounts.ts b/src/hooks/useGetTargetParsedTokenAccounts.ts index 76a301d9b..499849eb1 100644 --- a/src/hooks/useGetTargetParsedTokenAccounts.ts +++ b/src/hooks/useGetTargetParsedTokenAccounts.ts @@ -80,9 +80,9 @@ function useGetTargetParsedTokenAccounts() { const decimals = (targetAsset && metadata.data?.get(targetAsset)?.decimals) || undefined; const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); - const terraWallet = useTerraWallet(targetChain); + const terraWallet = useTerraWallet(targetChain as any); const { provider, signerAddress, evmChainId } = - useEthereumProvider(targetChain); + useEthereumProvider(targetChain as any); const hasCorrectEvmNetwork = evmChainId === getEvmChainId(targetChain); const xplaWallet = useXplaWallet(); const { address: algoAccount } = useAlgorandWallet(); diff --git a/src/hooks/useHandleAttest.tsx b/src/hooks/useHandleAttest.tsx index 0c9bf4654..0aefdd799 100644 --- a/src/hooks/useHandleAttest.tsx +++ b/src/hooks/useHandleAttest.tsx @@ -131,7 +131,7 @@ async function algo( ALGORAND_HOST.algodPort ); const txs = await attestFromAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, ALGORAND_BRIDGE_ID, wallet.getAddress()!, @@ -669,10 +669,10 @@ export function useHandleAttest() { const isTargetComplete = useSelector(selectAttestIsTargetComplete); const isSending = useSelector(selectAttestIsSending); const isSendComplete = useSelector(selectAttestIsSendComplete); - const { signer } = useEthereumProvider(sourceChain); + const { signer } = useEthereumProvider(sourceChain as any); const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); const { walletAddress: terraAddress, wallet: terraWallet } = - useTerraWallet(sourceChain); + useTerraWallet(sourceChain as any); const terraFeeDenom = useSelector(selectTerraFeeDenom); const xplaWallet = useXplaWallet(); const { address: algoAccount, wallet: algoWallet } = useAlgorandWallet(); diff --git a/src/hooks/useHandleCreateWrapped.tsx b/src/hooks/useHandleCreateWrapped.tsx index 9dc08f236..df296cecf 100644 --- a/src/hooks/useHandleCreateWrapped.tsx +++ b/src/hooks/useHandleCreateWrapped.tsx @@ -177,7 +177,7 @@ async function algo( ALGORAND_HOST.algodPort ); const txs = await createWrappedOnAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, ALGORAND_BRIDGE_ID, wallet.getAddress()!, @@ -677,8 +677,8 @@ export function useHandleCreateWrapped( const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); const signedVAA = useAttestSignedVAA(); const isCreating = useSelector(selectAttestIsCreating); - const { signer } = useEthereumProvider(targetChain); - const terraWallet = useTerraWallet(targetChain); + const { signer } = useEthereumProvider(targetChain as any); + const terraWallet = useTerraWallet(targetChain as any); const terraFeeDenom = useSelector(selectTerraFeeDenom); const xplaWallet = useXplaWallet(); const { address: algoAccount, wallet: algoWallet } = useAlgorandWallet(); diff --git a/src/hooks/useHandleNFTRedeem.tsx b/src/hooks/useHandleNFTRedeem.tsx index e58611751..1508c0795 100644 --- a/src/hooks/useHandleNFTRedeem.tsx +++ b/src/hooks/useHandleNFTRedeem.tsx @@ -193,7 +193,7 @@ export function useHandleNFTRedeem() { const { enqueueSnackbar } = useSnackbar(); const targetChain = useSelector(selectNFTTargetChain); const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); - const { signer } = useEthereumProvider(targetChain); + const { signer } = useEthereumProvider(targetChain as any); const { account: aptosAccount, wallet: aptosWallet } = useAptosContext(); const signedVAA = useNFTSignedVAA(); const isRedeeming = useSelector(selectNFTIsRedeeming); diff --git a/src/hooks/useHandleNFTTransfer.tsx b/src/hooks/useHandleNFTTransfer.tsx index 65bbcf642..5f7ed8fe4 100644 --- a/src/hooks/useHandleNFTTransfer.tsx +++ b/src/hooks/useHandleNFTTransfer.tsx @@ -267,7 +267,7 @@ export function useHandleNFTTransfer() { const isTargetComplete = useSelector(selectNFTIsTargetComplete); const isSending = useSelector(selectNFTIsSending); const isSendComplete = useSelector(selectNFTIsSendComplete); - const { signer } = useEthereumProvider(sourceChain); + const { signer } = useEthereumProvider(sourceChain as any); const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); const { account: aptosAccount, wallet: aptosWallet } = useAptosContext(); const sourceParsedTokenAccount = useSelector( diff --git a/src/hooks/useHandleRedeem.tsx b/src/hooks/useHandleRedeem.tsx index 7b7215524..56add4335 100644 --- a/src/hooks/useHandleRedeem.tsx +++ b/src/hooks/useHandleRedeem.tsx @@ -114,7 +114,7 @@ async function algo( ALGORAND_HOST.algodPort ); const txs = await redeemOnAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, ALGORAND_BRIDGE_ID, signedVAA, @@ -559,8 +559,8 @@ export function useHandleRedeem() { const targetChain = useSelector(selectTransferTargetChain); const isTBTC = useSelector(selectTransferIsTBTC); const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet(); - const { signer } = useEthereumProvider(targetChain); - const { wallet: terraWallet } = useTerraWallet(targetChain); + const { signer } = useEthereumProvider(targetChain as any); + const { wallet: terraWallet } = useTerraWallet(targetChain as any); const terraFeeDenom = useSelector(selectTerraFeeDenom); const xplaWallet = useXplaWallet(); const { address: algoAccount, wallet: algoWallet } = useAlgorandWallet(); diff --git a/src/hooks/useHandleTransfer.tsx b/src/hooks/useHandleTransfer.tsx index 078ff7ab8..86a056da2 100644 --- a/src/hooks/useHandleTransfer.tsx +++ b/src/hooks/useHandleTransfer.tsx @@ -213,7 +213,7 @@ async function algo( ALGORAND_HOST.algodPort ); const txs = await transferFromAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, ALGORAND_BRIDGE_ID, wallet.getAddress()!, @@ -1026,9 +1026,9 @@ export function useHandleTransfer() { const isSending = useSelector(selectTransferIsSending); const isSendComplete = useSelector(selectTransferIsSendComplete); const isTBTC = useSelector(selectTransferIsTBTC); - const { signer } = useEthereumProvider(sourceChain); + const { signer } = useEthereumProvider(sourceChain as any); const { wallet: solanaWallet, publicKey: solPK } = useSolanaWallet(); - const { wallet: terraWallet } = useTerraWallet(sourceChain); + const { wallet: terraWallet } = useTerraWallet(sourceChain as any); const terraFeeDenom = useSelector(selectTerraFeeDenom); const xplaWallet = useXplaWallet(); const { address: algoAccount, wallet: algoWallet } = useAlgorandWallet(); diff --git a/src/hooks/useIsWalletReady.ts b/src/hooks/useIsWalletReady.ts index 48fe841c0..154774274 100644 --- a/src/hooks/useIsWalletReady.ts +++ b/src/hooks/useIsWalletReady.ts @@ -43,14 +43,14 @@ function useIsWalletReady( walletAddress?: string; } { const { publicKey: solPK } = useSolanaWallet(); - const terraWallet = useTerraWallet(chainId); + const terraWallet = useTerraWallet(chainId as any); const hasTerraWallet = !!terraWallet.wallet; const { provider, signerAddress, evmChainId, wallet: evmWallet, - } = useEthereumProvider(chainId); + } = useEthereumProvider(chainId as any); const hasEthInfo = !!provider && !!signerAddress; const correctEvmNetwork = getEvmChainId(chainId); const hasCorrectEvmNetwork = evmChainId === correctEvmNetwork; diff --git a/src/hooks/useOriginalAsset.ts b/src/hooks/useOriginalAsset.ts index 935ab086d..dd93729b9 100644 --- a/src/hooks/useOriginalAsset.ts +++ b/src/hooks/useOriginalAsset.ts @@ -110,7 +110,7 @@ export async function getOriginalAssetToken( ALGORAND_HOST.algodPort ); promise = await getOriginalAssetAlgorand( - algodClient, + algodClient as any, ALGORAND_TOKEN_BRIDGE_ID, BigInt(foreignNativeStringAddress) ); @@ -130,7 +130,7 @@ export async function getOriginalAssetToken( } else if (foreignChain === CHAIN_ID_INJECTIVE) { promise = await getOriginalAssetInjective( foreignNativeStringAddress, - getInjectiveWasmClient() + getInjectiveWasmClient() as any ); } else if (foreignChain === CHAIN_ID_SUI) { promise = await getOriginalAssetSui( @@ -229,7 +229,7 @@ function useOriginalAsset( nft: boolean, tokenId?: string ): DataWrapper { - const { provider } = useEthereumProvider(foreignChain); + const { provider } = useEthereumProvider(foreignChain as any); const { accountId: nearAccountId } = useNearContext(); const { isReady } = useIsWalletReady(foreignChain, false); const [originAddress, setOriginAddress] = useState(null); @@ -345,7 +345,7 @@ function useOriginalAsset( result.chainId ); queryExternalIdInjective( - client, + client as any, tokenBridgeAddress, uint8ArrayToHex(result.assetAddress) ).then((tokenId) => setOriginAddress(tokenId)); diff --git a/src/hooks/useSyncTargetAddress.ts b/src/hooks/useSyncTargetAddress.ts index 8d13cebdb..abf325500 100644 --- a/src/hooks/useSyncTargetAddress.ts +++ b/src/hooks/useSyncTargetAddress.ts @@ -52,7 +52,7 @@ function useSyncTargetAddress(shouldFire: boolean, nft?: boolean) { const targetChain = useSelector( nft ? selectNFTTargetChain : selectTransferTargetChain ); - const { signerAddress } = useEthereumProvider(targetChain); + const { signerAddress } = useEthereumProvider(targetChain as any); const { publicKey: solPK } = useSolanaWallet(); const targetAsset = useSelector( nft ? selectNFTTargetAsset : selectTransferTargetAsset @@ -61,7 +61,7 @@ function useSyncTargetAddress(shouldFire: boolean, nft?: boolean) { selectTransferTargetParsedTokenAccount ); const targetTokenAccountPublicKey = targetParsedTokenAccount?.publicKey; - const terraWallet = useTerraWallet(targetChain); + const terraWallet = useTerraWallet(targetChain as any); const xplaWallet = useXplaWallet(); const { address: algoAccount } = useAlgorandWallet(); const { account: aptosAddress } = useAptosContext(); diff --git a/src/hooks/useTransactionFees.tsx b/src/hooks/useTransactionFees.tsx index d802b4e89..3728abcf6 100644 --- a/src/hooks/useTransactionFees.tsx +++ b/src/hooks/useTransactionFees.tsx @@ -153,7 +153,7 @@ const toBalanceString = (balance: bigint | undefined, chainId: ChainId) => { export default function useTransactionFees(chainId: ChainId) { const { walletAddress, isReady } = useIsWalletReady(chainId); - const { provider } = useEthereumProvider(chainId); + const { provider } = useEthereumProvider(chainId as any); const [balance, setBalance] = useState(undefined); const [terraBalances, setTerraBalances] = useState([]); const [isLoading, setIsLoading] = useState(false); @@ -234,7 +234,7 @@ export default function useTransactionFees(chainId: ChainId) { } export function useEthereumGasPrice(contract: MethodType, chainId: ChainId) { - const { provider } = useEthereumProvider(chainId); + const { provider } = useEthereumProvider(chainId as any); const { isReady } = useIsWalletReady(chainId); const [estimateResults, setEstimateResults] = useState( null