From 77018b183c1e4e0b82d0665b777b4cd5275e9553 Mon Sep 17 00:00:00 2001 From: javiertc Date: Fri, 20 May 2022 23:36:54 -0400 Subject: [PATCH] remove nft api --- docs/get-started/tangocrypto.md | 381 +------------------------------- 1 file changed, 1 insertion(+), 380 deletions(-) diff --git a/docs/get-started/tangocrypto.md b/docs/get-started/tangocrypto.md index 70a3d3a51a..8cd4e4cfe1 100644 --- a/docs/get-started/tangocrypto.md +++ b/docs/get-started/tangocrypto.md @@ -9,11 +9,10 @@ image: ../img/og-developer-portal.png # What is Tangocrypto? We provide a suite of high availability APIs and developer tools for fast and reliable access to the Cardano network that requires only 1 minute to integrate. As a developer starting on Cardano you will face the following problems: -- There's no way to access the information on a blockchain without using a node. +- There's no way to access the information on a blockchain without using a node or an API provider. - You will have to start creating the infrastructure instead of focusing on your products and business. - In-house infrastructure doesn’t scale automatically when user demand increases. - There is a high learning curve, a broader error surface and increase in cost when building integrations with several API services from multiple providers. -- There is not a single platform with all the tools most businesses need, leading to multiple platform hiring and cost increase. We provide an unified platform where you'll be able to: - Ship products faster and validate business ideas. @@ -24,7 +23,6 @@ We provide an unified platform where you'll be able to: Our solution provides the following components: - REST API - Notify (Webhooks) -- NFT API 💻 You can create a **free** account now at https://dashboard.tangocrypto.com/register and start coding your next product. @@ -533,380 +531,3 @@ Rules can be created also from the dashboard: #### MORE INFO https://docs.tangocrypto.com/notify/notify/using-webhooks - -## NFT API -The NFT API allows you to: -- Launch an NFT collection in minutes. -- Let user mint their tokens based on pre-defined conditions. -- Scale to thousands of users. -- Payments with dApp connector (CIP30 wallet integration). - -![alt text](../../static/img/get-started/tangocrypto/nftstudio.png) - -### 1 - Create an NFT collection -The first step is to create a collection using the following parameters. -Parameters - -- **`name`**: (Mandatory) Collection name. The collection name is internal to your Tangocrypto account. This is just a way to identify different collections. -- **`description`**: (Optional) Collection description. The collection description is internal to your Tangocrypto account. -- **`url`**: (Optional) URL of the website where the collection is going to be sold. -- **`payout_address`**:(Mandatory) Wallet address that is going to receive the payments of the NFT sale. This should be the wallet address of the seller. -- **`policy`**: (Mandatory) Policy configuration for every NFT in the collection. When you create a new collection we do several steps in the background; we create a new key pair (public verification key/private signing key), a policy script and the policy id. Then during the sale process, all the tokens are minted with the same policy script and the policy id is attached permanently to the NFT. - - **`lock`**: (Mandatory) true | false Defines if the policy will be locked or not. If you select falsethen you are not required to choose a date and time to lock the policy, therefore the policy will be open and you can be minting NFTs under this policy forever. If you set this parameter to true then you have to specify a locktime date. - - **`lock_time`**: (Optional) Locktime date in ISO 8601 format `yyyy-mm-ddThh:mm:ss[.mmm]`. It defines how long you'll be able to mint NFTs for the collection. The policy will lock after that date, and you won't be able to mint more NFTs using the same policy id (even if you use the same key). Hours and minutes are optional; if you set it to2022-02-24, it will automatically fill it with 0s, for example, 2022-02-24T00:00:00.000Z. - Take into consideration the desirability and size of your collection before setting this date and leave enough time for selling the NFTs. There is no limited time for the future. -- **`reservation_time`**: (Optional) Reservation time in seconds. This timer defines how long an NFT will be reserved once a potential buyer starts the buying process. During this time interval, the NFT won't be available for sale. No other buyer will be able to create a new reservation. If the payment is not received and this timer expires, then the NFT is ready for sale again, and it can be reserved by another buyer. -- **`metadata`**: (Mandatory) Metadata tag for the collection. The values between < > mean that they are tags. A tag is simply a variable that we will assign its value when you mint the NFT. You can use the metadata tag to define common attributes shared by all the NFTs in the collection, like the name, copyright, date issued, artist name, social media links, etc. You can override all the attributes while creating the individual NFTs. -- **`asset_name`**: (Mandatory) Metadata tag for the NFT asset name. -- **`name`**: (Mandatory) Metadata tag for the NFT name. -- **`description`**: (Optional) Metadata tag for the NFT description. -- **`media_type`**: (Optional) Metadata tag for the media type. -- **`files`**: (Optional) array of files used for files. This is used when you want to create an NFT with different file formats. For example, you can create several audio files and add them to the metadata. -- **`media_type`**: (Optional) same as the previous description. -- **`name`**: (Optional) Asset name of the file -- **`src`**: `` (Optional) Tag to reference on token overrides. We expect a base64 string to be hosted on IPFS. -- **`attributes`**: (Optional) Custom attributes or traits for an NFT. You can create 2 types of attributes, fixed or variables. - - **`variables`**: Here you define a tag, which means that we'll replace this tag with a value you'll have to provide during the NFT creation step. As you can see in the example below, we defined five traits (colour, body, eyes, face, and accessories), but we don't specify the value, just a tag between the angle brackets `<>`. - - **`fixed`**: We include these attributes in the metadata of every NFT minted in the collection with a fixed value. You can add attributes like artist name, Twitter, Discord, copyright etc. You define their value here, and then you don't have to submit them during the NFT creation step. - -![alt text](../../static/img/get-started/tangocrypto/attributes.png) - -Create collection example - -```bash -curl --location --request POST 'https://cardano-testnet.tangocrypto.com//v1/nft/collections' \ ---header 'x-api-key: ' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "name": "Tango Collection", - "description": "Tango collection description", - "url": "https://www.tangocrypto.com", - "payout_address": "addr_test1qp9mj7vnenx4v99hw7ztfq03n7dmmujpgtlyfjhhel9w67nk72usllcew208n60ym94xcptfrgytuy5apwp565x28jgsg0ztq3", - "policy": { - "lock": true, - "lock_time": "2022-02-24" - }, - "metadata": { - "asset_name": "", - "name": "", - "media_type": "", - "description": "", - "files": [ - { - "name": "", - "media_type": "", - "src": "" - } - ], - "attributes": { - "color": "", - "body": "", - "eyes": "", - "face": "", - "accessory": "", - "collection": "Tangocrypto Collection", - "artist": "Tangocrypto", - "twitter": "https://twitter.com/tango_crypto", - "copyright": "Tangocrypto 2021" - }, - "version": "1.0" - } -}' -``` - -This endpoint returns the policy id. You should post the policy id in your website, social media or any communication channel, you use for buyers to verify the authenticity of the tokens they buy. - -```json -{ - "id": "e1d7fe1d97c64518a5c51011edcc1a31", - "name": "Tango Collection", - "url": "https://www.tangocrypto.com", - "description": "Tango collection description", - "payout_address": "addr_test1qpp33lzjgyzz6k86yy27kvkjepu8mfjy6g4l8rf2v8yjp4sla7h6txtvlevazp6jylz0w90y8yz0uec3cder28r47sssj9w2kd", - "policy": { - "lock": true, - "lock_time": "2022-02-24T00:00:00.000Z", - "policy_id": "6a16d7d312dfcbcb4f676fa31893cf6c456508d84472309f3aa7c998", - "script": { - "type": "all", - "scripts": [ - { - "type": "sig", - "keyHash": "76bcc8cf947649636f027e705a30ec66fa0476971aef51d219323c07" - }, - { - "type": "before", - "slot": 54094491 - } - ] - } - }, - "metadata": { - "label": "721", - "asset_name": "", - "name": "", - "media_type": "", - "description": "", - "files": [ - { - "name": "", - "media_type": "", - "src": "" - } - ], - "attributes": { - "color": "", - "body": "", - "eyes": "", - "face": "", - "accessory": "", - "collection": "Tangocrypto Collection", - "artist": "Tangocrypto", - "twitter": "https://twitter.com/tango_crypto", - "copyright": "Tangocrypto 2021" - }, - "version": "1.0" - }, - "created_at": "2022-02-23T08:21:38.908Z", - "updated_at": "2022-02-23T08:21:38.908Z" -} -``` - -### 2 - Create NFT -The next step is to create the NFTs for the collection. Use the following endpoint with the collection-id returned in step 1 as part of the path. -```bash -POST https://cardano-testnet.tangocrypto.com//v1/nft/collections//tokens -``` - -**Parameters** -- **`name`**: (Mandatory) Display name. Between 2 and 32 characters (maximum 64 bytes for UTF-8 encoded). -- **`asset_name`**: (Mandatory) Take into consideration is the name is case sensitive and is between 2 and 32 characters (maximum 64 bytes for UTF-8 encoded). -- **`description`**: (Optional) Token description. Between 2 and 32 characters (maximum 64 bytes for UTF-8 encoded). -- **`media_type`**: (Optional) Media type. It is common to have NFTs with MIME-type imag, audioand video. For example: -- - image/gif: Graphics Interchange Format (GIF). -- - image/jpeg: Joint Photographic Expert Group image (JPEG). -- - image/png: Portable Network Graphics (PNG). -- - audio/wav: Waveform audio file format (WAV). -- - video/mp4: MPEG-4 Part 14 (MP4). -- **image**: (Mandatory) base64 encoded image or already pinned image in IPFS. For example, ipfs://QmP4sEnaYa1fhLTFVTUq5E8d8XvEtxBS7NE5M3TACUtSxh or through an IPFS gateway https://ipfs.io/ipfs/QmP4sEnaYa1fhLTFVTUq5E8d8XvEtxBS7NE5M3TACUtSxh. -- **`metadata_attributes`**: You have to specify the values for the placeholder attributes for every token as defined in the collection attribute placeholder definition in Step 1. Please take into consideration that we have to define these values for every single NFT in the collection. For example, we set the colour, body, eyes, face and mime type for that particular NFT. -- - tag: Use the tag to match the placeholder defined in the collection. -- - value: Use the value to set a value for the placeholder tag. -- **`custom_attributes`**: Here you can set any arbitrary attributes that you didn't include in the collection attributes placeholder definition. Use key-value pairs to define unique attributes for each NFT. - -**Example** - -```bash -curl --location --request POST 'https://cardano-testnet.tangocrypto.com//v1/nft/tokens' \ ---header 'x-api-key: ' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "tokens": [{ - "name": "Text with spaces 01", - "asset_name": "TextWithoutSpaces01", - "description": "This is the description", - "media_type": "image/png", - "image": "iVBORw0KGgoAAAANSU.....hEUgAADQYAAA0HCAYAAACB0xAqAAAACXBIWXMA", - "metadata_attributes": [{ - "tag": "", - "value": "Red" - }, - { - "tag": "", - "value": "Skinny" - }, - { - "tag": "", - "value": "Blue" - }, - { - "tag": "", - "value": "Pen" - }, - { - "tag": "", - "value": "Rounded" - } - ], - "custom_attributes": { - "location": "city", - "hat": "baseball" - } - }] -}' -``` - -Response - -```json - -{ - "data": [{ - "id": "59aacd9bab9746f9a2f9f334b2f20c70", - "collection":{ - "id": "9c024f811654433b97f3b2719f00f604", - "name": "Tango collection description", - "description": "Collection description" - }, - "policy": { - "lock": true, - "lock_time": "2021-10-20T21:53:10Z", - "policy_id": "ebe10abbfc5ff382bf8eb7ed44bb8f3632828659ebba917bb8c3ccb6", - "script": { - "type": "all", - "scripts": [{ - "type": "sig", - "keyHash": "a65cef161eef7a3848f07c1a127f501b961194938478e92988813961" - }, - { - "type": "before", - "slot": "46854873" - } - ] - } - }, - "metadata": { - "721": { - "ebe10abbfc5ff382bf8eb7ed44bb8f3632828659ebba917bb8c3ccb6": { - "TheTokenName01": { - "name": "The Long Token Name 01", - "image": "ipfs://QmY9gydScXwQA4wzhFo1vqVpDkgi7sP4gH5TFmz8GYPF98", - "mediaType": "image/png", - "description": "Token description 3", - "face": "rounded", - "twitter": "https://twitter.com/tango_crypto", - "copyright": "Tangocrypto 2021", - "color": "Blue", - "artist": "Tangocrypto", - "collection": "Tangocrypto Collection", - "body": "fat", - "eyes": "green", - "accessory": "Hat" - } - }, - "version": "1.0" - } - }, - "created_at": "2021-10-20T21:53:10Z", - "updated_at": "2020-06-18T17:45:13Z" - }] -} -``` - -### 3 - Sell NFTs -The next step is to sell NFTs in the collection. Use the following endpoint with the collection-id returned in step 1 as part of the path and the token id from step 2. - -```bash -POST https://cardano-testnet.tangocrypto.com//v1/nft/collections//sales -``` - -- **`type`**: fixed | random. (Mandatory) Use fixed for selling a particular token or token list identified by the token-id. Use random for random sales, it will pick random tokens from the collection. -- **`price`**: (Mandatory) Individual token price in Lovelaces (1 ADA = 1000000 Lovelaces). -- **`reservation_time`**: (Optional) Reservation time in seconds. This timer defines how long an NFT will be reserved once a potential buyer starts the buying process. During this time interval, the NFT won't be available for sale. No other buyer will be able to create a new reservation. If the payment is not received and this timer expires, then the NFT is ready for sale again, and it can be reserved by another buyer. -- **`tokens`**: (Options) Array of token IDs returned in step 2. Used in fixed sell. - -The sale can have different states: -- `RESERVED`: The NFT is reserved and we are waiting for payment. -- `EXPIRED`: No payment was received and the reservation time expired. In order to add this token for sale again, you need to create another reservation calling the same endpoint. -- `COMPLETED`: Payment is received and the NFT was minted and sent to the buyer. - -:::important -Every time you call this endpoint you'll get a new sale and thus a new payment address. -::: - -**Example** - -```bash -curl --location --request POST 'https://cardano-testnet.tangocrypto.com//v1/nft/collections/61919f96e7020f542f502510/sales' \ ---header 'x-api-key: ' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "type": "fixed", - "price": 6000000, - "reservation_time": 300, - "tokens": ["6189bd6e73c4ab1a0c08eee1"] -}' -``` -Result -The result contains the sale `id` and the `address` for the payment. Every time you generate a sale you'll get a new sale id and address. - -```bash -{ - "data": [{ - "id": "7b4308a174e942e78ea0f2cbddd4d454", - "status": "RESERVED", - "type": "random", - "price": 6000000, - "supply": 1, - "payment_address": "addr_test1vpsxhfduzqr3s0x2v5fwqs229yx5ur7hmnds94jc3p0ru8s30nfyt", - "reserved_time": 300000, - "tangocrypto_fee": 2000000, - "tokens": [{ - "id": "a1eadb3e553d41b89a01fccf53919ded", - "asset_name": "XRNFT0000002", - "metadata": { - "721": { - "18ed282beda4bec13226c427d4744d2642ba2cef404470b62ae184d8": { - "XRNFT0000002": { - "image": "ipfs://QmY9gydScXwQA4wzhFo1vqVpDkgi7sP4gH5TFmz8GYPF98", - "copyright": "Tangocrypto 2021", - "color": "Blue", - "artist": "Tangocrypto", - "description": "Description for XR NFT 0000002", - "mediaType": "png", - "collection": "Tangocrypto Collection", - "body": "Rounded", - "eyes": "", - "face": "", - "twitter": "https://twitter.com/tango_crypto", - "name": "XR NFT 0000002", - "files": [ - { - "name": "nft-file", - "src": "ipfs://laksdjklasjdklasjdlaksjdlasdlsad", - "mediaType": "png" - } - ], - "accessory": "None", - "pepe": "grillo", - "rarity": "1" - } - }, - "version": "1.0" - } - } - }], - "collection": { - "id": "489b4acd87d841b581206991dd295362", - "name": "Sale Phase Collection", - "url": "https://www.tangocrypto.com", - "description": "Sale Phase collection description", - "reservation_time": 300, - "token_count": 9, - "token_for_sale_count": 4, - "token_sold_count": 3, - "revenue": 32000000, - "service_fee": 6000000, - "nft_fee": 4137840, - "tx_fee": 625995 - }, - "confirmations": 0, - "created_at": "2022-05-18T04:15:25.076Z", - "updated_at": "2022-05-18T04:15:25.076Z" - }] -} -``` - -#### Random sale example -The following endpoint will pick one random token from the collection and generate a sale. - -```bash -curl --location --request POST 'https://cardano-testnet.tangocrypto.com//v1/nft/collections/61844bfbb75c4782085f01fd/sales' \ ---header 'x-api-key: ' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "type": "random", - "price": 6000000, - "reservation_time": 300 -}' -``` \ No newline at end of file