new CulturaDigitalAssetClient()
new CulturaDigitalAssetClient(publicClient,walletClient,contractAddress):CulturaDigitalAssetClient
Parameters
publicClient
walletClient
contractAddress
`0x${string}`
Returns
CulturaDigitalAssetClient
Methods
mintDigitalAsset()
mintDigitalAsset(Mints a new digital asset token with specified metadata (React version using high-level contract interaction)to,digitalAssetName,digitalAssetDescription,parentInfo,terms,tokenURI):Promise<bigint>
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
parentInfo
readonlyReadonly<{ rightsBoundAccount: `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 parentInfo array should contain:- rightsBoundAccount: Address of parent digital asset collection (0x0 for original asset)
- digitalAssetClass: Token ID of parent digital asset (0 for original asset)
- royaltySplit: Percentage of royalties allocated to parent digital asset, expressed as a whole number (e.g., 10 for 10%).
royaltySplit values across all parentInfo must equal exactly 75.
(Note: This 75% value is currently hardcoded in the contract and may change in future versions).
getLicenseInfo()
getLicenseInfo(Gets the complete license information for a tokentokenId):Promise<Readonly<{digitalAssetName:string;digitalAssetDescription:string;creator:`0x${string}`;parentDigitalAsset: readonlyReadonly<{rightsBoundAccount:`0x${string}`;royaltySplit:bigint; }>[];termsURI:string; }>>
Parameters
tokenId
bigint
The identifier of the token
Returns
Promise<Readonly<{ digitalAssetName: string; digitalAssetDescription: string; creator: `0x${string}`; parentDigitalAsset: readonly Readonly<{ rightsBoundAccount: `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:ownerOf()
ownerOf(Get token ownertokenId):Promise<`0x${string}`>
Parameters
tokenId
bigint
Returns
Promise<`0x${string}`>
tokenURI()
tokenURI(Get token URItokenId):Promise<string>
Parameters
tokenId
bigint
Returns
Promise<string>
approve()
approve(Approve an address to transfer a tokento,tokenId):Promise<`0x${string}`>
Parameters
to
`0x${string}`
tokenId
bigint
Returns
Promise<`0x${string}`>
setApprovalForAll()
setApprovalForAll(Set approval for all tokensoperator,approved):Promise<`0x${string}`>
Parameters
operator
`0x${string}`
approved
boolean
Returns
Promise<`0x${string}`>
totalSupply()
totalSupply():Get the total supply of tokensPromise<bigint>
Returns
Promise<bigint>
The total supply as a BigInt
tokenByIndex()
tokenByIndex(Get a token by its indexindex):Promise<bigint>
Parameters
index
bigint
The index of the token
Returns
Promise<bigint>
Token ID at the specified index
