@dhedge/v2-sdk 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/v2-sdk",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "license": "MIT",
5
5
  "description": "🛠 An SDK for building applications on top of dHEDGE V2",
6
6
  "main": "dist/index.js",
@@ -1,7 +1,5 @@
1
1
  import axios from "axios";
2
2
 
3
- const excludedProtocols = ["OPTIMISM_PMM6"]; //Clipper
4
-
5
3
  export async function getOneInchProtocols(chainId: number): Promise<string> {
6
4
  try {
7
5
  const response = await axios.get(
@@ -9,8 +7,9 @@ export async function getOneInchProtocols(chainId: number): Promise<string> {
9
7
  );
10
8
  const protocols = response.data.protocols.map((e: { id: string }) => e.id);
11
9
  const filteredProtocols = protocols.filter(
12
- (e: string) => !excludedProtocols.includes(e)
10
+ (e: string) => !e.includes("PMM")
13
11
  );
12
+
14
13
  return `&protocols=${filteredProtocols.join(",")}`;
15
14
  } catch {
16
15
  return "";
@@ -1,54 +0,0 @@
1
- import { Dhedge } from "..";
2
- import { Dapp, Network } from "../types";
3
- import { TEST_POOL, USDC, WBTC } from "./constants";
4
- import { getTxOptions } from "./txOptions";
5
-
6
- import { wallet } from "./wallet";
7
-
8
- let dhedge: Dhedge;
9
- let options: any;
10
-
11
- jest.setTimeout(100000);
12
-
13
- describe("pool", () => {
14
- beforeAll(async () => {
15
- dhedge = new Dhedge(wallet, Network.OPTIMISM);
16
- options = await getTxOptions(Network.OPTIMISM);
17
- });
18
-
19
- // it("approves unlimited USDC on 1Inch", async () => {
20
- // let result;
21
- // const pool = await dhedge.loadPool(TEST_POOL);
22
- // try {
23
- // result = await pool.approve(
24
- // Dapp.ONEINCH,
25
- // USDC,
26
- // ethers.constants.MaxInt256,
27
- // options
28
- // );
29
- // console.log(result);
30
- // } catch (e) {
31
- // console.log(e);
32
- // }
33
- // expect(result).not.toBe(null);
34
- // });
35
-
36
- it("trades 1 USDC into WBTC on 1Inch", async () => {
37
- let result;
38
- const pool = await dhedge.loadPool(TEST_POOL);
39
- try {
40
- result = await pool.trade(
41
- Dapp.ONEINCH,
42
- USDC,
43
- WBTC,
44
- "1000000",
45
- 0.5,
46
- options
47
- );
48
- console.log(result);
49
- } catch (e) {
50
- console.log(e);
51
- }
52
- expect(result).not.toBe(null);
53
- });
54
- });