@dhedge/trading-widget 2.0.8 → 3.0.0-alpha
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 +12 -1
- package/core-kit/abi/easy-swapper-v2.d.ts +97 -0
- package/core-kit/abi/index.d.ts +0 -1
- package/core-kit/const/config.d.ts +1 -1
- package/core-kit/const/contracts/arbitrum.d.ts +0 -1
- package/core-kit/const/contracts/base.d.ts +0 -1
- package/core-kit/const/contracts/optimism.d.ts +0 -1
- package/core-kit/const/contracts/polygon.d.ts +0 -1
- package/core-kit/const/default-data.d.ts +3 -3
- package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +194 -63
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +97 -0
- package/core-kit/hooks/trading/index.d.ts +0 -2
- package/core-kit/hooks/trading/use-swaps-data-query.d.ts +7 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/index.d.ts +9 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-expected-amount.d.ts +4 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-quote.d.ts +1 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-receive-diff.d.ts +1 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-swap-data.d.ts +1 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-total-usd-value.d.ts +1 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-tracked-assets.d.ts +210 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-transaction.d.ts +6 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-handle-complete-withdraw.d.ts +11 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-is-complete-withdraw-step.d.ts +4 -0
- package/core-kit/hooks/trading/withdraw-v2/index.d.ts +3 -0
- package/core-kit/hooks/trading/withdraw-v2/init-step/index.d.ts +3 -0
- package/core-kit/hooks/trading/{withdraw/use-withdraw-allowance.d.ts → withdraw-v2/init-step/use-init-withdraw-allowance.d.ts} +1 -1
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction.d.ts +2 -0
- package/core-kit/hooks/trading/withdraw-v2/use-applied-withdraw-slippage.d.ts +1 -0
- package/core-kit/hooks/trading/withdraw-v2/use-min-withdraw-slippage.d.ts +1 -0
- package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +581 -0
- package/core-kit/models/index.d.ts +0 -1
- package/core-kit/types/config.types.d.ts +2 -2
- package/core-kit/types/state.types.d.ts +2 -2
- package/core-kit/types/trading-panel.types.d.ts +2 -7
- package/core-kit/types/trading.types.d.ts +0 -10
- package/core-kit/types/web3.types.d.ts +0 -7
- package/core-kit/utils/transaction.d.ts +8 -4
- package/{index-86a1e2d8.js → index-15f9e6d8.js} +15793 -15828
- package/index-598b19c0.cjs +207 -0
- package/index.cjs +1 -1
- package/index.d.ts +6 -6
- package/index.js +219 -228
- package/package.json +1 -1
- package/{pyth-adapter-3aef2c8d.js → pyth-adapter-393858f5.js} +1 -1
- package/{pyth-adapter-bd50cd24.cjs → pyth-adapter-3fa17063.cjs} +1 -1
- package/style.css +1 -1
- package/trading-widget/components/widget/widget-meta/stepper.d.ts +9 -0
- package/trading-widget/components/widget/widget-overlay/pool-select-overlay/pool-select-overlay.hooks.d.ts +1 -1
- package/trading-widget/components/widget/widget-overlay/token-select-overlay/token-select-item/token-select-item.d.ts +1 -1
- package/trading-widget/components/widget/widget-overlay/token-select-overlay/token-select-item/token-select-item.hooks.d.ts +2 -1
- package/trading-widget/components/widget/widget-overlay/token-select-overlay/token-select-overlay.hooks.d.ts +1 -1
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/approve-summary.d.ts +7 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/claim-summary.d.ts +7 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/oracles-update-summary.d.ts +2 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/swap-summary.d.ts +8 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/vault-transaction-summary.d.ts +9 -0
- package/trading-widget/components/withdraw/complete-step/balance/claim-button.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/balance/claim-button.hooks.d.ts +5 -0
- package/trading-widget/components/withdraw/complete-step/balance/complete-withdraw-balance.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/balance/complete-withdraw-balance.hooks.d.ts +11 -0
- package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +5 -0
- package/trading-widget/components/withdraw/complete-step/button/valid-swap-button/valid-swap-button.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/button/valid-swap-button/valid-swap-button.hooks.d.ts +5 -0
- package/trading-widget/components/withdraw/complete-step/complete-step.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/input-group/complete-withdraw-input-group.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/input-group/complete-withdraw-input-group.hooks.d.ts +12 -0
- package/trading-widget/components/withdraw/complete-step/meta/meta.d.ts +2 -0
- package/trading-widget/components/withdraw/complete-step/meta/transaction-disclosure/transaction-disclosure.d.ts +1 -0
- package/trading-widget/components/withdraw/complete-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +6 -0
- package/trading-widget/components/withdraw/init-step/balance/init-withdraw-balance.d.ts +2 -0
- package/trading-widget/components/withdraw/{balance/balance.hooks.d.ts → init-step/balance/init-withdraw-balance.hooks.d.ts} +1 -1
- package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.d.ts +2 -0
- package/trading-widget/components/withdraw/{button/trade-button/trade-button.hooks.d.ts → init-step/button/init-withdraw-button/init-withdraw-button.hooks.d.ts} +1 -1
- package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.d.ts +2 -0
- package/trading-widget/components/withdraw/{button/valid-withdraw-button/valid-withdraw-button.hooks.d.ts → init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts} +1 -1
- package/trading-widget/components/withdraw/init-step/init-step.d.ts +1 -0
- package/trading-widget/components/withdraw/init-step/input-group/init-withdraw-input-group.d.ts +1 -0
- package/trading-widget/components/withdraw/init-step/input-group/init-withdraw-input-group.hooks.d.ts +15 -0
- package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/asset-composition-table/asset-composition-table.d.ts +2 -0
- package/trading-widget/components/{widget/widget-input → withdraw/init-step/input-group/withdraw-section}/asset-composition-table/asset-composition-table.hooks.d.ts +1 -1
- package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.d.ts +3 -0
- package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.hooks.d.ts +10 -0
- package/trading-widget/components/withdraw/init-step/meta/meta.d.ts +2 -0
- package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.d.ts +1 -0
- package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +10 -0
- package/trading-widget/components/withdraw/tab-panel/tab-panel.hooks.d.ts +5 -1
- package/trading-widget/hooks/use-get-slippage-placeholder.d.ts +1 -2
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -1
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +10 -0
- package/core-kit/abi/dhedge-easy-swapper.d.ts +0 -231
- package/core-kit/hooks/trading/use-max-slippage-placeholder.d.ts +0 -1
- package/core-kit/hooks/trading/use-min-receive-text.d.ts +0 -4
- package/core-kit/hooks/trading/withdraw/index.d.ts +0 -7
- package/core-kit/hooks/trading/withdraw/use-withdraw-quote.d.ts +0 -2
- package/core-kit/hooks/trading/withdraw/use-withdraw-slippage.d.ts +0 -9
- package/core-kit/hooks/trading/withdraw/use-withdraw-trading-params.d.ts +0 -2
- package/core-kit/hooks/trading/withdraw/use-withdraw.d.ts +0 -2
- package/core-kit/models/default-selling-params.d.ts +0 -18
- package/index-c3d20359.cjs +0 -207
- package/trading-widget/components/widget/widget-input/asset-composition-table/asset-composition-table.d.ts +0 -2
- package/trading-widget/components/withdraw/balance/balance.d.ts +0 -2
- package/trading-widget/components/withdraw/button/trade-button/trade-button.d.ts +0 -2
- package/trading-widget/components/withdraw/button/valid-withdraw-button/valid-withdraw-button.d.ts +0 -2
- package/trading-widget/components/withdraw/input-group/input-group.d.ts +0 -1
- package/trading-widget/components/withdraw/input-group/input-group.hooks.d.ts +0 -23
- package/trading-widget/components/withdraw/meta/meta.d.ts +0 -2
- package/trading-widget/components/withdraw/meta/transaction-disclosure/transaction-disclosure.d.ts +0 -1
- package/trading-widget/components/withdraw/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +0 -16
- /package/core-kit/hooks/trading/{withdraw → withdraw-v2/init-step}/use-is-multi-asset-withdraw.d.ts +0 -0
- /package/core-kit/hooks/trading/{withdraw → withdraw-v2}/use-withdraw-type-handler.d.ts +0 -0
- /package/trading-widget/components/{widget/widget-input → withdraw/init-step/input-group/withdraw-section}/asset-composition-table/withdraw-explanation-tip.d.ts +0 -0
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
import type { PoolContractCallParams } from 'core-kit/types';
|
|
2
|
+
export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallParams) => import("wagmi").UseReadContractsReturnType<readonly [{
|
|
3
|
+
readonly address: `0x${string}`;
|
|
4
|
+
readonly abi: readonly [{
|
|
5
|
+
readonly inputs: readonly [{
|
|
6
|
+
readonly internalType: "address";
|
|
7
|
+
readonly name: "asset";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
}];
|
|
10
|
+
readonly name: "getAssetPrice";
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly internalType: "uint256";
|
|
13
|
+
readonly name: "price";
|
|
14
|
+
readonly type: "uint256";
|
|
15
|
+
}];
|
|
16
|
+
readonly stateMutability: "view";
|
|
17
|
+
readonly type: "function";
|
|
18
|
+
}, {
|
|
19
|
+
readonly inputs: readonly [{
|
|
20
|
+
readonly internalType: "address";
|
|
21
|
+
readonly name: "";
|
|
22
|
+
readonly type: "address";
|
|
23
|
+
}];
|
|
24
|
+
readonly name: "isPool";
|
|
25
|
+
readonly outputs: readonly [{
|
|
26
|
+
readonly internalType: "bool";
|
|
27
|
+
readonly name: "";
|
|
28
|
+
readonly type: "bool";
|
|
29
|
+
}];
|
|
30
|
+
readonly stateMutability: "view";
|
|
31
|
+
readonly type: "function";
|
|
32
|
+
}, {
|
|
33
|
+
readonly inputs: readonly [{
|
|
34
|
+
readonly internalType: "address";
|
|
35
|
+
readonly name: "extContract";
|
|
36
|
+
readonly type: "address";
|
|
37
|
+
}];
|
|
38
|
+
readonly name: "getAssetGuard";
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
readonly name: "guard";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
}];
|
|
44
|
+
readonly stateMutability: "view";
|
|
45
|
+
readonly type: "function";
|
|
46
|
+
}, {
|
|
47
|
+
readonly inputs: readonly [{
|
|
48
|
+
readonly internalType: "address";
|
|
49
|
+
readonly name: "extContract";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
}];
|
|
52
|
+
readonly name: "getContractGuard";
|
|
53
|
+
readonly outputs: readonly [{
|
|
54
|
+
readonly internalType: "address";
|
|
55
|
+
readonly name: "guard";
|
|
56
|
+
readonly type: "address";
|
|
57
|
+
}];
|
|
58
|
+
readonly stateMutability: "view";
|
|
59
|
+
readonly type: "function";
|
|
60
|
+
}];
|
|
61
|
+
readonly functionName: "isPool";
|
|
62
|
+
readonly chainId: number;
|
|
63
|
+
readonly args: readonly [`0x${string}`];
|
|
64
|
+
}, {
|
|
65
|
+
readonly address: `0x${string}`;
|
|
66
|
+
readonly abi: readonly [{
|
|
67
|
+
readonly inputs: readonly [{
|
|
68
|
+
readonly components: readonly [{
|
|
69
|
+
readonly components: readonly [{
|
|
70
|
+
readonly internalType: "contract IERC20";
|
|
71
|
+
readonly name: "token";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
}, {
|
|
74
|
+
readonly internalType: "uint256";
|
|
75
|
+
readonly name: "amount";
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
}, {
|
|
78
|
+
readonly components: readonly [{
|
|
79
|
+
readonly internalType: "bytes32";
|
|
80
|
+
readonly name: "routerKey";
|
|
81
|
+
readonly type: "bytes32";
|
|
82
|
+
}, {
|
|
83
|
+
readonly internalType: "bytes";
|
|
84
|
+
readonly name: "swapData";
|
|
85
|
+
readonly type: "bytes";
|
|
86
|
+
}];
|
|
87
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
88
|
+
readonly name: "aggregatorData";
|
|
89
|
+
readonly type: "tuple";
|
|
90
|
+
}];
|
|
91
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails[]";
|
|
92
|
+
readonly name: "srcData";
|
|
93
|
+
readonly type: "tuple[]";
|
|
94
|
+
}, {
|
|
95
|
+
readonly components: readonly [{
|
|
96
|
+
readonly internalType: "contract IERC20";
|
|
97
|
+
readonly name: "destToken";
|
|
98
|
+
readonly type: "address";
|
|
99
|
+
}, {
|
|
100
|
+
readonly internalType: "uint256";
|
|
101
|
+
readonly name: "minDestAmount";
|
|
102
|
+
readonly type: "uint256";
|
|
103
|
+
}];
|
|
104
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
105
|
+
readonly name: "destData";
|
|
106
|
+
readonly type: "tuple";
|
|
107
|
+
}];
|
|
108
|
+
readonly internalType: "struct IWithdrawalVault.MultiInSingleOutData";
|
|
109
|
+
readonly name: "_swapData";
|
|
110
|
+
readonly type: "tuple";
|
|
111
|
+
}, {
|
|
112
|
+
readonly internalType: "uint256";
|
|
113
|
+
readonly name: "_expectedDestTokenAmount";
|
|
114
|
+
readonly type: "uint256";
|
|
115
|
+
}];
|
|
116
|
+
readonly name: "completeWithdrawal";
|
|
117
|
+
readonly outputs: readonly [];
|
|
118
|
+
readonly stateMutability: "nonpayable";
|
|
119
|
+
readonly type: "function";
|
|
120
|
+
}, {
|
|
121
|
+
readonly inputs: readonly [];
|
|
122
|
+
readonly name: "completeWithdrawal";
|
|
123
|
+
readonly outputs: readonly [];
|
|
124
|
+
readonly stateMutability: "nonpayable";
|
|
125
|
+
readonly type: "function";
|
|
126
|
+
}, {
|
|
127
|
+
readonly inputs: readonly [];
|
|
128
|
+
readonly name: "customCooldown";
|
|
129
|
+
readonly outputs: readonly [{
|
|
130
|
+
readonly internalType: "uint256";
|
|
131
|
+
readonly name: "";
|
|
132
|
+
readonly type: "uint256";
|
|
133
|
+
}];
|
|
134
|
+
readonly stateMutability: "view";
|
|
135
|
+
readonly type: "function";
|
|
136
|
+
}, {
|
|
137
|
+
readonly inputs: readonly [{
|
|
138
|
+
readonly internalType: "address";
|
|
139
|
+
readonly name: "";
|
|
140
|
+
readonly type: "address";
|
|
141
|
+
}];
|
|
142
|
+
readonly name: "customCooldownDepositsWhitelist";
|
|
143
|
+
readonly outputs: readonly [{
|
|
144
|
+
readonly internalType: "bool";
|
|
145
|
+
readonly name: "";
|
|
146
|
+
readonly type: "bool";
|
|
147
|
+
}];
|
|
148
|
+
readonly stateMutability: "view";
|
|
149
|
+
readonly type: "function";
|
|
150
|
+
}, {
|
|
151
|
+
readonly inputs: readonly [{
|
|
152
|
+
readonly internalType: "address";
|
|
153
|
+
readonly name: "_dHedgeVault";
|
|
154
|
+
readonly type: "address";
|
|
155
|
+
}, {
|
|
156
|
+
readonly internalType: "contract IERC20";
|
|
157
|
+
readonly name: "_vaultDepositToken";
|
|
158
|
+
readonly type: "address";
|
|
159
|
+
}, {
|
|
160
|
+
readonly internalType: "uint256";
|
|
161
|
+
readonly name: "_depositAmount";
|
|
162
|
+
readonly type: "uint256";
|
|
163
|
+
}, {
|
|
164
|
+
readonly internalType: "uint256";
|
|
165
|
+
readonly name: "_expectedAmountReceived";
|
|
166
|
+
readonly type: "uint256";
|
|
167
|
+
}];
|
|
168
|
+
readonly name: "deposit";
|
|
169
|
+
readonly outputs: readonly [];
|
|
170
|
+
readonly stateMutability: "nonpayable";
|
|
171
|
+
readonly type: "function";
|
|
172
|
+
}, {
|
|
173
|
+
readonly inputs: readonly [{
|
|
174
|
+
readonly internalType: "address";
|
|
175
|
+
readonly name: "_dHedgeVault";
|
|
176
|
+
readonly type: "address";
|
|
177
|
+
}, {
|
|
178
|
+
readonly internalType: "address";
|
|
179
|
+
readonly name: "_vaultDepositToken";
|
|
180
|
+
readonly type: "address";
|
|
181
|
+
}, {
|
|
182
|
+
readonly internalType: "uint256";
|
|
183
|
+
readonly name: "_depositAmount";
|
|
184
|
+
readonly type: "uint256";
|
|
185
|
+
}];
|
|
186
|
+
readonly name: "depositQuote";
|
|
187
|
+
readonly outputs: readonly [{
|
|
188
|
+
readonly internalType: "uint256";
|
|
189
|
+
readonly name: "expectedAmountReceived";
|
|
190
|
+
readonly type: "uint256";
|
|
191
|
+
}];
|
|
192
|
+
readonly stateMutability: "view";
|
|
193
|
+
readonly type: "function";
|
|
194
|
+
}, {
|
|
195
|
+
readonly inputs: readonly [{
|
|
196
|
+
readonly internalType: "address";
|
|
197
|
+
readonly name: "_dHedgeVault";
|
|
198
|
+
readonly type: "address";
|
|
199
|
+
}, {
|
|
200
|
+
readonly internalType: "contract IERC20";
|
|
201
|
+
readonly name: "_vaultDepositToken";
|
|
202
|
+
readonly type: "address";
|
|
203
|
+
}, {
|
|
204
|
+
readonly internalType: "uint256";
|
|
205
|
+
readonly name: "_depositAmount";
|
|
206
|
+
readonly type: "uint256";
|
|
207
|
+
}, {
|
|
208
|
+
readonly internalType: "uint256";
|
|
209
|
+
readonly name: "_expectedAmountReceived";
|
|
210
|
+
readonly type: "uint256";
|
|
211
|
+
}];
|
|
212
|
+
readonly name: "depositWithCustomCooldown";
|
|
213
|
+
readonly outputs: readonly [];
|
|
214
|
+
readonly stateMutability: "nonpayable";
|
|
215
|
+
readonly type: "function";
|
|
216
|
+
}, {
|
|
217
|
+
readonly inputs: readonly [{
|
|
218
|
+
readonly internalType: "address";
|
|
219
|
+
readonly name: "_depositor";
|
|
220
|
+
readonly type: "address";
|
|
221
|
+
}];
|
|
222
|
+
readonly name: "getTrackedAssets";
|
|
223
|
+
readonly outputs: readonly [{
|
|
224
|
+
readonly components: readonly [{
|
|
225
|
+
readonly internalType: "address";
|
|
226
|
+
readonly name: "token";
|
|
227
|
+
readonly type: "address";
|
|
228
|
+
}, {
|
|
229
|
+
readonly internalType: "uint256";
|
|
230
|
+
readonly name: "balance";
|
|
231
|
+
readonly type: "uint256";
|
|
232
|
+
}];
|
|
233
|
+
readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
|
|
234
|
+
readonly name: "trackedAssets";
|
|
235
|
+
readonly type: "tuple[]";
|
|
236
|
+
}];
|
|
237
|
+
readonly stateMutability: "view";
|
|
238
|
+
readonly type: "function";
|
|
239
|
+
}, {
|
|
240
|
+
readonly inputs: readonly [{
|
|
241
|
+
readonly internalType: "address";
|
|
242
|
+
readonly name: "_dHedgeVault";
|
|
243
|
+
readonly type: "address";
|
|
244
|
+
}, {
|
|
245
|
+
readonly internalType: "uint256";
|
|
246
|
+
readonly name: "_amountIn";
|
|
247
|
+
readonly type: "uint256";
|
|
248
|
+
}, {
|
|
249
|
+
readonly internalType: "uint256";
|
|
250
|
+
readonly name: "_slippageTolerance";
|
|
251
|
+
readonly type: "uint256";
|
|
252
|
+
}];
|
|
253
|
+
readonly name: "initWithdrawal";
|
|
254
|
+
readonly outputs: readonly [];
|
|
255
|
+
readonly stateMutability: "nonpayable";
|
|
256
|
+
readonly type: "function";
|
|
257
|
+
}, {
|
|
258
|
+
readonly inputs: readonly [{
|
|
259
|
+
readonly internalType: "address";
|
|
260
|
+
readonly name: "_dHedgeVault";
|
|
261
|
+
readonly type: "address";
|
|
262
|
+
}, {
|
|
263
|
+
readonly internalType: "uint256";
|
|
264
|
+
readonly name: "_expectedAmountReceived";
|
|
265
|
+
readonly type: "uint256";
|
|
266
|
+
}];
|
|
267
|
+
readonly name: "nativeDeposit";
|
|
268
|
+
readonly outputs: readonly [];
|
|
269
|
+
readonly stateMutability: "payable";
|
|
270
|
+
readonly type: "function";
|
|
271
|
+
}, {
|
|
272
|
+
readonly inputs: readonly [{
|
|
273
|
+
readonly internalType: "address";
|
|
274
|
+
readonly name: "_dHedgeVault";
|
|
275
|
+
readonly type: "address";
|
|
276
|
+
}, {
|
|
277
|
+
readonly internalType: "uint256";
|
|
278
|
+
readonly name: "_expectedAmountReceived";
|
|
279
|
+
readonly type: "uint256";
|
|
280
|
+
}];
|
|
281
|
+
readonly name: "nativeDepositWithCustomCooldown";
|
|
282
|
+
readonly outputs: readonly [];
|
|
283
|
+
readonly stateMutability: "payable";
|
|
284
|
+
readonly type: "function";
|
|
285
|
+
}, {
|
|
286
|
+
readonly inputs: readonly [{
|
|
287
|
+
readonly internalType: "uint256";
|
|
288
|
+
readonly name: "_portion";
|
|
289
|
+
readonly type: "uint256";
|
|
290
|
+
}, {
|
|
291
|
+
readonly internalType: "address";
|
|
292
|
+
readonly name: "_to";
|
|
293
|
+
readonly type: "address";
|
|
294
|
+
}];
|
|
295
|
+
readonly name: "partialWithdraw";
|
|
296
|
+
readonly outputs: readonly [];
|
|
297
|
+
readonly stateMutability: "nonpayable";
|
|
298
|
+
readonly type: "function";
|
|
299
|
+
}, {
|
|
300
|
+
readonly inputs: readonly [];
|
|
301
|
+
readonly name: "swapper";
|
|
302
|
+
readonly outputs: readonly [{
|
|
303
|
+
readonly internalType: "contract ISwapper";
|
|
304
|
+
readonly name: "";
|
|
305
|
+
readonly type: "address";
|
|
306
|
+
}];
|
|
307
|
+
readonly stateMutability: "view";
|
|
308
|
+
readonly type: "function";
|
|
309
|
+
}, {
|
|
310
|
+
readonly inputs: readonly [];
|
|
311
|
+
readonly name: "weth";
|
|
312
|
+
readonly outputs: readonly [{
|
|
313
|
+
readonly internalType: "address";
|
|
314
|
+
readonly name: "";
|
|
315
|
+
readonly type: "address";
|
|
316
|
+
}];
|
|
317
|
+
readonly stateMutability: "view";
|
|
318
|
+
readonly type: "function";
|
|
319
|
+
}, {
|
|
320
|
+
readonly inputs: readonly [{
|
|
321
|
+
readonly internalType: "address";
|
|
322
|
+
readonly name: "";
|
|
323
|
+
readonly type: "address";
|
|
324
|
+
}];
|
|
325
|
+
readonly name: "withdrawalContracts";
|
|
326
|
+
readonly outputs: readonly [{
|
|
327
|
+
readonly internalType: "address";
|
|
328
|
+
readonly name: "";
|
|
329
|
+
readonly type: "address";
|
|
330
|
+
}];
|
|
331
|
+
readonly stateMutability: "view";
|
|
332
|
+
readonly type: "function";
|
|
333
|
+
}, {
|
|
334
|
+
readonly inputs: readonly [];
|
|
335
|
+
readonly name: "wrappedNativeToken";
|
|
336
|
+
readonly outputs: readonly [{
|
|
337
|
+
readonly internalType: "contract IWETH";
|
|
338
|
+
readonly name: "";
|
|
339
|
+
readonly type: "address";
|
|
340
|
+
}];
|
|
341
|
+
readonly stateMutability: "view";
|
|
342
|
+
readonly type: "function";
|
|
343
|
+
}, {
|
|
344
|
+
readonly inputs: readonly [{
|
|
345
|
+
readonly internalType: "address";
|
|
346
|
+
readonly name: "_dHedgeVault";
|
|
347
|
+
readonly type: "address";
|
|
348
|
+
}, {
|
|
349
|
+
readonly components: readonly [{
|
|
350
|
+
readonly components: readonly [{
|
|
351
|
+
readonly internalType: "contract IERC20";
|
|
352
|
+
readonly name: "token";
|
|
353
|
+
readonly type: "address";
|
|
354
|
+
}, {
|
|
355
|
+
readonly internalType: "uint256";
|
|
356
|
+
readonly name: "amount";
|
|
357
|
+
readonly type: "uint256";
|
|
358
|
+
}, {
|
|
359
|
+
readonly components: readonly [{
|
|
360
|
+
readonly internalType: "bytes32";
|
|
361
|
+
readonly name: "routerKey";
|
|
362
|
+
readonly type: "bytes32";
|
|
363
|
+
}, {
|
|
364
|
+
readonly internalType: "bytes";
|
|
365
|
+
readonly name: "swapData";
|
|
366
|
+
readonly type: "bytes";
|
|
367
|
+
}];
|
|
368
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
369
|
+
readonly name: "aggregatorData";
|
|
370
|
+
readonly type: "tuple";
|
|
371
|
+
}];
|
|
372
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
373
|
+
readonly name: "srcData";
|
|
374
|
+
readonly type: "tuple";
|
|
375
|
+
}, {
|
|
376
|
+
readonly components: readonly [{
|
|
377
|
+
readonly internalType: "contract IERC20";
|
|
378
|
+
readonly name: "destToken";
|
|
379
|
+
readonly type: "address";
|
|
380
|
+
}, {
|
|
381
|
+
readonly internalType: "uint256";
|
|
382
|
+
readonly name: "minDestAmount";
|
|
383
|
+
readonly type: "uint256";
|
|
384
|
+
}];
|
|
385
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
386
|
+
readonly name: "destData";
|
|
387
|
+
readonly type: "tuple";
|
|
388
|
+
}];
|
|
389
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
390
|
+
readonly name: "_swapData";
|
|
391
|
+
readonly type: "tuple";
|
|
392
|
+
}, {
|
|
393
|
+
readonly internalType: "uint256";
|
|
394
|
+
readonly name: "_expectedAmountReceived";
|
|
395
|
+
readonly type: "uint256";
|
|
396
|
+
}];
|
|
397
|
+
readonly name: "zapDeposit";
|
|
398
|
+
readonly outputs: readonly [];
|
|
399
|
+
readonly stateMutability: "nonpayable";
|
|
400
|
+
readonly type: "function";
|
|
401
|
+
}, {
|
|
402
|
+
readonly inputs: readonly [{
|
|
403
|
+
readonly internalType: "address";
|
|
404
|
+
readonly name: "_dHedgeVault";
|
|
405
|
+
readonly type: "address";
|
|
406
|
+
}, {
|
|
407
|
+
readonly components: readonly [{
|
|
408
|
+
readonly components: readonly [{
|
|
409
|
+
readonly internalType: "contract IERC20";
|
|
410
|
+
readonly name: "token";
|
|
411
|
+
readonly type: "address";
|
|
412
|
+
}, {
|
|
413
|
+
readonly internalType: "uint256";
|
|
414
|
+
readonly name: "amount";
|
|
415
|
+
readonly type: "uint256";
|
|
416
|
+
}, {
|
|
417
|
+
readonly components: readonly [{
|
|
418
|
+
readonly internalType: "bytes32";
|
|
419
|
+
readonly name: "routerKey";
|
|
420
|
+
readonly type: "bytes32";
|
|
421
|
+
}, {
|
|
422
|
+
readonly internalType: "bytes";
|
|
423
|
+
readonly name: "swapData";
|
|
424
|
+
readonly type: "bytes";
|
|
425
|
+
}];
|
|
426
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
427
|
+
readonly name: "aggregatorData";
|
|
428
|
+
readonly type: "tuple";
|
|
429
|
+
}];
|
|
430
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
431
|
+
readonly name: "srcData";
|
|
432
|
+
readonly type: "tuple";
|
|
433
|
+
}, {
|
|
434
|
+
readonly components: readonly [{
|
|
435
|
+
readonly internalType: "contract IERC20";
|
|
436
|
+
readonly name: "destToken";
|
|
437
|
+
readonly type: "address";
|
|
438
|
+
}, {
|
|
439
|
+
readonly internalType: "uint256";
|
|
440
|
+
readonly name: "minDestAmount";
|
|
441
|
+
readonly type: "uint256";
|
|
442
|
+
}];
|
|
443
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
444
|
+
readonly name: "destData";
|
|
445
|
+
readonly type: "tuple";
|
|
446
|
+
}];
|
|
447
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
448
|
+
readonly name: "_swapData";
|
|
449
|
+
readonly type: "tuple";
|
|
450
|
+
}, {
|
|
451
|
+
readonly internalType: "uint256";
|
|
452
|
+
readonly name: "_expectedAmountReceived";
|
|
453
|
+
readonly type: "uint256";
|
|
454
|
+
}];
|
|
455
|
+
readonly name: "zapDepositWithCustomCooldown";
|
|
456
|
+
readonly outputs: readonly [];
|
|
457
|
+
readonly stateMutability: "nonpayable";
|
|
458
|
+
readonly type: "function";
|
|
459
|
+
}, {
|
|
460
|
+
readonly inputs: readonly [{
|
|
461
|
+
readonly internalType: "address";
|
|
462
|
+
readonly name: "_dHedgeVault";
|
|
463
|
+
readonly type: "address";
|
|
464
|
+
}, {
|
|
465
|
+
readonly components: readonly [{
|
|
466
|
+
readonly components: readonly [{
|
|
467
|
+
readonly internalType: "contract IERC20";
|
|
468
|
+
readonly name: "token";
|
|
469
|
+
readonly type: "address";
|
|
470
|
+
}, {
|
|
471
|
+
readonly internalType: "uint256";
|
|
472
|
+
readonly name: "amount";
|
|
473
|
+
readonly type: "uint256";
|
|
474
|
+
}, {
|
|
475
|
+
readonly components: readonly [{
|
|
476
|
+
readonly internalType: "bytes32";
|
|
477
|
+
readonly name: "routerKey";
|
|
478
|
+
readonly type: "bytes32";
|
|
479
|
+
}, {
|
|
480
|
+
readonly internalType: "bytes";
|
|
481
|
+
readonly name: "swapData";
|
|
482
|
+
readonly type: "bytes";
|
|
483
|
+
}];
|
|
484
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
485
|
+
readonly name: "aggregatorData";
|
|
486
|
+
readonly type: "tuple";
|
|
487
|
+
}];
|
|
488
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
489
|
+
readonly name: "srcData";
|
|
490
|
+
readonly type: "tuple";
|
|
491
|
+
}, {
|
|
492
|
+
readonly components: readonly [{
|
|
493
|
+
readonly internalType: "contract IERC20";
|
|
494
|
+
readonly name: "destToken";
|
|
495
|
+
readonly type: "address";
|
|
496
|
+
}, {
|
|
497
|
+
readonly internalType: "uint256";
|
|
498
|
+
readonly name: "minDestAmount";
|
|
499
|
+
readonly type: "uint256";
|
|
500
|
+
}];
|
|
501
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
502
|
+
readonly name: "destData";
|
|
503
|
+
readonly type: "tuple";
|
|
504
|
+
}];
|
|
505
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
506
|
+
readonly name: "_swapData";
|
|
507
|
+
readonly type: "tuple";
|
|
508
|
+
}, {
|
|
509
|
+
readonly internalType: "uint256";
|
|
510
|
+
readonly name: "_expectedAmountReceived";
|
|
511
|
+
readonly type: "uint256";
|
|
512
|
+
}];
|
|
513
|
+
readonly name: "zapNativeDeposit";
|
|
514
|
+
readonly outputs: readonly [];
|
|
515
|
+
readonly stateMutability: "payable";
|
|
516
|
+
readonly type: "function";
|
|
517
|
+
}, {
|
|
518
|
+
readonly inputs: readonly [{
|
|
519
|
+
readonly internalType: "address";
|
|
520
|
+
readonly name: "_dHedgeVault";
|
|
521
|
+
readonly type: "address";
|
|
522
|
+
}, {
|
|
523
|
+
readonly components: readonly [{
|
|
524
|
+
readonly components: readonly [{
|
|
525
|
+
readonly internalType: "contract IERC20";
|
|
526
|
+
readonly name: "token";
|
|
527
|
+
readonly type: "address";
|
|
528
|
+
}, {
|
|
529
|
+
readonly internalType: "uint256";
|
|
530
|
+
readonly name: "amount";
|
|
531
|
+
readonly type: "uint256";
|
|
532
|
+
}, {
|
|
533
|
+
readonly components: readonly [{
|
|
534
|
+
readonly internalType: "bytes32";
|
|
535
|
+
readonly name: "routerKey";
|
|
536
|
+
readonly type: "bytes32";
|
|
537
|
+
}, {
|
|
538
|
+
readonly internalType: "bytes";
|
|
539
|
+
readonly name: "swapData";
|
|
540
|
+
readonly type: "bytes";
|
|
541
|
+
}];
|
|
542
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
543
|
+
readonly name: "aggregatorData";
|
|
544
|
+
readonly type: "tuple";
|
|
545
|
+
}];
|
|
546
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
547
|
+
readonly name: "srcData";
|
|
548
|
+
readonly type: "tuple";
|
|
549
|
+
}, {
|
|
550
|
+
readonly components: readonly [{
|
|
551
|
+
readonly internalType: "contract IERC20";
|
|
552
|
+
readonly name: "destToken";
|
|
553
|
+
readonly type: "address";
|
|
554
|
+
}, {
|
|
555
|
+
readonly internalType: "uint256";
|
|
556
|
+
readonly name: "minDestAmount";
|
|
557
|
+
readonly type: "uint256";
|
|
558
|
+
}];
|
|
559
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
560
|
+
readonly name: "destData";
|
|
561
|
+
readonly type: "tuple";
|
|
562
|
+
}];
|
|
563
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
564
|
+
readonly name: "_swapData";
|
|
565
|
+
readonly type: "tuple";
|
|
566
|
+
}, {
|
|
567
|
+
readonly internalType: "uint256";
|
|
568
|
+
readonly name: "_expectedAmountReceived";
|
|
569
|
+
readonly type: "uint256";
|
|
570
|
+
}];
|
|
571
|
+
readonly name: "zapNativeDepositWithCustomCooldown";
|
|
572
|
+
readonly outputs: readonly [];
|
|
573
|
+
readonly stateMutability: "payable";
|
|
574
|
+
readonly type: "function";
|
|
575
|
+
}];
|
|
576
|
+
readonly functionName: "withdrawalContracts";
|
|
577
|
+
readonly args: readonly [`0x${string}`];
|
|
578
|
+
}], true, {
|
|
579
|
+
isUserDhedgePool: boolean | undefined;
|
|
580
|
+
withdrawalContractAddress: `0x${string}` | undefined;
|
|
581
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PoolComposition } from 'core-kit/types/pool.types';
|
|
2
|
-
import type { ApyCurrency, TradingToken
|
|
2
|
+
import type { ApyCurrency, TradingToken } from 'core-kit/types/trading-panel.types';
|
|
3
3
|
import type { Address, ChainId } from 'core-kit/types/web3.types';
|
|
4
4
|
export interface PoolConfig {
|
|
5
5
|
address: Address;
|
|
@@ -10,7 +10,7 @@ export interface PoolConfig {
|
|
|
10
10
|
defaultDepositTokenSymbol?: string;
|
|
11
11
|
};
|
|
12
12
|
withdrawParams: {
|
|
13
|
-
customTokens:
|
|
13
|
+
customTokens: TradingToken[];
|
|
14
14
|
};
|
|
15
15
|
deprecated?: boolean;
|
|
16
16
|
}
|
|
@@ -8,8 +8,8 @@ export interface TradingPanelStateModal {
|
|
|
8
8
|
status: TradingModalStatus;
|
|
9
9
|
action?: TransactionAction;
|
|
10
10
|
link?: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
sendTokens: TradingToken[] | null;
|
|
12
|
+
receiveTokens: TradingToken[] | null;
|
|
13
13
|
}
|
|
14
14
|
export interface TradingPanelState {
|
|
15
15
|
settings: {
|
|
@@ -8,13 +8,9 @@ export interface TradingToken {
|
|
|
8
8
|
export interface DynamicTradingToken extends TradingToken {
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface WithdrawTradingToken extends TradingToken {
|
|
12
|
-
method?: WithdrawMethodName;
|
|
13
|
-
intermediateToken?: TradingToken;
|
|
14
|
-
}
|
|
15
11
|
export type TradingModalStatus = 'Success' | 'None' | 'Mining' | 'Wallet';
|
|
16
12
|
export interface PendingTransaction {
|
|
17
|
-
action: 'deposit' | 'withdraw' | 'approve';
|
|
13
|
+
action: 'deposit' | 'withdraw' | 'approve' | 'oraclesUpdate' | 'swap' | 'claim';
|
|
18
14
|
symbol: string;
|
|
19
15
|
chainId: ChainId;
|
|
20
16
|
txHash?: Address;
|
|
@@ -31,8 +27,7 @@ type RemoveTransaction = {
|
|
|
31
27
|
} & Partial<PendingTransaction>;
|
|
32
28
|
export type UpdateTransactionsArguments = AddTransaction | UpdateTransaction | RemoveTransaction;
|
|
33
29
|
export type TradingPanelType = 'deposit' | 'withdraw';
|
|
34
|
-
export type TransactionAction = 'deposit' | 'withdraw' | 'approve' | 'oraclesUpdate';
|
|
35
|
-
export type WithdrawMethodName = 'withdraw' | 'withdrawSUSD' | 'withdrawSafe';
|
|
30
|
+
export type TransactionAction = 'deposit' | 'withdraw' | 'approve' | 'oraclesUpdate' | 'swap' | 'claim';
|
|
36
31
|
export type SwapEntity = 'token' | 'pool';
|
|
37
32
|
export interface TokenSelectorPayload {
|
|
38
33
|
isOpen: boolean;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type { BigNumber } from 'bignumber.js';
|
|
2
|
-
import type { DefaultSellingParams } from 'core-kit/models';
|
|
3
1
|
import type { Address, ChainId } from 'core-kit/types/web3.types';
|
|
4
|
-
export interface TradingParams {
|
|
5
|
-
sendAssetAddress: Address;
|
|
6
|
-
fromTokenAmount: BigNumber;
|
|
7
|
-
receiveAssetAmount: string;
|
|
8
|
-
poolDepositAddress?: Address;
|
|
9
|
-
receiveAssetAddress: Address;
|
|
10
|
-
}
|
|
11
2
|
export type NativeTokenSymbol = 'ETH' | 'POL';
|
|
12
3
|
export type ChainNativeTokenMap = {
|
|
13
4
|
[key in ChainId]?: {
|
|
@@ -17,7 +8,6 @@ export type ChainNativeTokenMap = {
|
|
|
17
8
|
decimals: number;
|
|
18
9
|
};
|
|
19
10
|
};
|
|
20
|
-
export type TxArgs = DefaultSellingParams;
|
|
21
11
|
export interface SwapDataResponse {
|
|
22
12
|
destinationAmount: string;
|
|
23
13
|
txData: string;
|
|
@@ -10,13 +10,6 @@ export interface EstimatedGas {
|
|
|
10
10
|
error: string;
|
|
11
11
|
}
|
|
12
12
|
export type EstimateCall = (...args: unknown[]) => Promise<EstimatedGas>;
|
|
13
|
-
export interface SendEstimationResult {
|
|
14
|
-
argsToUse: unknown[];
|
|
15
|
-
gas: bigint;
|
|
16
|
-
}
|
|
17
|
-
export interface ContractCallArgs<T extends string | undefined | void> {
|
|
18
|
-
getOrderedArgs: (extraArg: T) => string[];
|
|
19
|
-
}
|
|
20
13
|
export interface SimulateTransactionParams {
|
|
21
14
|
chainId: ChainId;
|
|
22
15
|
from: Address;
|