Skip to content

Commit

Permalink
fix: refactor import paths to fix generated types (#1130)
Browse files Browse the repository at this point in the history
Co-authored-by: Jimmy Hardwick <[email protected]>
  • Loading branch information
CodeSchwert and jwhardwick authored Nov 9, 2023
1 parent 8f5983d commit cd3f434
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/internal/dex/sdk/src/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Environment, ImmutableConfiguration } from '@imtbl/config';
import { ChainNotSupportedError, InvalidConfigurationError } from 'errors';
import * as test from 'test/utils';
import { ERC20 } from 'types';
import { ExchangeModuleConfiguration, ExchangeOverrides } from '../types';
import { ExchangeConfiguration, ExchangeContracts } from './index';
import { ExchangeContracts, ExchangeModuleConfiguration, ExchangeOverrides } from '../types';
import { ExchangeConfiguration } from './index';
import { IMMUTABLE_TESTNET_CHAIN_ID } from '../constants/chains';

describe('ExchangeConfiguration', () => {
Expand Down
10 changes: 1 addition & 9 deletions packages/internal/dex/sdk/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Environment, ImmutableConfiguration } from '@imtbl/config';
import { ChainNotSupportedError, InvalidConfigurationError } from 'errors';
import { isValidNonZeroAddress } from 'lib';
import { ExchangeModuleConfiguration, ExchangeOverrides, SecondaryFee, Chain } from '../types';
import { ExchangeContracts, ExchangeModuleConfiguration, ExchangeOverrides, SecondaryFee, Chain } from '../types';
import {
IMMUTABLE_TESTNET_CHAIN_ID,
IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS,
Expand All @@ -10,14 +10,6 @@ import {
TIMX_IMMUTABLE_TESTNET,
} from '../constants';

export type ExchangeContracts = {
multicall: string;
coreFactory: string;
quoterV2: string;
peripheryRouter: string;
secondaryFee: string;
};

export const CONTRACTS_FOR_CHAIN_ID: Record<number, ExchangeContracts> = {
[IMMUTABLE_TESTNET_CHAIN_ID]: {
multicall: '0xD17c98b38bA28c7eA1080317EB9AB2b9663BEd92',
Expand Down
9 changes: 8 additions & 1 deletion packages/internal/dex/sdk/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { ethers } from 'ethers';
import { ModuleConfiguration } from '@imtbl/config';
import { ExchangeContracts } from 'config';

export type ExchangeContracts = {
multicall: string;
coreFactory: string;
quoterV2: string;
peripheryRouter: string;
secondaryFee: string;
};

/**
* Type representing a Chain
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/src/genericImxProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ProviderConfiguration } from 'config';
import {
AnyToken,
RegisterUserResponse,
Expand All @@ -19,6 +18,7 @@ import {
EthSigner,
} from '@imtbl/core-sdk';
import { TransactionResponse } from '@ethersproject/providers';
import { ProviderConfiguration } from './config';
import { IMXProvider } from './imxProvider';
import { Signers } from './signable-actions/types';
import { batchTransfer, transfer } from './signable-actions/transfer';
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/src/l1-providers/metaMaskWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProviderConfiguration } from 'config';
import { ProviderConfiguration } from '../config';
import { connect } from './metaMask';
import {
connect as buildImxSigner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@imtbl/core-sdk';
import * as encUtils from 'enc-utils';
import { TransactionResponse } from '@ethersproject/providers';
import { ProviderConfiguration } from 'config';
import { ProviderConfiguration } from '../../config';
import { getEncodeAssetInfo } from './getEncodeAssetInfo';
import {
getSignableRegistrationOnchain,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Signer } from '@ethersproject/abstract-signer';
import { TransactionResponse } from '@ethersproject/providers';
import { Contracts, ImmutableXConfiguration, UsersApi } from '@imtbl/core-sdk';
import { ProviderConfiguration } from 'config';
import { ProviderConfiguration } from '../../config';
import {
getSignableRegistrationOnchain,
isRegisteredOnChain,
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/src/signable-actions/withdrawal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TokenAmount, AnyToken } from '@imtbl/core-sdk';
import { ProviderConfiguration } from 'config';
import { ProviderConfiguration } from '../config';
import { Signers } from './types';
import {
prepareWithdrawalAction,
Expand Down

0 comments on commit cd3f434

Please sign in to comment.