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

Commit

Permalink
feat(euler): Add getBalancePerToken for EToken based on convertBalanc…
Browse files Browse the repository at this point in the history
…eToUnderlying (#1438)
  • Loading branch information
conwayconstar committed Sep 24, 2022
1 parent 76e2c8f commit 0bff135
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/apps/euler/ethereum/euler.e-token.token-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ import { EulerTokenType } from '../common/euler.token-definition-resolver';
export class EthereumEulerETokenTokenFetcher extends EulerETokenTokenFetcher {
groupLabel = 'Lending';
tokenType = EulerTokenType.E_TOKEN;

async getBalancePerToken({ address, appToken, multicall }) {
const contract = this.getContract(appToken.address);
const balance = await multicall.wrap(contract).balanceOf(address);

return multicall.wrap(contract).convertBalanceToUnderlying(balance);
}
}

0 comments on commit 0bff135

Please sign in to comment.