whales-pre-market-aptos-sdk
Version:
TypeScript SDK for Whales Pre-Market on Aptos blockchain
46 lines (45 loc) • 1.16 kB
TypeScript
export interface GraphQLConfig {
apiUrl: string;
authorizationKey?: string;
headers?: Record<string, string>;
}
export interface EventTableData {
block_height: string;
data: string;
epoch: string;
event_name: string;
timestamp: string;
version: string;
}
export interface GraphQLResponse<T> {
data: T;
errors?: any[];
}
export interface EventsQueryResponse {
event_table: EventTableData[];
}
export declare class GraphQLClient {
private client;
private config;
constructor(config: GraphQLConfig);
/**
* Execute a GraphQL query
*/
query<T = any>(query: string, variables?: Record<string, any>): Promise<GraphQLResponse<T>>;
/**
* Get events with pagination
*/
getEvents(version?: string, limit?: number): Promise<EventTableData[]>;
/**
* Get events with custom query
*/
getEventsWithCustomQuery(query: string, variables?: Record<string, any>): Promise<any>;
/**
* Update the configuration
*/
updateConfig(newConfig: Partial<GraphQLConfig>): void;
/**
* Get current configuration
*/
getConfig(): GraphQLConfig;
}