diff --git a/nft-taquito/.gitignore b/nft-taquito/.gitignore deleted file mode 100644 index c66f727..0000000 --- a/nft-taquito/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -frontend/node_modules -backend/node_modules -backend/dist -backend/uploads/* -*/package-lock.json -.DS_Store diff --git a/nft-taquito/README.md b/nft-taquito/README.md deleted file mode 100644 index 8fe5687..0000000 --- a/nft-taquito/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Tutorial application: Create a web app that mints NFTs - -This is the completed application from the tutorial [Create a web app that mints NFTs](https://docs.tezos.com/tutorials/create-an-nft/nft-taquito/). - -## Project structure - -This project contains two applications that you run on your computer and one smart contract that you deploy to Tezos: - -- The `frontend` folder contains a Vite and Svelte application that allows users to upload files and send a request to mint and NFT based on that file. -- The `backend` folder contains an Express application that receives the files and NFT information and mints NFTs. -- The `contract` folder contains a smart contract written in CameLIGO that manages the NFTs. - -## Running the application - -To run the application, you must deploy (originate) the contract and start the backend and frontend applications: - -1. If you don't have an account on Pinata, set one up at . - -1. On Pinata, create an API key with the `pinFileToIFPS` and `pinJSONToIFPS` permissions and copy the API key and secret. - -1. Originate the `contract/NFTS_contract.mligo` file to Tezos, using the commented text at the end as the initial storage value. -For example, you can use the web IDE for LIGO at to originate the contract. - -1. Copy the address of the originated contract. - -1. Start the backend app: - - 1. Go to the `backend` folder. - - 1. Install the dependencies by running `npm install`. - - 1. In the file `src/PinataKeys.ts`, enter your Pinata API key and secret. - - 1. Start the app by running `npm run dev`. - -1. Start the frontend app: - - 1. Go to the `frontend` folder. - - 1. Install the dependencies by running `npm install`. - - 1. Update the `src/App.svelte` file to set the address of the contract you originated in this line: - - ```ts - const contractAddress = "KT1XKSMfewg86885Q25ezFdNVTr995XVhVCf"; - ``` - - 1. Start the app by running `npm run dev`. - -1. Open the frontend app in a web browser by going to . diff --git a/nft-taquito/backend/Procfile b/nft-taquito/backend/Procfile deleted file mode 100644 index 4e4926a..0000000 --- a/nft-taquito/backend/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: node dist/index.js \ No newline at end of file diff --git a/nft-taquito/backend/package.json b/nft-taquito/backend/package.json deleted file mode 100644 index 3e5fb16..0000000 --- a/nft-taquito/backend/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nft-taquito-pinata-tutorial", - "version": "1.0.0", - "description": "A tutorial about using Taquito and Pinata to mint NFTs on Tezos", - "main": "dist/index.js", - "scripts": { - "build": "tsc", - "postinstall": "tsc", - "prestart": "npm run build", - "start": "node dist/index.js", - "dev": "nodemon --watch \"src/**\" --ext \"ts,json\" --exec \"ts-node src/index.ts\"", - "test": "echo \"Error: no test specified\" && exit 1", - "deploy": "git add . && git commit -m Heroku && git push heroku main" - }, - "author": "Claude Barde", - "license": "ISC", - "engines": { - "node": ">=18.0" - }, - "dependencies": { - "@pinata/sdk": "^2.1.0", - "axios": "^1.3.2", - "cors": "^2.8.5", - "express": "^4.18.2", - "multer": "^1.4.2", - "uuid": "^9.0.0" - }, - "devDependencies": { - "@types/express": "^4.17.17", - "@types/node": "^18.11.19", - "nodemon": "^2.0.20", - "ts-node": "^10.9.1", - "typescript": "^4.9.5" - } -} diff --git a/nft-taquito/backend/src/PinataKeys.ts b/nft-taquito/backend/src/PinataKeys.ts deleted file mode 100644 index 5304aae..0000000 --- a/nft-taquito/backend/src/PinataKeys.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - apiKey: "DUMMY_KEY", - apiSecret: "DUMMY_SECRET" -}; diff --git a/nft-taquito/backend/src/index.ts b/nft-taquito/backend/src/index.ts deleted file mode 100644 index 75b0563..0000000 --- a/nft-taquito/backend/src/index.ts +++ /dev/null @@ -1,107 +0,0 @@ -import express from "express"; -import pinataSDK from "@pinata/sdk"; -import fs from "fs"; -const cors = require("cors"); -const multer = require("multer"); - -const app = express(); -const upload = multer({ dest: "uploads/" }); -const port = process.env.NODE_ENV === "production" ? process.env.PORT : 8080; // default port to listen -let pinata: any; -if (process.env.NODE_ENV === "production") { - pinata = new pinataSDK( - process.env.PINATA_API_KEY, - process.env.PINATA_SECRET_KEY - ); -} else { - const PinataKeys = require("./PinataKeys").default; - pinata = new pinataSDK(PinataKeys.apiKey, PinataKeys.apiSecret); -} - -const corsOptions = { - origin: ["http://localhost:5173", "https://my-cool-nft-app.com"], - optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204 -}; -app.use(cors(corsOptions)); -app.use(express.json({ limit: "50mb" })); -app.use( - express.urlencoded({ limit: "50mb", extended: true, parameterLimit: 50000 }) -); - -// defines a route handler for the default home page -app.get("/", (req, res) => { - res.send("Hello developers!"); -}); - -// handles minting -app.post("/mint", upload.single("image"), async (req, res) => { - const multerReq = req as any; - //console.log(multerReq.file, req.body); - if (!multerReq.file) { - res.status(500).json({ status: false, msg: "no file provided" }); - } else { - const fileName = multerReq.file.filename; - // tests Pinata authentication - await pinata - .testAuthentication() - .catch((err: any) => res.status(500).json(JSON.stringify(err))); - // creates readable stream - const readableStreamForFile = fs.createReadStream(`./uploads/${fileName}`); - const options: any = { - pinataMetadata: { - name: req.body.title.replace(/\s/g, "-"), - keyvalues: { - description: req.body.description - } - } - }; - const pinnedFile = await pinata.pinFileToIPFS( - readableStreamForFile, - options - ); - if (pinnedFile.IpfsHash && pinnedFile.PinSize > 0) { - // remove file from server - fs.unlinkSync(`./uploads/${fileName}`); - // pins metadata - const metadata = { - name: req.body.title, - description: req.body.description, - symbol: "TUT", - artifactUri: `ipfs://${pinnedFile.IpfsHash}`, - displayUri: `ipfs://${pinnedFile.IpfsHash}`, - creators: [req.body.creator], - decimals: 0, - thumbnailUri: "https://tezostaquito.io/img/favicon.png", - is_transferable: true, - shouldPreferSymbol: false - }; - - const pinnedMetadata = await pinata.pinJSONToIPFS(metadata, { - pinataMetadata: { - name: "TUT-metadata" - } - }); - - if (pinnedMetadata.IpfsHash && pinnedMetadata.PinSize > 0) { - res.status(200).json({ - status: true, - msg: { - imageHash: pinnedFile.IpfsHash, - metadataHash: pinnedMetadata.IpfsHash - } - }); - } else { - res - .status(500) - .json({ status: false, msg: "metadata were not pinned" }); - } - } else { - res.status(500).json({ status: false, msg: "file was not pinned" }); - } - } -}); - -// starts the Express server -app.listen(port, () => { - console.log(`server started at http://localhost:${port}`); -}); diff --git a/nft-taquito/backend/src/types.ts b/nft-taquito/backend/src/types.ts deleted file mode 100644 index c386359..0000000 --- a/nft-taquito/backend/src/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface NFT { - name: string; - description: string; - symbol: string; - decimals: number; - artifactUri: string; - displayUri: string; - thumbnailUri: string; - creators: string[]; - is_transferable: boolean; - lastUpdate: number; - formats: { uri: string; mimeType: string }[]; - isBooleanAmount: boolean; - shouldPreferSymbol: boolean; -} diff --git a/nft-taquito/backend/tsconfig.json b/nft-taquito/backend/tsconfig.json deleted file mode 100644 index 35cc4e4..0000000 --- a/nft-taquito/backend/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "esModuleInterop": true, - "target": "es6", - "noImplicitAny": true, - "moduleResolution": "node", - "sourceMap": true, - "outDir": "dist", - "baseUrl": ".", - "paths": { - "*": ["node_modules/*"] - } - }, - "include": ["src/**/*"] -} diff --git a/nft-taquito/contract/NFTS_contract.mligo b/nft-taquito/contract/NFTS_contract.mligo deleted file mode 100644 index 2348fcc..0000000 --- a/nft-taquito/contract/NFTS_contract.mligo +++ /dev/null @@ -1,541 +0,0 @@ -(** -Implementation of the FA2 interface for the NFT contract supporting multiple -types of NFTs. Each NFT type is represented by the range of token IDs - `token_def`. - *) - -type token_id = nat - -type transfer_destination = -[@layout:comb] -{ - to_ : address; - token_id : token_id; - amount : nat; -} - -type transfer = -[@layout:comb] -{ - from_ : address; - txs : transfer_destination list; -} - -type balance_of_request = -[@layout:comb] -{ - owner : address; - token_id : token_id; -} - -type balance_of_response = -[@layout:comb] -{ - request : balance_of_request; - balance : nat; -} - -type balance_of_param = -[@layout:comb] -{ - requests : balance_of_request list; - callback : (balance_of_response list) contract; -} - -type operator_param = -[@layout:comb] -{ - owner : address; - operator : address; - token_id: token_id; -} - -type update_operator = -[@layout:comb] - | Add_operator of operator_param - | Remove_operator of operator_param - -type token_metadata = -[@layout:comb] -{ - token_id : token_id; - token_info : (string, bytes) map; -} - -(* -One of the options to make token metadata discoverable is to declare -`token_metadata : token_metadata_storage` field inside the FA2 contract storage -*) -type token_metadata_storage = (token_id, token_metadata) big_map - -(** -Optional type to define view entry point to expose token_metadata on chain or -as an external view - *) -type token_metadata_param = -[@layout:comb] -{ - token_ids : token_id list; - handler : (token_metadata list) -> unit; -} - -type mint_params = -[@layout:comb] -{ - link_to_metadata: bytes; - owner: address; -} - -(* - TZIP-16 contract metadata storage field type. - The contract storage MUST have a field - `metadata : contract_metadata` -*) -type contract_metadata = (string, bytes) big_map - -(* FA2 hooks interface *) - -type transfer_destination_descriptor = -[@layout:comb] -{ - to_ : address option; - token_id : token_id; - amount : nat; -} - -type transfer_descriptor = -[@layout:comb] -{ - from_ : address option; - txs : transfer_destination_descriptor list -} - -type transfer_descriptor_param = -[@layout:comb] -{ - batch : transfer_descriptor list; - operator : address; -} - -(* -Entrypoints for sender/receiver hooks - -type fa2_token_receiver = - ... - | Tokens_received of transfer_descriptor_param - -type fa2_token_sender = - ... - | Tokens_sent of transfer_descriptor_param -*) - - -(** One of the specified `token_id`s is not defined within the FA2 contract *) -let fa2_token_undefined = "FA2_TOKEN_UNDEFINED" -(** -A token owner does not have sufficient balance to transfer tokens from -owner's account -*) -let fa2_insufficient_balance = "FA2_INSUFFICIENT_BALANCE" -(** A transfer failed because of `operator_transfer_policy == No_transfer` *) -let fa2_tx_denied = "FA2_TX_DENIED" -(** -A transfer failed because `operator_transfer_policy == Owner_transfer` and it is -initiated not by the token owner -*) -let fa2_not_owner = "FA2_NOT_OWNER" -(** -A transfer failed because `operator_transfer_policy == Owner_or_operator_transfer` -and it is initiated neither by the token owner nor a permitted operator - *) -let fa2_not_operator = "FA2_NOT_OPERATOR" -(** -`update_operators` entrypoint is invoked and `operator_transfer_policy` is -`No_transfer` or `Owner_transfer` -*) -let fa2_operators_not_supported = "FA2_OPERATORS_UNSUPPORTED" -(** -Receiver hook is invoked and failed. This error MUST be raised by the hook -implementation - *) -let fa2_receiver_hook_failed = "FA2_RECEIVER_HOOK_FAILED" -(** -Sender hook is invoked and failed. This error MUST be raised by the hook -implementation - *) -let fa2_sender_hook_failed = "FA2_SENDER_HOOK_FAILED" -(** -Receiver hook is required by the permission behavior, but is not implemented by -a receiver contract - *) -let fa2_receiver_hook_undefined = "FA2_RECEIVER_HOOK_UNDEFINED" -(** -Sender hook is required by the permission behavior, but is not implemented by -a sender contract - *) -let fa2_sender_hook_undefined = "FA2_SENDER_HOOK_UNDEFINED" -(** -Reference implementation of the FA2 operator storage, config API and -helper functions -*) - - -(* - Permission policy definition. - Stored in the TZIP-16 contract metadata JSON -*) - -type operator_transfer_policy = - [@layout:comb] - | No_transfer - | Owner_transfer - | Owner_or_operator_transfer - -type owner_hook_policy = - [@layout:comb] - | Owner_no_hook - | Optional_owner_hook - | Required_owner_hook - -type custom_permission_policy = -[@layout:comb] -{ - tag : string; - config_api: address option; -} - -type permissions_descriptor = -[@layout:comb] -{ - operator : operator_transfer_policy; - receiver : owner_hook_policy; - sender : owner_hook_policy; - custom : custom_permission_policy option; -} - -(** -(owner, operator, token_id) -> unit -To be part of FA2 storage to manage permitted operators -*) -type operator_storage = ((address * (address * token_id)), unit) big_map - -(** - Updates operator storage using an `update_operator` command. - Helper function to implement `Update_operators` FA2 entrypoint -*) -let update_operators (update, storage : update_operator * operator_storage) - : operator_storage = - match update with - | Add_operator op -> - Big_map.update (op.owner, (op.operator, op.token_id)) (Some unit) storage - | Remove_operator op -> - Big_map.remove (op.owner, (op.operator, op.token_id)) storage - -(** -Validate if operator update is performed by the token owner. -@param updater an address that initiated the operation; usually `Tezos.get_sender ()`. -*) -let validate_update_operators_by_owner (update, updater : update_operator * address) - : unit = - let op = match update with - | Add_operator op -> op - | Remove_operator op -> op - in - if op.owner = updater then unit else failwith fa2_not_owner - -(** - Generic implementation of the FA2 `%update_operators` entrypoint. - Assumes that only the token owner can change its operators. - *) -let fa2_update_operators (updates, storage - : (update_operator list) * operator_storage) : operator_storage = - let updater = Tezos.get_sender () in - let process_update = (fun (ops, update : operator_storage * update_operator) -> - let _u = validate_update_operators_by_owner (update, updater) in - update_operators (update, ops) - ) in - List.fold process_update updates storage - -(** - owner * operator * token_id * ops_storage -> unit -*) -type operator_validator = (address * address * token_id * operator_storage)-> unit - -(** -Create an operator validator function based on provided operator policy. -@param tx_policy operator_transfer_policy defining the constrains on who can transfer. -@return (owner, operator, token_id, ops_storage) -> unit - *) -let make_operator_validator (tx_policy : operator_transfer_policy) : operator_validator = - let can_owner_tx, can_operator_tx = match tx_policy with - | No_transfer -> (failwith fa2_tx_denied : bool * bool) - | Owner_transfer -> true, false - | Owner_or_operator_transfer -> true, true - in - (fun (owner, operator, token_id, ops_storage - : address * address * token_id * operator_storage) -> - if can_owner_tx && owner = operator - then unit (* transfer by the owner *) - else if not can_operator_tx - then failwith fa2_not_owner (* an operator transfer not permitted by the policy *) - else if Big_map.mem (owner, (operator, token_id)) ops_storage - then unit (* the operator is permitted for the token_id *) - else failwith fa2_not_operator (* the operator is not permitted for the token_id *) - ) - -(** -Default implementation of the operator validation function. -The default implicit `operator_transfer_policy` value is `Owner_or_operator_transfer` - *) -let default_operator_validator : operator_validator = - (fun (owner, operator, token_id, ops_storage - : address * address * token_id * operator_storage) -> - if owner = operator - then unit (* transfer by the owner *) - else if Big_map.mem (owner, (operator, token_id)) ops_storage - then unit (* the operator is permitted for the token_id *) - else failwith fa2_not_operator (* the operator is not permitted for the token_id *) - ) - -(** -Validate operators for all transfers in the batch at once -@param tx_policy operator_transfer_policy defining the constrains on who can transfer. -*) -let validate_operator (tx_policy, txs, ops_storage - : operator_transfer_policy * (transfer list) * operator_storage) : unit = - let validator = make_operator_validator tx_policy in - List.iter (fun (tx : transfer) -> - List.iter (fun (dst: transfer_destination) -> - validator (tx.from_, Tezos.get_sender (), dst.token_id ,ops_storage) - ) tx.txs - ) txs - -(* range of nft tokens *) -type token_def = -[@layout:comb] -{ - from_ : nat; - to_ : nat; -} - -type nft_meta = (token_def, token_metadata) big_map - -type token_storage = { - token_defs : token_def set; - next_token_id : token_id; - metadata : nft_meta; -} - -type ledger = (token_id, address) big_map -type reverse_ledger = (address, token_id list) big_map - -type nft_token_storage = { - ledger : ledger; - operators : operator_storage; - reverse_ledger: reverse_ledger; - metadata: (string, bytes) big_map; - token_metadata: token_metadata_storage; - next_token_id: token_id; - admin: address; -} - -type return_value = operation list * nft_token_storage - -(** -Retrieve the balances for the specified tokens and owners -@return callback operation -*) -let get_balance (p, ledger : balance_of_param * ledger) : operation = - let to_balance = fun (r : balance_of_request) -> - let owner = Big_map.find_opt r.token_id ledger in - match owner with - | None -> (failwith fa2_token_undefined : balance_of_response) - | Some o -> - let bal = if o = r.owner then 1n else 0n in - { request = r; balance = bal; } - in - let responses = List.map to_balance p.requests in - Tezos.transaction responses 0mutez p.callback - -(** -Update ledger balances according to the specified transfers. Fails if any of the -permissions or constraints are violated. -@param txs transfers to be applied to the ledger -@param validate_op function that validates of the tokens from the particular owner can be transferred. - *) -let transfer_nfts (txs, validate_op, ops_storage, ledger, reverse_ledger - : (transfer list) * operator_validator * operator_storage * ledger * reverse_ledger) : ledger * reverse_ledger = - (* process individual transfer *) - let make_transfer = (fun ((l, rv_l), tx : (ledger * reverse_ledger) * transfer) -> - List.fold - (fun ((ll, rv_ll), dst : (ledger * reverse_ledger) * transfer_destination) -> - if dst.amount = 0n - then ll, rv_ll - else if dst.amount <> 1n - then (failwith fa2_insufficient_balance : ledger * reverse_ledger) - else - let owner = Big_map.find_opt dst.token_id ll in - match owner with - | None -> (failwith fa2_token_undefined : ledger * reverse_ledger) - | Some o -> - if o <> tx.from_ - then (failwith fa2_insufficient_balance : ledger * reverse_ledger) - else - begin - let _u = validate_op (o, Tezos.get_sender (), dst.token_id, ops_storage) in - let new_ll = Big_map.update dst.token_id (Some dst.to_) ll in - (* removes token id from sender *) - let new_rv_ll = - match Big_map.find_opt tx.from_ rv_ll with - | None -> (failwith fa2_insufficient_balance : reverse_ledger) - | Some tk_id_l -> - Big_map.update - tx.from_ - (Some (List.fold ( - fun (new_list, token_id: token_id list * token_id) -> - if token_id = dst.token_id - then new_list - else token_id :: new_list - ) tk_id_l ([]: token_id list))) - rv_ll - in - (* adds token id to recipient *) - let updated_rv_ll = - match Big_map.find_opt dst.to_ new_rv_ll with - | None -> Big_map.add dst.to_ [dst.token_id] new_rv_ll - | Some tk_id_l -> Big_map.update dst.to_ (Some (dst.token_id :: tk_id_l)) new_rv_ll in - - new_ll, updated_rv_ll - end - ) tx.txs (l, rv_l) - ) - in - - List.fold make_transfer txs (ledger, reverse_ledger) - -(** Finds a definition of the token type (token_id range) associated with the provided token id *) -let find_token_def (tid, token_defs : token_id * (token_def set)) : token_def = - let tdef = Set.fold (fun (res, d : (token_def option) * token_def) -> - match res with - | Some _ -> res - | None -> - if tid >= d.from_ && tid < d.to_ - then Some d - else (None : token_def option) - ) token_defs (None : token_def option) - in - match tdef with - | None -> (failwith fa2_token_undefined : token_def) - | Some d -> d - -let get_metadata (tokens, meta : (token_id list) * token_storage ) - : token_metadata list = - List.map (fun (tid: token_id) -> - let tdef = find_token_def (tid, meta.token_defs) in - let meta = Big_map.find_opt tdef meta.metadata in - match meta with - | Some m -> { m with token_id = tid; } - | None -> (failwith "NO_DATA" : token_metadata) - ) tokens - -let mint (p, s: mint_params * nft_token_storage): nft_token_storage = - let { link_to_metadata; owner } = p in - let token_id = s.next_token_id in - (* Updates the ledger *) - let new_ledger = Big_map.add token_id owner s.ledger in - (* Updates the reverse ledger *) - let new_reverse_ledger = - match Big_map.find_opt owner s.reverse_ledger with - | None -> Big_map.add owner [token_id] s.reverse_ledger - | Some l -> Big_map.update owner (Some (token_id :: l)) s.reverse_ledger in - (* Stores the metadata *) - let new_entry = { token_id = token_id; token_info = Map.literal [("", link_to_metadata)] } in - - { - s with - ledger = new_ledger; - reverse_ledger = new_reverse_ledger; - token_metadata = Big_map.add token_id new_entry s.token_metadata; - next_token_id = token_id + 1n; - } - -let burn (p, s: token_id * nft_token_storage): nft_token_storage = - (* removes token from the ledger *) - let new_ledger: ledger = - match Big_map.find_opt p s.ledger with - | None -> (failwith "UNKNOWN_TOKEN": ledger) - | Some owner -> - if owner <> Tezos.get_sender () - then (failwith "NOT_TOKEN_OWNER": ledger) - else - Big_map.remove p s.ledger - in - (* removes token from the reverse ledger *) - let new_reverse_ledger: reverse_ledger = - let sender = Tezos.get_sender () in - - match Big_map.find_opt sender s.reverse_ledger with - | None -> (failwith "NOT_A_USER": reverse_ledger) - | Some tk_id_l -> - Big_map.update - sender - (Some (List.fold ( - fun (new_list, token_id: token_id list * token_id) -> - if token_id = p - then new_list - else token_id :: new_list - ) tk_id_l ([]: token_id list))) - s.reverse_ledger - in { s with ledger = new_ledger; reverse_ledger = new_reverse_ledger } - -(** entrypoints *) - -(** Transfer entrypoint *) -[@entry] -let transfer (txs : transfer list) (storage : nft_token_storage) : return_value = - let (new_ledger, new_reverse_ledger) = transfer_nfts - (txs, default_operator_validator, storage.operators, storage.ledger, storage.reverse_ledger) in - let new_storage = { storage with ledger = new_ledger; reverse_ledger = new_reverse_ledger } in - ([] : operation list), new_storage - -(** Balance entrypoint *) -[@entry] -let balance_of (p : balance_of_param) (storage : nft_token_storage) : return_value = - let op = get_balance (p, storage.ledger) in - [op], storage - -(** Update operators entrypoint *) -[@entry] -let update_operators (updates : update_operator list) (storage : nft_token_storage) : return_value = - let new_ops = fa2_update_operators (updates, storage.operators) in - let new_storage = { storage with operators = new_ops; } in - ([] : operation list), new_storage - -(** Mint NFT entrypoint *) -[@entry] -let mint (p : mint_params) (storage : nft_token_storage) : return_value = - ([]: operation list), mint (p, storage) - -(** Burn NFT entrypoint *) -[@entry] -let burn (p : token_id) (storage : nft_token_storage) : return_value = - ([]: operation list), burn (p, storage) - -(* - -{ - ledger = (Big_map.empty: (token_id, address) big_map); - operators = (Big_map.empty: ((address * (address * token_id)), unit) big_map); - reverse_ledger = (Big_map.empty: (address, token_id list) big_map); - metadata = Big_map.literal [ - ("", Bytes.pack("tezos-storage:contents")); - ("contents", ("7b2276657273696f6e223a2276312e302e30222c226e616d65223a2254555473222c22617574686f7273223a5b2240636c617564656261726465225d2c22696e7465726661636573223a5b22545a49502d303132222c22545a49502d303136225d7d": bytes)) - ]; - token_metadata = (Big_map.empty: (token_id, token_metadata) big_map); - next_token_id = 0n; - admin = ("tz1Me1MGhK7taay748h4gPnX2cXvbgL6xsYL": address); -} - -{"version":"v1.0.0","name":"TUTs","authors":["@claudebarde"],"interfaces":["TZIP-012","TZIP-016"]} - - -*) \ No newline at end of file diff --git a/nft-taquito/frontend/index.html b/nft-taquito/frontend/index.html deleted file mode 100644 index 60e29b4..0000000 --- a/nft-taquito/frontend/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - Mint an NFT - - - - - - -
- - - diff --git a/nft-taquito/frontend/package.json b/nft-taquito/frontend/package.json deleted file mode 100644 index a595bba..0000000 --- a/nft-taquito/frontend/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "nft-taquito-pinata-tutorial", - "version": "1.0.0", - "type": "module", - "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^2.0.2", - "@tsconfig/svelte": "^3.0.0", - "svelte": "^3.55.1", - "svelte-check": "^3.0.3", - "svelte-preprocess": "^5.0.1", - "tslib": "^2.5.0", - "typescript": "^4.9.5", - "vite": "^4.1.1" - }, - "scripts": { - "dev": "vite", - "build": "vite build", - "serve": "vite preview", - "check": "svelte-check --tsconfig ./tsconfig.json" - }, - "dependencies": { - "@airgap/beacon-sdk": "^3.3.2", - "@taquito/beacon-wallet": "^15.1.0", - "@taquito/taquito": "^15.1.0", - "@taquito/utils": "^15.1.0", - "file-loader": "^6.2.0", - "sass": "^1.67.0", - "vite-compatible-readable-stream": "^3.6.1" - } -} diff --git a/nft-taquito/frontend/public/Roman-SD.ttf b/nft-taquito/frontend/public/Roman-SD.ttf deleted file mode 100644 index 2a2a0ce..0000000 Binary files a/nft-taquito/frontend/public/Roman-SD.ttf and /dev/null differ diff --git a/nft-taquito/frontend/public/Roman-SD.woff b/nft-taquito/frontend/public/Roman-SD.woff deleted file mode 100644 index 5f45c15..0000000 Binary files a/nft-taquito/frontend/public/Roman-SD.woff and /dev/null differ diff --git a/nft-taquito/frontend/public/images/taquito.png b/nft-taquito/frontend/public/images/taquito.png deleted file mode 100644 index 292cd8d..0000000 Binary files a/nft-taquito/frontend/public/images/taquito.png and /dev/null differ diff --git a/nft-taquito/frontend/src/App.svelte b/nft-taquito/frontend/src/App.svelte deleted file mode 100644 index 23f4894..0000000 --- a/nft-taquito/frontend/src/App.svelte +++ /dev/null @@ -1,299 +0,0 @@ - - - - -
-
-

Create NFTs

- {#if userAddress} -
-
- Your NFTs: - {#if nftStorage} - [ {#each userNfts.reverse() as nft, index} - - {nft.tokenId} - - {#if index < userNfts.length - 1} - - {/if} - {/each} ] - {/if} -
-
- -
- {#if newNft} -
Your NFT has been successfully minted!
- - - -
- -
- {:else} -
-
Select your picture
-
- -
-
- -
-
-