import { Linking } from "react-native"; // Call only in the onPress for the exact JIT action label. export async function openChosenChiaUrl(value: string): Promise { const url = new URL(value); if (url.protocol !== "https:") throw new Error("Invalid handoff URL"); await Linking.openURL(value); // External OS handler; do not use an embedded WebView. } // Optional generic link: route home without reading query/hash or inferring completion. export function handleGenericReturn(value: string, showMarketplaceHome: () => void): void { if (new URL(value).hostname === "return.example-partner.invalid") showMarketplaceHome(); }