Fix Blockscout tx fetch: remove unsupported limit parameter
All checks were successful
check / check (push) Successful in 4s
All checks were successful
check / check (push) Successful in 4s
Blockscout v2 API rejects the `limit` query parameter on /transactions and /token-transfers endpoints (returns 422). Remove it and slice results client-side instead.
This commit is contained in:
@@ -51,20 +51,12 @@ async function fetchRecentTransactions(address, blockscoutUrl, count = 25) {
|
|||||||
const addrLower = address.toLowerCase();
|
const addrLower = address.toLowerCase();
|
||||||
|
|
||||||
const [txResp, ttResp] = await Promise.all([
|
const [txResp, ttResp] = await Promise.all([
|
||||||
|
fetch(blockscoutUrl + "/addresses/" + address + "/transactions"),
|
||||||
fetch(
|
fetch(
|
||||||
blockscoutUrl +
|
blockscoutUrl +
|
||||||
"/addresses/" +
|
"/addresses/" +
|
||||||
address +
|
address +
|
||||||
"/transactions?limit=" +
|
"/token-transfers?type=ERC-20",
|
||||||
count,
|
|
||||||
),
|
|
||||||
fetch(
|
|
||||||
blockscoutUrl +
|
|
||||||
"/addresses/" +
|
|
||||||
address +
|
|
||||||
"/token-transfers?limit=" +
|
|
||||||
count +
|
|
||||||
"&type=ERC-20",
|
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user