@visualizevalue/mint-app-base 0.1.76 → 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
 
@@ -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/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.76",
3
+ "version": "0.1.77",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
@@ -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,