On-Chain License

OnChainLicenseClient

The OnChainLicenseClient is used to register and manage licenses.

Methods

  • createSmartLicense

  • createCustomLicense

  • attachSmartLicense

  • attachCustomLicense

  • updateSmartLicense

  • updateCustomLicense

createSmartLicense

The createSmartLicense function is used to create a smart license with predefined terms

Method
Type

createSmartLicense

(request: ICreateSmartLicense) => Promise<{transactionResponse, result}>

  • Parameters:

Name
Type
Description

isRoyaltyAllowed

boolean

States whether royalty is allowed

isCommercialUseAllowed

boolean

States whether license is for commercial use

isExpirable

boolean

States whether license can be expired

isDerivativeAllowed

boolean

States whether derivative is allowed

licenseFee

number

Fee associated with the license

royaltyPercentage

number

Royalty percentage that will be shared whenever a derivative IP royalty is paid

licenseExpiryTimestamp

number

Expiry timestamp of the license

  • Returns:

Name
Type
Description

transactionResponse

Object

Contains details of the transaction, including the transactionHash, logs, and other relevant information.

result

Object

Object containing the license pdf url and term id of the newly created smart license.

  • response.transactionResponse.transactionHash - The transaction hash.

  • response.result.licenseURI - The ipfs URI of the newly created smart license.

  • response.result.licenseTermId - The term id of the newly created smart license.

createCustomLicense

The createCustomLicense function is used to create a custom license with predefined and user defined terms

Method
Type

createCustomLicense

(request: ICreateCustomLicense) => Promise<{transactionResponse, result}>

  • Parameters:

Name
Type
Description

isRoyaltyAllowed

boolean

States whether royalty is allowed

isCommercialUseAllowed

boolean

States whether license is for commercial use

isExpirable

boolean

States whether license can be expired

isDerivativeAllowed

boolean

States whether derivative is allowed

licenseFee

number

Fee associated with the license

customKey

Object

JSON object containing custom term as key value pairs. Eg: {isCustomTerm1: true, isCustomTerm2: false}

royaltyPercentage

number

Royalty percentage that will be shared whenever a derivative IP royalty is paid

licenseExpiryTimestamp

number

Expiry timestamp of the license

  • Returns:

Name
Type
Description

transactionResponse

Object

Contains details of the transaction, including the transactionHash, logs, and other relevant information.

result

Object

Object containing the license pdf url and term id of the newly created smart license.

  • response.transactionResponse.transactionHash - The transaction hash.

  • response.result.licenseURI - The ipfs URI of the newly created smart license.

  • response.result.licenseTermId - The term id of the newly created smart license.

attachSmartLicense

The attachSmartLicense function is used to attach smart license to an IP asset

Method
Type

attachSmartLicense

(request: IAttachLicense) => Promise<{transactionResponse}>

  • Parameters:

Name
Type
Description

ipId

address

Address of the ip asset to attach license on

licenseTermId

number

Term id of the license received in the createSmartLicense function

  • Returns:

Name
Type
Description

transactionResponse

Object

Contains details of the transaction, including the transactionHash, logs, and other relevant information.

  • response.transactionResponse.transactionHash - The transaction hash.

attachCustomLicense

The attachCustomLicense function is used to attach custom license to an IP asset

Method
Type

attachCustomLicense

(request: IAttachLicense) => Promise<{transactionResponse}>

  • Parameters:

Name
Type
Description

ipId

address

Address of the ip asset to attach license on

licenseTermId

number

Term id of the license

  • Returns:

Name
Type
Description

transactionResponse

Object

Contains details of the transaction, including the transactionHash, logs, and other relevant information.

  • response.transactionResponse.transactionHash - The transaction hash.

updateSmartLicense

The updateSmartLicense function is used to update smart license to an IP asset

Method
Type

updateSmartLicense

(request: IAttachLicense) => Promise<{transactionResponse}>

  • Parameters:

Name
Type
Description

ipId

address

Address of the ip asset to attach license on

licenseTermId

number

Term id of the license received in the createSmartLicense function

  • Returns:

Name
Type
Description

transactionResponse

Object

Contains details of the transaction, including the transactionHash, logs, and other relevant information.

  • response.transactionResponse.transactionHash - The transaction hash.

updateCustomLicense

The updateCustomLicense function is used to attach custom license to an IP asset

Method
Type

updateCustomLicense

(request: IAttachLicense) => Promise<{transactionResponse}>

  • Parameters:

Name
Type
Description

ipId

address

Address of the ip asset to attach license on

licenseTermId

number

Term id of the license

  • Returns:

Name
Type
Description

transactionResponse

Object

Contains details of the transaction, including the transactionHash, logs, and other relevant information.

  • response.transactionResponse.transactionHash - The transaction hash.

Last updated