From ba7307eff766d55a628d5124fce726de568e765f Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 6 Dec 2024 19:47:34 -0800 Subject: [PATCH] Fix incorrect parameter type --- index.d.ts | 8 ++++---- index.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8d1257c..43fbbe1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -12,7 +12,7 @@ export function fetchBytecode(address: string, rpc: string): Promise} 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; +export function extractCBOR(bytecode: string, lang?: "solidity" | "vyper"): Array; /** * Decode `solc`-encoded CBOR metadata. This is **not a full CBOR decoder**, it can only handle metadata from `solc`. * @param {Array} cbor Byte array of CBOR-encoded data. @@ -36,7 +36,7 @@ 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. + * @param {URL} ipfs URL for an IPFS node. * @returns {Promise} `Promise` that resolves to a `Response` object. */ -export function fetchCID(cid: string, ipfs: string): Promise; +export function fetchCID(cid: string, ipfs: URL): Promise; diff --git a/index.js b/index.js index 03ecd5b..3da587d 100644 --- a/index.js +++ b/index.js @@ -213,7 +213,7 @@ function calculateCID(metadata) { /** * 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. + * @param {URL} ipfs URL for an IPFS node. * @returns {Promise} `Promise` that resolves to a `Response` object. */ function fetchCID(cid, ipfs) { -- 2.47.3