@zerochain/sdk
Version:
The Züs JS SDK is a JavaScript client library that provides a convenient interface for interacting with the Züs Network. It allows developers to perform various operations such as creating and managing allocations, uploading and downloading files, executi
50 lines (49 loc) • 1.79 kB
TypeScript
import { sleep } from '@/utils';
/**
* Signs a hash using BLS signature scheme.
*
* @param hash The hash to be signed.
* @returns The serialized signature in hexadecimal format.
*/
declare function blsSign(hash: string, secretKey: string): Promise<string>;
/**
* Verifies a BLS signature against a given hash.
*
* @param signature The serialized BLS signature.
* @param hash The hash to verify the signature against.
* @returns A boolean indicating whether the signature is valid or not.
*/
declare function blsVerify(signature: string, hash: string): Promise<boolean>;
/**
* Verifies a BLS signature against a given hash and public key.
*
* @param pk The public key.
* @param signature The serialized BLS signature.
* @param hash The hash to verify the signature against.
* @returns A boolean indicating whether the signature is valid or not.
*/
declare function blsVerifyWith(pk: string, signature: string, hash: string): Promise<boolean>;
/**
* Adds a signature to an existing signature.
*
* @param secretKey The secret key.
* @param signature The serialized BLS signature.
* @param hash The hash to verify the signature against.
*
* @returns The serialized signature in hexadecimal format.
*/
declare function blsAddSignature(secretKey: string, signature: string, hash: string): Promise<string>;
export declare function createObjectURL(buf: ArrayBuffer, mimeType: string): Promise<string>;
export declare const getJsProxy: () => {
secretKey: string | null;
publicKey: string | null;
} & JsProxyMethods;
export type JsProxyMethods = {
sign: typeof blsSign;
verify: typeof blsVerify;
verifyWith: typeof blsVerifyWith;
addSignature: typeof blsAddSignature;
createObjectURL: typeof createObjectURL;
sleep: typeof sleep;
};
export {};