diff --git a/ui/LICENSE.md b/ui/LICENSE.md
deleted file mode 100644
index b713b4c95..000000000
--- a/ui/LICENSE.md
+++ /dev/null
@@ -1,203 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright 2023 MoonDAO and individual contributors
-
-Copyright 2021 Non-Fungible Labs, Inc
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/ui/NOTICE.md b/ui/NOTICE.md
deleted file mode 100644
index 9ae4f80e5..000000000
--- a/ui/NOTICE.md
+++ /dev/null
@@ -1,7 +0,0 @@
-MoonDAO
-
-Copyright 2023 MoonDAO and individual contributors
-
-The inital Developer of some parts of the framework, which are copied from, derived from,
-or inspired by [ThirdwebExample](https://github.com/thirdweb-example/marketplace-v3), is Non-Fungible Labs, Incorporated.
-Copyright 2021 Non-fungible Labs, Incorporated. All Rights Reserved.
\ No newline at end of file
diff --git a/ui/archive/announcements.tsx b/ui/archive/announcements.tsx
deleted file mode 100644
index d0b575cb1..000000000
--- a/ui/archive/announcements.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-import useTranslation from 'next-translate/useTranslation'
-import React, { useCallback, useRef } from 'react'
-import { useAnnouncements } from '../lib/dashboard/hooks'
-import { errorToast } from '../lib/utils/errorToast'
-import Announcement from '../components/dashboard/announcements/Announcement'
-import AnnouncementSkeletons from '../components/dashboard/announcements/AnnouncementSkeletons'
-import Head from '../components/layout/Head'
-import Header from '../components/layout/Header'
-import Line from '../components/layout/Line'
-
-export default function Announcements() {
- const { announcements, isLoading, error, updateAnnouncements } =
- useAnnouncements()
-
- const firstPostId = '916126920339509268'
-
- const lastPostId = announcements.length
- ? announcements[announcements.length - 1].id
- : ''
-
- const intObserver: any = useRef()
- const lastPostRef = useCallback(
- (announcement: any) => {
- if (isLoading) return
- if (intObserver.current) intObserver.current.disconnect()
-
- intObserver.current = new IntersectionObserver(async (entries) => {
- if (entries[0].isIntersecting && lastPostId !== firstPostId) {
- await updateAnnouncements(lastPostId)
- }
- })
-
- if (announcement) intObserver.current.observe(announcement)
- },
- [isLoading]
- )
-
- if (error)
- errorToast(
- 'Connection with Discord failed. Contact MoonDAO if the problem persists 🚀'
- )
-
- const { t } = useTranslation('common')
- return (
-
-
-
-
-
-
- {(isLoading && !announcements.length) || error ? (
-
- ) : (
-
- {announcements &&
- announcements.length &&
- announcements.map((e: any, i: number) =>
- i + 1 === announcements.length ? (
-
- ) : (
-
- )
- )}
-
- {lastPostId !== firstPostId ? (
-
- Loading more announcements...
-
- ) : (
-
- window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
- }
- className="mt-10 flex items-center rounded-xl border-[0.5px] border-gray-300 dark:border-gray-100 bg-gradient-to-br from-zinc-100 to-gray-200 px-2 py-1 lg:px-3 shadow-sm font-mono font-semibold hover:scale-105 dark:from-slate-950 dark:to-gray-950 dark:text-gray-100 shadow-blue-400 dark:shadow-indigo-100 lg:text-lg 2xl:text-xl"
- >
- Back to the top →
-
- )}
-
- )}
-
-
- )
-}
diff --git a/ui/archive/components/ContributionModal.tsx b/ui/archive/components/ContributionModal.tsx
deleted file mode 100644
index 0aebc8a4c..000000000
--- a/ui/archive/components/ContributionModal.tsx
+++ /dev/null
@@ -1,396 +0,0 @@
-// //New
-// import { Dialog, Transition } from '@headlessui/react'
-// import { CheckIcon } from '@heroicons/react/24/outline'
-// import { useWallets } from '@privy-io/react-auth'
-// import { useAddress, useContract } from '@thirdweb-dev/react'
-// import { BigNumber, ethers } from 'ethers'
-// import Image from 'next/image'
-// import { useContext, useEffect, useState, Fragment } from 'react'
-// import React from 'react'
-// import toast from 'react-hot-toast'
-// import { useLightAccount } from '../../lib/alchemy/useLightAccount'
-// import { useMoonPay } from '../../lib/privy/hooks/useMoonPay'
-// import PrivyWalletContext from '../../lib/privy/privy-wallet-context'
-// import { useTokenAllowance, useTokenApproval } from '../../lib/tokens/approve'
-// import { useVMOONEYCreateLock } from '../../lib/tokens/ve-token'
-// import { ETH, MOONEY } from '../../lib/uniswap/UniswapTokens'
-// import { useSwapRouter } from '../../lib/uniswap/hooks/useSwapRouter'
-// import { PrivyWeb3Button } from '../../components/privy/PrivyWeb3Button'
-// import { VMOONEY_ADDRESSES, MOONEY_ADDRESSES } from '../../const/config'
-
-// type ContributionModalProps = {
-// selectedLevel: number
-// setSelectedLevel: Function
-// }
-
-// export function ContributionModal({
-// selectedLevel,
-// setSelectedLevel,
-// }: ContributionModalProps) {
-// const address = useAddress()
-// const [enabled, setEnabled] = useState(false)
-// const [paymentMethod, setPaymentMethod] = useState('ethereum')
-
-// //Privy
-// const { selectedWallet } = useContext(PrivyWalletContext)
-// const { wallets } = useWallets()
-
-// //MoonPay
-// const fund = useMoonPay()
-
-// //Alchemy
-// // const lightAccountProvider = useLightAccount(wallets)
-
-// //Uniswap
-// const [swapRoute, setSwapRoute] = useState()
-// const { generateRoute, executeRoute } = useSwapRouter(
-// selectedLevel,
-// ETH,
-// MOONEY
-// )
-
-// //Thirdweb
-// const { contract: mooneyContract }: any = useContract(
-// MOONEY_ADDRESSES['ethereum']
-// )
-// const { contract: vMooneyContract }: any = useContract(
-// VMOONEY_ADDRESSES['ethereum']
-// )
-
-// const { data: tokenAllowance } = useTokenAllowance(
-// mooneyContract,
-// address,
-// VMOONEY_ADDRESSES['ethereum']
-// )
-
-// const { mutateAsync: approveToken } = useTokenApproval(
-// mooneyContract,
-// ethers.utils.parseEther(swapRoute?.route[0]?.rawQuote.toString() || '0'),
-// BigNumber.from(0),
-// VMOONEY_ADDRESSES['ethereum']
-// )
-
-// const { mutateAsync: createLock } = useVMOONEYCreateLock(
-// vMooneyContract,
-// ethers.utils.parseEther(selectedLevel.toString()),
-// Date.now() + 1000 * 60 * 60 * 24 * 365 * 2 //2 years
-// )
-
-// function exitModal() {
-// setEnabled(false)
-// setSelectedLevel(0)
-// }
-
-// useEffect(() => {
-// if (selectedLevel > 0) setEnabled(true)
-// generateRoute().then((swapRoute: any) => setSwapRoute(swapRoute))
-// }, [selectedLevel])
-
-// return (
-//
-//
-//
-//
-//
-
-//
-//
-//
-//
-// {/*Title and explanation*/}
-//
-//
-//
-// Payment Method
-//
-//
-//
-// Choose your preferred payment method to get started
-//
-//
-//
-//
-
-// {/*Payment methods*/}
-//
-//
setPaymentMethod('eth')}
-// >
-//
-//
Ethereum
-//
-
-//
setPaymentMethod('card')}
-// >
-//
-
-//
Credit Card
-//
-
-//
-//
-//
-// 1
-//
-//
-// Create or login to an existing MoonPay account
-//
-//
-//
-//
-// 2
-//
-//
-// Use your credit or debit card to complete a single
-// transaction
-//
-//
-//
-//
-
-// {/*Web3 purchase button, hidden because it wasn't in the figma*/}
-// {
-// const selectedWalletType =
-// wallets[selectedWallet].walletClientType
-// const provider: any = await wallets[
-// selectedWallet
-// ].getEthersProvider()
-
-// const nativeBalance = await provider.getBalance(
-// wallets[selectedWallet].address
-// )
-
-// const formattedNativeBalance =
-// ethers.utils.formatEther(nativeBalance)
-
-// if (
-// +formattedNativeBalance < selectedLevel ||
-// paymentMethod === 'card'
-// ) {
-// paymentMethod !== 'card' &&
-// toast(
-// 'This wallet does not have enough matic to purchase the tier, please fund your wallet with moonpay or an alternative method.'
-// )
-// return setTimeout(async () => {
-// await fund(selectedLevel - +formattedNativeBalance)
-// }, 3000)
-// }
-
-// //if the wallet is a privy embedded wallet, batch the transactions
-// //if the wallet is an external wallet (metamask, coinbase, etc), execute the transactions one by one
-
-// // if (selectedWalletType === 'privy') {
-// // //swap, approve, lock
-// // const ethersMooneyContract = new Contract(
-// // MOONEY_ADDRESSES['ethereum'],
-// // ERC20.abi,
-// // signer
-// // )
-
-// // const ethersVMooneyContract = new Contract(
-// // VMOONEY_ADDRESSES['ethereum'],
-// // VotingEscrow.abi,
-// // signer
-// // )
-
-// // const approveMooneyCallData =
-// // ethersMooneyContract.interface.encodeFunctionData(
-// // 'approve',
-// // [
-// // VMOONEY_ADDRESSES['ethereum'],
-// // swapRoute.route[0].rawQuote,
-// // ]
-// // )
-// // const createLockCallData =
-// // ethersVMooneyContract.interface.encodeFunctionData(
-// // 'create_lock',
-// // [
-// // ethers.utils.parseEther(selectedLevel.toString()),
-// // Math.floor(
-// // Number(
-// // Date.now() + 1000 * 60 * 60 * 24 * 365 * 2
-// // ) / 1000
-// // ),
-// // ]
-// // )
-
-// // const batchTx = await provider.sendTransactions([
-// // {
-// // to: V3_SWAP_ROUTER_ADDRESS,
-// // data: swapRoute?.methodParameters?.calldata,
-// // value: swapRoute?.methodParameters?.value,
-// // },
-// // {
-// // to: MOONEY_ADDRESSES['ethereum'],
-// // data: approveMooneyCallData,
-// // },
-// // {
-// // to: VMOONEY_ADDRESSES['ethereum'],
-// // data: createLockCallData,
-// // },
-// // ]).hash
-// // } else {
-// //swap eth for mooney
-// try {
-// const swapTx = await executeRoute(swapRoute)
-// toast('Swap matic/eth for mooney')
-
-// swapTx &&
-// toast.success('Successfully swapped ETH for Mooney')
-
-// //check mooney approval & approve swapped mooney if needed
-// const swappedMooney =
-// +swapRoute?.route[0].rawQuote.toString()
-// if (tokenAllowance < swappedMooney) {
-// const approvalTx = await approveToken()
-// if (!approvalTx)
-// return toast.error(
-// 'Onboarding canceled, user rejected approval'
-// )
-// approvalTx?.receipt &&
-// toast.success(
-// 'Successfully approved MOONEY for lock!'
-// )
-// }
-
-// //create lock for mooney
-// const lockTx = await createLock?.()
-// if (!lockTx)
-// return toast.error(
-// 'Onboarding canceled, user rejected lock'
-// )
-// lockTx?.receipt &&
-// toast.success(
-// 'Successfully locked $MOONEY for Voting Power!'
-// )
-// } catch (err: any) {
-// console.log('There was an issue onboarding', err.message)
-// toast.error('There was an issue onboarding')
-// }
-// // }
-// }}
-// isDisabled={selectedLevel === 0}
-// />
-
-// {/*Close button */}
-// setEnabled(false)}
-// >
-// x
-//
-//
-//
-//
-//
-//
-//
-// )
-// }
-
-// export default ContributionModal
-
-// /*
-
-// X
-// Payment Method:
-// //Select Payment Method
-//
-
-//
setPaymentMethod('eth')}
-// >
-// Ethereum
-//
-
-//
setPaymentMethod('card')}
-// >
-// Credit Card
-//
-
-//
{
-// const provider = await wallets[selectedWallet].getEthersProvider()
-// const nativeBalance = await provider.getBalance(
-// wallets[selectedWallet].address
-// )
-
-// const formattedNativeBalance =
-// ethers.utils.formatEther(nativeBalance)
-
-// // if (
-// // +formattedNativeBalance < selectedLevel ||
-// // paymentMethod === 'card'
-// // ) {
-// // setTimeout(async () => {
-// // await fund(selectedLevel - +formattedNativeBalance)
-// // }, 3000)
-// // }
-
-// //buy mooney on L2 using uniswap
-// const route = await generateRoute()
-
-// const tx = await executeRoute(route)
-// //approve mooney for lock
-// //lock mooney
-// }}
-// isDisabled={selectedLevel === 0}
-// />
-
-//
-
-// */
diff --git a/ui/archive/components/uniswap/CurrencyField.tsx b/ui/archive/components/uniswap/CurrencyField.tsx
deleted file mode 100644
index bfa3ecad8..000000000
--- a/ui/archive/components/uniswap/CurrencyField.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import Image from 'next/image'
-import { useEffect, useRef, useState } from 'react'
-// import { TOKENS } from '../../lib/uniswap/uniswap-config'
-import LoadingSpinner from './LoadingSpinner'
-
-export default function CurrencyField({
- loading,
- value,
- field,
- currentToken,
- setCurrentTokenId,
- balance,
- getSwapPrice,
-}: any) {
- const [dropdown, setDropdown] = useState(false)
-
- // function getPrice(value: any) {
- // getSwapPrice(value)
- // }
- // const inputRef: any = useRef()
-
- // const filteredTokens = TOKENS.filter(
- // ({ name }) => name !== currentToken.name && name !== 'MOONEY'
- // )
-
- // useEffect(() => {
- // if (field === 'input' && inputRef.current?.value > 0) {
- // getPrice(inputRef.current?.value)
- // }
- // }, [currentToken])
-
- return (
-
- {/*
- {loading ? (
-
-
-
- ) : (
-
- field === 'input' && +e.target.value > 0
- ? getPrice(e.target.value)
- : null
- }
- />
- )}
-
-
-
field === 'input' && setDropdown(true)}
- onMouseLeave={() => field === 'input' && setDropdown(false)}
- >
-
-
-
{currentToken.name}
-
- {field === 'input' && dropdown && (
-
-
-
-
{currentToken.name}
-
- {filteredTokens.map((t, i) => (
-
{
- setCurrentTokenId(t.id)
- setDropdown(false)
- }}
- >
-
-
{t.name}
-
- ))}
-
- )}
-
-
-
- Balance:
-
- {Number(balance).toFixed(2)}
-
-
-
*/}
-
- )
-}
diff --git a/ui/archive/components/uniswap/LoadingSpinner.tsx b/ui/archive/components/uniswap/LoadingSpinner.tsx
deleted file mode 100644
index 755f7f64d..000000000
--- a/ui/archive/components/uniswap/LoadingSpinner.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-export default function LoadingSpinner() {
- return (
-
- )
-}
diff --git a/ui/archive/components/uniswap/UniswapMooneySwap.tsx b/ui/archive/components/uniswap/UniswapMooneySwap.tsx
deleted file mode 100644
index 3c868c177..000000000
--- a/ui/archive/components/uniswap/UniswapMooneySwap.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import { useSigner } from '@thirdweb-dev/react'
-import { useState } from 'react'
-// import { TOKENS } from '../../lib/uniswap/uniswap-config'
-import CurrencyField from './CurrencyField'
-import LoadingSpinner from './LoadingSpinner'
-import SwapSettings from './SwapSettings'
-
-export default function UniswapMooneySwap({ account, MOONEYBalance }: any) {
- const signer = useSigner()
- const [slippageAmt, setSlippageAmt] = useState(1)
- const [deadlineMinutes, setDeadlineMinutes] = useState(10)
- const [showModal, setShowModal] = useState(false)
- const [currentTokenId, setCurrentTokenId] = useState(5)
- const [currentETHBalance, setCurrentETHBalance] = useState()
-
- const [inputAmt, setInputAmt] = useState(0)
- const [outputAmt, setOutputAmt] = useState(0)
- const [transaction, setTransaction] = useState()
- const [loading, setLoading] = useState(false)
- const [ratio, setRatio] = useState()
-
- // function getSwapPrice(inputAmt: any) {
- // setLoading(true)
- // setInputAmt(inputAmt)
- // getPrice(
- // signer?.provider,
- // inputAmt,
- // slippageAmt,
- // Math.floor(Date.now() / 1000 + deadlineMinutes * 60),
- // account?.address,
- // currentTokenId
- // ).then((data: any) => {
- // setTransaction(data[0])
- // setOutputAmt(data[1])
- // setRatio(data[2])
- // setLoading(false)
- // })
- // }
-
- return (
-
- {/*
-
setShowModal(!showModal)}
- />
- {showModal && (
-
-
-
- )}
-
-
-
-
- {signer && account?.address ? (
- {
- await swapForMooney(
- inputAmt,
- transaction,
- signer,
- currentTokenId,
- Math.floor(Date.now() / 1000 + deadlineMinutes * 60)
- )
- }}
- >
- Swap
-
- ) : (
-
- )}
-
*/}
-
- )
-}
diff --git a/ui/archive/current-projects.tsx b/ui/archive/current-projects.tsx
deleted file mode 100644
index 7c0dbb7f0..000000000
--- a/ui/archive/current-projects.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react'
-import { useChainDefault } from '@/lib/thirdweb/hooks/useChainDefault'
-import Container from '../components/layout/Container'
-import ContentLayout from '../components/layout/ContentLayout'
-import WebsiteHead from '../components/layout/Head'
-import IndexCardGrid from '../components/layout/IndexCardGrid'
-import { NoticeFooter } from '@/components/layout/NoticeFooter'
-
-const cardData = [
- {
- header: 'New Worlds 2024',
- link: 'https://moondao.com/proposal/153',
- hovertext: 'See Proposal',
- paragraph: (
- <>
- {` The Earthlight Foundation (“EarthLight”) is asking the MoonDAO community to sponsor the New Worlds conference and Space Cowboy Ball at Space Center Houston (Houston, Texas) on 1-2 November 2024. This $20,000 “Spice” sponsorship level will...`}
- >
- ),
- inline: true,
- },
-]
-
-const CurrentProjects: React.FC = () => {
- const title = 'Current Projects'
- const description = ''
- const image = '/assets/moondao-og.jpg'
-
- useChainDefault()
-
- return (
- <>
-
-
-
- Here is what MoonDAO is working on in Q4 2024>}
- preFooter={ }
- mainPadding
- mode="compact"
- popOverEffect={false}
- isProfile
- >
-
-
-
-
-
-
- >
- )
-}
-
-export default CurrentProjects
diff --git a/ui/archive/get-mooney.tsx b/ui/archive/get-mooney.tsx
deleted file mode 100644
index cd51b07fa..000000000
--- a/ui/archive/get-mooney.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useContext } from 'react'
-import ChainContext from '@/lib/thirdweb/chain-context'
-import NetworkSelector from '@/components/thirdweb/NetworkSelector'
-import NativeToMooney from '@/components/uniswap/NativeToMooney'
-
-export default function GetMooney() {
- const { selectedChain, setSelectedChain } = useContext(ChainContext)
-
- return (
-
- )
-}
diff --git a/ui/archive/home.tsx b/ui/archive/home.tsx
deleted file mode 100644
index 3442b49c2..000000000
--- a/ui/archive/home.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import useTranslation from 'next-translate/useTranslation'
-import { useRouter } from 'next/router'
-import Head from '../components/layout/Head'
-
-function HomeCard({ label, text }: any) {
- return (
-
-
-
- {label}
-
-
- {text}
-
-
-
- )
-}
-
-export default function Home() {
- const router = useRouter()
- const { t } = useTranslation('common')
- return (
-
-
-
-
-
-
- Mission Control
-
-
-
VIDEO
-
- {`MoonDAO is accelerating the development of a lunar base through better coordination. Want to help? This flow will onboard you into our community in less than 5 minutes, even if you’re new to Web3.`}
-
-
-
-
-
-
-
- Why Join MoonDAO?
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
- router.push('/join')
- }}
- >
- Join MoonDAO
-
-
-
-
-
- )
-}
diff --git a/ui/archive/marketplace/collection/[contractAddress]/[tokenId].tsx b/ui/archive/marketplace/collection/[contractAddress]/[tokenId].tsx
deleted file mode 100644
index 778d8182a..000000000
--- a/ui/archive/marketplace/collection/[contractAddress]/[tokenId].tsx
+++ /dev/null
@@ -1,381 +0,0 @@
-import { Mumbai, Polygon } from '@thirdweb-dev/chains'
-import {
- MediaRenderer,
- ThirdwebNftMedia,
- getAllDetectedExtensionNames,
- useAddress,
- useContract,
- useMetadata,
- useNFT,
-} from '@thirdweb-dev/react'
-import { GetServerSideProps } from 'next'
-import Link from 'next/link'
-import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
-import { useListingsByTokenId } from '../../../../lib/marketplace/hooks'
-import {
- getAllValidAuctions,
- getAllValidListings,
-} from '../../../../lib/marketplace/marketplace-listings'
-import {
- AuctionListing,
- CurrListing,
- DirectListing,
-} from '../../../../lib/marketplace/marketplace-utils'
-import randomColor from '../../../../lib/marketplace/marketplace-utils/randomColor'
-import { useChainDefault } from '../../../../lib/thirdweb/hooks/useChainDefault'
-import { initSDK } from '../../../../lib/thirdweb/thirdweb'
-import { LoadingSpinner } from '../../../../components/layout/LoadingSpinner'
-import Metadata from '../../../../components/marketplace/Layout/Metadata'
-import Skeleton from '../../../../components/marketplace/Layout/Skeleton'
-import AssetHistory from '../../../../components/marketplace/NFT/AssetHistory'
-import AssetListings from '../../../../components/marketplace/NFT/AssetListings'
-import BuyOrBid from '../../../../components/marketplace/NFT/BuyOrBid'
-import { MARKETPLACE_ADDRESS, MOONEY_DECIMALS } from '../../../../const/config'
-
-type TokenPageProps = {
- contractAddress: string
- tokenId: string
- nft: any
-}
-
-const [randomColor1, randomColor2] = [randomColor(), randomColor()]
-
-export default function TokenPage({
- contractAddress,
- tokenId,
-}: TokenPageProps) {
- useChainDefault()
-
- const router = useRouter()
- const address = useAddress()
-
- //Marketplace
- const [validListings, setValidListings] = useState([])
- const [validAuctions, setValidAuctions] = useState([])
- const { contract: marketplace, isLoading: loadingContract }: any =
- useContract(MARKETPLACE_ADDRESS, 'marketplace-v3')
-
- //get listings for specific asset
- const { listings: directListings, auctions: auctionListings } =
- useListingsByTokenId(validListings, validAuctions, tokenId, contractAddress)
-
- //selected listing
- const [currListing, setCurrListing] = useState({
- type: 'direct',
- listing: {} as DirectListing | AuctionListing,
- })
-
- //tab for direct listings and auctions
- const [tab, setTab] = useState<'listings' | 'auctions'>('listings')
-
- const [winningBid, setWinningBid] = useState()
-
- //NFT Collection & Metadata
- const { contract: nftCollection } = useContract(contractAddress)
- const { data: nft } = useNFT(nftCollection, tokenId)
-
- const { data: collectionMetadata }: any = useMetadata(nftCollection)
-
- // Load historical transfer events: TODO - more event types like sale
-
- ///set valid listings and auctions
- useEffect(() => {
- if (marketplace) {
- getAllValidListings(marketplace).then((listings: DirectListing[]) => {
- setValidListings(listings)
- })
- getAllValidAuctions(marketplace).then((auctions: AuctionListing[]) => {
- setValidAuctions(auctions)
- })
- }
- }, [marketplace])
-
- ///set Current Listing (potentially refactor currListing to useMemo?)
- useEffect(() => {
- if (directListings[0] || auctionListings[0]) {
- const listing = directListings[0]
- ? { type: 'direct', listing: directListings[0] }
- : { type: 'auction', listing: auctionListings[0] }
- setCurrListing(listing)
- listing.type === 'auction' && setTab('auctions')
- }
- }, [nft, directListings, auctionListings])
-
- ///set winning bid
- useEffect(() => {
- //set winning bid if auction
- if (!loadingContract && currListing.type === 'auction') {
- ;(async () => {
- const winningBid = await marketplace?.englishAuctions?.getWinningBid(
- currListing.listing.auctionId
- )
- setWinningBid(winningBid)
- })()
- }
- //check if connected wallet is owner of asset
- }, [currListing, address, loadingContract])
-
- if (!nft) return
-
- return (
- <>
-
-
-
-
-
-
- {/*Description*/}
-
-
- Description
-
-
-
- {nft.metadata.description}
-
-
- {/*Traits*/}
-
- Traits
-
-
-
- {Object.entries(nft?.metadata?.attributes || {}).map(
- ([key, value]: any) => (
-
-
- {value.trait_type}
-
-
- {value.value?.toString() || ''}
-
-
- )
- )}
-
{/*{nft?.metadata?.attributes}*/}
-
-
- {/*History*/}
- {/* {currListing?.listing && nft.type === 'ERC721' && (
-
- )} */}
-
-
-
- {/*Collection title, image and description*/}
-
- {collectionMetadata && (
-
-
-
- {collectionMetadata.name}
-
-
- )}
-
- {nft.metadata.name}
-
-
-
- Token ID #{nft.metadata.id}
-
-
- {currListing?.listing && nft.type === 'ERC721' && (
-
- {/* Random linear gradient circle shape */}
-
- {/*Nft owner info*/}
-
-
-
Seller
-
- {currListing?.listing?.creatorAddress?.slice(0, 8)}...
- {currListing?.listing?.creatorAddress?.slice(-4)}
-
-
-
-
- )}
-
-
-
- {/* Quantity for ERC1155 */}
- {currListing?.listing && nft.type === 'ERC1155' && (
- <>
-
- Quantity
-
-
- {currListing.listing.quantity}
-
- >
- )}
- {/* Pricing information */}
-
Price
-
- {!currListing?.listing ||
- (currListing.type === 'direct' &&
- !currListing.listing.pricePerToken) ||
- (currListing.type === 'auction' &&
- !currListing.listing.buyoutBidAmount) ? (
-
- ) : (
- <>
- {currListing.listing && currListing.type === 'direct' ? (
- <>
- {Math.round(
- +currListing.listing.pricePerToken / MOONEY_DECIMALS
- ) || '...'}
- {' ' + 'MOONEY'}
- >
- ) : currListing.listing &&
- currListing.type === 'auction' ? (
- <>
- {Math.round(
- +currListing.listing.buyoutBidAmount /
- MOONEY_DECIMALS
- ) || '...'}
- {' ' + 'MOONEY'}
- >
- ) : (
- 'Not for sale'
- )}
-
- {'Expiration'}
-
-
- {new Date(
- +currListing.listing.endTimestamp * 1000
- ).toLocaleDateString() +
- ' @ ' +
- new Date(
- +currListing.listing.endTimestamp * 1000
- ).toLocaleTimeString()}
-
- >
- )}
-
-
- {currListing && (
-
- {!currListing.listing ? (
-
- ) : (
- <>
- {currListing.type === 'auction' &&
- currListing.listing && (
- <>
-
- Bids starting from
-
-
-
- {Math.round(
- +currListing.listing.minimumBidAmount /
- MOONEY_DECIMALS
- )}
- {' ' + 'MOONEY'}
-
-
- {'Winning Bid'}
-
-
- {winningBid
- ? winningBid.bidAmount / MOONEY_DECIMALS +
- ' MOONEY'
- : 'No bids yet'}
-
-
- {'Expiration'}
-
-
- {new Date(
- +currListing.listing.endTimestamp * 1000
- ).toLocaleDateString() +
- ' @ ' +
- new Date(
- +currListing.listing.endTimestamp * 1000
- ).toLocaleTimeString()}
-
- >
- )}
- >
- )}
-
- )}
-
-
-
- {/*Direct listings and auction, hidden if there isn't either via conditional*/}
- {nft.type === 'ERC1155' && (
-
- )}
-
- {(directListings[0] || auctionListings[0]) && (
-
- )}
-
-
-
- >
- )
-}
-
-export const getServerSideProps: GetServerSideProps = async ({ params }) => {
- const contractAddress = params?.contractAddress
- const tokenId = params?.tokenId
-
- return {
- props: {
- contractAddress,
- tokenId,
- },
- }
-}
diff --git a/ui/archive/marketplace/collection/[contractAddress]/index.tsx b/ui/archive/marketplace/collection/[contractAddress]/index.tsx
deleted file mode 100644
index d229fa085..000000000
--- a/ui/archive/marketplace/collection/[contractAddress]/index.tsx
+++ /dev/null
@@ -1,220 +0,0 @@
-import { Mumbai, Polygon, Sepolia } from '@thirdweb-dev/chains'
-import {
- MediaRenderer,
- getAllDetectedExtensionNames,
- useContract,
- useMetadata,
-} from '@thirdweb-dev/react'
-import { useEffect, useState } from 'react'
-import {
- useAssets,
- useCollectionStats,
-} from '../../../../lib/marketplace/hooks'
-import {
- getAllValidAuctions,
- getAllValidListings,
-} from '../../../../lib/marketplace/marketplace-listings'
-import {
- AuctionListing,
- DirectListing,
-} from '../../../../lib/marketplace/marketplace-utils'
-import { useChainDefault } from '../../../../lib/thirdweb/hooks/useChainDefault'
-import { initSDK } from '../../../../lib/thirdweb/thirdweb'
-import { LoadingSpinner } from '../../../../components/layout/LoadingSpinner'
-import AssetPreview from '../../../../components/marketplace/Collection/AssetPreview'
-import Metadata from '../../../../components/marketplace/Layout/Metadata'
-import Skeleton from '../../../../components/marketplace/Layout/Skeleton'
-import LogoSmall from '../../../../components/marketplace/assets/LogoSmall'
-import { MARKETPLACE_ADDRESS } from '../../../../const/config'
-
-type CollectionPageProps = {
- contractAddress: string //pre-rendered
-}
-
-export default function CollectionPage({
- contractAddress,
-}: CollectionPageProps) {
- useChainDefault()
- //Marketplace data
- const { contract: marketplace } = useContract(
- MARKETPLACE_ADDRESS,
- 'marketplace-v3'
- )
- const [validListings, setValidListings] = useState([])
- const [validAuctions, setValidAuctions] = useState([])
-
- //NFT Collection Data
- const [collectionType, setCollectionType] = useState('')
- const { contract: collectionContract }: any = useContract(contractAddress)
- const { data: collectionMetadata }: any = useMetadata(collectionContract)
-
- const assets = useAssets(validListings, validAuctions, contractAddress)
- const { floorPrice, listed, supply } = useCollectionStats(
- validListings,
- validAuctions,
- collectionContract
- )
-
- useEffect(() => {
- //get all valid listings and auctions
- if (marketplace && collectionContract) {
- getAllValidListings(marketplace).then((listings: DirectListing[]) => {
- setValidListings(listings)
- })
- getAllValidAuctions(marketplace).then((auctions: AuctionListing[]) => {
- setValidAuctions(auctions)
- })
-
- //set collection type
- const extensions = getAllDetectedExtensionNames(collectionContract.abi)
- setCollectionType(extensions[0])
- }
- }, [marketplace, collectionContract])
-
- return (
-
-
- {/*Collection title and data*/}
-
-
- {collectionMetadata ? (
-
- ) : (
-
- )}
-
-
- {/*Title */}
-
- {collectionMetadata ? (
-
- {collectionMetadata.name}
-
- ) : (
-
- )}
-
-
- {/*Data div */}
-
-
- Floor{' '}
-
-
- {/*Floor*/}
- {floorPrice || '. . .'}
-
-
- {/*Listings*/}
-
- Listed{' '}
-
- {listed || '. . .'}
-
-
- {/*Supply*/}
- {collectionType !== 'ERC1155' && (
-
- Supply{' '}
-
- {supply || '. . .'}
-
-
- )}
-
-
- {collectionMetadata ? (
-
- {collectionMetadata?.description}
-
- ) : (
-
- )}
-
-
-
- {/*Grid with the collection's assets */}
-
- {assets[0] ? (
- assets.map((l: DirectListing | AuctionListing, i: number) => (
-
- ))
- ) : (
-
- )}
-
-
- )
-}
-
-export async function getStaticPaths() {
- const sdk = initSDK(
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? Polygon : Sepolia
- )
- const marketplace = await sdk.getContract(MARKETPLACE_ADDRESS as string)
- const acceptedCollections = await marketplace.roles.get('asset')
-
- const paths = acceptedCollections.map((contractAddress: string) => ({
- params: { contractAddress },
- }))
- return {
- paths,
- fallback: true,
- }
-}
-
-// export async function getServerSideProps({ params }: any) {
-// const contractAddress = params?.contractAddress
-// const sdk = initSDK(
-// process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? Polygon : Mumbai
-// )
-// const marketplace = await sdk.getContract(MARKETPLACE_ADDRESS)
-// const acceptedCollections = await marketplace.roles.get('asset')
-
-// if (!acceptedCollections.includes(contractAddress)) {
-// return {
-// notFound: true,
-// }
-// }
-
-// const collectionContract = await sdk.getContract(contractAddress)
-// const collectionMetadata = await collectionContract.metadata.get()
-
-// return {
-// props: { contractAddress, collectionMetadata },
-// }
-// }
-
-export async function getStaticProps({ params }: any) {
- const contractAddress = params?.contractAddress
- const sdk = initSDK(
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? Polygon : Sepolia
- )
- const marketplace = await sdk.getContract(MARKETPLACE_ADDRESS as string)
- const acceptedCollections = await marketplace.roles.get('asset')
-
- if (!acceptedCollections.includes(contractAddress)) {
- return {
- notFound: true,
- }
- }
-
- return {
- props: { contractAddress },
- revalidate: 60,
- }
-}
diff --git a/ui/archive/proposals.tsx b/ui/archive/proposals.tsx
deleted file mode 100644
index 0c4da8bcb..000000000
--- a/ui/archive/proposals.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import useTranslation from 'next-translate/useTranslation'
-import React, { useState } from 'react'
-import { PROPOSALS_QUERY } from '../lib/dashboard/gql/proposalsGQL'
-import { useGQLQuery } from '../lib/utils/hooks'
-import ProposalList from '../components/dashboard/proposals/ProposalList'
-import ProposalSkeletons from '../components/dashboard/proposals/ProposalSkeletons'
-import Head from '../components/layout/Head'
-
-export default function Proposals() {
- const [skip, setSkip] = useState(0)
-
- const { data, isLoading, error, update } = useGQLQuery(
- 'https://hub.snapshot.org/graphql',
- PROPOSALS_QUERY,
- { skip }
- )
-
- function handleSkip(value: number) {
- setSkip(value)
- }
-
- const { t } = useTranslation('common')
-
- return (
-
-
- {error || isLoading ? (
-
- ) : (
- data && (
-
- )
- )}
-
- )
-}
-
-// add locales for Proposals title and desc
diff --git a/ui/components/dashboard/announcements/Announcement.tsx b/ui/components/dashboard/announcements/Announcement.tsx
deleted file mode 100644
index 71d49384c..000000000
--- a/ui/components/dashboard/announcements/Announcement.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import Image from 'next/image'
-import React from 'react'
-import BlurBackground from '../../layout/BlurBackground'
-import AnnouncementContent from './AnnouncementContent'
-import Reaction from './Reaction'
-
-const Announcement = React.forwardRef(
- (
- {
- content,
- mentions,
- author,
- timestamp,
- reactions,
- loading,
- attachments,
- }: any,
- ref: any
- ) => {
- const avatar = `https://cdn.discordapp.com/avatars/${author.id}/${author.avatar}.webp?size=80`
- const name = author.username
- const time = new Date(timestamp).toDateString()
-
- const AnnouncementBody = (
-
-
-
-
- {/*Avatar, Name, Date */}
-
- {loading ? (
-
- ) : (
-
- )}
-
-
-
- {time}
-
-
- {name}
-
-
-
-
- {/*Content*/}
-
-
- {/*Attachments*/}
-
- {attachments &&
- attachments.map((attachment: any, i: number) => (
-
- ))}
-
-
- {/*Reactions*/}
-
- {reactions &&
- reactions.map((reaction: any, i: number) => (
-
- ))}
-
-
-
- )
-
- const result = ref ? (
- {AnnouncementBody}
- ) : (
- {AnnouncementBody}
- )
-
- return result
- }
-)
-Announcement.displayName = 'Announcement'
-export default Announcement
diff --git a/ui/components/dashboard/announcements/AnnouncementContent.tsx b/ui/components/dashboard/announcements/AnnouncementContent.tsx
deleted file mode 100644
index c6fc33ddc..000000000
--- a/ui/components/dashboard/announcements/AnnouncementContent.tsx
+++ /dev/null
@@ -1,131 +0,0 @@
-import {
- discordChannelDictionary,
- discordRoleDictionary,
-} from '../../../lib/dashboard/dashboard-utils.ts/discord-config'
-import { parseAnnouncementText } from '../../../lib/dashboard/dashboard-utils.ts/parseAnnouncementText'
-import { LogoSmall } from '../../assets'
-
-const AnnouncementContent = ({ text, mentions, loading }: any) => {
- const linkRegex =
- /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g
- const textSeparatedFromLinks = parseAnnouncementText(text, linkRegex)
-
- return (
-
- {textSeparatedFromLinks.map((str, i) =>
- i % 2 === 0 ? (
-
- ) : (
-
{`${str} `}
- )
- )}
-
- )
-}
-
-const TextContent = ({ sentence, mentions }: any) => {
- const mentionsRegex = /<(@|#).[0-9]*>/g
- const sentenceSeparatedFromMentions = parseAnnouncementText(
- sentence,
- mentionsRegex
- )
- // Added a way to add the MoonDAO shield emoticon by detecting the id
- return (
- <>
- {sentenceSeparatedFromMentions.map((e, i) =>
- e.startsWith('<@&') ? (
-
- ) : e.startsWith('<#') ? (
-
- ) : e.startsWith('<@') ? (
-
- ) : e.includes('<:MoonDAO:1047902000601383013>') ? (
-
- {e.slice(0, e.indexOf('<:MoonDAO:1047902000601383013>'))}{' '}
-
- {e.slice(e.indexOf('<:MoonDAO:1047902000601383013>') + 30)}
-
- ) : (
- e
- )
- )}
- >
- )
-}
-
-const ReplaceIdWithRoleName = ({ word }: any) => {
- const ending = word.lastIndexOf('>')
- const roleId = word.slice(3, ending)
- return (
- <>
- {discordRoleDictionary[roleId] ? (
- {`@${discordRoleDictionary[roleId][1]}`}
- ) : (
- word
- )}
- >
- )
-}
-
-const ReplaceIdWithChannelName = ({ word }: any) => {
- const ending = word.lastIndexOf('>')
- const channelId = word.slice(2, ending)
-
- return (
- <>
- {discordChannelDictionary[channelId] ? (
- <>
- {`@${discordChannelDictionary[channelId][1]}`}
- >
- ) : (
- word
- )}
- >
- )
-}
-
-const ReplaceIdWithMention = ({ word, mentions }: any) => {
- const ending = word.lastIndexOf('>')
- const id = word.slice(2, ending)
-
- return (
- <>
- {mentions.map(
- (mention: any, i: number) =>
- mention.id.includes(id) && (
- {`@${mention.username}`}
- )
- )}
- >
- )
-}
-
-export default AnnouncementContent
diff --git a/ui/components/dashboard/announcements/AnnouncementSkeletons.tsx b/ui/components/dashboard/announcements/AnnouncementSkeletons.tsx
deleted file mode 100644
index 542998d69..000000000
--- a/ui/components/dashboard/announcements/AnnouncementSkeletons.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import Announcement from './Announcement'
-
-const AnnouncementSkeletons = () => {
- const skeletonData = {
- content: Array(8)
- .fill('Loading, if this takes too long contact MoonDao Discord ')
- .join(' '),
- mentions: [],
- author: { username: 'MoonDAO' },
- timestamp: new Date(),
- reactions: [
- { emoji: { name: '🚀' }, count: '10' },
- { emoji: { name: '🚀' }, count: '10' },
- { emoji: { name: '🚀' }, count: '10' },
- ],
- }
-
- return (
- <>
- {Array(10)
- .fill(skeletonData)
- .map((e, i) => (
-
- ))}
- >
- )
-}
-
-export default AnnouncementSkeletons
diff --git a/ui/components/dashboard/announcements/Reaction.tsx b/ui/components/dashboard/announcements/Reaction.tsx
deleted file mode 100644
index e37dfd965..000000000
--- a/ui/components/dashboard/announcements/Reaction.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-const Reaction = ({ reaction, index, loading }:any) => {
- if (loading) return
;
- if(/\P{Extended_Pictographic}/u.test(reaction.emoji.name)) return;
- return (
-
-
{reaction.emoji.name}
-
{reaction.count}
-
- );
-};
-
-export default Reaction;
diff --git a/ui/components/dashboard/proposals/CaretButton.tsx b/ui/components/dashboard/proposals/CaretButton.tsx
deleted file mode 100644
index 67cef296c..000000000
--- a/ui/components/dashboard/proposals/CaretButton.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-interface CaretButton {
- left: boolean
- skip: number
- setSkip: Function
- total: number
- scrollUp: boolean
-}
-
-const CaretButton = ({ left, skip, setSkip, total, scrollUp }: CaretButton) => {
- const canGoToLeftPage = left && skip - 10 >= 0
- const canGoToRightPage = skip + 10 <= total
-
- return (
- {
- if ((scrollUp && canGoToRightPage) || (scrollUp && canGoToLeftPage))
- setTimeout(
- () => window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }),
- 300
- )
- left && canGoToLeftPage
- ? setSkip(skip - 10)
- : canGoToRightPage && setSkip(skip + 10)
- }}
- className="border-[50%] margin-auto block h-[36px] w-[36px] rounded-full border border-blue-600 dark:bg-slate-950 disabled:border-blue-400 disabled:opacity-50 bg-slate-50 disabled:hover:scale-100 dark:border-white"
- >
-
-
-
-
- )
-}
-
-export default CaretButton
diff --git a/ui/components/dashboard/proposals/PaginationButton.tsx b/ui/components/dashboard/proposals/PaginationButton.tsx
deleted file mode 100644
index 0dc7559cb..000000000
--- a/ui/components/dashboard/proposals/PaginationButton.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-interface PaginationButton {
- page: number
- skip: number
- setSkip: Function
- scrollUp: boolean
-}
-
-const PaginationButton = ({
- page,
- skip,
- setSkip,
- scrollUp,
-}: PaginationButton) => {
- const samePageClick = page * 10 === skip
- return (
- {
- setSkip(10 * page)
- if (scrollUp)
- setTimeout(
- () => window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }),
- 300
- )
- }}
- >
- {page + 1}
-
- )
-}
-
-export default PaginationButton
diff --git a/ui/components/dashboard/proposals/Proposal.tsx b/ui/components/dashboard/proposals/Proposal.tsx
deleted file mode 100644
index 47a04a2ac..000000000
--- a/ui/components/dashboard/proposals/Proposal.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import { getHumanTime } from '../../../lib/dashboard/dashboard-utils.ts/getHumanTime'
-import { authorMappings } from '../../../lib/dashboard/gql/proposalsGQL'
-import ArticleTitle from '../../layout/ArticleTitle'
-import BlurBackground from '../../layout/BlurBackground'
-import LinkHighlighter from '../LinkHighlighter'
-
-interface Proposal {
- title: string
- loading?: boolean
- startTime?: number
- endTime?: number
- author: any
- state: string
- idx: number
- proposalId?: string
- body: string
-}
-
-const Proposal = ({
- title,
- loading,
- startTime,
- endTime,
- author,
- state,
- idx,
- proposalId = '',
- body,
-}: Proposal) => {
- const timeStr =
- !startTime || !endTime
- ? ''
- : state == 'pending'
- ? getHumanTime((startTime - Math.floor(Date.now() / 1000)) * 1000)
- : state == 'active'
- ? getHumanTime((endTime - Math.floor(Date.now() / 1000)) * 1000)
- : getHumanTime((Math.floor(Date.now() / 1000) - endTime) * 1000)
-
- const link = 'https://snapshot.org/#/tomoondao.eth/proposal/' + proposalId
-
- return (
-
-
-
-
-
- {/*Title and Started */}
-
-
- {/*Body*/}
-
- {/*Author and status */}
-
-
- {state == 'active'
- ? `Voting Ends in ${timeStr}`
- : state == 'pending'
- ? `Voting Starts in ${timeStr}`
- : `Voting Ended ${timeStr} ago`}
-
-
-
-
- {authorMappings[author]
- ? authorMappings[author]
- : author.slice(0, 12) + '...'}
-
-
- {state}
-
-
-
-
-
- )
-}
-
-export default Proposal
diff --git a/ui/components/dashboard/proposals/ProposalList.tsx b/ui/components/dashboard/proposals/ProposalList.tsx
deleted file mode 100644
index 3750f18da..000000000
--- a/ui/components/dashboard/proposals/ProposalList.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import Header from '../../../components/layout/Header'
-import Line from '../../../components/layout/Line'
-import CaretButton from './CaretButton'
-import PaginationButton from './PaginationButton'
-import Proposal from './Proposal'
-
-type ProposalListProps = {
- data: any
- skip: number
- setSkip: Function
- isLoading: boolean
-}
-
-export default function ProposalList({
- data,
- skip,
- setSkip,
- isLoading,
-}: ProposalListProps) {
- const pages = [...Array(6)]
-
- return (
-
-
-
-
-
-
-
-
- Click the proposal's title to read more.
-
-
- {!isLoading &&
- data.map((e: any, i: number) => (
-
- ))}
- {/*Pagination not working properly, jumps to wrong numbers, problem with skip*/}
-
-
- {pages.map((e, i) => (
-
- ))}
-
-
-
- )
-}
diff --git a/ui/components/dashboard/proposals/ProposalSkeletons.tsx b/ui/components/dashboard/proposals/ProposalSkeletons.tsx
deleted file mode 100644
index ff1dec3c5..000000000
--- a/ui/components/dashboard/proposals/ProposalSkeletons.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import Proposal from "./Proposal";
-
-const ProposalSkeletons = () => {
- const skeletonData = {
- title: "Loading MoonDAO members proposals. If loading takes too long, contact MoonDAO Discord.",
- author: "0x679d87D8640e66778c3419D164998E720D7495f6",
- body: "Loading MoonDAO members proposals. If loading takes too long, contact MoonDAO Discord. Loading MoonDAO members proposals. If loading takes too long, contact MoonDAO Discord. Loading MoonDAO members proposals. If loading takes too long, contact MoonDAO Discord. If loading takes too long, contact MoonDAO Discord.",
- };
- return (
- <>
- {Array(10)
- .fill(skeletonData)
- .map((e, i) => (
-
- ))}
- >
- );
-};
-
-export default ProposalSkeletons;
diff --git a/ui/components/directory/EntityCitizenCard.tsx b/ui/components/directory/EntityCitizenCard.tsx
deleted file mode 100644
index 175da5d2d..000000000
--- a/ui/components/directory/EntityCitizenCard.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import { ThirdwebNftMedia } from '@thirdweb-dev/react'
-import { ZERO_ADDRESS } from 'const/config'
-import Link from 'next/link'
-import { useEffect, useState } from 'react'
-import { getAttribute } from '@/lib/utils/nft'
-import { nft } from '../marketplace/assets/seed'
-
-export default function EntityCitizenCard({
- metadata,
- owner,
- type,
-}: {
- metadata: any
- owner: any
- type: any
-}) {
- const [citizenDiscord, setCitizenDiscord] = useState()
-
- useEffect(() => {
- if (type === 'citizen') {
- setCitizenDiscord(getAttribute(metadata.attributes, 'discord')?.value)
- }
- }, [type, metadata])
-
- return (
-
- {metadata && (
-
-
-
- {metadata.name && (
-
- {metadata.name}
-
- )}
-
- {owner.slice(0, 6) + '...' + owner.slice(-4)}
-
- {metadata?.description && (
-
- {metadata.description.length > 100
- ? `${metadata.description.slice(0, 100)}...`
- : metadata.description}
-
- )}
-
-
-
- {metadata.name ? (
- <>
-
- {type === 'entity' ? 'Entity' : 'Citizen'}
-
-
- ID: {metadata.id}
-
- >
- ) : (
-
- Not registered
-
- )}
-
- {type === 'citizen' &&
- getAttribute(metadata.attributes, 'discord')?.value && (
-
- {`Discord: @${citizenDiscord}`}
-
- )}
-
-
-
- )}
-
- )
-}
diff --git a/ui/components/marketplace/Collection/AssetPreview.tsx b/ui/components/marketplace/Collection/AssetPreview.tsx
deleted file mode 100644
index 3d2b5a6d2..000000000
--- a/ui/components/marketplace/Collection/AssetPreview.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { MediaRenderer } from '@thirdweb-dev/react'
-import { useRouter } from 'next/router'
-import { useAssetStats } from '../../../lib/marketplace/hooks'
-import {
- AuctionListing,
- DirectListing,
-} from '../../../lib/marketplace/marketplace-utils'
-import LogoSmall from '../../assets/LogoSmall'
-import Skeleton from '../Layout/Skeleton'
-
-type AssetPreviewProps = {
- listing: DirectListing | AuctionListing
- validListings: DirectListing[]
- validAuctions: AuctionListing[]
-}
-
-export default function AssetPreview({
- listing,
- validListings,
- validAuctions,
-}: AssetPreviewProps) {
- const router = useRouter()
- const { floorPrice, listed, supply } = useAssetStats(
- validListings,
- validAuctions,
- listing.assetContractAddress,
- listing.tokenId
- )
- if (!listing?.asset) return NFT not found!
-
- return (
-
- {/*Stamps to cut corners*/}
-
-
- {/*Image container to create zoom effect*/}
-
-
- router.push(
- `/marketplace/collection/${listing.assetContractAddress}/${listing.tokenId}`
- )
- }
- >
-
-
-
- {/*Card with Asset data*/}
-
-
-
{listing.asset.name}
- {/*Price*/}
-
-
- {floorPrice && floorPrice.toString().length < 9
- ? floorPrice
- : floorPrice?.toString().slice(0, 7) + '...'}
-
-
-
-
#{listing.tokenId}
-
- router.push(
- `/marketplace/collection/${listing.assetContractAddress}/${listing.tokenId}`
- )
- }
- className="absolute top-12 mt-10 border-[0.5px] hover:scale-105 px-[10px] py-[4px] transition-all duration-150 hover:bg-slate-900 rounded-tl-[10px] rounded-br-[10px]"
- >
- Buy now
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Collection/CollectionGrid.tsx b/ui/components/marketplace/Collection/CollectionGrid.tsx
deleted file mode 100644
index 0ea797805..000000000
--- a/ui/components/marketplace/Collection/CollectionGrid.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import CollectionPreview from './CollectionPreview'
-
-// I copied the map to give an example of how the grid will look like
-export default function CollectionGrid({
- collections,
- validListings,
- validAuctions,
-}: any) {
- return (
-
- {collections &&
- collections[0] &&
- collections.map((c: any, i: number) => (
-
- ))}
-
- )
-}
diff --git a/ui/components/marketplace/Collection/CollectionPreview.tsx b/ui/components/marketplace/Collection/CollectionPreview.tsx
deleted file mode 100644
index 8afddaa2e..000000000
--- a/ui/components/marketplace/Collection/CollectionPreview.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import { MediaRenderer, useContract, useMetadata } from '@thirdweb-dev/react'
-import Link from 'next/link'
-import { useCollectionStats } from '../../../lib/marketplace/hooks'
-import randomColor from '../../../lib/marketplace/marketplace-utils/randomColor'
-import LogoSmall from '../../assets/LogoSmall'
-import Skeleton from '../Layout/Skeleton'
-
-export default function CollectionPreview({
- collection,
- validListings,
- validAuctions,
-}: any) {
- const { contract: collectionContract } = useContract(
- collection.assetContractAddress
- )
- const { data: metadata }: any = useMetadata(collectionContract)
-
- const { floorPrice } = useCollectionStats(
- validListings,
- validAuctions,
- collectionContract
- )
-
- if (!metadata) return
-
- return (
-
-
- {metadata?.image ? (
-
- ) : (
-
- )}
-
-
-
- {metadata.name}
-
-
-
- Floor
-
-
- {floorPrice}
-
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Home/Hero.tsx b/ui/components/marketplace/Home/Hero.tsx
deleted file mode 100644
index b45e9a762..000000000
--- a/ui/components/marketplace/Home/Hero.tsx
+++ /dev/null
@@ -1,118 +0,0 @@
-import Link from 'next/link'
-import { useState, useEffect, useRef } from 'react'
-import {
- AuctionListing,
- DirectListing,
-} from '../../../lib/marketplace/marketplace-utils'
-import ArrowButton from '../Layout/ArrowButton'
-import FrameDetail from '../assets/FrameDetail'
-import HeroStar from '../assets/HeroStar'
-import VerticalStar from '../assets/VerticalStar'
-import HeroImage from './HeroImage'
-import HeroImageSelector from './HeroImageSelector'
-import PolygonBridge from './PolygonBridge'
-
-//TODO for the slide selector: Transition between images, automatic change of images after interval.
-//TODO adjust blur so it doesnt overlay on top of hero image
-
-export default function Hero({ topAssets }: any) {
- // State for the hero, contains link of the collection when clicked and image
- const [currentSlide, setCurrentSlide] = useState(0)
- const [heroImageArray, setHeroImageArray] = useState<
- DirectListing[] | AuctionListing[]
- >([])
-
- useEffect(() => {
- if (topAssets[0]) {
- setHeroImageArray(topAssets)
- }
- }, [topAssets])
-
- useEffect(() => {
- if (heroImageArray.length > 0) {
- const interval = setInterval(() => {
- if (currentSlide === heroImageArray.length - 1) {
- setCurrentSlide(0)
- } else {
- setCurrentSlide(currentSlide + 1)
- }
- }, 5000)
- return () => clearInterval(interval)
- }
- }, [currentSlide, heroImageArray])
-
- return (
-
- {/*Hero image*/}
-
- {/*Here goes the link to the collection and the image*/}
-
-
-
- {/*Buttons to change slides*/}
-
-
- {/*Stars and frame detail*/}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/*Title, paragraph and button to see all collections*/}
-
- {/*Blur blob*/}
-
- {/*Title and paragraph*/}
-
- MOONDAO
- MARKETPLACE
-
-
- {`Whether you're an artist seeking to showcase your unique creations or
- a collector in search of one-of-a-kind digital artifacts, the MoonDAO
- Marketplace offers a seamless and secure environment for buying and
- selling NFTs with L2 MOONEY.`}
-
-
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Home/HeroImage.tsx b/ui/components/marketplace/Home/HeroImage.tsx
deleted file mode 100644
index 696a31aa9..000000000
--- a/ui/components/marketplace/Home/HeroImage.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import Image from 'next/image'
-
-export default function HeroImage({ asset }: any) {
- if (!asset?.asset)
- return (
-
- )
-
- return (
-
- )
-}
diff --git a/ui/components/marketplace/Home/HeroImageSelector.tsx b/ui/components/marketplace/Home/HeroImageSelector.tsx
deleted file mode 100644
index 08b849476..000000000
--- a/ui/components/marketplace/Home/HeroImageSelector.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-type ImageSelector = {
- currentSlide: number
- setCurrentSlide: Function
- topAssetsLength: number
-}
-
-type ImageSelectorButton = {
- currentSlide: number
- slideNumber: number
- setCurrentSlide: Function
-}
-
-const HeroImageSelector = ({
- currentSlide,
- setCurrentSlide,
- topAssetsLength,
-}: ImageSelector) => {
- //This component takes in the current slide and the function to change the slides, and passes it to the buttons.
- return (
-
- {Array.from(Array(topAssetsLength)).map((_, i) => (
-
- ))}
-
- )
-}
-
-const SelectButton = ({
- currentSlide,
- slideNumber,
- setCurrentSlide,
-}: ImageSelectorButton) => {
- // Each button has an assigned "slide number", when the button is clicked the currently selected slide changes to match the attribute slide number.
- // Example: Slide 0 (zero index array) will get selected if the first button is pressed, and that corresponds to the first entry in the Slider Data array.
- return (
- setCurrentSlide(slideNumber)}
- className={`${
- currentSlide === slideNumber ? 'bg-moon-gold' : 'bg-white bg-opacity-20'
- } transition-all duration-150 w-11 lg:w-8 2xl:w-11 h-1 xl:h-[6px] rounded`}
- >
- )
-}
-
-export default HeroImageSelector
diff --git a/ui/components/marketplace/Home/PolygonBridge.tsx b/ui/components/marketplace/Home/PolygonBridge.tsx
deleted file mode 100644
index 46dc85d1d..000000000
--- a/ui/components/marketplace/Home/PolygonBridge.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import Link from 'next/link'
-
-export default function PolygonBridge({ linked }: any) {
- return (
-
-
- window.open(
- 'https://wallet.polygon.technology/polygon/bridge/deposit'
- )
- }
- className="bridge-button"
- >
- {`${
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? 'Polygon' : 'Mumbai'
- } Bridge`}
-
- {linked && (
- <>
-
- {`The marketplace uses L2 MOONEY, use the bridge to transfer L1
- MOONEY (${
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? 'Mainnet' : 'Goerli'
- }) to L2`}
-
- Learn more →
-
-
- >
- )}
-
- )
-}
diff --git a/ui/components/marketplace/Home/Showcases/CollectionShowcase.jsx b/ui/components/marketplace/Home/Showcases/CollectionShowcase.jsx
deleted file mode 100644
index 0f303af12..000000000
--- a/ui/components/marketplace/Home/Showcases/CollectionShowcase.jsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import ArrowButton from '../../Layout/ArrowButton'
-import SectionHeader from '../../Layout/SectionHeader'
-import CollectionThumbnail from './CollectionThumbnail'
-
-export default function CollectionShowcase({
- collections,
- validListings,
- validAuctions,
-}) {
- return (
-
-
-
-
-
-
2 && 'xl:grid-cols-3'
- } mt-14 md:mt-16 flex flex-col gap-10 md:grid md:grid-cols-2 md:grid-flow-row md:gap-12 xl:gap-14 items-center`}
- >
- {collections &&
- collections.map((collection, index) => (
-
- ))}
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Home/Showcases/CollectionThumbnail.tsx b/ui/components/marketplace/Home/Showcases/CollectionThumbnail.tsx
deleted file mode 100644
index 3785ce679..000000000
--- a/ui/components/marketplace/Home/Showcases/CollectionThumbnail.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { ThirdwebNftMedia, useContract, useMetadata } from '@thirdweb-dev/react'
-import Image from 'next/image'
-import Link from 'next/link'
-import { useCollectionStats } from '../../../../lib/marketplace/hooks'
-import LogoSmall from '../../../assets/LogoSmall'
-import Skeleton from '../../Layout/Skeleton'
-
-export default function CollectionThumbnail({
- collection,
- validListings,
- validAuctions,
-}: any) {
- const { contract: collectionContract } = useContract(
- collection.assetContractAddress
- )
- const { data: metadata }: any = useMetadata(collectionContract)
-
- const { floorPrice } = useCollectionStats(
- validListings,
- validAuctions,
- collectionContract
- )
-
- if (!metadata) return
- return (
-
-
-
- {/*
{metadata.id}
*/}
-
-
-
-
{metadata.name}
-
- Floor{' '}
-
-
- {floorPrice}
-
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Home/Showcases/NewCollectionThumbnail.tsx b/ui/components/marketplace/Home/Showcases/NewCollectionThumbnail.tsx
deleted file mode 100644
index 6ba9281be..000000000
--- a/ui/components/marketplace/Home/Showcases/NewCollectionThumbnail.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import { MediaRenderer, useContract, useMetadata } from '@thirdweb-dev/react'
-import Link from 'next/link'
-import { useCollectionStats } from '../../../../lib/marketplace/hooks'
-import randomColor from '../../../../lib/marketplace/marketplace-utils/randomColor'
-import LogoSmall from '../../../assets/LogoSmall'
-import Skeleton from '../../Layout/Skeleton'
-
-export default function NewCollectionThumbnail({
- collection,
- validListings,
- validAuctions,
-}: any) {
- const { contract: collectionContract } = useContract(
- collection?.assetContractAddress
- )
- const { data: metadata }: any = useMetadata(collectionContract)
-
- const { floorPrice } = useCollectionStats(
- validListings,
- validAuctions,
- collectionContract
- )
- if (!metadata) return
- return (
-
-
- {metadata?.image ? (
-
- ) : (
-
- )}
-
-
-
- {metadata.name}
-
-
-
- Floor
-
-
- {floorPrice}
-
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Home/Showcases/NewShowcase.jsx b/ui/components/marketplace/Home/Showcases/NewShowcase.jsx
deleted file mode 100644
index fbe3e47d4..000000000
--- a/ui/components/marketplace/Home/Showcases/NewShowcase.jsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import NewCollectionThumbnail from "./NewCollectionThumbnail";
-import SectionHeader from "../../Layout/SectionHeader";
-
-{
- /*TODO: Add button for carousel*/
-}
-
-export default function NewShowcase({
- collections,
- validListings,
- validAuctions,
-}) {
-
-
- if (!collections) return <>>;
-
- return (
-
-
-
- 2 && "xl:grid-cols-3"} mt-10 md:mt-16 flex flex-col gap-10 md:grid md:grid-cols-2 md:grid-flow-row md:gap-12 xl:gap-20`}>
- {collections
- .slice(collections.length <= 3 ? -collections.length : 0, 3)
- .map((collection, index) => (
-
- ))}
-
-
- );
-}
diff --git a/ui/components/marketplace/Home/Showcases/TrendingShowcase.tsx b/ui/components/marketplace/Home/Showcases/TrendingShowcase.tsx
deleted file mode 100644
index 1432e53c8..000000000
--- a/ui/components/marketplace/Home/Showcases/TrendingShowcase.tsx
+++ /dev/null
@@ -1,138 +0,0 @@
-import {
- AuctionListing,
- DirectListing,
-} from '../../../../lib/marketplace/marketplace-utils'
-import ArrowButton from '../../Layout/ArrowButton'
-import SectionHeader from '../../Layout/SectionHeader'
-import TrendingThumbnail from './TrendingThumbnail'
-
-interface TrendingShowcaseProps {
- assets: DirectListing[] | AuctionListing[]
- validListings: DirectListing[]
- validAuctions: AuctionListing[]
-}
-
-export default function TrendingShowcase({
- assets,
- validListings,
- validAuctions,
-}: TrendingShowcaseProps) {
- return (
-
-
- {/*
- Will show 4 components from Mobile up to LG screens, where it transforms into a grid
- Incoming data is being sliced before mapping
- */}
-
- {assets &&
- assets
- .slice(assets.length < 4 ? -assets.length : 0, 4)
- .map((asset, i, arr) => (
-
- ))}
-
- {/*Desktop grid, not slicing*/}
-
- {assets &&
- assets.map((asset, i) => (
-
- ))}
-
-
-
- )
-}
-
-const dummyData = [
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail2.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail3.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail4.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail2.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail3.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail4.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
- {
- name: 'Lorem Ipsum',
- img: '/trendingthumbnail.png',
- holders: 20,
- floor: 20000,
- number: 102,
- link: '/',
- },
-]
diff --git a/ui/components/marketplace/Home/Showcases/TrendingThumbnail.tsx b/ui/components/marketplace/Home/Showcases/TrendingThumbnail.tsx
deleted file mode 100644
index 2fe1efec5..000000000
--- a/ui/components/marketplace/Home/Showcases/TrendingThumbnail.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import { ThirdwebNftMedia } from '@thirdweb-dev/react'
-import Link from 'next/link'
-import { useAssetStats } from '../../../../lib/marketplace/hooks'
-import LogoSmall from '../../../assets/LogoSmall'
-import Skeleton from '../../Layout/Skeleton'
-
-export default function TrendingThumbnail({
- asset,
- validListings,
- validAuctions,
- last = false,
- first = false,
-}: any) {
- const { floorPrice, listed } = useAssetStats(
- validListings,
- validAuctions,
- asset?.assetContractAddress,
- asset?.tokenId
- )
- if (!asset?.asset) return
-
- return (
-
-
- {/*Stamps to cut corners*/}
- {/*
-
*/}
- {/*Image container to create zoom effect*/}
-
-
-
- {/*Card with Asset data*/}
-
-
-
{asset.asset.name}
-
{listed} listed
-
Floor Price
-
-
- {floorPrice && floorPrice.toString().length < 12
- ? floorPrice
- : floorPrice?.toString().slice(0, 10) + '...'}
-
-
-
-
#{asset.tokenId}
-
- Details
-
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Layout/ArrowButton.jsx b/ui/components/marketplace/Layout/ArrowButton.jsx
deleted file mode 100644
index e32268da6..000000000
--- a/ui/components/marketplace/Layout/ArrowButton.jsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import Link from "next/link";
-
-const ArrowButton = ({ text, position, link }) => {
- return (
-
-
- {text}{" "}
-
-
-
-
-
-
- );
-};
-
-export default ArrowButton;
diff --git a/ui/components/marketplace/Layout/Metadata.tsx b/ui/components/marketplace/Layout/Metadata.tsx
deleted file mode 100644
index e006c90c5..000000000
--- a/ui/components/marketplace/Layout/Metadata.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import Head from "next/head";
-
-const defaultDescription =
- "The MoonDAO Digital Asset Marketplace is where people can buy or list digital assets (NFTs) for Mooney.";
-
-const screenshot =
- "https://ipfs.io/ipfs/QmUFwnzo1Ef4VmyTY7Y1hqML622fH9num46T7ZJkM1784X";
-
-interface MetadataProps {
- title?: string;
- description?: string;
- image?: string;
-}
-
-export default function Metadata({
- title = "",
- description = defaultDescription,
- image,
-}: MetadataProps) {
- return (
-
-
- {"Marketplace | " + title}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/ui/components/marketplace/Layout/SectionHeader.tsx b/ui/components/marketplace/Layout/SectionHeader.tsx
deleted file mode 100644
index a2c8ad7e1..000000000
--- a/ui/components/marketplace/Layout/SectionHeader.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import VerticalStar from '../../../components/marketplace/assets/VerticalStar'
-
-interface Title {
- title: String
-}
-
-const SectionHeader = ({ title }: Title) => {
- return (
-
- {title}
-
-
-
-
- )
-}
-
-export default SectionHeader
diff --git a/ui/components/marketplace/Layout/Skeleton.tsx b/ui/components/marketplace/Layout/Skeleton.tsx
deleted file mode 100644
index 2d171b35c..000000000
--- a/ui/components/marketplace/Layout/Skeleton.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from "react";
-
-type Props = {
- width?: string;
- height?: string;
- borderRadius?: string;
-};
-
-export default function Skeleton({ height, width, borderRadius }: Props) {
- return (
-
- );
-}
diff --git a/ui/components/marketplace/NFT/AssetHistory.tsx b/ui/components/marketplace/NFT/AssetHistory.tsx
deleted file mode 100644
index ac92c39af..000000000
--- a/ui/components/marketplace/NFT/AssetHistory.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import { useContractEvents } from '@thirdweb-dev/react'
-import { SmartContract } from '@thirdweb-dev/sdk'
-import Link from 'next/link'
-import { useEffect, useState } from 'react'
-import { useCurrBlockNum } from '../../../lib/marketplace/marketplace-utils/hooks'
-
-export const ETHERSCAN_URL: string = process.env.NEXT_PUBLIC_CHAIN
- ? 'https://polygonscan.com/' //Matic
- : 'https://mumbai.polygonscan.com/' //Mumbai
-
-interface AssetHistoryProps {
- marketplace: SmartContract | undefined
- contract: any
- tokenId: string
-}
-
-export default function AssetHistory({ contract, tokenId }: AssetHistoryProps) {
- const currBlockNum: any = useCurrBlockNum()
- const [assetTransferEvents, setAssetTransferEvents] = useState([])
- const { data: transferEvents, isLoading: loadingTransferEvents }: any =
- useContractEvents(contract, 'Transfer', {
- queryFilter: {
- filters: {
- tokenId: tokenId,
- },
- fromBlock: +currBlockNum - 19999,
- order: 'desc',
- },
- })
-
- //filter by token id (query filter doesn't always work)
- useEffect(() => {
- if (transferEvents) {
- setAssetTransferEvents(
- transferEvents.filter(
- (event: any) => event.data.tokenId.toString() === tokenId
- )
- )
- }
- }, [transferEvents, tokenId])
-
- return (
- <>
-
- History
-
-
- {transferEvents &&
- assetTransferEvents[0] &&
- assetTransferEvents.map((event: any, index: number) => (
-
-
-
Event
- {transferEvents && transferEvents[0] ? (
-
- {
- // if last event in array, then it's a mint
- 'Transfer'
- }
-
- ) : (
-
- {event.data}
-
- )}
-
-
-
-
From
-
- {event.data.from?.slice(0, 4)}...
- {event.data.from?.slice(-2)}
-
-
-
-
-
To
-
- {event.data.to?.slice(0, 4)}...
- {event.data.to?.slice(-2)}
-
-
-
-
-
- ↗
-
-
-
- ))}
-
- >
- )
-}
diff --git a/ui/components/marketplace/NFT/AssetListings.tsx b/ui/components/marketplace/NFT/AssetListings.tsx
deleted file mode 100644
index 4cf7fea56..000000000
--- a/ui/components/marketplace/NFT/AssetListings.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import { toast } from 'react-hot-toast'
-import {
- AuctionListing,
- DirectListing,
-} from '../../../lib/marketplace/marketplace-utils'
-import toastStyle from '../../../lib/marketplace/marketplace-utils/toastConfig'
-import Listing from './Listing'
-
-type AssetListingsProps = {
- tab: string
- setTab: Function
- directListings: DirectListing[]
- auctionListings: AuctionListing[]
- currListing: any
- setCurrListing: Function
-}
-
-export default function AssetListings({
- tab,
- setTab,
- auctionListings,
- directListings,
- currListing,
- setCurrListing,
-}: AssetListingsProps) {
- return (
-
-
-
{
- if (!directListings[0])
- return toast('No direct listings available', {
- style: toastStyle,
- })
- setTab('listings')
- }}
- >
- Listings
-
- {
- if (!auctionListings[0])
- return toast('No auction listings available', {
- style: toastStyle,
- })
- setTab('auctions')
- }}
- >
- Auctions
-
-
- {tab === 'listings' && directListings[0] && (
- <>
-
- Direct Listings :
-
-
- {directListings[0] &&
- directListings.map((l: any, i: number) => (
-
-
-
- ))}
-
- >
- )}
-
- {tab === 'auctions' && auctionListings[0] && (
- <>
-
- Auction Listings :
-
-
- {auctionListings[0] &&
- auctionListings.map((a: any, i: number) => (
-
-
-
- ))}
-
- >
- )}
-
- )
-}
diff --git a/ui/components/marketplace/NFT/BuyOrBid.tsx b/ui/components/marketplace/NFT/BuyOrBid.tsx
deleted file mode 100644
index 0329f2785..000000000
--- a/ui/components/marketplace/NFT/BuyOrBid.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-import { MarketplaceV3 } from '@thirdweb-dev/sdk'
-import Link from 'next/link'
-import { useRouter } from 'next/router'
-import { useMemo, useState } from 'react'
-import { toast } from 'react-hot-toast'
-import { CurrListing } from '../../../lib/marketplace/marketplace-utils'
-import toastStyle from '../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS, MOONEY_DECIMALS } from '../../../const/config'
-import { PrivyWeb3Button } from '../../privy/PrivyWeb3Button'
-import Skeleton from '../Layout/Skeleton'
-
-type BuyOrBidProps = {
- marketplace: MarketplaceV3 | undefined
- walletAddress: string | undefined
- winningBid: string | undefined
- currListing: CurrListing | undefined
-}
-
-export default function BuyOrBid({
- marketplace,
- walletAddress,
- winningBid,
- currListing,
-}: BuyOrBidProps) {
- const router = useRouter()
- const [bidValue, setBidValue] = useState(
- currListing?.listing?.minimumBidAmount / MOONEY_DECIMALS || 0
- )
- const [directListingQuantity, setDirectListingQuantity] = useState(1)
-
- const isOwner = useMemo(() => {
- if (walletAddress && currListing?.listing?.creatorAddress)
- return (
- walletAddress?.toLowerCase() ===
- currListing?.listing?.creatorAddress.toLowerCase()
- )
- }, [walletAddress, currListing])
-
- async function createBidOrOffer() {
- let txResult
- if (!currListing || !marketplace) return
- try {
- if (currListing.type === 'auction') {
- txResult = await marketplace?.englishAuctions.makeBid(
- currListing.listing?.auctionId,
- bidValue
- )
- } else {
- throw new Error('No valid auction listing found for this NFT')
- }
- setTimeout(() => {
- router.reload()
- toast(`Bid success!`, {
- icon: 'âś…',
- style: toastStyle,
- position: 'bottom-center',
- })
- }, 1000)
- return txResult
- } catch (err: any) {
- toast.error(`Bid failed! Reason: ${err?.reason}`)
- }
- }
-
- async function buyListing() {
- let txResult
- if (!currListing || !marketplace) return
- try {
- if (currListing.type === 'direct') {
- txResult = await marketplace.directListings.buyFromListing(
- currListing.listing.listingId,
- directListingQuantity,
- walletAddress
- )
- } else {
- txResult = await marketplace.englishAuctions.buyoutAuction(
- currListing.listing.auctionId
- )
- await marketplace.englishAuctions.executeSale(
- currListing.listing.auctionId
- )
- }
- setTimeout(() => {
- router.reload()
- toast(`Purchase success!`, {
- icon: 'âś…',
- style: toastStyle,
- position: 'bottom-center',
- })
- }, 1000)
- return txResult
- } catch (err: any) {
- toast(`Purchase failed! Reason: ${err?.reason}`, {
- icon: '❌',
- style: toastStyle,
- position: 'bottom-center',
- })
- }
- }
-
- return (
- <>
- {currListing && !currListing.listing?.creatorAddress ? (
-
- ) : (
- <>
- {/*Web3 connect button and template in case of listed by user address*/}
- {isOwner ? (
-
- This listing was created by you.
-
- ) : (
- <>
-
- {currListing &&
- walletAddress &&
- currListing.type === 'auction' && (
- <>
-
- 0
- ? String(+winningBid / MOONEY_DECIMALS)
- : currListing.listing
- ? String(
- +currListing.listing.minimumBidAmount /
- MOONEY_DECIMALS
- )
- : '0'
- }
- type="number"
- step={1}
- onChange={(e: any) => {
- setBidValue(e.target.value)
- }}
- />
-
- await createBidOrOffer()}
- />
-
- {
- '*Winning an Auction: after the auction has expired go to the'
- }
- {` 'winning bids' `}
- {
- 'tab to claim your asset, if the auction creator has already claimed the payout this will be done automatically*'
- }
-
- >
- )}
- >
- )}
- >
- )}
- >
- )
-}
diff --git a/ui/components/marketplace/NFT/Listing.tsx b/ui/components/marketplace/NFT/Listing.tsx
deleted file mode 100644
index ecf4c154d..000000000
--- a/ui/components/marketplace/NFT/Listing.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import { MOONEY_DECIMALS } from '../../../const/config'
-
-interface ListingProps {
- type: 'direct' | 'auction'
- listing: any
- setCurrListing: Function
-}
-
-export default function Listing({
- type = 'direct',
- listing,
- setCurrListing,
-}: ListingProps) {
- const listingId = type === 'direct' ? listing?.listingId : listing?.auctionId
- const seller = listing.creatorAddress
- const buyOut =
- type === 'direct' ? listing.pricePerToken : listing.buyoutBidAmount
- const minBid = type === 'direct' ? 0 : listing.minimumBidAmount
- const end = listing.endTimestamp
-
- if (!listingId) return <>>
-
- return (
- setCurrListing({ type, listing })}
- >
-
- {/*Seller*/}
-
-
- Seller
-
-
- {seller.slice(0, 6) + '...' + seller.slice(-4)}
-
-
- {/*Price*/}
-
-
- {'Quantity'}
-
-
{listing.quantity}
-
-
-
- {'Price'}
- (MOONEY)
-
-
{(+buyOut / MOONEY_DECIMALS).toFixed(1)}
-
-
-
-
- {/*Bid*/}
- {type === 'auction' ? (
-
-
- {'Min Bid'}
-
-
{(+minBid / MOONEY_DECIMALS).toFixed(1)}
-
- ) : (
-
- {/*Important empty div as forces expiration to stick to left even if not auction*/}
-
- )}
- {/*Expiration*/}
-
-
- {'Expiration'}
-
-
- {new Date(+end * 1000).toLocaleDateString() +
- ' @ ' +
- new Date(+end * 1000).toLocaleTimeString()}
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/Profile/CancelListing.tsx b/ui/components/marketplace/Profile/CancelListing.tsx
deleted file mode 100644
index 46e140169..000000000
--- a/ui/components/marketplace/Profile/CancelListing.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { useContract } from '@thirdweb-dev/react'
-import { useRouter } from 'next/router'
-import { toast } from 'react-hot-toast'
-import toastStyle from '../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS } from '../../../const/config'
-import { PrivyWeb3Button } from '../../privy/PrivyWeb3Button'
-
-export default function CancelListing({
- marketplaceContract,
- listingId,
- type,
- expired = false,
-}: {
- marketplaceContract: any
- listingId: string | number
- type: string
- expired?: boolean
-}) {
- const router = useRouter()
-
- return (
-
-
- type === 'auction'
- ? marketplaceContract?.englishAuctions.cancelAuction(listingId)
- : marketplaceContract?.directListings.cancelListing(listingId)
- }
- onSuccess={() => {
- router.reload()
- setTimeout(() => {
- toast.success('Successfully canceled!', { style: toastStyle })
- }, 1000)
- }}
- />
-
- {type === 'auction' && expired ? (
-
This auction expired with no bids
- ) : type === 'auction' ? (
-
This auction can be canceled until the first bid is made
- ) : (
- ''
- )}
-
-
- )
-}
diff --git a/ui/components/marketplace/Profile/ClaimAsset.tsx b/ui/components/marketplace/Profile/ClaimAsset.tsx
deleted file mode 100644
index 2944466d5..000000000
--- a/ui/components/marketplace/Profile/ClaimAsset.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Web3Button, useContract } from '@thirdweb-dev/react'
-import { useRouter } from 'next/router'
-import { toast } from 'react-hot-toast'
-import toastStyle from '../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS } from '../../../const/config'
-import { PrivyWeb3Button } from '../../privy/PrivyWeb3Button'
-
-type ClaimAssetProps = {
- marketplaceContract: any
- walletAddress: string
- auctionId: string | number
-}
-
-export default function ClaimAsset({
- marketplaceContract,
- walletAddress,
- auctionId,
-}: ClaimAssetProps) {
- const router = useRouter()
-
- return (
-
- marketplaceContract?.englishAuctions.closeAuctionForBidder(
- auctionId,
- walletAddress
- )
- }
- onSuccess={() => {
- router.reload()
- setTimeout(() => {
- toast.success('Asset claimed!', { style: toastStyle })
- }, 1000)
- }}
- />
- )
-}
diff --git a/ui/components/marketplace/Profile/ClaimAuctionPayout.tsx b/ui/components/marketplace/Profile/ClaimAuctionPayout.tsx
deleted file mode 100644
index 66262a7a6..000000000
--- a/ui/components/marketplace/Profile/ClaimAuctionPayout.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Web3Button, useContract } from '@thirdweb-dev/react'
-import { useRouter } from 'next/router'
-import { toast } from 'react-hot-toast'
-import toastStyle from '../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS } from '../../../const/config'
-import { PrivyWeb3Button } from '../../privy/PrivyWeb3Button'
-
-interface ClaimAuctionPayoutProps {
- marketplaceContract: any
- claimable: boolean
- auctionId: number
-}
-
-export default function ClaimAuctionPayout({
- marketplaceContract,
- claimable,
- auctionId,
-}: ClaimAuctionPayoutProps) {
- const router = useRouter()
-
- return (
-
- marketplaceContract?.call('collectAuctionPayout', [+auctionId])
- }
- onSuccess={() => {
- router.reload()
- setTimeout(() => {
- toast.success('Successfully claimed!', { style: toastStyle })
- }, 1000)
- }}
- isDisabled={!claimable}
- />
- )
-}
diff --git a/ui/components/marketplace/Profile/ProfileAuctionListing.tsx b/ui/components/marketplace/Profile/ProfileAuctionListing.tsx
deleted file mode 100644
index fb946b9e8..000000000
--- a/ui/components/marketplace/Profile/ProfileAuctionListing.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import { MediaRenderer, useContract } from '@thirdweb-dev/react'
-import Link from 'next/link'
-import { useEffect, useState } from 'react'
-import { useClaimableAuction } from '../../../lib/marketplace/hooks'
-import { AuctionListing } from '../../../lib/marketplace/marketplace-utils'
-import { MARKETPLACE_ADDRESS, MOONEY_DECIMALS } from '../../../const/config'
-import Skeleton from '../Layout/Skeleton'
-import CancelListing from './CancelListing'
-import ClaimAuctionPayout from './ClaimAuctionPayout'
-
-interface ProfileAuctionListingProps {
- listing: AuctionListing
- walletAddress: string
-}
-
-export default function ProfileAuctionListing({
- listing,
- walletAddress,
-}: ProfileAuctionListingProps) {
- const buyOut = listing?.buyoutBidAmount
- const minBid = listing.minimumBidAmount
- const end = listing.endTimestamp
-
- const [winningBidObj, setWinningBidObj] = useState()
- const [loadingBid, setLoadingBid] = useState(true)
-
- const { contract: marketplace } = useContract(
- MARKETPLACE_ADDRESS,
- 'marketplace-v3'
- )
-
- const claimable = useClaimableAuction(winningBidObj, +buyOut, end)
-
- useEffect(() => {
- if (marketplace && listing?.auctionId) {
- setLoadingBid(true)
- marketplace.englishAuctions
- .getWinningBid(listing.auctionId)
- .then((bid: any) => {
- setWinningBidObj(bid)
- setLoadingBid(false)
- })
- .catch((e: any) => {
- setLoadingBid(false)
- console.log(e)
- })
- }
- }, [marketplace, listing])
-
- if (listing.status === 3 || listing.status === 2) return <>>
- return (
-
- Date.now()
- ? 'bg-gradient-to-br from-yellow-600 via-amber-500 to-moon-secondary'
- : 'bg-gray-800 opacity-70 text-gray-200'
- } px-2 py-1 rounded-full italic absolute top-2 left-3 text-sm`}
- >
- {'Status : '}
- {+end * 1000 > Date.now()
- ? 'Active âś”'
- : claimable
- ? 'Sold âś–'
- : 'Expired'}
-
- {/*Image with Link*/}
-
- {listing.asset ? (
-
-
-
- ) : (
-
- )}
-
-
-
- {/*Title*/}
-
- {listing.asset.name}
-
- {/*Quantity*/}
-
-
Quantity
-
{listing.quantity}
-
- {/*Price*/}
-
-
Buyout price
-
{`${Math.round(
- +buyOut / MOONEY_DECIMALS
- )} MOONEY`}
-
-
- {/*Minimum bid*/}
-
-
Minimum bid
-
{`${Math.round(
- +minBid / MOONEY_DECIMALS
- )} MOONEY`}
-
- {/*Winning bid*/}
-
-
Winning bid
-
{`${
- winningBidObj?.bidAmount / MOONEY_DECIMALS || 'No bids yet'
- } MOONEY`}
-
- {/*Expiration Date */}
-
-
Listing Expiration
-
{`${new Date(+end * 1000).toLocaleDateString()} @ ${new Date(
- +end * 1000
- ).toLocaleTimeString()}`}
-
-
- {/* Auctions that have ended and have a payout */}
-
- {claimable && (
- <>
- {walletAddress && walletAddress === listing.creatorAddress && (
-
- )}
-
-
{`(Payout: ${
- winningBidObj?.bidAmount / MOONEY_DECIMALS
- } MOONEY)`}
- >
- )}
- {/* Expired Auctions /w No bids */}
- {!loadingBid &&
- walletAddress &&
- walletAddress === listing.creatorAddress &&
- +end * 1000 < Date.now() &&
- !claimable ? (
-
- ) : !loadingBid && walletAddress && !winningBidObj ? (
-
- ) : (
- ''
- )}
-
-
- )
-}
diff --git a/ui/components/marketplace/Profile/ProfileDirectListing.tsx b/ui/components/marketplace/Profile/ProfileDirectListing.tsx
deleted file mode 100644
index 071e0f6e6..000000000
--- a/ui/components/marketplace/Profile/ProfileDirectListing.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import { MediaRenderer, useContract } from '@thirdweb-dev/react'
-import Link from 'next/link'
-import { DirectListing } from '../../../lib/marketplace/marketplace-utils'
-import { MARKETPLACE_ADDRESS, MOONEY_DECIMALS } from '../../../const/config'
-import Skeleton from '../Layout/Skeleton'
-import CancelListing from './CancelListing'
-
-interface ProfileDirectListingProps {
- listing: DirectListing
- walletAddress: string
-}
-
-export default function ProfileDirectListing({
- listing,
- walletAddress,
-}: ProfileDirectListingProps) {
- const buyOut = listing.pricePerToken
- const end = listing.endTimestamp
-
- const { contract: marketplace } = useContract(
- MARKETPLACE_ADDRESS,
- 'marketplace-v3'
- )
-
- return (
-
- {/*Status*/}
- Date.now()
- ? 'bg-gradient-to-br from-yellow-600 via-amber-500 to-moon-secondary'
- : 'bg-amber-700 opacity-70 text-gray-200'
- } px-2 py-1 rounded-full italic absolute top-2 left-3 text-sm`}
- >
- {'Status : '}
- {+end * 1000 > Date.now() ? 'Active âś”' : 'Sold âś–'}
-
- {/*Image with link */}
-
- {listing.asset ? (
-
-
-
- ) : (
-
- )}
-
-
- {/*Title*/}
-
- {listing.asset.name}
-
- {/*Quantity*/}
-
-
Quantity
-
{listing.quantity}
-
- {/*Price */}
-
-
Price
-
{`${Math.round(
- +buyOut / MOONEY_DECIMALS
- )} MOONEY`}
-
- {/*Expiration date*/}
-
-
Listing Expiration
-
{`${new Date(+end * 1000).toLocaleDateString()} @ ${new Date(
- +end * 1000
- ).toLocaleTimeString()}`}
-
- {walletAddress && walletAddress === listing.creatorAddress && (
-
- )}
-
-
- )
-}
diff --git a/ui/components/marketplace/Profile/ProfileListingGrid.tsx b/ui/components/marketplace/Profile/ProfileListingGrid.tsx
deleted file mode 100644
index 73005b65d..000000000
--- a/ui/components/marketplace/Profile/ProfileListingGrid.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import { useAddress } from '@thirdweb-dev/react'
-import {
- AuctionListing,
- DirectListing,
-} from '../../../lib/marketplace/marketplace-utils'
-import ProfileAuctionListing from './ProfileAuctionListing'
-import ProfileDirectListing from './ProfileDirectListing'
-import ProfileWinningBid from './ProfileWinningBid'
-
-export default function ProfileListingGrid({ listings, type = 'direct' }: any) {
- const address = useAddress()
- return (
-
- {listings && listings[0] ? (
- <>
- {type === 'direct' &&
- listings.map((l: DirectListing, i: number) => (
-
- ))}{' '}
- {type === 'auction' &&
- listings.map((a: AuctionListing, i: number) => (
-
- ))}
- {type === 'winningBids' &&
- listings.map((a: AuctionListing, i: number) => (
-
- ))}
- >
- ) : (
-
- {type === 'direct' || type === 'auction'
- ? `No ${type} listings`
- : `No assets to claim`}
-
- )}
-
- )
-}
diff --git a/ui/components/marketplace/Profile/ProfileWinningBid.tsx b/ui/components/marketplace/Profile/ProfileWinningBid.tsx
deleted file mode 100644
index fbfa740ab..000000000
--- a/ui/components/marketplace/Profile/ProfileWinningBid.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { MediaRenderer, useContract } from '@thirdweb-dev/react'
-import { useEffect, useState } from 'react'
-import { AuctionListing } from '../../../lib/marketplace/marketplace-utils'
-import { MARKETPLACE_ADDRESS } from '../../../const/config'
-import Skeleton from '../Layout/Skeleton'
-import ClaimAsset from './ClaimAsset'
-
-interface ProfileAuctionListingProps {
- listing: AuctionListing
- walletAddress: string
-}
-
-export default function ProfileWinningBid({
- listing,
- walletAddress,
-}: ProfileAuctionListingProps) {
- const [winningBidObj, setWinningBidObj] = useState()
- const [loadingBid, setLoadingBid] = useState(true)
-
- const { contract: marketplace } = useContract(
- MARKETPLACE_ADDRESS,
- 'marketplace-v3'
- )
-
- useEffect(() => {
- if (marketplace && listing?.auctionId) {
- setLoadingBid(true)
- marketplace.englishAuctions
- .getWinningBid(listing.auctionId)
- .then((bid: any) => {
- setWinningBidObj(bid)
- setLoadingBid(false)
- })
- .catch((e: any) => {
- setLoadingBid(false)
- console.log(e)
- })
- }
- }, [marketplace, listing])
-
- if (listing.status === 3 || listing.status === 2) return <>>
- return (
-
-
- {'Status : '}
- {'Won ✨'}
-
- {/*Image with Link*/}
-
- {listing.asset ? (
-
- ) : (
-
- )}
-
-
-
- {/*Title*/}
-
- {listing.asset.name}
-
-
- {/* Auctions that have ended and have a payout */}
- {walletAddress &&
- winningBidObj &&
- winningBidObj?.bidderAddress === walletAddress && (
-
- )}
-
-
- )
-}
diff --git a/ui/components/marketplace/Sell/NoAssets.tsx b/ui/components/marketplace/Sell/NoAssets.tsx
deleted file mode 100644
index 890cd4ac0..000000000
--- a/ui/components/marketplace/Sell/NoAssets.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { useNetworkMismatch } from '@thirdweb-dev/react'
-import Metadata from '../Layout/Metadata'
-import VerticalStar from '../assets/VerticalStar'
-
-const NoAssets = ({ address, userAssets, loading }: any) => {
- const networkMistmatch = useNetworkMismatch()
- return (
-
-
-
-
- Sell NFTs
-
-
-
-
- {!address && (
-
- {'Please connect your wallet'}
-
- )}
- {address && loading && (
-
- {!loading ? 'Please connect your wallet' : 'Loading...'}
-
- )}
- {networkMistmatch && (
-
- {`The marketplace only supports NFTs on ${
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? 'Polygon' : 'Mumbai'
- }`}
-
- )}
- {address && !networkMistmatch && !loading && !userAssets?.[0] && (
-
- {
- "You don't have any approved NFTs to sell. Please buy an NFT from the marketplace or submit a collection."
- }
-
- )}
-
-
- )
-}
-
-export default NoAssets
diff --git a/ui/components/marketplace/Sell/SaleInfo/BatchSaleInfo.tsx b/ui/components/marketplace/Sell/SaleInfo/BatchSaleInfo.tsx
deleted file mode 100644
index 1c405e06e..000000000
--- a/ui/components/marketplace/Sell/SaleInfo/BatchSaleInfo.tsx
+++ /dev/null
@@ -1,471 +0,0 @@
-import { useContract, Web3Button } from '@thirdweb-dev/react'
-import React, { useEffect, useState } from 'react'
-import { useForm } from 'react-hook-form'
-import toast, { Toaster } from 'react-hot-toast'
-import {
- AuctionSubmission,
- DirectSubmission,
-} from '../../../../lib/marketplace/marketplace-utils'
-import toastStyle from '../../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS, MOONEY_ADDRESSES } from '../../../../const/config'
-import { PrivyWeb3Button } from '../../../privy/PrivyWeb3Button'
-
-type Props = {
- nft: any
- contractAddress: string
- walletAddress: any
- setSelectedNft: Function
- batchType: 'direct' | 'auction' | undefined
- listingBatch: any
- auctionBatch: any
-}
-
-type AuctionFormData = {
- nftContractAddress: string
- tokenId: any
- startDate: Date
- quantity: string
- endDate: Date
- floorPrice: string
- buyoutPrice: string
-}
-
-type DirectFormData = {
- nftContractAddress: string
- tokenId: any
- quantity: string
- price: string
- startDate: Date
- endDate: Date
-}
-
-export default function BatchSaleInfo({
- nft,
- contractAddress,
- walletAddress,
- setSelectedNft,
- batchType,
- listingBatch,
- auctionBatch,
-}: Props) {
- const { contract: nftCollection } = useContract(contractAddress)
-
- const chainName =
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? 'polygon' : 'mumbai'
-
- // Manage form submission state using tabs and conditional rendering
- const [tab, setTab] = useState<'direct' | 'auction'>('direct')
-
- //Check if user has balance for quanity
- function checkBalance(quantity: string | number) {
- const batch =
- batchType === 'direct'
- ? listingBatch.data.listings
- : auctionBatch.data.auctions
- const hasBalance = nft && nft.quantityOwned >= +quantity
- !hasBalance && toast.error('Insufficient balance')
- return hasBalance
- }
- // User requires to set marketplace approval before listing
- async function checkAndProvideApproval() {
- try {
- const hasApproval = await nftCollection?.call(
- 'isApprovedForAll',
-
- [walletAddress || nft.owner, MARKETPLACE_ADDRESS]
- )
-
- // If it is, provide approval
- if (!hasApproval) {
- const txResult = await nftCollection?.call('setApprovalForAll', [
- MARKETPLACE_ADDRESS,
- true,
- ])
-
- if (txResult) {
- toast.success('Marketplace approval granted', {
- icon: 'đź‘Ť',
- style: toastStyle,
- position: 'bottom-center',
- })
- }
- }
-
- return true
- } catch (err) {
- console.error(err)
- }
- }
-
- // Manage form values using react-hook-form library: Auction form
- const { register: registerAuction, handleSubmit: handleSubmitAuction } =
- useForm({
- defaultValues: {
- nftContractAddress: contractAddress,
- tokenId: nft.metadata.id,
- startDate: new Date(),
- quantity: '1',
- endDate: new Date(),
- floorPrice: '0',
- buyoutPrice: '0',
- },
- })
-
- // Manage form values using react-hook-form library: Direct form
- const { register: registerDirect, handleSubmit: handleSubmitDirect } =
- useForm({
- defaultValues: {
- nftContractAddress: contractAddress,
- tokenId: nft.metadata.id,
- quantity: '1',
- startDate: new Date(),
- endDate: new Date(),
- price: '0',
- },
- })
-
- //handle direct listing
- async function handleSubmissionAuction(data: AuctionFormData) {
- if (!checkBalance(data.quantity)) return
-
- await checkAndProvideApproval()
- const startDate: any = new Date(data.startDate).valueOf() / 1000
- const endDate: any = new Date(data.endDate).valueOf() / 1000
-
- const auction: AuctionSubmission = {
- assetContractAddress: data.nftContractAddress,
- tokenId: data.tokenId,
- quantity: nft.type === 'ERC1155' ? data.quantity : '1',
- currencyContractAddress: MOONEY_ADDRESSES[chainName],
- minimumBidAmount: String(+data.floorPrice),
- buyoutBidAmount: String(+data.buyoutPrice),
- timeBufferInSeconds: '900', //15 minutes
- bidBufferBps: '500',
- startTimestamp: startDate,
- endTimestamp: endDate,
- }
- const batchData = { auction, nft } //pass auction w/ nft so it can render in manage batch
-
- auctionBatch.addAuction(batchData)
- setSelectedNft(undefined)
- toast('The auction was successfully added to the batch!', {
- icon: '🚀',
- style: toastStyle,
- position: 'bottom-center',
- })
- }
-
- //handle auction listing
- async function handleSubmissionDirect(data: DirectFormData) {
- if (!checkBalance(data.quantity)) return
- await checkAndProvideApproval()
- const startDate: any = new Date(data.startDate).valueOf() / 1000
- const endDate: any = new Date(data.endDate).valueOf() / 1000
- const listing: DirectSubmission = {
- assetContractAddress: contractAddress,
- tokenId: data.tokenId,
- quantity: nft.type === 'ERC1155' ? data.quantity : '1',
- currencyContractAddress: MOONEY_ADDRESSES[chainName],
- pricePerToken: String(+data.price),
- startTimestamp: startDate,
- endTimestamp: endDate,
- isReservedListing: false,
- }
-
- const batchData = { listing, nft } //pass listing w/ nft so it can render in manage batch
- listingBatch.addListing(batchData)
- setSelectedNft(undefined)
- toast('The listing was successfully added to batch!', {
- icon: '🚀',
- style: toastStyle,
- position: 'bottom-center',
- })
- }
-
- //set tab to batch type
- useEffect(() => {
- if (batchType) {
- setTab(batchType)
- }
- }, [batchType])
-
- return (
- <>
-
-
-
-
- !batchType || batchType === 'direct'
- ? setTab('direct')
- : toast.error(
- 'This is an auction batch. Please select auction tab to view auction details'
- )
- }
- >
- Direct
-
-
- !batchType || batchType === 'auction'
- ? setTab('auction')
- : toast.error(
- 'This is a direct batch. Please select direct tab to view direct details'
- )
- }
- >
- Auction
-
-
- <>
- <>
- {/* Direct listing fields */}
-
- {/* Input field for ERC1155 quantity */}
- {nft.type === 'ERC1155' && (
- <>
-
- {' '}
- Quantity{' '}
-
-
- {
- if (+e.target.value > nft.quantityOwned) {
- e.target.value = nft.quantityOwned
- toast.error(
- `You can't list more than ${nft.quantityOwned} of this asset`,
- { style: toastStyle }
- )
- }
- }}
- />
-
{`/ ${nft.quantityOwned || '/ ...'}`}
-
-
- *list multiple assets*
-
- >
- )}
-
Duration
- {/* Input field for auction start date */}
-
- {' '}
- Listing Starts on{' '}
-
-
- {/* Input field for auction end date */}
-
- {' '}
- Listing Ends on{' '}
-
-
- {
- <>
-
Price
-
- {' '}
- {'Price per asset'}
-
-
-
-
- await handleSubmitDirect(handleSubmissionDirect)()
- }
- />
- >
- }
-
-
- {/* Auction listing fields */}
-
- {/* Input field for quantity */}
- {nft.type === 'ERC1155' && (
- <>
-
- {' '}
- Quantity{' '}
-
-
- {
- if (+e.target.value > nft?.quantityOwned) {
- e.target.value = nft.quantityOwned
- toast.error(
- `You can't list more than ${nft.quantityOwned} of this asset`,
- { style: toastStyle }
- )
- }
- }}
- />
-
{`/ ${nft.quantityOwned || '/ ...'}`}
-
-
- *list multiple assets as a bundle*
-
- >
- )}
-
-
Duration
-
- {/* Input field for auction start date */}
-
- {' '}
- Auction Starts on{' '}
-
-
-
- {/* Input field for auction end date */}
-
- {' '}
- Auction Ends on{' '}
-
-
-
Price
-
- {/* Input field for minimum bid price */}
-
- {' '}
- Allow bids starting from{' '}
-
-
-
- {/* Input field for buyout price */}
-
- {' '}
- Buyout price for asset or bundle{' '}
-
-
-
-
- await handleSubmitAuction(handleSubmissionAuction)()
- }
- />
- {/* info */}
-
-
Auction Info:
-
- *Once a bid is placed, the auction cannot be cancelled.*
-
-
- *Buyout: If an auction is bought out, the bidder will receive
- the asset and the seller will receive the payout
- automatically.*
-
-
- *Bids: If an auction expires with a winning bid, the buyer or
- seller will have to close the auction by claiming their asset
- or payout.*
-
-
-
- >
- >
-
- >
- )
-}
diff --git a/ui/components/marketplace/Sell/SaleInfo/ManageBatch.tsx b/ui/components/marketplace/Sell/SaleInfo/ManageBatch.tsx
deleted file mode 100644
index c824dc86e..000000000
--- a/ui/components/marketplace/Sell/SaleInfo/ManageBatch.tsx
+++ /dev/null
@@ -1,186 +0,0 @@
-import {
- MediaRenderer,
- ThirdwebNftMedia,
- Web3Button,
-} from '@thirdweb-dev/react'
-import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
-import { toast } from 'react-hot-toast'
-import toastStyle from '../../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS } from '../../../../const/config'
-import { PrivyWeb3Button } from '../../../privy/PrivyWeb3Button'
-
-type ManageBatchProps = {
- batchType: 'direct' | 'auction' | undefined
- setBatchType: Function
- batch: any
- setBatch: Function
- listingBatch: any
- auctionBatch: any
-}
-
-export default function ManageBatch({
- batchType,
- setBatchType,
- batch,
- setBatch,
- listingBatch,
- auctionBatch,
-}: ManageBatchProps) {
- const router = useRouter()
- const [enabled, setEnabled] = useState(false)
-
- useEffect(() => {
- if (batchType === 'direct') {
- setBatch(listingBatch.data.listings)
- } else if (batchType === 'auction') {
- setBatch(auctionBatch.data.auctions)
- }
- }, [
- batchType,
- listingBatch.data?.listings,
- auctionBatch.data?.auctions,
- setBatch,
- ])
-
- function CreateBatch() {
- return (
- {
- if (!batchType)
- return toast('Add 2 or more listings to create a batch', {
- icon: '✨',
- style: toastStyle,
- duration: 5000,
- })
- if (batchType === 'direct') {
- await listingBatch.listAll()
- } else if (batchType === 'auction') {
- await auctionBatch.listAll()
- }
- router.reload()
- }}
- />
- )
- }
-
- return (
- <>
- {/* Manage and submit*/}
-
-
- !batch || batch?.length <= 1
- ? toast('Add 2 or more listings to create a batch', {
- icon: '✨',
- style: toastStyle,
- duration: 5000,
- })
- : setEnabled(!enabled)
- }
- className="bg-indigo-600 px-3 py-2.5 rounded-sm shadow shadow-white hover:scale-[1.03] transition-all duration-150 font-medium"
- >
- {!enabled ? 'Manage Batch' : 'Finish Managing'}
-
-
-
- {/*Manage batch*/}
- {enabled && batchType && (
-
-
- Type of Batch:{' '}
-
- {batchType}
-
-
-
- {batch &&
- batch.map((item: any, i: number) => (
-
- {/*Replace for IMAGE here, add 120px Width and Height, 'rounded-2xl' and 'object-cover' to the image*/}
- {item && batchType ? (
-
- ) : (
-
- )}
-
-
-
- {'#' + Number(i + 1)}
-
-
- batchType === 'direct'
- ? listingBatch.removeListing(i)
- : auctionBatch.removeAuction(i)
- }
- >
- âś–
-
-
- {'Token ID'}
-
- {item.tokenId}
-
-
-
- {/* quantity */}
-
- {'Quantity'}
-
- {item.quantity}
-
-
-
- {batchType === 'direct' ? (
-
- {'Price Per NFT'}
-
- {item.pricePerToken}
-
-
- ) : (
-
- {'Reserve Price'}
-
- {item.buyoutBidAmount}
-
-
- )}
-
-
- ))}
-
-
- {
- setBatch(undefined)
- setBatchType(undefined)
- listingBatch.clearAll()
- auctionBatch.clearAll()
- setEnabled(false)
- }}
- >
- Clear All
-
-
-
- )}
- >
- )
-}
diff --git a/ui/components/marketplace/Sell/SaleInfo/SingleSaleInfo.tsx b/ui/components/marketplace/Sell/SaleInfo/SingleSaleInfo.tsx
deleted file mode 100644
index bb4fbad2e..000000000
--- a/ui/components/marketplace/Sell/SaleInfo/SingleSaleInfo.tsx
+++ /dev/null
@@ -1,446 +0,0 @@
-import { useContract, Web3Button } from '@thirdweb-dev/react'
-import React, { useState } from 'react'
-import { useForm } from 'react-hook-form'
-import toast, { Toaster } from 'react-hot-toast'
-import {
- AuctionSubmission,
- DirectSubmission,
-} from '../../../../lib/marketplace/marketplace-utils'
-import toastStyle from '../../../../lib/marketplace/marketplace-utils/toastConfig'
-import { MARKETPLACE_ADDRESS, MOONEY_ADDRESSES } from '../../../../const/config'
-import { PrivyWeb3Button } from '../../../privy/PrivyWeb3Button'
-
-type Props = {
- nft: any
- contractAddress: string
- router: any
- walletAddress: any
-}
-
-type AuctionFormData = {
- nftContractAddress: string
- tokenId: any
- startDate: Date
- quantity: string
- endDate: Date
- floorPrice: string
- buyoutPrice: string
-}
-
-type DirectFormData = {
- nftContractAddress: string
- tokenId: any
- quantity: string
- price: string
- startDate: Date
- endDate: Date
-}
-
-export default function SingleSaleInfo({
- nft,
- contractAddress,
- router,
- walletAddress,
-}: Props) {
- const { contract: marketplace }: any = useContract(
- MARKETPLACE_ADDRESS,
- 'marketplace-v3'
- )
-
- const chainName =
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? 'polygon' : 'mumbai'
-
- const { contract: nftCollection } = useContract(contractAddress)
-
- // Manage form submission state using tabs and conditional rendering
- const [tab, setTab] = useState<'direct' | 'auction'>('direct')
-
- //Check if user has balance for quanity
- function checkBalance(quantity: string | number) {
- const hasBalance = nft && nft.quantityOwned >= +quantity
- !hasBalance && toast.error('Insufficient balance')
- return hasBalance
- }
-
- // User requires to set marketplace approval before listing
- async function checkAndProvideApproval() {
- try {
- const hasApproval = await nftCollection?.call(
- 'isApprovedForAll',
-
- [walletAddress || nft.owner, MARKETPLACE_ADDRESS]
- )
-
- // If it is, provide approval
- if (!hasApproval) {
- const txResult = await nftCollection?.call('setApprovalForAll', [
- MARKETPLACE_ADDRESS,
- true,
- ])
-
- if (txResult) {
- toast.success('Marketplace approval granted', {
- icon: 'đź‘Ť',
- style: toastStyle,
- position: 'bottom-center',
- })
- }
- }
-
- return true
- } catch (err) {
- console.error(err)
- }
- }
-
- // Manage form values using react-hook-form library: Auction form
- const { register: registerAuction, handleSubmit: handleSubmitAuction } =
- useForm({
- defaultValues: {
- nftContractAddress: contractAddress,
- tokenId: nft.metadata.id,
- startDate: new Date(),
- quantity: '1',
- endDate: new Date(),
- floorPrice: '0',
- buyoutPrice: '0',
- },
- })
-
- // Manage form values using react-hook-form library: Direct form
- const { register: registerDirect, handleSubmit: handleSubmitDirect } =
- useForm({
- defaultValues: {
- nftContractAddress: contractAddress,
- tokenId: nft.metadata.id,
- quantity: '1',
- startDate: new Date(),
- endDate: new Date(),
- price: '0',
- },
- })
-
- //handle direct listing
- async function handleSubmissionAuction(data: AuctionFormData) {
- if (!checkBalance(data.quantity)) return
-
- await checkAndProvideApproval()
- const startDate: any = new Date(data.startDate).valueOf() / 1000
- const endDate: any = new Date(data.endDate).valueOf() / 1000
-
- const auction: AuctionSubmission = {
- assetContractAddress: data.nftContractAddress,
- tokenId: data.tokenId,
- quantity: nft.type === 'ERC1155' ? data.quantity : '1',
- currencyContractAddress: MOONEY_ADDRESSES[chainName],
- minimumBidAmount: String(+data.floorPrice),
- buyoutBidAmount: String(+data.buyoutPrice),
- timeBufferInSeconds: '900', //15 minutes
- bidBufferBps: '500',
- startTimestamp: startDate,
- endTimestamp: endDate,
- }
- const txResult = await marketplace.englishAuctions.createAuction(auction)
- await router.push(`/marketplace/collection/${data.nftContractAddress}/${data.tokenId}`)
- toast('Listed Successfully!', {
- icon: '🥳',
- style: toastStyle,
- position: 'bottom-center',
- })
- return txResult
- }
-
- //handle auction listing
- async function handleSubmissionDirect(data: DirectFormData) {
- if (!checkBalance(data.quantity)) return
- await checkAndProvideApproval()
- const startDate: any = new Date(data.startDate).valueOf() / 1000
- const endDate: any = new Date(data.endDate).valueOf() / 1000
- const listing: DirectSubmission = {
- assetContractAddress: contractAddress,
- tokenId: data.tokenId,
- quantity: nft.type === 'ERC1155' ? data.quantity : '1',
- currencyContractAddress: MOONEY_ADDRESSES[chainName],
- pricePerToken: String(+data.price),
- startTimestamp: startDate,
- endTimestamp: endDate,
- isReservedListing: false,
- }
- const txResult = await marketplace.directListings.createListing(listing)
- await router.push(`/marketplace/collection/${data.nftContractAddress}/${data.tokenId}`)
- toast('Listed Successfully!', {
- icon: '🥳',
- style: toastStyle,
- position: 'bottom-center',
- })
- return txResult
- }
-
- return (
- <>
-
-
-
-
setTab('direct')}
- >
- Direct
-
- setTab('auction')}
- >
- Auction
-
-
- <>
- <>
- {/* Direct listing fields */}
-
- {/* Input field for ERC1155 quantity */}
- {nft.type === 'ERC1155' && (
- <>
-
- {' '}
- Quantity{' '}
-
-
- {
- if (+e.target.value > nft.quantityOwned) {
- e.target.value = nft.quantityOwned
- toast.error(
- `You can't list more than ${nft.quantityOwned} of this asset`,
- { style: toastStyle }
- )
- }
- }}
- />
-
{`/ ${nft.quantityOwned || '/ ...'}`}
-
-
- *list multiple assets*
-
- >
- )}
-
Duration
- {/* Input field for auction start date */}
-
- {' '}
- Listing Starts on{' '}
-
-
- {/* Input field for auction end date */}
-
- {' '}
- Listing Ends on{' '}
-
-
- {
- <>
-
Price
-
- {' '}
- {'Price per asset'}
-
-
-
-
{
- console.log('test')
- await handleSubmitDirect(handleSubmissionDirect)()
- }}
- />
- >
- }
-
-
- {/* Auction listing fields */}
-
- {/* Input field for quantity */}
- {nft.type === 'ERC1155' && (
- <>
-
- {' '}
- Quantity{' '}
-
-
- {
- if (+e.target.value > nft?.quantityOwned) {
- e.target.value = nft.quantityOwned
- toast.error(
- `You can't list more than ${nft.quantityOwned} of this asset`,
- { style: toastStyle }
- )
- }
- }}
- />
-
{`/ ${nft.quantityOwned || '/ ...'}`}
-
-
- *list multiple assets as a bundle*
-
- >
- )}
-
-
Duration
-
- {/* Input field for auction start date */}
-
- {' '}
- Auction Starts on{' '}
-
-
-
- {/* Input field for auction end date */}
-
- {' '}
- Auction Ends on{' '}
-
-
-
Price
-
- {/* Input field for minimum bid price */}
-
- {' '}
- Allow bids starting from{' '}
-
-
-
- {/* Input field for buyout price */}
-
- {' '}
- Buyout price for asset or bundle{' '}
-
-
-
-
- await handleSubmitAuction(handleSubmissionAuction)()
- }
- />
-
- {/* info */}
-
-
Auction Info:
-
- *Once a bid is placed, the auction cannot be cancelled.*
-
-
- *Buyout: If an auction is bought out, the bidder will receive
- the asset and the seller will receive the payout
- automatically.*
-
-
- *Bids: If an auction expires with a winning bid, the buyer or
- seller will have to close the auction by claiming their asset
- or payout.*
-
-
-
- >
- >
-
- >
- )
-}
diff --git a/ui/components/marketplace/Sell/SaleInfo/ToggleSaleInfo.tsx b/ui/components/marketplace/Sell/SaleInfo/ToggleSaleInfo.tsx
deleted file mode 100644
index f9391181f..000000000
--- a/ui/components/marketplace/Sell/SaleInfo/ToggleSaleInfo.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-export default function ToggleSaleInfo({ isBatch, setIsBatch }: any) {
- return (
-
-
setIsBatch(!isBatch)}
- >
-
-
- Single
-
- |
-
- Batch
-
-
-
-
- {isBatch
- ? "Select multiple NFTs to sell at once"
- : "Select a single NFT to sell"}
-
-
- );
-}
diff --git a/ui/components/marketplace/Sell/SellCard.tsx b/ui/components/marketplace/Sell/SellCard.tsx
deleted file mode 100644
index 293092eb0..000000000
--- a/ui/components/marketplace/Sell/SellCard.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { ThirdwebNftMedia } from '@thirdweb-dev/react'
-
-const SellCard = ({ nft, i, setSelectedNft }: any) => {
- console.log(nft)
- if (nft.quantityOwned <= 0) return <>> //only render if user owns at least 1 of this NFT
- return (
- setSelectedNft(nft)}
- >
-
- {nft.type === 'ERC1155' && (
-
- {'x' + nft.quantityOwned}
-
- )}
-
-
{nft.collectionName}
-
- {nft.metadata?.name}
-
-
- {nft?.type}
-
-
-
- )
-}
-
-export default SellCard
diff --git a/ui/components/marketplace/Sell/SubmitCollection.tsx b/ui/components/marketplace/Sell/SubmitCollection.tsx
deleted file mode 100644
index e48b187e7..000000000
--- a/ui/components/marketplace/Sell/SubmitCollection.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { useRef, useState } from 'react'
-import { useClickOutside } from '../../../lib/marketplace/marketplace-utils/hooks'
-
-export default function SubmitCollection() {
- const submitRef: any = useRef()
- const [enabled, setEnabled] = useState(false)
-
- useClickOutside(submitRef, enabled, setEnabled)
-
- return (
-
- {!enabled ? (
-
-
setEnabled(true)}
- >
- Submit a Collection
-
-
- {
- "Don't see your assets? Apply to have your collection added to the marketplace \n (you must be the owner of the collection)"
- }
-
-
- ) : (
-
- setEnabled(false)}
- >
- âś–
-
-
-
- )}
-
- )
-}
diff --git a/ui/components/marketplace/assets/FrameDetail.jsx b/ui/components/marketplace/assets/FrameDetail.jsx
deleted file mode 100644
index 6c54351bb..000000000
--- a/ui/components/marketplace/assets/FrameDetail.jsx
+++ /dev/null
@@ -1,12 +0,0 @@
-const FrameDetail = () => (
-
-
-
-
-
-
-
-
-
-);
-export default FrameDetail;
diff --git a/ui/components/marketplace/assets/Glass.jsx b/ui/components/marketplace/assets/Glass.jsx
deleted file mode 100644
index 8547a779e..000000000
--- a/ui/components/marketplace/assets/Glass.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-const Glass = () => (
-
-
-
-);
-export default Glass;
diff --git a/ui/components/marketplace/assets/Glass.tsx b/ui/components/marketplace/assets/Glass.tsx
deleted file mode 100644
index 7594ef59a..000000000
--- a/ui/components/marketplace/assets/Glass.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-// If size isn't passed, defaults to the size of how the glass looks on the mobile navbar.
-
-interface Glass {
- size?: {
- height: number;
- width: number;
- };
-}
-
-const Glass = ({ size }: Glass) => (
-
-
-
-);
-export default Glass;
diff --git a/ui/components/marketplace/assets/Hamburger.jsx b/ui/components/marketplace/assets/Hamburger.jsx
deleted file mode 100644
index 16274cdea..000000000
--- a/ui/components/marketplace/assets/Hamburger.jsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import * as React from "react"
-const Hamburger = () => (
-
-
-
-)
-export default Hamburger
diff --git a/ui/components/marketplace/assets/HeroStar.tsx b/ui/components/marketplace/assets/HeroStar.tsx
deleted file mode 100644
index fa295c050..000000000
--- a/ui/components/marketplace/assets/HeroStar.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-// If size isn't passed, defaults to the size of how the stars looks on the largest desktop screen.
-
-interface Star {
- size?: {
- height: number;
- width: number;
- };
-}
-
-const HeroStar = ({size} : Star) => (
-
-
-
-);
-export default HeroStar;
diff --git a/ui/components/marketplace/assets/LogoSmall.tsx b/ui/components/marketplace/assets/LogoSmall.tsx
deleted file mode 100644
index cd7063c63..000000000
--- a/ui/components/marketplace/assets/LogoSmall.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-// If size isn't passed, defaults to the size of how the logo looks on the mobile navbar.
-
-interface Logo {
- size?: {
- height: number;
- width: number;
- };
-}
-
-const LogoSmall = ({ size }: Logo) => (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-);
-export default LogoSmall;
diff --git a/ui/components/marketplace/assets/VerticalStar.tsx b/ui/components/marketplace/assets/VerticalStar.tsx
deleted file mode 100644
index bb71788cf..000000000
--- a/ui/components/marketplace/assets/VerticalStar.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-//In the hero its 60 x 60
-// If size isn't passed, defaults to the size of how the star looks on section headers.
-
-interface Star {
- size?: {
- width: number;
- height: number;
- };
-}
-const VerticalStar = ({ size }: Star) => (
-
-
-
-);
-export default VerticalStar;
diff --git a/ui/components/marketplace/assets/seed.tsx b/ui/components/marketplace/assets/seed.tsx
deleted file mode 100644
index bd6ebd316..000000000
--- a/ui/components/marketplace/assets/seed.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-export const nft = {
- metadata: {
- id: '1',
- name: 'Space Ticket',
- description: 'This is a description',
- attributes: [
- {
- trait_type: 'Rarity',
- value: 'Common',
- },
- {
- trait_type: 'Level',
- value: 1,
- },
- ],
- },
- type: 'ERC1155',
-}
-
-export const collectionMetadata = {
- name: 'Space Ticket',
- description: 'This is a description',
- image: 'ipfs://QmV4HC9fNrPJQeYpbW55NLLuSBMyzE11zS1L4HmL6Lbk7X',
-}
diff --git a/ui/components/marketplace/r3f/Profile/BannerScene.tsx b/ui/components/marketplace/r3f/Profile/BannerScene.tsx
deleted file mode 100644
index 5286b4cf4..000000000
--- a/ui/components/marketplace/r3f/Profile/BannerScene.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* eslint-disable react/no-unknown-property */
-import { useFrame, useThree } from '@react-three/fiber'
-import { useRef } from 'react'
-import ThreeText from '../ThreeText'
-
-type BannerSceneProps = {
- walletAddress: string
-}
-
-export default function BannerScene({ walletAddress }: BannerSceneProps) {
- const spotLightRef: any = useRef()
- const { camera, size } = useThree()
-
- useFrame(() => {
- camera.position.z = window.scrollY / 100
- if (spotLightRef.current) {
- spotLightRef.current.position.x =
- size.width > 800
- ? window.scrollY / 3 - size.width / 11
- : window.scrollY / 5 - size.width / 10
- }
- })
-
- return (
- <>
- 800
- ? [(-size.width / 150) * 2.5, -0.5, 50]
- : [(-size.width / 105) * 2.5, -0.5, 50]
- }
- color={'royalblue'}
- intensity={0.75}
- distance={500}
- />
-
- 800
- ? [-size.width / 150, -0.5, -5]
- : [-size.width / 105, -0.5, -5]
- }
- size={size.width > 800 ? size.width / 1000 : size.width / 700}
- height={0.15}
- />
- >
- )
-}
diff --git a/ui/components/marketplace/r3f/Skybox.tsx b/ui/components/marketplace/r3f/Skybox.tsx
deleted file mode 100644
index 2eed97971..000000000
--- a/ui/components/marketplace/r3f/Skybox.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-/* eslint-disable react/no-unknown-property */
-import { useTexture } from '@react-three/drei'
-import * as THREE from 'three'
-
-export default function Skybox({ image, position = [0, 0, 0] }: any) {
- const texture: any = useTexture(image)
-
- return (
-
-
-
-
- )
-}
diff --git a/ui/components/marketplace/r3f/ThreeText.tsx b/ui/components/marketplace/r3f/ThreeText.tsx
deleted file mode 100644
index a940896b3..000000000
--- a/ui/components/marketplace/r3f/ThreeText.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* eslint-disable react/no-unknown-property */
-import { extend } from '@react-three/fiber'
-import { Object3DNode } from '@react-three/fiber'
-import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js'
-import { FontLoader } from 'three/examples/jsm/loaders/FontLoader.js'
-import goodtimes from '../../../public/fonts/goodtimes.json'
-
-class Text extends TextGeometry {}
-
-extend({ TextGeometry })
-
-declare module '@react-three/fiber' {
- interface ThreeElements {
- textGeometry: Object3DNode
- }
-}
-
-interface ThreeTextProps {
- position: [number, number, number]
- text: string
- height?: number
- size?: number
- color?: string
-}
-
-export default function ThreeText({
- position,
- text,
- height = 1,
- size = 1,
- color = '#1d1d1d',
-}: ThreeTextProps) {
- const font: any = new FontLoader().parse(goodtimes)
- return (
-
-
-
-
- )
-}
diff --git a/ui/cypress/integration/network/entity-citizen-card.cy.tsx b/ui/cypress/integration/network/entity-citizen-card.cy.tsx
deleted file mode 100644
index 32977fa95..000000000
--- a/ui/cypress/integration/network/entity-citizen-card.cy.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import { PrivyProvider } from '@privy-io/react-auth'
-import { Sepolia } from '@thirdweb-dev/chains'
-import { NFT } from '@thirdweb-dev/sdk'
-import React from 'react'
-import { PrivyThirdwebSDKProvider } from '@/lib/privy/PrivyThirdwebSDKProvider'
-import EntityCitizenCard from '@/components/directory/EntityCitizenCard'
-
-describe(' ', () => {
- let dummyNft: NFT
- before(() => {
- //load product test data from fixture
- cy.fixture('nft/nft').then((nft) => {
- dummyNft = nft
- })
- })
- it('Renders Entity Citizen Card as Entity', () => {
- cy.mount(
-
-
-
-
-
- )
- cy.get('#entity-citizen-card-name').should(
- 'have.text',
- dummyNft.metadata.name
- )
- cy.get('#entity-citizen-card-description').should(
- 'have.text',
- `${dummyNft.metadata.description?.slice(0, 100)}...`
- )
- cy.get('#entity-citizen-card-id').should(
- 'have.text',
- `ID: ${dummyNft.metadata.id}`
- )
- cy.get('#entity-citizen-card-type').should('have.text', 'Entity')
- })
-
- it('Renders Entity Citizen Card as Citizen', () => {
- cy.mount(
-
-
-
-
-
- )
-
- cy.get('#entity-citizen-card-type').should('have.text', 'Citizen')
- })
-})
diff --git a/ui/lib/marketplace/hooks/index.ts b/ui/lib/marketplace/hooks/index.ts
deleted file mode 100644
index 40474511a..000000000
--- a/ui/lib/marketplace/hooks/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export { useAssets } from "./useAssets";
-export { useListingsByTokenId } from "./useListingsByTokenId";
-export { useListingsByWallet } from "./useListingsByWallet";
-export { useSearch } from "./useSearch";
-export { useUserAssets } from "./useUserAssets";
-export { useClaimableAuction } from "./useClaimableAuction";
-export { useAssetStats, useCollectionStats } from "./useStats";
-export { useLocalQue } from "./useLocalQue";
diff --git a/ui/lib/marketplace/hooks/useAssets.tsx b/ui/lib/marketplace/hooks/useAssets.tsx
deleted file mode 100644
index 0190e01b6..000000000
--- a/ui/lib/marketplace/hooks/useAssets.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { useEffect, useState } from 'react'
-import { AuctionListing, DirectListing } from '../marketplace-utils'
-
-//Get unique assets for a specific collection
-export function useAssets(
- listings: DirectListing[],
- auctions: AuctionListing[],
- assetContractAddress: string
-) {
- const [assets, setAssets] = useState([])
- useEffect(() => {
- if (listings || auctions) {
- const uniqueAssets: any = []
- const filteredAssets: any = []
- const length: number =
- listings.length > auctions.length ? listings.length : auctions.length
- for (let i = 0; i < length; i++) {
- if (
- listings[i] &&
- listings[i].assetContractAddress === assetContractAddress &&
- !uniqueAssets.includes(listings[i].tokenId)
- ) {
- const tokenId: any = listings[i].tokenId
- uniqueAssets.push(tokenId)
- filteredAssets.push(listings[i])
- }
- if (
- auctions[i] &&
- auctions[i].assetContractAddress === assetContractAddress &&
- !uniqueAssets.includes(auctions[i].tokenId)
- ) {
- const tokenId: any = auctions[i].tokenId
- uniqueAssets.push(tokenId)
- filteredAssets.push(auctions[i])
- }
- }
- setAssets(filteredAssets)
- }
- }, [listings, auctions, assetContractAddress])
- return assets
-}
diff --git a/ui/lib/marketplace/hooks/useAuctionBatch.tsx b/ui/lib/marketplace/hooks/useAuctionBatch.tsx
deleted file mode 100644
index b38501f85..000000000
--- a/ui/lib/marketplace/hooks/useAuctionBatch.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { MarketplaceV3 } from "@thirdweb-dev/sdk";
-import { useState } from "react";
-import { toast } from "react-hot-toast";
-
-export function useAuctionBatch(marketplace: MarketplaceV3) {
- const [auctions, setAuctions] = useState([]);
- const [nfts, setNfts] = useState([]);
- function addAuction({ auction, nft }: any) {
- setNfts((prev) => [...prev, nft]);
- setAuctions((prev) => [...prev, auction]);
- }
-
- function removeAuction(auctionIndex: number) {
- setNfts(nfts.filter((_, i) => i !== auctionIndex));
- setAuctions(auctions.filter((_, i) => i !== auctionIndex));
- }
-
- function clearAll() {
- setNfts([]);
- setAuctions([]);
- }
-
- async function listAll() {
- if (auctions.length <= 1)
- toast.error("You must add at least 2 listings to create a batch listing");
- else {
- try {
- const tx = await marketplace.englishAuctions.createAuctionsBatch(
- auctions
- );
- toast.success("Auctions created successfully");
- return tx;
- } catch (err) {
- toast.error("Error creating auctions");
- }
- }
- }
-
- return {
- data: { auctions, nfts },
- addAuction,
- removeAuction,
- listAll,
- clearAll,
- };
-}
diff --git a/ui/lib/marketplace/hooks/useClaimableAuction.tsx b/ui/lib/marketplace/hooks/useClaimableAuction.tsx
deleted file mode 100644
index 8e3d59431..000000000
--- a/ui/lib/marketplace/hooks/useClaimableAuction.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useMemo } from 'react'
-import { ZERO_ADDRESS } from '../../../const/config'
-
-//Check if closed auction has a payout
-export function useClaimableAuction(
- winningBidObj: any,
- buyoutBidAmount: number,
- endTimestamp: string | number
-) {
- const claimable = useMemo(() => {
- const now = Date.now() / 1000
- if (winningBidObj?.bidderAddress === ZERO_ADDRESS || !winningBidObj)
- return false
- return (
- winningBidObj.bidAmount >= +buyoutBidAmount ||
- (winningBidObj.bidAmount > 0 && +endTimestamp < now)
- )
- }, [winningBidObj, buyoutBidAmount, endTimestamp])
- return claimable
-}
diff --git a/ui/lib/marketplace/hooks/useListingBatch.tsx b/ui/lib/marketplace/hooks/useListingBatch.tsx
deleted file mode 100644
index 92ce404a0..000000000
--- a/ui/lib/marketplace/hooks/useListingBatch.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { MarketplaceV3 } from "@thirdweb-dev/sdk";
-import { useState } from "react";
-import { toast } from "react-hot-toast";
-
-export function useListingBatch(marketplace: MarketplaceV3) {
- const [listings, setListings] = useState([]);
- const [nfts, setNfts] = useState([]);
- function addListing({ listing, nft }: any) {
- setNfts((prev) => [...prev, nft]);
- setListings((prev) => [...prev, listing]);
- }
-
- function removeListing(listingIndex: number) {
- setNfts(nfts.filter((_, i) => i !== listingIndex));
- setListings(listings.filter((_, i) => i !== listingIndex));
- }
-
- function clearAll() {
- setNfts([]);
- setListings([]);
- }
-
- async function listAll() {
- if (listings.length <= 1)
- toast.error("You must add at least 2 listings to create a batch listing");
- else {
- try {
- const tx = await marketplace.directListings.createListingsBatch(
- listings
- );
- toast.success("Listings created successfully");
- return tx;
- } catch (err) {
- toast.error("Error creating listings");
- }
- }
- }
-
- return {
- data: { listings, nfts },
- addListing,
- removeListing,
- listAll,
- clearAll,
- };
-}
diff --git a/ui/lib/marketplace/hooks/useListingsByTokenId.tsx b/ui/lib/marketplace/hooks/useListingsByTokenId.tsx
deleted file mode 100644
index 2931682b7..000000000
--- a/ui/lib/marketplace/hooks/useListingsByTokenId.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { useEffect, useState } from 'react'
-import { AuctionListing, DirectListing } from '../marketplace-utils'
-
-export function useListingsByTokenId(
- validListings: DirectListing[],
- validAuctions: AuctionListing[],
- tokenId: string | number,
- contractAddress: string
-) {
- const [listings, setListings] = useState([])
- const [auctions, setAuctions] = useState([])
-
- useEffect(() => {
- if (validListings && validAuctions && contractAddress) {
- const filteredListings =
- validListings[0] &&
- validListings?.filter(
- (l: DirectListing) =>
- l.assetContractAddress.toLowerCase() ===
- contractAddress.toLowerCase() && +l.tokenId === Number(tokenId)
- )
- const filteredAuctions =
- validAuctions[0] &&
- validAuctions?.filter(
- (a: AuctionListing) =>
- a.assetContractAddress.toLowerCase() ===
- contractAddress.toLowerCase() && +a.tokenId === Number(tokenId)
- )
- setListings(filteredListings || [])
- setAuctions(filteredAuctions || [])
- }
- }, [validListings, validAuctions, contractAddress, tokenId])
-
- return { listings, auctions } as {
- listings: DirectListing[]
- auctions: AuctionListing[]
- }
-}
diff --git a/ui/lib/marketplace/hooks/useListingsByWallet.tsx b/ui/lib/marketplace/hooks/useListingsByWallet.tsx
deleted file mode 100644
index 008be3f70..000000000
--- a/ui/lib/marketplace/hooks/useListingsByWallet.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { useEffect, useState } from 'react'
-import { AuctionListing, DirectListing } from '../marketplace-utils'
-
-//Get listings and auctions for a specific wallet
-export function useListingsByWallet(
- validListings: DirectListing[],
- allAuctions: AuctionListing[],
- walletAddress: string
-) {
- const [listings, setListings] = useState()
- const [auctions, setAuctions] = useState()
- const [loading, setLoading] = useState(false)
-
- useEffect(() => {
- if (walletAddress) {
- setLoading(true)
- const filteredListings =
- (validListings &&
- validListings[0] &&
- validListings?.filter(
- (l: DirectListing) =>
- l.creatorAddress && l.creatorAddress === walletAddress
- )) ||
- []
- const filteredAuctions =
- (allAuctions &&
- allAuctions[0] &&
- allAuctions?.filter(
- (a: AuctionListing) =>
- a.creatorAddress && a.creatorAddress === walletAddress
- )) ||
- []
- setListings(filteredListings)
- setAuctions(filteredAuctions)
- setLoading(false)
- }
- }, [validListings, allAuctions, walletAddress])
-
- return { listings, auctions, isLoading: loading }
-}
diff --git a/ui/lib/marketplace/hooks/useLocalQue.tsx b/ui/lib/marketplace/hooks/useLocalQue.tsx
deleted file mode 100644
index d0f4c94a9..000000000
--- a/ui/lib/marketplace/hooks/useLocalQue.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { useEffect, useState } from 'react'
-import { LocalQue } from '../marketplace-utils'
-
-export function useLocalQue(address: string) {
- const [localQue, setLocalQue] = useState(getLocalQue())
-
- function getLocalQue() {
- if (!address) return
- const storedQue = localStorage.getItem(`multicallQue-${address}`)
- if (storedQue) {
- return JSON.parse(storedQue) as LocalQue
- }
- }
-
- useEffect(() => {
- function storeLocalQue() {
- address &&
- localStorage.setItem(
- `multicallQue-${address}`,
- JSON.stringify(localQue)
- )
- }
-
- if (localQue) storeLocalQue()
- }, [address, localQue])
-
- useEffect(() => {
- if (address) setLocalQue(getLocalQue())
- }, [address, setLocalQue])
-
- return [localQue, setLocalQue]
-}
diff --git a/ui/lib/marketplace/hooks/useSearch.tsx b/ui/lib/marketplace/hooks/useSearch.tsx
deleted file mode 100644
index e787cd843..000000000
--- a/ui/lib/marketplace/hooks/useSearch.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import { useEffect, useState } from 'react'
-import { AuctionListing, DirectListing } from '../marketplace-utils'
-
-//Search for collection or asset by name, return collection or asset url
-export function useSearch(
- text: string,
- validListings: DirectListing[],
- validAuctions: AuctionListing[]
-) {
- const [validAssets, setValidAssets] = useState([])
- const [searchResults, setSearchResults] = useState([])
-
- useEffect(() => {
- function uniqueAssets() {
- if (validListings || validAuctions) {
- const listings = validListings
- const auctions = validAuctions
- const uniqueAssets: any = []
- const filteredAssets: any = []
- const length: number =
- listings.length > auctions.length ? listings.length : auctions.length
- for (let i = 0; i < length; i++) {
- if (
- listings[i] &&
- !uniqueAssets.includes(
- listings[i].assetContractAddress + listings[i].tokenId
- )
- ) {
- const tokenId: any = listings[i].tokenId
- uniqueAssets.push(listings[i].assetContractAddress + tokenId)
- filteredAssets.push(listings[i])
- }
- if (
- auctions[i] &&
- !uniqueAssets.includes(
- auctions[i].assetContractAddress + auctions[i].tokenId
- )
- ) {
- const tokenId: any = auctions[i].tokenId
- uniqueAssets.push(auctions[i].assetContractAddress + tokenId)
- filteredAssets.push(auctions[i])
- }
- }
- setValidAssets(filteredAssets)
- }
- }
-
- uniqueAssets()
- }, [validListings, validAuctions])
-
- useEffect(() => {
- if (!text || text?.trim() === '' || text.length < 2) return
- //update unique assets
-
- const results = validAssets.filter((l: any) =>
- l.asset.name.toLowerCase().includes(text.toLowerCase())
- )
-
- setSearchResults(results)
- }, [text, validAssets])
-
- //limit search to 4 results
- return searchResults.slice(0, 4)
-}
diff --git a/ui/lib/marketplace/hooks/useStats.tsx b/ui/lib/marketplace/hooks/useStats.tsx
deleted file mode 100644
index 89b201019..000000000
--- a/ui/lib/marketplace/hooks/useStats.tsx
+++ /dev/null
@@ -1,162 +0,0 @@
-import { useEffect, useState } from "react";
-import {
- AssetStats,
- AuctionListing,
- CollectionStats,
- DirectListing,
-} from "../marketplace-utils";
-import { useListingsByTokenId } from "./useListingsByTokenId";
-import { getAllDetectedExtensionNames } from "@thirdweb-dev/sdk";
-import { useContract } from "@thirdweb-dev/react";
-import { MOONEY_DECIMALS } from "../../../const/config";
-
-function getFloorPrice(listings: DirectListing[], auctions: AuctionListing[]) {
- //get floor price for validListings
-
- const listingFloor =
- listings && listings[0]
- ? Math.min(...listings.map((listing) => +listing.pricePerToken))
- : 0; //get floor price for validAuctions
- const auctionFloor =
- auctions && auctions[0]
- ? Math.min(...auctions.map((auction) => +auction.buyoutBidAmount))
- : 0;
-
- //true floor price for asset
- if (listingFloor === 0) return auctionFloor;
- if (auctionFloor === 0) return listingFloor;
- return +listingFloor < +auctionFloor ? listingFloor : auctionFloor;
-}
-
-//Get stats for a specific asset
-export function useAssetStats(
- validListings: DirectListing[],
- validAuctions: AuctionListing[],
- contractAddress: string,
- tokenId: string
-) {
- const [stats, setStats] = useState({
- floorPrice: 0,
- listed: 0,
- supply: 0,
- });
-
- const { contract }: any = useContract(contractAddress);
-
- const { listings: assetListings, auctions: assetAuctions } =
- useListingsByTokenId(
- validListings,
- validAuctions,
- tokenId,
- contractAddress
- );
-
- useEffect(() => {
- let floorPrice, supply;
- if (assetListings && assetAuctions && contract) {
- floorPrice = Math.round(
- +getFloorPrice(assetListings, assetAuctions) / MOONEY_DECIMALS
- );
- const extensions = getAllDetectedExtensionNames(contract?.abi);
- (async () => {
- if (extensions[0] !== "ERC1155") {
- supply = await contract.erc721.totalCount();
- } else {
- supply = await contract.erc1155.totalSupply(tokenId);
- }
-
- const listed =
- (assetListings?.reduce(
- (arr: number, l: any) => arr + Number(l.quantity),
- 0
- ) || 0) +
- (assetAuctions?.reduce(
- (arr: number, a: any) => arr + Number(a.quantity),
- 0
- ) || 0);
-
- setStats({
- floorPrice: floorPrice || 0,
- supply: supply?.toNumber() || 0,
- listed,
- });
- })();
- }
- }, [assetListings, assetAuctions, contract, tokenId]);
-
- return stats;
-}
-
-//Get stats for a speicific collection
-export function useCollectionStats(
- validListings: DirectListing[],
- validAuctions: AuctionListing[],
- collectionContract: any
-) {
- const [collectionListings, setCollectionListings] = useState([]);
- const [collectionAuctions, setCollectionAuctions] = useState([]);
-
- const [stats, setStats] = useState({
- floorPrice: 0,
- listed: 0,
- supply: 0,
- });
- //Get nfts for a specific collection
- useEffect(() => {
- if (!collectionContract) return;
- if (validListings) {
- const filteredListings =
- validListings[0] &&
- validListings?.filter(
- (l: DirectListing) =>
- l.assetContractAddress.toLowerCase() ===
- collectionContract.getAddress().toLowerCase()
- );
- setCollectionListings(filteredListings);
- }
- if (validAuctions) {
- const filteredAuctions =
- validAuctions[0] &&
- validAuctions?.filter(
- (a: AuctionListing) =>
- a.assetContractAddress.toLowerCase() ===
- collectionContract.getAddress().toLowerCase()
- );
- setCollectionAuctions(filteredAuctions);
- }
- }, [validListings, validAuctions, collectionContract]);
-
- //Get stats
- useEffect(() => {
- if (collectionContract && (collectionListings || collectionAuctions)) {
- const floorPrice = getFloorPrice(collectionListings, collectionAuctions);
- const listed =
- (collectionListings?.reduce(
- (arr: number, l: any) => arr + Number(l.quantity),
- 0
- ) || 0) +
- (collectionAuctions?.reduce(
- (arr: number, a: any) => arr + Number(a.quantity || 0),
- 0
- ) || 0);
-
- let supply: any;
- (async () => {
- const extensions = getAllDetectedExtensionNames(
- collectionContract?.abi
- );
- if (extensions[0] === "ERC1155") {
- supply = await collectionContract.erc1155.totalCount();
- } else {
- supply = await collectionContract.erc721.totalCount();
- }
- setStats({
- floorPrice: Math.round(+floorPrice / MOONEY_DECIMALS),
- listed,
- supply: supply?.toNumber() || 0,
- });
- })();
- }
- }, [collectionListings, collectionAuctions, collectionContract]);
- return stats;
-}
diff --git a/ui/lib/marketplace/hooks/useUserAssets.tsx b/ui/lib/marketplace/hooks/useUserAssets.tsx
deleted file mode 100644
index 5c7e65869..000000000
--- a/ui/lib/marketplace/hooks/useUserAssets.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-import { Mumbai, Polygon } from '@thirdweb-dev/chains'
-import { useAddress, useNetworkMismatch, useSigner } from '@thirdweb-dev/react'
-import {
- MarketplaceV3,
- ThirdwebSDK,
- getAllDetectedExtensionNames,
-} from '@thirdweb-dev/sdk'
-import { useEffect, useState } from 'react'
-import { AuctionListing, DirectListing } from '../marketplace-utils'
-import { useListingsByWallet } from './useListingsByWallet'
-
-//Get all NFTs from collections accepted by the marketplace by wallet
-export function useUserAssets(
- marketplace: MarketplaceV3 | undefined,
- validListings: DirectListing[],
- validAuctions: AuctionListing[],
- batch: any,
- walletAddress: string
-) {
- const address = useAddress()
- const chain = process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? Polygon : Mumbai
- const [assets, setAssets] = useState()
- const [isLoading, setIsLoading] = useState(true)
- const signer: any = useSigner()
- const networkMismatch = useNetworkMismatch()
-
- const {
- listings: profileListings,
- auctions: profileAuctions,
- isLoading: loadingProfileListings,
- } = useListingsByWallet(validListings, validAuctions, address || '')
-
- useEffect(() => {
- if (
- marketplace &&
- signer &&
- !networkMismatch &&
- profileAuctions &&
- profileListings &&
- !loadingProfileListings
- ) {
- setIsLoading(true)
- marketplace.roles.get('asset').then(async (res: any) => {
- await res.forEach(async (collection: any) => {
- if (networkMismatch) return
- try {
- const sdk: ThirdwebSDK = ThirdwebSDK.fromSigner(signer, chain)
- const contract: any = await sdk.getContract(collection)
- const extensions = getAllDetectedExtensionNames(contract.abi)
- let ownedAssets: any
- if (extensions[0] === 'ERC1155') {
- ownedAssets = await contract.erc1155.getOwned(signer._address)
- //Create a new array of ownedAssets with quantityOwned updated to reflect the number of assets not listed on the marketplace
- if (profileListings?.[0] || profileAuctions?.[0]) {
- ownedAssets = await ownedAssets.map((asset: any) => {
- const ownedQuantity = asset.quantityOwned
- //only count direct listings, auction listings are automatically subtracted from asset.quantityOwned
- const listedQuantity =
- profileListings?.reduce(
- (arr: number, listing: any) =>
- listing.assetContractAddress.toLowerCase() ===
- collection.toLowerCase() &&
- listing.tokenId === asset.metadata.id
- ? arr + Number(listing?.quantity)
- : arr,
- 0
- ) || 0
-
- const batchListedQuantity =
- batch?.reduce(
- (arr: number, listing: any) =>
- listing.assetContractAddress.toLowerCase() ===
- collection.toLowerCase() &&
- listing.tokenId === asset.metadata.id
- ? arr + Number(listing?.quantity)
- : arr,
- 0
- ) || 0 + listedQuantity
-
- return {
- ...asset,
- quantityOwned: ownedQuantity - batchListedQuantity,
- }
- })
- }
- } else {
- ownedAssets = await contract.erc721.getOwned(signer._address)
-
- if (profileListings?.[0] || profileAuctions?.[0]) {
- ownedAssets = ownedAssets
- .filter(
- (asset: any) =>
- !profileListings?.find(
- (listing: any) =>
- listing.assetContractAddress === collection &&
- listing.tokenId === asset.metadata.id
- ) &&
- !profileAuctions?.find(
- (auction: any) =>
- auction.assetContractAddress === collection &&
- auction.tokenId === asset.metadata.id
- )
- )
- .map((asset: any) => ({ ...asset, quantityOwned: '1' }))
-
- //check for batch listing
- if (batch?.[0]) {
- ownedAssets = ownedAssets.filter(
- (asset: any) =>
- !batch?.find(
- (listing: any) =>
- listing.assetContractAddress === collection &&
- listing.tokenId === asset.metadata.id
- )
- )
- }
- } else {
- ownedAssets = ownedAssets.map((asset: any) => ({
- ...asset,
- quantityOwned: '1',
- }))
- }
- }
- const collectionName = await contract.call('name')
-
- //add collection data to ownedAssets
- ownedAssets = await ownedAssets.map((asset: any) => ({
- ...asset,
- collection,
- collectionName,
- }))
-
- //add ownedAssets to assets array and filter out any duplicates (on address change duplicates are created and then filtered out, this is a quick fix)
- ownedAssets.length > 0 &&
- setAssets((prev: any) =>
- prev
- ? [
- ...prev.filter((a: any) => a.collection !== collection),
- ...ownedAssets,
- ]
- : ownedAssets
- )
- } catch (err: any) {
- console.log(err.message)
- }
- setIsLoading(false)
- })
- })
- }
- }, [batch, signer, profileListings, profileAuctions, walletAddress])
-
- useEffect(() => {
- if (signer && walletAddress) {
- if (signer._address !== walletAddress) {
- setAssets(undefined)
- }
- }
- }, [signer, walletAddress])
- return { assets, isLoading }
-}
diff --git a/ui/lib/marketplace/hooks/useUserWinnings.tsx b/ui/lib/marketplace/hooks/useUserWinnings.tsx
deleted file mode 100644
index f898f37d0..000000000
--- a/ui/lib/marketplace/hooks/useUserWinnings.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { MarketplaceV3 } from '@thirdweb-dev/sdk'
-import { useEffect, useState } from 'react'
-import { AuctionListing } from '../marketplace-utils'
-
-//Filter auctions won by the profile address (only applies to winning bids on auctions, buying out an auction does not require the user to claim the token manually)
-
-export function useUserWinnings(
- marketplace: MarketplaceV3,
- allAuctions: any,
- walletAddress: string
-) {
- const [assetsWon, setAssetsWon] = useState([])
-
- useEffect(() => {
- if (marketplace && walletAddress && allAuctions && allAuctions[0]) {
- ;(async () => {
- setAssetsWon([])
- await allAuctions.map(async (a: AuctionListing) => {
- if (a.status !== 5) return
- let winningBid: any
- let closed: any
- try {
- winningBid = await marketplace.englishAuctions.getWinningBid(
- a.auctionId
- )
- closed = await marketplace.englishAuctions.events.getEvents(
- 'AuctionClosed',
- {
- filters: {
- auctionId: a.auctionId,
- },
- }
- )
- } catch (err) {
- console.log(err)
- }
- if (winningBid?.bidderAddress === walletAddress && !closed[0])
- setAssetsWon((prev: any) => [
- ...prev.filter((prevA: any) => prevA.auctionId !== a.auctionId),
- a,
- ])
- })
- })()
- }
- }, [allAuctions, marketplace, walletAddress])
-
- return assetsWon
-}
diff --git a/ui/lib/marketplace/marketplace-listings.ts b/ui/lib/marketplace/marketplace-listings.ts
deleted file mode 100644
index 86f1522a4..000000000
--- a/ui/lib/marketplace/marketplace-listings.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { MarketplaceV3 } from "@thirdweb-dev/sdk";
-import { serialize } from "./marketplace-utils";
-
-//Get all auctions including expired & closed auctions from marketplace
-export async function getAllAuctions(marketplace: MarketplaceV3) {
- try {
- const auctions = await marketplace.englishAuctions.getAll();
- const serialized = serialize(auctions);
- return serialized;
- } catch (err) {
- console.log(err);
- return [];
- }
-}
-
-//Get all valid listings from marketplace
-export async function getAllValidListings(marketplace: MarketplaceV3) {
- try {
- const listings = await marketplace.directListings.getAllValid();
- const serialized = serialize(listings);
- return serialized;
- } catch (err) {
- console.log(err);
- return [];
- }
-}
-
-//Get all valid auctions from marketplace
-export async function getAllValidAuctions(marketplace: MarketplaceV3) {
- try {
- const auctions = await marketplace.englishAuctions.getAllValid();
- const serialized = serialize(auctions);
- return serialized;
- } catch (err) {
- console.log(err);
- return [];
- }
-}
diff --git a/ui/lib/marketplace/marketplace-subgraph.ts b/ui/lib/marketplace/marketplace-subgraph.ts
deleted file mode 100644
index aa83c252a..000000000
--- a/ui/lib/marketplace/marketplace-subgraph.ts
+++ /dev/null
@@ -1,170 +0,0 @@
-////Advanced filtering for auctions and listings using the MarketplaceV3 subgraph. The subgraph provides historical data for all events emiited by the marketplace contract.
-import { useEffect, useMemo, useState } from 'react'
-import { cacheExchange, createClient, fetchExchange } from 'urql'
-import { AuctionListing, DirectListing } from './marketplace-utils'
-
-///INIT GRAPH CLIENT//////////////////////////////////
-///////////////////////////////////////////////////////
-
-const graphClient: any = createClient({
- url:
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet'
- ? 'https://api.studio.thegraph.com/query/38443/moondao-marketplace-l2/v0.0.1'
- : 'https://api.studio.thegraph.com/query/38443/moondao-marketplace-test-l2/v0.0.2',
- exchanges: [fetchExchange, cacheExchange],
-})
-
-async function graphQuery(query: string) {
- const data = await graphClient.query(query).toPromise()
- return data
-}
-
-//FILTERS//////////////////////////////////////////////
-///////////////////////////////////////////////////////
-
-// ListingIds and AuctionIds that are trending (have the most bids/sales)
-// determined by newest 250 bids/sales (increase size as needed up to 1000)
-export async function queryTrending(
- validListings: DirectListing[],
- validAuctions: AuctionListing[]
-) {
- const query = `
- query {
- newSales(first: 250, orderBy: blockTimestamp, orderDirection: desc) {
- listingId
- assetContract
- tokenId
- }
- newBids(first: 250, orderBy: blockTimestamp, orderDirection: desc) {
- auctionId
- assetContract
- auction_tokenId
- }
- }
- `
- try {
- const {
- data: { newSales, newBids },
- } = await graphQuery(query)
- //Find assets with the most bids/sales
- const trendingCount: any = {}
-
- newSales.forEach((sale: any) => {
- const key = sale.assetContract.toLowerCase() + '/' + sale.tokenId
- if (trendingCount[key]) {
- trendingCount[key] += 1
- } else {
- trendingCount[key] = 1
- }
- })
- newBids.forEach((bid: any) => {
- const key = bid.assetContract.toLowerCase() + '/' + bid.auction_tokenId
- if (trendingCount[key]) {
- trendingCount[key] += 1
- } else {
- trendingCount[key] = 1
- }
- })
-
- let allListings = !validListings[0]
- ? validAuctions
- : !validAuctions[0]
- ? validListings
- : [...validListings, ...validAuctions]
-
- const trendingListings: any = {}
-
- allListings.forEach((listing: any) => {
- const trendingCountKey: string =
- listing.assetContractAddress.toLowerCase() + '/' + listing.tokenId
- if (!trendingListings[trendingCountKey]) {
- trendingListings[trendingCountKey] = {
- ...listing,
- popularity: trendingCount[trendingCountKey] || 0,
- }
- }
- })
-
- return Object.values(trendingListings).sort(
- (a: any, b: any) => b.popularity - a.popularity
- )
- } catch (err) {
- console.log(err)
- return []
- }
-}
-
-function filterExpiring(
- validListings: DirectListing[],
- validAuctions: AuctionListing[]
-) {
- let allListings = !validListings[0]
- ? validAuctions
- : !validAuctions[0]
- ? validListings
- : [...validListings, ...validAuctions]
- return allListings.sort((a: any, b: any) => a.endTimestamp - b.endTimestamp)
-}
-
-//////HOOKS////////////////////////////////////////////
-///////////////////////////////////////////////////////
-
-export function useFilter(
- type: string,
- validListings: DirectListing[],
- validAuctions: AuctionListing[]
-) {
- const [filteredAssets, setFilteredAssets] = useState([])
-
- const collections = useMemo(() => {
- const uniqueCollectionAddresses: any = []
- return filteredAssets[0]
- ? filteredAssets?.filter(
- (l: DirectListing | AuctionListing) =>
- l &&
- !uniqueCollectionAddresses.includes(l.assetContractAddress) &&
- uniqueCollectionAddresses.push(l.assetContractAddress)
- )
- : []
- }, [filteredAssets])
-
- const assets = useMemo(() => {
- const uniqueAssets: any = []
- return filteredAssets[0]
- ? filteredAssets?.filter(
- (l: DirectListing | AuctionListing) =>
- l &&
- !uniqueAssets.includes(l.assetContractAddress + l.tokenId) &&
- uniqueAssets.push(l.assetContractAddress + l.tokenId)
- )
- : []
- }, [filteredAssets])
-
- useEffect(() => {
- if (type === 'all') {
- setFilteredAssets(
- validAuctions[0] && validListings[0]
- ? [...validListings, ...validAuctions]
- : validAuctions[0]
- ? validAuctions
- : validListings
- )
- }
- if (type === 'trending') {
- queryTrending(validListings, validAuctions).then(
- (filteredListings: any) => {
- setFilteredAssets(filteredListings)
- }
- )
- } else if (type === 'expiring' || type === 'new') {
- const filteredListings = filterExpiring(validListings, validAuctions)
- setFilteredAssets(
- type === 'new'
- ? filteredListings.sort((a: any, b: any) => b - a)
- : filteredListings
- )
- }
- }, [validListings, validAuctions, type])
-
- return { collections, assets }
-}
diff --git a/ui/lib/marketplace/marketplace-utils.ts b/ui/lib/marketplace/marketplace-utils.ts
deleted file mode 100644
index 1baa18bfb..000000000
--- a/ui/lib/marketplace/marketplace-utils.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import { DirectListingV3, EnglishAuction } from '@thirdweb-dev/sdk'
-import { BigNumber } from 'ethers'
-import { MOONEY_ADDRESSES } from '../../const/config'
-
-export type DirectListing = {
- asset: {
- name: string
- description: string
- image: string
- id: string
- uri: string
- }
- listingId: string | number
- creatorAddress: string
- assetContractAddress: string
- tokenId: string
- quantity: string
- currencyContractAddress: string
- pricePerToken: string | number
- startTimestamp: string | number
- endTimestamp: string | number
- reserved: boolean
- status: string | number
- popularity: any
-}
-
-export type AuctionListing = {
- asset: {
- name: string
- description: string
- image: string
- id: string
- uri: string
- }
- auctionId: string | number
- creatorAddress: string
- assetContractAddress: string
- tokenId: string
- quantity: string
- currencyContractAddress: string
- minimumBidAmount: string | number
- buyoutBidAmount: string | number
- timeBufferInSeconds: string | number
- bidBufferBps: string | number
- startTimestamp: string | number
- endTimestamp: string | number
- status: string | number
- popularity: any
-}
-
-export type CurrListing = {
- type: string
- listing: any
-}
-
-export type DirectSubmission = {
- assetContractAddress: string
- tokenId: string
- quantity: string
- currencyContractAddress: string
- pricePerToken: string
- startTimestamp: string
- endTimestamp: string
- isReservedListing: boolean
-}
-
-export type AuctionSubmission = {
- assetContractAddress: string
- tokenId: string
- quantity: string
- currencyContractAddress: string
- minimumBidAmount: string
- buyoutBidAmount: string
- timeBufferInSeconds: string
- bidBufferBps: string
- startTimestamp: string
- endTimestamp: string
-}
-
-export type LocalQue = {
- queuedListings: DirectSubmission[]
- queuedAuctions: AuctionSubmission[]
-}
-
-export type AssetStats = {
- floorPrice: string | number | undefined
- supply: string | number | undefined
- listed: string | number | undefined
-}
-
-export type CollectionStats = {
- floorPrice: string | number
- listed: string | number
- supply: string | number
-}
-
-export function BigConvert(data: any) {
- return !data ? 0 : BigNumber.from(data).toString()
-}
-
-export function serialize(data: any) {
- //data = array of listings = [[{listingData1}], [{listingData2}]]
- let formatted
- if (data[0]?.minimumBidAmount) {
- formatted = data.map(
- (auction: EnglishAuction) =>
- isL2MOONEY(auction.currencyContractAddress) &&
- ({
- asset: auction.asset,
- auctionId: auction.id,
- creatorAddress: auction.creatorAddress,
- assetContractAddress: auction.assetContractAddress,
- tokenId: auction.tokenId,
- quantity: auction.quantity,
- currencyContractAddress: auction.currencyContractAddress,
- minimumBidAmount: auction.minimumBidAmount,
- buyoutBidAmount: auction?.buyoutBidAmount,
- timeBufferInSeconds: auction.timeBufferInSeconds,
- bidBufferBps: auction.bidBufferBps,
- startTimestamp: auction.startTimeInSeconds,
- endTimestamp: auction.endTimeInSeconds,
- status: auction.status,
- } as AuctionListing)
- )
- } else {
- formatted = data.map(
- (listing: DirectListingV3) =>
- isL2MOONEY(listing.currencyContractAddress) &&
- ({
- asset: listing.asset,
- listingId: listing.id,
- creatorAddress: listing.creatorAddress,
- assetContractAddress: listing.assetContractAddress,
- tokenId: listing.tokenId,
- quantity: listing.quantity,
- currencyContractAddress: listing.currencyContractAddress,
- pricePerToken: listing.pricePerToken,
- startTimestamp: listing.startTimeInSeconds,
- endTimestamp: listing.endTimeInSeconds,
- reserved: listing.isReservedListing,
- status: listing.status,
- } as DirectListing)
- )
- }
-
- //Filter out any listings or auctions that are not in MOONEY
- const L2_MOONEYListings = formatted.filter(
- (listing: any) =>
- listing?.currencyContractAddress &&
- isL2MOONEY(listing.currencyContractAddress)
- )
-
- return JSON.parse(JSON.stringify(L2_MOONEYListings))
-}
-
-function isL2MOONEY(currencyAddress: string) {
- const mooneyAddress =
- process.env.NEXT_PUBLIC_CHAIN === 'mainnet'
- ? MOONEY_ADDRESSES['polygon']
- : MOONEY_ADDRESSES['mumbai']
-
- return currencyAddress.toLowerCase() === mooneyAddress.toLowerCase()
-}
-
-//////HOOKS////////////////////////////////////////////
-////////////////////////////////////////////////////////
diff --git a/ui/lib/marketplace/marketplace-utils/formatTimeRemaining.ts b/ui/lib/marketplace/marketplace-utils/formatTimeRemaining.ts
deleted file mode 100644
index fb44676ad..000000000
--- a/ui/lib/marketplace/marketplace-utils/formatTimeRemaining.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { BigNumber, BigNumberish } from "ethers";
-
-export default function formatTimeRemaining(
- unixTimestamp: BigNumberish
-): string {
- // Get the current time in seconds
- const now = Math.floor(Date.now() / 1000);
-
- // Calculate the time difference between now and the input timestamp
- const timeDifference = BigNumber.from(unixTimestamp).sub(now).toNumber();
-
- // Convert the time difference to seconds, minutes, hours, or days
- if (timeDifference < 60) {
- return `${timeDifference} seconds`;
- } else if (timeDifference < 3600) {
- return `${Math.floor(timeDifference / 60)} minutes`;
- } else if (timeDifference < 86400) {
- return `${Math.floor(timeDifference / 3600)} hours`;
- } else {
- return `${Math.floor(timeDifference / 86400)} days`;
- }
-}
diff --git a/ui/lib/marketplace/marketplace-utils/hooks/index.ts b/ui/lib/marketplace/marketplace-utils/hooks/index.ts
deleted file mode 100644
index f20123a38..000000000
--- a/ui/lib/marketplace/marketplace-utils/hooks/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { useClickOutside } from './useClickOutside'
-export { useCurrBlockNum } from './useCurrBlockNum'
diff --git a/ui/lib/marketplace/marketplace-utils/hooks/useClickOutside.tsx b/ui/lib/marketplace/marketplace-utils/hooks/useClickOutside.tsx
deleted file mode 100644
index 96a0b6775..000000000
--- a/ui/lib/marketplace/marketplace-utils/hooks/useClickOutside.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { useEffect } from 'react'
-
-export function useClickOutside(
- ref: any,
- enabled: boolean,
- setEnabled: Function
-) {
- useEffect(() => {
- function handleClickOutside(e: Event) {
- ref.current && !ref.current.contains(e.target) && setEnabled(false)
- document.removeEventListener('click', handleClickOutside)
- }
-
- if (enabled) {
- setTimeout(
- () => document.addEventListener('click', handleClickOutside),
- 500
- )
- }
- }, [enabled, ref, setEnabled])
-
- return enabled
-}
diff --git a/ui/lib/marketplace/marketplace-utils/hooks/useCurrBlockNum.tsx b/ui/lib/marketplace/marketplace-utils/hooks/useCurrBlockNum.tsx
deleted file mode 100644
index cbc2e1af1..000000000
--- a/ui/lib/marketplace/marketplace-utils/hooks/useCurrBlockNum.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Mumbai, Polygon } from '@thirdweb-dev/chains'
-import { useEffect, useState } from 'react'
-import { initSDK } from '../../../thirdweb/thirdweb'
-
-export function useCurrBlockNum() {
- const [currBlockNum, setCurrBlockNum] = useState(
- undefined
- )
- const chain = process.env.NEXT_PUBLIC_CHAIN === 'mainnet' ? Polygon : Mumbai
- const sdk = initSDK(chain)
- useEffect(() => {
- sdk &&
- sdk
- .getProvider()
- .getBlockNumber()
- .then((blockNumber: number) => {
- setCurrBlockNum(blockNumber)
- })
- }, [sdk])
- return currBlockNum
-}
diff --git a/ui/lib/marketplace/marketplace-utils/hooks/useLocalStorage.tsx b/ui/lib/marketplace/marketplace-utils/hooks/useLocalStorage.tsx
deleted file mode 100644
index cfd1c4576..000000000
--- a/ui/lib/marketplace/marketplace-utils/hooks/useLocalStorage.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-//WIP, will use to store local batches
-import { useEffect, useState } from 'react'
-
-export function useLocalStorage(key: string) {
- const [localData, setLocalData] = useState()
-
- function storeLocalData(data: any) {
- const localData = JSON.stringify(data)
- localStorage.setItem(key, localData)
- }
-
- useEffect(() => {
- function getLocalData() {
- const localData = localStorage.getItem(key)
- if (localData) {
- setLocalData(JSON.parse(localData))
- }
- }
-
- if (key?.trim() !== '') getLocalData()
- }, [key])
-
- return { data: localData, store: storeLocalData }
-}
diff --git a/ui/lib/marketplace/marketplace-utils/randomColor.ts b/ui/lib/marketplace/marketplace-utils/randomColor.ts
deleted file mode 100644
index cd6760be2..000000000
--- a/ui/lib/marketplace/marketplace-utils/randomColor.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export default function randomColor() {
- let letters = "0123456789ABCDEF";
- let color = "#";
- for (let i = 0; i < 6; i++) {
- color += letters[Math.floor(Math.random() * 16)];
- }
- return color;
-}