@yeci226/hoyoapi
Version:
HoYoAPI is an unofficial API Wrapper library developed to facilitate communication with the official HoYoLab API.
24 lines (23 loc) • 1.12 kB
TypeScript
/**
* Encrypt passwords or accounts using HoyoVerse RSA public key.
*
* @param {string} text - The plain credentials text.
* @returns {string} The base64 encrypted text.
*/
export declare function encryptCredentials(text: string): string;
/**
* Generate DS header needed specifically for the loginByPassword API endpoint.
*
* @param {Record<string, any>} body - The JSON body payload of the request.
* @returns {string} The generated DS Header signature.
*/
export declare function generateAppLoginDS(body: Record<string, any>): string;
/**
* Builds a final Aigis header utilizing the result object returned from GEETEST completion.
*
* @param {string} sessionId A string split from the initial \`;\` separated x-rpc-aigis data payload.
* @param {any} mmtData The inner JSON payload associated with aigis.
* @param {any} geetestResult Usually contains geetest_challenge, geetest_validate, geetest_seccode strings.
* @returns {string} The raw string representing the verified x-rpc-aigis header.
*/
export declare function buildAigisHeader(sessionId: string, mmtData: any, geetestResult: any): string;