From c212733c0d2a3fde3a26e971a946f2f4aa641f67 Mon Sep 17 00:00:00 2001 From: Juan Christian Cieri Date: Tue, 17 Nov 2020 22:46:21 -0400 Subject: [PATCH] Add request for get transaction detail by id --- .../transactions/requests/getTransaction.js | 19 +++++++++++++++++++ source/renderer/app/api/transactions/types.js | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 source/renderer/app/api/transactions/requests/getTransaction.js diff --git a/source/renderer/app/api/transactions/requests/getTransaction.js b/source/renderer/app/api/transactions/requests/getTransaction.js new file mode 100644 index 0000000000..55a92edbcd --- /dev/null +++ b/source/renderer/app/api/transactions/requests/getTransaction.js @@ -0,0 +1,19 @@ +// @flow +import type { RequestConfig } from '../../common/types'; +import type { Transaction } from '../types'; +import { request } from '../../utils/request'; + +export const getTransaction = ( + config: RequestConfig, + walletId: string, + transactionId: string +): Promise => + request( + { + method: 'GET', + path: `/v2/wallets/${walletId}/transactions/${transactionId}`, + ...config, + }, + {}, + null + ); diff --git a/source/renderer/app/api/transactions/types.js b/source/renderer/app/api/transactions/types.js index d8195b5677..0d658c4fc0 100644 --- a/source/renderer/app/api/transactions/types.js +++ b/source/renderer/app/api/transactions/types.js @@ -90,6 +90,11 @@ export type GetTransactionsRequest = { // cachedTransactions: Array, }; +export type GetTransactionRequest = { + walletId: string, + transactionId: string, +}; + export type GetTransactionFeeRequest = { walletId: string, address: string,