@dhedge/trading-widget 2.0.8 → 3.0.0-alpha

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 (112) hide show
  1. package/README.md +12 -1
  2. package/core-kit/abi/easy-swapper-v2.d.ts +97 -0
  3. package/core-kit/abi/index.d.ts +0 -1
  4. package/core-kit/const/config.d.ts +1 -1
  5. package/core-kit/const/contracts/arbitrum.d.ts +0 -1
  6. package/core-kit/const/contracts/base.d.ts +0 -1
  7. package/core-kit/const/contracts/optimism.d.ts +0 -1
  8. package/core-kit/const/contracts/polygon.d.ts +0 -1
  9. package/core-kit/const/default-data.d.ts +3 -3
  10. package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +194 -63
  11. package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +97 -0
  12. package/core-kit/hooks/trading/index.d.ts +0 -2
  13. package/core-kit/hooks/trading/use-swaps-data-query.d.ts +7 -0
  14. package/core-kit/hooks/trading/withdraw-v2/complete-step/index.d.ts +9 -0
  15. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-expected-amount.d.ts +4 -0
  16. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-quote.d.ts +1 -0
  17. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-receive-diff.d.ts +1 -0
  18. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-swap-data.d.ts +1 -0
  19. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-total-usd-value.d.ts +1 -0
  20. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-tracked-assets.d.ts +210 -0
  21. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-transaction.d.ts +6 -0
  22. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-handle-complete-withdraw.d.ts +11 -0
  23. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-is-complete-withdraw-step.d.ts +4 -0
  24. package/core-kit/hooks/trading/withdraw-v2/index.d.ts +3 -0
  25. package/core-kit/hooks/trading/withdraw-v2/init-step/index.d.ts +3 -0
  26. package/core-kit/hooks/trading/{withdraw/use-withdraw-allowance.d.ts → withdraw-v2/init-step/use-init-withdraw-allowance.d.ts} +1 -1
  27. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction.d.ts +2 -0
  28. package/core-kit/hooks/trading/withdraw-v2/use-applied-withdraw-slippage.d.ts +1 -0
  29. package/core-kit/hooks/trading/withdraw-v2/use-min-withdraw-slippage.d.ts +1 -0
  30. package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +581 -0
  31. package/core-kit/models/index.d.ts +0 -1
  32. package/core-kit/types/config.types.d.ts +2 -2
  33. package/core-kit/types/state.types.d.ts +2 -2
  34. package/core-kit/types/trading-panel.types.d.ts +2 -7
  35. package/core-kit/types/trading.types.d.ts +0 -10
  36. package/core-kit/types/web3.types.d.ts +0 -7
  37. package/core-kit/utils/transaction.d.ts +8 -4
  38. package/{index-86a1e2d8.js → index-15f9e6d8.js} +15793 -15828
  39. package/index-598b19c0.cjs +207 -0
  40. package/index.cjs +1 -1
  41. package/index.d.ts +6 -6
  42. package/index.js +219 -228
  43. package/package.json +1 -1
  44. package/{pyth-adapter-3aef2c8d.js → pyth-adapter-393858f5.js} +1 -1
  45. package/{pyth-adapter-bd50cd24.cjs → pyth-adapter-3fa17063.cjs} +1 -1
  46. package/style.css +1 -1
  47. package/trading-widget/components/widget/widget-meta/stepper.d.ts +9 -0
  48. package/trading-widget/components/widget/widget-overlay/pool-select-overlay/pool-select-overlay.hooks.d.ts +1 -1
  49. package/trading-widget/components/widget/widget-overlay/token-select-overlay/token-select-item/token-select-item.d.ts +1 -1
  50. package/trading-widget/components/widget/widget-overlay/token-select-overlay/token-select-item/token-select-item.hooks.d.ts +2 -1
  51. package/trading-widget/components/widget/widget-overlay/token-select-overlay/token-select-overlay.hooks.d.ts +1 -1
  52. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/approve-summary.d.ts +7 -0
  53. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/claim-summary.d.ts +7 -0
  54. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/oracles-update-summary.d.ts +2 -0
  55. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/swap-summary.d.ts +8 -0
  56. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/vault-transaction-summary.d.ts +9 -0
  57. package/trading-widget/components/withdraw/complete-step/balance/claim-button.d.ts +2 -0
  58. package/trading-widget/components/withdraw/complete-step/balance/claim-button.hooks.d.ts +5 -0
  59. package/trading-widget/components/withdraw/complete-step/balance/complete-withdraw-balance.d.ts +2 -0
  60. package/trading-widget/components/withdraw/complete-step/balance/complete-withdraw-balance.hooks.d.ts +11 -0
  61. package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.d.ts +2 -0
  62. package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +5 -0
  63. package/trading-widget/components/withdraw/complete-step/button/valid-swap-button/valid-swap-button.d.ts +2 -0
  64. package/trading-widget/components/withdraw/complete-step/button/valid-swap-button/valid-swap-button.hooks.d.ts +5 -0
  65. package/trading-widget/components/withdraw/complete-step/complete-step.d.ts +2 -0
  66. package/trading-widget/components/withdraw/complete-step/input-group/complete-withdraw-input-group.d.ts +2 -0
  67. package/trading-widget/components/withdraw/complete-step/input-group/complete-withdraw-input-group.hooks.d.ts +12 -0
  68. package/trading-widget/components/withdraw/complete-step/meta/meta.d.ts +2 -0
  69. package/trading-widget/components/withdraw/complete-step/meta/transaction-disclosure/transaction-disclosure.d.ts +1 -0
  70. package/trading-widget/components/withdraw/complete-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +6 -0
  71. package/trading-widget/components/withdraw/init-step/balance/init-withdraw-balance.d.ts +2 -0
  72. package/trading-widget/components/withdraw/{balance/balance.hooks.d.ts → init-step/balance/init-withdraw-balance.hooks.d.ts} +1 -1
  73. package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.d.ts +2 -0
  74. package/trading-widget/components/withdraw/{button/trade-button/trade-button.hooks.d.ts → init-step/button/init-withdraw-button/init-withdraw-button.hooks.d.ts} +1 -1
  75. package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.d.ts +2 -0
  76. package/trading-widget/components/withdraw/{button/valid-withdraw-button/valid-withdraw-button.hooks.d.ts → init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts} +1 -1
  77. package/trading-widget/components/withdraw/init-step/init-step.d.ts +1 -0
  78. package/trading-widget/components/withdraw/init-step/input-group/init-withdraw-input-group.d.ts +1 -0
  79. package/trading-widget/components/withdraw/init-step/input-group/init-withdraw-input-group.hooks.d.ts +15 -0
  80. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/asset-composition-table/asset-composition-table.d.ts +2 -0
  81. package/trading-widget/components/{widget/widget-input → withdraw/init-step/input-group/withdraw-section}/asset-composition-table/asset-composition-table.hooks.d.ts +1 -1
  82. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.d.ts +3 -0
  83. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.hooks.d.ts +10 -0
  84. package/trading-widget/components/withdraw/init-step/meta/meta.d.ts +2 -0
  85. package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.d.ts +1 -0
  86. package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +10 -0
  87. package/trading-widget/components/withdraw/tab-panel/tab-panel.hooks.d.ts +5 -1
  88. package/trading-widget/hooks/use-get-slippage-placeholder.d.ts +1 -2
  89. package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -1
  90. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +10 -0
  91. package/core-kit/abi/dhedge-easy-swapper.d.ts +0 -231
  92. package/core-kit/hooks/trading/use-max-slippage-placeholder.d.ts +0 -1
  93. package/core-kit/hooks/trading/use-min-receive-text.d.ts +0 -4
  94. package/core-kit/hooks/trading/withdraw/index.d.ts +0 -7
  95. package/core-kit/hooks/trading/withdraw/use-withdraw-quote.d.ts +0 -2
  96. package/core-kit/hooks/trading/withdraw/use-withdraw-slippage.d.ts +0 -9
  97. package/core-kit/hooks/trading/withdraw/use-withdraw-trading-params.d.ts +0 -2
  98. package/core-kit/hooks/trading/withdraw/use-withdraw.d.ts +0 -2
  99. package/core-kit/models/default-selling-params.d.ts +0 -18
  100. package/index-c3d20359.cjs +0 -207
  101. package/trading-widget/components/widget/widget-input/asset-composition-table/asset-composition-table.d.ts +0 -2
  102. package/trading-widget/components/withdraw/balance/balance.d.ts +0 -2
  103. package/trading-widget/components/withdraw/button/trade-button/trade-button.d.ts +0 -2
  104. package/trading-widget/components/withdraw/button/valid-withdraw-button/valid-withdraw-button.d.ts +0 -2
  105. package/trading-widget/components/withdraw/input-group/input-group.d.ts +0 -1
  106. package/trading-widget/components/withdraw/input-group/input-group.hooks.d.ts +0 -23
  107. package/trading-widget/components/withdraw/meta/meta.d.ts +0 -2
  108. package/trading-widget/components/withdraw/meta/transaction-disclosure/transaction-disclosure.d.ts +0 -1
  109. package/trading-widget/components/withdraw/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +0 -16
  110. /package/core-kit/hooks/trading/{withdraw → withdraw-v2/init-step}/use-is-multi-asset-withdraw.d.ts +0 -0
  111. /package/core-kit/hooks/trading/{withdraw → withdraw-v2}/use-withdraw-type-handler.d.ts +0 -0
  112. /package/trading-widget/components/{widget/widget-input → withdraw/init-step/input-group/withdraw-section}/asset-composition-table/withdraw-explanation-tip.d.ts +0 -0
package/README.md CHANGED
@@ -117,7 +117,7 @@ UI configuration provider. Manages params to configure custom styling, component
117
117
  > | `isSanctioned` | `boolean` | `false` | Restricts depositing action button and conditionally renders SanctionedAlert component |
118
118
  > | `depositQuoteDiffWarningThreshold` | `number` | `1` | Deposit slippage absolute percent value warning threshold, Affects styling to warn user |
119
119
  > | `depositQuoteDiffErrorThreshold` | `number` | `3` | Deposit slippage absolute percent value error threshold, Affects styling to warn user |
120
- > | `defaultWithdrawSlippageScale` | `number[]` | `[0.1, 0.3, 0.5, 1, 1.5, 3]` | Initial withdraw slippage absolute percent. Further adjustments are available in panel settings |
120
+ > | `defaultWithdrawSlippage` | `number` | `[0.1, 0.3, 0.5, 1, 1.5, 3]` | Initial withdraw slippage absolute percent. Further adjustments are available in panel settings |
121
121
  > | `defaultSwapTransactionSlippage` | `number` | `0.3` | Default slippage (%) applied to swap transaction. |
122
122
  > | `defaultNoSwapMinDepositAmountGap` | `number` | `0.1` | Default gap (%) for min received vault tokens during no swap deposits. |
123
123
  > | `defaultLockTime` | `string` | `'24 hours'` | Formatted default deposit lock time to be displayed in panel (Long lockup period is used to bypass entry fee and can be managed in panel settings) |
@@ -504,6 +504,17 @@ path: `component.meta[name]`
504
504
  > | `multiAssetFractions` | string | multi asset fractions | |
505
505
  > | `explorer` | string | Explorer | |
506
506
  > | `as` | string | As | |
507
+ > | `switchNetwork` | string | Switch Network | |
508
+ > | `depositAction` | string | Buy | |
509
+ > | `withdrawAction` | string | Sell | |
510
+ > | `swapAction` | string | Swap | |
511
+ > | `claimAction` | string | Claim Without Swap | |
512
+ > | `claimLabel` | string | Claim | |
513
+ > | `swapOf` | string | Swap of | |
514
+ > | `to` | string | to | |
515
+ > | `initWithdrawDescription` | string | Unroll {vaultSymbol} tokens into multi assets | |
516
+ > | `initWithdrawTooltip` | string | Convertible tokens are basic ERC20 tokens which can be swapped on any DEXs | |
517
+ > | `completeWithdrawDescription` | string | Swap multi assets into {assetSymbol} | |
507
518
 
508
519
  ###### Source: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx`
509
520
 
@@ -1,4 +1,64 @@
1
1
  export declare const EasySwapperV2Abi: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly components: readonly [{
4
+ readonly components: readonly [{
5
+ readonly internalType: "contract IERC20";
6
+ readonly name: "token";
7
+ readonly type: "address";
8
+ }, {
9
+ readonly internalType: "uint256";
10
+ readonly name: "amount";
11
+ readonly type: "uint256";
12
+ }, {
13
+ readonly components: readonly [{
14
+ readonly internalType: "bytes32";
15
+ readonly name: "routerKey";
16
+ readonly type: "bytes32";
17
+ }, {
18
+ readonly internalType: "bytes";
19
+ readonly name: "swapData";
20
+ readonly type: "bytes";
21
+ }];
22
+ readonly internalType: "struct ISwapper.AggregatorData";
23
+ readonly name: "aggregatorData";
24
+ readonly type: "tuple";
25
+ }];
26
+ readonly internalType: "struct ISwapper.SrcTokenSwapDetails[]";
27
+ readonly name: "srcData";
28
+ readonly type: "tuple[]";
29
+ }, {
30
+ readonly components: readonly [{
31
+ readonly internalType: "contract IERC20";
32
+ readonly name: "destToken";
33
+ readonly type: "address";
34
+ }, {
35
+ readonly internalType: "uint256";
36
+ readonly name: "minDestAmount";
37
+ readonly type: "uint256";
38
+ }];
39
+ readonly internalType: "struct ISwapper.DestData";
40
+ readonly name: "destData";
41
+ readonly type: "tuple";
42
+ }];
43
+ readonly internalType: "struct IWithdrawalVault.MultiInSingleOutData";
44
+ readonly name: "_swapData";
45
+ readonly type: "tuple";
46
+ }, {
47
+ readonly internalType: "uint256";
48
+ readonly name: "_expectedDestTokenAmount";
49
+ readonly type: "uint256";
50
+ }];
51
+ readonly name: "completeWithdrawal";
52
+ readonly outputs: readonly [];
53
+ readonly stateMutability: "nonpayable";
54
+ readonly type: "function";
55
+ }, {
56
+ readonly inputs: readonly [];
57
+ readonly name: "completeWithdrawal";
58
+ readonly outputs: readonly [];
59
+ readonly stateMutability: "nonpayable";
60
+ readonly type: "function";
61
+ }, {
2
62
  readonly inputs: readonly [];
3
63
  readonly name: "customCooldown";
4
64
  readonly outputs: readonly [{
@@ -88,6 +148,29 @@ export declare const EasySwapperV2Abi: readonly [{
88
148
  readonly outputs: readonly [];
89
149
  readonly stateMutability: "nonpayable";
90
150
  readonly type: "function";
151
+ }, {
152
+ readonly inputs: readonly [{
153
+ readonly internalType: "address";
154
+ readonly name: "_depositor";
155
+ readonly type: "address";
156
+ }];
157
+ readonly name: "getTrackedAssets";
158
+ readonly outputs: readonly [{
159
+ readonly components: readonly [{
160
+ readonly internalType: "address";
161
+ readonly name: "token";
162
+ readonly type: "address";
163
+ }, {
164
+ readonly internalType: "uint256";
165
+ readonly name: "balance";
166
+ readonly type: "uint256";
167
+ }];
168
+ readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
169
+ readonly name: "trackedAssets";
170
+ readonly type: "tuple[]";
171
+ }];
172
+ readonly stateMutability: "view";
173
+ readonly type: "function";
91
174
  }, {
92
175
  readonly inputs: readonly [{
93
176
  readonly internalType: "address";
@@ -134,6 +217,20 @@ export declare const EasySwapperV2Abi: readonly [{
134
217
  readonly outputs: readonly [];
135
218
  readonly stateMutability: "payable";
136
219
  readonly type: "function";
220
+ }, {
221
+ readonly inputs: readonly [{
222
+ readonly internalType: "uint256";
223
+ readonly name: "_portion";
224
+ readonly type: "uint256";
225
+ }, {
226
+ readonly internalType: "address";
227
+ readonly name: "_to";
228
+ readonly type: "address";
229
+ }];
230
+ readonly name: "partialWithdraw";
231
+ readonly outputs: readonly [];
232
+ readonly stateMutability: "nonpayable";
233
+ readonly type: "function";
137
234
  }, {
138
235
  readonly inputs: readonly [];
139
236
  readonly name: "swapper";
@@ -1,6 +1,5 @@
1
1
  export { erc20Abi } from './erc20';
2
2
  export { AaveLendingPoolAbi } from './aave-lending-pool';
3
- export { DhedgeEasySwapperAbi } from './dhedge-easy-swapper';
4
3
  export { DHedgeStakingV2Abi } from './dhedge-staking-v2';
5
4
  export { PoolFactoryAbi } from './pool-factory';
6
5
  export { PoolLogicAbi } from './pool-logic';
@@ -1,5 +1,5 @@
1
1
  import type { Address, ChainId } from 'core-kit/types/web3.types';
2
- export type ContractId = 'factory' | 'easySwapper' | 'rewardDistribution' | 'aaveLendingPoolV2' | 'aaveLendingPoolV3' | 'stakingV2' | 'poolManagerLogic' | 'erc20' | 'poolLogic' | 'synthetixV3AssetGuard' | 'synthetixV3Core' | 'flatcoinPointsModule' | 'easySwapperV2';
2
+ export type ContractId = 'factory' | 'rewardDistribution' | 'aaveLendingPoolV2' | 'aaveLendingPoolV3' | 'stakingV2' | 'poolManagerLogic' | 'erc20' | 'poolLogic' | 'synthetixV3AssetGuard' | 'synthetixV3Core' | 'flatcoinPointsModule' | 'easySwapperV2';
3
3
  type ContractsAddressesMap = Readonly<Record<ChainId, {
4
4
  [id in ContractId]?: Address;
5
5
  }>>;
@@ -1,5 +1,4 @@
1
1
  export declare const FACTORY_ADDRESS_ARBITRUM = "0xffFb5fB14606EB3a548C113026355020dDF27535";
2
- export declare const EASY_SWAPPER_ADDRESS_ARBITRUM = "0x80b9411977C4fF8D618f2aC3f29F1e2D623C4d34";
3
2
  export declare const AAVE_LENDING_POOL_V3_ADDRESS_ARBITRUM = "0x794a61358D6845594F94dc1DB02A252b5b4814aD";
4
3
  export declare const SYNTHETIX_V3_CORE_ADDRESS_ARBITRUM = "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847";
5
4
  export declare const EASY_SWAPPER_V2_ADDRESS_ARBITRUM = "0xA5679C4272A056Bb83f039961fae7D99C48529F5";
@@ -1,6 +1,5 @@
1
1
  export declare const FACTORY_ADDRESS_BASE = "0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F";
2
2
  export declare const SYNTHETIX_V3_CORE_ADDRESS_BASE = "0x32C222A9A159782aFD7529c87FA34b96CA72C696";
3
- export declare const EASY_SWAPPER_ADDRESS_BASE = "0xE10Ed1E5354eEd0F7C9D2e16250ba8996C12db7A";
4
3
  export declare const EASY_SWAPPER_V2_ADDRESS_BASE = "0xf067575Eb60c7587C11e867907AA7284833704d1";
5
4
  export declare const FLATCOIN_POINTS_MODULE_ADDRESS_BASE = "0x59525b9b23adc475ef91d98dae06b568ba574ce5";
6
5
  export declare const FLATMONEY_EARLY_DEPOSITOR_VAULT_ADDRESS_BASE = "0xa907504d7a4c415b4e6e1d0866d96afe8202f0e5";
@@ -1,6 +1,5 @@
1
1
  export declare const REWARD_DISTRIBUTION_ADDRESS_OPTIMISM = "0x07e144e336fcc3fe928a8a2a5714da64354c1aab";
2
2
  export declare const FACTORY_ADDRESS_OPTIMISM = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6";
3
- export declare const EASY_SWAPPER_ADDRESS_OPTIMISM = "0x3988513793bCE39f0167064A9F7fC3617FaF35AB";
4
3
  export declare const STAKING_V2_ADDRESS_OPTIMISM = "0xf165ca3d75120d817b7428eef8c39ea5cb33b612";
5
4
  export declare const AAVE_LENDING_POOL_V3_ADDRESS_OPTIMISM = "0x794a61358D6845594F94dc1DB02A252b5b4814aD";
6
5
  export declare const EASY_SWAPPER_V2_ADDRESS_OPTIMISM = "0x2Ed1bd7f66e47113672f3870308b5E867C5bb743";
@@ -1,5 +1,4 @@
1
1
  export declare const FACTORY_ADDRESS_POLYGON = "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0";
2
- export declare const EASY_SWAPPER_ADDRESS_POLYGON = "0xB2F1498983bf9c9442c35F772e6C1AdE66a8DeDE";
3
2
  export declare const AAVE_LENDING_POOL_V2_ADDRESS_POLYGON = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf";
4
3
  export declare const AAVE_LENDING_POOL_V3_ADDRESS_POLYGON = "0x794a61358D6845594F94dc1DB02A252b5b4814aD";
5
4
  export declare const EASY_SWAPPER_V2_ADDRESS_POLYGON = "0x45b90480D6F643dE2f128db091A357C3c90399f2";
@@ -10,14 +10,14 @@ export declare const EXTENDED_DEBOUNCE_TIME: number;
10
10
  export declare const DEFAULT_LOCK_TIME: string;
11
11
  export declare const EMPTY_POOL_CONFIG: PoolConfig;
12
12
  export declare const DEFAULT_DEPOSIT_METHOD: DepositMethodName;
13
- export declare const DEFAULT_WITHDRAW_SLIPPAGE = 3;
13
+ export declare const DEFAULT_WITHDRAW_SLIPPAGE = 1;
14
14
  export declare const DEFAULT_DEPOSIT_SLIPPAGE = 0;
15
15
  export declare const DEFAULT_NO_SWAP_MIN_DEPOSIT_AMOUNT_GAP = 0.2;
16
16
  export declare const DEFAULT_SWAP_TRANSACTION_SLIPPAGE = 0.3;
17
- export declare const DEFAULT_WITHDRAW_SLIPPAGE_SCALE: number[];
18
17
  export declare const DEFAULT_DEPOSIT_SLIPPAGE_SCALE: number[];
19
- export declare const DEFAULT_EASY_SWAPPER_WITHDRAW_METHOD = "withdraw";
20
18
  export declare const DEFAULT_MULTI_ASSET_WITHDRAW_METHOD = "withdrawSafe";
19
+ export declare const EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD = "initWithdrawal";
20
+ export declare const EASY_SWAPPER_V2_COMPLETE_WITHDRAW_METHOD = "completeWithdrawal";
21
21
  export declare const NATIVE_TOKEN_DEPOSIT_GAS_LIMIT = 4200000;
22
22
  export declare const GAS_LIMIT_BUFFER_COEFF = 1.25;
23
23
  export declare const MANAGER_FEE_DENOMINATOR = 10000;
@@ -1,67 +1,5 @@
1
1
  import type { PoolContractCallParams } from 'core-kit/types';
2
2
  export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParams) => import("wagmi").UseReadContractsReturnType<readonly [{
3
- readonly address: `0x${string}`;
4
- readonly abi: readonly [{
5
- readonly inputs: readonly [{
6
- readonly internalType: "address";
7
- readonly name: "asset";
8
- readonly type: "address";
9
- }];
10
- readonly name: "getAssetPrice";
11
- readonly outputs: readonly [{
12
- readonly internalType: "uint256";
13
- readonly name: "price";
14
- readonly type: "uint256";
15
- }];
16
- readonly stateMutability: "view";
17
- readonly type: "function";
18
- }, {
19
- readonly inputs: readonly [{
20
- readonly internalType: "address";
21
- readonly name: "";
22
- readonly type: "address";
23
- }];
24
- readonly name: "isPool";
25
- readonly outputs: readonly [{
26
- readonly internalType: "bool";
27
- readonly name: "";
28
- readonly type: "bool";
29
- }];
30
- readonly stateMutability: "view";
31
- readonly type: "function";
32
- }, {
33
- readonly inputs: readonly [{
34
- readonly internalType: "address";
35
- readonly name: "extContract";
36
- readonly type: "address";
37
- }];
38
- readonly name: "getAssetGuard";
39
- readonly outputs: readonly [{
40
- readonly internalType: "address";
41
- readonly name: "guard";
42
- readonly type: "address";
43
- }];
44
- readonly stateMutability: "view";
45
- readonly type: "function";
46
- }, {
47
- readonly inputs: readonly [{
48
- readonly internalType: "address";
49
- readonly name: "extContract";
50
- readonly type: "address";
51
- }];
52
- readonly name: "getContractGuard";
53
- readonly outputs: readonly [{
54
- readonly internalType: "address";
55
- readonly name: "guard";
56
- readonly type: "address";
57
- }];
58
- readonly stateMutability: "view";
59
- readonly type: "function";
60
- }];
61
- readonly functionName: "isPool";
62
- readonly chainId: number;
63
- readonly args: readonly [`0x${string}`];
64
- }, {
65
3
  readonly address: `0x${string}`;
66
4
  readonly abi: readonly [{
67
5
  readonly inputs: readonly [{
@@ -308,6 +246,66 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
308
246
  }, {
309
247
  readonly address: `0x${string}`;
310
248
  readonly abi: readonly [{
249
+ readonly inputs: readonly [{
250
+ readonly components: readonly [{
251
+ readonly components: readonly [{
252
+ readonly internalType: "contract IERC20";
253
+ readonly name: "token";
254
+ readonly type: "address";
255
+ }, {
256
+ readonly internalType: "uint256";
257
+ readonly name: "amount";
258
+ readonly type: "uint256";
259
+ }, {
260
+ readonly components: readonly [{
261
+ readonly internalType: "bytes32";
262
+ readonly name: "routerKey";
263
+ readonly type: "bytes32";
264
+ }, {
265
+ readonly internalType: "bytes";
266
+ readonly name: "swapData";
267
+ readonly type: "bytes";
268
+ }];
269
+ readonly internalType: "struct ISwapper.AggregatorData";
270
+ readonly name: "aggregatorData";
271
+ readonly type: "tuple";
272
+ }];
273
+ readonly internalType: "struct ISwapper.SrcTokenSwapDetails[]";
274
+ readonly name: "srcData";
275
+ readonly type: "tuple[]";
276
+ }, {
277
+ readonly components: readonly [{
278
+ readonly internalType: "contract IERC20";
279
+ readonly name: "destToken";
280
+ readonly type: "address";
281
+ }, {
282
+ readonly internalType: "uint256";
283
+ readonly name: "minDestAmount";
284
+ readonly type: "uint256";
285
+ }];
286
+ readonly internalType: "struct ISwapper.DestData";
287
+ readonly name: "destData";
288
+ readonly type: "tuple";
289
+ }];
290
+ readonly internalType: "struct IWithdrawalVault.MultiInSingleOutData";
291
+ readonly name: "_swapData";
292
+ readonly type: "tuple";
293
+ }, {
294
+ readonly internalType: "uint256";
295
+ readonly name: "_expectedDestTokenAmount";
296
+ readonly type: "uint256";
297
+ }];
298
+ readonly name: "completeWithdrawal";
299
+ readonly outputs: readonly [];
300
+ readonly stateMutability: "nonpayable";
301
+ readonly type: "function";
302
+ }, {
303
+ readonly inputs: readonly [];
304
+ readonly name: "completeWithdrawal";
305
+ readonly outputs: readonly [];
306
+ readonly stateMutability: "nonpayable";
307
+ readonly type: "function";
308
+ }, {
311
309
  readonly inputs: readonly [];
312
310
  readonly name: "customCooldown";
313
311
  readonly outputs: readonly [{
@@ -397,6 +395,29 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
397
395
  readonly outputs: readonly [];
398
396
  readonly stateMutability: "nonpayable";
399
397
  readonly type: "function";
398
+ }, {
399
+ readonly inputs: readonly [{
400
+ readonly internalType: "address";
401
+ readonly name: "_depositor";
402
+ readonly type: "address";
403
+ }];
404
+ readonly name: "getTrackedAssets";
405
+ readonly outputs: readonly [{
406
+ readonly components: readonly [{
407
+ readonly internalType: "address";
408
+ readonly name: "token";
409
+ readonly type: "address";
410
+ }, {
411
+ readonly internalType: "uint256";
412
+ readonly name: "balance";
413
+ readonly type: "uint256";
414
+ }];
415
+ readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
416
+ readonly name: "trackedAssets";
417
+ readonly type: "tuple[]";
418
+ }];
419
+ readonly stateMutability: "view";
420
+ readonly type: "function";
400
421
  }, {
401
422
  readonly inputs: readonly [{
402
423
  readonly internalType: "address";
@@ -443,6 +464,20 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
443
464
  readonly outputs: readonly [];
444
465
  readonly stateMutability: "payable";
445
466
  readonly type: "function";
467
+ }, {
468
+ readonly inputs: readonly [{
469
+ readonly internalType: "uint256";
470
+ readonly name: "_portion";
471
+ readonly type: "uint256";
472
+ }, {
473
+ readonly internalType: "address";
474
+ readonly name: "_to";
475
+ readonly type: "address";
476
+ }];
477
+ readonly name: "partialWithdraw";
478
+ readonly outputs: readonly [];
479
+ readonly stateMutability: "nonpayable";
480
+ readonly type: "function";
446
481
  }, {
447
482
  readonly inputs: readonly [];
448
483
  readonly name: "swapper";
@@ -726,6 +761,66 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
726
761
  }, {
727
762
  readonly address: `0x${string}`;
728
763
  readonly abi: readonly [{
764
+ readonly inputs: readonly [{
765
+ readonly components: readonly [{
766
+ readonly components: readonly [{
767
+ readonly internalType: "contract IERC20";
768
+ readonly name: "token";
769
+ readonly type: "address";
770
+ }, {
771
+ readonly internalType: "uint256";
772
+ readonly name: "amount";
773
+ readonly type: "uint256";
774
+ }, {
775
+ readonly components: readonly [{
776
+ readonly internalType: "bytes32";
777
+ readonly name: "routerKey";
778
+ readonly type: "bytes32";
779
+ }, {
780
+ readonly internalType: "bytes";
781
+ readonly name: "swapData";
782
+ readonly type: "bytes";
783
+ }];
784
+ readonly internalType: "struct ISwapper.AggregatorData";
785
+ readonly name: "aggregatorData";
786
+ readonly type: "tuple";
787
+ }];
788
+ readonly internalType: "struct ISwapper.SrcTokenSwapDetails[]";
789
+ readonly name: "srcData";
790
+ readonly type: "tuple[]";
791
+ }, {
792
+ readonly components: readonly [{
793
+ readonly internalType: "contract IERC20";
794
+ readonly name: "destToken";
795
+ readonly type: "address";
796
+ }, {
797
+ readonly internalType: "uint256";
798
+ readonly name: "minDestAmount";
799
+ readonly type: "uint256";
800
+ }];
801
+ readonly internalType: "struct ISwapper.DestData";
802
+ readonly name: "destData";
803
+ readonly type: "tuple";
804
+ }];
805
+ readonly internalType: "struct IWithdrawalVault.MultiInSingleOutData";
806
+ readonly name: "_swapData";
807
+ readonly type: "tuple";
808
+ }, {
809
+ readonly internalType: "uint256";
810
+ readonly name: "_expectedDestTokenAmount";
811
+ readonly type: "uint256";
812
+ }];
813
+ readonly name: "completeWithdrawal";
814
+ readonly outputs: readonly [];
815
+ readonly stateMutability: "nonpayable";
816
+ readonly type: "function";
817
+ }, {
818
+ readonly inputs: readonly [];
819
+ readonly name: "completeWithdrawal";
820
+ readonly outputs: readonly [];
821
+ readonly stateMutability: "nonpayable";
822
+ readonly type: "function";
823
+ }, {
729
824
  readonly inputs: readonly [];
730
825
  readonly name: "customCooldown";
731
826
  readonly outputs: readonly [{
@@ -815,6 +910,29 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
815
910
  readonly outputs: readonly [];
816
911
  readonly stateMutability: "nonpayable";
817
912
  readonly type: "function";
913
+ }, {
914
+ readonly inputs: readonly [{
915
+ readonly internalType: "address";
916
+ readonly name: "_depositor";
917
+ readonly type: "address";
918
+ }];
919
+ readonly name: "getTrackedAssets";
920
+ readonly outputs: readonly [{
921
+ readonly components: readonly [{
922
+ readonly internalType: "address";
923
+ readonly name: "token";
924
+ readonly type: "address";
925
+ }, {
926
+ readonly internalType: "uint256";
927
+ readonly name: "balance";
928
+ readonly type: "uint256";
929
+ }];
930
+ readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
931
+ readonly name: "trackedAssets";
932
+ readonly type: "tuple[]";
933
+ }];
934
+ readonly stateMutability: "view";
935
+ readonly type: "function";
818
936
  }, {
819
937
  readonly inputs: readonly [{
820
938
  readonly internalType: "address";
@@ -861,6 +979,20 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
861
979
  readonly outputs: readonly [];
862
980
  readonly stateMutability: "payable";
863
981
  readonly type: "function";
982
+ }, {
983
+ readonly inputs: readonly [{
984
+ readonly internalType: "uint256";
985
+ readonly name: "_portion";
986
+ readonly type: "uint256";
987
+ }, {
988
+ readonly internalType: "address";
989
+ readonly name: "_to";
990
+ readonly type: "address";
991
+ }];
992
+ readonly name: "partialWithdraw";
993
+ readonly outputs: readonly [];
994
+ readonly stateMutability: "nonpayable";
995
+ readonly type: "function";
864
996
  }, {
865
997
  readonly inputs: readonly [];
866
998
  readonly name: "swapper";
@@ -1142,7 +1274,6 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
1142
1274
  readonly args: readonly [];
1143
1275
  readonly chainId: number;
1144
1276
  }], true, {
1145
- isPool: boolean | undefined;
1146
1277
  poolManagerLogic: `0x${string}` | undefined;
1147
1278
  isCustomCooldownDepositAllowed: boolean | undefined;
1148
1279
  customCooldown: bigint | undefined;
@@ -1,5 +1,65 @@
1
1
  import type { PoolConfig } from 'core-kit/types/config.types';
2
2
  export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => import("wagmi").UseReadContractReturnType<readonly [{
3
+ readonly inputs: readonly [{
4
+ readonly components: readonly [{
5
+ readonly components: readonly [{
6
+ readonly internalType: "contract IERC20";
7
+ readonly name: "token";
8
+ readonly type: "address";
9
+ }, {
10
+ readonly internalType: "uint256";
11
+ readonly name: "amount";
12
+ readonly type: "uint256";
13
+ }, {
14
+ readonly components: readonly [{
15
+ readonly internalType: "bytes32";
16
+ readonly name: "routerKey";
17
+ readonly type: "bytes32";
18
+ }, {
19
+ readonly internalType: "bytes";
20
+ readonly name: "swapData";
21
+ readonly type: "bytes";
22
+ }];
23
+ readonly internalType: "struct ISwapper.AggregatorData";
24
+ readonly name: "aggregatorData";
25
+ readonly type: "tuple";
26
+ }];
27
+ readonly internalType: "struct ISwapper.SrcTokenSwapDetails[]";
28
+ readonly name: "srcData";
29
+ readonly type: "tuple[]";
30
+ }, {
31
+ readonly components: readonly [{
32
+ readonly internalType: "contract IERC20";
33
+ readonly name: "destToken";
34
+ readonly type: "address";
35
+ }, {
36
+ readonly internalType: "uint256";
37
+ readonly name: "minDestAmount";
38
+ readonly type: "uint256";
39
+ }];
40
+ readonly internalType: "struct ISwapper.DestData";
41
+ readonly name: "destData";
42
+ readonly type: "tuple";
43
+ }];
44
+ readonly internalType: "struct IWithdrawalVault.MultiInSingleOutData";
45
+ readonly name: "_swapData";
46
+ readonly type: "tuple";
47
+ }, {
48
+ readonly internalType: "uint256";
49
+ readonly name: "_expectedDestTokenAmount";
50
+ readonly type: "uint256";
51
+ }];
52
+ readonly name: "completeWithdrawal";
53
+ readonly outputs: readonly [];
54
+ readonly stateMutability: "nonpayable";
55
+ readonly type: "function";
56
+ }, {
57
+ readonly inputs: readonly [];
58
+ readonly name: "completeWithdrawal";
59
+ readonly outputs: readonly [];
60
+ readonly stateMutability: "nonpayable";
61
+ readonly type: "function";
62
+ }, {
3
63
  readonly inputs: readonly [];
4
64
  readonly name: "customCooldown";
5
65
  readonly outputs: readonly [{
@@ -89,6 +149,29 @@ export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<P
89
149
  readonly outputs: readonly [];
90
150
  readonly stateMutability: "nonpayable";
91
151
  readonly type: "function";
152
+ }, {
153
+ readonly inputs: readonly [{
154
+ readonly internalType: "address";
155
+ readonly name: "_depositor";
156
+ readonly type: "address";
157
+ }];
158
+ readonly name: "getTrackedAssets";
159
+ readonly outputs: readonly [{
160
+ readonly components: readonly [{
161
+ readonly internalType: "address";
162
+ readonly name: "token";
163
+ readonly type: "address";
164
+ }, {
165
+ readonly internalType: "uint256";
166
+ readonly name: "balance";
167
+ readonly type: "uint256";
168
+ }];
169
+ readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
170
+ readonly name: "trackedAssets";
171
+ readonly type: "tuple[]";
172
+ }];
173
+ readonly stateMutability: "view";
174
+ readonly type: "function";
92
175
  }, {
93
176
  readonly inputs: readonly [{
94
177
  readonly internalType: "address";
@@ -135,6 +218,20 @@ export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<P
135
218
  readonly outputs: readonly [];
136
219
  readonly stateMutability: "payable";
137
220
  readonly type: "function";
221
+ }, {
222
+ readonly inputs: readonly [{
223
+ readonly internalType: "uint256";
224
+ readonly name: "_portion";
225
+ readonly type: "uint256";
226
+ }, {
227
+ readonly internalType: "address";
228
+ readonly name: "_to";
229
+ readonly type: "address";
230
+ }];
231
+ readonly name: "partialWithdraw";
232
+ readonly outputs: readonly [];
233
+ readonly stateMutability: "nonpayable";
234
+ readonly type: "function";
138
235
  }, {
139
236
  readonly inputs: readonly [];
140
237
  readonly name: "swapper";
@@ -5,8 +5,6 @@ export { useRawAssetPrice } from './use-raw-asset-price';
5
5
  export { useIsTradingEnabled } from './use-is-trading-enabled';
6
6
  export { useExchangeRate } from './use-exchange-rate';
7
7
  export { useHandleTrade } from './use-handle-trade';
8
- export { useMinReceiveText } from './use-min-receive-text';
9
- export { useMaxSlippagePlaceholder } from './use-max-slippage-placeholder';
10
8
  export { useSynthetixV3OraclesUpdate } from './synthetix-v3/use-synthetix-v3-oracles-update';
11
9
  export { useDepositProjectedEarnings } from './projected-earnings/use-deposit-projected-earnings';
12
10
  export { useProjectedEarningsCore } from './projected-earnings/use-projected-earnings-core';
@@ -0,0 +1,7 @@
1
+ import { type UseQueryOptions } from '@tanstack/react-query';
2
+ import type { Address } from 'viem';
3
+ import type { SwapDataRequest, SwapDataResponse } from 'core-kit/types';
4
+ export declare const useSwapsDataQuery: (assets: Omit<SwapDataRequest, 'fromAddress'>[], options?: Omit<UseQueryOptions<Record<Address, SwapDataResponse | null>, Error, Record<Address, SwapDataResponse | null>, [
5
+ string,
6
+ Omit<SwapDataRequest, 'fromAddress'>[]
7
+ ]>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<Record<`0x${string}`, SwapDataResponse | null>, Error>;