diff --git a/.github/diagram.svg b/.github/diagram.svg index aafcf6fcdd..0abc40ee7a 100644 --- a/.github/diagram.svg +++ b/.github/diagram.svg @@ -1 +1 @@ -utilsutilsteststestsstoresstoresservicesservicesqueriesqueriespagespageslibslibscomposablescomposablescomponentscomponentspublicpublicconfigconfige2ee2esubsquidsubsquid[prefix][prefix]uiuistaticstatictransactiontransactionmassmintmassmintdropdroptransfertransfersharedsharedsearchsearchrmrkrmrkprofileprofilemigratemigratemassmintmassmintlandinglandingitemsitemsidentityidentitygallerygalleryexploreexploredropsdropscreatecreatecommoncommoncollectioncollectioncodeCheckercodeCheckercarouselcarouselbsxbsxblogbloggeneralgeneralsrcsrcfiltersfiltersGalleryGallerycreatecreatestepsstepslandinglandingItemsGridItemsGridlistingCartlistingCartunlockableunlockabledropdropactivityactivitycomponentscomponentsmodulesmoduleseventseventsMediaItemMediaItem.ahk.csv.filters.graphql.html.js.mjs.scss.tab.ts.txt.ui.vue.xml.yamleach dot sized by file size \ No newline at end of file +utilsutilsteststestsstoresstoresservicesservicesqueriesqueriespagespageslibslibscomposablescomposablescomponentscomponentspublicpublicapiapie2ee2esubsquidsubsquid[prefix][prefix]uiuistaticstatictransactiontransactionmassmintmassmintdropdropsharedsharedsearchsearchrmrkrmrkprofileprofilemigratemigratemassmintmassmintlandinglandingitemsitemsidentityidentitygallerygallerydropsdropscreatecreatecommoncommoncollectioncollectioncodeCheckercodeCheckercarouselcarouselbsxbsxblogbloggeneralgeneralsrcsrcfiltersfiltersGalleryGallerycreatecreatestepsstepslandinglandingItemsGridItemsGridlistingCartlistingCartunlockableunlockabledropdropactivityactivitycomponentscomponentseventseventsMediaItemMediaItem.ahk.csv.filters.graphql.html.js.mjs.scss.tab.ts.txt.ui.vue.xml.yamleach dot sized by file size \ No newline at end of file diff --git a/components/Navbar.vue b/components/Navbar.vue index dba9cf05e8..2d7ca39e0f 100644 --- a/components/Navbar.vue +++ b/components/Navbar.vue @@ -290,7 +290,7 @@ const logoSrc = computed(() => { const dropsPath = computed(() => { const prefix = pickByVm({ SUB: 'ahp', - EVM: 'base', + EVM: urlPrefix.value, }) return `/${prefix}/drops` }) diff --git a/components/carousel/CarouselTypeDrops.vue b/components/carousel/CarouselTypeDrops.vue index ffc31f18cd..1d9282b23a 100644 --- a/components/carousel/CarouselTypeDrops.vue +++ b/components/carousel/CarouselTypeDrops.vue @@ -29,9 +29,10 @@ import type { Drop } from '@/components/drops/useDrops' import { useDrops } from '@/components/drops/useDrops' import { openReconnectWalletModal } from '@/components/common/ConnectWallet/openReconnectWalletModal' +import { vmOf } from '@/utils/config/chain.config' let queries = { - limit: 12, + limit: 14, active: [true], chain: ['ahp', 'base'], } @@ -48,7 +49,7 @@ if (!isProduction && urlPrefix.value === 'ahk') { const container = ref() const { accountId } = useAuth() -const { vmOf } = useChain() + const router = useRouter() const { cols, isReady: isDynamicGridReady } = useDynamicGrid({ container, @@ -63,7 +64,7 @@ const skeletonCount = computed(() => Number.isInteger(perView.value) ? perView.value : Math.ceil(perView.value), ) -const { drops, loaded: isReady } = useDrops(queries) +const { drops, loaded: isReady } = useDrops(queries, { filterOutMinted: true }) const dropsAlias = computed(() => drops.value.map(drop => drop.alias)) const onDropClick = ({ path, drop }: { path: string, drop: Drop }) => { diff --git a/components/codeChecker/CodeChecker.vue b/components/codeChecker/CodeChecker.vue index 3be28c4cb6..40d205d5fe 100644 --- a/components/codeChecker/CodeChecker.vue +++ b/components/codeChecker/CodeChecker.vue @@ -234,11 +234,11 @@ import type { AssetMessage, Validity } from './types' const RESOURCES_LIST = [ { title: 'codeChecker.kodahashTemplate', - url: 'https://hello.kodadot.xyz/tutorial/generative-art', + url: 'https://github.com/vikiival/kodahash', }, { title: 'codeChecker.learnAboutGenArt', - url: 'https://github.com/vikiival/kodahash', + url: 'https://hello.kodadot.xyz/tutorial/generative-art', }, { title: 'codeChecker.codeChecker', diff --git a/components/collection/drop/modal/PaidMint.vue b/components/collection/drop/modal/PaidMint.vue index 3ed3983495..f86785cc52 100644 --- a/components/collection/drop/modal/PaidMint.vue +++ b/components/collection/drop/modal/PaidMint.vue @@ -7,8 +7,6 @@ :title="title" :scrollable="false" :loading="loading" - :custom-skeleton-title="preStepTitle" - :estimated-time="estimedTime" @close="close" > amountToMint.value === 1 && !canMint.value, ) -const estimedTime = computed(() => - isSingleMintNotReady.value ? IPFS_ESTIMATED_TIME_SECONDS : undefined, -) - const mintButton = computed(() => { if (!canMint.value) { return { @@ -117,10 +109,6 @@ const loading = computed( || false, ) -const preStepTitle = computed(() => - isSingleMintNotReady.value ? $i18n.t('drops.mintDropError') : undefined, -) - const isMintOverviewStep = computed( () => modalStep.value === ModalStep.OVERVIEW, ) diff --git a/components/collection/drop/modal/shared/SuccessfulDrop.vue b/components/collection/drop/modal/shared/SuccessfulDrop.vue index a984ee0221..8dce884026 100644 --- a/components/collection/drop/modal/shared/SuccessfulDrop.vue +++ b/components/collection/drop/modal/shared/SuccessfulDrop.vue @@ -34,6 +34,7 @@ const { toast } = useToast() const { urlPrefix } = usePrefix() const { accountId } = useAuth() const { getCollectionFrameUrl } = useSocialShare() +const { toMintNFTs } = storeToRefs(useDropStore()) const cantList = computed(() => !props.canListNfts) const txHash = computed(() => props.mintingSession.txHash ?? '') @@ -42,30 +43,48 @@ const mintedNft = computed( () => props.mintingSession.items[0], ) -const items = computed(() => - props.mintingSession.items.map(item => ({ - id: item.id, - name: item.name, - image: item.image, - collection: item.collection.id, - collectionName: item.collection.name, - mimeType: item.mimeType, - })), -) +const itemMedias = props.mintingSession.items.map(item => ({ + id: item.id, + name: item.name, + image: item.image, + collection: item.collection.id, + collectionName: item.collection.name, + mimeType: item.mimeType, + metadata: item.metadata, +})) +const items = ref(itemMedias) + +// update serial number in nft.name asynchronously +onMounted(async () => { + const metadatas = await Promise.all( + items.value.map(item => $fetch<{ name?: string }>(item.metadata)), + ) + + items.value.forEach((_, index) => { + const metadata = metadatas[index] + if (metadata.name) { + items.value[index].name = metadata.name + toMintNFTs.value[index].name = metadata.name + } + }) +}) const nftPath = computed( - () => `/${mintedNft.value?.chain}/gallery/${mintedNft.value?.id}`, + () => + `/${mintedNft.value?.chain}/gallery/${mintedNft.value?.collection.id}-${mintedNft.value?.id}`, ) const nftFullUrl = computed(() => `${window.location.origin}${nftPath.value}`) const userProfilePath = computed( () => `/${urlPrefix.value}/u/${accountId.value}`, ) +const getItemSn = (name: string) => `#${name.split('#')[1]}` + const sharingTxt = computed(() => singleMint.value - ? $i18n.t('sharing.dropNft', [`#${mintedNft.value?.index}`]) + ? $i18n.t('sharing.dropNft', [getItemSn(items.value[0].name)]) : $i18n.t('sharing.dropNfts', [ - props.mintingSession.items.map(item => `#${item.index}`).join(', '), + items.value.map(item => getItemSn(item.name)).join(', '), ]), ) diff --git a/components/collection/drop/types.ts b/components/collection/drop/types.ts index 53818cb525..242bf3d8c9 100644 --- a/components/collection/drop/types.ts +++ b/components/collection/drop/types.ts @@ -33,8 +33,8 @@ export type MintedNFT = { chain: string name: string image: string - index: number - collection: { id: string, name: string, max: number } + collection: { id: string, name: string, max?: number } + metadata: string mimeType?: string } diff --git a/components/common/successfulModal/SuccessfulItemsMedia.vue b/components/common/successfulModal/SuccessfulItemsMedia.vue index 25e229f694..fd7deb92b1 100644 --- a/components/common/successfulModal/SuccessfulItemsMedia.vue +++ b/components/common/successfulModal/SuccessfulItemsMedia.vue @@ -27,6 +27,7 @@ export type ItemMedia = { collectionName: string price?: string mimeType?: string + metadata: string } const props = defineProps<{ diff --git a/components/create/CreateCollection.vue b/components/create/CreateCollection.vue index 0ac05113c2..cf3ae73b35 100644 --- a/components/create/CreateCollection.vue +++ b/components/create/CreateCollection.vue @@ -277,8 +277,10 @@ const royalty = ref({ }) const menus = availablePrefixes().filter( - menu => menu.value !== 'ksm' && menu.value !== 'rmrk', -) + (menu) => { + const { isRemark, isEvm } = useIsChain(computed(() => menu.value as Prefix)) + return !isRemark.value && !isEvm.value + }) const chainByPrefix = menus.find(menu => menu.value === urlPrefix.value) const selectBlockchain = ref(chainByPrefix?.value || menus[0].value) diff --git a/components/create/CreateNft.vue b/components/create/CreateNft.vue index e206d6522f..8604e94b78 100644 --- a/components/create/CreateNft.vue +++ b/components/create/CreateNft.vue @@ -393,8 +393,11 @@ const imagePreview = computed(() => { // select available blockchain const menus = availablePrefixes().filter( - menu => menu.value !== 'ksm' && menu.value !== 'rmrk', -) + (menu) => { + const { isRemark, isEvm } = useIsChain(computed(() => menu.value as Prefix)) + return !isRemark.value && !isEvm.value + }) + const chainByPrefix = computed(() => menus.find(menu => menu.value === urlPrefix.value), ) diff --git a/components/drops/Drops.vue b/components/drops/Drops.vue index 1f55a9e598..46fd1145a8 100644 --- a/components/drops/Drops.vue +++ b/components/drops/Drops.vue @@ -36,7 +36,7 @@ :drops="currentDrops" :loaded="loaded" :default-skeleton-count="DEFAULT_SKELETON_COUNT" - :async-skeleton-count="Math.round((count/2) - currentDrops.length)" + :async-skeleton-count="asyncSkeletonCountOf(currentDrops.length)" skeleton-key="current-drops-skeleton" /> @@ -56,7 +56,7 @@ :drops="pastDrops" :loaded="loaded" :default-skeleton-count="DEFAULT_SKELETON_COUNT" - :async-skeleton-count="Math.round((count/2) - pastDrops.length)" + :async-skeleton-count="asyncSkeletonCountOf(pastDrops.length)" skeleton-key="skeleton" /> @@ -96,6 +96,8 @@ const pastDrops = computed(() => filter(drops.value, { status: DropStatus.MINTING_ENDED }), ) +const asyncSkeletonCountOf = (amount: number) => count.value ? Math.max(0, Math.round((count.value) / 2) - amount) : DEFAULT_SKELETON_COUNT + const checkRouteAvailability = () => { if (!dropsVisible(urlPrefix.value)) { navigateTo('/') diff --git a/components/drops/DropsGrid.vue b/components/drops/DropsGrid.vue index 9f3fbd2f72..e6fbdd4549 100644 --- a/components/drops/DropsGrid.vue +++ b/components/drops/DropsGrid.vue @@ -5,7 +5,7 @@ persist >