Skip to content

feat(TransactionPanel): defaultDestination/Amount/Memo props, onSuccess/onError callbacks, 28-char memo counter #361

Description

@k-deejah

Problem

1. TransactionPanel does not support a defaultDestination or defaultAmount prop — consumers embedding TransactionPanel in a "Pay X" flow (e.g. a donation button) have no way to pre-fill the form fields.

2. TransactionPanel does not emit an onSuccess callback with the TxResult — after submission, setResult(data) updates internal state but no external callback fires. Consumers building automated workflows have no way to react to a successful payment.

3. TransactionPanel memo field has no character count indicator — Stellar text memos are limited to 28 bytes. Users typing long memos do not see the limit until they hit it or the transaction fails.

Solution

  1. Add defaultDestination?: string, defaultAmount?: string, defaultMemo?: string props initializing the form state.
  2. Add onSuccess?: (result: TxResult) => void and onError?: (error: string) => void callback props.
  3. Add a character counter label below the memo input: {memo.length}/28 with red colour when at/above 28.

Acceptance Criteria

  • Default props pre-fill the respective form fields
  • onSuccess fires with TxResult after a successful submission
  • onError fires with the error string on failure
  • Memo counter shows {n}/28 with red colour at/above limit
  • npm run build passes

Note for Contributors: Write a clear PR description. Include a screenshot of the memo counter at the 28-char limit.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions