@dhedge/trading-widget 3.4.0-canary.8 → 3.4.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 (52) hide show
  1. package/README.md +15 -15
  2. package/core-kit/abi/index.d.ts +0 -1
  3. package/core-kit/const/config.d.ts +1 -1
  4. package/core-kit/const/contracts/base.d.ts +0 -1
  5. package/core-kit/const/default-data.d.ts +1 -1
  6. package/core-kit/const/error.d.ts +1 -5
  7. package/core-kit/const/tokens/base.d.ts +0 -1
  8. package/core-kit/types/index.d.ts +0 -1
  9. package/core-kit/types/trading.types.d.ts +4 -1
  10. package/core-kit/utils/error.d.ts +0 -7
  11. package/core-kit/utils/number.d.ts +1 -1
  12. package/core-kit/utils/token.d.ts +5 -1
  13. package/core-kit/utils/transaction.d.ts +3 -3
  14. package/index-6b0d77d6.js +41041 -0
  15. package/index-d9748020.cjs +217 -0
  16. package/index.cjs +1 -1
  17. package/index.d.ts +1 -2
  18. package/index.js +222 -225
  19. package/package.json +1 -1
  20. package/{pyth-adapter-e0c9d117.cjs → pyth-adapter-310b1266.cjs} +1 -1
  21. package/{pyth-adapter-16890d39.js → pyth-adapter-cf357270.js} +1 -1
  22. package/style.css +1 -1
  23. package/core-kit/abi/limit-order.d.ts +0 -736
  24. package/core-kit/types/react-query.types.d.ts +0 -11
  25. package/index-8fe1068f.cjs +0 -217
  26. package/index-fab8a095.js +0 -42741
  27. package/limit-orders/component/common/action-button.d.ts +0 -10
  28. package/limit-orders/component/common/modal-content.d.ts +0 -8
  29. package/limit-orders/component/common/modal-dialog.d.ts +0 -9
  30. package/limit-orders/component/common/price-input.d.ts +0 -20
  31. package/limit-orders/component/input-group/input-group.d.ts +0 -2
  32. package/limit-orders/component/input-group/input-group.hooks.d.ts +0 -15
  33. package/limit-orders/component/limit-order-button/limit-order-button.d.ts +0 -2
  34. package/limit-orders/component/limit-order-button/limit-order-button.hooks.d.ts +0 -9
  35. package/limit-orders/component/limit-order-button/network-check-button.d.ts +0 -2
  36. package/limit-orders/component/limit-order-button/network-check-button.hooks.d.ts +0 -4
  37. package/limit-orders/component/limit-order-modal.d.ts +0 -11
  38. package/limit-orders/component/limit-order-modal.hooks.d.ts +0 -6
  39. package/limit-orders/constants.d.ts +0 -1
  40. package/limit-orders/hooks/state.d.ts +0 -2
  41. package/limit-orders/hooks/use-invalidate-limit-order-query.d.ts +0 -1
  42. package/limit-orders/hooks/use-listen-limit-order-execution.d.ts +0 -1
  43. package/limit-orders/hooks/use-on-limit-order-settled.d.ts +0 -2
  44. package/limit-orders/hooks/use-user-limit-order.d.ts +0 -753
  45. package/limit-orders/index.d.ts +0 -2
  46. package/limit-orders/providers/state-provider/reducer.d.ts +0 -7
  47. package/limit-orders/providers/state-provider/state-provider.d.ts +0 -6
  48. package/limit-orders/providers/state-provider/state-provider.types.d.ts +0 -51
  49. package/limit-orders/providers/theme-provider/index.d.ts +0 -2
  50. package/limit-orders/providers/theme-provider/theme-provider.d.ts +0 -3
  51. package/limit-orders/providers/theme-provider/theme-provider.types.d.ts +0 -132
  52. package/limit-orders/utils.d.ts +0 -23
@@ -1,2 +0,0 @@
1
- export { LimitOrderModal } from './component/limit-order-modal';
2
- export { useUserLimitOrder } from './hooks/use-user-limit-order';
@@ -1,7 +0,0 @@
1
- import type { LimitOrderAction, LimitOrderState } from 'limit-orders/providers/state-provider/state-provider.types';
2
- export declare const DEFAULT_FORM_DATA: {
3
- takeProfitPrice: string;
4
- stopLossPrice: string;
5
- termsAccepted: boolean;
6
- };
7
- export declare const reducer: (state: LimitOrderState, action: LimitOrderAction) => LimitOrderState;
@@ -1,6 +0,0 @@
1
- import type { FC, PropsWithChildren } from 'react';
2
- import type { LimitOrderActionsState, LimitOrderContextConfig, LimitOrderState } from './state-provider.types';
3
- export declare const getDefaultLimitOrderState: (config: LimitOrderContextConfig['initialState']) => LimitOrderState;
4
- export declare const LimitOrderStateContext: import("react").Context<LimitOrderState>;
5
- export declare const LimitOrderActionsContext: import("react").Context<LimitOrderActionsState>;
6
- export declare const LimitOrderStateProvider: FC<PropsWithChildren<LimitOrderContextConfig>>;
@@ -1,51 +0,0 @@
1
- import type { Address, Hash } from 'viem';
2
- export interface LimitOrderState {
3
- isModalOpen: boolean;
4
- vaultAddress: Address;
5
- vaultChainId: number;
6
- isReversedOrder?: boolean;
7
- form: {
8
- takeProfitPrice: string;
9
- stopLossPrice: string;
10
- termsAccepted: boolean;
11
- };
12
- pricingAsset: {
13
- address: Address;
14
- symbol: string;
15
- };
16
- pendingTransaction: Hash | null;
17
- }
18
- export type LimitOrderCallbacks = {
19
- onTransactionSuccess?: (transaction: Address) => void;
20
- onTransactionError?: (transaction: Address) => void;
21
- };
22
- export type LimitOrderActionsState = LimitOrderCallbacks & {
23
- setIsModalOpen: (payload: boolean) => void;
24
- setTakeProfitPrice: (payload: string) => void;
25
- setStopLossPrice: (payload: string) => void;
26
- setTermsAccepted: (payload: boolean) => void;
27
- setPendingTransaction: (payload: Hash | null) => void;
28
- reset: () => void;
29
- };
30
- export type LimitOrderAction = {
31
- type: 'SET_TAKE_PROFIT_PRICE';
32
- payload: string;
33
- } | {
34
- type: 'SET_STOP_LOSS_PRICE';
35
- payload: string;
36
- } | {
37
- type: 'SET_IS_MODAL_OPEN';
38
- payload: boolean;
39
- } | {
40
- type: 'SET_TERMS_ACCEPTED';
41
- payload: boolean;
42
- } | {
43
- type: 'RESET';
44
- } | {
45
- type: 'SET_PENDING_TRANSACTION';
46
- payload: Hash | null;
47
- };
48
- export interface LimitOrderContextConfig {
49
- initialState: Pick<LimitOrderState, 'vaultAddress' | 'vaultChainId' | 'pricingAsset' | 'isReversedOrder'>;
50
- actions?: LimitOrderCallbacks;
51
- }
@@ -1,2 +0,0 @@
1
- export { ThemeProvider } from './theme-provider';
2
- export * from './theme-provider.types';
@@ -1,3 +0,0 @@
1
- import type { FC, PropsWithChildren } from 'react';
2
- import type { ThemeProviderProps } from './theme-provider.types';
3
- export declare const ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>>;
@@ -1,132 +0,0 @@
1
- export interface ThemeProviderConfigProps {
2
- global?: {
3
- color?: {
4
- colorTextPrimary?: string;
5
- colorTextPrimaryHover?: string;
6
- colorBorderPrimary?: string;
7
- colorBgPrimary?: string;
8
- colorTextSecondary?: string;
9
- colorBgSecondary?: string;
10
- colorTextAccent?: string;
11
- colorTextAccentHover?: string;
12
- colorBgAccentFrom?: string;
13
- colorBgAccentTo?: string;
14
- colorBgAccentFromHover?: string;
15
- colorBgAccentToHover?: string;
16
- colorTextNeutral?: string;
17
- colorBgNeutral?: string;
18
- colorTextLoading?: string;
19
- colorTextError?: string;
20
- colorTextWarning?: string;
21
- colorIcon?: string;
22
- };
23
- size?: {
24
- gap?: string;
25
- spacer?: string;
26
- fontSizeBase?: string;
27
- lineHeightBase?: string;
28
- fontSizeXs?: string;
29
- lineHeightXs?: string;
30
- fontSizeSm?: string;
31
- lineHeightSm?: string;
32
- fontSizeLg?: string;
33
- lineHeightLg?: string;
34
- iconSize?: string;
35
- iconSizeSm?: string;
36
- iconSecondarySize?: string;
37
- iconSecondarySizeSm?: string;
38
- labelFontSize?: string;
39
- labelLineHeight?: string;
40
- };
41
- style?: {
42
- radiusPrimary?: string;
43
- radiusSecondary?: string;
44
- fontWeightLight?: string;
45
- fontWeightMedium?: string;
46
- fontWeightBold?: string;
47
- actionOpacity?: string;
48
- actionOpacityHover?: string;
49
- };
50
- };
51
- component?: {
52
- inputGroup?: {
53
- color?: object;
54
- size?: {
55
- px?: string;
56
- gap?: string;
57
- };
58
- style?: object;
59
- };
60
- input?: {
61
- color?: {
62
- textColor?: string;
63
- loadingTextColor?: string;
64
- bgColor?: string;
65
- bgColorFocus?: string;
66
- borderColor?: string;
67
- borderColorFocus?: string;
68
- placeholderColor?: string;
69
- buttonBgColor?: string;
70
- buttonBorderColor?: string;
71
- buttonTextColor?: string;
72
- };
73
- size?: {
74
- px?: string;
75
- py?: string;
76
- gap?: string;
77
- priceGap?: string;
78
- iconSize?: string;
79
- iconSizeSm?: string;
80
- labelFontSize?: string;
81
- labelLineHeight?: string;
82
- fontSize?: string;
83
- lineHeight?: string;
84
- fontSizeLg?: string;
85
- lineHeightLg?: string;
86
- tokenFontSize?: string;
87
- tokenLineHeight?: string;
88
- tokenFontSizeSm?: string;
89
- tokenLineHeightSm?: string;
90
- buttonPx?: string;
91
- buttonPy?: string;
92
- buttonFontSize?: string;
93
- buttonLineHeight?: string;
94
- };
95
- style?: {
96
- radius?: string;
97
- labelFontWeight?: string;
98
- fontWeight?: string;
99
- tokenFontWeight?: string;
100
- buttonRadius?: string;
101
- };
102
- };
103
- actionButton?: {
104
- color?: {
105
- colorBgFrom?: string;
106
- colorBgTo?: string;
107
- colorBgFromHover?: string;
108
- colorBgToHover?: string;
109
- colorBorder?: string;
110
- colorText?: string;
111
- outlineColorBorder?: string;
112
- outlineColorBorderHover?: string;
113
- outlineColorText?: string;
114
- };
115
- size?: {
116
- borderWidth?: string;
117
- };
118
- style?: object;
119
- };
120
- tooltip?: {
121
- color?: {
122
- colorBg?: string;
123
- colorText?: string;
124
- };
125
- size?: object;
126
- style?: object;
127
- };
128
- };
129
- }
130
- export interface ThemeProviderProps {
131
- config?: ThemeProviderConfigProps;
132
- }
@@ -1,23 +0,0 @@
1
- import type { Address } from 'core-kit/types';
2
- export declare const getLimitOrderId: ({ userAddress, vaultAddress, }: {
3
- userAddress: Address;
4
- vaultAddress: Address;
5
- }) => `0x${string}`;
6
- export declare const calculateProfitPriceDifference: ({ price, markPrice, }: {
7
- price: string;
8
- markPrice: string;
9
- }) => string;
10
- export declare const calculateLossPriceDifference: ({ price, markPrice, }: {
11
- price: string;
12
- markPrice: string;
13
- }) => string;
14
- export declare const adjustLimitOrderError: ({ error, isReversedOrder, }: {
15
- error: {
16
- title: string;
17
- hint?: string;
18
- } | null;
19
- isReversedOrder: boolean | undefined;
20
- }) => {
21
- title: string;
22
- hint?: string | undefined;
23
- } | null;