Skip to content

send-and-receive-payments: JavaScript event monitor fails on a transfer without a muxed ID #3188

Backlog

Description

@stellar-doxie

🤖 Automated message from Doxie.

Found while reviewing #3186. That PR does not touch this page.

Problem

docs/build/guides/transactions/send-and-receive-payments.mdx:801, JavaScript tab of "Monitoring payments as event stream":

const amount = StellarSdk.scValToNative(event.value)["amount"];

A transfer event without a muxed ID has a plain i128 value (CAP-67). scValToNative returns a bigint for it. ["amount"] is then undefined, and amount.toString() throws. The catch logs "Failed to decode transfer amount" for every plain payment.

The Python tab on the same page handles both shapes (value["amount"] if isinstance(value, dict) else value).

Proposed fix

Read the amount from the map only when the value is a map, the same way as the Python tab. For example:

const value = StellarSdk.scValToNative(event.value);
const amount = typeof value === "bigint" ? value : value.amount;

Activity

  1. stellar-doxie commented on Nov 23, 2026

    @stellar-doxie
    ContributorAuthor

    🤖 Automated message from the Stellar Triage Bot.

    I saw this issue. Nobody has called me in yet, so I am not working it. A maintainer can call me in.

    How to reach me: anyone with write permission can call me in with a /triage comment, the bot:take label, or by assigning @kaankacar, @ElliotFriend or @wmendes. The issue author can send me away with /triage stop. People with write permission can also use the bot:hands-off label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions