]> git.ardis.lu - solc-metadata/commitdiff
Fix incorrect parameter type
authorArdis Lu <ardisglu@gmail.com>
Sat, 7 Dec 2024 03:47:34 +0000 (19:47 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sat, 7 Dec 2024 03:47:34 +0000 (19:47 -0800)
index.d.ts
index.js

index 8d1257c0941d4bba925db6d7597657a6323f0a0e..43fbbe123b36024b6411aec588f245f498c037cd 100644 (file)
@@ -12,7 +12,7 @@ export function fetchBytecode(address: string, rpc: string): Promise<string | un
  * @param {string} bytecode Runtime bytecode of a smart contract.
  * @returns {'solidity'|'vyper'|'unknown'} The smart contract language used to generate this smart contract.
  */
-export function detectLanguage(bytecode: string): 'solidity' | 'vyper' | 'unknown';
+export function detectLanguage(bytecode: string): "solidity" | "vyper" | "unknown";
 /**
  * Parse arbitrary EVM bytecode to extract the bytecode metadata from it.
  * @param {string} bytecode Raw EVM bytecode in hex (including `0x` prefix).
@@ -20,7 +20,7 @@ export function detectLanguage(bytecode: string): 'solidity' | 'vyper' | 'unknow
  * @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>;
+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.
@@ -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<Response>} `Promise` that resolves to a `Response` object.
  */
-export function fetchCID(cid: string, ipfs: string): Promise<Response>;
+export function fetchCID(cid: string, ipfs: URL): Promise<Response>;
index 03ecd5bd49ba8104ef4d9df8aff806e07e6abe37..3da587d3b0daf21384eae9ea013b29234101ebb4 100644 (file)
--- 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<Response>} `Promise` that resolves to a `Response` object.
  */
 function fetchCID(cid, ipfs) {
This page took 0.046956 seconds and 4 git commands to generate.