@dhedge/v2-sdk 2.1.3 → 2.1.5
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/config.d.ts +8 -0
- package/dist/entities/pool.d.ts +11 -0
- package/dist/services/odos/index.d.ts +15 -1
- package/dist/services/pendle/index.d.ts +4 -0
- package/dist/test/constants.d.ts +1 -0
- package/dist/v2-sdk.cjs.development.js +1704 -88
- 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 +1704 -88
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/odos/OdosRouterV3.json +1351 -0
- package/src/abi/pendle/PT.json +13 -0
- package/src/config.ts +14 -5
- package/src/entities/pool.ts +41 -1
- package/src/services/odos/index.ts +97 -13
- package/src/services/pendle/index.ts +33 -0
- package/src/services/toros/completeWithdrawal.ts +1 -1
- package/src/services/toros/initWithdrawal.ts +1 -1
- package/src/services/toros/swapData.ts +83 -12
- package/src/test/constants.ts +2 -1
- package/src/test/odos.test.ts +43 -12
- package/src/test/pendleMint.test.ts +59 -0
package/dist/config.d.ts
CHANGED
|
@@ -20,3 +20,11 @@ export declare const flatMoneyContractAddresses: Readonly<Partial<Record<Network
|
|
|
20
20
|
StableModule: string;
|
|
21
21
|
COLLATERAL: string;
|
|
22
22
|
}>>>;
|
|
23
|
+
export declare const OdosSwapFeeRecipient: {
|
|
24
|
+
polygon: string;
|
|
25
|
+
optimism: string;
|
|
26
|
+
arbitrum: string;
|
|
27
|
+
base: string;
|
|
28
|
+
ethereum: string;
|
|
29
|
+
plasma: string;
|
|
30
|
+
};
|
package/dist/entities/pool.d.ts
CHANGED
|
@@ -563,4 +563,15 @@ export declare class Pool {
|
|
|
563
563
|
* @returns {Promise<any>} Transaction
|
|
564
564
|
*/
|
|
565
565
|
completeTorosWithdrawal(destinationToken: string, slippage?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
|
|
566
|
+
/**
|
|
567
|
+
* Mint PT and YT tokens on Pendle
|
|
568
|
+
* @param {string} assetFrom Asset to mint from (only underlying asset)
|
|
569
|
+
* @param {string} pt PT address
|
|
570
|
+
* @param {BigNumber | string} amountIn Amount underlying asset
|
|
571
|
+
* @param {number} slippage Slippage tolerance in %
|
|
572
|
+
* @param {any} options Transaction options
|
|
573
|
+
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
574
|
+
* @returns {Promise<any>} Transaction
|
|
575
|
+
*/
|
|
576
|
+
mintPendle(assetFrom: string, pt: string, amountIn: BigNumber | string, slippage?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
|
|
566
577
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { ethers } from "../..";
|
|
2
2
|
import { Pool } from "../../entities";
|
|
3
|
-
export declare const odosBaseUrl = "https://api.odos.xyz/sor";
|
|
3
|
+
export declare const odosBaseUrl = "https://enterprise-api.odos.xyz/sor";
|
|
4
|
+
export interface SwapTokenInfo {
|
|
5
|
+
inputToken: string;
|
|
6
|
+
inputAmount: ethers.BigNumber;
|
|
7
|
+
inputReceiver: string;
|
|
8
|
+
outputToken: string;
|
|
9
|
+
outputQuote: ethers.BigNumber;
|
|
10
|
+
outputMin: ethers.BigNumber;
|
|
11
|
+
outputReceiver: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SwapReferralInfo {
|
|
14
|
+
code: ethers.BigNumber;
|
|
15
|
+
fee: ethers.BigNumber;
|
|
16
|
+
feeRecipient: string;
|
|
17
|
+
}
|
|
4
18
|
export declare function getOdosSwapTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<{
|
|
5
19
|
swapTxData: string;
|
|
6
20
|
minAmountOut: string;
|
|
@@ -4,4 +4,8 @@ export declare function getPendleSwapTxData(pool: Pool, tokenIn: string, tokenOu
|
|
|
4
4
|
swapTxData: string;
|
|
5
5
|
minAmountOut: string | null;
|
|
6
6
|
}>;
|
|
7
|
+
export declare function getPendleMintTxData(pool: Pool, tokenIn: string, pt: string, amountIn: ethers.BigNumber | string, slippage: number): Promise<{
|
|
8
|
+
swapTxData: string;
|
|
9
|
+
minAmountOut: string | null;
|
|
10
|
+
}>;
|
|
7
11
|
export declare function getMarket(pool: Pool, tokenIn: string, tokenOut: string): Promise<string>;
|