@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/dist/v2-sdk.cjs.development.js +7 -5
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +7 -5
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +4 -4
- package/src/services/toros/initWithdrawal.ts +3 -2
- package/src/test/constants.ts +1 -1
- package/src/test/dytm.test.ts +0 -5
- package/src/test/toros.test.ts +27 -25
package/package.json
CHANGED
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]: "
|
|
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]: "
|
|
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: "
|
|
291
|
+
Periphery: ""
|
|
292
292
|
},
|
|
293
293
|
[Network.ETHEREUM]: {
|
|
294
|
-
Periphery: "
|
|
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 {
|
package/src/test/constants.ts
CHANGED
|
@@ -124,7 +124,7 @@ export const CONTRACT_ADDRESS = {
|
|
|
124
124
|
VELO: "",
|
|
125
125
|
COMPOUNDV3_WETH: "0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486",
|
|
126
126
|
FLUID_WETH: "0x45df0656f8adf017590009d2f1898eeca4f0a205",
|
|
127
|
-
TOROS: "
|
|
127
|
+
TOROS: "0x27D8FDb0251B48D8EdD1Ad7bEDf553cF99AbE7B0" //BTCBEAR1X
|
|
128
128
|
},
|
|
129
129
|
[Network.BASE]: {
|
|
130
130
|
USDC: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
package/src/test/dytm.test.ts
CHANGED
|
@@ -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
|
package/src/test/toros.test.ts
CHANGED
|
@@ -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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
|