Skip to content

Commit

Permalink
update inputValues api
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Oct 6, 2023
1 parent 6c31834 commit c1438d5
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/useContractCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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]
)

Expand Down

0 comments on commit c1438d5

Please sign in to comment.