Skip to content

Commit

Permalink
Merge pull request #822 from reservoirprotocol/devin/1734536661-add-s…
Browse files Browse the repository at this point in the history
…oneium-chain

Add Soneium chain configuration
  • Loading branch information
pedromcunha authored Dec 18, 2024
2 parents db40309 + 1c50b5f commit 3cad8b5
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/curly-comics-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@reservoir0x/reservoir-sdk': patch
'@reservoir0x/reservoir-kit-ui': patch
---

Add Soneium chain configuration (Chain ID: 1868)
3 changes: 3 additions & 0 deletions demo/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,7 @@ export default [
{
...reservoirChains.creatorTestnet,
},
{
...reservoirChains.soneium,
},
]
25 changes: 25 additions & 0 deletions packages/sdk/src/utils/customChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,30 @@ export const creatorTestnet = {
},
} as const satisfies Chain

export const soneium = {
id: 1868,
name: 'Soneium',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['http://yellow-flash-rpc.dwellir.com'],
},
public: {
http: ['http://yellow-flash-rpc.dwellir.com'],
},
},
blockExplorers: {
etherscan: {
name: 'Soneium Explorer',
url: 'https://vk9a3tgpne6qmub8.blockscout.com',
},
default: {
name: 'Soneium Explorer',
url: 'https://vk9a3tgpne6qmub8.blockscout.com',
},
},
} as const satisfies Chain

export const customChains = {
ancient8,
ancient8Testnet,
Expand Down Expand Up @@ -1036,4 +1060,5 @@ export const customChains = {
monadDevnet,
game7,
creatorTestnet,
soneium,
} 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 @@ -306,6 +306,24 @@ export const chainPaymentTokensMap = {
},
],

// Soneium
1868: [
{
chainId: 1868,
address: zeroAddress,
symbol: 'ETH',
name: 'Soneium ETH',
decimals: 18,
},
{
chainId: 1868,
address: '0x4200000000000000000000000000000000000006',
symbol: 'WETH',
name: 'WETH',
decimals: 18,
},
],

// Bsc
56: [
{
Expand Down
9 changes: 9 additions & 0 deletions packages/sdk/src/utils/reservoirChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,14 @@ const creatorTestnet = {
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

const soneium = {
id: 1868,
name: 'Soneium',
baseApiUrl: 'https://api-soneium.reservoir.tools',
paymentTokens: chainPaymentTokensMap[1868],
checkPollingInterval: 1000,
} satisfies ReservoirBaseChain

export const reservoirChains = {
mainnet,
polygon,
Expand Down Expand Up @@ -560,4 +568,5 @@ export const reservoirChains = {
monadDevnet,
game7,
creatorTestnet,
soneium,
}
4 changes: 2 additions & 2 deletions packages/sdk/tests/unit/ExecuteSteps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { mainnet } from 'viem/chains'
import signatureStepDataEIP712 from '../data/signatureStepEIP712.json'
import signatureStepDataEIP191 from '../data/signatureStepEIP191.json'
import transactionStepData from '../data/transactionStep.json'
import multiTransactionStep from '../data/multiTransactionStep.json'
import multiTransactionStep from '../data/multitransactionStep.json'

function delay(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
Expand Down Expand Up @@ -129,7 +129,7 @@ beforeEach(() => {
jest.clearAllMocks()
jest.resetModules()
transactionStepData.steps.forEach(step => step.items.forEach(item => item.status = 'incomplete'))
multiTransactionStep.steps.forEach(step => step.items.forEach(item => item.status = 'incomplete'))
multiTransactionStep.steps.forEach((step: { items: Array<{ status: string }> }) => step.items.forEach((item: { status: string }) => item.status = 'incomplete'))
signatureStepDataEIP712.steps.forEach(step => step.items.forEach(item => item.status = 'incomplete'))
signatureStepDataEIP191.steps.forEach(step => step.items.forEach(item => item.status = 'incomplete'))
sendTransactionSpyTriggerTimes = []
Expand Down
17 changes: 11 additions & 6 deletions packages/ui/src/constants/chainIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ import ShapeIconColor from '../img/chains/ShapeIconColor'
import AbstractIconLight from '../img/chains/AbstractIconLight'
import AbstractIconDark from '../img/chains/AbstractIconDark'
import AbstractIconColor from '../img/chains/AbstractIconColor'
import MinatoIconLight from '../img/chains/MinatoIconLight'
import MinatoIconDark from '../img/chains/MinatoIconDark'
import MinatoIconColor from '../img/chains/MinatoIconColor'
import HychainIconLight from '../img/chains/HychainIconLight'
import HychainIconDark from '../img/chains/HychainIconDark'
import HychainIconColor from '../img/chains/HychainIconColor'
Expand All @@ -127,6 +124,9 @@ import MonadIconColor from '../img/chains/MonadIconColor'
import CreatorTestnetIconLight from '../img/chains/CreatorTestnetIconLight'
import CreatorTestnetIconDark from '../img/chains/CreatorTestnetIconDark'
import CreatorTestnetIconColor from '../img/chains/CreatorTestnetIconColor'
import SoneiumIconLight from '../img/chains/SoneiumIconLight'
import SoneiumIconDark from '../img/chains/SoneiumIconDark'
import SoneiumIconColor from '../img/chains/SoneiumIconColor'

const chainIcons = {
[reservoirChains.ancient8.id]: {
Expand Down Expand Up @@ -381,9 +381,9 @@ const chainIcons = {
color: <AbstractIconColor />,
},
[reservoirChains.minato.id]: {
light: <MinatoIconLight />,
dark: <MinatoIconDark />,
color: <MinatoIconColor />,
light: <SoneiumIconLight />,
dark: <SoneiumIconDark />,
color: <SoneiumIconColor />,
},
[reservoirChains.hychain.id]: {
light: <HychainIconLight />,
Expand Down Expand Up @@ -435,6 +435,11 @@ const chainIcons = {
dark: <CreatorTestnetIconDark />,
color: <CreatorTestnetIconColor />,
},
[reservoirChains.soneium.id]: {
light: <SoneiumIconLight />,
dark: <SoneiumIconDark />,
color: <SoneiumIconColor />,
},
}

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 @@ -60,5 +60,6 @@ const wrappedContractNames: Record<number, string> = {
41454: 'WMON', // monad devnet
2187: 'WG7', //game7
4654: 'WETH', // creator testnet
1868: 'WETH', // Soneium
}
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 @@ -60,6 +60,7 @@ const wrappedContracts: Record<number, string> = {
41454: '0x3c6dd29e612b28c10f3ee9bacf0f4af5f17b3f3e', // monad devnet
2187: '0xfa3ed70386b9255fC04aA008A8ad1B0CDa816Fac', //game7
4654: '0x34AF38Ec07708dBC01C5A814fc418D3840448fce', // creator testnet
1868: '0x4200000000000000000000000000000000000006', // Soneium
}

export default wrappedContracts

0 comments on commit 3cad8b5

Please sign in to comment.