From f8b52aaa02e259c5e83f8e4b6adfa2bed1dbd25d Mon Sep 17 00:00:00 2001 From: Dmitry <35160421+TheJuze@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:14:52 +0300 Subject: [PATCH 1/4] actualize testnet chains (#260) --- src/__tests__/basic.test.ts | 22 ++------- src/config/chains.json | 91 ------------------------------------- src/config/envs.json | 90 ------------------------------------ src/constants/chains.ts | 6 --- src/types.ts | 57 ++++++++++------------- 5 files changed, 30 insertions(+), 236 deletions(-) diff --git a/src/__tests__/basic.test.ts b/src/__tests__/basic.test.ts index d4de381..76fb063 100644 --- a/src/__tests__/basic.test.ts +++ b/src/__tests__/basic.test.ts @@ -81,7 +81,7 @@ describe('Orion', () => { test('Init Orion testing', () => { const orion = new Orion('testing'); expect(orion.referralSystem).toBeInstanceOf(ReferralSystem); - expect(orion.unitsArray.length).toBe(4); // eth, bsc, polygon, fantom + expect(orion.unitsArray.length).toBe(2); // eth, bsc const unitBSC = orion.units[SupportedChainId.BSC_TESTNET]; expect(unitBSC?.chainId).toBe(SupportedChainId.BSC_TESTNET); @@ -89,23 +89,11 @@ describe('Orion', () => { expect(orion.getSiblingsOf(SupportedChainId.BSC_TESTNET)).toHaveLength(3); expect(unitBSC?.networkCode).toBe('bsc'); - const unitRopsten = orion.units[SupportedChainId.ROPSTEN] - expect(unitRopsten?.chainId).toBe(SupportedChainId.ROPSTEN); + const unitSepolia = orion.units[SupportedChainId.SEPOLIA] + expect(unitSepolia?.chainId).toBe(SupportedChainId.SEPOLIA); // expect(unitRopsten?.env).toBe('testing'); - expect(orion.getSiblingsOf(SupportedChainId.ROPSTEN)).toHaveLength(3); - expect(unitRopsten?.networkCode).toBe('eth'); - - const unitPolygon = orion.units[SupportedChainId.POLYGON_TESTNET]; - expect(unitPolygon?.chainId).toBe(SupportedChainId.POLYGON_TESTNET); - // expect(unitPolygon?.env).toBe('testing'); - expect(orion.getSiblingsOf(SupportedChainId.POLYGON_TESTNET)).toHaveLength(3); - expect(unitPolygon?.networkCode).toBe('polygon'); - - const unitFantom = orion.units[SupportedChainId.FANTOM_TESTNET]; - expect(unitFantom?.chainId).toBe(SupportedChainId.FANTOM_TESTNET); - // expect(unitFantom?.env).toBe('testing'); - expect(orion.getSiblingsOf(SupportedChainId.FANTOM_TESTNET)).toHaveLength(3); - expect(unitFantom?.networkCode).toBe('ftm'); + expect(orion.getSiblingsOf(SupportedChainId.SEPOLIA)).toHaveLength(3); + expect(unitSepolia?.networkCode).toBe('eth'); }); test('Init Orion production', () => { diff --git a/src/config/chains.json b/src/config/chains.json index 3607a21..4afb939 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -51,32 +51,6 @@ "curveRegistry": "" } }, - "3": { - "chainId": "3", - "explorer": "https://ropsten.etherscan.io/", - "label": "Ropsten", - "shortName": "ETH-Ropsten", - "code": "eth", - "rpc": "https://testing.orion.xyz/eth-ropsten/rpc", - "baseCurrencyName": "ETH", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, - "5": { - "chainId": "5", - "explorer": "https://goerli.etherscan.io/", - "label": "Goerli", - "shortName": "ETH-Goerli", - "code": "eth", - "rpc": "https://testing.orion.xyz/eth-goerli/rpc", - "baseCurrencyName": "ETH", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "11155111": { "chainId": "11155111", "explorer": "https://sepolia.etherscan.io/", @@ -90,19 +64,6 @@ "curveRegistry": "" } }, - "421613": { - "chainId": "421613", - "explorer": "https://goerli.arbiscan.io/", - "label": "Arbitrum Goerli", - "shortName": "Arbitrum Goerli", - "code": "arb", - "rpc": "https://goerli-rollup.arbitrum.io/rpc", - "baseCurrencyName": "ETH", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "42161": { "chainId": "42161", "explorer": "https://arbiscan.io/", @@ -116,19 +77,6 @@ "curveRegistry": "0x445FE580eF8d70FF569aB36e80c647af338db351" } }, - "4002": { - "chainId": "4002", - "explorer": "https://testnet.ftmscan.com/", - "label": "Fantom Testnet", - "shortName": "FTM-Testnet", - "code": "ftm", - "rpc": "https://rpc.testnet.fantom.network/", - "baseCurrencyName": "FTM", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "250": { "chainId": "250", "explorer": "https://ftmscan.com/", @@ -155,19 +103,6 @@ "curveRegistry": "0x094d12e5b541784701FD8d65F11fc0598FBC6332" } }, - "80001": { - "chainId": "80001", - "label": "Polygon Mumbai", - "shortName": "Polygon Mumbai", - "code": "polygon", - "baseCurrencyName": "MATIC", - "rpc": "https://rpc.ankr.com/polygon_mumbai", - "explorer": "https://mumbai.polygonscan.com/", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "66": { "chainId": "66", "explorer": "https://www.oklink.com/okc/", @@ -181,32 +116,6 @@ "curveRegistry": "" } }, - "65": { - "chainId": "65", - "explorer": "https://www.oklink.com/okc-test/", - "label": "OKC Testnet", - "shortName": "OKC-Testnet", - "code": "okc", - "rpc": "https://exchaintestrpc.okex.org/", - "baseCurrencyName": "OKT", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, - "56303": { - "chainId": "56303", - "label": "DRIP Chain", - "shortName": "DRIP Chain", - "code": "drip", - "baseCurrencyName": "DRIP", - "rpc": "https://testnet.1d.rip/", - "explorer": "https://explorer-testnet.1d.rip/", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "2525": { "chainId": "2525", "label": "inEVM", diff --git a/src/config/envs.json b/src/config/envs.json index adaf1ce..445649e 100644 --- a/src/config/envs.json +++ b/src/config/envs.json @@ -244,78 +244,6 @@ "http": "/orion-indexer/" } } - }, - "421613": { - "api": "https://testing.orion.xyz/arbitrum-goerli", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } - }, - "4002": { - "api": "https://testing.orion.xyz/ftm-testnet", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } - }, - "80001": { - "api": "https://testing.orion.xyz/polygon-mumbai", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } - }, - "56303": { - "api": "https://testing.orion.xyz/drip-testnet", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } } } }, @@ -544,24 +472,6 @@ "http": "/orion-indexer/" } } - }, - "3": { - "api": "https://dn-dev.orion.xyz/eth-ropsten", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } } } }, diff --git a/src/constants/chains.ts b/src/constants/chains.ts index df0bd2f..621b947 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -2,13 +2,7 @@ import { SupportedChainId } from '../types.js'; export const developmentChains = [ SupportedChainId.BSC_TESTNET, - SupportedChainId.ROPSTEN, - SupportedChainId.GOERLI, SupportedChainId.SEPOLIA, - SupportedChainId.ARBITRUM_GOERLI, - SupportedChainId.FANTOM_TESTNET, - SupportedChainId.POLYGON_TESTNET, - SupportedChainId.OKC_TESTNET, ]; export const productionChains = [ SupportedChainId.MAINNET, diff --git a/src/types.ts b/src/types.ts index c02bc8f..72ec8dc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -82,26 +82,19 @@ export type Pair = { export enum SupportedChainId { MAINNET = '1', - ARBITRUM = '42161', - FANTOM_OPERA = '250', - POLYGON = '137', - OKC = '66', - OPBNB = '204', - INEVM = '2525', - LINEA = '59144', - AVAX = '43114', - BASE = '8453', - - ROPSTEN = '3', - GOERLI = '5', - SEPOLIA = '11155111', - POLYGON_TESTNET = '80001', - FANTOM_TESTNET = '4002', BSC = '56', + OKC = '66', + POLYGON = '137', + OPBNB = '204', + FANTOM_OPERA = '250', + INEVM = '2525', + BASE = '8453', + ARBITRUM = '42161', + AVAX = '43114', + LINEA = '59144', + BSC_TESTNET = '97', - OKC_TESTNET = '65', - DRIP_TESTNET = '56303', - ARBITRUM_GOERLI = '421613', + SEPOLIA = '11155111', // For testing and debug purpose // BROKEN = '0', @@ -291,22 +284,22 @@ export type EnvConfig = { referralAPI: string frontageAPI: string networks: Partial< - Record< - SupportedChainId, - VerboseUnitConfig + Record< + SupportedChainId, + VerboseUnitConfig + > > - > } export type AggregatedAssets = Partial< - Record< - string, - Partial< - Record + Record< + string, + Partial< + Record + > > - > - >; +>; export type RedeemOrder = { sender: string @@ -446,9 +439,9 @@ type BridgeHistory = Awaited>; type BridgeHistoryItem = NonNullable; export type AtomicSwap = Partial< - Omit + Omit > & Partial< - Omit + Omit > & { sourceChainId: SupportedChainId targetChainId: SupportedChainId From bdbac70be6f93dc5b0e74b9ea600be09253fb6b7 Mon Sep 17 00:00:00 2001 From: TheJuze Date: Tue, 11 Jun 2024 16:15:33 +0300 Subject: [PATCH 2/4] bump v --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index aebbd2f..b0d5b2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@orionprotocol/sdk", - "version": "0.22.3", + "version": "0.22.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@orionprotocol/sdk", - "version": "0.22.3", + "version": "0.22.4", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 539209a..0be1c52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.22.3", + "version": "0.22.4", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", From d93578d03f7d48c8b600388b06d173c6d5ccc274 Mon Sep 17 00:00:00 2001 From: Den Great Date: Tue, 11 Jun 2024 21:57:54 +0800 Subject: [PATCH 3/4] cjs -> esm --- src/BalanceGuard.ts | 2 +- src/Orion/bridge/swap.ts | 2 +- src/Unit/Exchange/callGenerators/aero.ts | 2 +- src/Unit/Exchange/callGenerators/curve.ts | 2 +- src/Unit/Exchange/callGenerators/erc20.ts | 2 +- src/Unit/Exchange/callGenerators/feePayment.ts | 2 +- src/Unit/Exchange/callGenerators/uniswapV2.ts | 2 +- src/Unit/Exchange/callGenerators/uniswapV3.ts | 2 +- src/Unit/Exchange/callGenerators/utils.ts | 2 +- src/Unit/Exchange/callGenerators/weth.ts | 2 +- src/Unit/Exchange/deposit.ts | 2 +- src/Unit/Exchange/generateSwapCalldata.ts | 2 +- src/Unit/Exchange/swapLimit.ts | 2 +- src/Unit/Exchange/swapMarket.ts | 2 +- src/Unit/Exchange/withdraw.ts | 2 +- src/Unit/Pmm/index.ts | 2 +- src/utils/checkIsToken.ts | 2 +- src/utils/getBalance.ts | 2 +- src/utils/getBalances.ts | 2 +- src/utils/parseExchangeTradeTransaction.ts | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/BalanceGuard.ts b/src/BalanceGuard.ts index 2308313..9d0b881 100644 --- a/src/BalanceGuard.ts +++ b/src/BalanceGuard.ts @@ -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, diff --git a/src/Orion/bridge/swap.ts b/src/Orion/bridge/swap.ts index f527fbd..4bb8352 100644 --- a/src/Orion/bridge/swap.ts +++ b/src/Orion/bridge/swap.ts @@ -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'; diff --git a/src/Unit/Exchange/callGenerators/aero.ts b/src/Unit/Exchange/callGenerators/aero.ts index fc235fd..755c49a 100644 --- a/src/Unit/Exchange/callGenerators/aero.ts +++ b/src/Unit/Exchange/callGenerators/aero.ts @@ -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" diff --git a/src/Unit/Exchange/callGenerators/curve.ts b/src/Unit/Exchange/callGenerators/curve.ts index 596854e..6b9de2b 100644 --- a/src/Unit/Exchange/callGenerators/curve.ts +++ b/src/Unit/Exchange/callGenerators/curve.ts @@ -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"; diff --git a/src/Unit/Exchange/callGenerators/erc20.ts b/src/Unit/Exchange/callGenerators/erc20.ts index cc823d6..b32efce 100644 --- a/src/Unit/Exchange/callGenerators/erc20.ts +++ b/src/Unit/Exchange/callGenerators/erc20.ts @@ -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" diff --git a/src/Unit/Exchange/callGenerators/feePayment.ts b/src/Unit/Exchange/callGenerators/feePayment.ts index ccff002..a16f4b1 100644 --- a/src/Unit/Exchange/callGenerators/feePayment.ts +++ b/src/Unit/Exchange/callGenerators/feePayment.ts @@ -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" diff --git a/src/Unit/Exchange/callGenerators/uniswapV2.ts b/src/Unit/Exchange/callGenerators/uniswapV2.ts index 53d26b5..4fa1566 100644 --- a/src/Unit/Exchange/callGenerators/uniswapV2.ts +++ b/src/Unit/Exchange/callGenerators/uniswapV2.ts @@ -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" diff --git a/src/Unit/Exchange/callGenerators/uniswapV3.ts b/src/Unit/Exchange/callGenerators/uniswapV3.ts index 2da58f1..67bfcec 100644 --- a/src/Unit/Exchange/callGenerators/uniswapV3.ts +++ b/src/Unit/Exchange/callGenerators/uniswapV3.ts @@ -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" diff --git a/src/Unit/Exchange/callGenerators/utils.ts b/src/Unit/Exchange/callGenerators/utils.ts index bf0c812..b61dc4b 100644 --- a/src/Unit/Exchange/callGenerators/utils.ts +++ b/src/Unit/Exchange/callGenerators/utils.ts @@ -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" diff --git a/src/Unit/Exchange/callGenerators/weth.ts b/src/Unit/Exchange/callGenerators/weth.ts index 1e2b7e3..059e3c7 100644 --- a/src/Unit/Exchange/callGenerators/weth.ts +++ b/src/Unit/Exchange/callGenerators/weth.ts @@ -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" diff --git a/src/Unit/Exchange/deposit.ts b/src/Unit/Exchange/deposit.ts index 93f4d71..d257244 100644 --- a/src/Unit/Exchange/deposit.ts +++ b/src/Unit/Exchange/deposit.ts @@ -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'; diff --git a/src/Unit/Exchange/generateSwapCalldata.ts b/src/Unit/Exchange/generateSwapCalldata.ts index 1b7b350..94d53d9 100644 --- a/src/Unit/Exchange/generateSwapCalldata.ts +++ b/src/Unit/Exchange/generateSwapCalldata.ts @@ -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'; diff --git a/src/Unit/Exchange/swapLimit.ts b/src/Unit/Exchange/swapLimit.ts index b2d4886..19ae300 100644 --- a/src/Unit/Exchange/swapLimit.ts +++ b/src/Unit/Exchange/swapLimit.ts @@ -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'; diff --git a/src/Unit/Exchange/swapMarket.ts b/src/Unit/Exchange/swapMarket.ts index 20a0d99..934e2bb 100644 --- a/src/Unit/Exchange/swapMarket.ts +++ b/src/Unit/Exchange/swapMarket.ts @@ -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'; diff --git a/src/Unit/Exchange/withdraw.ts b/src/Unit/Exchange/withdraw.ts index 7e400d7..9b5d2d7 100644 --- a/src/Unit/Exchange/withdraw.ts +++ b/src/Unit/Exchange/withdraw.ts @@ -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'; diff --git a/src/Unit/Pmm/index.ts b/src/Unit/Pmm/index.ts index 1c8b1f5..d4f1c57 100644 --- a/src/Unit/Pmm/index.ts +++ b/src/Unit/Pmm/index.ts @@ -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 { diff --git a/src/utils/checkIsToken.ts b/src/utils/checkIsToken.ts index d55c45d..5be176a 100644 --- a/src/utils/checkIsToken.ts +++ b/src/utils/checkIsToken.ts @@ -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'; diff --git a/src/utils/getBalance.ts b/src/utils/getBalance.ts index 10b3838..91ab443 100644 --- a/src/utils/getBalance.ts +++ b/src/utils/getBalance.ts @@ -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"; diff --git a/src/utils/getBalances.ts b/src/utils/getBalances.ts index 02527cc..f9e5390 100644 --- a/src/utils/getBalances.ts +++ b/src/utils/getBalances.ts @@ -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'; diff --git a/src/utils/parseExchangeTradeTransaction.ts b/src/utils/parseExchangeTradeTransaction.ts index 7f63a85..9b59093 100644 --- a/src/utils/parseExchangeTradeTransaction.ts +++ b/src/utils/parseExchangeTradeTransaction.ts @@ -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'; From 1263edc3d24d69e9808f04ba602d300cff4ac22f Mon Sep 17 00:00:00 2001 From: TheJuze Date: Tue, 11 Jun 2024 17:23:45 +0300 Subject: [PATCH 4/4] bump v --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0d5b2c..6d92660 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@orionprotocol/sdk", - "version": "0.22.4", + "version": "0.22.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@orionprotocol/sdk", - "version": "0.22.4", + "version": "0.22.5", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 0be1c52..f628cfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.22.4", + "version": "0.22.5", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js",