@rainbow-me/rainbowkit
Version:
The best way to connect a wallet
28 lines (25 loc) • 566 B
JavaScript
"use client";
// src/components/RainbowKitProvider/walletConnectDeepLink.ts
var storageKey = "WALLETCONNECT_DEEPLINK_CHOICE";
function setWalletConnectDeepLink({
mobileUri,
name
}) {
if (typeof window === "undefined") return;
window.localStorage.setItem(
storageKey,
JSON.stringify({
href: mobileUri.split("?")[0],
name
})
);
}
function clearWalletConnectDeepLink() {
if (typeof window !== "undefined") {
window.localStorage.removeItem(storageKey);
}
}
export {
setWalletConnectDeepLink,
clearWalletConnectDeepLink
};