MCPcopy Create free account
hub / github.com/subquery/subql / cidToBytes32

Function cidToBytes32

packages/cli/src/controller/network/constants.ts:119–127  ·  view source on GitHub ↗
(cid: string)

Source from the content-addressed store, hash-verified

117}
118
119export function cidToBytes32(cid: string): string {
120 let bytes: Uint8Array;
121 try {
122 bytes = base58Decode(cid);
123 } catch (e) {
124 throw new Error('Invalid CID: failed to decode base58 string', {cause: e});
125 }
126 return `0x${Buffer.from(bytes).subarray(2).toString('hex')}`;
127}
128
129export const projectMetadataSchema = z
130 .object({

Callers 4

listDeploymentBoostsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected