IP Asset

IPAssetClient allows you to create, get, and list IP Assets with Story Protocol.

IPAssetClient

Methods

  • register
  • registerDerivative
  • registerDerivativeWithLicenseTokens
  • mintAndRegisterIpAssetWithPilTerms
  • registerIpAndAttachPilTerms
  • registerDerivativeIp

register

Registers an NFT as IP, creating a corresponding IP record.

MethodType
register(request: RegisterRequest) => Promise<RegisterIpResponse>

Parameters:

  • request: The request object that contains all data needed to register IP.
  • request.nftContract: The address of the NFT.
  • request.tokenId: The token identifier of the NFT.
  • request.metadata: [Optional] The metadata for the IP.
    • request.metadata.metadataURI: [Optional] The URI of the metadata for the IP.
    • request.metadata.metadataHash: [Optional] The metadata for the IP.
    • request.metadata.nftMetadataHash: [Optional] The metadata for the IP NFT.
  • request.deadline: [Optional]The deadline for the signature in milliseconds.
  • request.txOptions: [Optional] The transaction options.

Returns:

  • response.txHash: The transaction hash. If the IP is already registered, this will return as undefined.
  • response.ipId: The ipId of the newly registered IP Asset. If the IP is already registered, this will return the existing ipId.

registerDerivative

Registers an IP Asset as a derivative of another IP Asset without needing License Tokens.

The License Terms must be attached to the parent IP before calling this function. Remember that all IPAs have default license terms attached by default.

The derivative IP owner must be the caller or an authorized operator.

MethodType
registerDerivative(request: RegisterDerivativeRequest) => Promise<RegisterDerivativeResponse>

Parameters:

  • request: The request object that contains all data needed to register derivative IP.
  • request.childIpId: The derivative IP ID.
  • request.parentIpIds: The parent IP IDs.
  • request.licenseTermsIds: The IDs of the license terms that the parent IP supports.
  • request.txOptions: [Optional] The transaction options.

registerDerivativeWithLicenseTokens

Uses a pre-minted License Token to register an IP Asset as a derivative of another IP Asset. The derivative IPA will inherit the License Terms in the License Token.

The derivative IP owner must be the caller or an authorized operator.

MethodType
registerDerivativeWithLicenseTokens(request: RegisterDerivativeWithLicenseTokensRequest) => Promise<RegisterDerivativeWithLicenseTokensResponse>

Parameters:

  • request: The request object that contains all data needed to register derivative license tokens.
  • request.childIpId: The derivative IP ID.
  • request.licenseTokenIds: The IDs of the license tokens.
  • request.txOptions: [Optional] The transaction options.

mintAndRegisterIpAssetWithPilTerms

Mint an NFT from a collection, register it as an IP, attach metadata to the IP, and attach License Terms to the IP all in one function.

πŸ“˜

SPG Function

This is a function provided by the SPG, which combines multiple transactions into one.

MethodType
mintAndRegisterIpAssetWithPilTerms(request: CreateIpAssetWithPilTermsRequest) => Promise<CreateIpAssetWithPilTermsResponse>

Parameters:

  • request: The request object that contains all data needed to mint and register ip.
  • request.nftContract: The address of the NFT collection.
  • request.pilType: The type of the PIL.
  • request.metadata: [Optional] The metadata for the IP.
    • request.metadata.metadataURI: [Optional] The URI of the metadata for the IP.
    • request.metadata.metadataHash: [Optional] The metadata for the IP.
    • request.metadata.nftMetadataHash: [Optional] The metadata for the IP NFT.
  • request.recipient: [Optional] The address of the recipient of the minted NFT.
  • request.mintingFee: [Optional] The fee to be paid when minting a license.
  • request.commercialRevShare: [Optional] Percentage of revenue that must be shared with the licensor.
  • request.currency: [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
  • request.txOptions: [Optional] The transaction options.

registerIpAndAttachPilTerms

Register a given NFT as an IP, attach metadata to the IP, and attach License Terms to the IP all in one function.

πŸ“˜

SPG Function

This is a function provided by the SPG, which combines multiple transactions into one.

MethodType
registerIpAndAttachPilTerms(request: RegisterIpAndAttachPilTermsRequest) => Promise<RegisterIpAndAttachPilTermsResponse>

Parameters:

  • request: The request object that contains all data needed to mint and register ip.
  • request.nftContract: The address of the NFT collection.
  • request.tokenId: The ID of the NFT.
  • request.pilType: The type of the PIL.
  • request.metadata: [Optional] The metadata for the IP.
    • request.metadata.metadataURI: [Optional] The URI of the metadata for the IP.
    • request.metadata.metadataHash: [Optional] The metadata for the IP.
    • request.metadata.nftMetadataHash: [Optional] The metadata for the IP NFT.
  • request.deadline: [Optional]The deadline for the signature in milliseconds.
  • request.mintingFee: [Optional] The fee to be paid when minting a license.
  • request.commercialRevShare: [Optional] Percentage of revenue that must be shared with the licensor.
  • request.currency: [Optional] The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.
  • request.txOptions: [Optional] The transaction options.

registerDerivativeIp

Register an NFT as IP and then link it as a derivative of another IP Asset.

πŸ“˜

SPG Function

This is a function provided by the SPG, which combines multiple transactions into one.

MethodType
registerDerivativeIp(request: RegisterIpAndMakeDerivativeRequest) => Promise<RegisterIpAndMakeDerivativeResponse>

Parameters:

  • request: The request object that contains all data needed to mint and register ip.
  • request.nftContract: The address of the NFT collection.
  • request.tokenId: The ID of the NFT.
  • request.derivData: The derivative data to be used for registerDerivative.
    • request.derivData.parentIpIds: The IDs of the parent IPs to link the registered derivative IP.
    • request.derivData.licenseTermsIds: The IDs of the license terms to be used for the linking.
    • request.derivData.licenseTemplate: [Optional] The address of the license template to be used for the linking.
  • request.metadata: [Optional] The metadata for the IP.
    • request.metadata.metadataURI: [Optional] The URI of the metadata for the IP.
    • request.metadata.metadataHash: [Optional] The metadata for the IP.
    • request.metadata.nftMetadataHash: [Optional] The metadata for the IP NFT.
  • request.deadline: [Optional]The deadline for the signature in milliseconds.
  • request.txOptions: [Optional] The transaction options.