Skip to content

Commit cc64fae

Browse files
authored
feat: initial chain to connect to (#511)
1 parent a7d2b7c commit cc64fae

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.changeset/tall-falcons-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@stakekit/widget": patch
3+
---
4+
5+
feat: initial chain to connect

packages/widget/src/providers/rainbow-kit.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const RainbowKitProviderWithTheme = ({
3939

4040
const { t, i18n } = useTranslation();
4141

42-
const { hideAccountAndChainSelector } = useSettings();
42+
const { hideAccountAndChainSelector, initialChain } = useSettings();
4343

4444
const chainIdsToUse = useMemo(
4545
() => new Set(connectorChains.map((c) => c.id)),
@@ -85,6 +85,7 @@ export const RainbowKitProviderWithTheme = ({
8585
appInfo={{ disclaimer: Disclamer, appName: t("shared.stake_kit") }}
8686
{...(hideAccountAndChainSelector && { avatar: null })}
8787
showRecentTransactions={false}
88+
initialChain={initialChain}
8889
theme={finalTheme}
8990
hideDisconnect={hideDisconnect}
9091
dialogRoot={portalContainer}

packages/widget/src/providers/settings/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { TokenDto, TransactionFormat } from "@stakekit/api-hooks";
22
import type { ReactNode } from "react";
3-
import type { SupportedSKChains } from "../../domain/types/chains";
3+
import type {
4+
SupportedSKChainIds,
5+
SupportedSKChains,
6+
} from "../../domain/types/chains";
47
import type { PreferredTokenYieldsPerNetwork } from "../../domain/types/stake";
58
import type { SKExternalProviders } from "../../domain/types/wallets";
69
import type { Languages, localResources } from "../../translation";
@@ -72,6 +75,7 @@ export type SettingsProps = {
7275
preferredTokenYieldsPerNetwork?: PreferredTokenYieldsPerNetwork;
7376
portalContainer?: HTMLElement;
7477
tonConnectManifestUrl?: string;
78+
initialChain?: SupportedSKChainIds;
7579
};
7680

7781
export type SettingsContextType = SettingsProps & VariantProps;

0 commit comments

Comments
 (0)