SPG 함수
0) Prerequisites
1) 민팅 + 등록 + 약관 첨부하기
import { PIL_TYPE } from '@story-protocol/core-sdk';
import { toHex, Address } from 'viem';
const newCollection = await client.nftClient.createNFTCollection({
name: 'Test NFT',
symbol: 'TEST',
txOptions: { waitForTransaction: true }
});
const response = await client.ipAsset.mintAndRegisterIpAssetWithPilTerms({
// an NFT contract address created by the SPG
nftContract: newCollection.nftContract as Address,
pilType: PIL_TYPE.NON_COMMERCIAL_REMIX,
// https://docs.story.foundation/docs/ipa-metadata-standard
ipMetadata: {
ipMetadataURI: 'test-uri',
ipMetadataHash: toHex('test-metadata-hash', { size: 32 }),
nftMetadataHash: toHex('test-nft-metadata-hash', { size: 32 }),
nftMetadataURI: 'test-nft-uri',
},
txOptions: { waitForTransaction: true }
});
console.log(`Completed at transaction hash ${response.txHash}, NFT Token ID: ${response.tokenId}, IPA ID: ${response.ipId}, License Terms ID: ${response.licenseTermsId}`);2) 등록 + 약관 첨부하기
3) 등록 + Derivative
4) 민팅 + 등록 + Derivative
Last updated