@dhedge/v2-sdk 2.2.2 → 2.2.4

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": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "license": "MIT",
5
5
  "description": "🛠 An SDK for building applications on top of dHEDGE V2",
6
6
  "main": "dist/index.js",
package/src/config.ts CHANGED
@@ -62,7 +62,7 @@ export const routerAddress: AddressDappNetworkMap = {
62
62
  [Dapp.ODOS]: "0x0D05a7D3448512B78fa8A9e46c4872C88C4a0D05",
63
63
  [Dapp.PENDLE]: "0x888888888889758F76e7103c6CbF23ABbF58F946",
64
64
  [Dapp.KYBERSWAP]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
65
- [Dapp.DYTM]: "0x0fF1CEE337d7af25eEF4c1a7A2CaF83f98d80001"
65
+ [Dapp.DYTM]: ""
66
66
  },
67
67
  [Network.BASE]: {
68
68
  [Dapp.ONEINCH]: "0x111111125421ca6dc452d289314280a0f8842a65",
@@ -80,7 +80,7 @@ export const routerAddress: AddressDappNetworkMap = {
80
80
  [Dapp.ONEINCH]: "0x111111125421ca6dc452d289314280a0f8842a65",
81
81
  [Dapp.KYBERSWAP]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
82
82
  [Dapp.ONDO]: "0xde41399145F23936b03dD1474eC16c1519c0DC2a",
83
- [Dapp.DYTM]: "0x0ff1ce991105DD1a8e26bC8a974Fd0154398Df0f"
83
+ [Dapp.DYTM]: "0x0ff1ceB93DbADfB13722058D60c4B8cD122b06ea"
84
84
  },
85
85
  [Network.PLASMA]: {
86
86
  [Dapp.AAVEV3]: "0x925a2A7214Ed92428B5b1B090F80b25700095e12",
@@ -288,9 +288,9 @@ export const dytmContractAddresses: Readonly<Partial<
288
288
  >
289
289
  >> = {
290
290
  [Network.ARBITRUM]: {
291
- Periphery: "0x1FBe7Bb394BE505C08e9ee419Dd166c71004e51B"
291
+ Periphery: ""
292
292
  },
293
293
  [Network.ETHEREUM]: {
294
- Periphery: "0xbc632a1A4bD878D7e7D14ea6CfE0DDe3Fc291D1a"
294
+ Periphery: "0xfA03F9Ce907006133a0E77796a31c40AC22151d5"
295
295
  }
296
296
  };
@@ -24,12 +24,13 @@ const getCalculateSwapDataParams = async (
24
24
  const aaveAssetGuard = new ethers.Contract(
25
25
  aaveAssetGuardAddress,
26
26
  AaveLendingPoolAssetGuardAbi,
27
- pool.signer
27
+ pool.signer.provider
28
28
  );
29
29
  const swapDataParams = await aaveAssetGuard.callStatic.calculateSwapDataParams(
30
30
  torosAsset,
31
31
  amountIn,
32
- slippage
32
+ slippage,
33
+ { from: ethers.constants.AddressZero }
33
34
  );
34
35
 
35
36
  return {
@@ -124,7 +124,7 @@ export const CONTRACT_ADDRESS = {
124
124
  VELO: "",
125
125
  COMPOUNDV3_WETH: "0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486",
126
126
  FLUID_WETH: "0x45df0656f8adf017590009d2f1898eeca4f0a205",
127
- TOROS: "0xA6711f8a184E352c5A0714a48912cD33ca4a16A0" //DYTMT
127
+ TOROS: "0x27D8FDb0251B48D8EdD1Ad7bEDf553cF99AbE7B0" //BTCBEAR1X
128
128
  },
129
129
  [Network.BASE]: {
130
130
  USDC: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
@@ -230,11 +230,6 @@ const testDytm = ({ network, wallet, provider }: TestingRunParams) => {
230
230
  });
231
231
  };
232
232
 
233
- testingHelper({
234
- network: Network.ARBITRUM,
235
- testingRun: testDytm
236
- });
237
-
238
233
  testingHelper({
239
234
  network: Network.ETHEREUM,
240
235
  testingRun: testDytm
@@ -44,6 +44,8 @@ const testToros = ({ wallet, network, provider }: TestingRunParams) => {
44
44
  await pool.managerLogic.connect(signer).setTrader(wallet.address);
45
45
  const newAssets = [
46
46
  [USDC, true],
47
+ [TOROS, false],
48
+ [routerAddress[network].toros, false],
47
49
  [TOROS, false]
48
50
  ];
49
51
  await pool.managerLogic.connect(signer).changeAssets(newAssets, []);
@@ -117,32 +119,32 @@ const testToros = ({ wallet, network, provider }: TestingRunParams) => {
117
119
  expect(completeWithdrawResult.txData).toBeDefined();
118
120
  });
119
121
 
120
- it("init Toros Token for withdrawal", async () => {
121
- await provider.send("evm_increaseTime", [86400]);
122
- await provider.send("evm_mine", []);
123
- const torosBalance = await pool.utils.getBalance(TOROS, pool.address);
124
- await pool.approve(Dapp.TOROS, TOROS, MAX_AMOUNT);
125
- await pool.trade(Dapp.TOROS, TOROS, USDC, torosBalance, 1.5);
126
- const torosBalanceDelta = await balanceDelta(
127
- pool.address,
128
- TOROS,
129
- pool.signer
130
- );
131
- expect(torosBalanceDelta.lt(0)).toBe(true);
132
- });
122
+ // it("init Toros Token for withdrawal", async () => {
123
+ // await provider.send("evm_increaseTime", [86400]);
124
+ // await provider.send("evm_mine", []);
125
+ // const torosBalance = await pool.utils.getBalance(TOROS, pool.address);
126
+ // await pool.approve(Dapp.TOROS, TOROS, MAX_AMOUNT);
127
+ // await pool.trade(Dapp.TOROS, TOROS, USDC, torosBalance, 1.5);
128
+ // const torosBalanceDelta = await balanceDelta(
129
+ // pool.address,
130
+ // TOROS,
131
+ // pool.signer
132
+ // );
133
+ // expect(torosBalanceDelta.lt(0)).toBe(true);
134
+ // });
133
135
 
134
- it("complete withdrawal from Toros asset", async () => {
135
- // Advance chain time past the Toros withdrawal cooldown
136
- await provider.send("evm_increaseTime", [600]);
137
- await provider.send("evm_mine", []);
138
- await pool.completeTorosWithdrawal(USDC, 1.5);
139
- const usdcBalanceDelta = await balanceDelta(
140
- pool.address,
141
- USDC,
142
- pool.signer
143
- );
144
- expect(usdcBalanceDelta.gt(0)).toBe(true);
145
- });
136
+ // it("complete withdrawal from Toros asset", async () => {
137
+ // // Advance chain time past the Toros withdrawal cooldown
138
+ // await provider.send("evm_increaseTime", [600]);
139
+ // await provider.send("evm_mine", []);
140
+ // await pool.completeTorosWithdrawal(USDC, 1.5);
141
+ // const usdcBalanceDelta = await balanceDelta(
142
+ // pool.address,
143
+ // USDC,
144
+ // pool.signer
145
+ // );
146
+ // expect(usdcBalanceDelta.gt(0)).toBe(true);
147
+ // });
146
148
  });
147
149
  };
148
150