Skip to content

Commit

Permalink
Only enable oracle bidding on supported chains
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromcunha committed Sep 14, 2023
1 parent a3e7613 commit b179fbd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/buttons/Bid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const Bid: FC<Props> = ({
openState={openState}
feesBps={orderFees}
currencies={bidCurrencies}
oracleEnabled={true}
oracleEnabled={marketplaceChain.oracleBidsEnabled}
chainId={marketplaceChain.id}
onClose={(data, stepData, currentStep) => {
if (mutate && currentStep == BidStep.Complete) mutate()
Expand Down
2 changes: 1 addition & 1 deletion components/buttons/CollectionOffer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const CollectionOffer: FC<Props> = ({
attribute={attribute}
feesBps={orderFees}
currencies={bidCurrencies}
oracleEnabled={true}
oracleEnabled={marketplaceChain.oracleBidsEnabled}
chainId={marketplaceChain.id}
onClose={(data, stepData, currentStep) => {
if (mutate && currentStep == BidStep.Complete) mutate()
Expand Down
13 changes: 12 additions & 1 deletion utils/chains.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { Currency } from '@reservoir0x/reservoir-kit-ui'
import wrappedContracts from './wrappedContracts'
import { zeroAddress } from 'viem'
import { arbitrum, mainnet, polygon, optimism, Chain, bsc, avalanche } from 'wagmi/chains'
import {
arbitrum,
mainnet,
polygon,
optimism,
Chain,
bsc,
avalanche,
} from 'wagmi/chains'
import usdcContracts from './usdcContracts'

//Chains that are missing from wagmi:
Expand Down Expand Up @@ -134,6 +142,7 @@ export type ReservoirChain = Chain & {
community?: string
wssUrl?: string
listingCurrencies?: Currency[]
oracleBidsEnabled?: boolean
}

const nativeCurrencyBase = {
Expand Down Expand Up @@ -184,6 +193,7 @@ export const DefaultChain: ReservoirChain = {
contract: usdcContracts[mainnet.id],
},
],
oracleBidsEnabled: true,
}

export default [
Expand Down Expand Up @@ -218,6 +228,7 @@ export default [
coinGeckoId: 'weth',
},
],
oracleBidsEnabled: true,
},
{
...arbitrum,
Expand Down

0 comments on commit b179fbd

Please sign in to comment.