Skip to main content
resources/smartLicenses.SmartLicenseClient The SmartLicenseClient is used to manage Smart License templates on the blockchain. A Smart License is a reusable, on-chain template that defines the terms and conditions of a license, such as required licensee information or specific usage rights. These templates are then attached to listings to standardize and automate the licensing process.

Table of contents

Methods

constructor

new SmartLicenseClient(client): SmartLicenseClient

Parameters

Returns

SmartLicenseClient

Methods

create

create(smartLicenseId, requiredParams?, termCreationFee?): Promise<{ transactionHash: `0x\{string}\` ; `smartLicenseHash`: \`0x{string}` }> Creates a Smart License template.

Parameters

Returns

Promise<{ transactionHash: `0x\{string}\` ; `smartLicenseHash`: \`0x{string}` }> The transaction identifier and the calculated smart license hash.

getAll

getAll(params?): Promise<SmartLicense[]> Get all smart licenses with optional filtering

Parameters

Returns

Promise<SmartLicense[]> Array of smart licenses

getById

getById(id): Promise<SmartLicense> Get a specific smart license by ID

Parameters

Returns

Promise<SmartLicense> The smart license object

getByHash

getByHash(hash, status?): Promise<null | SmartLicense> Get a smart license by its hash

Parameters

Returns

Promise<null | SmartLicense> The smart license object or null if not found