@dhedge/trading-widget 5.0.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.
Files changed (65) hide show
  1. package/README.md +29 -21
  2. package/core-kit/const/storage.d.ts +0 -3
  3. package/core-kit/const/trading.d.ts +2 -0
  4. package/core-kit/hooks/state/index.d.ts +1 -0
  5. package/core-kit/hooks/state/stepper.d.ts +5 -0
  6. package/core-kit/hooks/trading/allowance/use-approve.d.ts +3 -1
  7. package/core-kit/hooks/trading/allowance/use-can-spend.d.ts +4 -1
  8. package/core-kit/hooks/trading/index.d.ts +1 -0
  9. package/core-kit/hooks/trading/trade-handlers/use-handle-trade.d.ts +6 -1
  10. package/core-kit/hooks/trading/trade-handlers/use-trading-settle-handler.d.ts +7 -1
  11. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-auto-send-complete-withdraw-transaction.d.ts +6 -1
  12. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-transaction.d.ts +3 -1
  13. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-handle-complete-withdraw.d.ts +2 -1
  14. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-allowance.d.ts +7 -1
  15. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction.d.ts +6 -1
  16. package/core-kit/hooks/trading/withdraw-v2/init-step/use-is-unroll-and-claim-transaction.d.ts +5 -1
  17. package/core-kit/types/state.types.d.ts +6 -1
  18. package/core-kit/types/trading-panel.types.d.ts +7 -0
  19. package/core-kit/utils/formatter.d.ts +1 -0
  20. package/index.cjs +1 -1
  21. package/index.d.ts +2 -2
  22. package/index.js +3867 -3550
  23. package/package.json +1 -1
  24. package/style.css +1 -1
  25. package/trading-widget/components/widget/widget-buttons/add-to-wallet-button/add-to-wallet-button.d.ts +2 -0
  26. package/trading-widget/components/widget/widget-buttons/add-to-wallet-button/add-to-wallet-button.hooks.d.ts +3 -0
  27. package/trading-widget/components/widget/widget-buttons/index.d.ts +3 -0
  28. package/trading-widget/components/widget/widget-buttons/notifications-settings-button/notifications-settings-button.d.ts +3 -0
  29. package/trading-widget/components/widget/widget-buttons/withdraw-stepper-button/withdraw-stepper-button.d.ts +2 -0
  30. package/trading-widget/components/widget/widget-buttons/withdraw-stepper-button/withdraw-stepper-button.hooks.d.ts +4 -0
  31. package/trading-widget/components/widget/widget-overlay/index.d.ts +1 -1
  32. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-overlay.hooks.d.ts +1 -0
  33. package/trading-widget/components/widget/widget-overlay/trading-overlay/withdrawals/success-withdrawal-overlay.d.ts +3 -0
  34. package/trading-widget/components/widget/widget-overlay/trading-overlay/withdrawals/success-withdrawal-overlay.hooks.d.ts +9 -0
  35. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/approve-step.d.ts +3 -0
  36. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/approve-step.hooks.d.ts +10 -0
  37. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/complete-withdraw-step.d.ts +3 -0
  38. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/complete-withdraw-step.hooks.d.ts +10 -0
  39. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/init-withdraw-step.d.ts +3 -0
  40. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/init-withdraw-step.hooks.d.ts +13 -0
  41. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/step-item.d.ts +9 -0
  42. 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
  43. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-stepper-overlay.hooks.d.ts +14 -0
  44. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-steps.d.ts +11 -0
  45. package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts +1 -2
  46. package/trading-widget/hooks/index.d.ts +3 -0
  47. package/trading-widget/hooks/use-display-limit-sell-overlay.d.ts +1 -0
  48. package/trading-widget/hooks/use-step-description.d.ts +1 -0
  49. package/trading-widget/hooks/use-transaction-status-label.d.ts +5 -0
  50. package/trading-widget/providers/component-provider/component-provider.d.ts +1 -0
  51. package/trading-widget/providers/component-provider/component-provider.hooks.d.ts +1 -0
  52. package/trading-widget/providers/component-provider/component-provider.types.d.ts +5 -0
  53. package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -0
  54. package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +5 -0
  55. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +11 -5
  56. package/trading-widget/types/overlay.types.d.ts +1 -1
  57. package/trading-widget/types/theme.types.d.ts +1 -1
  58. package/trading-widget/components/widget/widget-overlay/fmp-withdrawal-overlay/fmp-withdrawal-overlay.hooks.d.ts +0 -10
  59. package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.d.ts +0 -2
  60. package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +0 -6
  61. package/trading-widget/components/withdraw/complete-step/complete-step.hooks.d.ts +0 -3
  62. package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.d.ts +0 -2
  63. package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.hooks.d.ts +0 -6
  64. package/trading-widget/components/withdraw/stepper/withdraw-stepper.d.ts +0 -2
  65. package/trading-widget/components/withdraw/stepper/withdraw-stepper.hooks.d.ts +0 -8
package/README.md CHANGED
@@ -157,10 +157,11 @@ UI configuration provider. Manages params to configure custom styling, component
157
157
 
158
158
  ##### actions
159
159
 
160
- > | name | type | default value | description |
161
- > | -------------------- | ------------------------ | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
162
- > | `onConnect` | `() => void` | `() => {}` | Widget has built-in `Connect Wallet` action button that triggers `onConnect` callback assuming starting of abstract wallet connection process. After all the only requirement is to get connected wallet inside wagmi's `useAccount` hook to make trading operations possible |
163
- > | `onAcceptTermsOfUse` | `() => Promise<boolean>` | `() => Promise.resolve(true)` | Callback is triggered after user's approval of Terms of Use statements assuming switching of external `config.termsOfUseAccepted` param to `true` state |
160
+ > | name | type | default value | description |
161
+ > | ----------------------------- | ------------------------ | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
162
+ > | `onConnect` | `() => void` | `() => {}` | Widget has built-in `Connect Wallet` action button that triggers `onConnect` callback assuming starting of abstract wallet connection process. After all the only requirement is to get connected wallet inside wagmi's `useAccount` hook to make trading operations possible |
163
+ > | `onAcceptTermsOfUse` | `() => Promise<boolean>` | `() => Promise.resolve(true)` | Callback is triggered after user's approval of Terms of Use statements assuming switching of external `config.termsOfUseAccepted` param to `true` state |
164
+ > | `onOpenNotificationsSettings` | `() => void` | `undefined` | Optional callback to open notifications settings modal. |
164
165
 
165
166
  ###### Source: `packages/trading-widget/src/trading-widget/providers/config-provider`
166
167
 
@@ -175,18 +176,19 @@ UI configuration provider. Manages params to configure custom styling, component
175
176
  <code>Custom components to be injected into widget layout</code>
176
177
  </summary>
177
178
 
178
- > | name | type | default value | description |
179
- > | ----------------------- | ----------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
180
- > | `GeoBlockAlert` | ComponentType | `<GeoBlockAlert>` | Component replaces deposit button while `isGeoBlocked` config param is set to `true` |
181
- > | `SanctionedAlert` | ComponentType | `<SanctionedAlert>` | Component replaces deposit button while `isSanctioned` config param is set to `true` |
182
- > | `MaxSupplyReachedAlert` | ComponentType | `<MaxSupplyReachedAlert>` | Component rendered in the deposit meta when the expected total supply exceeds the max cap; warns that the deposit will not go through |
183
- > | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure |
184
- > | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure |
185
- > | `CustomDepositMeta` | ComponentType | `undefined` | Custom extra component injected above deposit meta section in the deposit tab panel (e.g., chart, info, etc.) |
186
- > | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering |
187
- > | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation |
188
- > | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points |
189
- > | `ActionButton` | ComponentType | `<ActionButton>` | Component overrides default `ActionButton` and has `ButtonProps` API |
179
+ > | name | type | default value | description |
180
+ > | ----------------------- | ---------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
181
+ > | `GeoBlockAlert` | ComponentType | `<GeoBlockAlert>` | Component replaces deposit button while `isGeoBlocked` config param is set to `true` |
182
+ > | `SanctionedAlert` | ComponentType | `<SanctionedAlert>` | Component replaces deposit button while `isSanctioned` config param is set to `true` |
183
+ > | `MaxSupplyReachedAlert` | ComponentType | `<MaxSupplyReachedAlert>` | Component rendered in the deposit meta when the expected total supply exceeds the max cap; warns that the deposit will not go through |
184
+ > | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure |
185
+ > | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure |
186
+ > | `CustomDepositMeta` | ComponentType | `undefined` | Custom extra component injected above deposit meta section in the deposit tab panel (e.g., chart, info, etc.) |
187
+ > | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering |
188
+ > | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation |
189
+ > | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points |
190
+ > | `ActionButton` | ComponentType | `<ActionButton>` | Component overrides default `ActionButton` and has `ButtonProps` API |
191
+ > | `BecomeReferrerButton` | ComponentType<BecomeReferrerButtonProps> | `undefined` | Component is rendered at the top of the action buttons in the success deposit overlay. Receives `vaultAddress` prop |
190
192
 
191
193
  ###### Source: `packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsx`
192
194
 
@@ -292,6 +294,14 @@ path: `component.popup[name]`
292
294
  > | `color.colorBorder` | string | `config?.global?.color?.colorTextSecondary ?? #9DA2AD` | Popup bg color |
293
295
  > | `size.fontSize` | string | `config?.global?.size?.fontSizeXs ?? 12px` | Popup font size |
294
296
 
297
+ ###### overlay
298
+
299
+ path: `component.overlay[name]`
300
+
301
+ > | name | type | default value | description |
302
+ > | --------------- | ------ | ----------------------------------------------------- | ---------------- |
303
+ > | `color.colorBg` | string | `config?.component?.popup?.color?.colorBg ?? #2B313E` | Overlay bg color |
304
+
295
305
  ###### popupList
296
306
 
297
307
  path: `component.popupList[name]`
@@ -517,6 +527,7 @@ path: `component.meta[name]`
517
527
  > | `allAssets` | string | All Assets | |
518
528
  > | `all` | string | All | |
519
529
  > | `sell` | string | Sell | |
530
+ > | `sellNow` | string | Sell now | |
520
531
  > | `receiveEstimated` | string | Receive (estimated) | |
521
532
  > | `confirmInWallet` | string | Please confirm in wallet | |
522
533
  > | `pending` | string | Pending... | |
@@ -568,11 +579,6 @@ path: `component.meta[name]`
568
579
  > | `claimLabel` | string | Claim Assets | |
569
580
  > | `createLimitSellOrder` | string | Stop order set | |
570
581
  > | `swapAndClaimTo` | string | Swap and claim assets to | |
571
- > | `initWithdrawDescription` | string | Unroll | |
572
- > | `initWithdrawTooltip` | string | Unroll prepares assets for single asset withdrawal | |
573
- > | `completeWithdrawDescription` | string | Claim | |
574
- > | `completeWithdrawTooltip` | string | This final step swaps all assets to a single asset and sends it to your wallet | |
575
- > | `unrollAndClaimDescription` | string | Claim | |
576
582
  > | `limitOrderWithdrawDescription` | string | You are about to create a withdrawal request. Your vault tokens will be withdrawn within a few minutes. | |
577
583
  > | `total` | string | Total: | |
578
584
  > | `showAll` | string | Show All | |
@@ -585,6 +591,8 @@ path: `component.meta[name]`
585
591
  > | `batchTransactionsSwitchLabel` | string | Batch | |
586
592
  > | `batchTransactionsTooltip` | string | Group approve and trade calls into a single batch transaction. Disable if you prefer separate prompts. | |
587
593
  > | `openLimitOrderAfterBuySwitchLabel` | string | Add Stop Order | |
594
+ > | `openNotificationsSettingsLabel` | string | Enable alerts | |
595
+ > | `addToWallet` | string | add to wallet | |
588
596
  > | `orderingLabel` | string | Ordering | |
589
597
  > | `paidLabel` | string | Paid | |
590
598
  > | `priceLabel` | string | Price | |
@@ -3,6 +3,3 @@ export declare const LOCAL_STORAGE_KEYS: {
3
3
  readonly REFERRER: "referrer";
4
4
  readonly REF_POOL: "ref_pool";
5
5
  };
6
- export declare const SESSION_STORAGE_KEYS: {
7
- readonly AUTO_COMPLETE_WITHDRAW: "auto-complete-withdraw";
8
- };
@@ -1,3 +1,4 @@
1
+ import type { TransactionAction } from '../types';
1
2
  export declare const EASY_SWAPPER_V2_DEPOSIT_METHODS: {
2
3
  DEPOSIT: "deposit";
3
4
  DEPOSIT_CUSTOM: "depositWithCustomCooldown";
@@ -8,3 +9,4 @@ export declare const EASY_SWAPPER_V2_DEPOSIT_METHODS: {
8
9
  ZAP_DEPOSIT: "zapDeposit";
9
10
  ZAP_DEPOSIT_CUSTOM: "zapDepositWithCustomCooldown";
10
11
  };
12
+ export declare const COMPLETE_WITHDRAW_ACTIONS: TransactionAction[];
@@ -3,6 +3,7 @@ export { useTradingPanelPoolAddress, useTradingPanelPoolConfig, useTradingPanelP
3
3
  export { useSendTokenInput, useReceiveTokenInput, } from '../../hooks/state/input';
4
4
  export { useTradingPanelSettings, useCustomDepositTokensPerChain, } from '../../hooks/state/settings';
5
5
  export { useTradingPanelModal } from '../../hooks/state/modal';
6
+ export { useTradingPanelStepper } from '../../hooks/state/stepper';
6
7
  export { useTradingPanelType, useIsDepositTradingPanelType, } from '../../hooks/state/type';
7
8
  export { useTradingPanelTransactions } from '../../hooks/state/transaction';
8
9
  export { useTradingPanelActions, useTradingPanelState, } from '../../hooks/state/context';
@@ -0,0 +1,5 @@
1
+ import type { TradingPanelActionsState, TradingPanelState } from '../../types/state.types';
2
+ export declare const useTradingPanelStepper: () => [
3
+ TradingPanelState['stepper'],
4
+ TradingPanelActionsState['updateStepper']
5
+ ];
@@ -1,9 +1,11 @@
1
1
  import type { TradingToken } from '@shared/types';
2
+ import type { OnTradingSettleErrorCallback } from '../../../hooks/trading/trade-handlers/use-trading-settle-handler';
2
3
  import type { Address } from '../../../types/web3.types';
3
4
  interface UseApproveParams {
4
5
  token: TradingToken;
5
6
  rawTokenAmount: string;
6
7
  spenderAddress: Address;
8
+ onErrorCallback?: OnTradingSettleErrorCallback;
7
9
  }
8
- export declare const useApprove: ({ token, rawTokenAmount, spenderAddress, }: UseApproveParams) => () => Promise<void>;
10
+ export declare const useApprove: ({ token, rawTokenAmount, spenderAddress, onErrorCallback, }: UseApproveParams) => () => Promise<void>;
9
11
  export {};
@@ -7,5 +7,8 @@ interface UseCanSpendParams {
7
7
  chainId: ChainId;
8
8
  skip?: boolean;
9
9
  }
10
- export declare const useCanSpend: ({ rawAmountToSpend, tokenAddress, ownerAddress, spenderAddress, chainId, skip, }: UseCanSpendParams) => boolean;
10
+ export declare const useCanSpend: ({ rawAmountToSpend, tokenAddress, ownerAddress, spenderAddress, chainId, skip, }: UseCanSpendParams) => {
11
+ canSpend: boolean;
12
+ isFetching: boolean;
13
+ };
11
14
  export {};
@@ -1,5 +1,6 @@
1
1
  export { useTradingResultHandling } from '../../hooks/trading/trade-handlers/use-trading-result-handling';
2
2
  export { useTradingSettleHandler } from '../../hooks/trading/trade-handlers/use-trading-settle-handler';
3
+ export type { OnTradingSettleErrorCallback } from '../../hooks/trading/trade-handlers/use-trading-settle-handler';
3
4
  export { useAssetPrice } from '../../hooks/trading/use-asset-price';
4
5
  export { useRawAssetPrice } from '../../hooks/trading/use-raw-asset-price';
5
6
  export { useIsTradingEnabled } from '../../hooks/trading/use-is-trading-enabled';
@@ -1,6 +1,11 @@
1
1
  import type { ContractActionFunc } from '../../../types/web3.types';
2
- export declare const useHandleTrade: (trade: ContractActionFunc) => {
2
+ interface UseHandleTradeParams {
3
+ trade: ContractActionFunc;
4
+ onErrorCallback?: () => void;
5
+ }
6
+ export declare const useHandleTrade: ({ trade, onErrorCallback, }: UseHandleTradeParams) => {
3
7
  disabled: boolean;
4
8
  label: string;
5
9
  handleTrade: () => Promise<void>;
6
10
  };
11
+ export {};
@@ -1,3 +1,9 @@
1
1
  import type { PendingTransaction } from '../../../types/trading-panel.types';
2
2
  import type { UseWriteContractParameters } from '../../../types/web3.types';
3
- export declare const useTradingSettleHandler: (action: PendingTransaction['action']) => Required<Required<UseWriteContractParameters>['mutation']>['onSettled'];
3
+ export type OnTradingSettleErrorCallback = (error: Error) => void;
4
+ interface UseTradingSettleHandlerParams {
5
+ action: PendingTransaction['action'];
6
+ onErrorCallback?: OnTradingSettleErrorCallback;
7
+ }
8
+ export declare const useTradingSettleHandler: ({ action, onErrorCallback, }: UseTradingSettleHandlerParams) => Required<Required<UseWriteContractParameters>['mutation']>['onSettled'];
9
+ export {};
@@ -1 +1,6 @@
1
- export declare const useAutoSendCompleteWithdrawTransaction: (handleTrade: () => Promise<void>) => void;
1
+ interface UseAutoSendCompleteWithdrawTransactionParams {
2
+ handleTrade: () => Promise<void>;
3
+ onError: () => void;
4
+ }
5
+ export declare const useAutoSendCompleteWithdrawTransaction: ({ handleTrade, onError, }: UseAutoSendCompleteWithdrawTransactionParams) => void;
6
+ export {};
@@ -1,6 +1,8 @@
1
+ import type { OnTradingSettleErrorCallback } from '../../../../hooks/trading';
1
2
  import type { ContractActionFunc } from '../../../../types/web3.types';
2
3
  interface UseWithdrawSwapTransactionProps {
3
4
  isClaim?: boolean;
5
+ onErrorCallback?: OnTradingSettleErrorCallback;
4
6
  }
5
- export declare const useCompleteWithdrawTransaction: ({ isClaim, }?: UseWithdrawSwapTransactionProps | undefined) => ContractActionFunc;
7
+ export declare const useCompleteWithdrawTransaction: ({ isClaim, onErrorCallback, }?: UseWithdrawSwapTransactionProps | undefined) => ContractActionFunc;
6
8
  export {};
@@ -2,8 +2,9 @@ import type { ContractActionFunc } from '../../../../types/web3.types';
2
2
  interface UseHandleWithdrawSwapProps {
3
3
  withdraw: ContractActionFunc;
4
4
  isClaim?: boolean;
5
+ onErrorCallback?: () => void;
5
6
  }
6
- export declare const useHandleCompleteWithdraw: ({ withdraw, isClaim, }: UseHandleWithdrawSwapProps) => {
7
+ export declare const useHandleCompleteWithdraw: ({ withdraw, isClaim, onErrorCallback, }: UseHandleWithdrawSwapProps) => {
7
8
  disabled: boolean;
8
9
  label: string;
9
10
  handleTrade: () => Promise<void>;
@@ -1,4 +1,10 @@
1
- export declare const useInitWithdrawAllowance: () => {
1
+ import type { OnTradingSettleErrorCallback } from '../../../../hooks/trading';
2
+ interface UseInitWithdrawAllowanceParams {
3
+ onErrorCallback?: OnTradingSettleErrorCallback;
4
+ }
5
+ export declare const useInitWithdrawAllowance: ({ onErrorCallback, }?: UseInitWithdrawAllowanceParams | undefined) => {
2
6
  canSpend: boolean;
3
7
  approve: () => Promise<void>;
8
+ isCanSpendFetching: boolean;
4
9
  };
10
+ export {};
@@ -1,6 +1,11 @@
1
+ import { type OnTradingSettleErrorCallback } from '../../../../hooks/trading';
1
2
  import type { TransactionAction } from '../../../../types';
2
3
  import type { ContractActionFunc } from '../../../../types/web3.types';
3
- export declare const useInitWithdrawTransaction: () => {
4
+ interface UseInitiateWithdrawTransactionParams {
5
+ onErrorCallback?: OnTradingSettleErrorCallback;
6
+ }
7
+ export declare const useInitWithdrawTransaction: ({ onErrorCallback, }?: UseInitiateWithdrawTransactionParams | undefined) => {
4
8
  withdraw: ContractActionFunc;
5
9
  action: TransactionAction;
6
10
  };
11
+ export {};
@@ -1 +1,5 @@
1
- export declare const useIsUnrollAndClaimTransaction: () => boolean;
1
+ export declare const useIsUnrollAndClaimTransaction: () => {
2
+ isUnrollAndClaimTransaction: boolean;
3
+ isFetching: boolean;
4
+ isFetched: boolean;
5
+ };
@@ -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,6 +47,7 @@ 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
53
  updatePoolConfig: (payload: Record<PoolConfig['address'], Pick<PoolConfig, 'maintenance' | 'maintenanceDeposits' | 'maintenanceWithdrawals'>>) => void;
@@ -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;
@@ -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;
@@ -12,3 +12,4 @@ export declare const formatTokenBalance: ({ balance, symbol, precision, truncate
12
12
  precision: number;
13
13
  truncateSymbol?: boolean | undefined;
14
14
  }) => string;
15
+ export declare const getTxHashShort: (link: string | undefined) => string | undefined;