diff --git a/src/clients/TokenClient.ts b/src/clients/TokenClient.ts index 9d919855d..dee189cb2 100644 --- a/src/clients/TokenClient.ts +++ b/src/clients/TokenClient.ts @@ -172,7 +172,11 @@ export class TokenClient { } resolveRemoteTokens(chainId: number, hubPoolTokens: L1Token[]): Contract[] { - const { signer } = this.hubPoolClient.hubPool; + const { signer } = this.spokePoolClients[chainId].spokePool; + + if (chainId === this.hubPoolClient.chainId) { + return hubPoolTokens.map(({ address }) => new Contract(address, ERC20.abi, signer)); + } const tokens = hubPoolTokens .map(({ symbol, address }) => { @@ -282,13 +286,11 @@ export class TokenClient { const { relayerAddress } = this; const tokenData = Object.fromEntries( - await Promise.all( - await sdkUtils.mapAsync(this.resolveRemoteTokens(chainId, hubPoolTokens), async (token: Contract) => { - const balance: BigNumber = await token.balanceOf(relayerAddress); - const allowance = await this._getAllowance(spokePoolClient, token); - return [token.address, { balance, allowance }]; - }) - ) + await sdkUtils.mapAsync(this.resolveRemoteTokens(chainId, hubPoolTokens), async (token: Contract) => { + const balance: BigNumber = await token.balanceOf(relayerAddress); + const allowance = await this._getAllowance(spokePoolClient, token); + return [token.address, { balance, allowance }]; + }) ); return tokenData;