@dhedge/trading-widget 2.0.7 → 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 (113) hide show
  1. package/README.md +325 -301
  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-f50b0dfa.js → index-15f9e6d8.js} +15631 -15672
  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-b09c2a74.js → pyth-adapter-393858f5.js} +1 -1
  45. package/{pyth-adapter-5256483f.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/theme-provider/theme-provider.types.d.ts +1 -0
  91. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +10 -0
  92. package/core-kit/abi/dhedge-easy-swapper.d.ts +0 -231
  93. package/core-kit/hooks/trading/use-max-slippage-placeholder.d.ts +0 -1
  94. package/core-kit/hooks/trading/use-min-receive-text.d.ts +0 -4
  95. package/core-kit/hooks/trading/withdraw/index.d.ts +0 -7
  96. package/core-kit/hooks/trading/withdraw/use-withdraw-quote.d.ts +0 -2
  97. package/core-kit/hooks/trading/withdraw/use-withdraw-slippage.d.ts +0 -9
  98. package/core-kit/hooks/trading/withdraw/use-withdraw-trading-params.d.ts +0 -2
  99. package/core-kit/hooks/trading/withdraw/use-withdraw.d.ts +0 -2
  100. package/core-kit/models/default-selling-params.d.ts +0 -18
  101. package/index-10e5f6b7.cjs +0 -207
  102. package/trading-widget/components/widget/widget-input/asset-composition-table/asset-composition-table.d.ts +0 -2
  103. package/trading-widget/components/withdraw/balance/balance.d.ts +0 -2
  104. package/trading-widget/components/withdraw/button/trade-button/trade-button.d.ts +0 -2
  105. package/trading-widget/components/withdraw/button/valid-withdraw-button/valid-withdraw-button.d.ts +0 -2
  106. package/trading-widget/components/withdraw/input-group/input-group.d.ts +0 -1
  107. package/trading-widget/components/withdraw/input-group/input-group.hooks.d.ts +0 -23
  108. package/trading-widget/components/withdraw/meta/meta.d.ts +0 -2
  109. package/trading-widget/components/withdraw/meta/transaction-disclosure/transaction-disclosure.d.ts +0 -1
  110. package/trading-widget/components/withdraw/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +0 -16
  111. /package/core-kit/hooks/trading/{withdraw → withdraw-v2/init-step}/use-is-multi-asset-withdraw.d.ts +0 -0
  112. /package/core-kit/hooks/trading/{withdraw → withdraw-v2}/use-withdraw-type-handler.d.ts +0 -0
  113. /package/trading-widget/components/{widget/widget-input → withdraw/init-step/input-group/withdraw-section}/asset-composition-table/withdraw-explanation-tip.d.ts +0 -0
@@ -1,231 +0,0 @@
1
- export declare const DhedgeEasySwapperAbi: readonly [{
2
- readonly inputs: readonly [{
3
- readonly internalType: "address";
4
- readonly name: "";
5
- readonly type: "address";
6
- }];
7
- readonly name: "allowedPools";
8
- readonly outputs: readonly [{
9
- readonly internalType: "bool";
10
- readonly name: "";
11
- readonly type: "bool";
12
- }];
13
- readonly stateMutability: "view";
14
- readonly type: "function";
15
- }, {
16
- readonly inputs: readonly [{
17
- readonly internalType: "address";
18
- readonly name: "pool";
19
- readonly type: "address";
20
- }, {
21
- readonly internalType: "contract IERC20Extended";
22
- readonly name: "depositAsset";
23
- readonly type: "address";
24
- }, {
25
- readonly internalType: "uint256";
26
- readonly name: "amount";
27
- readonly type: "uint256";
28
- }, {
29
- readonly internalType: "contract IERC20Extended";
30
- readonly name: "poolDepositAsset";
31
- readonly type: "address";
32
- }, {
33
- readonly internalType: "uint256";
34
- readonly name: "expectedLiquidityMinted";
35
- readonly type: "uint256";
36
- }];
37
- readonly name: "deposit";
38
- readonly outputs: readonly [{
39
- readonly internalType: "uint256";
40
- readonly name: "liquidityMinted";
41
- readonly type: "uint256";
42
- }];
43
- readonly stateMutability: "nonpayable";
44
- readonly type: "function";
45
- }, {
46
- readonly inputs: readonly [{
47
- readonly internalType: "address";
48
- readonly name: "pool";
49
- readonly type: "address";
50
- }, {
51
- readonly internalType: "contract IERC20Extended";
52
- readonly name: "depositAsset";
53
- readonly type: "address";
54
- }, {
55
- readonly internalType: "uint256";
56
- readonly name: "amount";
57
- readonly type: "uint256";
58
- }, {
59
- readonly internalType: "contract IERC20Extended";
60
- readonly name: "poolDepositAsset";
61
- readonly type: "address";
62
- }, {
63
- readonly internalType: "uint256";
64
- readonly name: "expectedLiquidityMinted";
65
- readonly type: "uint256";
66
- }];
67
- readonly name: "depositWithCustomCooldown";
68
- readonly outputs: readonly [{
69
- readonly internalType: "uint256";
70
- readonly name: "liquidityMinted";
71
- readonly type: "uint256";
72
- }];
73
- readonly stateMutability: "nonpayable";
74
- readonly type: "function";
75
- }, {
76
- readonly inputs: readonly [{
77
- readonly internalType: "address";
78
- readonly name: "pool";
79
- readonly type: "address";
80
- }, {
81
- readonly internalType: "contract IERC20Extended";
82
- readonly name: "poolDepositAsset";
83
- readonly type: "address";
84
- }, {
85
- readonly internalType: "uint256";
86
- readonly name: "expectedLiquidityMinted";
87
- readonly type: "uint256";
88
- }];
89
- readonly name: "depositNative";
90
- readonly outputs: readonly [{
91
- readonly internalType: "uint256";
92
- readonly name: "liquidityMinted";
93
- readonly type: "uint256";
94
- }];
95
- readonly stateMutability: "payable";
96
- readonly type: "function";
97
- }, {
98
- readonly inputs: readonly [{
99
- readonly internalType: "address";
100
- readonly name: "pool";
101
- readonly type: "address";
102
- }, {
103
- readonly internalType: "contract IERC20Extended";
104
- readonly name: "poolDepositAsset";
105
- readonly type: "address";
106
- }, {
107
- readonly internalType: "uint256";
108
- readonly name: "expectedLiquidityMinted";
109
- readonly type: "uint256";
110
- }];
111
- readonly name: "depositNativeWithCustomCooldown";
112
- readonly outputs: readonly [{
113
- readonly internalType: "uint256";
114
- readonly name: "liquidityMinted";
115
- readonly type: "uint256";
116
- }];
117
- readonly stateMutability: "payable";
118
- readonly type: "function";
119
- }, {
120
- readonly inputs: readonly [{
121
- readonly internalType: "address";
122
- readonly name: "pool";
123
- readonly type: "address";
124
- }, {
125
- readonly internalType: "contract IERC20Extended";
126
- readonly name: "depositAsset";
127
- readonly type: "address";
128
- }, {
129
- readonly internalType: "uint256";
130
- readonly name: "amount";
131
- readonly type: "uint256";
132
- }, {
133
- readonly internalType: "contract IERC20Extended";
134
- readonly name: "poolDepositAsset";
135
- readonly type: "address";
136
- }, {
137
- readonly internalType: "bool";
138
- readonly name: "customCooldown";
139
- readonly type: "bool";
140
- }];
141
- readonly name: "depositQuote";
142
- readonly outputs: readonly [{
143
- readonly internalType: "uint256";
144
- readonly name: "expectedLiquidityMinted";
145
- readonly type: "uint256";
146
- }];
147
- readonly stateMutability: "view";
148
- readonly type: "function";
149
- }, {
150
- readonly inputs: readonly [];
151
- readonly name: "feeDenominator";
152
- readonly outputs: readonly [{
153
- readonly internalType: "uint256";
154
- readonly name: "";
155
- readonly type: "uint256";
156
- }];
157
- readonly stateMutability: "view";
158
- readonly type: "function";
159
- }, {
160
- readonly inputs: readonly [];
161
- readonly name: "feeNumerator";
162
- readonly outputs: readonly [{
163
- readonly internalType: "uint256";
164
- readonly name: "";
165
- readonly type: "uint256";
166
- }];
167
- readonly stateMutability: "view";
168
- readonly type: "function";
169
- }, {
170
- readonly inputs: readonly [{
171
- readonly internalType: "address";
172
- readonly name: "pool";
173
- readonly type: "address";
174
- }, {
175
- readonly internalType: "uint256";
176
- readonly name: "fundTokenAmount";
177
- readonly type: "uint256";
178
- }, {
179
- readonly internalType: "contract IERC20Extended";
180
- readonly name: "withdrawalAsset";
181
- readonly type: "address";
182
- }, {
183
- readonly internalType: "uint256";
184
- readonly name: "expectedAmountOut";
185
- readonly type: "uint256";
186
- }];
187
- readonly name: "withdraw";
188
- readonly outputs: readonly [];
189
- readonly stateMutability: "nonpayable";
190
- readonly type: "function";
191
- }, {
192
- readonly inputs: readonly [{
193
- readonly internalType: "address";
194
- readonly name: "pool";
195
- readonly type: "address";
196
- }, {
197
- readonly internalType: "uint256";
198
- readonly name: "fundTokenAmount";
199
- readonly type: "uint256";
200
- }, {
201
- readonly internalType: "uint256";
202
- readonly name: "expectedAmountOut";
203
- readonly type: "uint256";
204
- }];
205
- readonly name: "withdrawNative";
206
- readonly outputs: readonly [];
207
- readonly stateMutability: "nonpayable";
208
- readonly type: "function";
209
- }, {
210
- readonly inputs: readonly [{
211
- readonly internalType: "address";
212
- readonly name: "pool";
213
- readonly type: "address";
214
- }, {
215
- readonly internalType: "uint256";
216
- readonly name: "fundTokenAmount";
217
- readonly type: "uint256";
218
- }, {
219
- readonly internalType: "contract IERC20Extended";
220
- readonly name: "intermediateAsset";
221
- readonly type: "address";
222
- }, {
223
- readonly internalType: "uint256";
224
- readonly name: "expectedAmountSUSD";
225
- readonly type: "uint256";
226
- }];
227
- readonly name: "withdrawSUSD";
228
- readonly outputs: readonly [];
229
- readonly stateMutability: "nonpayable";
230
- readonly type: "function";
231
- }];
@@ -1 +0,0 @@
1
- export declare const useMaxSlippagePlaceholder: () => string;
@@ -1,4 +0,0 @@
1
- import BigNumber from 'bignumber.js';
2
- import type { TradingPanelState } from 'core-kit/types';
3
- export declare const receiveAppliedSlippage: (receiveBalance: BigNumber, slippage: TradingPanelState['settings']['slippage'], scale: number[]) => string;
4
- export declare const useMinReceiveText: () => string;
@@ -1,7 +0,0 @@
1
- export { useIsMultiAssetWithdraw } from './use-is-multi-asset-withdraw';
2
- export { useWithdraw } from './use-withdraw';
3
- export { useWithdrawAllowance } from './use-withdraw-allowance';
4
- export { useWithdrawSlippage } from './use-withdraw-slippage';
5
- export { useWithdrawTypeHandler } from './use-withdraw-type-handler';
6
- export { useWithdrawQuote } from './use-withdraw-quote';
7
- export { useWithdrawTradingParams } from './use-withdraw-trading-params';
@@ -1,2 +0,0 @@
1
- import type { PoolConfig } from 'core-kit/types/config.types';
2
- export declare const useWithdrawQuote: (poolConfig: Pick<PoolConfig, 'address' | 'chainId'>) => void;
@@ -1,9 +0,0 @@
1
- import type BigNumber from 'bignumber.js';
2
- import type { SendEstimationResult } from 'core-kit/types/web3.types';
3
- interface WithdrawSlippageParams {
4
- estimateSell: () => Promise<Map<number, SendEstimationResult>>;
5
- fromTokenAmount: BigNumber;
6
- isMultiAssetsWithdraw: boolean;
7
- }
8
- export declare const useWithdrawSlippage: ({ estimateSell, fromTokenAmount, isMultiAssetsWithdraw, }: WithdrawSlippageParams) => void;
9
- export {};
@@ -1,2 +0,0 @@
1
- import type { TradingParams } from 'core-kit/types/trading.types';
2
- export declare const useWithdrawTradingParams: () => Omit<TradingParams, 'poolDepositAddress'>;
@@ -1,2 +0,0 @@
1
- import type { ContractActionFunc } from 'core-kit/types/web3.types';
2
- export declare const useWithdraw: () => ContractActionFunc;
@@ -1,18 +0,0 @@
1
- import type { Address, ContractCallArgs } from 'core-kit/types/web3.types';
2
- interface DefaultSellingParamsProps {
3
- sendAssetAddress: Address;
4
- fromTokenAmount: string;
5
- receiveAssetAddress: Address;
6
- receiveAssetInputValue: string;
7
- decimalsReceiveToken: number;
8
- }
9
- export declare class DefaultSellingParams implements ContractCallArgs<string> {
10
- readonly sendAssetAddress: Address;
11
- readonly fromTokenAmount: string;
12
- readonly receiveAssetAddress: Address;
13
- readonly receiveAssetInputValue: string;
14
- readonly decimalsReceiveToken: number;
15
- constructor(props: DefaultSellingParamsProps);
16
- getOrderedArgs(minReturnAmount: string): string[];
17
- }
18
- export {};