Skip to main content

How to Upload NFTs to DID Spaces Using the SDK

Overview

Overview

If you need to develop NFT Studio and want to upload NFT customizations to DID Spaces, you can call NFT Blender via the SDK.

Here's how to use /api/sdk/upload-to-did-spaces

How To Use

  1. Mounting NFT Blender as a component, related information Of course, mounting NFT Maker also works: NFT Maker mounts NFT Blender
  2. For local development of top-level applications, you may need to fill in the Endpoint for DID Spaces, which can be added in the .env.development file javascript APP_SPACE_ENDPOINT=https://<your-did-spaces-endpoint>
  3. In Top-Level Applications Mapping to the NFT Blender SDK javascript const component = require('@blocklet/sdk/lib/component'); // ----------------- NFT Blender SDK ----------------- const { data } = await component.call({ name: 'nft-blender', path: '/api/sdk/upload-to-did-spaces', data: { fileName: '', // NFT Filename filePath: '', // NFT Filepath assetId: '', // NFT Address }, }); // ----------------- NFT Blender SDK -----------------
  4. Complete the logic of the top-level application and trigger the code to upload the NFT to DID Spaces
  5. You can check if the upload was successful by going to DID Spaces

Parameter Description

Parameter NameRequiredDefault / EnumTips
fileNameundefinedNFT display filename
filePathundefinedNFT filepath
assetIdundefinedNFT address