Skip to content

Commit

Permalink
adding search by origin tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Defi-Moses committed Oct 12, 2024
1 parent 099624f commit 89f6ac4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ export const getTransactionById = async (req: Request, res: Response) => {
try {
const query = db
.with('deposits', () =>
qDeposits().where('transactionId', '=', transactionId as string)
qDeposits().where((eb) =>
eb.or([
eb('transactionId', '=', transactionId as string),
eb('transactionHash', '=', transactionId as string)
])
)
)
.with('relays', () => qRelays())
.with('proofs', () => qProofs({activeOnly: false})) // display proofs even if they have been invalidated/replaced by a dispute
Expand Down
4 changes: 2 additions & 2 deletions packages/rfq-indexer/api/src/routes/transactionIdRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const router = express.Router()
* @openapi
* /transaction-id/{transactionId}:
* get:
* summary: Get transaction details by ID
* summary: Get transaction details by ID or the origin transaction hash
* description: Retrieves detailed information about a transaction, including deposit, relay, proof, claim, and refund data if available
* parameters:
* - in: path
* name: transactionId
* required: true
* schema:
* type: string
* description: The unique identifier of the transaction
* description: The unique identifier of the transaction or the origin transaction hash
* responses:
* 200:
* description: Successful response
Expand Down

0 comments on commit 89f6ac4

Please sign in to comment.