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

Commit

Permalink
feat(synthetix): Make synths exchangeable (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
JForsaken committed Jun 10, 2022
1 parent 0e5efc2 commit 076bb1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class EthereumSynthetixSynthTokenFetcher implements PositionFetcher<AppTo
return this.tokenHelper.getTokens({
network: Network.ETHEREUM_MAINNET,
resolverAddress: '0x823be81bbf96bec0e25ca13170f5aacb5b79ba83',
exchangeable: true,
});
}
}
9 changes: 5 additions & 4 deletions src/apps/synthetix/helpers/synthetix.synth.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface';
import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present';
import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present';
import { ContractType } from '~position/contract.interface';
import { AppTokenPosition } from '~position/position.interface';
import { AppTokenPosition, ExchangeableAppTokenDataProps } from '~position/position.interface';
import { Network } from '~types/network.interface';

import { SynthetixContractFactory } from '../contracts';
Expand All @@ -16,6 +16,7 @@ import { SYNTHETIX_DEFINITION } from '../synthetix.definition';
export type SynthetixSynthTokenHelperParams = {
network: Network;
resolverAddress: string;
exchangeable?: boolean;
};

@Injectable()
Expand All @@ -25,7 +26,7 @@ export class SynthetixSynthTokenHelper {
@Inject(SynthetixContractFactory) private readonly contractFactory: SynthetixContractFactory,
) {}

async getTokens({ network, resolverAddress }: SynthetixSynthTokenHelperParams) {
async getTokens({ network, resolverAddress, exchangeable = false }: SynthetixSynthTokenHelperParams) {
const multicall = this.appToolkit.getMulticall(network);

const addressResolverContract = this.contractFactory.synthetixAddressResolver({
Expand Down Expand Up @@ -60,7 +61,7 @@ export class SynthetixSynthTokenHelper {
const secondaryLabel = buildDollarDisplayItem(price);
const images = [getTokenImg(address, network)];

const token: AppTokenPosition = {
const token: AppTokenPosition<ExchangeableAppTokenDataProps> = {
type: ContractType.APP_TOKEN,
appId: SYNTHETIX_DEFINITION.id,
groupId: SYNTHETIX_DEFINITION.groups.synth.id,
Expand All @@ -73,7 +74,7 @@ export class SynthetixSynthTokenHelper {
pricePerShare,
tokens,

dataProps: {},
dataProps: { exchangeable },

displayProps: {
label,
Expand Down

0 comments on commit 076bb1f

Please sign in to comment.