@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
97 lines (94 loc) • 3.28 kB
JavaScript
"use client";
import {
getWalletConnectConnector
} from "./chunk-23WIEY36.js";
import {
getInjectedConnector,
hasInjectedProvider
} from "./chunk-DNSG5Q7V.js";
// src/wallets/walletConnectors/frontierWallet/frontierWallet.ts
import { isAndroid } from "@funkit/utils";
var frontierWallet = ({
projectId,
walletConnectParameters
}) => {
const isFrontierInjected = hasInjectedProvider({
namespace: "frontier.ethereum",
flag: "isFrontier"
});
const shouldUseWalletConnect = !isFrontierInjected;
return {
id: "frontier",
name: "Frontier Wallet",
rdns: "xyz.frontier.wallet",
installed: isFrontierInjected,
iconUrl: async () => (await import("./frontierWallet-5QV7ZACT.js")).default,
iconBackground: "#CC703C",
downloadUrls: {
android: "https://play.google.com/store/apps/details?id=com.frontierwallet",
ios: "https://apps.apple.com/us/app/frontier-crypto-defi-wallet/id1482380988",
qrCode: "https://www.frontier.xyz/download",
chrome: "https://chrome.google.com/webstore/detail/frontier-wallet/kppfdiipphfccemcignhifpjkapfbihd",
browserExtension: "https://www.frontier.xyz/download"
},
mobile: {
getUri: shouldUseWalletConnect ? (uri) => {
return isAndroid() ? `frontier://wc?uri=${encodeURIComponent(uri)}` : uri;
} : void 0
},
qrCode: shouldUseWalletConnect ? {
getUri: (uri) => {
return isAndroid() ? `frontier://wc?uri=${encodeURIComponent(uri)}` : uri;
},
instructions: {
learnMoreUrl: "https://help.frontier.xyz/en/",
steps: [
{
description: "wallet_connectors.im_token.qr_code.step1.description",
step: "install",
title: "wallet_connectors.im_token.qr_code.step1.title"
},
{
description: "wallet_connectors.im_token.qr_code.step2.description",
step: "create",
title: "wallet_connectors.im_token.qr_code.step2.title"
},
{
description: "wallet_connectors.im_token.qr_code.step3.description",
step: "scan",
title: "wallet_connectors.im_token.qr_code.step3.title"
}
]
}
} : void 0,
extension: {
instructions: {
learnMoreUrl: "https://help.frontier.xyz/en/articles/6967236-setting-up-frontier-on-your-device",
steps: [
{
description: "wallet_connectors.frontier.extension.step1.description",
step: "install",
title: "wallet_connectors.frontier.extension.step1.title"
},
{
description: "wallet_connectors.frontier.extension.step2.description",
step: "create",
title: "wallet_connectors.frontier.extension.step2.title"
},
{
description: "wallet_connectors.frontier.extension.step3.description",
step: "refresh",
title: "wallet_connectors.frontier.extension.step3.title"
}
]
}
},
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({ projectId, walletConnectParameters }) : getInjectedConnector({
namespace: "frontier.ethereum",
flag: "isFrontier"
})
};
};
export {
frontierWallet
};