@dhedge/trading-widget 4.7.0 → 5.1.0
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/README.md +46 -39
- package/core-kit/const/storage.d.ts +0 -3
- package/core-kit/const/trading.d.ts +2 -0
- package/core-kit/hooks/state/action.d.ts +0 -4
- package/core-kit/hooks/state/index.d.ts +2 -1
- package/core-kit/hooks/state/stepper.d.ts +5 -0
- package/core-kit/hooks/trading/allowance/use-approve.d.ts +3 -1
- package/core-kit/hooks/trading/allowance/use-can-spend.d.ts +4 -1
- package/core-kit/hooks/trading/index.d.ts +2 -3
- package/core-kit/hooks/trading/trade-handlers/use-handle-trade.d.ts +6 -1
- package/core-kit/hooks/trading/trade-handlers/use-trading-settle-handler.d.ts +7 -1
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-auto-send-complete-withdraw-transaction.d.ts +6 -1
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-transaction.d.ts +3 -1
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-handle-complete-withdraw.d.ts +2 -1
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-init-withdraw-aave-swap-quotes.d.ts +5 -0
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-init-withdraw-complex-asset-data.d.ts +8 -4
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-get-init-withdraw-transaction-arguments.d.ts +2 -2
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-allowance.d.ts +7 -1
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction.d.ts +6 -1
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-is-unroll-and-claim-transaction.d.ts +5 -1
- package/core-kit/types/state.types.d.ts +7 -7
- package/core-kit/types/trading-panel.types.d.ts +7 -0
- package/core-kit/utils/aave.d.ts +1 -1
- package/core-kit/utils/complex-withdraw-asset-data.d.ts +22 -0
- package/core-kit/utils/formatter.d.ts +1 -0
- package/core-kit/utils/index.d.ts +1 -0
- package/core-kit/utils/number.d.ts +6 -0
- package/core-kit/utils/swap-data.d.ts +3 -12
- package/core-kit/utils/transaction.d.ts +6 -4
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +4026 -3714
- package/package.json +1 -1
- package/style.css +1 -1
- package/trading-widget/components/widget/widget-buttons/add-to-wallet-button/add-to-wallet-button.d.ts +2 -0
- package/trading-widget/components/widget/widget-buttons/add-to-wallet-button/add-to-wallet-button.hooks.d.ts +3 -0
- package/trading-widget/components/widget/widget-buttons/index.d.ts +3 -0
- package/trading-widget/components/widget/widget-buttons/notifications-settings-button/notifications-settings-button.d.ts +3 -0
- package/trading-widget/components/widget/widget-buttons/withdraw-stepper-button/withdraw-stepper-button.d.ts +2 -0
- package/trading-widget/components/widget/widget-buttons/withdraw-stepper-button/withdraw-stepper-button.hooks.d.ts +4 -0
- package/trading-widget/components/widget/widget-overlay/index.d.ts +1 -1
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-overlay.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/withdrawals/success-withdrawal-overlay.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/withdrawals/success-withdrawal-overlay.hooks.d.ts +9 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/approve-step.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/approve-step.hooks.d.ts +10 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/complete-withdraw-step.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/complete-withdraw-step.hooks.d.ts +10 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/init-withdraw-step.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/init-withdraw-step.hooks.d.ts +13 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/step-item.d.ts +9 -0
- package/trading-widget/components/widget/widget-overlay/{fmp-withdrawal-overlay/fmp-withdrawal-overlay.d.ts → withdraw-stepper-overlay/withdraw-stepper-overlay.d.ts} +1 -1
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-stepper-overlay.hooks.d.ts +14 -0
- package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-steps.d.ts +11 -0
- package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts +1 -2
- package/trading-widget/hooks/index.d.ts +3 -0
- package/trading-widget/hooks/use-display-limit-sell-overlay.d.ts +1 -0
- package/trading-widget/hooks/use-step-description.d.ts +1 -0
- package/trading-widget/hooks/use-transaction-status-label.d.ts +5 -0
- package/trading-widget/providers/component-provider/component-provider.d.ts +1 -0
- package/trading-widget/providers/component-provider/component-provider.hooks.d.ts +1 -0
- package/trading-widget/providers/component-provider/component-provider.types.d.ts +5 -0
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -1
- package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +5 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +11 -5
- package/trading-widget/types/overlay.types.d.ts +1 -1
- package/trading-widget/types/theme.types.d.ts +1 -1
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-init-withdraw-aave-swap-data.d.ts +0 -5
- package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +0 -1248
- package/trading-widget/components/widget/widget-overlay/fmp-withdrawal-overlay/fmp-withdrawal-overlay.hooks.d.ts +0 -10
- package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.d.ts +0 -2
- package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +0 -6
- package/trading-widget/components/withdraw/complete-step/complete-step.hooks.d.ts +0 -3
- package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.d.ts +0 -2
- package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.hooks.d.ts +0 -6
- package/trading-widget/components/withdraw/stepper/withdraw-stepper.d.ts +0 -2
- package/trading-widget/components/withdraw/stepper/withdraw-stepper.hooks.d.ts +0 -8
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { SwapDataResponse } from '@shared/types';
|
|
1
2
|
import type { Address, Hex } from 'viem';
|
|
2
|
-
import type { fetchSwapsDataForAave, useSwapsDataQuery } from '../hooks/trading';
|
|
3
3
|
import type { useCompleteWithdrawTrackedAssets } from '../hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-tracked-assets';
|
|
4
4
|
import type { CalculateSwapDataParamsResponse } from '../types';
|
|
5
|
+
import type { SwapDataMap, SwapsQuotesMap } from '../utils/swap-data';
|
|
5
6
|
/**
|
|
6
7
|
* Calculates the slippage tolerance for withdrawSafe.
|
|
7
8
|
* Returns an integer number from 0 to 10000,
|
|
@@ -24,13 +25,14 @@ export declare const buildZapDepositTransactionArguments: ({ vaultAddress, swapD
|
|
|
24
25
|
export declare const buildSwapWithdrawTransactionData: ({ receiveAssetAddress, assets, swapData, }: {
|
|
25
26
|
receiveAssetAddress: Address;
|
|
26
27
|
assets: ReturnType<typeof useCompleteWithdrawTrackedAssets>['data'];
|
|
27
|
-
swapData:
|
|
28
|
+
swapData: SwapDataMap;
|
|
28
29
|
}) => unknown[][];
|
|
29
|
-
export declare const buildAaveWithdrawAssetTransactionData: ({ assetAddress,
|
|
30
|
+
export declare const buildAaveWithdrawAssetTransactionData: ({ assetAddress, swapQuotes, swapParams, slippageToleranceForContractTransaction, routerKey, }: {
|
|
30
31
|
assetAddress: Address;
|
|
31
32
|
swapParams: CalculateSwapDataParamsResponse | undefined;
|
|
32
|
-
|
|
33
|
+
swapQuotes: SwapsQuotesMap<string>;
|
|
33
34
|
slippageToleranceForContractTransaction: bigint;
|
|
35
|
+
routerKey: SwapDataResponse['routerKey'];
|
|
34
36
|
}) => {
|
|
35
37
|
supportedAsset: `0x${string}`;
|
|
36
38
|
withdrawData: string;
|