(cid: string)
| 117 | } |
| 118 | |
| 119 | export 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 | |
| 129 | export const projectMetadataSchema = z |
| 130 | .object({ |
no outgoing calls
no test coverage detected