Once the CID is calculated, you may finally use the CID to retrieve the full JSON metadata from IPFS (assuming someone has pinned the JSON file in IPFS).
If the smart contract was compiled using an old version of `solc` (before `v0.6.0`), then the metadata may only contain `bzzr0` or `bzzr1` keys. In this case, the tool is unable to fetch the metadata because there are no easily accessible public Swarm gateways, and it's unlikely the metadata is still hosted anyway.
+
+## TypeScript
+
+`index.d.ts` is generated from the [JSDoc](https://jsdoc.app/) comments in `index.js` using `tsc`:
+
+```
+tsc --declaration --emitDeclarationOnly --allowJs ./index.js
+```
--- /dev/null
+/**
+ * Wrapper around the `fetch` API to simplify making an `eth_getCode` JSON-RPC call.
+ * @param {string} address Hex address of the smart contract to retrieve the bytecode for (including `0x` prefix).
+ * @param {string} rpc URL for a node that supports the standard Ethereum JSON-RPC method `eth_getCode`.
+ * @returns {Promise<string|undefined>} `Promise` that will resolve to the `string` bytecode for the address, or `undefined` if the address is malformed.
+ * @throws {TypeError} Will throw an error if the RPC responds with an HTTP error.
+ */
+export function fetchBytecode(address: string, rpc: string): Promise<string | undefined>;
+/**
+ * Parse arbitrary EVM bytecode to extract the bytecode metadata from it.
+ * @param {string} bytecode Raw EVM bytecode in hex (including `0x` prefix).
+ * @param {'solidity'|'vyper'} [lang=solidity] Smart contract language used to compile this bytecode.
+ * @returns {Array<number>} Byte array of the CBOR-encoded bytecode metadata.
+ * @throws {TypeError} Will throw an error if the bytecode is malformed.
+ */
+export function extractCBOR(bytecode: string, lang?: 'solidity' | 'vyper'): Array<number>;
+/**
+ * Decode `solc`-encoded CBOR metadata. This is **not a full CBOR decoder**, it can only handle metadata from `solc`.
+ * @param {Array<number>} cbor Byte array of CBOR-encoded data.
+ * @returns {Object} `Object` representing the decoded CBOR data.
+ */
+export function decodeCBOR(cbor: Array<number>): any;
+/**
+ * Get IPFS CIDs for the JSON metadata file from decoded bytecode metadata.
+ * @param {Object} metadata Decoded bytecode metadata.
+ * @returns {Object} The `solc` compiler version and IPFS CIDs (both CIDv0 and CIDv1) of the JSON metadata.
+ */
+export function calculateCID(metadata: any): any;
+/**
+ * Wrapper around the `fetch` API to simplify querying an IPFS node for a CID.
+ * @param {string} cid An IPFS CID.
+ * @param {string} ipfs URL for an IPFS node.
+ * @returns {Promise<Response>} `Promise` that resolves to a `Response` object.
+ */
+export function fetchCID(cid: string, ipfs: string): Promise<Response>;