Skip to content

fix: add isPendingTransactionStatus helper#194

Open
shoaib050326 wants to merge 2 commits into0xNgoo:mainfrom
shoaib050326:fix/issue-132-pending-status-helper
Open

fix: add isPendingTransactionStatus helper#194
shoaib050326 wants to merge 2 commits into0xNgoo:mainfrom
shoaib050326:fix/issue-132-pending-status-helper

Conversation

@shoaib050326
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a public isPendingTransactionStatus(status: TransactionStatus): boolean helper for SEP-24 transaction statuses.

The helper is exported from the public types surface and documents the exact statuses it treats as pending or in-progress:

  • pending_anchor
  • pending_user_transfer_start
  • pending_user_transfer_complete
  • pending_external
  • pending_trust
  • pending_user
  • pending_stellar

How to test?

bun install --frozen-lockfile
bun run lint
bun test

Checklist

  • My code follows the code style of this project.
  • I have added tests for my changes.
  • I have updated the documentation accordingly.
  • I have run bun run test and bun run lint locally.

Issue Reference

Closes #132

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a utility function isPendingTransactionStatus and a set of pending transaction statuses, supported by new unit tests. The review feedback recommends enhancing the implementation by defining a PendingTransactionStatus type and utilizing it as a TypeScript type guard to facilitate type narrowing in downstream logic.

@shoaib050326
Copy link
Copy Markdown
Contributor Author

Resolved medium Priority Issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add isPendingTransactionStatus() helper

1 participant