From c1438d5d9855079fcec2df754022d3736a6475ea Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Fri, 6 Oct 2023 10:54:02 +0200 Subject: [PATCH] update inputValues api --- src/useContractCall.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/useContractCall.ts b/src/useContractCall.ts index 105e603..ef248e0 100644 --- a/src/useContractCall.ts +++ b/src/useContractCall.ts @@ -19,7 +19,6 @@ import { NetworkId } from './safe' const EXPLORER_API_URLS = { '1': 'https://api.etherscan.io/api', - '4': 'https://api-rinkeby.etherscan.io/api', '5': 'https://api-goerli.etherscan.io/api', '100': 'https://blockscout.com/xdai/mainnet/api', '73799': 'https://volta-explorer.energyweb.org/api', @@ -219,17 +218,15 @@ export const useContractCall = ({ const inputs = useMemo( () => - (inputTypes || []) - .filter((inputType) => !!inputType.name) // don't render fields for unnamed inputs - .map((inputType) => ({ - name: inputType.name, - type: inputType.type, - baseType: inputType.baseType, - arrayChildren: inputType.arrayChildren, - arrayLength: inputType.arrayLength, - components: inputType.components, - value: inputValues[inputType.name], - })), + (inputTypes || []).map((inputType, index) => ({ + name: inputType.name, + type: inputType.type, + baseType: inputType.baseType, + arrayChildren: inputType.arrayChildren, + arrayLength: inputType.arrayLength, + components: inputType.components, + value: inputValues[index], + })), [inputTypes, inputValues] )