@dhedge/trading-widget 3.0.0-alpha.3 → 3.0.0-alpha.5

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 (52) hide show
  1. package/README.md +7 -4
  2. package/core-kit/abi/easy-swapper-v2.d.ts +322 -0
  3. package/core-kit/const/default-data.d.ts +2 -0
  4. package/core-kit/const/network.d.ts +156 -1706
  5. package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +644 -0
  6. package/core-kit/hooks/pool/multicall/use-pools.dynamic.d.ts +4 -1
  7. package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +322 -0
  8. package/core-kit/hooks/trading/withdraw-v2/index.d.ts +1 -0
  9. package/core-kit/hooks/trading/withdraw-v2/init-step/index.d.ts +3 -0
  10. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-estimated-receive-assets.d.ts +210 -0
  11. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction-arguments.d.ts +5 -0
  12. package/core-kit/hooks/trading/withdraw-v2/init-step/use-is-unroll-and-claim-transaction.d.ts +1 -0
  13. package/core-kit/hooks/trading/withdraw-v2/use-withdraw-assets-info.d.ts +219 -0
  14. package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +832 -0
  15. package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +322 -0
  16. package/core-kit/types/trading-panel.types.d.ts +1 -1
  17. package/index-33c9ef9c.cjs +217 -0
  18. package/index-3d8f663e.js +40423 -0
  19. package/index.cjs +1 -1
  20. package/index.js +1 -1
  21. package/package.json +1 -1
  22. package/pyth-adapter-78dd047a.js +5705 -0
  23. package/pyth-adapter-83411db2.cjs +11 -0
  24. package/style.css +1 -1
  25. package/trading-widget/components/common/balance/withdraw-assets-composition-table.d.ts +7 -0
  26. package/trading-widget/components/common/meta/assets-composition-disclosure/assets-composition-disclosure.d.ts +3 -0
  27. package/trading-widget/components/common/spinner/spinner.d.ts +0 -2
  28. package/trading-widget/components/widget/widget-input/token-selector/token-selector.hooks.d.ts +2 -0
  29. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/swap-summary.d.ts +0 -1
  30. package/trading-widget/components/withdraw/complete-step/balance/complete-withdraw-balance.hooks.d.ts +1 -1
  31. package/trading-widget/components/withdraw/init-step/input-group/init-withdraw-input-group.hooks.d.ts +0 -1
  32. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/all-assets-composition-table/all-assets-composition-table.d.ts +2 -0
  33. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/all-assets-composition-table/all-assets-composition-table.hooks.d.ts +14 -0
  34. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/single-asset-composition-table/single-asset-composition-table.d.ts +3 -0
  35. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/single-asset-composition-table/single-asset-composition-table.hooks.d.ts +10 -0
  36. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.d.ts +4 -1
  37. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.hooks.d.ts +11 -8
  38. package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +1 -0
  39. package/trading-widget/components/withdraw/stepper/withdraw-stepper.d.ts +2 -0
  40. package/trading-widget/components/withdraw/stepper/withdraw-stepper.hooks.d.ts +8 -0
  41. package/trading-widget/components/withdraw/tab-panel/tab-panel.hooks.d.ts +0 -2
  42. package/trading-widget/providers/component-provider/component-provider.hooks.d.ts +0 -1
  43. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +6 -3
  44. package/trading-widget/utils/synthetix-v3.d.ts +8 -9
  45. package/index-57a6eab2.js +0 -39514
  46. package/index-a45591cd.cjs +0 -207
  47. package/pyth-adapter-25487a87.js +0 -4119
  48. package/pyth-adapter-ef6a3a0d.cjs +0 -11
  49. package/trading-widget/components/widget/widget-meta/stepper.d.ts +0 -9
  50. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/asset-composition-table/asset-composition-table.d.ts +0 -2
  51. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/asset-composition-table/asset-composition-table.hooks.d.ts +0 -12
  52. /package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/{asset-composition-table → all-assets-composition-table}/withdraw-explanation-tip.d.ts +0 -0
@@ -1,7 +1,5 @@
1
1
  import type { FC } from 'react';
2
- import type { ThemeType } from 'trading-widget/types';
3
2
  interface SpinnerProps {
4
- type?: ThemeType;
5
3
  className?: string;
6
4
  }
7
5
  export declare const Spinner: FC<SpinnerProps>;
@@ -4,4 +4,6 @@ export interface TokenSelectorProps {
4
4
  export declare const useTokenSelector: ({ symbol }: TokenSelectorProps) => {
5
5
  isAllSymbol: boolean;
6
6
  onClick: () => void;
7
+ disabled: boolean;
8
+ hideTokenIcon: boolean;
7
9
  };
@@ -1,7 +1,6 @@
1
1
  import type { FC } from 'react';
2
2
  import type { TradingPanelStateModal } from 'core-kit/types';
3
3
  interface SwapSummaryProps {
4
- sendTokens: TradingPanelStateModal['sendTokens'];
5
4
  receiveTokens: TradingPanelStateModal['receiveTokens'];
6
5
  }
7
6
  export declare const SwapSummary: FC<SwapSummaryProps>;
@@ -8,5 +8,5 @@ export declare const useCompleteWithdrawBalance: () => {
8
8
  price: number;
9
9
  }[];
10
10
  usdAmount: string;
11
- showClaimButton: boolean;
11
+ withdrawalVaultLink: string | undefined;
12
12
  };
@@ -9,7 +9,6 @@ export declare const useInitWithdrawInputGroup: () => {
9
9
  value: string;
10
10
  decimals: number;
11
11
  };
12
- receiveToken: import("../../../../..").DynamicTradingToken;
13
12
  onInputChange: (value: string) => void;
14
13
  isMultiAssetWithdraw: boolean;
15
14
  };
@@ -0,0 +1,2 @@
1
+ import type { AllAssetsCompositionTableProps } from 'trading-widget/components/withdraw/init-step/input-group/withdraw-section/all-assets-composition-table/all-assets-composition-table.hooks';
2
+ export declare const AllAssetsCompositionTable: ({ className, showFraction, iconSize, showAllAsset, }: AllAssetsCompositionTableProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { TokenIconSize } from 'trading-widget/types';
2
+ export interface AllAssetsCompositionTableProps {
3
+ className?: string;
4
+ showFraction?: boolean;
5
+ iconSize?: TokenIconSize;
6
+ showAllAsset?: boolean;
7
+ }
8
+ export declare const useAllAssetsCompositionTable: (showAllAsset: AllAssetsCompositionTableProps['showAllAsset']) => {
9
+ visibleAssets: import("../../../../../../..").PoolCompositionWithFraction[];
10
+ hiddenAssets: import("../../../../../../..").PoolCompositionWithFraction[];
11
+ chainId: number;
12
+ showUnitWithdrawalTip: boolean;
13
+ address: `0x${string}`;
14
+ };
@@ -0,0 +1,3 @@
1
+ import type { FC } from 'react';
2
+ import type { SingleAssetCompositionTableProps } from 'trading-widget/components/withdraw/init-step/input-group/withdraw-section/single-asset-composition-table/single-asset-composition-table.hooks';
3
+ export declare const SingleAssetCompositionTable: FC<SingleAssetCompositionTableProps>;
@@ -0,0 +1,10 @@
1
+ import type { useInitWithdrawEstimatedReceiveAssets } from 'core-kit/hooks/trading/withdraw-v2/init-step';
2
+ export interface SingleAssetCompositionTableProps {
3
+ assets: ReturnType<typeof useInitWithdrawEstimatedReceiveAssets>['data'];
4
+ isLoading: boolean;
5
+ }
6
+ export declare const useSingleAssetCompositionTable: ({ assets, }: Pick<SingleAssetCompositionTableProps, 'assets'>) => {
7
+ showReceivedResults: boolean;
8
+ showSingleTokenAmount: boolean;
9
+ singleTokenBalance: number | undefined;
10
+ };
@@ -1,3 +1,6 @@
1
1
  import type { FC } from 'react';
2
- import type { WithdrawSectionProps } from 'trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.hooks';
2
+ interface WithdrawSectionProps {
3
+ isMultiAssetWithdraw: boolean;
4
+ }
3
5
  export declare const WithdrawSection: FC<WithdrawSectionProps>;
6
+ export {};
@@ -1,10 +1,13 @@
1
- export interface WithdrawSectionProps {
2
- isMultiAssetWithdraw: boolean;
1
+ export declare const useWithdrawSection: () => {
2
+ assets: {
3
+ address: `0x${string}`;
4
+ symbol: string;
5
+ decimals: number;
6
+ rawBalance: bigint;
7
+ balance: number;
8
+ price: number;
9
+ }[];
10
+ isLoading: boolean;
11
+ usdAmount: string;
3
12
  assetSymbol: string;
4
- }
5
- export declare const useWithdrawSection: ({ isMultiAssetWithdraw, assetSymbol, }: WithdrawSectionProps) => {
6
- isMultiAssetWithdraw: boolean;
7
- label: string;
8
- assetSymbol: string;
9
- vaultSymbol: string;
10
13
  };
@@ -7,4 +7,5 @@ export declare const useInitWithdrawTransactionDisclosure: () => {
7
7
  sendTokenSymbol: string;
8
8
  exitFee: string;
9
9
  minReceivedText: string;
10
+ showMinReceivedText: boolean;
10
11
  };
@@ -0,0 +1,2 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ export declare const WithdrawStepper: FC<PropsWithChildren>;
@@ -0,0 +1,8 @@
1
+ export declare const useWithdrawStepper: () => {
2
+ hideStepper: boolean;
3
+ activeStepIndex: number;
4
+ steps: {
5
+ index: number;
6
+ description: string | import("react/jsx-runtime").JSX.Element;
7
+ }[];
8
+ };
@@ -1,5 +1,3 @@
1
1
  export declare const useWithdrawTabPanel: () => {
2
2
  isCompleteWithdrawStep: boolean;
3
- isMultiAssetWithdraw: boolean;
4
- isStep1Active: boolean;
5
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const useComponentContext: () => Partial<{
3
2
  GeoBlockAlert?: import("react").ComponentType | undefined;
4
3
  SanctionedAlert?: import("react").ComponentType | undefined;
@@ -80,16 +80,19 @@ export type TranslationMap = {
80
80
  depositAction: string;
81
81
  withdrawAction: string;
82
82
  unrollAction: string;
83
+ unrollAndClaimAction: string;
83
84
  swapAction: string;
84
85
  claimAction: string;
85
86
  claimLabel: string;
86
- swapOf: string;
87
- to: string;
88
- withdrawDescriptionTitle: string;
87
+ swapAndClaimTo: string;
89
88
  initWithdrawDescription: string;
90
89
  initWithdrawTooltip: string;
91
90
  completeWithdrawDescription: string;
92
91
  completeWithdrawTooltip: string;
92
+ unrollAndClaimDescription: string;
93
+ total: string;
94
+ showAll: string;
95
+ hide: string;
93
96
  [key: string]: string;
94
97
  };
95
98
  export interface TranslationProviderProps {
@@ -1,11 +1,10 @@
1
- import { UTCDate } from '@date-fns/utc';
2
1
  import type { SynthetixV3PeriodType } from 'trading-widget/types/synthetix-v3.types';
3
2
  export declare const getDateRangeByPeriod: (period: SynthetixV3PeriodType) => {
4
- from: UTCDate;
5
- to: UTCDate;
3
+ from: Date;
4
+ to: Date;
6
5
  intraWeekRanges: {
7
- from: UTCDate;
8
- to: UTCDate;
6
+ from: Date;
7
+ to: Date;
9
8
  }[];
10
9
  duration: {
11
10
  percentage: number;
@@ -16,11 +15,11 @@ export declare const getDateRangeByPeriod: (period: SynthetixV3PeriodType) => {
16
15
  };
17
16
  };
18
17
  export declare const getRangeData: () => {
19
- from: UTCDate;
20
- to: UTCDate;
18
+ from: Date;
19
+ to: Date;
21
20
  intraWeekRanges: {
22
- from: UTCDate;
23
- to: UTCDate;
21
+ from: Date;
22
+ to: Date;
24
23
  }[];
25
24
  duration: {
26
25
  percentage: number;