@dhedge/v2-sdk 1.11.1 → 2.0.1

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.
Files changed (38) hide show
  1. package/dist/entities/pool.d.ts +91 -91
  2. package/dist/services/flatmoney/stableLp.d.ts +4 -4
  3. package/dist/services/odos/index.d.ts +5 -1
  4. package/dist/services/pendle/index.d.ts +4 -1
  5. package/dist/services/toros/completeWithdrawal.d.ts +7 -0
  6. package/dist/services/toros/easySwapper.d.ts +2 -2
  7. package/dist/services/toros/initWithdrawal.d.ts +3 -0
  8. package/dist/services/toros/retry.d.ts +5 -0
  9. package/dist/services/toros/swapData.d.ts +11 -0
  10. package/dist/types.d.ts +5 -0
  11. package/dist/utils/contract.d.ts +3 -2
  12. package/dist/v2-sdk.cjs.development.js +5716 -2693
  13. package/dist/v2-sdk.cjs.development.js.map +1 -1
  14. package/dist/v2-sdk.cjs.production.min.js +1 -1
  15. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  16. package/dist/v2-sdk.esm.js +5716 -2693
  17. package/dist/v2-sdk.esm.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/abi/IAaveLendingPoolAssetGuard.json +645 -0
  20. package/src/abi/IEasySwapperV2.json +1507 -0
  21. package/src/abi/pendle/PT.json +15 -0
  22. package/src/abi/pendle/SY.json +1 -0
  23. package/src/entities/pool.ts +240 -149
  24. package/src/services/flatmoney/stableLp.ts +27 -21
  25. package/src/services/odos/index.ts +6 -3
  26. package/src/services/pendle/index.ts +43 -8
  27. package/src/services/toros/completeWithdrawal.ts +209 -0
  28. package/src/services/toros/easySwapper.ts +16 -84
  29. package/src/services/toros/initWithdrawal.ts +166 -0
  30. package/src/services/toros/retry.ts +28 -0
  31. package/src/services/toros/swapData.ts +70 -0
  32. package/src/test/constants.ts +1 -1
  33. package/src/test/odos.test.ts +8 -7
  34. package/src/test/oneInch.test.ts +20 -22
  35. package/src/test/pendle.test.ts +63 -37
  36. package/src/test/toros.test.ts +10 -8
  37. package/src/types.ts +8 -0
  38. package/src/utils/contract.ts +70 -16
@@ -0,0 +1,11 @@
1
+ export declare const SWAPPER_ADDERSS = "0x4F754e0F0924afD74980886b0B479Fa1D7C58D0D";
2
+ export interface SwapParams {
3
+ srcAsset: string;
4
+ srcAmount: string;
5
+ dstAsset: string;
6
+ chainId: number;
7
+ from: string;
8
+ receiver: string;
9
+ slippage: number;
10
+ }
11
+ export declare const getSwapDataViaOdos: ({ srcAsset, srcAmount, dstAsset, chainId, from, slippage }: SwapParams) => Promise<string>;
package/dist/types.d.ts CHANGED
@@ -90,3 +90,8 @@ export declare type LyraPosition = {
90
90
  collateral: BigNumber;
91
91
  state: number;
92
92
  };
93
+ export declare type SDKOptions = {
94
+ estimateGas: boolean;
95
+ onlyGetTxData?: boolean;
96
+ useTraderAddressAsFrom?: boolean;
97
+ } | boolean;
@@ -1,4 +1,4 @@
1
- import { ethers, Network, Pool } from "..";
1
+ import { ethers, Network, Pool, SDKOptions } from "..";
2
2
  export declare function call(provider: ethers.Signer, abi: any[], call: any[], options?: any): Promise<any>;
3
3
  export declare function multicall<T>(network: Network, provider: ethers.Signer, abi: any[], calls: any[], options?: any, requireSuccess?: boolean): Promise<(T | null)[]>;
4
4
  export declare class Multicaller {
@@ -12,4 +12,5 @@ export declare class Multicaller {
12
12
  call(path: any, address: any, fn: any, params?: any): Multicaller;
13
13
  execute(from?: any): Promise<any>;
14
14
  }
15
- export declare const getPoolTxOrGasEstimate: (pool: Pool, args: any[], estimateGas: boolean) => Promise<any>;
15
+ export declare const isSdkOptionsBoolean: (sdkOptions: SDKOptions) => sdkOptions is boolean;
16
+ export declare const getPoolTxOrGasEstimate: (pool: Pool, args: any[], sdkOptions: SDKOptions) => Promise<any>;