Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Cosmostation mobile #3576

Merged
merged 9 commits into from
Oct 8, 2024
1 change: 1 addition & 0 deletions packages/web/config/wallet-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
{
...CosmosKitWalletList["cosmostation-extension"],
logo: "/wallets/cosmostation.png",
mobileDisabled: false,
lazyInstall: () =>
import("@cosmos-kit/cosmostation-extension").then(
(m) => m.CosmostationExtensionWallet
Expand Down
17 changes: 17 additions & 0 deletions packages/web/modals/wallet-select/use-selectable-wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ export const useSelectableWallets = ({
.map((wallet) => ({ ...wallet, mobileDisabled: false }));
}

/**
* If on mobile and `cosmostation` is in `window`, it means that the user enters
* the frontend from Cosmostation's app in app browser. So, there is no need
* to use wallet connect, as it resembles the extension's usage.
*/
if (
_window?.cosmostation &&
_window?.cosmostation?.mode === mobileWebModeName
) {
return array
.filter(
(wallet) =>
wallet.name === AvailableCosmosWallets.Cosmostation
)
.map((wallet) => ({ ...wallet, mobileDisabled: false }));
}

/**
* If user is in a normal mobile browser, show only wallet connect
*/
Expand Down