From 1df6411c64298a9b75c15ed26f141d41ea63d6df Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Thu, 17 Aug 2023 11:09:29 +0000 Subject: [PATCH] docs: document default events (#1081) * Add events docs * Update CHANGELOG.md --- CHANGELOG.md | 2 +- docs/docs/core/08-events.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docs/docs/core/08-events.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c7512629b0..dc7c04e5d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,4 +55,4 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Build, CI ### Document Updates - +* (docs) [\#1081](https://github.com/Finschia/finschia-sdk/pull/1081) Document default events 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. +:::