Skip to content

Commit

Permalink
Merge branch 'ted/grwth-4238-enable-oracle-cancellation-on-all-chains…
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-palmer committed Apr 10, 2024
2 parents c96bbf1 + d1fc8ba commit 78ffaf4
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 29 deletions.
8 changes: 4 additions & 4 deletions components/portfolio/BatchListings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ const BatchListings: FC<Props> = ({
return (
prevListings?.map((listing) => {
if (
listing.token.token?.collection?.floorAskPrice?.amount?.decimal &&
listing.token.token?.collection?.floorAskPrice.currency
listing.token.token?.collection?.floorAsk?.price?.amount?.decimal &&
listing.token.token?.collection?.floorAsk?.price?.currency
) {
return {
...listing,
price:
listing.token.token.collection.floorAskPrice.amount.decimal.toString(),
currency: listing.token.token?.collection?.floorAskPrice
listing.token.token.collection?.floorAsk?.price?.amount.decimal.toString(),
currency: listing.token.token?.collection?.floorAsk?.price
.currency as Currency,
}
}
Expand Down
14 changes: 7 additions & 7 deletions components/portfolio/BatchListingsTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,26 +290,26 @@ export const BatchListingsTableRow: FC<BatchListingsTableRowProps> = ({
size="large"
css={{ minWidth: 'max-content', minHeight: 48, py: 14 }}
disabled={
!listing.token?.token?.collection?.floorAskPrice?.amount
!listing.token?.token?.collection?.floorAsk?.price?.amount
?.decimal
}
onClick={() => {
if (
listing.token?.token?.collection?.floorAskPrice?.amount
listing.token?.token?.collection?.floorAsk?.price?.amount
?.decimal
) {
handlePriceChange(
listing.token?.token?.collection?.floorAskPrice?.amount?.decimal?.toString()
listing.token?.token?.collection?.floorAsk?.price?.amount?.decimal?.toString()
)
}
}}
>
Floor
</Button>
{listing.token?.token?.collection?.floorAskPrice?.amount
{listing.token?.token?.collection?.floorAsk?.price?.amount
?.decimal ? (
<Text style="subtitle3" color="subtle">
{`${listing.token?.token?.collection?.floorAskPrice?.amount?.decimal} ${listing.token?.token?.collection?.floorAskPrice?.currency?.symbol}`}
{`${listing.token?.token?.collection?.floorAsk?.price?.amount?.decimal} ${listing.token?.token?.collection?.floorAsk?.price?.currency?.symbol}`}
</Text>
) : null}
</Flex>
Expand All @@ -330,8 +330,8 @@ export const BatchListingsTableRow: FC<BatchListingsTableRowProps> = ({
<Text style="subtitle3" color="subtle">
{topTraitPrice}{' '}
{
listing.token?.token?.collection?.floorAskPrice?.currency
?.symbol
listing.token?.token?.collection?.floorAsk?.price
?.currency?.symbol
}
</Text>
) : null}
Expand Down
18 changes: 12 additions & 6 deletions components/portfolio/TokenTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,14 @@ const TokenTableRow: FC<TokenTableRowProps> = ({
Floor
</Text>
<FormatCryptoCurrency
amount={token?.token?.collection?.floorAskPrice?.amount?.decimal}
amount={
token?.token?.collection?.floorAsk?.price?.amount?.decimal
}
address={
token?.token?.collection?.floorAskPrice?.currency?.contract
token?.token?.collection?.floorAsk?.price?.currency?.contract
}
decimals={
token?.token?.collection?.floorAskPrice?.currency?.decimals
token?.token?.collection?.floorAsk?.price?.currency?.decimals
}
textStyle="subtitle2"
logoHeight={14}
Expand Down Expand Up @@ -789,9 +791,13 @@ const TokenTableRow: FC<TokenTableRowProps> = ({
</TableCell>
<TableCell>
<FormatCryptoCurrency
amount={token?.token?.collection?.floorAskPrice?.amount?.decimal}
address={token?.token?.collection?.floorAskPrice?.currency?.contract}
decimals={token?.token?.collection?.floorAskPrice?.currency?.decimals}
amount={token?.token?.collection?.floorAsk?.price?.amount?.decimal}
address={
token?.token?.collection?.floorAsk?.price?.currency?.contract
}
decimals={
token?.token?.collection?.floorAsk?.price?.currency?.decimals
}
textStyle="subtitle1"
logoHeight={14}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/rankings/MintRankingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const RankingsTableRow: FC<RankingsTableRowProps> = ({ mint, rank }) => {
return optimizeImage(mint?.image || mint?.sampleImages?.[0], 250)
}, [mint.image])

const mintPrice = mint.mintPrice?.toString()
const mintPrice = mint.mintPrice

const sampleImages: string[] = mint?.sampleImages || []

Expand Down Expand Up @@ -217,7 +217,7 @@ const RankingsTableRow: FC<RankingsTableRowProps> = ({ mint, rank }) => {
justify="start"
css={{ height: '100%' }}
>
{mintPrice !== '0' ? (
{mintPrice ? (
<FormatCryptoCurrency
amount={mintPrice}
textStyle="subtitle1"
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.0.0",
"@reservoir0x/reservoir-kit-ui": "2.3.7",
"@reservoir0x/reservoir-kit-ui": "2.4.0",
"@sentry/nextjs": "^7.85.0",
"@tanstack/react-query": "5.20.2",
"@types/uuid": "^9.0.1",
Expand Down
16 changes: 16 additions & 0 deletions utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default [
contract: usdcContracts[arbitrum.id],
},
],
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.arbitrum.checkPollingInterval,
},
{
Expand All @@ -181,6 +182,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_BASE_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_BASE_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.base.checkPollingInterval,
},
{
Expand All @@ -202,6 +204,7 @@ export default [
contract: usdcContracts[optimism.id],
},
],
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.optimism.checkPollingInterval,
},
{
Expand All @@ -213,6 +216,7 @@ export default [
proxyApi: '/api/reservoir/zora',
routePrefix: 'zora',
coingeckoId: 'ethereum',
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.zora.checkPollingInterval,
},
{
Expand All @@ -233,6 +237,7 @@ export default [
contract: usdcContracts[bsc.id],
},
],
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.bsc.checkPollingInterval,
},
{
Expand All @@ -243,6 +248,7 @@ export default [
proxyApi: '/api/reservoir/opbnb',
routePrefix: 'opbnb',
coingeckoId: 'binancecoin',
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.opBnb.checkPollingInterval,
},
{
Expand All @@ -253,6 +259,7 @@ export default [
proxyApi: '/api/reservoir/ancient8',
routePrefix: 'ancient8',
coingeckoId: 'ethereum',
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.ancient8.checkPollingInterval,
},
{
Expand All @@ -265,6 +272,7 @@ export default [
coingeckoId: 'avalanche-2',
collectionSetId: process.env.NEXT_PUBLIC_AVALANCHE_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_AVALANCHE_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.avalanche.checkPollingInterval,
},
{
Expand All @@ -277,6 +285,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_ARBITRUM_NOVA_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ARBITRUM_NOVA_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.arbitrumNova.checkPollingInterval,
},
{
Expand All @@ -289,6 +298,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_LINEA_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_LINEA_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.linea.checkPollingInterval,
},
{
Expand All @@ -302,6 +312,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_POLYGON_ZKEVM_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_POLYGON_ZKEVM_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.polygonZkEvm.checkPollingInterval,
},
{
Expand All @@ -316,6 +327,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_ZKSYNC_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ZKSYNC_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.zkSync.checkPollingInterval,
},
{
Expand All @@ -330,6 +342,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_SCROLL_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_SCROLL_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.scroll.checkPollingInterval,
},
{
Expand All @@ -344,6 +357,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_APE_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_APEX_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.apexPop.checkPollingInterval,
},
{
Expand All @@ -358,6 +372,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_BLAST_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_BLAST_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.blast.checkPollingInterval,
},
{
Expand All @@ -372,6 +387,7 @@ export default [
coingeckoId: 'ethereum',
collectionSetId: process.env.NEXT_PUBLIC_ASTAR_ZKEVM_COLLECTION_SET_ID,
community: process.env.NEXT_PUBLIC_ASTAR_ZKEVM_COMMUNITY,
oracleBidsEnabled: true,
checkPollingInterval: reservoirChains.astarZkEVM.checkPollingInterval,
},
] as ReservoirChain[]
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1888,10 +1888,10 @@
dependencies:
merge-options "^3.0.4"

"@reservoir0x/reservoir-kit-ui@2.3.7":
version "2.3.7"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-2.3.7.tgz#33ecdf5ed57922ba999e1902268ea9cba1c826cb"
integrity sha512-ns+vtkBOB2lrj1GUW0yiX4/M/8GWZhG97f3q4htWY5laRuSLF5Nhx6tdiu2BEHL0v6yJLeQG3JPdJ4nxSXkfMA==
"@reservoir0x/reservoir-kit-ui@2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-2.4.0.tgz#3a2114170c901552ff316105a7605d226eeac8de"
integrity sha512-j+V3tQah77grMwhWjPQdRDCslmOIa6moyVaFPerHhZAMVhdYJ+DFtb2RdLa4j/RusS74HKhszfAWPFQacokA1g==
dependencies:
"@fortawesome/fontawesome-svg-core" "^6.1.1"
"@fortawesome/free-solid-svg-icons" "^6.1.1"
Expand All @@ -1907,18 +1907,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.0.7"
"@reservoir0x/reservoir-sdk" "2.0.9"
"@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].7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-2.0.7.tgz#4d3c2a8bb0059c2c925f7bf74934390ad8f12fc4"
integrity sha512-HimR3H1urwiYeWOME2XZd/2nkclkHjq0jEM5wAJa46zM3k6GjGMThp95Jg/LV6cV2Cu4ydD68zSrRpwnQTvbCQ==
"@reservoir0x/[email protected].9":
version "2.0.9"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-2.0.9.tgz#a2baffbfb9a17ed8340ef7a8404a505590c7cae2"
integrity sha512-kDuwq8wtL8DydyqQFjmVbu9zYORNOZWNplU8i+TftswjfMOpHkmuNxjg83HiJX0QWhZ51TY3j0dx9CiTcxDF4w==
dependencies:
axios "^1.6.7"

Expand Down

0 comments on commit 78ffaf4

Please sign in to comment.