Merge branch 'master' into statusbar-updates

pull/4960/head
Joseph Izang 7 months ago committed by GitHub
commit e3788f8b21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/etherscan/src/app/utils/networks.ts
  2. 8
      apps/etherscan/src/app/views/CaptureKeyView.tsx

@ -18,6 +18,7 @@ export const scanAPIurls = {
59144: 'https://api.lineascan.build/api', 59144: 'https://api.lineascan.build/api',
8453: 'https://api.basescan.org/api', 8453: 'https://api.basescan.org/api',
534352: 'https://api.scrollscan.com/api', 534352: 'https://api.scrollscan.com/api',
1116: 'https://openapi.coredao.org/api',
// all testnet // all testnet
17000: 'https://api-holesky.etherscan.io/api', 17000: 'https://api-holesky.etherscan.io/api',
@ -39,4 +40,5 @@ export const scanAPIurls = {
1442: 'https://api-testnet-zkevm.polygonscan.com/api', 1442: 'https://api-testnet-zkevm.polygonscan.com/api',
59140: 'https://api-testnet.lineascan.build/api', 59140: 'https://api-testnet.lineascan.build/api',
534351: 'https://api-sepolia.scrollscan.com/api', 534351: 'https://api-sepolia.scrollscan.com/api',
1115: 'https://api.test.btcs.network/api',
} }

@ -13,7 +13,7 @@ export const CaptureKeyView = () => {
const context = React.useContext(AppContext) const context = React.useContext(AppContext)
useEffect(() => { useEffect(() => {
if (!context.apiKey) setMsg('Please provide a 34-character API key to continue') if (!context.apiKey) setMsg('Please provide a 34 or 32 character API key to continue')
}, [context.apiKey]) }, [context.apiKey])
return ( return (
@ -24,14 +24,14 @@ export const CaptureKeyView = () => {
const errors = {} as any const errors = {} as any
if (!values.apiKey) { if (!values.apiKey) {
errors.apiKey = 'Required' errors.apiKey = 'Required'
} else if (values.apiKey.length !== 34) { } else if (values.apiKey.length !== 34 && values.apiKey.length !== 32) {
errors.apiKey = 'API key should be 34 characters long' errors.apiKey = 'API key should be 34 or 32 characters long'
} }
return errors return errors
}} }}
onSubmit={(values) => { onSubmit={(values) => {
const apiKey = values.apiKey const apiKey = values.apiKey
if (apiKey.length === 34) { if (apiKey.length === 34 || apiKey.length === 32) {
context.setAPIKey(values.apiKey) context.setAPIKey(values.apiKey)
navigate(location && location.state ? location.state : '/') navigate(location && location.state ? location.state : '/')
} }

Loading…
Cancel
Save