@velora-dex/widget 0.0.16 → 0.0.18
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/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +3 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +3 -2
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/web3/AccountButton.js +1 -1
- package/dist/components/web3/AccountButton.js.map +1 -1
- package/dist/components/web3/ConnectWallets/privy/button.d.ts.map +1 -1
- package/dist/components/web3/ConnectWallets/privy/button.js +99 -76
- package/dist/components/web3/ConnectWallets/privy/button.js.map +1 -1
- package/dist/components/web3/ConnectWallets/privy/connectRunner.d.ts.map +1 -1
- package/dist/components/web3/ConnectWallets/privy/connectRunner.js +5 -3
- package/dist/components/web3/ConnectWallets/privy/connectRunner.js.map +1 -1
- package/dist/components/widget/Drawer/state/useDrawerControls.d.ts.map +1 -1
- package/dist/components/widget/Drawer/state/useDrawerControls.js +29 -23
- package/dist/components/widget/Drawer/state/useDrawerControls.js.map +1 -1
- package/dist/components/widget/NetworkIcon/NetworkIconSquare.d.ts.map +1 -1
- package/dist/components/widget/NetworkIcon/NetworkIconSquare.js +3 -1
- package/dist/components/widget/NetworkIcon/NetworkIconSquare.js.map +1 -1
- package/dist/components/widget/NetworkWithIcon/NetworkWithIcon.d.ts.map +1 -1
- package/dist/components/widget/NetworkWithIcon/NetworkWithIcon.js +3 -1
- package/dist/components/widget/NetworkWithIcon/NetworkWithIcon.js.map +1 -1
- package/dist/components/widget/RowVirtualizer/RowVirtualizerFixed.d.ts.map +1 -1
- package/dist/components/widget/RowVirtualizer/RowVirtualizerFixed.js +3 -1
- package/dist/components/widget/RowVirtualizer/RowVirtualizerFixed.js.map +1 -1
- package/dist/components/widget/SelectToken/SelectTokenButton.d.ts.map +1 -1
- package/dist/components/widget/SelectToken/SelectTokenButton.js +106 -101
- package/dist/components/widget/SelectToken/SelectTokenButton.js.map +1 -1
- package/dist/components/widget/SwapModeSwitcher/state/swapSideAtom.js +1 -1
- package/dist/components/widget/WrapEth/hooks/useSubmitDepositTxMutation.d.ts.map +1 -1
- package/dist/components/widget/WrapEth/hooks/useSubmitDepositTxMutation.js +33 -28
- package/dist/components/widget/WrapEth/hooks/useSubmitDepositTxMutation.js.map +1 -1
- package/dist/hooks/permit/hooks/permit1/useGetPermitInfo.d.ts.map +1 -1
- package/dist/hooks/permit/hooks/permit1/useGetPermitInfo.js +17 -14
- package/dist/hooks/permit/hooks/permit1/useGetPermitInfo.js.map +1 -1
- package/dist/hooks/permit/hooks/permit1/useTryToSignPermit1.d.ts.map +1 -1
- package/dist/hooks/permit/hooks/permit1/useTryToSignPermit1.js +18 -15
- package/dist/hooks/permit/hooks/permit1/useTryToSignPermit1.js.map +1 -1
- package/dist/hooks/permit/hooks/permit2/usePermit2Allowance.d.ts.map +1 -1
- package/dist/hooks/permit/hooks/permit2/usePermit2Allowance.js +2 -4
- package/dist/hooks/permit/hooks/permit2/usePermit2Allowance.js.map +1 -1
- package/dist/hooks/permit/hooks/permit2/usePermit2TransferFromNonce.d.ts.map +1 -1
- package/dist/hooks/permit/hooks/permit2/usePermit2TransferFromNonce.js +6 -4
- package/dist/hooks/permit/hooks/permit2/usePermit2TransferFromNonce.js.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.d.ts.map +1 -1
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.js +12 -11
- package/dist/hooks/swap/prices/delta/queries/useWatchDeltaOrder.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/useApproveOrPermit.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/useApproveOrPermit.js +90 -76
- package/dist/hooks/swap/tradeFlow/common/useApproveOrPermit.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/useSignPermit1Or2.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/common/useSignPermit1Or2.js +148 -122
- package/dist/hooks/swap/tradeFlow/common/useSignPermit1Or2.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.js +249 -213
- package/dist/hooks/swap/tradeFlow/useDeltaFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.js +32 -26
- package/dist/hooks/swap/tradeFlow/useDeltaSwapStep.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketFlow.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketFlow.js +175 -160
- package/dist/hooks/swap/tradeFlow/useMarketFlow.js.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.d.ts.map +1 -1
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.js +33 -27
- package/dist/hooks/swap/tradeFlow/useMarketSwapStep.js.map +1 -1
- package/dist/hooks/txs/queries/useAwaitTx.d.ts.map +1 -1
- package/dist/hooks/txs/queries/useAwaitTx.js +16 -13
- package/dist/hooks/txs/queries/useAwaitTx.js.map +1 -1
- package/dist/hooks/txs/queries/useAwaitTxs.d.ts.map +1 -1
- package/dist/hooks/useSDK.d.ts.map +1 -1
- package/dist/hooks/useSDK.js +4 -2
- package/dist/hooks/useSDK.js.map +1 -1
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/logger.d.ts +5 -8
- package/dist/lib/utils/logger.d.ts.map +1 -1
- package/dist/lib/utils/logger.js +211 -2
- package/dist/lib/utils/logger.js.map +1 -1
- package/dist/styles.css +3 -3
- package/dist/test/Configurator.d.ts.map +1 -1
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +46 -42
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/inputs/hooks/useTokenFromInputProps.d.ts.map +1 -1
- package/dist/widget/inputs/hooks/useTokenFromInputProps.js +17 -14
- package/dist/widget/inputs/hooks/useTokenFromInputProps.js.map +1 -1
- package/dist/widget/inputs/hooks/useTokenToInputProps.d.ts.map +1 -1
- package/dist/widget/inputs/hooks/useTokenToInputProps.js +18 -15
- package/dist/widget/inputs/hooks/useTokenToInputProps.js.map +1 -1
- package/dist/widget/inputs/state/subscriptions.d.ts.map +1 -1
- package/dist/widget/inputs/state/subscriptions.js +2 -1
- package/dist/widget/inputs/state/subscriptions.js.map +1 -1
- package/dist/widget/logger.d.ts +8 -0
- package/dist/widget/logger.d.ts.map +1 -0
- package/dist/widget/logger.js +32 -0
- package/dist/widget/logger.js.map +1 -0
- package/dist/widget/state/configActionsAtom.d.ts.map +1 -1
- package/dist/widget/state/configActionsAtom.js +2 -0
- package/dist/widget/state/configActionsAtom.js.map +1 -1
- package/dist/widget/state/configAtom.d.ts +4 -1
- package/dist/widget/state/configAtom.d.ts.map +1 -1
- package/dist/widget/state/configAtom.js +1 -0
- package/dist/widget/state/configAtom.js.map +1 -1
- package/dist/widget/types.d.ts +13 -2
- package/dist/widget/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -15,15 +15,17 @@ import { useSwapSide } from '../../../components/widget/SwapModeSwitcher/state/s
|
|
|
15
15
|
import { useApproveOrPermit } from './common/useApproveOrPermit.js';
|
|
16
16
|
import { useMarkPermit1Or2NonceAsUsed } from './common/useSignPermit1Or2.js';
|
|
17
17
|
import { useWidgetConfig } from '../../../widget/state/configAtom.js';
|
|
18
|
+
import { useLogger } from '../../../widget/logger.js';
|
|
18
19
|
import { useTrackedPrice } from './common/useTrackedPrice.js';
|
|
19
20
|
import { useConstructGasParams } from './common/useConstructGasParams.js';
|
|
20
21
|
|
|
21
22
|
const MARKET_SWAP_MUTATION_KEY = "runMarketSwapFlow";
|
|
22
23
|
function useMarketFlow(t0) {
|
|
23
|
-
const $ = distExports.c(
|
|
24
|
+
const $ = distExports.c(104);
|
|
24
25
|
const {
|
|
25
26
|
marketPrice
|
|
26
27
|
} = t0;
|
|
28
|
+
const logger = useLogger("MarketFlow");
|
|
27
29
|
const chainId = useChainId();
|
|
28
30
|
const {
|
|
29
31
|
resolvedSlippage
|
|
@@ -86,73 +88,84 @@ function useMarketFlow(t0) {
|
|
|
86
88
|
signPermitMut
|
|
87
89
|
} = useApproveOrPermit(t6);
|
|
88
90
|
let t7;
|
|
89
|
-
if ($[13]
|
|
91
|
+
if ($[13] !== logger) {
|
|
90
92
|
t7 = {
|
|
91
|
-
onSuccess:
|
|
92
|
-
|
|
93
|
+
onSuccess: () => {
|
|
94
|
+
logger.log("Build tx success");
|
|
95
|
+
},
|
|
96
|
+
onError: (error) => {
|
|
97
|
+
logger.error("Build tx error", error);
|
|
98
|
+
}
|
|
93
99
|
};
|
|
94
|
-
$[13] =
|
|
100
|
+
$[13] = logger;
|
|
101
|
+
$[14] = t7;
|
|
95
102
|
} else {
|
|
96
|
-
t7 = $[
|
|
103
|
+
t7 = $[14];
|
|
97
104
|
}
|
|
98
105
|
let t8;
|
|
99
|
-
if ($[
|
|
106
|
+
if ($[15] !== chainId || $[16] !== t7) {
|
|
100
107
|
t8 = {
|
|
101
108
|
chainId,
|
|
102
109
|
mutationOptions: t7
|
|
103
110
|
};
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
111
|
+
$[15] = chainId;
|
|
112
|
+
$[16] = t7;
|
|
113
|
+
$[17] = t8;
|
|
106
114
|
} else {
|
|
107
|
-
t8 = $[
|
|
115
|
+
t8 = $[17];
|
|
108
116
|
}
|
|
109
117
|
const buildTxMut = useBuildTx(t8);
|
|
110
118
|
let t9;
|
|
111
|
-
if ($[
|
|
119
|
+
if ($[18] !== buildTxMut.error || $[19] !== buildTxMut.isError || $[20] !== buildTxMut.isPending || $[21] !== buildTxMut.isSuccess) {
|
|
112
120
|
t9 = {
|
|
113
121
|
isPending: buildTxMut.isPending,
|
|
114
122
|
isError: buildTxMut.isError,
|
|
115
123
|
isSuccess: buildTxMut.isSuccess,
|
|
116
124
|
error: buildTxMut.error
|
|
117
125
|
};
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
126
|
+
$[18] = buildTxMut.error;
|
|
127
|
+
$[19] = buildTxMut.isError;
|
|
128
|
+
$[20] = buildTxMut.isPending;
|
|
129
|
+
$[21] = buildTxMut.isSuccess;
|
|
130
|
+
$[22] = t9;
|
|
123
131
|
} else {
|
|
124
|
-
t9 = $[
|
|
132
|
+
t9 = $[22];
|
|
125
133
|
}
|
|
126
134
|
const buildTxParams = t9;
|
|
127
135
|
let t10;
|
|
128
|
-
if ($[
|
|
136
|
+
if ($[23] !== logger) {
|
|
129
137
|
t10 = {
|
|
130
|
-
onSuccess:
|
|
131
|
-
|
|
138
|
+
onSuccess: () => {
|
|
139
|
+
logger.log("Swap tx success");
|
|
140
|
+
},
|
|
141
|
+
onError: (error_0) => {
|
|
142
|
+
logger.error("Swap tx error", error_0);
|
|
143
|
+
}
|
|
132
144
|
};
|
|
133
|
-
$[
|
|
145
|
+
$[23] = logger;
|
|
146
|
+
$[24] = t10;
|
|
134
147
|
} else {
|
|
135
|
-
t10 = $[
|
|
148
|
+
t10 = $[24];
|
|
136
149
|
}
|
|
137
150
|
const sendSwapTxMut = useSendMarketSwapTx(t10);
|
|
138
151
|
let t11;
|
|
139
|
-
if ($[
|
|
152
|
+
if ($[25] !== chainId || $[26] !== sendSwapTxMut.txHash) {
|
|
140
153
|
t11 = {
|
|
141
154
|
hash: sendSwapTxMut.txHash,
|
|
142
155
|
chainId
|
|
143
156
|
};
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
157
|
+
$[25] = chainId;
|
|
158
|
+
$[26] = sendSwapTxMut.txHash;
|
|
159
|
+
$[27] = t11;
|
|
147
160
|
} else {
|
|
148
|
-
t11 = $[
|
|
161
|
+
t11 = $[27];
|
|
149
162
|
}
|
|
150
163
|
const swapTxMined = useAwaitTx(t11);
|
|
151
164
|
const t12 = sendSwapTxMut.isPending || swapTxMined.isLoading;
|
|
152
165
|
const t13 = sendSwapTxMut.isError || swapTxMined.isError;
|
|
153
166
|
const t14 = sendSwapTxMut.error || swapTxMined.error;
|
|
154
167
|
let t15;
|
|
155
|
-
if ($[
|
|
168
|
+
if ($[28] !== sendSwapTxMut.isError || $[29] !== sendSwapTxMut.isPending || $[30] !== sendSwapTxMut.isSuccess || $[31] !== sendSwapTxMut.txHash || $[32] !== swapTxMined.data || $[33] !== swapTxMined.isError || $[34] !== swapTxMined.isLoading || $[35] !== swapTxMined.isSuccess || $[36] !== t12 || $[37] !== t13 || $[38] !== t14) {
|
|
156
169
|
t15 = {
|
|
157
170
|
txHash: sendSwapTxMut.txHash,
|
|
158
171
|
receipt: swapTxMined.data,
|
|
@@ -167,20 +180,20 @@ function useMarketFlow(t0) {
|
|
|
167
180
|
isError: t13,
|
|
168
181
|
error: t14
|
|
169
182
|
};
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
183
|
+
$[28] = sendSwapTxMut.isError;
|
|
184
|
+
$[29] = sendSwapTxMut.isPending;
|
|
185
|
+
$[30] = sendSwapTxMut.isSuccess;
|
|
186
|
+
$[31] = sendSwapTxMut.txHash;
|
|
187
|
+
$[32] = swapTxMined.data;
|
|
188
|
+
$[33] = swapTxMined.isError;
|
|
189
|
+
$[34] = swapTxMined.isLoading;
|
|
190
|
+
$[35] = swapTxMined.isSuccess;
|
|
191
|
+
$[36] = t12;
|
|
192
|
+
$[37] = t13;
|
|
193
|
+
$[38] = t14;
|
|
194
|
+
$[39] = t15;
|
|
182
195
|
} else {
|
|
183
|
-
t15 = $[
|
|
196
|
+
t15 = $[39];
|
|
184
197
|
}
|
|
185
198
|
const swap = t15;
|
|
186
199
|
const {
|
|
@@ -189,26 +202,26 @@ function useMarketFlow(t0) {
|
|
|
189
202
|
const ensureTxReceipt = useEnsureTxReceipt();
|
|
190
203
|
const currentAbortControllerRef = useRef(null);
|
|
191
204
|
let t16;
|
|
192
|
-
if ($[
|
|
205
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
193
206
|
t16 = () => {
|
|
194
207
|
currentAbortControllerRef.current?.abort(new UserCancelledError());
|
|
195
208
|
currentAbortControllerRef.current = null;
|
|
196
209
|
};
|
|
197
|
-
$[
|
|
210
|
+
$[40] = t16;
|
|
198
211
|
} else {
|
|
199
|
-
t16 = $[
|
|
212
|
+
t16 = $[40];
|
|
200
213
|
}
|
|
201
214
|
const cancelFlow = t16;
|
|
202
215
|
const receiverAddress = useReceiverAddressValue();
|
|
203
216
|
let t17;
|
|
204
|
-
if ($[
|
|
217
|
+
if ($[41] !== chainId) {
|
|
205
218
|
t17 = {
|
|
206
219
|
chainId
|
|
207
220
|
};
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
221
|
+
$[41] = chainId;
|
|
222
|
+
$[42] = t17;
|
|
210
223
|
} else {
|
|
211
|
-
t17 = $[
|
|
224
|
+
t17 = $[42];
|
|
212
225
|
}
|
|
213
226
|
const {
|
|
214
227
|
markNonceAsUsed,
|
|
@@ -219,7 +232,7 @@ function useMarketFlow(t0) {
|
|
|
219
232
|
} = useConstructGasParams();
|
|
220
233
|
const partner = useWidgetConfig().partner;
|
|
221
234
|
let t18;
|
|
222
|
-
if ($[
|
|
235
|
+
if ($[43] !== account || $[44] !== approval || $[45] !== approveTxMut || $[46] !== buildTxMut || $[47] !== chainId || $[48] !== clearNonce || $[49] !== constructGasParams || $[50] !== ensureTxReceipt || $[51] !== logger || $[52] !== markNonceAsUsed || $[53] !== marketPrice || $[54] !== partner || $[55] !== receiverAddress || $[56] !== resolvedSlippage || $[57] !== sendSwapTxMut || $[58] !== signPermit || $[59] !== signPermitMut || $[60] !== trackedPrice.get || $[61] !== trackedPrice.set) {
|
|
223
236
|
t18 = async (t192) => {
|
|
224
237
|
const {
|
|
225
238
|
onTxSent
|
|
@@ -248,7 +261,7 @@ function useMarketFlow(t0) {
|
|
|
248
261
|
hash: approveTxHash,
|
|
249
262
|
chainId,
|
|
250
263
|
onReplaced: (data) => {
|
|
251
|
-
|
|
264
|
+
logger.log("onReplaced:approveTx", approveTxHash, data);
|
|
252
265
|
}
|
|
253
266
|
});
|
|
254
267
|
if (onTxSent) {
|
|
@@ -260,7 +273,7 @@ function useMarketFlow(t0) {
|
|
|
260
273
|
});
|
|
261
274
|
}
|
|
262
275
|
approveTxReceipt = await approveTxReceiptPromise;
|
|
263
|
-
|
|
276
|
+
logger.log("~ approveTx ~ receipt:", approveTxReceipt);
|
|
264
277
|
} else {
|
|
265
278
|
trackedPrice.set.approvedAmount(allowanceToSet);
|
|
266
279
|
signedPermitResult = await signPermitMut.signPermitAsync({
|
|
@@ -307,7 +320,7 @@ function useMarketFlow(t0) {
|
|
|
307
320
|
hash: swapTxHash,
|
|
308
321
|
chainId,
|
|
309
322
|
onReplaced: (data_0) => {
|
|
310
|
-
|
|
323
|
+
logger.log("onReplaced:swapTx", swapTxHash, data_0);
|
|
311
324
|
}
|
|
312
325
|
});
|
|
313
326
|
if (onTxSent) {
|
|
@@ -319,7 +332,7 @@ function useMarketFlow(t0) {
|
|
|
319
332
|
});
|
|
320
333
|
}
|
|
321
334
|
const swapTxReceipt = await swapTxReceiptPromise;
|
|
322
|
-
|
|
335
|
+
logger.log("~ swapTx ~ receipt:", swapTxReceipt);
|
|
323
336
|
return {
|
|
324
337
|
tradeFlowType: "marketSwap",
|
|
325
338
|
approve: {
|
|
@@ -341,72 +354,92 @@ function useMarketFlow(t0) {
|
|
|
341
354
|
throw error_1;
|
|
342
355
|
}
|
|
343
356
|
};
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
357
|
+
$[43] = account;
|
|
358
|
+
$[44] = approval;
|
|
359
|
+
$[45] = approveTxMut;
|
|
360
|
+
$[46] = buildTxMut;
|
|
361
|
+
$[47] = chainId;
|
|
362
|
+
$[48] = clearNonce;
|
|
363
|
+
$[49] = constructGasParams;
|
|
364
|
+
$[50] = ensureTxReceipt;
|
|
365
|
+
$[51] = logger;
|
|
366
|
+
$[52] = markNonceAsUsed;
|
|
367
|
+
$[53] = marketPrice;
|
|
368
|
+
$[54] = partner;
|
|
369
|
+
$[55] = receiverAddress;
|
|
370
|
+
$[56] = resolvedSlippage;
|
|
371
|
+
$[57] = sendSwapTxMut;
|
|
372
|
+
$[58] = signPermit;
|
|
373
|
+
$[59] = signPermitMut;
|
|
374
|
+
$[60] = trackedPrice.get;
|
|
375
|
+
$[61] = trackedPrice.set;
|
|
376
|
+
$[62] = t18;
|
|
363
377
|
} else {
|
|
364
|
-
t18 = $[
|
|
378
|
+
t18 = $[62];
|
|
365
379
|
}
|
|
366
380
|
const submitSwapTx = t18;
|
|
367
381
|
const invalidateTokenData = useInvalidateTokenDataQuery();
|
|
368
382
|
let t19;
|
|
369
|
-
if ($[
|
|
383
|
+
if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
|
|
370
384
|
t19 = [MARKET_SWAP_MUTATION_KEY];
|
|
371
|
-
$[
|
|
385
|
+
$[63] = t19;
|
|
372
386
|
} else {
|
|
373
|
-
t19 = $[
|
|
387
|
+
t19 = $[63];
|
|
374
388
|
}
|
|
375
389
|
let t20;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
390
|
+
let t21;
|
|
391
|
+
if ($[64] !== logger) {
|
|
392
|
+
t20 = (data_1) => {
|
|
393
|
+
logger.log("Swap tx success", data_1);
|
|
394
|
+
};
|
|
395
|
+
t21 = (error_2) => {
|
|
396
|
+
logger.error("Swap tx error", error_2);
|
|
397
|
+
};
|
|
398
|
+
$[64] = logger;
|
|
399
|
+
$[65] = t20;
|
|
400
|
+
$[66] = t21;
|
|
401
|
+
} else {
|
|
402
|
+
t20 = $[65];
|
|
403
|
+
t21 = $[66];
|
|
404
|
+
}
|
|
405
|
+
let t22;
|
|
406
|
+
if ($[67] !== invalidateTokenData || $[68] !== logger || $[69] !== trackedPrice) {
|
|
407
|
+
t22 = () => {
|
|
408
|
+
logger.log("Swap tx settled, invalidating balances and allowances");
|
|
379
409
|
invalidateTokenData({
|
|
380
410
|
nonces: true
|
|
381
411
|
});
|
|
382
412
|
trackedPrice.resetTrackedPrice();
|
|
383
413
|
};
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
414
|
+
$[67] = invalidateTokenData;
|
|
415
|
+
$[68] = logger;
|
|
416
|
+
$[69] = trackedPrice;
|
|
417
|
+
$[70] = t22;
|
|
387
418
|
} else {
|
|
388
|
-
|
|
419
|
+
t22 = $[70];
|
|
389
420
|
}
|
|
390
|
-
let
|
|
391
|
-
if ($[
|
|
392
|
-
|
|
421
|
+
let t23;
|
|
422
|
+
if ($[71] !== submitSwapTx || $[72] !== t20 || $[73] !== t21 || $[74] !== t22) {
|
|
423
|
+
t23 = {
|
|
393
424
|
mutationFn: submitSwapTx,
|
|
394
425
|
mutationKey: t19,
|
|
395
|
-
onSuccess:
|
|
396
|
-
onError:
|
|
397
|
-
onSettled:
|
|
426
|
+
onSuccess: t20,
|
|
427
|
+
onError: t21,
|
|
428
|
+
onSettled: t22
|
|
398
429
|
};
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
430
|
+
$[71] = submitSwapTx;
|
|
431
|
+
$[72] = t20;
|
|
432
|
+
$[73] = t21;
|
|
433
|
+
$[74] = t22;
|
|
434
|
+
$[75] = t23;
|
|
402
435
|
} else {
|
|
403
|
-
|
|
436
|
+
t23 = $[75];
|
|
404
437
|
}
|
|
405
|
-
const marketSwapMut = useMutation(
|
|
438
|
+
const marketSwapMut = useMutation(t23);
|
|
406
439
|
const runMarketSwapFlow = marketSwapMut.mutateAsync;
|
|
407
|
-
let
|
|
408
|
-
if ($[
|
|
409
|
-
|
|
440
|
+
let t24;
|
|
441
|
+
if ($[76] !== approveTxMut || $[77] !== buildTxMut || $[78] !== marketSwapMut || $[79] !== sendSwapTxMut || $[80] !== signPermitMut || $[81] !== trackedPrice) {
|
|
442
|
+
t24 = () => {
|
|
410
443
|
trackedPrice.resetTrackedPrice();
|
|
411
444
|
approveTxMut.reset();
|
|
412
445
|
signPermitMut.reset();
|
|
@@ -414,43 +447,43 @@ function useMarketFlow(t0) {
|
|
|
414
447
|
sendSwapTxMut.reset();
|
|
415
448
|
marketSwapMut.reset();
|
|
416
449
|
};
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
450
|
+
$[76] = approveTxMut;
|
|
451
|
+
$[77] = buildTxMut;
|
|
452
|
+
$[78] = marketSwapMut;
|
|
453
|
+
$[79] = sendSwapTxMut;
|
|
454
|
+
$[80] = signPermitMut;
|
|
455
|
+
$[81] = trackedPrice;
|
|
456
|
+
$[82] = t24;
|
|
424
457
|
} else {
|
|
425
|
-
|
|
458
|
+
t24 = $[82];
|
|
426
459
|
}
|
|
427
|
-
const reset =
|
|
428
|
-
let
|
|
429
|
-
if ($[
|
|
430
|
-
|
|
460
|
+
const reset = t24;
|
|
461
|
+
let t25;
|
|
462
|
+
if ($[83] !== reset || $[84] !== runMarketSwapFlow) {
|
|
463
|
+
t25 = (options) => {
|
|
431
464
|
reset();
|
|
432
465
|
return runMarketSwapFlow(options);
|
|
433
466
|
};
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
467
|
+
$[83] = reset;
|
|
468
|
+
$[84] = runMarketSwapFlow;
|
|
469
|
+
$[85] = t25;
|
|
437
470
|
} else {
|
|
438
|
-
|
|
471
|
+
t25 = $[85];
|
|
439
472
|
}
|
|
440
|
-
const retryFlow =
|
|
441
|
-
let
|
|
442
|
-
if ($[
|
|
443
|
-
|
|
444
|
-
$[
|
|
445
|
-
$[
|
|
446
|
-
$[
|
|
473
|
+
const retryFlow = t25;
|
|
474
|
+
let t26;
|
|
475
|
+
if ($[86] !== marketPrice || $[87] !== trackedPrice.get) {
|
|
476
|
+
t26 = trackedPrice.get.finalPrice() || trackedPrice.get.usingPrice() || marketPrice;
|
|
477
|
+
$[86] = marketPrice;
|
|
478
|
+
$[87] = trackedPrice.get;
|
|
479
|
+
$[88] = t26;
|
|
447
480
|
} else {
|
|
448
|
-
|
|
481
|
+
t26 = $[88];
|
|
449
482
|
}
|
|
450
|
-
const usedPrice =
|
|
451
|
-
let
|
|
452
|
-
if ($[
|
|
453
|
-
|
|
483
|
+
const usedPrice = t26;
|
|
484
|
+
let t27;
|
|
485
|
+
if ($[89] !== approval || $[90] !== buildTxParams || $[91] !== chainId || $[92] !== marketSwapMut.data || $[93] !== marketSwapMut.error || $[94] !== marketSwapMut.isError || $[95] !== marketSwapMut.isPending || $[96] !== marketSwapMut.isSuccess || $[97] !== reset || $[98] !== retryFlow || $[99] !== runMarketSwapFlow || $[100] !== signPermit || $[101] !== swap || $[102] !== usedPrice) {
|
|
486
|
+
t27 = {
|
|
454
487
|
chainId,
|
|
455
488
|
runMarketSwapFlow,
|
|
456
489
|
reset,
|
|
@@ -467,43 +500,25 @@ function useMarketFlow(t0) {
|
|
|
467
500
|
result: marketSwapMut.data,
|
|
468
501
|
usedPrice
|
|
469
502
|
};
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
503
|
+
$[89] = approval;
|
|
504
|
+
$[90] = buildTxParams;
|
|
505
|
+
$[91] = chainId;
|
|
506
|
+
$[92] = marketSwapMut.data;
|
|
507
|
+
$[93] = marketSwapMut.error;
|
|
508
|
+
$[94] = marketSwapMut.isError;
|
|
509
|
+
$[95] = marketSwapMut.isPending;
|
|
510
|
+
$[96] = marketSwapMut.isSuccess;
|
|
511
|
+
$[97] = reset;
|
|
512
|
+
$[98] = retryFlow;
|
|
513
|
+
$[99] = runMarketSwapFlow;
|
|
514
|
+
$[100] = signPermit;
|
|
515
|
+
$[101] = swap;
|
|
516
|
+
$[102] = usedPrice;
|
|
517
|
+
$[103] = t27;
|
|
485
518
|
} else {
|
|
486
|
-
|
|
519
|
+
t27 = $[103];
|
|
487
520
|
}
|
|
488
|
-
return
|
|
489
|
-
}
|
|
490
|
-
function _temp6(error_2) {
|
|
491
|
-
console.error("Swap tx error", error_2);
|
|
492
|
-
}
|
|
493
|
-
function _temp5(data_1) {
|
|
494
|
-
console.log("Swap tx success", data_1);
|
|
495
|
-
}
|
|
496
|
-
function _temp4(error_0) {
|
|
497
|
-
console.error("Swap tx error", error_0);
|
|
498
|
-
}
|
|
499
|
-
function _temp3() {
|
|
500
|
-
console.log("Swap tx success");
|
|
501
|
-
}
|
|
502
|
-
function _temp2(error) {
|
|
503
|
-
console.error("Build tx error", error);
|
|
504
|
-
}
|
|
505
|
-
function _temp() {
|
|
506
|
-
console.log("Build tx success");
|
|
521
|
+
return t27;
|
|
507
522
|
}
|
|
508
523
|
|
|
509
524
|
export { useMarketFlow };
|