@elephant-xyz/cli
Version:
CLI tool for Elephant Network
38 lines • 1.14 kB
TypeScript
export declare class IPLDCanonicalizerService {
private baseCanonicalizer;
constructor();
/**
* Canonicalize JSON with IPLD-aware array sorting
* Arrays containing IPLD links (objects with "/" key) are sorted by CID value
*/
canonicalize(json: any): string;
/**
* Recursively sort arrays that contain IPLD links
*/
private sortIPLDArrays;
/**
* Check if an object is an IPLD link
*/
private isIPLDLink;
/**
* Extract CID from an IPLD link object or return null
*/
private extractCID;
/**
* Canonicalize and convert to Buffer
*/
canonicalizeToBuffer(json: any): Buffer;
/**
* Parse JSON string and canonicalize with IPLD sorting
*/
parseAndCanonicalize(jsonString: string): string;
/**
* Verify if a JSON string is already in canonical form with IPLD sorting
*/
isCanonical(jsonString: string): boolean;
/**
* Compare two JSON objects after canonicalization with IPLD sorting
*/
areEquivalent(json1: any, json2: any): boolean;
}
//# sourceMappingURL=ipld-canonicalizer.service.d.ts.map