From cf56d53891331ce39a115da97bdb15edce1c5eea Mon Sep 17 00:00:00 2001 From: Ilias Trichopoulos Date: Wed, 10 May 2023 16:53:11 +0200 Subject: [PATCH] Use 2 endpoints instead of 1 to fetch address details --- src/api/addresses.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/addresses.ts b/src/api/addresses.ts index 62cecf2ed..0afb1d6dd 100644 --- a/src/api/addresses.ts +++ b/src/api/addresses.ts @@ -25,7 +25,8 @@ export const fetchAddressesData = async (addressHashes: AddressHash[]): Promise< const results = [] for (const addressHash of addressHashes) { - const details = await client.explorer.addresses.getAddressesAddress(addressHash) + const balances = await client.explorer.addresses.getAddressesAddressBalance(addressHash) + const txNumber = await client.explorer.addresses.getAddressesAddressTotalTransactions(addressHash) const transactions = await client.explorer.addresses.getAddressesAddressTransactions(addressHash, { page: 1 }) const mempoolTransactions = await client.explorer.addresses.getAddressesAddressMempoolTransactions(addressHash) const tokenIds = await client.explorer.addresses.getAddressesAddressTokens(addressHash) @@ -41,7 +42,10 @@ export const fetchAddressesData = async (addressHashes: AddressHash[]): Promise< results.push({ hash: addressHash, - details, + details: { + ...balances, + txNumber + }, transactions, mempoolTransactions, tokens