Skip to content

Add Galaxy Station wallet #4040

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

Open
wants to merge 4 commits into
base: stage
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions packages/web/config/generate-cosmos-kit-wallet-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import path from "node:path";
import { cdcwalletExtensionInfo } from "@cosmos-kit/cdcwallet-extension";
import { Wallet as DefaultWallet } from "@cosmos-kit/core";
import { cosmostationExtensionInfo } from "@cosmos-kit/cosmostation-extension";
import { galaxyStationExtensionInfo } from "@cosmos-kit/galaxy-station-extension";
import { GalaxyStationMobileInfo as galaxyStationMobileInfo } from "@cosmos-kit/galaxy-station-mobile";
import { keplrExtensionInfo } from "@cosmos-kit/keplr-extension";
import { keplrMobileInfo } from "@cosmos-kit/keplr-mobile";
import { leapExtensionInfo } from "@cosmos-kit/leap-extension";
Expand Down Expand Up @@ -38,6 +40,8 @@ const CosmosKitWalletList: Wallet[] = [
cosmostationExtensionInfo,
stationExtensionInfo,
cdcwalletExtensionInfo,
galaxyStationExtensionInfo,
galaxyStationMobileInfo,
];

function isObject(value: any): value is Record<any, any> {
Expand Down Expand Up @@ -96,6 +100,19 @@ async function generateCosmosKitWalletList() {
return acc;
}, {} as Record<string, Wallet>);

// Override formatNativeUrl for specific wallets
if (registryObject["galaxy-station-mobile"]) {
registryObject["galaxy-station-mobile"].walletconnect!.formatNativeUrl = (
_appUrl,
wcUri,
_os,
_name
) => {
const encodedWcUrl = encodeURIComponent(wcUri);
return `https://station.hexxagon.io/wcV2?${encodedWcUrl}`;
};
}

const content = `
import {Wallet} from "@cosmos-kit/core"
export enum AvailableCosmosWallets {${CosmosKitWalletList.map(
Expand Down
80 changes: 80 additions & 0 deletions packages/web/config/wallet-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,84 @@ export const CosmosWalletRegistry: CosmosRegistryWallet[] = [
},
features: [],
},
{
...CosmosKitWalletList["galaxy-station-extension"],
mobileDisabled: true,
logo: "/wallets/galaxy-station.png",
lazyInstall: () =>
import("@cosmos-kit/galaxy-station-extension").then(
(m) => m.GalaxyStationExtensionWallet
),
windowPropertyName: "galaxyStation",
supportsChain: async (chainId) => {
if (typeof window === "undefined") return true;

const galaxyStationWallet = (window as any)?.galaxyStation?.keplr as {
getChainInfosWithoutEndpoints: () => Promise<{ chainId: string }[]>;
};

if (!galaxyStationWallet) return true;

const chainInfos =
await galaxyStationWallet.getChainInfosWithoutEndpoints();
return chainInfos.some((info) => info.chainId === chainId);
},
stakeUrl: "https://station.hexxagon.io/stake",
governanceUrl: "https://station.hexxagon.io/gov",
features: [],
},
{
...CosmosKitWalletList["galaxy-station-mobile"],
logo: "/wallets/galaxy-station.png",
lazyInstall: () =>
import("@cosmos-kit/galaxy-station-mobile").then(
(m) => m.GalaxyStationMobileWallet
),
supportsChain: async (chainId) => {
const galaxyStationMobileAvailableChains: MainnetChainIds[] = [
"akashnet-2",
"archway-1",
"atomone-1",
"bitsong-2b",
"carbon-1",
"celestia",
"cheqd-mainnet-1",
"chihuahua-1",
"columbus-5",
"comdex-1",
"cosmoshub-4",
"crescent-1",
"dydx-mainnet-1",
"gravity-bridge-3",
"injective-1",
"irishub-1",
"juno-1",
"kaiyo-1",
"kava_2222-10",
"kichain-2",
"lum-network-1",
"mars-1",
"mainnet-3",
"migaloo-1",
"neutron-1",
"noble-1",
"osmosis-1",
"ssc-1",
"pacific-1",
"phoenix-1",
"sentinelhub-2",
"stafihub-1",
"stargaze-1",
"stride-1",
"teritori-1",
];

return galaxyStationMobileAvailableChains.includes(
chainId as MainnetChainIds
);
},
stakeUrl: "https://station.hexxagon.io/stake",
governanceUrl: "https://station.hexxagon.io/gov",
features: [],
},
];
1 change: 1 addition & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@cosmos-kit/cdcwallet": "^2.13.2",
"@cosmos-kit/core": "^2.13.1",
"@cosmos-kit/cosmostation": "^2.11.2",
"@cosmos-kit/galaxy-station": "^2.13.7",
"@cosmos-kit/keplr": "^2.12.2",
"@cosmos-kit/leap": "^2.12.2",
"@cosmos-kit/okxwallet": "^2.9.2",
Expand Down
Binary file added packages/web/public/wallets/galaxy-station.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading