Skip to content

feat: add isTerminalTransactionStatus helper#195

Open
shoaib050326 wants to merge 3 commits into0xNgoo:mainfrom
shoaib050326:fix/issue-131-terminal-status-helper
Open

feat: add isTerminalTransactionStatus helper#195
shoaib050326 wants to merge 3 commits into0xNgoo:mainfrom
shoaib050326:fix/issue-131-terminal-status-helper

Conversation

@shoaib050326
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a public isTerminalTransactionStatus(status: TransactionStatus): boolean helper, documents the set of terminal transaction statuses in the helper JSDoc, and exports the helper through the public types barrel.

How to test?

Run:

bun test tests/types/transaction-status.test.ts
bun run test
bun run lint

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 #131

@shoaib050326 shoaib050326 marked this pull request as ready for review April 2, 2026 05:07
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 the isTerminalTransactionStatus helper function and a list of terminal transaction statuses, supported by new unit tests. Feedback suggests enhancing type safety by defining a TerminalTransactionStatus union type and implementing the helper as a TypeScript Type Guard. Additionally, it is recommended to refactor the tests to iterate over the TRANSACTION_STATUSES array rather than using hardcoded lists to ensure long-term maintainability and prevent desynchronization.

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 isTerminalTransactionStatus() helper

1 participant