Skip to content

Commit

Permalink
Added getTransactionByHash.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
razvantomegea committed Dec 4, 2024
1 parent 26c3c9f commit 590c727
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/apiCalls/transactions/getTransactionByHash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import axios from 'axios';
import { TRANSACTIONS_ENDPOINT } from 'apiCalls/endpoints';
import { networkSelector } from 'store/selectors';
import { getState } from 'store/store';
import { ServerTransactionType } from 'types/serverTransactions.types';

export const getTransactionByHash = (hash: string) => {
const { apiAddress } = networkSelector(getState());

return axios.get<ServerTransactionType>(
`${apiAddress}/${TRANSACTIONS_ENDPOINT}/${hash}`,
{
timeout: 10000 // 10sec
}
);
};

0 comments on commit 590c727

Please sign in to comment.