export interface DeepLinkDataType { deepLinkUrl: string; } export interface PushNotiDataType { event: string; destination: string; data: string; } export type UserInfo = { avatar?: string; name?: string; }; export type Currency = 'vnd' | 'usd'; export interface MiniAppProps { language?: 'vi' | 'en'; deepLinkUrl?: string; walletId?: string; isCreateNewWallet?: boolean; userInfo?: UserInfo; currency?: Currency; isOnlyReady?: boolean; userId: string; } export type WalletDataType = { id: string; userId: string; name: string; icon: string; background: string; totalAmount: { vnd: string; usd: string; }; }; export declare enum SupportedNativeEvent { PUSH_EVENT = "ReadyWallet_FOREGROUND_PUSH_EVENT", DEEPLINK_EVENT = "ReadyWallet_FOREGROUND_DEEPLINK_EVENT" } export type CustomColorToken = { primary?: string; primaryOnPress?: string; link?: string; success?: string; warning?: string; error?: string; disable?: string; text?: string; label?: string; border?: string; borderLight?: string; background?: string; backgroundSecondary?: string; block?: string; }; export declare class ReadyWalletClass { private readonly AS_READY_PUSH_DATA_KEY; private readonly AS_READY_PUSH_TOKEN_KEY; private readonly AS_READY_COLOR_TOKEN; private readonly AS_READY_WALLET; private readonly READY_PUSH_ORIGIN; /** * Get data from mini wallet app push notifications saved from async-storage * @returns {Promise} A promise to array of data or null */ private getPushData; /** * Save data from mini wallet app push notifications saved to async-storage * @returns {Promise} The promise indicates whether the process was successful or not */ private savePushData; private clearPushData; private getDeviceToken; getColor(): Promise; getReadyWallets(userId: string): Promise; /** * When the mini app is being launched. * If it receives a push notification from the supper application, * it will send an event to the mini app to process the notification data. */ sendPushDataEvent(value: PushNotiDataType): Promise; /** * On Android devide * The wallet miniapp activity is run on difirrent taskAffinity with your main activity * Once mini wallet app is opended, your main activity will handle the wallet connect deep link to connect Dapps. * @note Android Supported Only */ sendDeeplinkDataEvent(value: DeepLinkDataType): Promise; /** * Set up miniapp Push notification service * @param token {string) A FCM token */ setDeviceToken(token: string): Promise; /** * Handle an push notification payload sent by Ready. * @param data FirebaseMessagingTypes.RemoteMessage.data Remote messages sent from Firebase or OSNotification.additionalData sent from OneSignal * @returns A Boolean value indicating this Push notification is from Ready * @note It checks the data attribute type of the message received from Server. Validate origin is "readyio" and have destination, data properties */ isReadyPush(data: { [key: string]: string | object; } | object | undefined): boolean; loadColor(color: CustomColorToken): Promise; /** * Present ReadyWallet as a modal overlay in your app. * @param initProps Init object pass to mini app. Includes app language and deep link url. * @note The mini app only supports English (en) and Vietnamese (vi) */ openApp(initProps?: MiniAppProps): Promise; /** * Close ReadyWallet mini app. */ closeApp(): any; } //# sourceMappingURL=ReadyWalletClass.d.ts.map