Broadcast
Usage: client.platform.document.broadcast(documents, identity)
Description: This method will broadcast the document on the Application Chain
Parameters:
parameters | type | required | Description |
---|---|---|---|
documents | Object | yes | |
documents.create | ExtendedDocument[] | no | array of valid created document to create |
documents.replace | ExtendedDocument[] | no | array of valid created document to replace |
documents.delete | ExtendedDocument[] | no | array of valid created document to delete |
identity | Identity | yes | A valid registered identity |
Example:
const identityId = '';// Your identity identifier
const identity = await client.platform.identities.get(identityId);
const helloWorldDocument = await client.platform.documents.create(
// Assuming a contract tutorialContract is registered with a field note
'tutorialContract.note',
identity,
{ message: 'Hello World'},
);
await client.platform.documents.broadcast({ create: [helloWorldDocument] }, identity);
Returns: documents.
Updated 10 months ago