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

Function parse

packages/cli/src/plugins/blockExplorer.ts:86–93  ·  view source on GitHub ↗
({ response })

Source from the content-addressed store, hash-verified

84 return `${camelCase(name)}:${JSON.stringify(contract.address)}`
85 },
86 async parse({ response }) {
87 const json = await response.json()
88 const parsed = await BlockExplorerResponse.safeParseAsync(json)
89 if (!parsed.success)
90 throw fromZodError(parsed.error, { prefix: 'Invalid response' })
91 if (parsed.data.status === '0') throw new Error(parsed.data.result)
92 return parsed.data.result
93 },
94 request({ address }) {
95 if (!address) throw new Error('address is required')
96 return {

Callers

nothing calls this directly

Calls 1

fromZodErrorFunction · 0.85

Tested by

no test coverage detected