react-native-monflowts 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/Monflowts.podspec +22 -0
- package/README.md +229 -2
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/monflowts/MonflowtsAssetsModule.kt +219 -0
- package/android/src/main/java/com/monflowts/MonflowtsCrashFeedModule.kt +175 -0
- package/android/src/main/java/com/monflowts/MonflowtsHapticModule.kt +170 -0
- package/android/src/main/java/com/monflowts/MonflowtsLottieView.kt +96 -0
- package/android/src/main/java/com/monflowts/MonflowtsLottieViewManager.kt +53 -0
- package/android/src/main/java/com/monflowts/MonflowtsPackage.kt +70 -0
- package/android/src/main/java/com/monflowts/MonflowtsSoundModule.kt +132 -0
- package/android/src/main/java/com/monflowts/MonflowtsSpeechModule.kt +81 -0
- package/android/src/main/java/com/monflowts/MonflowtsSvgView.kt +355 -0
- package/android/src/main/java/com/monflowts/MonflowtsSvgViewManager.kt +59 -0
- package/android/src/main/java/com/monflowts/MonflowtsWebView.kt +86 -0
- package/android/src/main/java/com/monflowts/MonflowtsWebViewManager.kt +33 -0
- package/android/src/main/java/com/monflowts/MonflowtsWheelView.kt +98 -0
- package/android/src/main/java/com/monflowts/MonflowtsWheelViewManager.kt +46 -0
- package/ios/Monflowts-Bridging-Header.h +5 -0
- package/ios/MonflowtsAssetsBridge.m +14 -0
- package/ios/MonflowtsAssetsModule.swift +217 -0
- package/ios/MonflowtsCrashFeedBridge.m +9 -0
- package/ios/MonflowtsCrashFeedModule.swift +88 -0
- package/ios/MonflowtsHTTP1EventSource.swift +296 -0
- package/ios/MonflowtsHapticBridge.m +8 -0
- package/ios/MonflowtsHapticModule.swift +55 -0
- package/ios/MonflowtsLottieBridge.m +12 -0
- package/ios/MonflowtsLottieUIView.swift +95 -0
- package/ios/MonflowtsLottieViewManager.swift +13 -0
- package/ios/MonflowtsSSEParser.swift +58 -0
- package/ios/MonflowtsSoundBridge.m +8 -0
- package/ios/MonflowtsSoundModule.swift +100 -0
- package/ios/MonflowtsSpeechBridge.m +9 -0
- package/ios/MonflowtsSpeechModule.swift +61 -0
- package/ios/MonflowtsSvgBridge.m +11 -0
- package/ios/MonflowtsSvgUIView.swift +431 -0
- package/ios/MonflowtsSvgViewManager.swift +13 -0
- package/ios/MonflowtsWebBridge.m +8 -0
- package/ios/MonflowtsWebUIView.swift +92 -0
- package/ios/MonflowtsWebViewManager.swift +14 -0
- package/ios/MonflowtsWheelBridge.m +7 -0
- package/ios/MonflowtsWheelUIView.swift +126 -0
- package/ios/MonflowtsWheelViewManager.swift +14 -0
- package/lib/module/HapticsManager.js +93 -0
- package/lib/module/HapticsManager.js.map +1 -0
- package/lib/module/HubContent.js +642 -0
- package/lib/module/HubContent.js.map +1 -0
- package/lib/module/Icons.js +64 -0
- package/lib/module/Icons.js.map +1 -0
- package/lib/module/MonflowtsHub.js +233 -0
- package/lib/module/MonflowtsHub.js.map +1 -0
- package/lib/module/NativeLottieView.js +6 -0
- package/lib/module/NativeLottieView.js.map +1 -0
- package/lib/module/NativeSvgView.js +6 -0
- package/lib/module/NativeSvgView.js.map +1 -0
- package/lib/module/NativeWebView.js +14 -0
- package/lib/module/NativeWebView.js.map +1 -0
- package/lib/module/NativeWheelView.js +6 -0
- package/lib/module/NativeWheelView.js.map +1 -0
- package/lib/module/SoundManager.js +120 -0
- package/lib/module/SoundManager.js.map +1 -0
- package/lib/module/SpeechManager.js +40 -0
- package/lib/module/SpeechManager.js.map +1 -0
- package/lib/module/api/client.js +109 -0
- package/lib/module/api/client.js.map +1 -0
- package/lib/module/api/gameTypes.js +2 -0
- package/lib/module/api/gameTypes.js.map +1 -0
- package/lib/module/api/http.js +252 -0
- package/lib/module/api/http.js.map +1 -0
- package/lib/module/api/mutations.js +359 -0
- package/lib/module/api/mutations.js.map +1 -0
- package/lib/module/api/playerTypes.js +2 -0
- package/lib/module/api/playerTypes.js.map +1 -0
- package/lib/module/api/queries.js +403 -0
- package/lib/module/api/queries.js.map +1 -0
- package/lib/module/api/sdkTypes.js +2 -0
- package/lib/module/api/sdkTypes.js.map +1 -0
- package/lib/module/assets/assetKeys.js +4 -0
- package/lib/module/assets/assetKeys.js.map +1 -0
- package/lib/module/assets/assetSync.js +61 -0
- package/lib/module/assets/assetSync.js.map +1 -0
- package/lib/module/assets/nativeAssets.js +25 -0
- package/lib/module/assets/nativeAssets.js.map +1 -0
- package/lib/module/assets/remote.js +47 -0
- package/lib/module/assets/remote.js.map +1 -0
- package/lib/module/components/AbandonPolicyNotice.js +200 -0
- package/lib/module/components/AbandonPolicyNotice.js.map +1 -0
- package/lib/module/components/AnimatedAmount.js +39 -0
- package/lib/module/components/AnimatedAmount.js.map +1 -0
- package/lib/module/components/CoinFlyOverlay.js +157 -0
- package/lib/module/components/CoinFlyOverlay.js.map +1 -0
- package/lib/module/components/GameCharacter.js +45 -0
- package/lib/module/components/GameCharacter.js.map +1 -0
- package/lib/module/components/GameRulesModal.js +279 -0
- package/lib/module/components/GameRulesModal.js.map +1 -0
- package/lib/module/components/HypeCallout.js +103 -0
- package/lib/module/components/HypeCallout.js.map +1 -0
- package/lib/module/components/InsufficientFundsOverlay.js +285 -0
- package/lib/module/components/InsufficientFundsOverlay.js.map +1 -0
- package/lib/module/components/JackpotNearMiss.js +89 -0
- package/lib/module/components/JackpotNearMiss.js.map +1 -0
- package/lib/module/components/JackpotTeaser.js +341 -0
- package/lib/module/components/JackpotTeaser.js.map +1 -0
- package/lib/module/components/MonflowtsButton.js +129 -0
- package/lib/module/components/MonflowtsButton.js.map +1 -0
- package/lib/module/components/MonflowtsChipGroup.js +40 -0
- package/lib/module/components/MonflowtsChipGroup.js.map +1 -0
- package/lib/module/components/MonflowtsPressable.js +42 -0
- package/lib/module/components/MonflowtsPressable.js.map +1 -0
- package/lib/module/components/QuitConfirmModal.js +180 -0
- package/lib/module/components/QuitConfirmModal.js.map +1 -0
- package/lib/module/components/SessionTimer.js +77 -0
- package/lib/module/components/SessionTimer.js.map +1 -0
- package/lib/module/components/SideDemoTab.js +110 -0
- package/lib/module/components/SideDemoTab.js.map +1 -0
- package/lib/module/components/StakeInput.js +138 -0
- package/lib/module/components/StakeInput.js.map +1 -0
- package/lib/module/constants.js +50 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/content.js +21 -0
- package/lib/module/content.js.map +1 -0
- package/lib/module/effects/EffectBurst.js +56 -0
- package/lib/module/effects/EffectBurst.js.map +1 -0
- package/lib/module/effects/beaverStates.js +11 -0
- package/lib/module/effects/beaverStates.js.map +1 -0
- package/lib/module/effects/hypePhrases.js +67 -0
- package/lib/module/effects/hypePhrases.js.map +1 -0
- package/lib/module/effects/particleAnims.js +17 -0
- package/lib/module/effects/particleAnims.js.map +1 -0
- package/lib/module/hooks/useAvailableGames.js +29 -0
- package/lib/module/hooks/useAvailableGames.js.map +1 -0
- package/lib/module/hooks/useCrash.js +137 -0
- package/lib/module/hooks/useCrash.js.map +1 -0
- package/lib/module/hooks/useCrashFeed.js +49 -0
- package/lib/module/hooks/useCrashFeed.js.map +1 -0
- package/lib/module/hooks/useCurrency.js +13 -0
- package/lib/module/hooks/useCurrency.js.map +1 -0
- package/lib/module/hooks/useFairSeed.js +55 -0
- package/lib/module/hooks/useFairSeed.js.map +1 -0
- package/lib/module/hooks/useGameEvents.js +186 -0
- package/lib/module/hooks/useGameEvents.js.map +1 -0
- package/lib/module/hooks/useGameHistory.js +55 -0
- package/lib/module/hooks/useGameHistory.js.map +1 -0
- package/lib/module/hooks/useLeaderboard.js +83 -0
- package/lib/module/hooks/useLeaderboard.js.map +1 -0
- package/lib/module/hooks/useMines.js +166 -0
- package/lib/module/hooks/useMines.js.map +1 -0
- package/lib/module/hooks/useNotifications.js +66 -0
- package/lib/module/hooks/useNotifications.js.map +1 -0
- package/lib/module/hooks/usePlayGame.js +408 -0
- package/lib/module/hooks/usePlayGame.js.map +1 -0
- package/lib/module/hooks/usePlinko.js +75 -0
- package/lib/module/hooks/usePlinko.js.map +1 -0
- package/lib/module/hooks/useRaffleDrawState.js +57 -0
- package/lib/module/hooks/useRaffleDrawState.js.map +1 -0
- package/lib/module/hooks/useRefreshWallet.js +24 -0
- package/lib/module/hooks/useRefreshWallet.js.map +1 -0
- package/lib/module/hooks/useResponsive.js +16 -0
- package/lib/module/hooks/useResponsive.js.map +1 -0
- package/lib/module/hooks/useRevealWin.js +120 -0
- package/lib/module/hooks/useRevealWin.js.map +1 -0
- package/lib/module/hooks/useScreenShake.js +32 -0
- package/lib/module/hooks/useScreenShake.js.map +1 -0
- package/lib/module/hooks/useWallet.js +77 -0
- package/lib/module/hooks/useWallet.js.map +1 -0
- package/lib/module/i18n.js +104 -0
- package/lib/module/i18n.js.map +1 -0
- package/lib/module/index.js +22 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lottieAnimations.js +15 -0
- package/lib/module/lottieAnimations.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/stores/assetStore.js +140 -0
- package/lib/module/stores/assetStore.js.map +1 -0
- package/lib/module/stores/authStore.js +47 -0
- package/lib/module/stores/authStore.js.map +1 -0
- package/lib/module/stores/gameStore.js +23 -0
- package/lib/module/stores/gameStore.js.map +1 -0
- package/lib/module/stores/sdkInitStore.js +155 -0
- package/lib/module/stores/sdkInitStore.js.map +1 -0
- package/lib/module/stores/settingsStore.js +40 -0
- package/lib/module/stores/settingsStore.js.map +1 -0
- package/lib/module/theme.js +160 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/apolloError.js +69 -0
- package/lib/module/utils/apolloError.js.map +1 -0
- package/lib/module/utils/crashMultiplier.js +8 -0
- package/lib/module/utils/crashMultiplier.js.map +1 -0
- package/lib/module/utils/crashMultiplier.test.js +34 -0
- package/lib/module/utils/crashMultiplier.test.js.map +1 -0
- package/lib/module/utils/deviceAnalytics.js +51 -0
- package/lib/module/utils/deviceAnalytics.js.map +1 -0
- package/lib/module/utils/idempotency.js +66 -0
- package/lib/module/utils/idempotency.js.map +1 -0
- package/lib/module/utils/layout.js +14 -0
- package/lib/module/utils/layout.js.map +1 -0
- package/lib/module/utils/safeInlineScript.js +12 -0
- package/lib/module/utils/safeInlineScript.js.map +1 -0
- package/lib/module/utils/sseClient.js +40 -0
- package/lib/module/utils/sseClient.js.map +1 -0
- package/lib/module/views/DepositSelect.js +275 -0
- package/lib/module/views/DepositSelect.js.map +1 -0
- package/lib/module/views/Dice.js +111 -0
- package/lib/module/views/Dice.js.map +1 -0
- package/lib/module/views/DiceBattle.js +815 -0
- package/lib/module/views/DiceBattle.js.map +1 -0
- package/lib/module/views/DiceLobby.js +577 -0
- package/lib/module/views/DiceLobby.js.map +1 -0
- package/lib/module/views/FortuneWheel.js +892 -0
- package/lib/module/views/FortuneWheel.js.map +1 -0
- package/lib/module/views/Freefall.js +808 -0
- package/lib/module/views/Freefall.js.map +1 -0
- package/lib/module/views/History.js +366 -0
- package/lib/module/views/History.js.map +1 -0
- package/lib/module/views/Home.js +554 -0
- package/lib/module/views/Home.js.map +1 -0
- package/lib/module/views/Jetstream.js +889 -0
- package/lib/module/views/Jetstream.js.map +1 -0
- package/lib/module/views/Leaderboard.js +1206 -0
- package/lib/module/views/Leaderboard.js.map +1 -0
- package/lib/module/views/MillionaireHunter.js +1697 -0
- package/lib/module/views/MillionaireHunter.js.map +1 -0
- package/lib/module/views/Minefield.js +826 -0
- package/lib/module/views/Minefield.js.map +1 -0
- package/lib/module/views/PaymentWebView.js +546 -0
- package/lib/module/views/PaymentWebView.js.map +1 -0
- package/lib/module/views/PlayerCard.js +184 -0
- package/lib/module/views/PlayerCard.js.map +1 -0
- package/lib/module/views/Profile.js +531 -0
- package/lib/module/views/Profile.js.map +1 -0
- package/lib/module/views/RaffleDraw.js +1242 -0
- package/lib/module/views/RaffleDraw.js.map +1 -0
- package/lib/module/views/RevealWin.js +1267 -0
- package/lib/module/views/RevealWin.js.map +1 -0
- package/lib/module/views/Splash.js +363 -0
- package/lib/module/views/Splash.js.map +1 -0
- package/lib/module/views/Success.js +363 -0
- package/lib/module/views/Success.js.map +1 -0
- package/lib/module/views/TicketShop.js +372 -0
- package/lib/module/views/TicketShop.js.map +1 -0
- package/lib/module/views/TriviaLobby.js +582 -0
- package/lib/module/views/TriviaLobby.js.map +1 -0
- package/lib/module/views/TriviaMaster.js +884 -0
- package/lib/module/views/TriviaMaster.js.map +1 -0
- package/lib/module/views/Wallet.js +622 -0
- package/lib/module/views/Wallet.js.map +1 -0
- package/lib/module/views/WithdrawFlow.js +445 -0
- package/lib/module/views/WithdrawFlow.js.map +1 -0
- package/lib/module/views/gridGeometry.js +26 -0
- package/lib/module/views/gridGeometry.js.map +1 -0
- package/lib/module/views/revealWinHelpers.js +29 -0
- package/lib/module/views/revealWinHelpers.js.map +1 -0
- package/lib/module/views/ticketBundlePresets.js +29 -0
- package/lib/module/views/ticketBundlePresets.js.map +1 -0
- package/lib/module/views/triviaHelpers.js +78 -0
- package/lib/module/views/triviaHelpers.js.map +1 -0
- package/lib/module/voiceClips.js +16 -0
- package/lib/module/voiceClips.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/HapticsManager.d.ts +28 -0
- package/lib/typescript/src/HapticsManager.d.ts.map +1 -0
- package/lib/typescript/src/HubContent.d.ts +7 -0
- package/lib/typescript/src/HubContent.d.ts.map +1 -0
- package/lib/typescript/src/Icons.d.ts +14 -0
- package/lib/typescript/src/Icons.d.ts.map +1 -0
- package/lib/typescript/src/MonflowtsHub.d.ts +5 -0
- package/lib/typescript/src/MonflowtsHub.d.ts.map +1 -0
- package/lib/typescript/src/NativeLottieView.d.ts +13 -0
- package/lib/typescript/src/NativeLottieView.d.ts.map +1 -0
- package/lib/typescript/src/NativeSvgView.d.ts +12 -0
- package/lib/typescript/src/NativeSvgView.d.ts.map +1 -0
- package/lib/typescript/src/NativeWebView.d.ts +22 -0
- package/lib/typescript/src/NativeWebView.d.ts.map +1 -0
- package/lib/typescript/src/NativeWheelView.d.ts +9 -0
- package/lib/typescript/src/NativeWheelView.d.ts.map +1 -0
- package/lib/typescript/src/SoundManager.d.ts +29 -0
- package/lib/typescript/src/SoundManager.d.ts.map +1 -0
- package/lib/typescript/src/SpeechManager.d.ts +10 -0
- package/lib/typescript/src/SpeechManager.d.ts.map +1 -0
- package/lib/typescript/src/api/client.d.ts +7 -0
- package/lib/typescript/src/api/client.d.ts.map +1 -0
- package/lib/typescript/src/api/gameTypes.d.ts +326 -0
- package/lib/typescript/src/api/gameTypes.d.ts.map +1 -0
- package/lib/typescript/src/api/http.d.ts +61 -0
- package/lib/typescript/src/api/http.d.ts.map +1 -0
- package/lib/typescript/src/api/mutations.d.ts +22 -0
- package/lib/typescript/src/api/mutations.d.ts.map +1 -0
- package/lib/typescript/src/api/playerTypes.d.ts +53 -0
- package/lib/typescript/src/api/playerTypes.d.ts.map +1 -0
- package/lib/typescript/src/api/queries.d.ts +21 -0
- package/lib/typescript/src/api/queries.d.ts.map +1 -0
- package/lib/typescript/src/api/sdkTypes.d.ts +87 -0
- package/lib/typescript/src/api/sdkTypes.d.ts.map +1 -0
- package/lib/typescript/src/assets/assetKeys.d.ts +3 -0
- package/lib/typescript/src/assets/assetKeys.d.ts.map +1 -0
- package/lib/typescript/src/assets/assetSync.d.ts +41 -0
- package/lib/typescript/src/assets/assetSync.d.ts.map +1 -0
- package/lib/typescript/src/assets/nativeAssets.d.ts +30 -0
- package/lib/typescript/src/assets/nativeAssets.d.ts.map +1 -0
- package/lib/typescript/src/assets/remote.d.ts +8 -0
- package/lib/typescript/src/assets/remote.d.ts.map +1 -0
- package/lib/typescript/src/components/AbandonPolicyNotice.d.ts +16 -0
- package/lib/typescript/src/components/AbandonPolicyNotice.d.ts.map +1 -0
- package/lib/typescript/src/components/AnimatedAmount.d.ts +12 -0
- package/lib/typescript/src/components/AnimatedAmount.d.ts.map +1 -0
- package/lib/typescript/src/components/CoinFlyOverlay.d.ts +17 -0
- package/lib/typescript/src/components/CoinFlyOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/GameCharacter.d.ts +14 -0
- package/lib/typescript/src/components/GameCharacter.d.ts.map +1 -0
- package/lib/typescript/src/components/GameRulesModal.d.ts +10 -0
- package/lib/typescript/src/components/GameRulesModal.d.ts.map +1 -0
- package/lib/typescript/src/components/HypeCallout.d.ts +11 -0
- package/lib/typescript/src/components/HypeCallout.d.ts.map +1 -0
- package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts +12 -0
- package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/JackpotNearMiss.d.ts +8 -0
- package/lib/typescript/src/components/JackpotNearMiss.d.ts.map +1 -0
- package/lib/typescript/src/components/JackpotTeaser.d.ts +13 -0
- package/lib/typescript/src/components/JackpotTeaser.d.ts.map +1 -0
- package/lib/typescript/src/components/MonflowtsButton.d.ts +21 -0
- package/lib/typescript/src/components/MonflowtsButton.d.ts.map +1 -0
- package/lib/typescript/src/components/MonflowtsChipGroup.d.ts +18 -0
- package/lib/typescript/src/components/MonflowtsChipGroup.d.ts.map +1 -0
- package/lib/typescript/src/components/MonflowtsPressable.d.ts +39 -0
- package/lib/typescript/src/components/MonflowtsPressable.d.ts.map +1 -0
- package/lib/typescript/src/components/QuitConfirmModal.d.ts +11 -0
- package/lib/typescript/src/components/QuitConfirmModal.d.ts.map +1 -0
- package/lib/typescript/src/components/SessionTimer.d.ts +14 -0
- package/lib/typescript/src/components/SessionTimer.d.ts.map +1 -0
- package/lib/typescript/src/components/SideDemoTab.d.ts +18 -0
- package/lib/typescript/src/components/SideDemoTab.d.ts.map +1 -0
- package/lib/typescript/src/components/StakeInput.d.ts +16 -0
- package/lib/typescript/src/components/StakeInput.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +21 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/content.d.ts +53 -0
- package/lib/typescript/src/content.d.ts.map +1 -0
- package/lib/typescript/src/effects/EffectBurst.d.ts +20 -0
- package/lib/typescript/src/effects/EffectBurst.d.ts.map +1 -0
- package/lib/typescript/src/effects/beaverStates.d.ts +4 -0
- package/lib/typescript/src/effects/beaverStates.d.ts.map +1 -0
- package/lib/typescript/src/effects/hypePhrases.d.ts +11 -0
- package/lib/typescript/src/effects/hypePhrases.d.ts.map +1 -0
- package/lib/typescript/src/effects/particleAnims.d.ts +9 -0
- package/lib/typescript/src/effects/particleAnims.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useAvailableGames.d.ts +14 -0
- package/lib/typescript/src/hooks/useAvailableGames.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCrash.d.ts +13 -0
- package/lib/typescript/src/hooks/useCrash.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCrashFeed.d.ts +22 -0
- package/lib/typescript/src/hooks/useCrashFeed.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCurrency.d.ts +6 -0
- package/lib/typescript/src/hooks/useCurrency.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useFairSeed.d.ts +8 -0
- package/lib/typescript/src/hooks/useFairSeed.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useGameEvents.d.ts +50 -0
- package/lib/typescript/src/hooks/useGameEvents.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useGameHistory.d.ts +14 -0
- package/lib/typescript/src/hooks/useGameHistory.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useLeaderboard.d.ts +71 -0
- package/lib/typescript/src/hooks/useLeaderboard.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useMines.d.ts +11 -0
- package/lib/typescript/src/hooks/useMines.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNotifications.d.ts +26 -0
- package/lib/typescript/src/hooks/useNotifications.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePlayGame.d.ts +62 -0
- package/lib/typescript/src/hooks/usePlayGame.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePlinko.d.ts +8 -0
- package/lib/typescript/src/hooks/usePlinko.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRaffleDrawState.d.ts +50 -0
- package/lib/typescript/src/hooks/useRaffleDrawState.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRefreshWallet.d.ts +8 -0
- package/lib/typescript/src/hooks/useRefreshWallet.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useResponsive.d.ts +8 -0
- package/lib/typescript/src/hooks/useResponsive.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRevealWin.d.ts +10 -0
- package/lib/typescript/src/hooks/useRevealWin.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useScreenShake.d.ts +14 -0
- package/lib/typescript/src/hooks/useScreenShake.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useWallet.d.ts +23 -0
- package/lib/typescript/src/hooks/useWallet.d.ts.map +1 -0
- package/lib/typescript/src/i18n.d.ts +29 -0
- package/lib/typescript/src/i18n.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +12 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/lottieAnimations.d.ts +2 -0
- package/lib/typescript/src/lottieAnimations.d.ts.map +1 -0
- package/lib/typescript/src/stores/assetStore.d.ts +17 -0
- package/lib/typescript/src/stores/assetStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/authStore.d.ts +25 -0
- package/lib/typescript/src/stores/authStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/gameStore.d.ts +14 -0
- package/lib/typescript/src/stores/gameStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/sdkInitStore.d.ts +38 -0
- package/lib/typescript/src/stores/sdkInitStore.d.ts.map +1 -0
- package/lib/typescript/src/stores/settingsStore.d.ts +23 -0
- package/lib/typescript/src/stores/settingsStore.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +149 -0
- package/lib/typescript/src/theme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +49 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/apolloError.d.ts +12 -0
- package/lib/typescript/src/utils/apolloError.d.ts.map +1 -0
- package/lib/typescript/src/utils/crashMultiplier.d.ts +2 -0
- package/lib/typescript/src/utils/crashMultiplier.d.ts.map +1 -0
- package/lib/typescript/src/utils/crashMultiplier.test.d.ts +2 -0
- package/lib/typescript/src/utils/crashMultiplier.test.d.ts.map +1 -0
- package/lib/typescript/src/utils/deviceAnalytics.d.ts +3 -0
- package/lib/typescript/src/utils/deviceAnalytics.d.ts.map +1 -0
- package/lib/typescript/src/utils/idempotency.d.ts +14 -0
- package/lib/typescript/src/utils/idempotency.d.ts.map +1 -0
- package/lib/typescript/src/utils/layout.d.ts +10 -0
- package/lib/typescript/src/utils/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/safeInlineScript.d.ts +5 -0
- package/lib/typescript/src/utils/safeInlineScript.d.ts.map +1 -0
- package/lib/typescript/src/utils/sseClient.d.ts +5 -0
- package/lib/typescript/src/utils/sseClient.d.ts.map +1 -0
- package/lib/typescript/src/views/DepositSelect.d.ts +9 -0
- package/lib/typescript/src/views/DepositSelect.d.ts.map +1 -0
- package/lib/typescript/src/views/Dice.d.ts +10 -0
- package/lib/typescript/src/views/Dice.d.ts.map +1 -0
- package/lib/typescript/src/views/DiceBattle.d.ts +15 -0
- package/lib/typescript/src/views/DiceBattle.d.ts.map +1 -0
- package/lib/typescript/src/views/DiceLobby.d.ts +12 -0
- package/lib/typescript/src/views/DiceLobby.d.ts.map +1 -0
- package/lib/typescript/src/views/FortuneWheel.d.ts +13 -0
- package/lib/typescript/src/views/FortuneWheel.d.ts.map +1 -0
- package/lib/typescript/src/views/Freefall.d.ts +13 -0
- package/lib/typescript/src/views/Freefall.d.ts.map +1 -0
- package/lib/typescript/src/views/History.d.ts +7 -0
- package/lib/typescript/src/views/History.d.ts.map +1 -0
- package/lib/typescript/src/views/Home.d.ts +13 -0
- package/lib/typescript/src/views/Home.d.ts.map +1 -0
- package/lib/typescript/src/views/Jetstream.d.ts +14 -0
- package/lib/typescript/src/views/Jetstream.d.ts.map +1 -0
- package/lib/typescript/src/views/Leaderboard.d.ts +8 -0
- package/lib/typescript/src/views/Leaderboard.d.ts.map +1 -0
- package/lib/typescript/src/views/MillionaireHunter.d.ts +13 -0
- package/lib/typescript/src/views/MillionaireHunter.d.ts.map +1 -0
- package/lib/typescript/src/views/Minefield.d.ts +13 -0
- package/lib/typescript/src/views/Minefield.d.ts.map +1 -0
- package/lib/typescript/src/views/PaymentWebView.d.ts +29 -0
- package/lib/typescript/src/views/PaymentWebView.d.ts.map +1 -0
- package/lib/typescript/src/views/PlayerCard.d.ts +15 -0
- package/lib/typescript/src/views/PlayerCard.d.ts.map +1 -0
- package/lib/typescript/src/views/Profile.d.ts +9 -0
- package/lib/typescript/src/views/Profile.d.ts.map +1 -0
- package/lib/typescript/src/views/RaffleDraw.d.ts +12 -0
- package/lib/typescript/src/views/RaffleDraw.d.ts.map +1 -0
- package/lib/typescript/src/views/RevealWin.d.ts +13 -0
- package/lib/typescript/src/views/RevealWin.d.ts.map +1 -0
- package/lib/typescript/src/views/Splash.d.ts +10 -0
- package/lib/typescript/src/views/Splash.d.ts.map +1 -0
- package/lib/typescript/src/views/Success.d.ts +12 -0
- package/lib/typescript/src/views/Success.d.ts.map +1 -0
- package/lib/typescript/src/views/TicketShop.d.ts +15 -0
- package/lib/typescript/src/views/TicketShop.d.ts.map +1 -0
- package/lib/typescript/src/views/TriviaLobby.d.ts +12 -0
- package/lib/typescript/src/views/TriviaLobby.d.ts.map +1 -0
- package/lib/typescript/src/views/TriviaMaster.d.ts +16 -0
- package/lib/typescript/src/views/TriviaMaster.d.ts.map +1 -0
- package/lib/typescript/src/views/Wallet.d.ts +10 -0
- package/lib/typescript/src/views/Wallet.d.ts.map +1 -0
- package/lib/typescript/src/views/WithdrawFlow.d.ts +9 -0
- package/lib/typescript/src/views/WithdrawFlow.d.ts.map +1 -0
- package/lib/typescript/src/views/gridGeometry.d.ts +19 -0
- package/lib/typescript/src/views/gridGeometry.d.ts.map +1 -0
- package/lib/typescript/src/views/revealWinHelpers.d.ts +15 -0
- package/lib/typescript/src/views/revealWinHelpers.d.ts.map +1 -0
- package/lib/typescript/src/views/ticketBundlePresets.d.ts +18 -0
- package/lib/typescript/src/views/ticketBundlePresets.d.ts.map +1 -0
- package/lib/typescript/src/views/triviaHelpers.d.ts +31 -0
- package/lib/typescript/src/views/triviaHelpers.d.ts.map +1 -0
- package/lib/typescript/src/voiceClips.d.ts +4 -0
- package/lib/typescript/src/voiceClips.d.ts.map +1 -0
- package/package.json +160 -4
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
4
|
+
import { View, Text, StyleSheet, StatusBar, Alert, BackHandler } from 'react-native';
|
|
5
|
+
const ReactActivity = React.Activity;
|
|
6
|
+
import { useMutation, useApolloClient } from '@apollo/client/react';
|
|
7
|
+
import { INITIALIZE_DEPOSIT, COMPLETE_DEPOSIT } from "./api/mutations.js";
|
|
8
|
+
import { useAuthStore } from "./stores/authStore.js";
|
|
9
|
+
import { errorText, t, useTranslation } from "./i18n.js";
|
|
10
|
+
import { useGameStore } from "./stores/gameStore.js";
|
|
11
|
+
import { useSettingsStore } from "./stores/settingsStore.js";
|
|
12
|
+
import { useWallet } from "./hooks/useWallet.js";
|
|
13
|
+
import { useAvailableGames } from "./hooks/useAvailableGames.js";
|
|
14
|
+
import { COLORS } from "./constants.js";
|
|
15
|
+
import { walletContent } from "./content.js";
|
|
16
|
+
import SvgIcon from "./Icons.js";
|
|
17
|
+
import JackpotTeaser from "./components/JackpotTeaser.js";
|
|
18
|
+
import MonflowtsPressable from "./components/MonflowtsPressable.js";
|
|
19
|
+
import { sounds } from "./SoundManager.js";
|
|
20
|
+
import { speech } from "./SpeechManager.js";
|
|
21
|
+
import { PLAYER_SOUND_ENABLED } from "./api/queries.js";
|
|
22
|
+
import { haptics } from "./HapticsManager.js";
|
|
23
|
+
import { getApolloErrorMessage } from "./utils/apolloError.js";
|
|
24
|
+
import { GAME_EVENTS, useGameEvents } from "./hooks/useGameEvents.js";
|
|
25
|
+
import { useResponsive } from "./hooks/useResponsive.js";
|
|
26
|
+
import { COLUMN_MAX_WIDTH } from "./utils/layout.js";
|
|
27
|
+
|
|
28
|
+
// Views
|
|
29
|
+
import Home from "./views/Home.js";
|
|
30
|
+
import Wallet from "./views/Wallet.js";
|
|
31
|
+
import History from "./views/History.js";
|
|
32
|
+
import Profile from "./views/Profile.js";
|
|
33
|
+
import Success from "./views/Success.js";
|
|
34
|
+
import DiceLobby from "./views/DiceLobby.js";
|
|
35
|
+
import DiceBattle from "./views/DiceBattle.js";
|
|
36
|
+
import FortuneWheel from "./views/FortuneWheel.js";
|
|
37
|
+
import TicketShop from "./views/TicketShop.js";
|
|
38
|
+
import MillionaireHunter from "./views/MillionaireHunter.js";
|
|
39
|
+
import RevealWin from "./views/RevealWin.js";
|
|
40
|
+
import Freefall from "./views/Freefall.js";
|
|
41
|
+
import Minefield from "./views/Minefield.js";
|
|
42
|
+
import Jetstream from "./views/Jetstream.js";
|
|
43
|
+
import RaffleDraw from "./views/RaffleDraw.js";
|
|
44
|
+
import Leaderboard from "./views/Leaderboard.js";
|
|
45
|
+
import TriviaLobby from "./views/TriviaLobby.js";
|
|
46
|
+
import TriviaMaster from "./views/TriviaMaster.js";
|
|
47
|
+
import DepositSelect from "./views/DepositSelect.js";
|
|
48
|
+
import PaymentWebView from "./views/PaymentWebView.js";
|
|
49
|
+
import WithdrawFlow from "./views/WithdrawFlow.js";
|
|
50
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
51
|
+
const TAB_SCREENS = ['HOME', 'WALLET', 'HISTORY', 'PROFILE'];
|
|
52
|
+
const TAB_ICONS = {
|
|
53
|
+
HOME: 'gamepad',
|
|
54
|
+
WALLET: 'diamond',
|
|
55
|
+
HISTORY: 'clipboard',
|
|
56
|
+
PROFILE: 'user'
|
|
57
|
+
};
|
|
58
|
+
const TAB_LABEL_KEYS = {
|
|
59
|
+
HOME: 'nav.games',
|
|
60
|
+
WALLET: 'nav.wallet',
|
|
61
|
+
HISTORY: 'nav.history',
|
|
62
|
+
PROFILE: 'nav.profile'
|
|
63
|
+
};
|
|
64
|
+
const TAB_BAR_MAX_WIDTH = 560;
|
|
65
|
+
const SCREEN_BACKDROPS = {
|
|
66
|
+
DICE_LOBBY: '#120a1d',
|
|
67
|
+
RAFFLE_DRAW: '#0a061a',
|
|
68
|
+
SUCCESS: '#0d0a1a',
|
|
69
|
+
TRIVIA_LOBBY: '#0a0612'
|
|
70
|
+
};
|
|
71
|
+
const GAME_REPLAY_SCREENS = {
|
|
72
|
+
'Dice Battle': 'DICE_LOBBY',
|
|
73
|
+
'Fortune Wheel': 'FORTUNE_WHEEL',
|
|
74
|
+
'Millionaire Hunter': 'MILLIONAIRE_HUNTER',
|
|
75
|
+
'Trivia Master': 'TRIVIA_LOBBY',
|
|
76
|
+
'Reveal & Win': 'REVEAL_WIN',
|
|
77
|
+
Freefall: 'FREEFALL',
|
|
78
|
+
Minefield: 'MINEFIELD',
|
|
79
|
+
Jetstream: 'JETSTREAM'
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// ── Map game codes to navigation screens ──
|
|
83
|
+
const GAME_CODE_TO_SCREEN = {
|
|
84
|
+
DICE_ROLL: 'DICE_LOBBY',
|
|
85
|
+
SPIN_WHEEL: 'FORTUNE_WHEEL',
|
|
86
|
+
MILLIONAIRE_HUNTER: 'MILLIONAIRE_HUNTER',
|
|
87
|
+
FAST_FINGER: 'TRIVIA_LOBBY',
|
|
88
|
+
RAFFLE_DRAW: 'RAFFLE_DRAW',
|
|
89
|
+
REVEAL_WIN: 'REVEAL_WIN',
|
|
90
|
+
PLINKO: 'FREEFALL',
|
|
91
|
+
MINES: 'MINEFIELD',
|
|
92
|
+
CRASH: 'JETSTREAM'
|
|
93
|
+
};
|
|
94
|
+
const PAYMENT_PROVIDERS = new Set(['NETAPPS_PAY', 'PAYSTACK', 'FLUTTERWAVE', 'MONNIFY']);
|
|
95
|
+
const HubContent = ({
|
|
96
|
+
config
|
|
97
|
+
}) => {
|
|
98
|
+
const [currentScreen, setCurrentScreen] = useState('HOME');
|
|
99
|
+
const {
|
|
100
|
+
width,
|
|
101
|
+
isWide
|
|
102
|
+
} = useResponsive();
|
|
103
|
+
const [diceStake, setDiceStake] = useState(500);
|
|
104
|
+
const [diceStakeCount, setDiceStakeCount] = useState(1);
|
|
105
|
+
const [triviaStake, setTriviaStake] = useState(250);
|
|
106
|
+
const [triviaStakeCount, setTriviaStakeCount] = useState(1);
|
|
107
|
+
const [triviaCategoryId, setTriviaCategoryId] = useState(undefined);
|
|
108
|
+
const [depositAmountKobo, setDepositAmountKobo] = useState(0);
|
|
109
|
+
const [depositTransactionId, setDepositTransactionId] = useState('');
|
|
110
|
+
const [depositPublicKey, setDepositPublicKey] = useState('');
|
|
111
|
+
const [depositPaymentChannels, setDepositPaymentChannels] = useState(['card', 'transfer', 'ussd']);
|
|
112
|
+
const [depositProvider, setDepositProvider] = useState('NETAPPS_PAY');
|
|
113
|
+
const [successData, setSuccessData] = useState(null);
|
|
114
|
+
const [lastGameName, setLastGameName] = useState(null);
|
|
115
|
+
const [teaserGame, setTeaserGame] = useState(null);
|
|
116
|
+
const demoMode = useGameStore(s => s.demoMode);
|
|
117
|
+
const demoBalance = useGameStore(s => s.demoBalance);
|
|
118
|
+
const creditDemoBalance = useGameStore(s => s.creditDemoBalance);
|
|
119
|
+
const apolloClient = useApolloClient();
|
|
120
|
+
const {
|
|
121
|
+
isRTL
|
|
122
|
+
} = useTranslation();
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
let cancelled = false;
|
|
125
|
+
let attempt = 0;
|
|
126
|
+
const fetchSoundFlag = () => {
|
|
127
|
+
apolloClient.query({
|
|
128
|
+
query: PLAYER_SOUND_ENABLED,
|
|
129
|
+
fetchPolicy: 'network-only'
|
|
130
|
+
}).then(({
|
|
131
|
+
data
|
|
132
|
+
}) => {
|
|
133
|
+
if (!cancelled) useSettingsStore.getState().setAdminSoundEnabled(data?.playerSoundEnabled === true);
|
|
134
|
+
}).catch(() => {
|
|
135
|
+
if (!cancelled && attempt < 5) {
|
|
136
|
+
attempt += 1;
|
|
137
|
+
setTimeout(fetchSoundFlag, 1500 * attempt);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
fetchSoundFlag();
|
|
142
|
+
return () => {
|
|
143
|
+
cancelled = true;
|
|
144
|
+
};
|
|
145
|
+
}, [apolloClient]);
|
|
146
|
+
|
|
147
|
+
// Mirror SDK-level sound flag onto the singleton so every
|
|
148
|
+
// MonflowtsPressable in the tree picks it up without prop drilling.
|
|
149
|
+
const adminSoundEnabled = useSettingsStore(s => s.adminSoundEnabled);
|
|
150
|
+
const soundEnabled = useSettingsStore(s => s.soundEnabled);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
const muted = config.disableSound === true || !adminSoundEnabled || !soundEnabled;
|
|
153
|
+
sounds.setMute(muted);
|
|
154
|
+
speech.setMute(muted);
|
|
155
|
+
}, [config.disableSound, adminSoundEnabled, soundEnabled]);
|
|
156
|
+
|
|
157
|
+
// Seed the haptics preference from the SDK config exactly once.
|
|
158
|
+
// After that, the user's in-app toggle (Profile → Settings) is the
|
|
159
|
+
// source of truth and the host app's `enableHaptic` is ignored.
|
|
160
|
+
const hapticsSeeded = useRef(false);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (hapticsSeeded.current) return;
|
|
163
|
+
hapticsSeeded.current = true;
|
|
164
|
+
if (typeof config.enableHaptic === 'boolean') {
|
|
165
|
+
useSettingsStore.getState().setHapticsEnabled(config.enableHaptic);
|
|
166
|
+
}
|
|
167
|
+
}, [config.enableHaptic]);
|
|
168
|
+
|
|
169
|
+
// Subscribe to the user preference and mirror it onto the haptics
|
|
170
|
+
// singleton so every press across the SDK respects the toggle.
|
|
171
|
+
const hapticsEnabled = useSettingsStore(s => s.hapticsEnabled);
|
|
172
|
+
useEffect(() => {
|
|
173
|
+
haptics.setMute(!hapticsEnabled);
|
|
174
|
+
}, [hapticsEnabled]);
|
|
175
|
+
|
|
176
|
+
// ── Server data ──
|
|
177
|
+
const {
|
|
178
|
+
wallet,
|
|
179
|
+
refetchWallet
|
|
180
|
+
} = useWallet();
|
|
181
|
+
const {
|
|
182
|
+
availableGames
|
|
183
|
+
} = useAvailableGames();
|
|
184
|
+
const {
|
|
185
|
+
onEvent: onGameEvent
|
|
186
|
+
} = useGameEvents({
|
|
187
|
+
gameServerUrl: config.realtimeUrl,
|
|
188
|
+
autoConnect: Boolean(config.realtimeUrl)
|
|
189
|
+
});
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
if (!config.realtimeUrl) return;
|
|
192
|
+
return onGameEvent(GAME_EVENTS.WALLET_UPDATED, () => {
|
|
193
|
+
void refetchWallet();
|
|
194
|
+
});
|
|
195
|
+
}, [config.realtimeUrl, onGameEvent, refetchWallet]);
|
|
196
|
+
const realBalance = wallet ? Math.round(wallet.balanceKobo / 100) : 0;
|
|
197
|
+
const balance = demoMode ? demoBalance : realBalance;
|
|
198
|
+
|
|
199
|
+
// ── Mutations ──
|
|
200
|
+
const [initializeDepositMutation, {
|
|
201
|
+
loading: initDepositLoading
|
|
202
|
+
}] = useMutation(INITIALIZE_DEPOSIT);
|
|
203
|
+
const [completeDepositMutation] = useMutation(COMPLETE_DEPOSIT);
|
|
204
|
+
|
|
205
|
+
// ── Android hardware back: exit from HOME ──
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
const onHardwareBack = () => {
|
|
208
|
+
if (currentScreen === 'HOME') {
|
|
209
|
+
config.onExit?.();
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
};
|
|
214
|
+
const sub = BackHandler.addEventListener('hardwareBackPress', onHardwareBack);
|
|
215
|
+
return () => sub.remove();
|
|
216
|
+
}, [currentScreen, config]);
|
|
217
|
+
const findGame = useCallback(code => {
|
|
218
|
+
return availableGames.find(g => g.gameCode === code);
|
|
219
|
+
}, [availableGames]);
|
|
220
|
+
const navigateToGame = useCallback(code => {
|
|
221
|
+
const game = findGame(code);
|
|
222
|
+
const screen = GAME_CODE_TO_SCREEN[code];
|
|
223
|
+
if (screen) {
|
|
224
|
+
// Show jackpot teaser if the game has a jackpot amount
|
|
225
|
+
const jackpot = game?.gameplayRules?.jackpotAmountKobo;
|
|
226
|
+
if (jackpot && jackpot > 0) {
|
|
227
|
+
setTeaserGame(game);
|
|
228
|
+
}
|
|
229
|
+
setCurrentScreen(screen);
|
|
230
|
+
}
|
|
231
|
+
}, [findGame]);
|
|
232
|
+
const teaserVisible = !!teaserGame && GAME_CODE_TO_SCREEN[teaserGame.gameCode] === currentScreen;
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
if (teaserGame && !teaserVisible) setTeaserGame(null);
|
|
235
|
+
}, [teaserGame, teaserVisible]);
|
|
236
|
+
const demoWinStreakRef = useRef(0);
|
|
237
|
+
const handleWin = useCallback((game, amount) => {
|
|
238
|
+
if (demoMode) {
|
|
239
|
+
creditDemoBalance(amount);
|
|
240
|
+
demoWinStreakRef.current += 1;
|
|
241
|
+
if (demoWinStreakRef.current % 3 !== 0) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
refetchWallet();
|
|
246
|
+
}
|
|
247
|
+
setSuccessData({
|
|
248
|
+
type: 'MONEY',
|
|
249
|
+
amount
|
|
250
|
+
});
|
|
251
|
+
setLastGameName(game);
|
|
252
|
+
setCurrentScreen('SUCCESS');
|
|
253
|
+
}, [refetchWallet, demoMode, creditDemoBalance]);
|
|
254
|
+
const handleGameEnd = useCallback(() => {
|
|
255
|
+
if (!demoMode) refetchWallet();
|
|
256
|
+
}, [refetchWallet, demoMode]);
|
|
257
|
+
const handleDeposit = useCallback(() => {
|
|
258
|
+
setCurrentScreen('DEPOSIT_SELECT');
|
|
259
|
+
}, []);
|
|
260
|
+
const handleDepositProceed = useCallback(async amountKobo => {
|
|
261
|
+
completingDepositRef.current = false;
|
|
262
|
+
try {
|
|
263
|
+
const {
|
|
264
|
+
data
|
|
265
|
+
} = await initializeDepositMutation({
|
|
266
|
+
variables: {
|
|
267
|
+
input: {
|
|
268
|
+
amountKobo
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
const result = data?.initializeDeposit;
|
|
273
|
+
const provider = typeof result?.provider === 'string' ? result.provider.toUpperCase() : 'NETAPPS_PAY';
|
|
274
|
+
const channels = Array.isArray(result?.paymentChannels) ? result.paymentChannels.filter(channel => typeof channel === 'string' && /^[a-z0-9_-]{1,32}$/i.test(channel)).slice(0, 10) : [];
|
|
275
|
+
if (typeof result?.transactionId !== 'string' || !/^[a-f\d]{24}$/i.test(result.transactionId) || typeof result?.publicKey !== 'string' || !result.publicKey.trim() || result.publicKey.length > 512 || !Number.isSafeInteger(result.amountKobo) || result.amountKobo !== amountKobo || !PAYMENT_PROVIDERS.has(provider)) {
|
|
276
|
+
Alert.alert(t('hub.paymentUnavailable'), t('hub.tryAgainLater'));
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
setDepositAmountKobo(result.amountKobo);
|
|
280
|
+
setDepositTransactionId(result.transactionId);
|
|
281
|
+
setDepositPublicKey(result.publicKey);
|
|
282
|
+
setDepositPaymentChannels(channels.length > 0 ? channels : ['card', 'transfer', 'ussd']);
|
|
283
|
+
setDepositProvider(provider);
|
|
284
|
+
setCurrentScreen('PAYMENT');
|
|
285
|
+
} catch (err) {
|
|
286
|
+
Alert.alert(t('hub.paymentError'), errorText(err, 'hub.paymentInitFailed'));
|
|
287
|
+
}
|
|
288
|
+
}, [initializeDepositMutation]);
|
|
289
|
+
const completingDepositRef = useRef(false);
|
|
290
|
+
const handlePaymentSuccess = useCallback(async gatewayRef => {
|
|
291
|
+
if (completingDepositRef.current) return;
|
|
292
|
+
completingDepositRef.current = true;
|
|
293
|
+
try {
|
|
294
|
+
const {
|
|
295
|
+
data
|
|
296
|
+
} = await completeDepositMutation({
|
|
297
|
+
variables: {
|
|
298
|
+
input: {
|
|
299
|
+
transactionId: depositTransactionId,
|
|
300
|
+
gatewayRef
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
const result = data?.completeDeposit;
|
|
305
|
+
if (result?.wallet) {
|
|
306
|
+
useAuthStore.getState().updateWallet(result.wallet);
|
|
307
|
+
}
|
|
308
|
+
refetchWallet();
|
|
309
|
+
setSuccessData({
|
|
310
|
+
type: 'DEPOSIT',
|
|
311
|
+
amount: (result?.amountKobo ?? depositAmountKobo) / 100
|
|
312
|
+
});
|
|
313
|
+
setLastGameName(null);
|
|
314
|
+
setCurrentScreen('SUCCESS');
|
|
315
|
+
} catch (err) {
|
|
316
|
+
completingDepositRef.current = false;
|
|
317
|
+
const message = getApolloErrorMessage(err);
|
|
318
|
+
const pending = /being processed|credited shortly|being retried/i.test(message);
|
|
319
|
+
Alert.alert(pending ? t('hub.depositPending') : t('hub.depositFailed'), errorText(err, pending ? 'hub.depositPendingMessage' : 'hub.paymentVerifyFailed'));
|
|
320
|
+
setCurrentScreen('WALLET');
|
|
321
|
+
}
|
|
322
|
+
}, [completeDepositMutation, refetchWallet, depositAmountKobo, depositTransactionId]);
|
|
323
|
+
const handlePaymentFailed = useCallback(message => {
|
|
324
|
+
Alert.alert(t('hub.paymentFailed'), message);
|
|
325
|
+
setCurrentScreen('WALLET');
|
|
326
|
+
}, []);
|
|
327
|
+
const handlePaymentClose = useCallback(() => {
|
|
328
|
+
setCurrentScreen('WALLET');
|
|
329
|
+
}, []);
|
|
330
|
+
const handleWithdraw = useCallback(() => {
|
|
331
|
+
setCurrentScreen('WITHDRAW');
|
|
332
|
+
}, []);
|
|
333
|
+
const showBottomNav = TAB_SCREENS.includes(currentScreen);
|
|
334
|
+
const homeScreen = /*#__PURE__*/_jsx(Home, {
|
|
335
|
+
onNavigate: setCurrentScreen,
|
|
336
|
+
balance: balance,
|
|
337
|
+
availableGames: availableGames,
|
|
338
|
+
onGameSelect: navigateToGame,
|
|
339
|
+
onExit: config.onExit
|
|
340
|
+
});
|
|
341
|
+
const renderScreen = () => {
|
|
342
|
+
switch (currentScreen) {
|
|
343
|
+
case 'HOME':
|
|
344
|
+
return ReactActivity ? null : homeScreen;
|
|
345
|
+
case 'WALLET':
|
|
346
|
+
return /*#__PURE__*/_jsx(Wallet, {
|
|
347
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
348
|
+
balance: balance,
|
|
349
|
+
onDeposit: handleDeposit,
|
|
350
|
+
onWithdraw: handleWithdraw
|
|
351
|
+
});
|
|
352
|
+
case 'HISTORY':
|
|
353
|
+
return /*#__PURE__*/_jsx(History, {
|
|
354
|
+
onBack: () => setCurrentScreen('HOME')
|
|
355
|
+
});
|
|
356
|
+
case 'LEADERBOARD':
|
|
357
|
+
return /*#__PURE__*/_jsx(Leaderboard, {
|
|
358
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
359
|
+
onNavigate: s => setCurrentScreen(s)
|
|
360
|
+
});
|
|
361
|
+
case 'PROFILE':
|
|
362
|
+
return /*#__PURE__*/_jsx(Profile, {
|
|
363
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
364
|
+
balance: balance,
|
|
365
|
+
onLogout: () => config.onExit?.()
|
|
366
|
+
});
|
|
367
|
+
case 'SUCCESS':
|
|
368
|
+
{
|
|
369
|
+
const replayScreen = lastGameName ? GAME_REPLAY_SCREENS[lastGameName] : undefined;
|
|
370
|
+
return /*#__PURE__*/_jsx(Success, {
|
|
371
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
372
|
+
data: successData,
|
|
373
|
+
onPlayAgain: replayScreen ? () => setCurrentScreen(replayScreen) : undefined
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
case 'DICE_LOBBY':
|
|
377
|
+
return /*#__PURE__*/_jsx(DiceLobby, {
|
|
378
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
379
|
+
onStart: (stake, stakeCount) => {
|
|
380
|
+
setDiceStake(stake);
|
|
381
|
+
setDiceStakeCount(stakeCount);
|
|
382
|
+
setCurrentScreen('DICE_BATTLE');
|
|
383
|
+
},
|
|
384
|
+
game: findGame('DICE_ROLL'),
|
|
385
|
+
balance: balance,
|
|
386
|
+
onTopUp: handleDeposit
|
|
387
|
+
});
|
|
388
|
+
case 'DICE_BATTLE':
|
|
389
|
+
return /*#__PURE__*/_jsx(DiceBattle, {
|
|
390
|
+
onBack: () => setCurrentScreen('DICE_LOBBY'),
|
|
391
|
+
initialStake: diceStake,
|
|
392
|
+
stakeCount: diceStakeCount,
|
|
393
|
+
onWin: amt => handleWin('Dice Battle', amt),
|
|
394
|
+
onLose: handleGameEnd,
|
|
395
|
+
game: findGame('DICE_ROLL'),
|
|
396
|
+
balance: balance,
|
|
397
|
+
onTopUp: handleDeposit
|
|
398
|
+
});
|
|
399
|
+
case 'FORTUNE_WHEEL':
|
|
400
|
+
return /*#__PURE__*/_jsx(FortuneWheel, {
|
|
401
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
402
|
+
balance: balance,
|
|
403
|
+
onWin: amt => handleWin('Fortune Wheel', amt),
|
|
404
|
+
onLose: handleGameEnd,
|
|
405
|
+
game: findGame('SPIN_WHEEL'),
|
|
406
|
+
onTopUp: handleDeposit
|
|
407
|
+
});
|
|
408
|
+
case 'TICKET_SHOP':
|
|
409
|
+
return /*#__PURE__*/_jsx(TicketShop, {
|
|
410
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
411
|
+
balance: balance,
|
|
412
|
+
game: findGame('RAFFLE_DRAW'),
|
|
413
|
+
onPurchase: () => refetchWallet(),
|
|
414
|
+
onTopUp: handleDeposit
|
|
415
|
+
});
|
|
416
|
+
case 'MILLIONAIRE_HUNTER':
|
|
417
|
+
return /*#__PURE__*/_jsx(MillionaireHunter, {
|
|
418
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
419
|
+
onWin: amt => handleWin('Millionaire Hunter', amt),
|
|
420
|
+
onLose: handleGameEnd,
|
|
421
|
+
balance: balance,
|
|
422
|
+
game: findGame('MILLIONAIRE_HUNTER'),
|
|
423
|
+
onTopUp: handleDeposit
|
|
424
|
+
});
|
|
425
|
+
case 'REVEAL_WIN':
|
|
426
|
+
return /*#__PURE__*/_jsx(RevealWin, {
|
|
427
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
428
|
+
onWin: amt => handleWin('Reveal & Win', amt),
|
|
429
|
+
onLose: handleGameEnd,
|
|
430
|
+
balance: balance,
|
|
431
|
+
game: findGame('REVEAL_WIN'),
|
|
432
|
+
onTopUp: handleDeposit
|
|
433
|
+
});
|
|
434
|
+
case 'FREEFALL':
|
|
435
|
+
return /*#__PURE__*/_jsx(Freefall, {
|
|
436
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
437
|
+
onWin: amt => handleWin('Freefall', amt),
|
|
438
|
+
onLose: handleGameEnd,
|
|
439
|
+
balance: balance,
|
|
440
|
+
game: findGame('PLINKO'),
|
|
441
|
+
onTopUp: handleDeposit
|
|
442
|
+
});
|
|
443
|
+
case 'MINEFIELD':
|
|
444
|
+
return /*#__PURE__*/_jsx(Minefield, {
|
|
445
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
446
|
+
onWin: amt => handleWin('Minefield', amt),
|
|
447
|
+
onLose: handleGameEnd,
|
|
448
|
+
balance: balance,
|
|
449
|
+
game: findGame('MINES'),
|
|
450
|
+
onTopUp: handleDeposit
|
|
451
|
+
});
|
|
452
|
+
case 'JETSTREAM':
|
|
453
|
+
return /*#__PURE__*/_jsx(Jetstream, {
|
|
454
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
455
|
+
onWin: amt => handleWin('Jetstream', amt),
|
|
456
|
+
onLose: handleGameEnd,
|
|
457
|
+
balance: balance,
|
|
458
|
+
game: findGame('CRASH'),
|
|
459
|
+
onTopUp: handleDeposit,
|
|
460
|
+
serverUrl: config.apiUrl
|
|
461
|
+
});
|
|
462
|
+
case 'RAFFLE_DRAW':
|
|
463
|
+
return /*#__PURE__*/_jsx(RaffleDraw, {
|
|
464
|
+
onNavigate: s => setCurrentScreen(s),
|
|
465
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
466
|
+
game: findGame('RAFFLE_DRAW')
|
|
467
|
+
});
|
|
468
|
+
case 'TRIVIA_LOBBY':
|
|
469
|
+
return /*#__PURE__*/_jsx(TriviaLobby, {
|
|
470
|
+
onBack: () => setCurrentScreen('HOME'),
|
|
471
|
+
onStart: (stake, stakeCount, categoryId) => {
|
|
472
|
+
setTriviaStake(stake);
|
|
473
|
+
setTriviaStakeCount(stakeCount);
|
|
474
|
+
setTriviaCategoryId(categoryId);
|
|
475
|
+
setCurrentScreen('TRIVIA_MASTER');
|
|
476
|
+
},
|
|
477
|
+
balance: balance,
|
|
478
|
+
game: findGame('FAST_FINGER'),
|
|
479
|
+
onTopUp: handleDeposit
|
|
480
|
+
});
|
|
481
|
+
case 'TRIVIA_MASTER':
|
|
482
|
+
return /*#__PURE__*/_jsx(TriviaMaster, {
|
|
483
|
+
onBack: () => setCurrentScreen('TRIVIA_LOBBY'),
|
|
484
|
+
initialStake: triviaStake,
|
|
485
|
+
stakeCount: triviaStakeCount,
|
|
486
|
+
categoryId: triviaCategoryId,
|
|
487
|
+
onWin: amt => handleWin('Trivia Master', amt),
|
|
488
|
+
onLose: handleGameEnd,
|
|
489
|
+
balance: balance,
|
|
490
|
+
game: findGame('FAST_FINGER'),
|
|
491
|
+
onTopUp: handleDeposit
|
|
492
|
+
});
|
|
493
|
+
case 'DEPOSIT_SELECT':
|
|
494
|
+
return /*#__PURE__*/_jsx(DepositSelect, {
|
|
495
|
+
onBack: () => setCurrentScreen('WALLET'),
|
|
496
|
+
onProceed: handleDepositProceed,
|
|
497
|
+
loading: initDepositLoading
|
|
498
|
+
});
|
|
499
|
+
case 'WITHDRAW':
|
|
500
|
+
return /*#__PURE__*/_jsx(WithdrawFlow, {
|
|
501
|
+
onBack: () => setCurrentScreen('WALLET'),
|
|
502
|
+
balance: balance,
|
|
503
|
+
onSuccess: amount => {
|
|
504
|
+
refetchWallet();
|
|
505
|
+
setSuccessData({
|
|
506
|
+
type: 'MONEY',
|
|
507
|
+
amount
|
|
508
|
+
});
|
|
509
|
+
setLastGameName(null);
|
|
510
|
+
setCurrentScreen('SUCCESS');
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
case 'PAYMENT':
|
|
514
|
+
{
|
|
515
|
+
const player = useAuthStore.getState().player;
|
|
516
|
+
return /*#__PURE__*/_jsx(PaymentWebView, {
|
|
517
|
+
publicKey: depositPublicKey,
|
|
518
|
+
amountKobo: depositAmountKobo,
|
|
519
|
+
transactionId: depositTransactionId,
|
|
520
|
+
paymentChannels: depositPaymentChannels,
|
|
521
|
+
provider: depositProvider,
|
|
522
|
+
email: player?.email ?? '',
|
|
523
|
+
fullName: [player?.firstName, player?.lastName].filter(Boolean).join(' ') || player?.displayName || '',
|
|
524
|
+
phone: player?.msisdn ?? undefined,
|
|
525
|
+
mToken: config.mToken,
|
|
526
|
+
onSuccess: handlePaymentSuccess,
|
|
527
|
+
onFailed: handlePaymentFailed,
|
|
528
|
+
onClose: handlePaymentClose
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
default:
|
|
532
|
+
return ReactActivity ? null : homeScreen;
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
const activeScreen = renderScreen();
|
|
536
|
+
const isColumnScreen = isWide && activeScreen != null && currentScreen !== 'HOME';
|
|
537
|
+
const backdrop = isColumnScreen ? SCREEN_BACKDROPS[currentScreen] : undefined;
|
|
538
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
539
|
+
style: [styles.container, {
|
|
540
|
+
direction: isRTL ? 'rtl' : 'ltr'
|
|
541
|
+
}, backdrop ? {
|
|
542
|
+
backgroundColor: backdrop
|
|
543
|
+
} : null],
|
|
544
|
+
children: [/*#__PURE__*/_jsx(StatusBar, {
|
|
545
|
+
barStyle: "light-content",
|
|
546
|
+
backgroundColor: COLORS.backgroundDark
|
|
547
|
+
}), ReactActivity != null && /*#__PURE__*/_jsx(ReactActivity, {
|
|
548
|
+
mode: currentScreen === 'HOME' ? 'visible' : 'hidden',
|
|
549
|
+
children: homeScreen
|
|
550
|
+
}), isColumnScreen ? /*#__PURE__*/_jsx(View, {
|
|
551
|
+
style: styles.screenColumn,
|
|
552
|
+
children: activeScreen
|
|
553
|
+
}) : activeScreen, /*#__PURE__*/_jsx(JackpotTeaser, {
|
|
554
|
+
visible: teaserVisible,
|
|
555
|
+
jackpotAmountKobo: teaserGame?.gameplayRules?.jackpotAmountKobo ?? 0,
|
|
556
|
+
gameName: teaserGame ? t(`games.${teaserGame.gameCode}.name`) : '',
|
|
557
|
+
gameCode: teaserGame?.gameCode ?? 'DICE_ROLL',
|
|
558
|
+
currency: wallet?.currency ?? walletContent().currency,
|
|
559
|
+
onDismiss: () => setTeaserGame(null)
|
|
560
|
+
}), showBottomNav && /*#__PURE__*/_jsx(View, {
|
|
561
|
+
style: [styles.tabBar, isWide && {
|
|
562
|
+
paddingHorizontal: Math.max(8, (width - TAB_BAR_MAX_WIDTH) / 2)
|
|
563
|
+
}],
|
|
564
|
+
children: TAB_SCREENS.map(screen => {
|
|
565
|
+
const isActive = currentScreen === screen;
|
|
566
|
+
return /*#__PURE__*/_jsxs(MonflowtsPressable, {
|
|
567
|
+
style: styles.tab,
|
|
568
|
+
onPress: () => setCurrentScreen(screen),
|
|
569
|
+
activeOpacity: 0.7,
|
|
570
|
+
children: [/*#__PURE__*/_jsx(SvgIcon, {
|
|
571
|
+
name: TAB_ICONS[screen],
|
|
572
|
+
size: isActive ? 22 : 20,
|
|
573
|
+
color: isActive ? COLORS.primary : COLORS.slateLight
|
|
574
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
575
|
+
style: [styles.tabLabel, isActive && styles.tabLabelActive],
|
|
576
|
+
children: t(TAB_LABEL_KEYS[screen] ?? 'nav.games')
|
|
577
|
+
}), isActive && /*#__PURE__*/_jsx(View, {
|
|
578
|
+
style: styles.tabIndicator
|
|
579
|
+
})]
|
|
580
|
+
}, screen);
|
|
581
|
+
})
|
|
582
|
+
})]
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
const styles = StyleSheet.create({
|
|
586
|
+
container: {
|
|
587
|
+
flex: 1,
|
|
588
|
+
backgroundColor: COLORS.backgroundDark
|
|
589
|
+
},
|
|
590
|
+
screenColumn: {
|
|
591
|
+
flex: 1,
|
|
592
|
+
width: '100%',
|
|
593
|
+
maxWidth: COLUMN_MAX_WIDTH,
|
|
594
|
+
alignSelf: 'center'
|
|
595
|
+
},
|
|
596
|
+
tabBar: {
|
|
597
|
+
position: 'absolute',
|
|
598
|
+
bottom: 0,
|
|
599
|
+
left: 0,
|
|
600
|
+
right: 0,
|
|
601
|
+
flexDirection: 'row',
|
|
602
|
+
backgroundColor: 'rgba(5, 11, 24, 0.95)',
|
|
603
|
+
borderTopWidth: 1,
|
|
604
|
+
borderTopColor: COLORS.white05,
|
|
605
|
+
paddingBottom: 28,
|
|
606
|
+
paddingTop: 8,
|
|
607
|
+
paddingHorizontal: 8
|
|
608
|
+
},
|
|
609
|
+
tab: {
|
|
610
|
+
flex: 1,
|
|
611
|
+
alignItems: 'center',
|
|
612
|
+
paddingVertical: 6,
|
|
613
|
+
position: 'relative'
|
|
614
|
+
},
|
|
615
|
+
tabIcon: {
|
|
616
|
+
fontSize: 22,
|
|
617
|
+
opacity: 0.4
|
|
618
|
+
},
|
|
619
|
+
tabIconActive: {
|
|
620
|
+
opacity: 1
|
|
621
|
+
},
|
|
622
|
+
tabLabel: {
|
|
623
|
+
fontSize: 10,
|
|
624
|
+
fontWeight: '600',
|
|
625
|
+
color: 'rgba(255,255,255,0.3)',
|
|
626
|
+
marginTop: 2
|
|
627
|
+
},
|
|
628
|
+
tabLabelActive: {
|
|
629
|
+
color: COLORS.primary,
|
|
630
|
+
fontWeight: '700'
|
|
631
|
+
},
|
|
632
|
+
tabIndicator: {
|
|
633
|
+
position: 'absolute',
|
|
634
|
+
top: -8,
|
|
635
|
+
width: 20,
|
|
636
|
+
height: 3,
|
|
637
|
+
borderRadius: 2,
|
|
638
|
+
backgroundColor: COLORS.primary
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
export default HubContent;
|
|
642
|
+
//# sourceMappingURL=HubContent.js.map
|