Skip to content

Commit

Permalink
Merge pull request #516 from reservoirprotocol/jaden/platf-3966-reser…
Browse files Browse the repository at this point in the history
…voirkit-support-for-nebula

feat: fixing nebula currencies
  • Loading branch information
JadenDurnford authored Jul 15, 2024
2 parents ca51a33 + 42c4b76 commit 6655626
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 30 deletions.
10 changes: 9 additions & 1 deletion hooks/useChainCurrency.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mainnet, sepolia } from 'wagmi/chains'
import { mainnet, sepolia, skaleNebula } from 'wagmi/chains'
import { useMarketplaceChain } from 'hooks'
import { zeroAddress } from 'viem'

Expand All @@ -14,6 +14,14 @@ export default function () {
address: zeroAddress,
chainId: chain?.id || mainnet.id,
}
} else if (chain.id === skaleNebula.id) {
return {
name: 'Europa ETH',
symbol: 'ETH',
decimals: 18,
address: '0xab01bad2c86e24d371a13ed6367bdca819589c5d',
chainId: 1482601649,
}
} else {
return {
...chain.nativeCurrency,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@radix-ui/react-toggle-group": "^1.0.1",
"@radix-ui/react-tooltip": "1.0.6",
"@rainbow-me/rainbowkit": "2.1.2",
"@reservoir0x/reservoir-kit-ui": "2.6.2",
"@reservoir0x/reservoir-kit-ui": "^2.6.3",
"@sentry/nextjs": "^7.85.0",
"@tanstack/react-query": "5.20.2",
"@types/uuid": "^9.0.1",
Expand Down
26 changes: 20 additions & 6 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { WagmiProvider, http } from 'wagmi'
import { chainIdToAlchemyNetworkMap } from 'utils/chainIdToAlchemyNetworkMap'
import { _transports } from '@rainbow-me/rainbowkit/dist/config/getDefaultConfig'
import { Chain, mainnet } from 'viem/chains'
import { Chain, mainnet, skaleNebula } from 'viem/chains'

//CONFIGURABLE: Use nextjs to load your own custom font: https://nextjs.org/docs/basic-features/font-optimization
const inter = Inter({
Expand All @@ -63,14 +63,14 @@ const wagmiConfig = getDefaultConfig({
projectId: WALLET_CONNECT_PROJECT_ID,
chains: (supportedChains.length === 0 ? [mainnet] : supportedChains) as [
Chain,
...Chain[],
...Chain[]
],
ssr: true,
transports: supportedChains.reduce((transportsConfig: _transports, chain) => {
const network = chainIdToAlchemyNetworkMap[chain.id]
if (network && ALCHEMY_API_KEY) {
transportsConfig[chain.id] = http(
`https://${network}.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
`https://${network}.g.alchemy.com/v2/${ALCHEMY_API_KEY}`
)
} else {
transportsConfig[chain.id] = http() // Fallback to default HTTP transport
Expand Down Expand Up @@ -141,14 +141,14 @@ function MyApp({
setRainbowKitTheme(
rainbowDarkTheme({
borderRadius: 'small',
}),
})
)
} else {
setReservoirKitTheme(reservoirLightTheme(reservoirKitThemeOverrides))
setRainbowKitTheme(
rainbowLightTheme({
borderRadius: 'small',
}),
})
)
}
}, [theme])
Expand Down Expand Up @@ -203,14 +203,28 @@ function MyApp({
checkPollingInterval: checkPollingInterval,
paymentTokens: chainPaymentTokensMap[id],
}
},
}
),
logLevel: 4,
source: source,
normalizeRoyalties: NORMALIZE_ROYALTIES,
//CONFIGURABLE: Set your marketplace fee and recipient, (fee is in BPS)
// Note that this impacts orders created on your marketplace (offers/listings)
// marketplaceFees: ['0x03508bB71268BBA25ECaCC8F620e01866650532c:250'],
convertLink:
marketplaceChain.id === skaleNebula.id
? {
customUrl: ({ toCurrency }) => {
if (!toCurrency || toCurrency.symbol === 'ETH') {
return 'https://portal.skale.space/bridge?from=mainnet&to=green-giddy-denebola&token=eth&type=eth'
} else if (toCurrency) {
return `https://portal.skale.space/bridge?from=mainnet&to=green-giddy-denebola&token=${toCurrency.symbol}&type=erc20`
} else {
return 'https://portal.skale.space/bridge?from=mainnet&to=green-giddy-denebola'
}
},
}
: undefined,
}}
theme={reservoirKitTheme}
>
Expand Down
16 changes: 6 additions & 10 deletions utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,25 +423,21 @@ export default [
community: process.env.NEXT_PUBLIC_NEBULA_COMMUNITY,
listingCurrencies: [
{
chainId: 1482601649,
address: '0xab01bad2c86e24d371a13ed6367bdca819589c5d',
contract: '0xab01bad2c86e24d371a13ed6367bdca819589c5d',
symbol: 'ETH',
name: 'Europa ETH',
decimals: 18,
},
{
chainId: 1482601649,
address: '0xcc205196288b7a26f6d43bbd68aaa98dde97276d',
contract: '0xcc205196288b7a26f6d43bbd68aaa98dde97276d',
symbol: 'USDC',
name: 'USDC',
decimals: 18,
decimals: 6,
coinGeckoId: 'usd-coin',
},
{
chainId: 1482601649,
address: '0x7f73b66d4e6e67bcdeaf277b9962addcdabbfc4d',
contract: '0x7f73b66d4e6e67bcdeaf277b9962addcdabbfc4d',
symbol: 'SKL',
name: 'SKL',
decimals: 18,
coinGeckoId: 'skale',
},
],
oracleBidsEnabled: true,
Expand Down
6 changes: 3 additions & 3 deletions utils/paymentTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,14 @@ export const chainPaymentTokensMap = {
chainId: 1482601649,
address: '0xcc205196288b7a26f6d43bbd68aaa98dde97276d',
symbol: 'USDC',
name: 'USDC',
decimals: 18,
name: 'Europa USDC',
decimals: 6,
},
{
chainId: 1482601649,
address: '0x7f73b66d4e6e67bcdeaf277b9962addcdabbfc4d',
symbol: 'SKL',
name: 'SKL',
name: 'Europa SKL',
decimals: 18,
},
],
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1753,10 +1753,10 @@
dependencies:
"@react-hookz/deep-equal" "^1.0.3"

"@reservoir0x/[email protected].2":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-2.6.2.tgz#7a85f3f55090657bcd1e413a3bf0592d79abea8b"
integrity sha512-fPzR+IZdU0Q8g3cFfUdqOAJpGsSHCoanF+IgsJyDU0FUXq+sapPcTZ/bDYz7+oBy9A9qyrR7fhh1rLfUs8dBpg==
"@reservoir0x/reservoir-kit-ui@^2.6.3":
version "2.6.3"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-2.6.3.tgz#2d42a767fb8af7653c8355b0bea9b054788bb2d7"
integrity sha512-VE8anDMGf7d8G1Q796nvkkUC1HWqJG2ZkFi3D0Jp0ODbNPa94+3E7vyts5BOx8Invhi6fyZcqCIEowxFxaNeqA==
dependencies:
"@fortawesome/fontawesome-svg-core" "^6.1.1"
"@fortawesome/free-solid-svg-icons" "^6.1.1"
Expand All @@ -1772,18 +1772,18 @@
"@radix-ui/react-toggle-group" "1.0.4"
"@radix-ui/react-tooltip" "1.0.6"
"@react-hookz/web" "^19.2.0"
"@reservoir0x/reservoir-sdk" "2.3.0"
"@reservoir0x/reservoir-sdk" "2.3.1"
"@stitches/react" "1.3.1-1"
dayjs "^1.11.4"
flatpickr "^4.6.13"
framer-motion "^6.4.2"
react-flatpickr "^3.10.13"
swr "2.0.1"

"@reservoir0x/[email protected].0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-2.3.0.tgz#a0568eee033e12b10f5672fe524f4b64f87488a4"
integrity sha512-u341EVzoOVM+VfG9nSax8mpxRCXbHpiSv25Wa6DYoYg88S2HIAFGDbQea6e7a9AZHA+Whw9dKnGEmDs/Ga4FMw==
"@reservoir0x/[email protected].1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-2.3.1.tgz#f5e16aca360978f5ea3ffc3ed5d666c96a791052"
integrity sha512-wOw61dnxEt/RqHw55dRm13B+YSCe5cqmJZUC4RQCnYFf/lfoGE1DZhu0Wy7E1+fAr5WqbkL3t9e4zTYRJYcoFA==
dependencies:
axios "^1.6.7"

Expand Down

0 comments on commit 6655626

Please sign in to comment.