buildFromProperties
buildFromProperties(
creatorAddress
,chainSpaceDesc
?):Promise
<IChainSpaceAccountType
>
Creates a new ChainSpace object in the CORD blockchain.
Parameters
• creatorAddress: string
The account address the chainspace creator.
• chainSpaceDesc?: string
(Optional) A custom description to represent the ChainSpace. If not provided, a default description is generated, incorporating a unique UUID.
Returns
Promise
<IChainSpaceAccountType
>
A promise that resolves to an IChainSpace object, encompassing the ChainSpace’s identifier, description, hash digest, creator’s DID, and authorization URI.
Remarks
This function is designed to create a distinct ChainSpace on the CORD blockchain. A ChainSpace is a conceptual area within the blockchain, designated for managing specific data or assets under defined rules and permissions. The function generates a unique identifier and an authorization identifier for the new ChainSpace, based on the creator’s address and an optional custom description.
Example
const creatorUri = 'did:cord:creator';const customDesc = 'MyCustomChainSpace';
buildFromProperties(creatorUri, customDesc).then(chainSpace => { console.log('Created ChainSpace URI:', chainSpace.uri);}).catch(error => { console.error('Error creating ChainSpace:', error);});