cjs -> esm

This commit is contained in:
Den Great
2024-06-11 21:57:54 +08:00
parent bdbac70be6
commit d93578d03f
20 changed files with 20 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import clone from 'just-clone';
import { ERC20__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { ERC20__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import { APPROVE_ERC20_GAS_LIMIT, NATIVE_CURRENCY_PRECISION } from './constants/index.js';
import type {
AggregatedBalanceRequirement, ApproveFix, Asset, BalanceIssue, BalanceRequirement, Source,

View File

@@ -1,6 +1,6 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard.js';
import getAvailableSources from '../../utils/getAvailableFundsSources.js';

View File

@@ -1,4 +1,4 @@
import { SwapExecutor__factory, AeroPool__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { SwapExecutor__factory, AeroPool__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import { type BigNumberish, JsonRpcProvider } from "ethers"
import { SafeArray } from "../../../utils/safeGetters.js"
import { addCallParams } from "./utils.js"

View File

@@ -2,7 +2,7 @@ import {
SwapExecutor__factory,
CurveRegistry__factory,
ERC20__factory,
} from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js";
} from "@orionprotocol/contracts/lib/ethers-v6/index.js";
import { MaxUint256, type BigNumberish, type JsonRpcProvider } from "ethers";
import { addCallParams, pathCallWithBalance } from "./utils.js";
import type { SingleSwap } from "../../../types.js";

View File

@@ -1,4 +1,4 @@
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import type { BigNumberish, AddressLike } from "ethers"
import { type CallParams, addCallParams } from "./utils.js"

View File

@@ -1,4 +1,4 @@
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import type { BigNumberish, AddressLike } from "ethers"
import { type CallParams, addCallParams } from "./utils.js"

View File

@@ -1,4 +1,4 @@
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import { SafeArray } from "../../../utils/safeGetters.js"
import { type BytesLike, type BigNumberish, concat, ethers, toBeHex } from "ethers"
import { addCallParams } from "./utils.js"

View File

@@ -1,4 +1,4 @@
import { SwapExecutor__factory, UniswapV3Pool__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { SwapExecutor__factory, UniswapV3Pool__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import { type BigNumberish , ethers, JsonRpcProvider } from "ethers"
import { SafeArray } from "../../../utils/safeGetters.js"
import { addCallParams } from "./utils.js"

View File

@@ -1,4 +1,4 @@
import { ERC20__factory, SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { ERC20__factory, SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import type { AddressLike } from "ethers"
import { type BytesLike, ethers, type BigNumberish } from "ethers"

View File

@@ -1,4 +1,4 @@
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js"
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import type { BigNumberish } from "ethers"
import { type CallParams, addCallParams } from "./utils.js"
import type { AddressLike } from "ethers"

View File

@@ -1,6 +1,6 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard.js';
import type Unit from '../index.js';

View File

@@ -1,4 +1,4 @@
import type { LibValidator } from '@orionprotocol/contracts/lib/ethers-v6-cjs/Exchange.js';
import type { LibValidator } from '@orionprotocol/contracts/lib/ethers-v6/Exchange.js';
import { ethers, ZeroAddress } from 'ethers';
import type { AddressLike, JsonRpcProvider, BigNumberish, BytesLike } from 'ethers';
import cloneDeep from 'lodash.clonedeep';

View File

@@ -1,6 +1,6 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard.js';
import getAvailableSources from '../../utils/getAvailableFundsSources.js';

View File

@@ -1,6 +1,6 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard.js';
import getAvailableSources from '../../utils/getAvailableFundsSources.js';

View File

@@ -1,6 +1,6 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard.js';
import type Unit from '../index.js';

View File

@@ -4,7 +4,7 @@ import {pmmOrderSchema} from "./schemas/order";
import {simpleFetch} from "simple-typed-fetch";
import {ethers, Wallet} from "ethers";
import {BigNumber} from "bignumber.js";
import { ERC20__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { ERC20__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import {orionRFQContractABI} from "./abi/OrionRFQ";
export default class Pmm {

View File

@@ -1,4 +1,4 @@
import { ERC20__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { ERC20__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import { ethers } from 'ethers';
import invariant from 'tiny-invariant';

View File

@@ -1,4 +1,4 @@
import { ERC20__factory, Exchange__factory, type Exchange } from "@orionprotocol/contracts/lib/ethers-v6-cjs/index.js";
import { ERC20__factory, Exchange__factory, type Exchange } from "@orionprotocol/contracts/lib/ethers-v6/index.js";
import type { BigNumber } from "bignumber.js";
import { ZeroAddress, ethers } from "ethers";
import { INTERNAL_PROTOCOL_PRECISION, NATIVE_CURRENCY_PRECISION } from "../constants/index.js";

View File

@@ -1,4 +1,4 @@
import type { Exchange } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import type { Exchange } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import type { BigNumber } from 'bignumber.js';
import type { ethers } from 'ethers';
import type { Aggregator } from '../services/Aggregator/index.js';

View File

@@ -1,4 +1,4 @@
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6-cjs/index.js';
import { Exchange__factory } from '@orionprotocol/contracts/lib/ethers-v6/index.js';
import { ethers } from 'ethers';
import { z } from 'zod';