The replit is here: https://replit.com/@Algorand/ASAIntegrationsJS#index.js
Blows up on line 149 when I run it (error: metadata should be uint8array or string). When I debug it, it works. When I run it locally it works too. Please advise as I am sure this error is on replit end.
let metadatafile = { "name": "ALICECOI", "description": "Alice's Artwork Coins", "image": "https://s3.amazonaws.com/your-bucket/images/MyPicture.png", "image_integrity": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", "properties": { "simple_property": "Alice's first artwork", "rich_property": { "name": "AliceCoi", "value": "001", "display_value": "001", "class": "emphasis", "css": { "color": "#ffffff", "font-weight": "bold", "text-decoration": "underline" } }, "array_property": { "name": "Artwork Coins", "value": [1, 2, 3, 4], "class": "emphasis" } } }; const hash = crypto.createHash('sha256'); hash.update(metadatafile); const metadata = new Uint8Array(hash.digest()); // blows up on next line let txn = algosdk.makeAssetCreateTxnWithSuggestedParams(addr, note, totalIssuance, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, metadata, params);
svg files cannot be displayed: https://storage.googleapis.com/replit/images/1645141380274_8f5c76100df8bb1ae29a04d8a1f4dfba.svg
Uint8Array error - not valid datatype (but runs fine in debugger)
The replit is here:
https://replit.com/@Algorand/ASAIntegrationsJS#index.js
Blows up on line 149 when I run it (error: metadata should be uint8array or string). When I debug it, it works. When I run it locally it works too. Please advise as I am sure this error is on replit end.
let metadatafile = {
"name": "ALICECOI",
"description": "Alice's Artwork Coins",
"image": "https://s3.amazonaws.com/your-bucket/images/MyPicture.png",
"image_integrity": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",
"properties": {
"simple_property": "Alice's first artwork",
"rich_property": {
"name": "AliceCoi",
"value": "001",
"display_value": "001",
"class": "emphasis",
"css": {
"color": "#ffffff",
"font-weight": "bold",
"text-decoration": "underline"
}
},
"array_property": {
"name": "Artwork Coins",
"value": [1, 2, 3, 4],
"class": "emphasis"
}
}
};
const hash = crypto.createHash('sha256');
hash.update(metadatafile);
const metadata = new Uint8Array(hash.digest());
// blows up on next line
let txn = algosdk.makeAssetCreateTxnWithSuggestedParams(addr, note,
totalIssuance, decimals, defaultFrozen, manager, reserve, freeze,
clawback, unitName, assetName, assetURL, metadata, params);
svg files cannot be displayed: https://storage.googleapis.com/replit/images/1645141380274_8f5c76100df8bb1ae29a04d8a1f4dfba.svg