License
LicenseClient allows you to manage license terms and tokens within Story.
LicenseClient
Methods
- attachLicenseTerms
- mintLicenseTokens
- registerPILTerms
- registerNonComSocialRemixingPIL
- registerCommercialUsePIL
- registerCommercialRemixPIL
- getLicenseTerms
attachLicenseTerms
Attaches license terms to an IP.
Method | Type |
---|---|
attachLicenseTerms | (request: AttachLicenseTermsRequest) => AttachLicenseTermsResponse |
Parameters:
request.ipId
: The address of the IP to which the license terms are attached.request.licenseTemplate
: The address of the license template.request.licenseTermsId
: The ID of the license terms.request.txOptions
: [Optional] The transaction options.
mintLicenseTokens
Mints License Tokens that give permission to use the IP Asset based on License Terms. The license tokens are minted to the receiver
.
Note that a license token can only be minted if the licenseTermsId
are already attached to the IP Asset, making it a publicly available license. The IP owner can, however, mint a private license by minting a license token with a licenseTermsId
that is not attached to the IP Asset.
It might require the caller pay a minting fee, depending on the license terms or configured by the IP owner. The minting fee is paid in the minting fee token specified in the license terms or configured by the IP owner. IP owners can configure the minting fee of their IPs or configure the minting fee module to determine the minting fee.
Method | Type |
---|---|
mintLicenseTokens | (request: MintLicenseTokensRequest) => Promise<MintLicenseTokensResponse> |
Parameters:
request.licensorIpId
: The licensor IP ID.request.licenseTermsId
: The ID of the license terms within the license template.request.maxMintingFee
: The maximum minting fee to be paid when minting a license.request.maxRevenueShare
: The maximum revenue share to be paid when minting a license.request.amount
: [Optional] The amount of license tokens to mint.request.receiver
: [Optional] The address of the receiver.request.licenseTemplate
: [Optional] The address of the license template.request.txOptions
: [Optional] The transaction options.
registerPILTerms
Registers new license terms and return the ID of the newly registered license terms.
Method | Type |
---|---|
registerPILTerms | (request: RegisterPILTermsRequest) => Promise<RegisterPILResponse> |
Parameters:
- Expected Parameters: Instead of listing all of the expected parameters here, please see
LicenseTerms
type in this file. They all come from the PIL Terms. request.txOptions
: [Optional] The transaction options.
registerNonComSocialRemixingPIL
Convenient function to register a PIL non commercial social remix license to the registry.
No reason to call this function. Non-Commercial Social Remixing terms are already registered with licenseTermdId = 1
in our protocol. There’s no reason to register them again.
Method | Type |
---|---|
registerNonComSocialRemixingPIL | (request?: RegisterNonComSocialRemixingPILRequest) => Promise<RegisterPILResponse> |
Parameters:
request.txOptions
: [Optional] The transaction options.
registerCommercialUsePIL
Convenient function to register a PIL commercial use license to the registry.
Method | Type |
---|---|
registerCommercialUsePIL | (request: RegisterCommercialUsePILRequest) => Promise<RegisterPILResponse> |
Parameters:
request.defaultMintingFee
: The fee to be paid when minting a license.request.currency
: The ERC20 token to be used to pay the minting fee and the token must be registered on Story’s protocol.request.royaltyPolicyAddress
: [Optional] The address of the royalty policy contract, default value is LAP.request.txOptions
: [Optional] The transaction options.
registerCommercialRemixPIL
Convenient function to register a PIL commercial Remix license to the registry.
Method | Type |
---|---|
registerCommercialRemixPIL | (request: RegisterCommercialRemixPILRequest) => Promise<RegisterPILResponse> |
Parameters:
request.defaultMintingFee
: The fee to be paid when minting a license.request.commercialRevShare
: Percentage of revenue that must be shared with the licensor.request.currency
: The ERC20 token to be used to pay the minting fee and the token must be registered on Story’s protocol.request.royaltyPolicyAddress
: [Optional] The address of the royalty policy contract, default value is LAP.request.txOptions
: [Optional] The transaction options.
getLicenseTerms
Gets License Terms of the given ID.
Method | Type | ||
---|---|---|---|
getLicenseTerms | `(selectedLicenseTermsId: string \ | number \ | bigint) => PiLicenseTemplateGetLicenseTermsResponse` |
Parameters:
selectedLicenseTermsId
: The ID of the license terms.
predictMintingLicenseFee
Pre-compute the minting license fee for the given IP and license terms. The function can be used to calculate the minting license fee before minting license tokens.
Method | Type |
---|---|
predictMintingLicenseFee | (request: PredictMintingLicenseFeeRequest) => LicensingModulePredictMintingLicenseFeeResponse |
Parameters:
request.licensorIpId
: The IP ID of the licensor.request.licenseTermsId
: The ID of the license terms.request.amount
: The amount of license tokens to mint.request.licenseTemplate
: [Optional] The address of the license template, default value is Programmable IP License.request.receiver
: [Optional] The address of the receiver, default value is your wallet address.request.txOptions
: [Optional] The transaction options.
setLicensingConfig
Sets the licensing configuration for a specific license terms of an IP.
Method | Type |
---|---|
setLicensingConfig | (request: SetLicensingConfigRequest) => SetLicensingConfigResponse |
Parameters:
request.ipId
: The address of the IP for which the configuration is being set.request.licenseTermsId
: The ID of the license terms within the license template.request.licenseTemplate
: The address of the license template used, If not specified, the configuration applies to all licenses.request.licensingConfig
: The licensing configuration for the license.request.licensingConfig.isSet
: Whether the configuration is set or not.request.licensingConfig.mintingFee
: The minting fee to be paid when minting license tokens.request.licensingConfig.hookData
: The data to be used by the licensing hook.request.licensingConfig.licensingHook
: The hook contract address for the licensing module, or address(0) if none.
request.txOptions
: [Optional] The transaction options.