MCPcopy
hub / github.com/subquery/subql / ipfsCID_validate

Function ipfsCID_validate

packages/cli/src/controller/deploy-controller.ts:162–179  ·  view source on GitHub ↗
(
  cid: string | undefined,
  authToken: string,
  url: string
)

Source from the content-addressed store, hash-verified

160}
161
162export async function ipfsCID_validate(
163 cid: string | undefined,
164 authToken: string,
165 url: string
166): Promise<ValidateDataType> {
167 assert(cid, 'IPFS CID is required');
168 try {
169 const res = await getAxiosInstance(url, authToken).post<ValidateDataType>(`ipfs/deployment-id/${cid}/validate`);
170
171 if (res.status === 500) {
172 throw new Error((res.data as unknown as {message: string}).message);
173 }
174
175 return res.data;
176 } catch (e) {
177 throw errorHandle(e, 'Failed to validate IPFS CID:');
178 }
179}
180
181export async function imageVersions(name: string, version: string, authToken: string, url: string): Promise<string[]> {
182 try {

Calls 2

errorHandleFunction · 0.90
getAxiosInstanceFunction · 0.85

Tested by

no test coverage detected