@dhedge/v2-sdk 1.11.0 → 2.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/dist/entities/pool.d.ts +4 -4
- package/dist/services/compound/lending.d.ts +4 -3
- package/dist/services/odos/index.d.ts +4 -1
- package/dist/services/pendle/index.d.ts +4 -1
- package/dist/test/constants.d.ts +5 -0
- package/dist/v2-sdk.cjs.development.js +422 -125
- 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 +422 -125
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/fluid/IFToken.json +27 -0
- package/src/abi/pendle/PT.json +15 -0
- package/src/abi/pendle/SY.json +1 -0
- package/src/entities/pool.ts +25 -14
- package/src/services/compound/lending.ts +50 -11
- package/src/services/odos/index.ts +5 -2
- package/src/services/pendle/index.ts +43 -8
- package/src/test/constants.ts +5 -0
- package/src/test/fluid.test.ts +90 -0
- package/src/test/odos.test.ts +8 -7
- package/src/test/oneInch.test.ts +20 -22
- package/src/test/pendle.test.ts +63 -37
- package/src/utils/contract.ts +32 -6
package/dist/entities/pool.d.ts
CHANGED
|
@@ -178,8 +178,8 @@ export declare class Pool {
|
|
|
178
178
|
*/
|
|
179
179
|
lend(dapp: Dapp, asset: string, amount: BigNumber | string, referralCode?: number, options?: any, estimateGas?: boolean): Promise<any>;
|
|
180
180
|
/**
|
|
181
|
-
* Lend asset to a Compound V3
|
|
182
|
-
* @param {string} market Address of
|
|
181
|
+
* Lend asset to a Compound V3 or Fluid lending pool
|
|
182
|
+
* @param {string} market Address of cToken or fToken
|
|
183
183
|
* @param {string} asset Asset
|
|
184
184
|
* @param {BigNumber | string} amount Amount of asset to lend
|
|
185
185
|
* @param {any} options Transaction options
|
|
@@ -198,8 +198,8 @@ export declare class Pool {
|
|
|
198
198
|
*/
|
|
199
199
|
withdrawDeposit(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any, estimateGas?: boolean): Promise<any>;
|
|
200
200
|
/**
|
|
201
|
-
* Witdraw asset from a
|
|
202
|
-
* @param {string} market Address of
|
|
201
|
+
* Witdraw asset from a Compound V3 or Fluid lending pool
|
|
202
|
+
* @param {string} market Address of cToken or fToken
|
|
203
203
|
* @param {string} asset Asset
|
|
204
204
|
* @param {BigNumber | string} amount Amount of asset to withdraw
|
|
205
205
|
* @param {any} options Transaction options
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { ethers } from "../..";
|
|
2
|
-
export declare function getCompoundV3LendTxData(asset: string, amount: ethers.BigNumber | string): string
|
|
3
|
-
export declare function getCompoundV3WithdrawTxData(asset: string, amount: ethers.BigNumber | string): string
|
|
1
|
+
import { ethers, Pool } from "../..";
|
|
2
|
+
export declare function getCompoundV3LendTxData(pool: Pool, market: string, asset: string, amount: ethers.BigNumber | string): Promise<string>;
|
|
3
|
+
export declare function getCompoundV3WithdrawTxData(pool: Pool, market: string, asset: string, amount: ethers.BigNumber | string): Promise<string>;
|
|
4
|
+
export declare function isCompoundV3Market(pool: Pool, market: string): Promise<boolean>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { ethers } from "../..";
|
|
2
2
|
import { Pool } from "../../entities";
|
|
3
|
-
export declare function getOdosSwapTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<
|
|
3
|
+
export declare function getOdosSwapTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<{
|
|
4
|
+
swapTxData: string;
|
|
5
|
+
minAmountOut: string;
|
|
6
|
+
}>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ethers } from "../..";
|
|
2
2
|
import { Pool } from "../../entities";
|
|
3
|
-
export declare function getPendleSwapTxData(pool: Pool, tokenIn: string, tokenOut: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<
|
|
3
|
+
export declare function getPendleSwapTxData(pool: Pool, tokenIn: string, tokenOut: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<{
|
|
4
|
+
swapTxData: string;
|
|
5
|
+
minAmountOut: string | null;
|
|
6
|
+
}>;
|
|
4
7
|
export declare function getMarket(pool: Pool, tokenIn: string, tokenOut: string): Promise<string>;
|
package/dist/test/constants.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare const CONTRACT_ADDRESS: {
|
|
|
37
37
|
VELODROME_CL_USDC_WETH_GAUGE: string;
|
|
38
38
|
VELO: string;
|
|
39
39
|
COMPOUNDV3_WETH: string;
|
|
40
|
+
FLUID_WETH: string;
|
|
40
41
|
TOROS: string;
|
|
41
42
|
UNIT: string;
|
|
42
43
|
};
|
|
@@ -58,6 +59,7 @@ export declare const CONTRACT_ADDRESS: {
|
|
|
58
59
|
VELODROME_CL_USDC_WETH_GAUGE: string;
|
|
59
60
|
VELO: string;
|
|
60
61
|
COMPOUNDV3_WETH: string;
|
|
62
|
+
FLUID_WETH: string;
|
|
61
63
|
TOROS: string;
|
|
62
64
|
};
|
|
63
65
|
arbitrum: {
|
|
@@ -80,6 +82,7 @@ export declare const CONTRACT_ADDRESS: {
|
|
|
80
82
|
VELODROME_CL_USDC_WETH_GAUGE: string;
|
|
81
83
|
VELO: string;
|
|
82
84
|
COMPOUNDV3_WETH: string;
|
|
85
|
+
FLUID_WETH: string;
|
|
83
86
|
TOROS: string;
|
|
84
87
|
};
|
|
85
88
|
base: {
|
|
@@ -99,6 +102,7 @@ export declare const CONTRACT_ADDRESS: {
|
|
|
99
102
|
VELODROME_CL_USDC_WETH_GAUGE: string;
|
|
100
103
|
VELO: string;
|
|
101
104
|
COMPOUNDV3_WETH: string;
|
|
105
|
+
FLUID_WETH: string;
|
|
102
106
|
TOROS: string;
|
|
103
107
|
};
|
|
104
108
|
ethereum: {
|
|
@@ -117,6 +121,7 @@ export declare const CONTRACT_ADDRESS: {
|
|
|
117
121
|
VELODROME_CL_USDC_WETH_GAUGE: string;
|
|
118
122
|
VELO: string;
|
|
119
123
|
COMPOUNDV3_WETH: string;
|
|
124
|
+
FLUID_WETH: string;
|
|
120
125
|
TOROS: string;
|
|
121
126
|
UNIT: string;
|
|
122
127
|
};
|