@@ -25,6 +25,8 @@ import { WalletButtonRow } from "../../components/claim-reward/WalletButtonRow";
2525import { LoadingModal } from "../../components/claim-reward/LoadingModal" ;
2626import { useEventManager } from "../../stores/useEventManager" ;
2727import { InsufficientFundsModal } from "../../components/InsufficientFundsModal" ;
28+ import { useOpenApp } from "../../hooks/useOpenApp" ;
29+ import { WalletPresets } from "@/constants/WalletPresets" ;
2830
2931// Decode common Starknet u256/BigNumberish shapes using starknet helpers
3032function decodeU256ToBigInt ( raw : any ) : bigint | null {
@@ -69,6 +71,7 @@ const ClaimRewardSectionComponent: React.FC<ClaimRewardProps> = ({
6971 const { width } = useCachedWindowDimensions ( ) ;
7072 const { notify } = useEventManager ( ) ;
7173 const [ showInsufficientFunds , setShowInsufficientFunds ] = useState ( false ) ;
74+ const { openApp } = useOpenApp ( ) ;
7275
7376 const handleBack = useCallback ( ( ) => {
7477 if ( onBack ) onBack ( ) ;
@@ -188,62 +191,6 @@ const ClaimRewardSectionComponent: React.FC<ClaimRewardProps> = ({
188191 } ) ( ) ;
189192 } , [ ] ) ;
190193
191- const openReadyWallet = useCallback ( async ( ) => {
192- const scheme = "ready://open" ;
193- try {
194- await Linking . openURL ( scheme ) ;
195- return ;
196- } catch ( _e ) {
197- if ( __DEV__ ) {
198- console . debug ( "Failed to open READY wallet scheme" ) ;
199- }
200- }
201- try {
202- if ( Platform . OS === "ios" ) {
203- await Linking . openURL (
204- "https://apps.apple.com/us/app/ready-earn-on-bitcoin-usdc/id1358741926" ,
205- ) ;
206- } else {
207- const pkg = "im.argent.contractwalletclient" ;
208- const market = `market://details?id=${ pkg } ` ;
209- const web = `https://play.google.com/store/apps/details?id=${ pkg } ` ;
210- await Linking . openURL ( market ) . catch ( ( ) => Linking . openURL ( web ) ) ;
211- }
212- } catch ( _e ) {
213- if ( __DEV__ ) {
214- console . debug ( "Failed to open READY install link" ) ;
215- }
216- }
217- } , [ ] ) ;
218-
219- const openBraavosWallet = useCallback ( async ( ) => {
220- const scheme = "braavos://open" ;
221- try {
222- await Linking . openURL ( scheme ) ;
223- return ;
224- } catch ( _e ) {
225- if ( __DEV__ ) {
226- console . debug ( "Failed to open BRAAVOS wallet scheme" ) ;
227- }
228- }
229- try {
230- if ( Platform . OS === "ios" ) {
231- await Linking . openURL (
232- "https://apps.apple.com/us/app/braavos-wallet/id1636013523" ,
233- ) ;
234- } else {
235- const pkg = "app.braavos.wallet" ;
236- const market = `market://details?id=${ pkg } ` ;
237- const web = `https://play.google.com/store/apps/details?id=${ pkg } ` ;
238- await Linking . openURL ( market ) . catch ( ( ) => Linking . openURL ( web ) ) ;
239- }
240- } catch ( _e ) {
241- if ( __DEV__ ) {
242- console . debug ( "Failed to open BRAAVOS install link" ) ;
243- }
244- }
245- } , [ ] ) ;
246-
247194 const isValidAddress = / ^ 0 x [ a - f A - F 0 - 9 ] { 63 , 64 } $ / . test (
248195 ( debouncedInput || "" ) . trim ( ) ,
249196 ) ;
@@ -313,8 +260,8 @@ const ClaimRewardSectionComponent: React.FC<ClaimRewardProps> = ({
313260 < View style = { styles . section } >
314261 < View style = { styles . card } >
315262 < WalletButtonRow
316- onPressReady = { openReadyWallet }
317- onPressBraavos = { openBraavosWallet }
263+ onPressReady = { ( ) => openApp ( WalletPresets . readyWallet ) }
264+ onPressBraavos = { ( ) => openApp ( WalletPresets . braavos ) }
318265 />
319266 < Text style = { styles . hintInline } >
320267 Open a wallet above and paste an address to receive your STRK.
0 commit comments