Skip to content

Commit

Permalink
update with mainnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
allenchuang committed Feb 12, 2025
1 parent d57ea53 commit e5d8aa1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/storykit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@storyprotocol/storykit",
"author": "storyprotocol engineering <[email protected]>",
"version": "0.2.13",
"version": "0.2.14",
"type": "module",
"exports": {
".": {
Expand Down
15 changes: 15 additions & 0 deletions packages/storykit/src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,35 @@ export const STORY_AENEID: ChainConfig = {
// NOTE: No default currency for Aeneid
}

export const STORY_MAINNET: ChainConfig = {
id: 1514,
name: "story",
simplehashId: "story",
apiVersion: "v3",
displayName: "Story Mainnet",
rpcUrl: "https://mainnet.storyrpc.io",
blockExplorerUrl: "https://mainnet.storyscan.xyz",
protocolExplorerUrl: "https://explorer.story.foundation",
// NOTE: No default currency for Mainnet
}

export const CHAINS = {
[STORY_ILIAD.name]: STORY_ILIAD,
[STORY_ODYSSEY.name]: STORY_ODYSSEY,
[STORY_AENEID.name]: STORY_AENEID,
[STORY_MAINNET.name]: STORY_MAINNET,
}

export const CHAINNAME_TO_CHAINID: { [key: string]: number } = {
"story-testnet": 1513,
"story-odyssey": 1516,
"story-aeneid": 1315,
"story": 1514,
}

export const CHAINID_TO_CHAINNAME: { [key: number]: string } = {
1513: "story-testnet",
1516: "story-odyssey",
1315: "story-aeneid",
1514: "story",
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ export const Aeneid: Story = {
},
}

export const Mainnet: Story = {
argTypes: {
children: { control: false },
},
args: {
chain: STORYKIT_SUPPORTED_CHAIN.STORY_MAINNET,
},
}

export const DarkMode: Story = {
argTypes: {
children: { control: false },
Expand Down
9 changes: 7 additions & 2 deletions packages/storykit/src/types/chains.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { STORY_AENEID, STORY_ILIAD, STORY_ODYSSEY } from "@/constants/chains"
import { STORY_AENEID, STORY_ILIAD, STORY_MAINNET, STORY_ODYSSEY } from "@/constants/chains"
import { Currency } from "@/types/currencies"

export type ChainConfig = {
Expand All @@ -13,10 +13,15 @@ export type ChainConfig = {
defaultCurrency?: Currency
}

export type SupportedChainConfig = typeof STORY_ODYSSEY | typeof STORY_ILIAD | typeof STORY_AENEID
export type SupportedChainConfig =
| typeof STORY_ODYSSEY
| typeof STORY_ILIAD
| typeof STORY_AENEID
| typeof STORY_MAINNET

export enum STORYKIT_SUPPORTED_CHAIN {
STORY_TESTNET = "story-testnet",
ODYSSEY_TESTNET = "story-odyssey",
AENEID_TESTNET = "story-aeneid",
STORY_MAINNET = "story",
}

0 comments on commit e5d8aa1

Please sign in to comment.