Soroban event reference doc#157
Open
githoboman wants to merge 4 commits into
Open
Conversation
…nvironment settings
…hema and indexer utilities
|
@githoboman Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #144
Created docs/event-reference.md — a reference of every event the indexer recognizes, grounded in the actual code rather than the task title.
What it documents, one section per event, each with a real worked example:
transfer — from/to/amount (from topics[1], topics[2], value)
mint — to/amount; from is null, admin in topics[1] is intentionally ignored
burn — from/amount; to is null
clawback — same shape as burn
Each section has: the topic/value shape table, how the fields map into a TransferRecord, the base64 XDR (taken verbatim from the test fixtures), and the decoded form. The example XDR and decoded values are verified — I ran them through @stellar/stellar-sdk's scValToNative/Address to confirm the exact addresses and amounts, then removed the temp script.
One correction worth flagging: the task title lists transfer, mint, burn, approve, but the indexer actually recognizes transfer, mint, burn, clawback (src/decoder.ts:7 — KNOWN_EVENT_TYPES). There is no approve handling anywhere. I documented the four real events and added a dedicated "A note on approve" section explaining why it's not indexed (it sets an allowance, not a balance movement; its value is a struct, not an i128) and what it would take to add it.
Gitignore change: per your choice, I removed the docs/ line from .gitignore so the doc is trackable. Side effect: the existing docs/cookbook/ directory is now also no longer ignored — worth a glance before you commit if it contains anything you'd rather keep untracked.
Want me to commit these changes (on this Soroban-event-reference-doc branch), or open a PR?