Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/tall-falcons-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stakekit/widget": patch
---

feat: initial chain to connect
3 changes: 2 additions & 1 deletion packages/widget/src/providers/rainbow-kit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const RainbowKitProviderWithTheme = ({

const { t, i18n } = useTranslation();

const { hideAccountAndChainSelector } = useSettings();
const { hideAccountAndChainSelector, initialChain } = useSettings();

const chainIdsToUse = useMemo(
() => new Set(connectorChains.map((c) => c.id)),
Expand Down Expand Up @@ -85,6 +85,7 @@ export const RainbowKitProviderWithTheme = ({
appInfo={{ disclaimer: Disclamer, appName: t("shared.stake_kit") }}
{...(hideAccountAndChainSelector && { avatar: null })}
showRecentTransactions={false}
initialChain={initialChain}
theme={finalTheme}
hideDisconnect={hideDisconnect}
dialogRoot={portalContainer}
Expand Down
6 changes: 5 additions & 1 deletion packages/widget/src/providers/settings/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { TokenDto, TransactionFormat } from "@stakekit/api-hooks";
import type { ReactNode } from "react";
import type { SupportedSKChains } from "../../domain/types/chains";
import type {
SupportedSKChainIds,
SupportedSKChains,
} from "../../domain/types/chains";
import type { PreferredTokenYieldsPerNetwork } from "../../domain/types/stake";
import type { SKExternalProviders } from "../../domain/types/wallets";
import type { Languages, localResources } from "../../translation";
Expand Down Expand Up @@ -72,6 +75,7 @@ export type SettingsProps = {
preferredTokenYieldsPerNetwork?: PreferredTokenYieldsPerNetwork;
portalContainer?: HTMLElement;
tonConnectManifestUrl?: string;
initialChain?: SupportedSKChainIds;
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new initialChain feature lacks test coverage. Consider adding a test case that verifies the initialChain prop is correctly passed through the settings context to the RainbowKitProvider. This would ensure the initial chain selection works as expected when users provide this configuration.

Copilot uses AI. Check for mistakes.
};

export type SettingsContextType = SettingsProps & VariantProps;
Loading