@visualizevalue/mint-app-base 0.1.75 → 0.1.77

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
@@ -11,25 +11,29 @@ NUXT_PUBLIC_DESCRIPTION=To mint is a human right.
11
11
  # =========================
12
12
  # ARTIST SCOPE
13
13
  # =========================
14
- NUXT_PUBLIC_CREATOR_ADDRESS=0xc8f8e2F59Dd95fF67c3d39109ecA2e2A017D4c8a
14
+ NUXT_PUBLIC_CREATOR_ADDRESS=0xc8f8e2f59dd95ff67c3d39109eca2e2a017d4c8a
15
15
 
16
16
  # =========================
17
17
  # SERVICES
18
18
  # =========================
19
- NUXT_PUBLIC_BLOCK_EXPLORER=https://etherscan.io
20
19
  NUXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
21
- NUXT_PUBLIC_RPC1=
22
- NUXT_PUBLIC_RPC2=
23
- NUXT_PUBLIC_RPC3=
24
20
 
25
21
  # =========================
26
- # ONCHAIN
22
+ # MAINNET
27
23
  # =========================
28
-
29
- # # SEPOLIA
30
- # NUXT_PUBLIC_FACTORY_ADDRESS=0x750C5a6CFD40C9CaA48C31D87AC2a26101Acd517
31
- # NUXT_PUBLIC_CHAIN_ID=11155111
32
-
33
- # # MAINNET
24
+ # NUXT_PUBLIC_BLOCK_EXPLORER=https://etherscan.io
34
25
  # NUXT_PUBLIC_FACTORY_ADDRESS=0xd717Fe677072807057B03705227EC3E3b467b670
35
26
  # NUXT_PUBLIC_CHAIN_ID=1
27
+ # NUXT_PUBLIC_RPC1=https://eth.llamarpc.com
28
+ # NUXT_PUBLIC_RPC2=https://eth.drpc.org
29
+ # NUXT_PUBLIC_RPC3=https://1rpc.io/eth
30
+
31
+ # =========================
32
+ # SEPOLIA
33
+ # =========================
34
+ NUXT_PUBLIC_BLOCK_EXPLORER=https://sepolia.etherscan.io
35
+ NUXT_PUBLIC_FACTORY_ADDRESS=0x750C5a6CFD40C9CaA48C31D87AC2a26101Acd517
36
+ NUXT_PUBLIC_CHAIN_ID=11155111
37
+ NUXT_PUBLIC_RPC1=https://ethereum-sepolia-rpc.publicnode.com
38
+ NUXT_PUBLIC_RPC2=https://sepolia.drpc.org
39
+ NUXT_PUBLIC_RPC3=https://1rpc.io/sepolia
package/app.config.ts CHANGED
@@ -1,12 +1,25 @@
1
1
  export default defineAppConfig({
2
- knownRenderers: [
3
- {
4
- component: 'P5',
5
- name: 'P5 Renderer',
6
- version: 1n,
7
- address: '0x32B8Ffa14e7F77c252b6D43BEC5498FCef2b205F',
8
- description: 'Allows using P5 scripts as the artifact content'
9
- },
10
- ],
2
+ knownRenderers: {
3
+ // Mainnet
4
+ 1: [
5
+ {
6
+ component: 'P5',
7
+ name: 'P5 Renderer',
8
+ version: 1n,
9
+ address: '0x32B8Ffa14e7F77c252b6D43BEC5498FCef2b205F',
10
+ description: 'Allows using P5 scripts as the artifact content'
11
+ },
12
+ ],
13
+ // Sepolia
14
+ 11155111: [
15
+ {
16
+ component: 'P5',
17
+ name: 'P5 Renderer (Sepolia)',
18
+ version: 1n,
19
+ address: '0xfaDF2fB2F8a15Fc830c176B71D2c905E95f4169e',
20
+ description: 'Allows using P5 scripts as the artifact content'
21
+ },
22
+ ],
23
+ }
11
24
  })
12
25
 
@@ -0,0 +1,8 @@
1
+ :root {
2
+
3
+ --alert-info-color: var(--color);
4
+ --alert-info-background-color: transparent;
5
+ --alert-info-border-color: var(--muted);
6
+
7
+ }
8
+
@@ -1,3 +1,4 @@
1
+ @import "./components/alerts.css";
1
2
  @import "./components/breadcrumbs.css";
2
3
  @import "./components/buttons.css";
3
4
  @import "./components/cards.css";
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <Transition name="fade">
3
+ <aside v-if="! dismissed" class="alert" :class="[type]">
4
+ <button v-if="dismissable" @click="dismiss" class="close">
5
+ <Icon type="close" />
6
+ </button>
7
+ <slot />
8
+ </aside>
9
+ </Transition>
10
+ </template>
11
+
12
+ <script setup>
13
+ import { useLocalStorage } from '@vueuse/core'
14
+
15
+ const props = defineProps({
16
+ type: {
17
+ type: String,
18
+ default: 'info',
19
+ },
20
+ dismiss: {
21
+ type: String,
22
+ }
23
+ })
24
+
25
+ const dismissKey = computed(() => `alert:${props.dismiss}`)
26
+
27
+ const dismissed = useLocalStorage(dismissKey.value, false)
28
+ const dismissable = computed(() => !! props.dismiss)
29
+
30
+ const dismiss = () => {
31
+ dismissed.value = true
32
+ }
33
+ </script>
34
+
35
+ <style scoped>
36
+ .alert {
37
+ position: relative;
38
+ display: grid;
39
+ gap: var(--spacer-sm);
40
+
41
+ &.info {
42
+ border-color: var(--alert-info-border-color) !important;
43
+ background-color: var(--alert-info-background-color);
44
+ color: var(--alert-info-color);
45
+ }
46
+
47
+ :deep(> h1) {
48
+ text-transform: uppercase;
49
+ font-weight: bold;
50
+ }
51
+
52
+ :deep(> h1),
53
+ :deep(> p) {
54
+ font-size: var(--font-sm);
55
+ }
56
+
57
+ .close {
58
+ position: absolute;
59
+ width: var(--size-5);
60
+ padding: var(--size-1);
61
+ top: var(--spacer-sm);
62
+ right: var(--spacer-sm);
63
+ background: none;
64
+
65
+ &:--highlight {
66
+ background: none;
67
+ }
68
+ }
69
+ }
70
+ </style>
71
+
@@ -42,11 +42,12 @@ const props = defineProps(['collection'])
42
42
 
43
43
  const appConfig = useAppConfig()
44
44
  const store = useOnchainStore()
45
+ const mainChainId = useMainChainId()
45
46
 
46
47
  const installedRenderers = computed(() => props.collection.renderers)
47
48
 
48
49
  const availableRenderers = computed(
49
- () => appConfig.knownRenderers.filter(r =>
50
+ () => appConfig.knownRenderers[mainChainId].filter(r =>
50
51
  !installedRenderers.value.map(cr => cr.address).includes(r.address)
51
52
  )
52
53
  )
@@ -43,13 +43,14 @@ export const useCreateMintData = () => {
43
43
  // Expose the mint component based on the selected renderer
44
44
  export const useCreateMintRendererComponent = (collection: Collection) => {
45
45
  const appConfig = useAppConfig()
46
+ const mainChainId = useMainChainId()
46
47
  const rendererAddress: Ref<string | null> = computed(() => {
47
48
  if (! collection.renderers?.length) return null
48
49
 
49
50
  return collection.renderers[renderer.value].address.toLowerCase()
50
51
  })
51
52
 
52
- const component = computed(() => appConfig.knownRenderers
53
+ const component = computed(() => appConfig.knownRenderers[mainChainId]
53
54
  .find((r) =>
54
55
  r.address.toLowerCase() === rendererAddress.value
55
56
  )?.component || 'Base'
package/index.d.ts CHANGED
@@ -3,7 +3,11 @@ import { Renderer } from './utils/types'
3
3
  declare module 'nuxt/schema' {
4
4
  interface AppConfigInput {
5
5
  // Known renderers besides the base renderer
6
- knownRenderers: Renderer[],
6
+ knownRenderers: {
7
+ 1: Renderer[],
8
+ 11155111?: Renderer[],
9
+ 17000?: Renderer[],
10
+ }
7
11
  }
8
12
  }
9
13
 
package/locales/en.json CHANGED
@@ -87,12 +87,17 @@
87
87
  },
88
88
  "create": {
89
89
  "title": "Create New",
90
+ "alert_new": {
91
+ "title": "Create New Collection",
92
+ "text": "Note this just creates the collection smart contract. You'll be able to mint individual artifacts within the collection after collection deployment."
93
+ },
90
94
  "note": {
91
95
  "start": "Note: This should be a small file, preferably a simple SVG like",
92
96
  "link_text": "this one (273 bytes)",
93
97
  "end": "Try to make it less than 10kb."
94
98
  },
95
99
  "preview": {
100
+ "collection": "Collection",
96
101
  "token": "Token",
97
102
  "no_description": "No description"
98
103
  },
package/nuxt.config.ts CHANGED
@@ -16,7 +16,7 @@ export default defineNuxtConfig({
16
16
  runtimeConfig: {
17
17
  public: {
18
18
  blockExplorer: 'https://etherscan.io',
19
- chainId: 1337,
19
+ chainId: 1,
20
20
  creatorAddress: '',
21
21
  defaultAvatar: '/icons/opepen.svg',
22
22
  description: 'To mint is a human right.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.75",
3
+ "version": "0.1.77",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
@@ -9,14 +9,19 @@
9
9
  class="inset"
10
10
  >
11
11
 
12
+ <Alert dismiss="create-new-collection-info">
13
+ <h1>{{ $t('create.alert_new.title') }}</h1>
14
+ <p>{{ $t('create.alert_new.text') }}</p>
15
+ </Alert>
16
+
12
17
  <article class="preview">
13
18
  <div class="visual">
14
19
  <Image v-if="image" :src="image" alt="Preview" />
15
20
  <ImagePreview v-else />
16
21
  </div>
17
22
  <h1>
18
- <span :class="{ '': !title }">{{ title || $t('create.preview.token') }}</span>
19
- <small :class="{ '': !symbol }">{{ symbol || '$T' }}</small>
23
+ <span :class="{ '': !title }">{{ title || $t('create.preview.collection') }}</span>
24
+ <small :class="{ '': !symbol }">{{ symbol || '$SYM' }}</small>
20
25
  </h1>
21
26
  <p :class="{ '': !description }">
22
27
  {{ description || $t('create.preview.no_description') }}
@@ -6,6 +6,7 @@ import type { CustomTransport, Transport } from 'viem'
6
6
 
7
7
  export default defineNuxtPlugin(nuxtApp => {
8
8
  const title = nuxtApp.$config.public.title || 'Mint'
9
+ const mainChainId = nuxtApp.$config.public.chainId
9
10
 
10
11
  const connectors: CreateConnectorFn[] = [
11
12
  injected(),
@@ -46,7 +47,11 @@ export default defineNuxtPlugin(nuxtApp => {
46
47
  }),
47
48
  ssr: true,
48
49
  transports: {
49
- [mainnet.id]: transports,
50
+ [mainnet.id]: mainChainId == 1
51
+ // Use configured transports if we're on mainnet
52
+ ? transports
53
+ // Default to viem public rpc if not on mainnet
54
+ : http(),
50
55
  [sepolia.id]: transports,
51
56
  [holesky.id]: transports,
52
57
  [localhost.id]: transports,