Skip to content

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Dec 11, 2025

High Level Overview of Change

This PR is a fast follow from #1269 to refactor the files converted to TS to use proper async/await structure instead of then structure.

There is no functionality change, only refactors.

Context of Change

Best practices, easier to read/write

Type of Change

  • Refactor (non-breaking change that only restructures code)

Codebase Modernization

Already done ;)

Before / After

No changes

Test Plan

CI passes.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors recently converted TypeScript files to use modern async/await syntax instead of promise .then() chains, improving code readability and maintainability. The changes are purely structural with no functional modifications.

Key Changes:

  • Converted promise chains to async/await pattern across multiple rippled service files
  • Improved type annotations and simplified logic in transaction and ledger summary utilities
  • Modernized export syntax to use inline re-exports

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/rippled/transactions.ts Converted getTransaction to async/await with try/catch error handling
src/rippled/quorum.ts Converted getQuorum to async/await with try/catch error handling
src/rippled/nUNL.ts Converted getNegativeUNL to async/await with try/catch error handling
src/rippled/lib/txSummary/index.ts Added explicit type annotation and simplified conditional logic in summarizeTransaction
src/rippled/lib/summarizeLedger.ts Refactored to use functional map/reduce pattern and added type annotation for parameter
src/rippled/lib/rippled.ts Converted 20+ functions from promise chains to async/await pattern
src/rippled/ledgers.ts Converted getLedger to async/await and added return type annotation
src/rippled/index.ts Simplified exports using inline re-export syntax
src/rippled/accountTransactions.ts Converted getAccountTransactions to async/await with try/catch error handling

The refactoring is clean, consistent, and follows TypeScript best practices. All error handling has been properly maintained, and the async/await conversion is correctly implemented throughout.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kuan121 kuan121 self-requested a review December 12, 2025 21:50
rippledSocket: XrplClient,
params: any,
): Promise<any> =>
rippledSocket.send(params).catch((error: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be converted to async/await as well?

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.

3 participants