Skip to content

Commit

Permalink
feat(assets): use yearn-assets for zapper tokens (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
nymmrx authored Jul 15, 2021
1 parent 8551dbd commit 6099cf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EthAddress, WethAddress, ZeroAddress } from "../helpers";
import { PickleJars } from "../services/partners/pickle";
import { Address, Integer, SdkError, ZapApprovalTransactionOutput, ZapProtocol } from "../types";
import { TransactionOutcome } from "../types/custom/simulation";
import { PickleJarContract, VaultContract, YearnVaultContract } from "../vaultContract";
import { PickleJarContract, VaultContract, YearnVaultContract } from "../vault";

const baseUrl = "https://simulate.yearn.network";
const latestBlockKey = -1;
Expand Down
7 changes: 6 additions & 1 deletion src/interfaces/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ export class TokenInterface<C extends ChainId> extends ServiceInterface<C> {
async supported(): Promise<Token[]> {
if (this.chainId === 1 || this.chainId === 1337) {
// only ETH Main is supported
return await this.yearn.services.zapper.supportedTokens();
const tokens = await this.yearn.services.zapper.supportedTokens();
const icons = this.yearn.services.asset.icon(tokens.map(token => token.address));
return tokens.map(token => {
const icon = icons[token.address];
return icon ? { ...token, icon } : token;
});
}
return [];
}
Expand Down
File renamed without changes.

0 comments on commit 6099cf9

Please sign in to comment.