Skip to main content
Client for interacting with the CulturaDigitalAsset NFT contract Functions for managing Cultura Digital Assets (implemented as ERC721 tokens with extended licensing capabilities)

new CulturaDigitalAssetClient()

new CulturaDigitalAssetClient(publicClient, walletClient, contractAddress): CulturaDigitalAssetClient

Parameters

publicClient
walletClient
contractAddress
`0x${string}`

Returns

CulturaDigitalAssetClient

Methods

mintDigitalAsset()

mintDigitalAsset(to, digitalAssetName, digitalAssetDescription, parentDigitalAssets, terms, tokenURI): Promise<bigint>
Mints a new digital asset token with specified metadata (React version using high-level contract interaction)

Parameters

to
`0x${string}` Address that will receive the minted token
digitalAssetName
string Name of the digital asset
digitalAssetDescription
string Description of the digital asset
parentDigitalAssets
readonly Readonly<{ parentCollection: `0x${string}`; parentDigitalAssetId: bigint; owner: `0x${string}`; royaltySplit: bigint; }>[] Array of parent digital asset information for derivative works
terms
Terms for the digital asset - can be a JSON object (to be uploaded to IPFS) or a string URI (pre-hosted) string | Record<string, any>
tokenURI
Token URI for the ERC-721 metadata - can be a JSON object (to be uploaded to IPFS) or a string URI (pre-hosted) string | Record<string, any>

Returns

Promise<bigint> The ID of the newly minted token

Remarks

This method mints a new digital asset token with licensing information. For derivative works, the parentDigitalAssets array should contain:
  • parentCollection: Address of parent digital asset collection (0x0 for original asset)
  • parentDigitalAssetId: Token ID of parent digital asset (0 for original asset)
  • owner: Address of parent digital asset owner
  • royaltySplit: Percentage of royalties allocated to parent digital asset, expressed as a whole number (e.g., 10 for 10%).
Important: The sum of royaltySplit values across all parentDigitalAssets must equal exactly 75. (Note: This 75% value is currently hardcoded in the contract and may change in future versions).

getLicenseInfo()

getLicenseInfo(tokenId): Promise<Readonly<{ digitalAssetName: string; digitalAssetDescription: string; creator: `0x${string}`; parentDigitalAsset: readonly Readonly<{ parentCollection: `0x${string}`; parentDigitalAssetId: bigint; owner: `0x${string}`; royaltySplit: bigint; }>[]; termsURI: string; }>>
Gets the complete license information for a token

Parameters

tokenId
bigint The identifier of the token

Returns

Promise<Readonly<{ digitalAssetName: string; digitalAssetDescription: string; creator: `0x${string}`; parentDigitalAsset: readonly Readonly<{ parentCollection: `0x${string}`; parentDigitalAssetId: bigint; owner: `0x${string}`; royaltySplit: bigint; }>[]; termsURI: string; }>> Complete license information including name, description, creator, parent Digital Assets, and terms URI

Remarks

Returns a complete object containing:
{
  digitalAssetName: string
  digitalAssetDescription: string
  creator: address
  parentDigitalAssets: ParentDigitalAsset[]
  termsURI: string
}

ownerOf()

ownerOf(tokenId): Promise<`0x${string}`>
Get token owner

Parameters

tokenId
bigint

Returns

Promise<`0x${string}`>

tokenURI()

tokenURI(tokenId): Promise<string>
Get token URI

Parameters

tokenId
bigint

Returns

Promise<string>

approve()

approve(to, tokenId): Promise<`0x${string}`>
Approve an address to transfer a token

Parameters

to
`0x${string}`
tokenId
bigint

Returns

Promise<`0x${string}`>

setApprovalForAll()

setApprovalForAll(operator, approved): Promise<`0x${string}`>
Set approval for all tokens

Parameters

operator
`0x${string}`
approved
boolean

Returns

Promise<`0x${string}`>

totalSupply()

totalSupply(): Promise<bigint>
Get the total supply of tokens

Returns

Promise<bigint> The total supply as a BigInt

tokenByIndex()

tokenByIndex(index): Promise<bigint>
Get a token by its index

Parameters

index
bigint The index of the token

Returns

Promise<bigint> Token ID at the specified index