@enzymefinance/testutils 4.0.0-next.7 → 4.0.0
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/CHANGELOG.md +24 -0
- package/dist/declarations/src/deployment.d.ts +6 -13
- package/dist/declarations/src/scaffolding/extensions/external-positions/aave-debt.d.ts +51 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +1 -183
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +0 -1
- package/dist/enzymefinance-testutils.browser.cjs.js +213 -483
- package/dist/enzymefinance-testutils.browser.esm.js +209 -462
- package/dist/enzymefinance-testutils.cjs.dev.js +213 -483
- package/dist/enzymefinance-testutils.cjs.prod.js +213 -483
- package/dist/enzymefinance-testutils.esm.js +209 -462
- package/package.json +2 -2
- package/src/deployment.ts +8 -17
- package/src/scaffolding/extensions/external-positions/aave-debt.ts +179 -0
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/integrations/curve.ts +1 -676
- package/src/scaffolding/extensions/integrations/index.ts +0 -1
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +0 -23
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +0 -70
@@ -1,23 +0,0 @@
|
|
1
|
-
import type { AddressLike } from '@enzymefinance/ethers';
|
2
|
-
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
3
|
-
import type { ComptrollerLib, IntegrationManager, ParaSwapV4Adapter, ParaSwapV4Path, StandardToken } from '@enzymefinance/protocol';
|
4
|
-
import type { BigNumberish } from 'ethers';
|
5
|
-
import { utils } from 'ethers';
|
6
|
-
export declare function paraSwapV4GenerateDummyPaths({ toTokens }: {
|
7
|
-
toTokens: AddressLike[];
|
8
|
-
}): {
|
9
|
-
routes: never[];
|
10
|
-
to: AddressLike;
|
11
|
-
totalNetworkFee: number;
|
12
|
-
}[];
|
13
|
-
export declare function paraSwapV4TakeOrder({ comptrollerProxy, integrationManager, fundOwner, paraSwapV4Adapter, outgoingAsset, outgoingAssetAmount, minIncomingAssetAmount, expectedIncomingAssetAmount, paths, }: {
|
14
|
-
comptrollerProxy: ComptrollerLib;
|
15
|
-
integrationManager: IntegrationManager;
|
16
|
-
fundOwner: SignerWithAddress;
|
17
|
-
paraSwapV4Adapter: ParaSwapV4Adapter;
|
18
|
-
outgoingAsset: StandardToken;
|
19
|
-
outgoingAssetAmount?: BigNumberish;
|
20
|
-
minIncomingAssetAmount?: BigNumberish;
|
21
|
-
expectedIncomingAssetAmount?: BigNumberish;
|
22
|
-
paths: ParaSwapV4Path[];
|
23
|
-
}): Promise<import("@enzymefinance/ethers").ContractReceipt<import("@enzymefinance/ethers").SendFunction<[_extension: AddressLike, _actionId: BigNumberish, _callArgs: utils.BytesLike], void, ComptrollerLib>>>;
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import type { AddressLike } from '@enzymefinance/ethers';
|
2
|
-
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
3
|
-
import type {
|
4
|
-
ComptrollerLib,
|
5
|
-
IntegrationManager,
|
6
|
-
ParaSwapV4Adapter,
|
7
|
-
ParaSwapV4Path,
|
8
|
-
StandardToken,
|
9
|
-
} from '@enzymefinance/protocol';
|
10
|
-
import {
|
11
|
-
callOnIntegrationArgs,
|
12
|
-
IntegrationManagerActionId,
|
13
|
-
paraSwapV4TakeOrderArgs,
|
14
|
-
takeOrderSelector,
|
15
|
-
} from '@enzymefinance/protocol';
|
16
|
-
import type { BigNumberish } from 'ethers';
|
17
|
-
import { utils } from 'ethers';
|
18
|
-
|
19
|
-
// ParaSwapV4Path
|
20
|
-
export function paraSwapV4GenerateDummyPaths({ toTokens }: { toTokens: AddressLike[] }) {
|
21
|
-
return toTokens.map((toToken) => {
|
22
|
-
return {
|
23
|
-
// Not supported in our protocol
|
24
|
-
routes: [],
|
25
|
-
|
26
|
-
to: toToken,
|
27
|
-
totalNetworkFee: 0, // Can ignore this param in the dummy
|
28
|
-
};
|
29
|
-
});
|
30
|
-
}
|
31
|
-
|
32
|
-
export async function paraSwapV4TakeOrder({
|
33
|
-
comptrollerProxy,
|
34
|
-
integrationManager,
|
35
|
-
fundOwner,
|
36
|
-
paraSwapV4Adapter,
|
37
|
-
outgoingAsset,
|
38
|
-
outgoingAssetAmount = utils.parseEther('1'),
|
39
|
-
minIncomingAssetAmount = 1,
|
40
|
-
expectedIncomingAssetAmount = minIncomingAssetAmount,
|
41
|
-
paths,
|
42
|
-
}: {
|
43
|
-
comptrollerProxy: ComptrollerLib;
|
44
|
-
integrationManager: IntegrationManager;
|
45
|
-
fundOwner: SignerWithAddress;
|
46
|
-
paraSwapV4Adapter: ParaSwapV4Adapter;
|
47
|
-
outgoingAsset: StandardToken;
|
48
|
-
outgoingAssetAmount?: BigNumberish;
|
49
|
-
minIncomingAssetAmount?: BigNumberish;
|
50
|
-
expectedIncomingAssetAmount?: BigNumberish;
|
51
|
-
paths: ParaSwapV4Path[];
|
52
|
-
}) {
|
53
|
-
const takeOrderArgs = paraSwapV4TakeOrderArgs({
|
54
|
-
expectedIncomingAssetAmount,
|
55
|
-
minIncomingAssetAmount,
|
56
|
-
outgoingAsset,
|
57
|
-
outgoingAssetAmount,
|
58
|
-
paths,
|
59
|
-
});
|
60
|
-
|
61
|
-
const callArgs = callOnIntegrationArgs({
|
62
|
-
adapter: paraSwapV4Adapter,
|
63
|
-
encodedCallArgs: takeOrderArgs,
|
64
|
-
selector: takeOrderSelector,
|
65
|
-
});
|
66
|
-
|
67
|
-
return comptrollerProxy
|
68
|
-
.connect(fundOwner)
|
69
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
70
|
-
}
|