@nosana/kit 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ipfs/IPFS.d.ts +1 -1
- package/dist/ipfs/IPFS.js +5 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/ipfs/IPFS.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class IPFS {
|
|
|
9
9
|
* It prepends the 0x1220 (18,32) to make it 34 bytes and Base58 encodes it.
|
|
10
10
|
* This result is IPFS addressable.
|
|
11
11
|
*/
|
|
12
|
-
static solHashToIpfsHash(hashArray: ReadonlyUint8Array): string;
|
|
12
|
+
static solHashToIpfsHash(hashArray: ReadonlyUint8Array): string | null;
|
|
13
13
|
/**
|
|
14
14
|
* Converts IPFS hash to byte array needed to submit results
|
|
15
15
|
* @param hash IPFS hash
|
package/dist/ipfs/IPFS.js
CHANGED
|
@@ -22,7 +22,11 @@ export class IPFS {
|
|
|
22
22
|
// Use the array as-is if it's not 32 bytes
|
|
23
23
|
finalArray = new Uint8Array(hashArray);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
const hash = bs58.encode(Buffer.from(finalArray));
|
|
26
|
+
if (hash === 'QmNLei78zWmzUdbeRB3CiUfAizWUrbeeZh5K1rhAQKCh51') {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return hash;
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
32
|
* Converts IPFS hash to byte array needed to submit results
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type ConvertBigIntToNumber<T> = {
|
|
|
9
9
|
* Type helper to convert bigint to number and ReadonlyUint8Array to string
|
|
10
10
|
*/
|
|
11
11
|
export type ConvertTypesForDb<T> = {
|
|
12
|
-
[K in keyof T]: T[K] extends bigint ? number : T[K] extends ReadonlyUint8Array ? string : T[K];
|
|
12
|
+
[K in keyof T]: T[K] extends bigint ? number : T[K] extends ReadonlyUint8Array ? string | null : T[K];
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Helper function to convert bigint values to numbers in an object
|