@mxlabs/okxnotify
Version:
OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle
37 lines (36 loc) • 1.18 kB
TypeScript
/**
* OKX API 工具类
*/
export declare class OkxUtils {
static cleanParams(params?: Record<string, unknown>): Record<string, unknown>;
/**
* 构建完整的请求 URL
* @param requestPath API 路径
* @param params 请求参数
* @param method 请求方法
* @returns 完整的 URL 字符串
*/
static buildUrl(requestPath: string, params?: Record<string, unknown>): string;
/**
* 构建请求头
* @param method 请求方法
* @param requestPath API 路径
* @param params 请求参数
* @returns 请求头对象
*/
static buildHeaders(method: 'GET' | 'POST', requestPath: string, params: Record<string, unknown>): Record<string, string>;
/**
* 处理 API 请求
* @param method 请求方法
* @param requestPath API 路径
* @param params 请求参数
* @returns Promise<T>
*/
static request<T>(method: 'GET' | 'POST', requestPath: string, params?: Record<string, any>): Promise<T>;
/**
* 处理错误
* @param error 错误对象
* @param requestPath API 路径
*/
static handleError(error: unknown, requestPath: string): void;
}