Skip to content

Commit

Permalink
NFTMania (Independent Publisher) (microsoft#1948)
Browse files Browse the repository at this point in the history
* Proposal - NFTMania (Independent Publisher)

* Committed files for Connector

* trial

* trials2

* Adding new connector files

* Updated the files with required changes

* Updated new apiDefinition file

* Updated Apidefinition with changed response body

* Response body changed to fixc errors

* Updates the error code 422

* Updated with x-ms and description

* Updated body and response

* Updated metadata

* Fixed Category error

* Added x-ms-summary and description

* Updated the summary to a different section

* Updated to previous version

* added x-ms-summary and description in parameters

* Deleting nftmania.md

This file is being removed as per the requested changes
  • Loading branch information
shreyan1999 authored and lindarecfut committed Feb 14, 2023
1 parent 62b93e8 commit 57a0175
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 0 deletions.
215 changes: 215 additions & 0 deletions independent-publisher-connectors/NFTMania/apiDefinition.swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{
"swagger": "2.0",
"info": {
"title": "MintNFT",
"description": "NFT Mania provides you with an Ultimate NFT experience and lets you develop applications in no time!",
"version": "1.0",
"contact": {
"name": "Shreyan J D Fernandes",
"url": "https://www.linkedin.com/in/shreyan-j-d-fernandes-227789147/",
"email": "shreyan.fernandes@gmail.com"
}

},
"host": "api.nftport.xyz",
"basePath": "/",
"schemes": [
"https"
],
"consumes": [],
"produces": [],
"paths": {
"/v0/mints/easy/urls": {
"post": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"response": {
"type": "string",
"description": "Response status, either OK or NOK.",
"title": "response",
"x-ms-visibility": "important"
},
"chain": {
"type": "string",
"description": "Polygon,goerli",
"title": "chain",
"x-ms-visibility": "important"
},
"contract_address": {
"type": "string",
"description": "The contract address where the NFT was minted.",
"title": "contract_address",
"x-ms-visibility": "important"
},
"transaction_hash": {
"type": "string",
"description": "The transaction hash which is returned by the blockchain after minting.",
"title": "transaction_hash",
"x-ms-visibility": "important"
},
"transaction_external_url": {
"type": "string",
"description": "Transaction URL in an external blockchain explorer.",
"title": "transaction_external_url",
"x-ms-visibility": "important"
},
"mint_to_address": {
"type": "string",
"description": "Account address where the NFT was sent.",
"title": "mint_to_address",
"x-ms-visibility": "important"
},
"name": {
"type": "string",
"description": "Name of the NFT.",
"title": "name"
},
"description": {
"type": "string",
"description": "Description of the NFT.",
"title": "description"
}
}
}
},
"402": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"response": {
"type": "string",
"description": "Response status either OK or NOK.",
"title": "response"
},
"error": {
"type": "object",
"properties": {
"status_code": {
"type": "integer",
"format": "int32",
"description": "HTTP response status code.",
"title": "status_code",
"x-ms-visibility": "important"
},
"code": {
"type": "string",
"description": "Machine readable code describing the error.",
"title": "code",
"x-ms-visibility": "important"
},
"message": {
"type": "string",
"description": "Detailed description of the error.",
"title": "message",
"x-ms-visibility": "important"
}
},
"description": "error"
}
}
}
}
},
"summary": "Mint NFT",
"description": "Mints NFT using the image URL",
"operationId": "Authorization",
"parameters": [
{
"name": "API",
"in": "header",
"required": true,
"type": "string",
"x-ms-visibility": "important",
"x-ms-summary":"Mint NFT",
"description": "Mints NFT using the image URL"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"chain": {
"type": "string",
"description": "Blockchain to mint the NFT on.",
"title": "chain",
"x-ms-visibility": "important",
"enum": [
"Polygon",
"Goerli"
]
},
"name": {
"type": "string",
"description": "Name of the NFT.",
"title": "name",
"x-ms-visibility": "important"
},
"description": {
"type": "string",
"description": "Text description of the NFT which will be seen on NFT marketplaces, etc.",
"title": "description",
"x-ms-visibility": "important"
},
"file_url": {
"type": "string",
"description": "URL that points to the image/video or any other file format as long as it returns a Content-Length and Content-Type header or contains the file extension. HTML files are not supported.",
"title": "file_url",
"x-ms-visibility": "important"
},
"mint_to_address": {
"type": "string",
"description": "Account address where the NFT will be sent. For example, your Metamask wallet address if you wish to send it to yourself.",
"title": "mint_to_address",
"x-ms-visibility": "important"
}
},
"x-ms-visibility": "important",
"required": [
"chain",
"description",
"file_url",
"mint_to_address",
"name"
]
},
"x-ms-visibility": "important"
}
],
"x-ms-visibility": "important"
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
},
"security": [],
"tags": [],
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://www.nftport.xyz/"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://www.nftport.xyz/privacy-policy"
},
{
"propertyName": "Categories",
"propertyValue": "Data"
}
]
}
23 changes: 23 additions & 0 deletions independent-publisher-connectors/NFTMania/apiProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"properties": {
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"displayName": "API Key",
"description": "The API Key for this api",
"tooltip": "Provide your API Key",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"iconBrandColor": "#da3b01",
"capabilities": [],
"publisher": "Shreyan J D Fernandes",
"stackOwner": "nftport.xyz"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions independent-publisher-connectors/NFTMania/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# NFTMania
This is a proposed connector for _Microsoft Power Platform_. Blockchain is s tech space which is gaining its prominence and is expected to be a key player in the upcoming web 3.0, besides this is provides various features for the security of any digital asset. NFT is one such branch based on blockchain which is being used by many to store the collectibles like art or any piece of data digitally. The NFTs are Non Fungible in nature so the owner holds the right for any collectible. It cant be manipulated as the transaction data will be stored on Blockchain. Developing the NFT is often overlooked as a tedious task due to the coding involved. It takes a long time to get ideas to life due to this. The main purpose of this connector is to help developers bring their NFT applications to market in hours instead of months. This is possible with the help of Microsoft Power Platform.This connector uses NFTPort APIs.

## Publisher: Shreyan J D Fernandes
My name is Shreyan J D Fernandes. I am a Gold Microsoft Learn Student Ambassador​ from India. I have a keen interest in Blockchain which is something that motivated me to plan this connector.I love to teach and explore new tech.

## Prerequisites
The connector uses the APIs from [_NFTPort_ ](https://www.nftport.xyz/)to run the backend services. This Connector requires an _API Key_ from [_NFTPort_ ](https://www.nftport.xyz/). Once a user has signed up on NFTPort platform, they can access the API key from their NFTPort Dashboard.
Apart from this a [_Polygon_](https://wallet.polygon.technology/)Wallet ID must be obtained from the website. this helps the user to mint the NFT to their personal wallet.

## Supported Operations
As of now the connector is capable of minting an Image into Non Fungible Token. The image must be hosted in any cloud storage and the URL must be provided.​

### Minting NFT with URL
The connector allows the user to choose any specific chain that they want the NFT to be deployed in. I have tried it out on Polygon Chain and it has been working fine for some NFTs that i minted for the purpose of testing.
Some details that must be filled for the API to run successfully include:
Chain:<Chain in which the user wants to publish the NFT>
Name:<The name of the particular NFT>
Description:<Description and details of the NFT being minted>
file_url:<Publicly viewable image of the Collectible to be minted as NFT. The link must be set to download and not to sharing mode>
mint_to_address:<This is the wallet address to which the Collectible will be minted as NFT>
Upon successful run. A success response of 200 will be displayed along with a message body in which the transaction hash and other details will be provided.

Response example: (Deployed on Polygon Chain)
{
"response": "OK",
"chain": "polygon",
"contract_address": "0x47c7ff137d7a6644a9a96f1d44f5a6f857d9023f",
"transaction_hash": "0x6eb71286f4875bf48be7834c1ff285910583705714f5a5acff67489f94e14954",
"transaction_external_url": "https://polygonscan.com/tx/0x6eb71286f4875bf48be7834c1ff285910583705714f5a5acff67489f94e14954",
"mint_to_address": "0x5FDd0881Ef284D6fBB2Ed97b01cb13d707f91e42",
"name": "TestMinting",
"description": "One-Stop & Simple NFT Infrastructure & APIs for Developers"
}


## Obtaining Credentials
To obtain the API Key, one must navigate to [_NFTPort_ ](https://www.nftport.xyz/) and Sign Up providing details like Email id and create a new password. Upon signing up and confirming the mail, One can see the dashboard. This dashboard has an option of API Key. This API key must be used to create a connection and also must be provided in the header section while minting the NFT from Power Platform.

## Getting Started
In order to use this connector, The required Image file must be hosted on the cloud and the public link must be used in the "file_url" section. Incase of Polygon blockchain, the Polygon wallet ID must be used in the "mint_to_address" section.

## Known Issues and Limitations
Incase the image being hosted on the google drive, then the URL must be altered to download. The original URL obtained will be in sharing mode. It must be changed to download.This link must be set to _"Anyone with the link can view"_
The obtained link will be in the below format:
https://drive.google.com/file/d/1x2x34xx....../view?usp=sharing
Remove the text file/d/ from the link and replace it with uc?id=

Now remove the section after the file ID, including /view and replace it with &export=download in place of the text you have removed.

This is what it should look like afterwards: https://drive.google.com/uc?id=1x2x34xx.......&export=download

0 comments on commit 57a0175

Please sign in to comment.