From 0b10a294081c53513345200640de4fc3bf1d3a77 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 8 Apr 2021 12:33:30 +0200 Subject: [PATCH] Only use first 32 bytes of returned data --- src/api.ts | 2 +- src/eth-scan.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.ts b/src/api.ts index 26b1811..3dd708e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -13,7 +13,7 @@ import { batch } from './utils'; */ export const toBalanceMap = (addresses: string[], results: Array): BalanceMap => { return results.reduce((current, next, index) => { - const value = typeof next === 'bigint' ? next : toNumber(next[1]); + const value = typeof next === 'bigint' ? next : toNumber(next[1].slice(0, 32)); return { ...current, diff --git a/src/eth-scan.ts b/src/eth-scan.ts index d586d48..83ca7b6 100644 --- a/src/eth-scan.ts +++ b/src/eth-scan.ts @@ -1,5 +1,5 @@ import { encode } from '@findeth/abi'; -import { callSingle, retryCalls, toBalanceMap, toNestedBalanceMap } from './api'; +import { callSingle, toBalanceMap, toNestedBalanceMap } from './api'; import { BALANCE_OF_ID, BALANCE_OF_TYPE,