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

fix(balancer): Add missing exports for zapper api #329

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/apps/balancer-v2/helpers/balancer-v2.pool.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Network } from '~types/network.interface';

import { BalancerV2ContractFactory } from '../contracts';

export enum PoolLabelStrategy {
export enum BalancerV2PoolLabelStrategy {
TOKEN_SYMBOLS = 'token-symbols',
POOL_NAME = 'pool-name',
}
Expand All @@ -35,7 +35,7 @@ type GetBalancerV2PoolTokensParams = {
appId: string;
network: Network;
}) => Promise<{ address: string; volume: number }[]>;
resolvePoolLabelStrategy?: () => PoolLabelStrategy;
resolvePoolLabelStrategy?: () => BalancerV2PoolLabelStrategy;
};

@Injectable()
Expand All @@ -53,7 +53,7 @@ export class BalancerV2PoolTokensHelper {
vaultAddress,
minLiquidity = 0,
resolvePoolTokenAddresses,
resolvePoolLabelStrategy = () => PoolLabelStrategy.TOKEN_SYMBOLS,
resolvePoolLabelStrategy = () => BalancerV2PoolLabelStrategy.TOKEN_SYMBOLS,
}: GetBalancerV2PoolTokensParams) {
const multicall = this.appToolkit.getMulticall(network);
const prices = await this.appToolkit.getBaseTokenPrices(network);
Expand Down Expand Up @@ -109,7 +109,7 @@ export class BalancerV2PoolTokensHelper {
// Display Props
const labelStrategy = resolvePoolLabelStrategy();
const label =
labelStrategy === PoolLabelStrategy.POOL_NAME
labelStrategy === BalancerV2PoolLabelStrategy.POOL_NAME
? await multicall.wrap(poolContract).name()
: tokens.map(v => v.symbol).join(' / ');
const secondaryLabel = reservePercentages.map(p => `${Math.round(p * 100)}%`).join(' / ');
Expand Down
1 change: 1 addition & 0 deletions src/apps/balancer-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { BalancerV2ContractFactory } from './contracts';

// Helpers
export { BalancerV2SpotPriceHelper } from './helpers/balancer-v2.spot-price.helper';
export { BalancerV2PoolLabelStrategy, BalancerV2PoolTokensHelper } from './helpers/balancer-v2.pool.token-helper';