Skip to content

Commit

Permalink
fix: fixed x-layer fetch useApi = false
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorovdg committed May 22, 2024
1 parent 0565942 commit eea4e02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ class Curve implements ICurve {
}

fetchFactoryPools = async (useApi = true): Promise<void> => {
if ([252, 1313161554].includes(this.chainId)) return;
if ([196, 252, 1313161554].includes(this.chainId)) return;

if (useApi) {
this.constants.FACTORY_POOLS_DATA = lowerCasePoolDataAddresses(await getFactoryPoolsDataFromApi.call(this, "factory"));
Expand Down Expand Up @@ -886,7 +886,7 @@ class Curve implements ICurve {
}

fetchNewFactoryPools = async (): Promise<string[]> => {
if ([252,1313161554].includes(this.chainId)) return [];
if ([196,252,1313161554].includes(this.chainId)) return [];

const currentPoolIds = Object.keys(this.constants.FACTORY_POOLS_DATA);
const lastPoolIdx = currentPoolIds.length === 0 ? -1 : Number(currentPoolIds[currentPoolIds.length - 1].split("-")[2]);
Expand Down Expand Up @@ -944,7 +944,7 @@ class Curve implements ICurve {
}

fetchRecentlyDeployedFactoryPool = async (poolAddress: string): Promise<string> => {
if ([252,1313161554].includes(this.chainId)) return '';
if ([196,252,1313161554].includes(this.chainId)) return '';

const poolData = lowerCasePoolDataAddresses(await getFactoryPoolData.call(this, 0, poolAddress));
this.constants.FACTORY_POOLS_DATA = { ...this.constants.FACTORY_POOLS_DATA, ...poolData };
Expand Down
8 changes: 8 additions & 0 deletions src/factory/constants-crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const lpTokenBasePoolIdDictBsc: IDict<string> = lowerCaseKeys({});

export const lpTokenBasePoolIdDictFraxtal: IDict<string> = lowerCaseKeys({});

export const lpTokenBasePoolIdDictXLayer: IDict<string> = lowerCaseKeys({});

export const basePoolIdZapDictEthereum: IDict<{ address: string, ABI: any }> = {
'3pool': {
address: "0x97aDC08FA1D849D2C48C5dcC1DaB568B169b0267".toLowerCase(),
Expand Down Expand Up @@ -80,6 +82,8 @@ export const basePoolIdZapDictBsc: IDict<{ address: string, ABI: any }> = {};

export const basePoolIdZapDictFraxtal: IDict<{ address: string, ABI: any }> = {};

export const basePoolIdZapDictXLayer: IDict<{ address: string, ABI: any }> = {};

export const CRYPTO_FACTORY_CONSTANTS: { [index: number]: { lpTokenBasePoolIdDict: IDict<string>, basePoolIdZapDict: IDict<{ address: string, ABI: any }> } } = {
1: { // ETH
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictEthereum,
Expand All @@ -101,6 +105,10 @@ export const CRYPTO_FACTORY_CONSTANTS: { [index: number]: { lpTokenBasePoolIdDic
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictPolygon,
basePoolIdZapDict: basePoolIdZapDictPolygon,
},
196: { // X-LAYER
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictXLayer,
basePoolIdZapDict: basePoolIdZapDictXLayer,
},
250: { // FANTOM
lpTokenBasePoolIdDict: lpTokenBasePoolIdDictFantom,
basePoolIdZapDict: basePoolIdZapDictFantom,
Expand Down

0 comments on commit eea4e02

Please sign in to comment.