@dhedge/trading-widget 3.0.4 → 3.1.1
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 +30 -1
- package/core-kit/abi/easy-swapper-v2.d.ts +114 -0
- package/core-kit/const/contracts/base.d.ts +1 -0
- package/core-kit/const/default-data.d.ts +2 -0
- package/core-kit/const/error.d.ts +6 -0
- package/core-kit/const/logger.d.ts +6 -5
- package/core-kit/hooks/pool/index.d.ts +1 -1
- package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +228 -0
- package/core-kit/hooks/pool/{use-fmed-vested-points.d.ts → use-vault-vested-points.d.ts} +3 -1
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +114 -0
- package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +114 -0
- package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +114 -0
- package/core-kit/utils/flat-money.d.ts +1 -1
- package/core-kit/utils/index.d.ts +1 -0
- package/core-kit/utils/logger.d.ts +17 -0
- package/{index-9cb35e91.js → index-348a3d46.js} +12699 -12264
- package/index-71d484d4.cjs +217 -0
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +145 -143
- package/package.json +1 -1
- package/{pyth-adapter-c77fed23.js → pyth-adapter-14673ba7.js} +1 -1
- package/{pyth-adapter-0e675a02.cjs → pyth-adapter-a1821dab.cjs} +1 -1
- package/style.css +1 -1
- package/trading-widget/components/common/button/icon-button/icon-button.d.ts +1 -0
- package/trading-widget/components/common/button/reload-button/reload-button.d.ts +3 -0
- package/trading-widget/components/common/button/reload-button/reload-button.hooks.d.ts +10 -0
- package/trading-widget/components/common/layout/index.d.ts +2 -0
- package/trading-widget/components/common/layout/notification/notification.d.ts +6 -0
- package/trading-widget/components/widget/widget-buttons/index.d.ts +1 -0
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-deposit-swap-quote-button/reload-deposit-swap-quote-button.d.ts +2 -0
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-deposit-swap-quote-button/reload-deposit-swap-quote-button.hooks.d.ts +8 -0
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-swap-quote-button.d.ts +2 -0
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-withdraw-swap-quote-button/reload-withdraw-swap-quote-button.d.ts +2 -0
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-withdraw-swap-quote-button/reload-withdraw-swap-quote-button.hooks.d.ts +8 -0
- package/trading-widget/components/widget/widget-overlay/{fmed-withdrawal-overlay/fmed-withdrawal-overlay.d.ts → fmp-withdrawal-overlay/fmp-withdrawal-overlay.d.ts} +1 -1
- package/trading-widget/components/widget/widget-overlay/fmp-withdrawal-overlay/fmp-withdrawal-overlay.hooks.d.ts +10 -0
- package/trading-widget/components/widget/widget-overlay/index.d.ts +2 -1
- package/trading-widget/components/widget/widget-overlay/notification-overlay/notification-overlay.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/notification-overlay/notification-overlay.hooks.d.ts +8 -0
- package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +1 -1
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -0
- package/trading-widget/providers/overlay-provider/overlay-provider.hooks.d.ts +3 -0
- package/trading-widget/providers/overlay-provider/overlay-provider.types.d.ts +4 -1
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +2 -0
- package/trading-widget/types/overlay.types.d.ts +2 -1
- package/index-389bb96e.cjs +0 -217
|
@@ -1,4 +1,118 @@
|
|
|
1
1
|
export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadContractReturnType<readonly [{
|
|
2
|
+
readonly inputs: readonly [];
|
|
3
|
+
readonly name: "FailedInnerCall";
|
|
4
|
+
readonly type: "error";
|
|
5
|
+
}, {
|
|
6
|
+
readonly inputs: readonly [{
|
|
7
|
+
readonly internalType: "bytes";
|
|
8
|
+
readonly name: "returnData";
|
|
9
|
+
readonly type: "bytes";
|
|
10
|
+
}];
|
|
11
|
+
readonly name: "FailedToApproveParaswap";
|
|
12
|
+
readonly type: "error";
|
|
13
|
+
}, {
|
|
14
|
+
readonly inputs: readonly [{
|
|
15
|
+
readonly internalType: "contract IERC20";
|
|
16
|
+
readonly name: "destToken";
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
}, {
|
|
19
|
+
readonly internalType: "uint256";
|
|
20
|
+
readonly name: "receivedAmount";
|
|
21
|
+
readonly type: "uint256";
|
|
22
|
+
}, {
|
|
23
|
+
readonly internalType: "uint256";
|
|
24
|
+
readonly name: "minAmount";
|
|
25
|
+
readonly type: "uint256";
|
|
26
|
+
}];
|
|
27
|
+
readonly name: "InsufficientAmountReceived";
|
|
28
|
+
readonly type: "error";
|
|
29
|
+
}, {
|
|
30
|
+
readonly inputs: readonly [{
|
|
31
|
+
readonly internalType: "bytes32";
|
|
32
|
+
readonly name: "routerKey";
|
|
33
|
+
readonly type: "bytes32";
|
|
34
|
+
}];
|
|
35
|
+
readonly name: "InvalidAggregator";
|
|
36
|
+
readonly type: "error";
|
|
37
|
+
}, {
|
|
38
|
+
readonly inputs: readonly [];
|
|
39
|
+
readonly name: "InvalidNativeTokenTransferEncoding";
|
|
40
|
+
readonly type: "error";
|
|
41
|
+
}, {
|
|
42
|
+
readonly inputs: readonly [];
|
|
43
|
+
readonly name: "NativeTokenSentWithoutNativeSwap";
|
|
44
|
+
readonly type: "error";
|
|
45
|
+
}, {
|
|
46
|
+
readonly inputs: readonly [{
|
|
47
|
+
readonly internalType: "uint256";
|
|
48
|
+
readonly name: "expectedAmount";
|
|
49
|
+
readonly type: "uint256";
|
|
50
|
+
}, {
|
|
51
|
+
readonly internalType: "uint256";
|
|
52
|
+
readonly name: "sentAmount";
|
|
53
|
+
readonly type: "uint256";
|
|
54
|
+
}];
|
|
55
|
+
readonly name: "NotEnoughNativeTokenSent";
|
|
56
|
+
readonly type: "error";
|
|
57
|
+
}, {
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly internalType: "address";
|
|
60
|
+
readonly name: "token";
|
|
61
|
+
readonly type: "address";
|
|
62
|
+
}];
|
|
63
|
+
readonly name: "SafeERC20FailedOperation";
|
|
64
|
+
readonly type: "error";
|
|
65
|
+
}, {
|
|
66
|
+
readonly inputs: readonly [{
|
|
67
|
+
readonly internalType: "address";
|
|
68
|
+
readonly name: "router";
|
|
69
|
+
readonly type: "address";
|
|
70
|
+
}, {
|
|
71
|
+
readonly components: readonly [{
|
|
72
|
+
readonly internalType: "contract IERC20";
|
|
73
|
+
readonly name: "token";
|
|
74
|
+
readonly type: "address";
|
|
75
|
+
}, {
|
|
76
|
+
readonly internalType: "uint256";
|
|
77
|
+
readonly name: "amount";
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
}, {
|
|
80
|
+
readonly components: readonly [{
|
|
81
|
+
readonly internalType: "bytes32";
|
|
82
|
+
readonly name: "routerKey";
|
|
83
|
+
readonly type: "bytes32";
|
|
84
|
+
}, {
|
|
85
|
+
readonly internalType: "bytes";
|
|
86
|
+
readonly name: "swapData";
|
|
87
|
+
readonly type: "bytes";
|
|
88
|
+
}];
|
|
89
|
+
readonly internalType: "struct AggregatorData";
|
|
90
|
+
readonly name: "aggregatorData";
|
|
91
|
+
readonly type: "tuple";
|
|
92
|
+
}];
|
|
93
|
+
readonly internalType: "struct SrcTokenSwapDetails";
|
|
94
|
+
readonly name: "srcTokenSwapDetails";
|
|
95
|
+
readonly type: "tuple";
|
|
96
|
+
}, {
|
|
97
|
+
readonly internalType: "bytes";
|
|
98
|
+
readonly name: "returnData";
|
|
99
|
+
readonly type: "bytes";
|
|
100
|
+
}];
|
|
101
|
+
readonly name: "SwapFailed";
|
|
102
|
+
readonly type: "error";
|
|
103
|
+
}, {
|
|
104
|
+
readonly inputs: readonly [{
|
|
105
|
+
readonly internalType: "enum Permit2TransferType";
|
|
106
|
+
readonly name: "transferType";
|
|
107
|
+
readonly type: "uint8";
|
|
108
|
+
}];
|
|
109
|
+
readonly name: "UnsupportedPermit2Method";
|
|
110
|
+
readonly type: "error";
|
|
111
|
+
}, {
|
|
112
|
+
readonly inputs: readonly [];
|
|
113
|
+
readonly name: "UnsupportedTokenTransferMethod";
|
|
114
|
+
readonly type: "error";
|
|
115
|
+
}, {
|
|
2
116
|
readonly anonymous: false;
|
|
3
117
|
readonly inputs: readonly [{
|
|
4
118
|
readonly indexed: true;
|
|
@@ -64,6 +64,120 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
|
|
|
64
64
|
}, {
|
|
65
65
|
readonly address: `0x${string}`;
|
|
66
66
|
readonly abi: readonly [{
|
|
67
|
+
readonly inputs: readonly [];
|
|
68
|
+
readonly name: "FailedInnerCall";
|
|
69
|
+
readonly type: "error";
|
|
70
|
+
}, {
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly internalType: "bytes";
|
|
73
|
+
readonly name: "returnData";
|
|
74
|
+
readonly type: "bytes";
|
|
75
|
+
}];
|
|
76
|
+
readonly name: "FailedToApproveParaswap";
|
|
77
|
+
readonly type: "error";
|
|
78
|
+
}, {
|
|
79
|
+
readonly inputs: readonly [{
|
|
80
|
+
readonly internalType: "contract IERC20";
|
|
81
|
+
readonly name: "destToken";
|
|
82
|
+
readonly type: "address";
|
|
83
|
+
}, {
|
|
84
|
+
readonly internalType: "uint256";
|
|
85
|
+
readonly name: "receivedAmount";
|
|
86
|
+
readonly type: "uint256";
|
|
87
|
+
}, {
|
|
88
|
+
readonly internalType: "uint256";
|
|
89
|
+
readonly name: "minAmount";
|
|
90
|
+
readonly type: "uint256";
|
|
91
|
+
}];
|
|
92
|
+
readonly name: "InsufficientAmountReceived";
|
|
93
|
+
readonly type: "error";
|
|
94
|
+
}, {
|
|
95
|
+
readonly inputs: readonly [{
|
|
96
|
+
readonly internalType: "bytes32";
|
|
97
|
+
readonly name: "routerKey";
|
|
98
|
+
readonly type: "bytes32";
|
|
99
|
+
}];
|
|
100
|
+
readonly name: "InvalidAggregator";
|
|
101
|
+
readonly type: "error";
|
|
102
|
+
}, {
|
|
103
|
+
readonly inputs: readonly [];
|
|
104
|
+
readonly name: "InvalidNativeTokenTransferEncoding";
|
|
105
|
+
readonly type: "error";
|
|
106
|
+
}, {
|
|
107
|
+
readonly inputs: readonly [];
|
|
108
|
+
readonly name: "NativeTokenSentWithoutNativeSwap";
|
|
109
|
+
readonly type: "error";
|
|
110
|
+
}, {
|
|
111
|
+
readonly inputs: readonly [{
|
|
112
|
+
readonly internalType: "uint256";
|
|
113
|
+
readonly name: "expectedAmount";
|
|
114
|
+
readonly type: "uint256";
|
|
115
|
+
}, {
|
|
116
|
+
readonly internalType: "uint256";
|
|
117
|
+
readonly name: "sentAmount";
|
|
118
|
+
readonly type: "uint256";
|
|
119
|
+
}];
|
|
120
|
+
readonly name: "NotEnoughNativeTokenSent";
|
|
121
|
+
readonly type: "error";
|
|
122
|
+
}, {
|
|
123
|
+
readonly inputs: readonly [{
|
|
124
|
+
readonly internalType: "address";
|
|
125
|
+
readonly name: "token";
|
|
126
|
+
readonly type: "address";
|
|
127
|
+
}];
|
|
128
|
+
readonly name: "SafeERC20FailedOperation";
|
|
129
|
+
readonly type: "error";
|
|
130
|
+
}, {
|
|
131
|
+
readonly inputs: readonly [{
|
|
132
|
+
readonly internalType: "address";
|
|
133
|
+
readonly name: "router";
|
|
134
|
+
readonly type: "address";
|
|
135
|
+
}, {
|
|
136
|
+
readonly components: readonly [{
|
|
137
|
+
readonly internalType: "contract IERC20";
|
|
138
|
+
readonly name: "token";
|
|
139
|
+
readonly type: "address";
|
|
140
|
+
}, {
|
|
141
|
+
readonly internalType: "uint256";
|
|
142
|
+
readonly name: "amount";
|
|
143
|
+
readonly type: "uint256";
|
|
144
|
+
}, {
|
|
145
|
+
readonly components: readonly [{
|
|
146
|
+
readonly internalType: "bytes32";
|
|
147
|
+
readonly name: "routerKey";
|
|
148
|
+
readonly type: "bytes32";
|
|
149
|
+
}, {
|
|
150
|
+
readonly internalType: "bytes";
|
|
151
|
+
readonly name: "swapData";
|
|
152
|
+
readonly type: "bytes";
|
|
153
|
+
}];
|
|
154
|
+
readonly internalType: "struct AggregatorData";
|
|
155
|
+
readonly name: "aggregatorData";
|
|
156
|
+
readonly type: "tuple";
|
|
157
|
+
}];
|
|
158
|
+
readonly internalType: "struct SrcTokenSwapDetails";
|
|
159
|
+
readonly name: "srcTokenSwapDetails";
|
|
160
|
+
readonly type: "tuple";
|
|
161
|
+
}, {
|
|
162
|
+
readonly internalType: "bytes";
|
|
163
|
+
readonly name: "returnData";
|
|
164
|
+
readonly type: "bytes";
|
|
165
|
+
}];
|
|
166
|
+
readonly name: "SwapFailed";
|
|
167
|
+
readonly type: "error";
|
|
168
|
+
}, {
|
|
169
|
+
readonly inputs: readonly [{
|
|
170
|
+
readonly internalType: "enum Permit2TransferType";
|
|
171
|
+
readonly name: "transferType";
|
|
172
|
+
readonly type: "uint8";
|
|
173
|
+
}];
|
|
174
|
+
readonly name: "UnsupportedPermit2Method";
|
|
175
|
+
readonly type: "error";
|
|
176
|
+
}, {
|
|
177
|
+
readonly inputs: readonly [];
|
|
178
|
+
readonly name: "UnsupportedTokenTransferMethod";
|
|
179
|
+
readonly type: "error";
|
|
180
|
+
}, {
|
|
67
181
|
readonly anonymous: false;
|
|
68
182
|
readonly inputs: readonly [{
|
|
69
183
|
readonly indexed: true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const isFmpAirdropVaultAddress: (address: Address) => boolean;
|
|
3
3
|
export declare const isFlatMoneyLeveragedRethAsset: (address: Address) => boolean;
|
|
4
4
|
export declare const getFlatMonetUnitSymbol: (chainId: number) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TradingPanelActionsState, TransactionAction } from 'core-kit/types';
|
|
2
|
+
import type { Address } from 'core-kit/types/web3.types';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms an Ethereum address to ensure it's treated as a string in Firebase Analytics.
|
|
5
|
+
* Adds a prefix to avoid scientific notation or numeric interpretation.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} ethereumAddress - The Ethereum address to transform.
|
|
8
|
+
* @returns {string} - The transformed Ethereum address.
|
|
9
|
+
*/
|
|
10
|
+
export declare const transformAddressForAnalytics: (ethereumAddress: Address) => string;
|
|
11
|
+
export declare const logTransactionByActionType: ({ action, log, symbol, vaultAddress, chainId, }: {
|
|
12
|
+
action: TransactionAction;
|
|
13
|
+
symbol: string;
|
|
14
|
+
log: TradingPanelActionsState['onLog'];
|
|
15
|
+
chainId: number;
|
|
16
|
+
vaultAddress: Address;
|
|
17
|
+
}) => void;
|