From 27478151fd9ac361fa42df07f14b53dc1e6d0376 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 25 Aug 2023 01:04:32 +0000 Subject: [PATCH] docs: document default events (backport #1081) (#1094) * docs: document default events (#1081) * Add events docs * Update CHANGELOG.md * Update CHANGELOG.md --- CHANGELOG.md | 1 + docs/docs/core/08-events.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 docs/docs/core/08-events.md diff --git a/CHANGELOG.md b/CHANGELOG.md index b01593bdf8..834847be60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,3 +68,4 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Document Updates * (readme) [\#997](https://github.com/finschia/finschia-sdk/pull/997) fix swagger url +* (docs) [\#1094](https://github.com/Finschia/finschia-sdk/pull/1094) Document default events (backport #1081) diff --git a/docs/docs/core/08-events.md b/docs/docs/core/08-events.md new file mode 100644 index 0000000000..36aad72e06 --- /dev/null +++ b/docs/docs/core/08-events.md @@ -0,0 +1,22 @@ +--- +sidebar_position: 1 +--- +# Events + +:::note Synopsis +`Event`s are objects that contain information about the execution of the application. They are mainly used by service providers like block explorers and wallet to track the execution of various messages and index transactions. +::: + +## Default Events + +There are a few events that are automatically emitted for all messages, directly from `baseapp`. + +* `message.action`: The name of the message type. +* `message.sender`: The address of the message signer. +* `message.module`: The name of the module that emitted the message. + +:::tip +The module name is assumed by `baseapp` to be the second element of the message route: `"cosmos.bank.v1beta1.MsgSend" -> "bank"`. +In case a module does not follow the standard message path, (e.g. IBC), it is advised to keep emitting the module name event. +`Baseapp` only emits that event if the module have not already done so. +:::