Pastel Network
  • Introduction
    • Pastel Overview
    • Pastel Token (PSL)
    • PSL Token Economics
    • Pastel Consensus Protocol
    • Key Features
  • Basics
    • Smart Ticket Structure
    • Fees and Burn
    • SuperNodes
      • SuperNode Staking
      • SuperNode States & Implications for Stake
      • SuperNode Operator Selection
      • SuperNode Fees
    • Governance
    • Accounts
  • Development Guide
    • Types of Pastel installations
      • Pastel Network Architecture
    • Requirements
      • Default directories
    • QuickStart: Running a Node
    • WalletNode
      • API
        • Sense API
        • Cascade API
        • NFT API
      • GRPC Interface
    • SuperNode
      • GRPC Interface
    • Pasteld Daemon
      • Pasteld CLI Implementation
      • Pasteld JSON-RPC API
    • Pastel-CLI
    • Understanding Smart Tickets
      • NFT Tickets
      • PastelID Tickets
    • Testing
    • Tutorials
      • Pastel Wallet App
    • Public Endpoints & Resources
    • Configurations
  • Sense Protocol
    • Sense Overview
    • Sense Basics
    • Building with Sense API
  • Cascade Protocol
    • Cascade Overview
    • Cascade Basics
    • Building with Cascade API
Powered by GitBook
On this page
  • Register NFTs
  • Search for NFTs
  • Download NFTs

Was this helpful?

Export as PDF
  1. Development Guide
  2. WalletNode
  3. API

NFT API

Register NFTs

Process

  1. Navigate to the "nfts" section of the Swagger API. Find "/nfts/register/upload" and insert your file and give your file a name.

  2. Execute the file upload API call and keep track of the image_id that is returned.

  3. Navigate to "/nfts/register/" and fill in the request body. Make sure to replace the image_id with the image_id from step 2. Spendable_address is your pastel address with enough PSL to execute the transaction. You should make sure to input a maximum reasonable PSL fee into the request body as well. Royalty is a percentage calculation.

  4. Once all the fields are filled out, execute the /nfts/register/ api call and note the task_id that is returned. This time, unlike Sense and Cascade, if your wallet contains enough PSL the requisite amount will be burned for you automatically.

  5. Navigate to the /nfts/register/{taskid}/state API call in Swagger and enter the task_id from step 4.

  6. Execute the state call, refreshing this over time will allow you to see the state of the Supernodes as they process it. When this yields "Task Completed" your art has been processed by the blockchain and your NFT is ready! If you want, you can search for your NFT (detailed in Search for NFTs section)

  7. In case the registration completes (success or failure), you might not get results from /nfts/register/{taskid}/state API call as that is a websocket connection only active till the registration is in process, in that case, you can use /nfts/<<task_id>>/history API call to go through the registration process life-cycle.

Search for NFTs

Process

  1. Navigate to the "nfts" section of the Swagger API. Find "/nfts/search" and filter to your heart's content. Supplying your pastelid and passphrase may allow you to see more information about NFTs you have access to. There are a number of filters this API provides that can be learned by looking at Swagger docs.

  2. If you know the transaction ID of a specific NFT you are searching for, the "/nfts/{txid}" API call will let you get the NFT associated with that transaction. You will need to fill in the request body with your pastelid and passphrase to authenticate.

Download NFTs

Process

  1. Navigate to the "nfts" section of the Swagger API. Find "/nfts/download" and supply the nft's transaction id (txid) and the owner's pastelID. Your NFT will be returned as a base64 encoded archive. You'll also need to set the Authorization key to the passphrase of owner's PastelID.

PreviousCascade APINextGRPC Interface

Last updated 2 years ago

Was this helpful?