Skip to content

Commit

Permalink
Merge pull request #836 from reservoirprotocol/devin/1736782328-add-s…
Browse files Browse the repository at this point in the history
…tory-odyssey-chain

feat: add Story Odyssey chain support
  • Loading branch information
JadenDurnford authored Jan 13, 2025
2 parents b159555 + 076b1ab commit 8cc30f7
Show file tree
Hide file tree
Showing 12 changed files with 151 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/story-odyssey-chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@reservoir0x/reservoir-sdk": patch
"@reservoir0x/reservoir-kit-ui": patch
"reservoir-kit-demo": patch
---

feat: add Story Odyssey chain support
1 change: 1 addition & 0 deletions demo/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const chains = [
customChains.monadDevnet,
customChains.game7,
customChains.blast,
customChains.storyOdyssey,
] as [Chain, ...Chain[]]

const wagmiConfig = getDefaultConfig({
Expand Down
3 changes: 3 additions & 0 deletions demo/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,7 @@ export default [
{
...reservoirChains.soneium,
},
{
...reservoirChains.storyOdyssey,
},
]
25 changes: 25 additions & 0 deletions packages/sdk/src/utils/customChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,30 @@ export const soneium = {
},
} as const satisfies Chain

export const storyOdyssey = {
id: 1516,
name: 'Story Odyssey',
nativeCurrency: { name: 'IP', symbol: 'IP', decimals: 18 },
rpcUrls: {
default: {
http: ['https://rpc.odyssey.storyrpc.io'],
},
public: {
http: ['https://rpc.odyssey.storyrpc.io'],
},
},
blockExplorers: {
etherscan: {
name: 'Story Odyssey Explorer',
url: 'https://odyssey.storyscan.xyz',
},
default: {
name: 'Story Odyssey Explorer',
url: 'https://odyssey.storyscan.xyz',
},
},
} as const satisfies Chain

export const customChains = {
ancient8,
ancient8Testnet,
Expand Down Expand Up @@ -1098,4 +1122,5 @@ export const customChains = {
game7,
creatorTestnet,
soneium,
storyOdyssey,
} as const satisfies Record<string, Chain>
18 changes: 18 additions & 0 deletions packages/sdk/src/utils/paymentTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,4 +1189,22 @@ export const chainPaymentTokensMap = {
decimals: 18,
},
],

// Story Odyssey
1516: [
{
chainId: 1516,
address: zeroAddress,
symbol: 'IP',
name: 'IP',
decimals: 18,
},
{
chainId: 1516,
address: '0x1516000000000000000000000000000000000000',
symbol: 'WIP',
name: 'WIP',
decimals: 18,
},
],
} as Record<number, PaymentToken[]>
9 changes: 9 additions & 0 deletions packages/sdk/src/utils/reservoirChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,14 @@ const soneium = {
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

const storyOdyssey = {
id: 1516,
name: 'Story Odyssey',
baseApiUrl: 'https://api-story-odyssey.reservoir.tools',
paymentTokens: chainPaymentTokensMap[1516],
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

export const reservoirChains = {
mainnet,
polygon,
Expand Down Expand Up @@ -569,4 +577,5 @@ export const reservoirChains = {
game7,
creatorTestnet,
soneium,
storyOdyssey,
}
8 changes: 8 additions & 0 deletions packages/ui/src/constants/chainIcons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from 'react'
import { reservoirChains } from '@reservoir0x/reservoir-sdk'
import StoryOdysseyIconDark from '../img/chains/StoryOdysseyIconDark'
import StoryOdysseyIconLight from '../img/chains/StoryOdysseyIconLight'
import StoryOdysseyIconColor from '../img/chains/StoryOdysseyIconColor'
import MainnetIconDark from '../img/chains/MainnetIconDark'
import MainnetIconLight from '../img/chains/MainnetIconLight'
import PolygonIconDark from '../img/chains/PolygonIconDark'
Expand Down Expand Up @@ -440,6 +443,11 @@ const chainIcons = {
dark: <SoneiumIconDark />,
color: <SoneiumIconColor />,
},
[reservoirChains.storyOdyssey.id]: {
light: <StoryOdysseyIconLight />,
dark: <StoryOdysseyIconDark />,
color: <StoryOdysseyIconColor />,
},
}

export default chainIcons
1 change: 1 addition & 0 deletions packages/ui/src/constants/wrappedContractNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ const wrappedContractNames: Record<number, string> = {
2187: 'WG7', //game7
4654: 'WETH', // creator testnet
1868: 'WETH', // Soneium
1516: 'WIP', // Story Odyssey
}
export default wrappedContractNames
1 change: 1 addition & 0 deletions packages/ui/src/constants/wrappedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const wrappedContracts: Record<number, string> = {
2187: '0xfa3ed70386b9255fC04aA008A8ad1B0CDa816Fac', //game7
4654: '0x34AF38Ec07708dBC01C5A814fc418D3840448fce', // creator testnet
1868: '0x4200000000000000000000000000000000000006', // Soneium
1516: '0x1516000000000000000000000000000000000000', // Story Odyssey
}

export default wrappedContracts
26 changes: 26 additions & 0 deletions packages/ui/src/img/chains/StoryOdysseyIconColor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'

const StoryOdysseyIconColor = () => (
<svg
width="auto"
height="100%"
viewBox="0 0 60 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="30" cy="30" r="30" fill="#4F46E5"/>
<text
x="30"
y="30"
textAnchor="middle"
dominantBaseline="middle"
fill="white"
fontSize="24"
fontFamily="Arial"
>
SO
</text>
</svg>
)

export default StoryOdysseyIconColor
26 changes: 26 additions & 0 deletions packages/ui/src/img/chains/StoryOdysseyIconDark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'

const StoryOdysseyIconDark = () => (
<svg
width="auto"
height="100%"
viewBox="0 0 60 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="30" cy="30" r="30" fill="#11181C"/>
<text
x="30"
y="30"
textAnchor="middle"
dominantBaseline="middle"
fill="white"
fontSize="24"
fontFamily="Arial"
>
SO
</text>
</svg>
)

export default StoryOdysseyIconDark
26 changes: 26 additions & 0 deletions packages/ui/src/img/chains/StoryOdysseyIconLight.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'

const StoryOdysseyIconLight = () => (
<svg
width="auto"
height="100%"
viewBox="0 0 60 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="30" cy="30" r="30" fill="#ECEDEE"/>
<text
x="30"
y="30"
textAnchor="middle"
dominantBaseline="middle"
fill="#11181C"
fontSize="24"
fontFamily="Arial"
>
SO
</text>
</svg>
)

export default StoryOdysseyIconLight

0 comments on commit 8cc30f7

Please sign in to comment.