@dhedge/trading-widget 5.0.0 → 5.2.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 +35 -23
- package/core-kit/const/network.d.ts +127 -7
- package/core-kit/const/storage.d.ts +0 -3
- package/core-kit/const/trading.d.ts +2 -0
- package/core-kit/hooks/pool/use-available-manager-fee.d.ts +1 -1
- package/core-kit/hooks/pool/use-pool-dynamic-exit-remaining-cooldown.d.ts +1 -1
- package/core-kit/hooks/pool/use-user-vault-balance.d.ts +1 -1
- package/core-kit/hooks/state/action.d.ts +1 -1
- package/core-kit/hooks/state/index.d.ts +1 -0
- 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/deposit-v2/use-deposit-quote-contract-read.d.ts +1 -1
- package/core-kit/hooks/trading/index.d.ts +1 -0
- 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/use-easy-swapper-tracked-assets.d.ts +1 -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-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/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +1 -1
- package/core-kit/types/config.types.d.ts +1 -0
- package/core-kit/types/state.types.d.ts +8 -3
- package/core-kit/types/trading-panel.types.d.ts +7 -0
- package/core-kit/utils/formatter.d.ts +1 -0
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +4122 -3752
- package/limit-orders/hooks/use-user-limit-order.d.ts +1 -1
- package/package.json +3 -3
- package/style.css +1 -1
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +1 -0
- 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-input/widget-input.hooks.d.ts +1 -1
- package/trading-widget/components/widget/widget-overlay/error-notification-overlay/complete-withdraw-error-overlay.d.ts +7 -0
- package/trading-widget/components/widget/widget-overlay/error-notification-overlay/error-notification-overlay.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-overlay/index.d.ts +1 -1
- package/trading-widget/components/widget/widget-overlay/pool-select-overlay/pool-select-overlay.hooks.d.ts +1 -0
- 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 -0
- package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +6 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +13 -7
- package/trading-widget/types/overlay.types.d.ts +1 -1
- package/trading-widget/types/theme.types.d.ts +1 -1
- 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
|
@@ -1174,4 +1174,4 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
1174
1174
|
readonly outputs: readonly [];
|
|
1175
1175
|
readonly stateMutability: "payable";
|
|
1176
1176
|
readonly type: "function";
|
|
1177
|
-
}], "withdrawalContracts", [`0x${string}`], `0x${string}`>;
|
|
1177
|
+
}], "withdrawalContracts", readonly [`0x${string}`], `0x${string}`>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SwapDataRequest, SwapDataResponse, TradingToken } from '@shared/types';
|
|
2
2
|
import type { EstimationError } from '../models';
|
|
3
3
|
import type { PoolConfig, PoolFallbackData } from '../types/config.types';
|
|
4
|
-
import type { DynamicTradingToken, PendingTransaction, TokenSelectorPayload, TradingModalStatus, TradingPanelType, TransactionAction, UpdateTransactionsArguments } from '../types/trading-panel.types';
|
|
4
|
+
import type { DynamicTradingToken, PendingTransaction, StepperState, TokenSelectorPayload, TradingModalStatus, TradingPanelType, TransactionAction, UpdateTransactionsArguments } from '../types/trading-panel.types';
|
|
5
5
|
import type { Address, ChainId, SimulateTransactionParams, SimulateTransactionResponse, WaitForTransactionReceiptReturnType } from '../types/web3.types';
|
|
6
6
|
export interface TradingPanelStateModal {
|
|
7
7
|
isOpen: boolean;
|
|
@@ -32,6 +32,7 @@ export interface TradingPanelState {
|
|
|
32
32
|
receiveToken: DynamicTradingToken;
|
|
33
33
|
};
|
|
34
34
|
modal: TradingPanelStateModal;
|
|
35
|
+
stepper: StepperState | null;
|
|
35
36
|
poolAddress: PoolConfig['address'];
|
|
36
37
|
poolConfigMap: Record<PoolConfig['address'], PoolConfig>;
|
|
37
38
|
transactions: PendingTransaction[];
|
|
@@ -46,9 +47,10 @@ export interface TradingPanelSetters {
|
|
|
46
47
|
updateTradingSettings: (payload: Partial<TradingPanelState['settings']>) => void;
|
|
47
48
|
setTradingType: (payload: TradingPanelState['type']) => void;
|
|
48
49
|
updateTradingModal: (payload: Partial<TradingPanelState['modal']>) => void;
|
|
50
|
+
updateStepper: (payload: TradingPanelState['stepper']) => void;
|
|
49
51
|
updateTransactions: (payload: UpdateTransactionsArguments) => void;
|
|
50
52
|
updatePoolFallbackData: (payload: PoolFallbackData) => void;
|
|
51
|
-
updatePoolConfig: (payload: Record<PoolConfig['address'], Pick<PoolConfig, 'maintenance' | 'maintenanceDeposits' | 'maintenanceWithdrawals'>>) => void;
|
|
53
|
+
updatePoolConfig: (payload: Record<PoolConfig['address'], Pick<PoolConfig, 'maintenance' | 'maintenanceDeposits' | 'maintenanceWithdrawals' | 'depositCapacity'>>) => void;
|
|
52
54
|
addPoolConfig: (payload: PoolConfig) => void;
|
|
53
55
|
updateCustomDepositTokensPerChain: (payload: Record<ChainId, TradingToken[]>) => void;
|
|
54
56
|
}
|
|
@@ -90,6 +92,9 @@ export type TradingPanelAction = {
|
|
|
90
92
|
} | {
|
|
91
93
|
type: 'UPDATE_TRADING_MODAL';
|
|
92
94
|
payload: Partial<TradingPanelState['modal']>;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'UPDATE_STEPPER';
|
|
97
|
+
payload: TradingPanelState['stepper'];
|
|
93
98
|
} | {
|
|
94
99
|
type: 'UPDATE_TRADING_TRANSACTIONS';
|
|
95
100
|
payload: UpdateTransactionsArguments;
|
|
@@ -98,7 +103,7 @@ export type TradingPanelAction = {
|
|
|
98
103
|
payload: PoolFallbackData;
|
|
99
104
|
} | {
|
|
100
105
|
type: 'UPDATE_POOL_CONFIG';
|
|
101
|
-
payload: Record<PoolConfig['address'], Pick<PoolConfig, 'maintenance' | 'maintenanceDeposits' | 'maintenanceWithdrawals'>>;
|
|
106
|
+
payload: Record<PoolConfig['address'], Pick<PoolConfig, 'maintenance' | 'maintenanceDeposits' | 'maintenanceWithdrawals' | 'depositCapacity'>>;
|
|
102
107
|
} | {
|
|
103
108
|
type: 'ADD_POOL_CONFIG';
|
|
104
109
|
payload: PoolConfig;
|
|
@@ -24,6 +24,13 @@ type RemoveTransaction = {
|
|
|
24
24
|
export type UpdateTransactionsArguments = AddTransaction | UpdateTransaction | RemoveTransaction;
|
|
25
25
|
export type TradingPanelType = 'deposit' | 'withdraw';
|
|
26
26
|
export type TransactionAction = 'deposit' | 'multi_withdraw' | 'single_withdraw' | 'approve' | 'swap' | 'claim' | 'single_withdraw_and_claim' | 'create_limit_sell_order' | 'limit_order_withdraw' | 'delete_limit_order_withdraw';
|
|
27
|
+
export interface StepperState {
|
|
28
|
+
type: TradingPanelType;
|
|
29
|
+
sendTokenAmount?: string;
|
|
30
|
+
sendTokenSymbol: string;
|
|
31
|
+
receiveTokenAmount?: string;
|
|
32
|
+
receiveTokenSymbol: string;
|
|
33
|
+
}
|
|
27
34
|
export type SwapEntity = 'token' | 'pool';
|
|
28
35
|
export interface TokenSelectorPayload {
|
|
29
36
|
isOpen: boolean;
|