@paraswap/dex-lib 4.7.0 → 4.7.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.
Files changed (128) hide show
  1. package/build/dex/hashflow/hashflow.js +38 -30
  2. package/build/dex/hashflow/hashflow.js.map +1 -1
  3. package/build/dex/idle-dao/idle-dao.d.ts +1 -0
  4. package/build/dex/idle-dao/idle-dao.js +23 -11
  5. package/build/dex/idle-dao/idle-dao.js.map +1 -1
  6. package/build/dex/maker-psm/maker-psm.d.ts +4 -41
  7. package/build/dex/maker-psm/maker-psm.js +40 -143
  8. package/build/dex/maker-psm/maker-psm.js.map +1 -1
  9. package/package.json +1 -1
  10. package/build/abi/PendleRouterStatic.json +0 -19
  11. package/build/abi/apex-defi/ApexDefiFactory.abi.json +0 -1749
  12. package/build/abi/apex-defi/ApexDefiRouter.abi.json +0 -1120
  13. package/build/abi/apex-defi/ApexDefiToken.abi.json +0 -229
  14. package/build/abi/apex-defi/ApexDefiWrapper.abi.json +0 -92
  15. package/build/abi/apex-defi/ApexDefiWrapperFactory.abi.json +0 -1107
  16. package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +0 -796
  17. package/build/abi/pendle/pendle-deployer.abi.json +0 -520
  18. package/build/abi/pendle/pendle-oracle.abi.json +0 -413
  19. package/build/abi/ring-v2/few-wrapped-token.json +0 -587
  20. package/build/abi/ring-v2/ring-v2-factory.json +0 -125
  21. package/build/abi/ring-v2/ring-v2-pool.json +0 -461
  22. package/build/abi/ring-v2/ring-v2-router.json +0 -332
  23. package/build/abi/stabull/stabull-curve.json +0 -738
  24. package/build/abi/stabull/stabull-router.json +0 -76
  25. package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +0 -682
  26. package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +0 -1335
  27. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.d.ts +0 -29
  28. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js +0 -153
  29. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js.map +0 -1
  30. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.d.ts +0 -40
  31. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js +0 -323
  32. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js.map +0 -1
  33. package/build/dex/aave-pt-to-underlying/config.d.ts +0 -3
  34. package/build/dex/aave-pt-to-underlying/config.js +0 -24
  35. package/build/dex/aave-pt-to-underlying/config.js.map +0 -1
  36. package/build/dex/aave-pt-to-underlying/constants.d.ts +0 -2
  37. package/build/dex/aave-pt-to-underlying/constants.js +0 -6
  38. package/build/dex/aave-pt-to-underlying/constants.js.map +0 -1
  39. package/build/dex/aave-pt-to-underlying/types.d.ts +0 -24
  40. package/build/dex/aave-pt-to-underlying/types.js +0 -3
  41. package/build/dex/aave-pt-to-underlying/types.js.map +0 -1
  42. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.d.ts +0 -39
  43. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js +0 -244
  44. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js.map +0 -1
  45. package/build/dex/aave-pt-to-usdc/config.d.ts +0 -3
  46. package/build/dex/aave-pt-to-usdc/config.js +0 -47
  47. package/build/dex/aave-pt-to-usdc/config.js.map +0 -1
  48. package/build/dex/aave-pt-to-usdc/constants.d.ts +0 -2
  49. package/build/dex/aave-pt-to-usdc/constants.js +0 -6
  50. package/build/dex/aave-pt-to-usdc/constants.js.map +0 -1
  51. package/build/dex/aave-pt-to-usdc/types.d.ts +0 -22
  52. package/build/dex/aave-pt-to-usdc/types.js +0 -3
  53. package/build/dex/aave-pt-to-usdc/types.js.map +0 -1
  54. package/build/dex/apex-defi/apex-defi-factory.d.ts +0 -26
  55. package/build/dex/apex-defi/apex-defi-factory.js +0 -53
  56. package/build/dex/apex-defi/apex-defi-factory.js.map +0 -1
  57. package/build/dex/apex-defi/apex-defi-pool.d.ts +0 -55
  58. package/build/dex/apex-defi/apex-defi-pool.js +0 -247
  59. package/build/dex/apex-defi/apex-defi-pool.js.map +0 -1
  60. package/build/dex/apex-defi/apex-defi-wrapper-factory.d.ts +0 -57
  61. package/build/dex/apex-defi/apex-defi-wrapper-factory.js +0 -250
  62. package/build/dex/apex-defi/apex-defi-wrapper-factory.js.map +0 -1
  63. package/build/dex/apex-defi/apex-defi.d.ts +0 -97
  64. package/build/dex/apex-defi/apex-defi.js +0 -1021
  65. package/build/dex/apex-defi/apex-defi.js.map +0 -1
  66. package/build/dex/apex-defi/config.d.ts +0 -4
  67. package/build/dex/apex-defi/config.js +0 -138
  68. package/build/dex/apex-defi/config.js.map +0 -1
  69. package/build/dex/apex-defi/types.d.ts +0 -32
  70. package/build/dex/apex-defi/types.js +0 -3
  71. package/build/dex/apex-defi/types.js.map +0 -1
  72. package/build/dex/apex-defi/utils.d.ts +0 -46
  73. package/build/dex/apex-defi/utils.js +0 -133
  74. package/build/dex/apex-defi/utils.js.map +0 -1
  75. package/build/dex/miro-migrator/miro-migrator-state.d.ts +0 -27
  76. package/build/dex/miro-migrator/miro-migrator-state.js +0 -89
  77. package/build/dex/miro-migrator/miro-migrator-state.js.map +0 -1
  78. package/build/dex/stabull/config.d.ts +0 -3
  79. package/build/dex/stabull/config.js +0 -177
  80. package/build/dex/stabull/config.js.map +0 -1
  81. package/build/dex/stabull/stabull-pool.d.ts +0 -46
  82. package/build/dex/stabull/stabull-pool.js +0 -113
  83. package/build/dex/stabull/stabull-pool.js.map +0 -1
  84. package/build/dex/stabull/stabull.d.ts +0 -55
  85. package/build/dex/stabull/stabull.js +0 -286
  86. package/build/dex/stabull/stabull.js.map +0 -1
  87. package/build/dex/stabull/types.d.ts +0 -21
  88. package/build/dex/stabull/types.js +0 -3
  89. package/build/dex/stabull/types.js.map +0 -1
  90. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +0 -4
  91. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +0 -56
  92. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +0 -1
  93. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +0 -7
  94. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +0 -28
  95. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +0 -1
  96. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
  97. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +0 -2
  98. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +0 -1
  99. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +0 -7
  100. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +0 -28
  101. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +0 -1
  102. package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
  103. package/build/dex/uniswap-v4/hooks/fee-hook/types.js +0 -2
  104. package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +0 -1
  105. package/build/dex/uniswap-v4/hooks/index.d.ts +0 -2
  106. package/build/dex/uniswap-v4/hooks/index.js +0 -8
  107. package/build/dex/uniswap-v4/hooks/index.js.map +0 -1
  108. package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +0 -26
  109. package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +0 -75
  110. package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +0 -1
  111. package/build/dex/usual/usual-usdc-usdc.d.ts +0 -17
  112. package/build/dex/usual/usual-usdc-usdc.js +0 -59
  113. package/build/dex/usual/usual-usdc-usdc.js.map +0 -1
  114. package/build/dex/yo/config.d.ts +0 -3
  115. package/build/dex/yo/config.js +0 -21
  116. package/build/dex/yo/config.js.map +0 -1
  117. package/build/dex/yo/types.d.ts +0 -13
  118. package/build/dex/yo/types.js +0 -3
  119. package/build/dex/yo/types.js.map +0 -1
  120. package/build/dex/yo/yo-pool.d.ts +0 -13
  121. package/build/dex/yo/yo-pool.js +0 -26
  122. package/build/dex/yo/yo-pool.js.map +0 -1
  123. package/build/dex/yo/yo.d.ts +0 -39
  124. package/build/dex/yo/yo.js +0 -248
  125. package/build/dex/yo/yo.js.map +0 -1
  126. package/build/implementations/api-paraswap-sdk.d.ts +0 -25
  127. package/build/implementations/api-paraswap-sdk.js +0 -102
  128. package/build/implementations/api-paraswap-sdk.js.map +0 -1
@@ -1,97 +0,0 @@
1
- import { AsyncOrSync } from 'ts-essentials';
2
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, TxInfo, DexExchangeParam } from '../../types';
3
- import { SwapSide, Network } from '../../constants';
4
- import { IDex } from '../../dex/idex';
5
- import { IDexHelper } from '../../dex-helper/idex-helper';
6
- import { ApexDefiData } from './types';
7
- import { SimpleExchange } from '../simple-exchange';
8
- import { ApexDefiEventPool } from './apex-defi-pool';
9
- import { Interface } from '@ethersproject/abi';
10
- import { ApexDefiFactory, OnPoolCreatedCallback } from './apex-defi-factory';
11
- import { ApexDefiWrapperFactory, OnWrapperCreatedCallback } from './apex-defi-wrapper-factory';
12
- export declare class ApexDefi extends SimpleExchange implements IDex<ApexDefiData> {
13
- readonly network: Network;
14
- readonly dexKey: string;
15
- readonly dexHelper: IDexHelper;
16
- readonly eventPools: Record<string, ApexDefiEventPool | null>;
17
- protected supportedTokensMap: {
18
- [address: string]: Token;
19
- };
20
- protected readonly factory: ApexDefiFactory;
21
- protected readonly wrapperFactory: ApexDefiWrapperFactory;
22
- readonly routerIface: Interface;
23
- readonly erc20Iface: Interface;
24
- readonly tokenIface: Interface;
25
- readonly factoryIface: Interface;
26
- readonly wrapperFactoryIface: Interface;
27
- readonly wrapperIface: Interface;
28
- feeFactor: number;
29
- readonly hasConstantPriceLargeAmounts = false;
30
- readonly needWrapNative = false;
31
- readonly isFeeOnTransferSupported = false;
32
- static dexKeysWithNetwork: {
33
- key: string;
34
- networks: Network[];
35
- }[];
36
- logger: Logger;
37
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
38
- protected getFactoryInstance(): ApexDefiFactory;
39
- protected getWrapperFactoryInstance(): ApexDefiWrapperFactory;
40
- protected onPoolCreated(): OnPoolCreatedCallback;
41
- protected onWrapperCreated(): OnWrapperCreatedCallback;
42
- initializePricing(blockNumber: number): Promise<void>;
43
- getAdapters(side: SwapSide): {
44
- name: string;
45
- index: number;
46
- }[] | null;
47
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
48
- protected getPoolIdentifier(pairAddress: Address): string;
49
- protected getPoolAddress(srcToken: Token, destToken: Token): string;
50
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<ApexDefiData>>;
51
- private getDirectAVAXPairPrices;
52
- private getCrossPairTokenToTokenPrices;
53
- private getOrDiscoverPool;
54
- /**
55
- * Discover and add a pool for a given token pair
56
- * This method is called when a pool is not found in the eventPools map
57
- */
58
- private discoverPool;
59
- /**
60
- * Calculate the output amount for a sell (exact input) swap
61
- * Uses the constant product formula: amountOut = (amountIn * reserveOut) / (reserveIn + amountIn)
62
- */
63
- private getSellPrice;
64
- /**
65
- * Calculate the input amount for a buy (exact output) swap
66
- * Uses the constant product formula: amountIn = (amountOut * reserveIn * feeFactor) / ((reserveOut - amountOut) * (feeFactor - totalFee))
67
- */
68
- private getBuyPrice;
69
- private calculateCrossPairSellPrice;
70
- private calculateCrossPairBuyPrice;
71
- private calculatePrices;
72
- getCalldataGasCost(_poolPrices: PoolPrices<ApexDefiData>): number | number[];
73
- getAdapterParam(_srcToken: string, _destToken: string, _srcAmount: string, _destAmount: string, _data: ApexDefiData, _side: SwapSide): AdapterExchangeParam;
74
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: ApexDefiData, _side: SwapSide): DexExchangeParam;
75
- private getDirectTokenSwap;
76
- private getRouterSwap;
77
- getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: ApexDefiData, _side: SwapSide): Promise<SimpleExchangeParam>;
78
- getDirectParam(_srcToken: Address, _destToken: Address, _srcAmount: NumberAsString, _destAmount: NumberAsString, _expectedAmount: NumberAsString, _data: ApexDefiData, _side: SwapSide, _permit: string, _uuid: string, _feePercent: NumberAsString, _deadline: NumberAsString, _partner: string, _beneficiary: string, _contractMethod: string): TxInfo<null>;
79
- getDirectParamV6(_srcToken: Address, _destToken: Address, _fromAmount: NumberAsString, _toAmount: NumberAsString, _quotedAmount: NumberAsString, _data: ApexDefiData, _side: SwapSide, _permit: string, _uuid: string, _partnerAndFee: string, _beneficiary: string, _blockNumber: number, _contractMethod: string): TxInfo<null>;
80
- static getDirectFunctionName(): string[];
81
- static getDirectFunctionNameV6(): string[];
82
- updatePoolState(): Promise<void>;
83
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
84
- private fetchAndInitPool;
85
- releaseResources(): AsyncOrSync<void>;
86
- protected _getLoweredAddresses(srcToken: Token, destToken: Token): string[];
87
- fixPathForRouter(path: Address[]): Address[];
88
- private getERC314Token;
89
- private convertAmountToERC314;
90
- private convertAmountFromERC314;
91
- private convertAmountsToERC314;
92
- private convertPricesFromERC314;
93
- private isWrapperOperation;
94
- private getWrapperPrices;
95
- private getWrapperSwap;
96
- private getWrapperSimpleParam;
97
- }