bitget-api
Version:
Complete Node.js & JavaScript SDK for Bitget V1-V3 REST APIs & WebSockets, with TypeScript & end-to-end tests.
16 lines (15 loc) • 674 B
TypeScript
export type SignEncodeMethod = 'hex' | 'base64';
export type SignAlgorithm = 'SHA-256' | 'SHA-512';
/**
* Similar to node crypto's `createHash()` function
*/
type KeyType = 'HMAC' | 'RSASSA-PKCS1-v1_5' | 'Ed25519';
export declare function getSignKeyType(secret: string): KeyType;
/**
* Sign a message, with a secret, using the Web Crypto API
*
* Ed25519 is stable as of v23.5.0, but also not available in all browsers
*/
export declare function signMessage(message: string, secret: string, method: SignEncodeMethod, algorithm: SignAlgorithm, _pemEncodeMethod?: SignEncodeMethod): Promise<string>;
export declare function checkWebCryptoAPISupported(): void;
export {};