@coinmeca/wallet-provider
Version:
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
57 lines • 2.44 kB
TypeScript
import React from "react";
export declare const encrypt: (data?: string, salt?: string) => string | undefined;
export declare const decrypt: (data?: string | null, salt?: string) => string | undefined;
export declare const format: (value?: any) => string | undefined;
export declare const parse: (value?: string) => any;
export interface StorageController {
get: (key: string) => any;
gets: (keys: string[]) => Record<string, any>;
getAll: () => Record<string, any>;
set: (key: string, value: any) => void;
sets: (map: string[][]) => void;
remove: (key: string) => void;
removes: (keys: string[]) => void;
clear: () => void;
}
export declare const loadStorage: (prefix: string, storage?: CloudStorage | Storage, isTelegram?: boolean, salt?: string) => StorageController;
export interface TelegramController {
telegram: Telegram["WebApp"] | undefined;
user: Telegram["WebApp"]["initDataUnsafe"]["user"] | undefined;
isInApp?: boolean;
isExpanded?: boolean;
isVerticalSwipe?: boolean;
isCloseConfirm?: boolean;
storage?: CloudStorage;
send: (text: string) => void | undefined;
enable: {
vertical: () => void | undefined;
closeConfirm: () => void | undefined;
};
disable: {
vertical: () => void | undefined;
closeConfirm: () => void | undefined;
};
bio: {
request: (reason?: string) => BiometricManager | undefined;
auth: (reason?: string) => BiometricManager | undefined;
};
show: {
alert: (message: string, callback?: () => void) => void | undefined;
confirm: (title: string, callback?: (ok: boolean) => void) => void | undefined;
popup: (popup: PopupParams, callback?: ((button_id: string) => void) | undefined) => void | undefined;
scanQR: (text: string, callback?: (data: string) => void) => void | undefined;
};
open: {
internal: (url: string, callback?: Function) => void;
external: (url: string, try_instant_view?: boolean, callback?: Function) => void;
};
expand: (callback?: Function) => void;
exit: (callback?: Function) => void;
}
export declare const loadTelegram: (telegram?: Telegram["WebApp"]) => TelegramController;
export declare const useTelegram: () => TelegramController;
export declare const TelegramProvider: React.FC<{
src?: string;
children?: React.ReactNode;
}>;
//# sourceMappingURL=telegram.d.ts.map