MCPcopy Create free account
hub / github.com/MiloOweno/vector-mesh / parse

Function parse

packages/cli/src/plugins/etherscan.ts:80–87  ·  view source on GitHub ↗
({ response })

Source from the content-addressed store, hash-verified

78 name,
79 getCacheKey,
80 async parse({ response }) {
81 const json = await response.json()
82 const parsed = await GetAbiResponse.safeParseAsync(json)
83 if (!parsed.success)
84 throw fromZodError(parsed.error, { prefix: 'Invalid response' })
85 if (parsed.data.status === '0') throw new Error(parsed.data.result)
86 return parsed.data.result
87 },
88 async request(contract) {
89 if (!contract.address) throw new Error('address is required')
90

Callers

nothing calls this directly

Calls 1

fromZodErrorFunction · 0.85

Tested by

no test coverage detected