How to Upload NFTs to DID Spaces Using the SDK
DID Spaces
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#
- Mounting NFT Blender as a component, related information
Of course, mounting NFT Maker also works: NFT Maker mounts NFT Blender - 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
APP_SPACE_ENDPOINT=https://<your-did-spaces-endpoint>
- In Top-Level Applications Mapping to the NFT Blender SDK
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 ----------------- - Complete the logic of the top-level application and trigger the code to upload the NFT to DID Spaces
- You can check if the upload was successful by going to DID Spaces
Parameter Description#
Parameter Name | Required | Default / Enum | Tips |
---|---|---|---|
fileName | ✅ | undefined | NFT display filename |
filePath | ✅ | undefined | NFT filepath |
assetId | ✅ | undefined | NFT address |