@uxuycom/web3-tg-sdk
Version:
web3 sdk for tg
44 lines (43 loc) • 1.46 kB
TypeScript
import { KeyPair, SessionCrypto } from '@tonconnect/protocol';
import { Storage } from '../utils/storage';
import EventEmitter from 'eventemitter3';
export declare class HttpBridge extends EventEmitter {
#private;
url: string;
ttl: number;
session: SessionCrypto;
storage: Storage;
eventSource?: EventSource;
lastEventId?: string;
targetClientId?: string;
eventNamePrefix: string;
constructor(options?: {
url?: string;
targetClientId?: string;
onError?: (error: any) => void;
onOpen?: () => void;
});
setSession(keyPair?: KeyPair): void;
get clientId(): string;
get requestId(): number;
get isListening(): boolean;
get lastEventIdKey(): string;
setBridgeUrl(url: string): void;
setLastEventId(lastEventId: string): void;
setTargetClientId(targetClientId: string): void;
sendMessage(id: string, message: unknown): Promise<import("axios").AxiosResponse<any, any>>;
getEventNameForId(name: string): string;
listen(options?: {
onError?: (error: any) => void;
onOpen?: () => void;
}): void;
on(event: string | symbol, listener: (...args: any[]) => void, options?: {
autoListen?: boolean;
}): this;
once(event: string | symbol, listener: (...args: any[]) => void, options?: {
autoListen?: boolean;
}): this;
close(): void;
reset(): void;
}
export declare const httpBridge: HttpBridge;