Skip to content

Commit

Permalink
Story: add mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto-crossmint committed Feb 13, 2025
1 parent 5157a60 commit 91cc98a
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 11 deletions.
21 changes: 12 additions & 9 deletions packages/client/wallets/smart-wallet/src/blockchain/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ import {

import { BlockchainIncludingTestnet as Blockchain, type ObjectValues, objectValues } from "@crossmint/common-sdk-base";
import { defineChain } from "viem";
import { story } from "./wallets/definitions/story";

const storyOdyssey = defineChain({
id: 1516,
name: "Story Odyssey",
const storyTestnet = defineChain({
id: 1513,
name: 'Story Testnet',
nativeCurrency: {
decimals: 18,
name: "IP",
symbol: "IP",
name: 'IP',
symbol: 'IP',
},
rpcUrls: {
default: { http: ["https://rpc.odyssey.storyrpc.io"] },
default: { http: ['https://testnet.storyrpc.io'] },
},
blockExplorers: {
default: {
name: "Story Odyssey Explorer",
url: "https://odyssey.storyscan.xyz",
name: 'Story Testnet Explorer',
url: 'https://testnet.storyscan.xyz',
},
},
testnet: true,
Expand All @@ -48,6 +49,7 @@ export const SmartWalletMainnet = {
POLYGON: Blockchain.POLYGON,
OPTIMISM: Blockchain.OPTIMISM,
ARBITRUM: Blockchain.ARBITRUM,
STORY: Blockchain.STORY,
} as const;
export type SmartWalletMainnet = ObjectValues<typeof SmartWalletMainnet>;
export const SMART_WALLET_MAINNETS = objectValues(SmartWalletMainnet);
Expand Down Expand Up @@ -76,5 +78,6 @@ export const viemNetworks: Record<SmartWalletChain, Chain> = {
"optimism-sepolia": optimismSepolia,
arbitrum: arbitrum,
"arbitrum-sepolia": arbitrumSepolia,
"story-testnet": storyOdyssey,
"story-testnet": storyTestnet,
story: story,
};
3 changes: 2 additions & 1 deletion packages/client/wallets/smart-wallet/src/blockchain/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ function getAlchemyRPC(chain: SmartWalletChain): string {
}

export function getRPC(chain: SmartWalletChain): string {
if (chain === "story-testnet") {
if (chain === "story-testnet" || chain === "story") {
// Story is not supported by Alchemy yet
return viemNetworks[chain].rpcUrls.default.http[0];
}
return getAlchemyRPC(chain);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineChain } from "viem";

export const storyTestnet = defineChain({
id: 1513,
name: 'Story Testnet',
nativeCurrency: {
decimals: 18,
name: 'IP',
symbol: 'IP',
},
rpcUrls: {
default: { http: ['https://testnet.storyrpc.io'] },
},
blockExplorers: {
default: {
name: 'Story Testnet Explorer',
url: 'https://testnet.storyscan.xyz',
},
},
testnet: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineChain } from "viem";

export const story = defineChain({
id: 1514,
name: 'Story',
nativeCurrency: {
decimals: 18,
name: 'IP Token',
symbol: 'IP',
},
rpcUrls: {
default: { http: ['https://mainnet.storyrpc.io'] },
},
testnet: false,
})
1 change: 1 addition & 0 deletions packages/common/base/src/blockchain/types/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const EVMBlockchain = {
ASTAR_ZKEVM: "astar-zkevm",
APEX: "apex",
CHILIZ: "chiliz",
STORY: "story"
} as const;
export type EVMBlockchain = ObjectValues<typeof EVMBlockchain>;
export const EVM_CHAINS = objectValues(EVMBlockchain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const BLOCKCHAIN_TO_COPY_NAME: Record<BlockchainIncludingTestnet, string>
apex: "Apex",
"hypersonic-testnet": "Hypersonic Testnet",
"story-testnet": "Story Testnet",
story: "Story Mainnet",
chiliz: "Chiliz",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const BLOCKCHAIN_TO_CHAIN_ID: Record<EVMBlockchainIncludingTestnet, numbe
"astar-zkevm": 3776,
apex: 70700,
"hypersonic-testnet": 675852,
"story-testnet": 1516,
"story-testnet": 1513,
story: 1514,
chiliz: 88888,
};

Expand Down

0 comments on commit 91cc98a

Please sign in to comment.