@dhedge/v2-sdk 2.2.1 → 2.2.2
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 +3 -0
- package/dist/entities/pool.d.ts +3 -1
- package/dist/services/dytm/index.d.ts +7 -0
- package/dist/services/toros/completeWithdrawal.d.ts +2 -2
- package/dist/services/toros/easySwapper.d.ts +4 -1
- package/dist/services/toros/initWithdrawal.d.ts +4 -1
- package/dist/types.d.ts +1 -0
- package/dist/v2-sdk.cjs.development.js +474 -123
- 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 +474 -123
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/dytm/IOffice.json +191 -0
- package/src/config.ts +20 -2
- package/src/entities/pool.ts +66 -32
- package/src/services/dytm/index.ts +77 -0
- package/src/services/toros/completeWithdrawal.ts +23 -7
- package/src/services/toros/easySwapper.ts +9 -7
- package/src/services/toros/initWithdrawal.ts +10 -6
- package/src/test/dytm.test.ts +241 -0
- package/src/types.ts +1 -0
package/dist/config.d.ts
CHANGED
package/dist/entities/pool.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Contract, ethers, Wallet, BigNumber, BigNumberish } from "ethers";
|
|
2
2
|
import { Dapp, FundComposition, AssetEnabled, Network, LyraOptionMarket, LyraOptionType, LyraTradeType, LyraPosition, SDKOptions, LimitOrderInfo } from "../types";
|
|
3
3
|
import { Utils } from "./utils";
|
|
4
|
+
import { TrackedAsset } from "../services/toros/completeWithdrawal";
|
|
4
5
|
export declare class Pool {
|
|
5
6
|
readonly poolLogic: Contract;
|
|
6
7
|
readonly managerLogic: Contract;
|
|
@@ -499,9 +500,10 @@ export declare class Pool {
|
|
|
499
500
|
* @param {number} slippage Slippage tolerance in %
|
|
500
501
|
* @param {any} options Transaction options
|
|
501
502
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
503
|
+
* @param {any} trackedAssets Tracked assets information (only for tx data generation)
|
|
502
504
|
* @returns {Promise<any>} Transaction
|
|
503
505
|
*/
|
|
504
|
-
completeTorosWithdrawal(destinationToken: string, slippage?: number, options?: any, sdkOptions?: SDKOptions): Promise<any>;
|
|
506
|
+
completeTorosWithdrawal(destinationToken: string, slippage?: number, options?: any, sdkOptions?: SDKOptions, trackedAssets?: TrackedAsset[]): Promise<any>;
|
|
505
507
|
/**
|
|
506
508
|
* Mint PT and YT tokens on Pendle
|
|
507
509
|
* @param {string} assetFrom Asset to mint from (only underlying asset)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import { Pool } from "../../entities";
|
|
3
|
+
export declare function toDebtId(key: ethers.BigNumber): ethers.BigNumber;
|
|
4
|
+
export declare const getDytmDepositTxData: (pool: Pool, asset: string, amount: ethers.BigNumber | string) => string;
|
|
5
|
+
export declare const getDytmBorrowTxData: (pool: Pool, asset: string, amount: ethers.BigNumber | string) => string;
|
|
6
|
+
export declare const getDytmRepayTxData: (pool: Pool, asset: string, amount: ethers.BigNumber | string) => Promise<string>;
|
|
7
|
+
export declare const getDytmWithdrawTxData: (pool: Pool, asset: string, amount: ethers.BigNumber | string) => Promise<string>;
|
|
@@ -3,5 +3,5 @@ export interface TrackedAsset {
|
|
|
3
3
|
token: string;
|
|
4
4
|
balance: ethers.BigNumber;
|
|
5
5
|
}
|
|
6
|
-
export declare const createCompleteWithdrawalTxArguments: (pool: Pool, receiveToken: string, slippage: number) => Promise<any>;
|
|
7
|
-
export declare const getCompleteWithdrawalTxData: (pool: Pool, receiveToken: string, slippage: number, useOnChainSwap: boolean) => Promise<string>;
|
|
6
|
+
export declare const createCompleteWithdrawalTxArguments: (pool: Pool, receiveToken: string, slippage: number, _trackedAssets: TrackedAsset[]) => Promise<any>;
|
|
7
|
+
export declare const getCompleteWithdrawalTxData: (pool: Pool, receiveToken: string, slippage: number, useOnChainSwap: boolean, trackedAssets: TrackedAsset[]) => Promise<string>;
|
|
@@ -19,4 +19,7 @@ export declare function getEasySwapperDepositQuote(pool: Pool, torosAsset: strin
|
|
|
19
19
|
* If `assetFrom` is a Toros pool, this is treated as a withdrawal and routes through
|
|
20
20
|
* `getInitWithdrawalTxData`. Otherwise it builds a `depositWithCustomCooldown` call.
|
|
21
21
|
*/
|
|
22
|
-
export declare function getEasySwapperTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber, slippage: number): Promise<
|
|
22
|
+
export declare function getEasySwapperTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber, slippage: number): Promise<{
|
|
23
|
+
swapTxData: string;
|
|
24
|
+
minAmountOut?: any;
|
|
25
|
+
}>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { Pool } from "../..";
|
|
2
2
|
export declare const createWithdrawTxArguments: (pool: Pool, torosAsset: string, amountIn: string, slippage: number, useOnChainSwap: boolean) => Promise<any>;
|
|
3
|
-
export declare const getInitWithdrawalTxData: (pool: Pool, torosAsset: string, amountIn: string, slippage: number, useOnChainSwap: boolean) => Promise<
|
|
3
|
+
export declare const getInitWithdrawalTxData: (pool: Pool, torosAsset: string, amountIn: string, slippage: number, useOnChainSwap: boolean) => Promise<{
|
|
4
|
+
swapTxData: string;
|
|
5
|
+
minAmountOut?: any;
|
|
6
|
+
}>;
|