guardian icon indicating copy to clipboard operation
guardian copied to clipboard

Improve documentation about external events

Open Neurone opened this issue 1 year ago • 0 comments

Problem description

The external events documentation seems not in sync with the actual code.

It is also not immediate to understand the acutaly payload from the format definition, so adding an example for each event would be appreciated.

From the code:

export enum ExternalMessageEvents {
    TOKEN_MINTED = 'external-events.token_minted',
    ERROR_LOG = 'external-events.error_logs',
    BLOCK_EVENTS = 'external-events.block_event',
    IPFS_ADDED_FILE = 'external-events.ipfs_added_file',
    IPFS_BEFORE_UPLOAD_CONTENT = 'external-events.ipfs_before_upload_content',
    IPFS_AFTER_READ_CONTENT = 'external-events.ipfs_after_read_content',
    IPFS_LOADED_FILE = 'external-events.ipfs_loaded_file',
}

From the doc:

  • external-events.token_minted
  • external-events.error_logs
  • external-events.block_run_action_event
  • externals-events.ipfs_added_file
  • external-events.ipfs_after_read_content
  • external-events.ipfs_before_upload_content

Differences:

  • external-events.block_run_action_event does not exist in the code
  • external-events.block_event is not mentioned in the doc
  • external-events.ipfs_added_file contains a typo in the doc (externalS-events.ipfs_added_file)
  • external-events.ipfs_before_upload_content is not mentioned in the doc
  • external-events.ipfs_loaded_file is not mentioned in the doc

Expected behavior

  • The documentation should list and describe all the available external events present in the source code
  • The documentation should include payload examples, not just format definitions, i.e.
external-events.token_minted: {
  tokenId: '0.0.4678707',
  tokenValue: 135,
  memo: '1724875475.946623551'
}

Neurone avatar Aug 28 '24 20:08 Neurone