@visualizevalue/mint-app-base 0.1.66 → 0.1.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -25,5 +25,5 @@ NUXT_PUBLIC_RPC3=
25
25
  # =========================
26
26
  # ONCHAIN
27
27
  # =========================
28
- NUXT_PUBLIC_FACTORY_ADDRESS=0xdc27b70874E36f00290Bd588D5B31AD510ca88a5
28
+ NUXT_PUBLIC_FACTORY_ADDRESS=0x750C5a6CFD40C9CaA48C31D87AC2a26101Acd517
29
29
  NUXT_PUBLIC_CHAIN_ID=11155111
@@ -6,7 +6,7 @@
6
6
 
7
7
  <Loading v-if="loading" />
8
8
  <div v-if="! tokens.length && !loading" >
9
- <p>{{ $('collection.no_tokens')}}</p>
9
+ <p>{{ $t('collection.no_tokens')}}</p>
10
10
  </div>
11
11
  </slot>
12
12
  </template>
@@ -38,7 +38,9 @@ const isMe = useIsMeCheck(id)
38
38
  const { loading } = useLoadArtistData(id)
39
39
  const collections = computed(() => isMe.value
40
40
  ? store.forArtist(id.value)
41
- : store.forArtistOnlyMinted(id.value)
41
+ // TODO: Swap again
42
+ // : store.forArtistOnlyMinted(id.value)
43
+ : store.forArtist(id.value)
42
44
  )
43
45
 
44
46
  // Force update collections with no mints
@@ -9,6 +9,7 @@
9
9
  currentBlock,
10
10
  blocksRemaining,
11
11
  secondsRemaining,
12
+ countDownStr,
12
13
  until,
13
14
  transactionFlowConfig: {
14
15
  title: {
@@ -54,9 +55,11 @@ const priceFeed = usePriceFeedStore()
54
55
 
55
56
  const { data: currentBlock } = useBlockNumber({ chainId: config.public.chainId })
56
57
  const blocksRemaining = computed(() => props.token.mintedBlock + 7200n - (currentBlock.value || 0n))
57
- const mintOpen = computed(() => currentBlock.value && blocksRemaining.value > 0n)
58
- const secondsRemaining = computed(() => props.token.closeAt - BigInt(nowInSeconds()))
58
+ const now = useNow()
59
59
  const until = computed(() => props.token.closeAt)
60
+ const secondsRemaining = computed(() => until.value - BigInt(now.value))
61
+ const mintOpen = computed(() => secondsRemaining.value > 0)
62
+ const { str: countDownStr } = useCountDown(secondsRemaining)
60
63
 
61
64
  const mintCount = computed(() => props.mintCount)
62
65
  const { price, displayPrice } = useMintPrice(mintCount)
@@ -24,7 +24,7 @@
24
24
  minted,
25
25
  mintOpen,
26
26
  currentBlock,
27
- blocksRemaining,
27
+ countDownStr,
28
28
  transactionFlowConfig
29
29
  }"
30
30
  >
@@ -54,13 +54,12 @@
54
54
  </div>
55
55
 
56
56
  <div class="mint-status">
57
- <p v-if="mintOpen">{{ $t('token.blocks_remaining', { blocksRemaining }) }}</p>
57
+ <p v-if="mintOpen">{{ $t('token.closes_in', { time: countDownStr }) }}</p>
58
58
  <p v-else-if="currentBlock">
59
- {{ $t('token.closed_at_block')}}
60
- {{ token.mintedBlock + BLOCKS_PER_DAY }}
59
+ {{ $t('token.closed_ago', { time: countDownStr })}}
61
60
  </p>
62
61
  <p v-if="ownedBalance">
63
- {{ $t('token.you_own', { ownedBalance }) }}
62
+ {{ $t('token.you_own', { ownedBalance }) }}
64
63
  {{ $t('tokens', Number(ownedBalance)) }}
65
64
  </p>
66
65
  </div>
@@ -9,6 +9,8 @@
9
9
  minted,
10
10
  mintOpen,
11
11
  blocksRemaining,
12
+ secondsRemaining,
13
+ countDownStr,
12
14
  transactionFlowConfig
13
15
  }"
14
16
  >
@@ -20,6 +22,8 @@
20
22
  :mintRequest="mintRequest"
21
23
  :minted="minted"
22
24
  :mintOpen="mintOpen"
25
+ :secondsRemaining="secondsRemaining"
26
+ :countDownStr="countDownStr"
23
27
  :blocksRemaining="blocksRemaining"
24
28
  :transactionFlowConfig="transactionFlowConfig"
25
29
  >
@@ -29,10 +33,7 @@
29
33
  <span>{{ token.name }} <span class="token-id">#{{ token.tokenId }}</span></span>
30
34
  <span v-if="token.description" class="description">{{ shortString(token.description, 60, 30) }}</span>
31
35
  </h1>
32
- <p v-if="mintOpen" class="closes-in">
33
- {{ $t('token.closes_in') }} {{ blocksRemaining }} {{ $t('blocks', Number(blocksRemaining)) }}
34
- </p>
35
- <p v-else class="closed-at">{{ $t('token.closed_at_block') }} {{ token.mintedBlock + BLOCKS_PER_DAY }}</p>
36
+ <p v-if="mintOpen" class="closes-in">{{ $t('token.closes_in', { time: countDownStr }) }}</p>
36
37
  </header>
37
38
  <Embed v-if="token.animationUrl" :src="token.animationUrl" />
38
39
  <Image v-else-if="token.image" :src="token.image" :alt="token.name" />
package/locales/en.json CHANGED
@@ -71,9 +71,8 @@
71
71
  },
72
72
  "token": {
73
73
  "by": "By",
74
- "closes_in": "Closes in",
75
- "blocks_remaining": "{blocksRemaining} blocks remaining",
76
- "closed_at_block": "Closed at block",
74
+ "closes_in": "Closes in {time}",
75
+ "closed_ago": "Closed {time} ago",
77
76
  "you_own": "You own {ownedBalance} {tokens}",
78
77
  "mint_timeline": "Mint Timeline",
79
78
  "artist_mint": "Artist Mint",
package/nuxt.config.ts CHANGED
@@ -20,7 +20,7 @@ export default defineNuxtConfig({
20
20
  creatorAddress: '',
21
21
  defaultAvatar: '/icons/opepen.svg',
22
22
  description: 'To mint is a human right.',
23
- factoryAddress: '0xdc27b70874E36f00290Bd588D5B31AD510ca88a5',
23
+ factoryAddress: '0x750C5a6CFD40C9CaA48C31D87AC2a26101Acd517',
24
24
  platformUrl: 'https://networked.art',
25
25
  rpc1: 'https://ethereum-sepolia.rpc.subquery.network/public',
26
26
  rpc2: 'https://ethereum-sepolia-rpc.publicnode.com',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.66",
3
+ "version": "0.1.68",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
package/utils/time.ts CHANGED
@@ -19,3 +19,24 @@ export const useNow = () => {
19
19
 
20
20
  return now
21
21
  }
22
+
23
+ export const useCountDown = (s: Ref<Number|BigInt>) => {
24
+ const duration = computed(() => Math.abs(parseInt(`${s.value}`)))
25
+
26
+ const seconds = computed(() => duration.value % 60)
27
+ const minutes = computed(() => Math.floor(duration.value / 60) % 60)
28
+ const hours = computed(() => Math.floor(duration.value / 60 / 60))
29
+
30
+ const str = computed(() => [
31
+ hours.value ? `${hours.value}h` : null,
32
+ minutes.value ? `${minutes.value}m` : null,
33
+ seconds.value ? `${seconds.value}s` : null,
34
+ ].filter(s => !!s).join(' '))
35
+
36
+ return {
37
+ seconds,
38
+ minutes,
39
+ hours,
40
+ str,
41
+ }
42
+ }