Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Use 2 endpoints instead of 1 to fetch address details
Browse files Browse the repository at this point in the history
  • Loading branch information
nop33 authored and mvaivre committed May 23, 2023
1 parent c8eecf1 commit cf56d53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -41,7 +42,10 @@ export const fetchAddressesData = async (addressHashes: AddressHash[]): Promise<

results.push({
hash: addressHash,
details,
details: {
...balances,
txNumber
},
transactions,
mempoolTransactions,
tokens
Expand Down

0 comments on commit cf56d53

Please sign in to comment.