Skip to main content

Create NFT with Metadata

To create a NFT with Metadata, you must call mintMetadataNft on dataset(Dataset.NFT). mintMetadataNft takes an object of type MintMetadataNftTangleRequest as parameter. In there you can specify the metadata of the NFT which for example could be used to create a digital twin.

    const link = otr(SoonaverseOtrAddress.TEST)
.dataset(Dataset.NFT)
.mintMetadataNft({
metadata: { prop1: 'prop1', prop2: 'prop2' },
});

mintMetadataNft returns an oject of type OtrRequest<MintMetadataNftTangleRequest>.

OTR Request Deep Link

The SDK provides the helper functions getFireflyDeepLink() and getBloomDeepLink() to generate deep links for OTR requests.

Full How-To Code

import { Dataset } from '@build-5/interfaces';
import { SoonaverseOtrAddress, otr } from '@build-5/sdk';

async function main() {
try {
const link = otr(SoonaverseOtrAddress.TEST)
.dataset(Dataset.NFT)
.mintMetadataNft({
metadata: { prop1: 'prop1', prop2: 'prop2' },
});
console.log(link);
} catch (e) {
console.log(e);
return;
}
}

main().then(() => process.exit());