Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/components/WalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ const WalletModal: React.FC<WalletModalProps> = ({ isOpen, onClose }) => {
description: "Connect with Kibisis wallet (Algorand/VOI)",
isInstalled: true,
},
{
id: "algovoi",
name: "AlgoVoi",
icon: wallets.find((w) => w.id === "algovoi")?.metadata.icon || "",
description: "Connect with AlgoVoi wallet (Algorand/VOI)",
isInstalled: true,
},
{
id: "lute",
name: "Lute",
Expand Down Expand Up @@ -174,6 +181,15 @@ const WalletModal: React.FC<WalletModalProps> = ({ isOpen, onClose }) => {
if (provider.id === "biatec" && availableWalletIds.includes("biatec")) {
return true;
}
// Show AlgoVoi if registered in WalletManager OR if the extension is detected directly
// (window.algorand detection bridges the gap before TxnLab/use-wallet#434 lands)
if (
provider.id === "algovoi" &&
(availableWalletIds.includes("algovoi") ||
(typeof window !== "undefined" && (window as any).algorand?.isAlgoVoi === true))
) {
return true;
}
// Show other wallets if they're available or not installed
return (
availableWalletIds.includes(provider.id) || !provider.isInstalled
Expand Down Expand Up @@ -250,6 +266,24 @@ const WalletModal: React.FC<WalletModalProps> = ({ isOpen, onClose }) => {

// For AVM networks, find the wallet from the wallets array
if (isAVM) {
// Handle AlgoVoi: use window.algorand directly until TxnLab/use-wallet#434 lands
if (providerId === "algovoi") {
const algoVoiProvider = (window as any).algorand;
if (!algoVoiProvider?.isAlgoVoi) {
throw new Error("AlgoVoi extension not detected. Please install it and reload.");
}
const registeredWallet = wallets.find((w) => w.id === "algovoi");
if (registeredWallet) {
await registeredWallet.connect();
} else {
// Fallback: trigger ARC-27 enable directly
const accounts = await algoVoiProvider.enable({ genesisHash: undefined });
if (!accounts?.accounts?.length) throw new Error("No accounts returned");
}
if (abortController.signal.aborted) return;
if (timeoutRef.current) { clearTimeout(timeoutRef.current); timeoutRef.current = null; }
toast({ title: "AlgoVoi Connected", description: "Successfully connected to AlgoVoi" });
} else
// Handle Vera Wallet specifically (uses WalletConnect)
if (providerId === "vera") {
const walletConnectWallet = wallets.find(
Expand Down
5 changes: 4 additions & 1 deletion src/contexts/NetworkContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ export const NetworkProvider: React.FC<NetworkProviderProps> = ({
// This allows switching to any network without disconnecting the wallet
return [
WalletId.KIBISIS,
// AlgoVoi: ARC-27 browser extension wallet (Algorand + Voi)
// Replace 'algovoi' with WalletId.ALGOVOI once TxnLab/use-wallet#434 lands
'algovoi' as any,
{
id: WalletId.LUTE,
options: { siteName: "DorkFi" },
Expand Down Expand Up @@ -178,7 +181,7 @@ export const NetworkProvider: React.FC<NetworkProviderProps> = ({
const walletNameLower = (walletName || "").toLowerCase();

// Universal wallets support all AVM networks
if (walletIdLower === "lute" || walletIdLower === "kibisis") {
if (walletIdLower === "lute" || walletIdLower === "kibisis" || walletIdLower === "algovoi") {
return true;
}

Expand Down