Skip to content
Merged
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/stale-swans-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stakekit/widget": patch
---

feat: hoodi chain support
19 changes: 13 additions & 6 deletions packages/widget/src/domain/types/chains/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
gnosis,
goerli,
harmonyOne,
holesky,
hoodi,
linea,
mainnet,
optimism,
Expand All @@ -20,6 +20,7 @@ import {
unichain,
viction,
} from "viem/chains";
import type { KebabToCamelCase } from "../../../types/utils";
import { getNetworkLogo } from "../../../utils";

const supportedEVMChains = [
Expand All @@ -33,7 +34,7 @@ const supportedEVMChains = [
EvmNetworks.Optimism,
EvmNetworks.Polygon,
EvmNetworks.Viction,
EvmNetworks.EthereumHolesky,
EvmNetworks.EthereumHoodi,
EvmNetworks.Base,
EvmNetworks.Linea,
EvmNetworks.Core,
Expand Down Expand Up @@ -142,10 +143,10 @@ export const evmChainsMap: EvmChainsMap = {
iconUrl: getNetworkLogo(EvmNetworks.Sonic),
},
},
[EvmNetworks.EthereumHolesky]: {
[EvmNetworks.EthereumHoodi]: {
type: "evm",
skChainName: EvmNetworks.EthereumHolesky,
wagmiChain: holesky,
skChainName: EvmNetworks.EthereumHoodi,
wagmiChain: hoodi,
},
[EvmNetworks.EthereumGoerli]: {
type: "evm",
Expand Down Expand Up @@ -202,9 +203,15 @@ export enum EvmChainIds {
Linea = 59_144,
Core = 1116,
Sonic = 146,
EthereumHolesky = 17000,
EthereumHoodi = 560048,
EthereumGoerli = 5,
EthereumSepolia = 11_155_111,
Unichain = 130,
Katana = 747474,
Gnosis = 100,
Comment thread
petar-omni marked this conversation as resolved.
}

EvmChainIds satisfies Record<
Capitalize<KebabToCamelCase<SupportedEvmChain>>,
number
>;
6 changes: 3 additions & 3 deletions packages/widget/src/domain/types/chains/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ export const supportedLedgerFamiliesWithCurrency = {
family: "ethereum",
skChainName: EvmNetworks.AvalancheC,
},
ethereum_holesky: {
currencyId: "ethereum_holesky",
ethereum_hoodi: {
currencyId: "ethereum_hoodi",
family: "ethereum",
skChainName: EvmNetworks.EthereumHolesky,
skChainName: EvmNetworks.EthereumHoodi,
},
bsc: {
currencyId: "bsc",
Expand Down
6 changes: 6 additions & 0 deletions packages/widget/src/domain/types/chains/misc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MiscNetworks } from "@stakekit/common";
import type { Chain } from "@stakekit/rainbowkit";
import type { KebabToCamelCase } from "../../../types/utils";
import { getTokenLogo } from "../../../utils";

const supportedMiscChains = [
Expand Down Expand Up @@ -132,3 +133,8 @@ export enum MiscChainIds {
Tron = 79,
Ton = 3412,
}

MiscChainIds satisfies Record<
Capitalize<KebabToCamelCase<SupportedMiscChains>>,
number
>;
6 changes: 6 additions & 0 deletions packages/widget/src/domain/types/chains/substrate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SubstrateNetworks } from "@stakekit/common";
import type { Chain } from "@stakekit/rainbowkit";
import type { KebabToCamelCase } from "../../../types/utils";
import { getNetworkLogo } from "../../../utils";

const supportedSubstrateChains = [
Expand Down Expand Up @@ -81,3 +82,8 @@ export enum SubstrateChainIds {
Polkadot = 9999,
Bittensor = 558,
}

SubstrateChainIds satisfies Record<
Capitalize<KebabToCamelCase<SupportedSubstrateChains>>,
number
>;
5 changes: 5 additions & 0 deletions packages/widget/src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ export type Action<T extends string, D = void> = D extends void
: { type: T; data: D };

export type Nullable<T> = T | undefined | null;

export type KebabToCamelCase<S extends string> =
S extends `${infer P1}-${infer P2}${infer P3}`
? `${P1}${Capitalize<KebabToCamelCase<`${P2}${P3}`>>}`
: S;