33const path = require ( "path" ) ;
44const isLocal = typeof process . pkg === "undefined" ;
55const basePath = isLocal ? process . cwd ( ) : path . dirname ( process . execPath ) ;
6+ const { NETWORK } = require ( path . join ( basePath , "constants/network.js" ) ) ;
67const fs = require ( "fs" ) ;
78const sha1 = require ( path . join ( basePath , "/node_modules/sha1" ) ) ;
89const { createCanvas, loadImage } = require ( path . join (
@@ -23,6 +24,9 @@ const {
2324 debugLogs,
2425 extraMetadata,
2526 text,
27+ namePrefix,
28+ network,
29+ solanaMetadata,
2630} = require ( path . join ( basePath , "/src/config.js" ) ) ;
2731const canvas = createCanvas ( format . width , format . height ) ;
2832const ctx = canvas . getContext ( "2d" ) ;
@@ -118,16 +122,42 @@ const drawBackground = () => {
118122const addMetadata = ( _dna , _edition ) => {
119123 let dateTime = Date . now ( ) ;
120124 let tempMetadata = {
121- dna : sha1 ( _dna ) ,
122- name : `#${ _edition } ` ,
125+ name : `${ namePrefix } #${ _edition } ` ,
123126 description : description ,
124127 image : `${ baseUri } /${ _edition } .png` ,
128+ dna : sha1 ( _dna ) ,
125129 edition : _edition ,
126130 date : dateTime ,
127131 ...extraMetadata ,
128132 attributes : attributesList ,
129133 compiler : "HashLips Art Engine" ,
130134 } ;
135+ if ( network == NETWORK . sol ) {
136+ tempMetadata = {
137+ //Added metadata for solana
138+ name : tempMetadata . name ,
139+ symbol : solanaMetadata . symbol ,
140+ description : tempMetadata . description ,
141+ //Added metadata for solana
142+ seller_fee_basis_points : solanaMetadata . seller_fee_basis_points ,
143+ image : `image.png` ,
144+ //Added metadata for solana
145+ external_url : solanaMetadata . external_url ,
146+ edition : _edition ,
147+ ...extraMetadata ,
148+ attributes : tempMetadata . attributes ,
149+ properties : {
150+ files : [
151+ {
152+ uri : "image.png" ,
153+ type : "image/png" ,
154+ } ,
155+ ] ,
156+ category : "image" ,
157+ creators : solanaMetadata . creators ,
158+ } ,
159+ } ;
160+ }
131161 metadataList . push ( tempMetadata ) ;
132162 attributesList = [ ] ;
133163} ;
@@ -254,7 +284,7 @@ const startCreating = async () => {
254284 let failedCount = 0 ;
255285 let abstractedIndexes = [ ] ;
256286 for (
257- let i = 1 ;
287+ let i = network == NETWORK . sol ? 0 : 1 ;
258288 i <= layerConfigurations [ layerConfigurations . length - 1 ] . growEditionSizeTo ;
259289 i ++
260290 ) {
0 commit comments