@funkit/connect 13.2.0 → 13.3.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.
- package/CHANGELOG.md +48 -0
- package/dist/{chunk-53FF4ZHH.js → chunk-SJ7E3DKC.js} +6 -0
- package/dist/{chunk-2RND3WWH.js → chunk-V4VFNIG4.js} +6 -0
- package/dist/clients/{chunk-44LV4GCX.js → chunk-2INCUCQQ.js} +1 -0
- package/dist/clients/chunk-6JL6PF5P.js +22 -0
- package/dist/clients/chunk-747THMHY.js +185 -0
- package/dist/clients/{chunk-Q4JGDB4L.js → chunk-BMU5EYUJ.js} +8 -24
- package/dist/clients/{chunk-T6YNXIOS.js → chunk-HBW7AZUH.js} +7 -5
- package/dist/clients/{chunk-4LM2J6AX.js → chunk-KDZFZETH.js} +168 -0
- package/dist/clients/{chunk-LNUR7YLW.js → chunk-PVBHWD47.js} +1 -1
- package/dist/clients/chunk-RNTQ7KEL.js +76 -0
- package/dist/clients/{chunk-PNYV3G5M.js → chunk-RTHDOT5K.js} +1 -1
- package/dist/clients/{chunk-3NHG6UYS.js → chunk-SKYQYPX5.js} +58 -2
- package/dist/clients/{chunk-AN6A4SB5.js → chunk-Z6FHIDTD.js} +5 -5
- package/dist/clients/fanatics.css +3136 -2947
- package/dist/clients/fanatics.js +1 -1
- package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.js +12 -77
- package/dist/clients/internal/nado/withdrawalStatus.css +18233 -0
- package/dist/clients/internal/nado/withdrawalStatus.js +218 -20
- package/dist/clients/lighter.css +3519 -2947
- package/dist/clients/lighter.js +5 -7
- package/dist/clients/mallard.d.ts +17 -2
- package/dist/clients/mallard.js +5 -3
- package/dist/clients/nado.js +4 -4
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +4 -3
- package/dist/clients/polymarket/index.js +9 -7
- package/dist/clients/polymarket/polymarket.js +6 -4
- package/dist/components/Box/Box.d.ts +18 -18
- package/dist/components/FunAsset/FunAssetItem.d.ts +3 -1
- package/dist/components/FunBadge/FunBadge.d.ts +1 -1
- package/dist/css/sprinkles.css.d.ts +24 -18
- package/dist/domains/clientMetadata.d.ts +1 -0
- package/dist/hooks/useHostDepositSettlement.d.ts +12 -0
- package/dist/index.css +3519 -2947
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5785 -3876
- package/dist/modals/CheckoutModal/FiatV2/FiatV2Step.d.ts +10 -8
- package/dist/modals/CheckoutModal/FiatV2/fiatV2DepositInputs.d.ts +38 -0
- package/dist/modals/CheckoutModal/FiatV2/useFiatV2DepositInputs.d.ts +6 -0
- package/dist/modals/CheckoutModal/FiatV2/useFiatV2Text.d.ts +7 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +2 -0
- package/dist/modals/CheckoutModal/SourceChange/fiatV2Reroute.d.ts +24 -0
- package/dist/modals/CheckoutModal/SourceChange/useAddCardRow.d.ts +4 -3
- package/dist/modals/CheckoutModal/SourceChange/useFiatV2Entry.d.ts +21 -0
- package/dist/providers/FunSessionContext.d.ts +20 -0
- package/dist/providers/FunkitCheckoutContext/index.d.ts +7 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -0
- package/dist/providers/FunkitProvider.d.ts +7 -0
- package/dist/providers/FunkitThemeProvider.d.ts +9 -0
- package/dist/shadow-css.js +1 -1
- package/dist/themes/darkTheme.js +1 -1
- package/dist/themes/lightTheme.js +1 -1
- package/dist/utils/localStorageFunSessionStorage.d.ts +9 -0
- package/dist/v2/components/PrimaryButton.css.d.ts +5 -0
- package/dist/v2/components/PrimaryButton.d.ts +16 -0
- package/dist/v2/components/Sheet.css.d.ts +13 -0
- package/dist/v2/components/Sheet.d.ts +23 -0
- package/dist/v2/components/Spinner.css.d.ts +2 -0
- package/dist/v2/components/Spinner.d.ts +6 -0
- package/dist/v2/flows/fiat/FiatDepositGate.d.ts +20 -0
- package/dist/v2/flows/fiat/FiatScreenPicker.d.ts +37 -0
- package/dist/v2/flows/funLogin/FunLoginScreenPicker.d.ts +30 -0
- package/dist/v2/screens/amount/AmountDisplay.css.d.ts +5 -0
- package/dist/v2/screens/amount/AmountDisplay.d.ts +15 -0
- package/dist/v2/screens/amount/AmountScreen.css.d.ts +2 -0
- package/dist/v2/screens/amount/AmountScreen.d.ts +37 -0
- package/dist/v2/screens/amount/PresetButton.css.d.ts +1 -0
- package/dist/v2/screens/amount/PresetButton.d.ts +9 -0
- package/dist/v2/screens/amount/fittedText/useFittedText.d.ts +19 -0
- package/dist/v2/screens/amount/fittedText/useIsomorphicEffect.d.ts +2 -0
- package/dist/v2/screens/amount/fittedText/useTextMeasurer.d.ts +3 -0
- package/dist/v2/screens/amount/typedAmount/amountText.d.ts +37 -0
- package/dist/v2/screens/amount/typedAmount/attachInputNormalization.d.ts +1 -0
- package/dist/v2/screens/funLogin/FunLoginCodeScreen.d.ts +35 -0
- package/dist/v2/screens/funLogin/FunLoginEmailScreen.d.ts +26 -0
- package/dist/v2/screens/funLogin/FunLoginScreen.css.d.ts +20 -0
- package/dist/v2/screens/funLogin/looksLikeEmail.d.ts +5 -0
- package/dist/v2/theme/colors.d.ts +28 -0
- package/dist/v2/theme/fonts.d.ts +9 -0
- package/dist/v2/theme/radii.d.ts +6 -0
- package/dist/wallets/walletConnectors/index.js +39 -39
- package/package.json +4 -4
- package/dist/clients/chunk-JXTKKLVA.js +0 -185
- package/dist/clients/chunk-PZSKO3BJ.js +0 -60
- package/dist/components/FunPayments/icons/coinbase.d.ts +0 -5
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "../../chunk-6JL6PF5P.js";
|
|
3
|
+
import "../../chunk-RNTQ7KEL.js";
|
|
2
4
|
import {
|
|
3
5
|
useFunkitConfig
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-SKYQYPX5.js";
|
|
7
|
+
import "../../chunk-RTHDOT5K.js";
|
|
8
|
+
import {
|
|
9
|
+
PaymentMethod
|
|
10
|
+
} from "../../chunk-2INCUCQQ.js";
|
|
11
|
+
import "../../chunk-LICTGZXW.js";
|
|
6
12
|
import {
|
|
7
13
|
useAccount
|
|
8
14
|
} from "../../chunk-2W2P3OS6.js";
|
|
9
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-KDZFZETH.js";
|
|
10
16
|
import {
|
|
11
17
|
logger
|
|
12
18
|
} from "../../chunk-B67ESBGC.js";
|
|
13
19
|
|
|
14
20
|
// src/clients/internal/nado/withdrawalStatus.ts
|
|
15
21
|
import {
|
|
16
|
-
getCompletionTxInfo,
|
|
17
|
-
resolveOnChainCompletionTxHash,
|
|
22
|
+
getCompletionTxInfo as getCompletionTxInfo2,
|
|
23
|
+
resolveOnChainCompletionTxHash as resolveOnChainCompletionTxHash2,
|
|
18
24
|
useDirectExecutionForDepositAddress,
|
|
19
25
|
useLogOnce
|
|
20
26
|
} from "@funkit/connect-core";
|
|
21
|
-
import { useEffect, useMemo, useState } from "react";
|
|
27
|
+
import { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
|
|
22
28
|
|
|
23
29
|
// src/hooks/useCheckoutDirectExecutionHistory.ts
|
|
24
30
|
import {
|
|
25
31
|
CheckoutRefundState,
|
|
26
|
-
CheckoutState,
|
|
27
|
-
RelayExecutionStatus
|
|
32
|
+
CheckoutState as CheckoutState2,
|
|
33
|
+
RelayExecutionStatus as RelayExecutionStatus2
|
|
28
34
|
} from "@funkit/api-base";
|
|
29
35
|
import { mapRelayExecutionStatusToCheckoutState } from "@funkit/connect-core";
|
|
30
36
|
|
|
@@ -34,6 +40,42 @@ function isAcrossRoute(metadata) {
|
|
|
34
40
|
return !!metadata?.across?.enabled;
|
|
35
41
|
}
|
|
36
42
|
|
|
43
|
+
// src/hooks/useHostDepositSettlement.ts
|
|
44
|
+
import {
|
|
45
|
+
CheckoutState,
|
|
46
|
+
RelayExecutionStatus
|
|
47
|
+
} from "@funkit/api-base";
|
|
48
|
+
import {
|
|
49
|
+
getCompletionTxInfo,
|
|
50
|
+
resolveOnChainCompletionTxHash
|
|
51
|
+
} from "@funkit/connect-core";
|
|
52
|
+
import { skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
53
|
+
|
|
54
|
+
// src/providers/FunkitCheckoutContext/index.tsx
|
|
55
|
+
import {
|
|
56
|
+
DirectExecutionType,
|
|
57
|
+
createDirectExecution,
|
|
58
|
+
deactivateCheckout as postApiDeactivateCheckout,
|
|
59
|
+
initializeCheckout as postApiInitializeCheckout
|
|
60
|
+
} from "@funkit/api-base";
|
|
61
|
+
import {
|
|
62
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO,
|
|
63
|
+
SOLANA_MAINNET_CHAIN_ID
|
|
64
|
+
} from "@funkit/chains";
|
|
65
|
+
import { getCheckoutTokenTransferParams } from "@funkit/connect-core";
|
|
66
|
+
import { isAddressEquivalent, isNotNullish } from "@funkit/utils";
|
|
67
|
+
import React, {
|
|
68
|
+
createContext,
|
|
69
|
+
useCallback,
|
|
70
|
+
useContext,
|
|
71
|
+
useEffect,
|
|
72
|
+
useMemo,
|
|
73
|
+
useRef,
|
|
74
|
+
useState
|
|
75
|
+
} from "react";
|
|
76
|
+
import { flushSync } from "react-dom";
|
|
77
|
+
import { v4 as uuid } from "uuid";
|
|
78
|
+
|
|
37
79
|
// src/hooks/useDirectExecutionInfoPolling.ts
|
|
38
80
|
import {
|
|
39
81
|
getDirectExecutionByTxHash
|
|
@@ -84,10 +126,165 @@ function useDirectExecutionInfoPolling({
|
|
|
84
126
|
};
|
|
85
127
|
}
|
|
86
128
|
|
|
129
|
+
// src/providers/FunkitCheckoutContext/index.tsx
|
|
130
|
+
var FunkitCheckoutContext = createContext({
|
|
131
|
+
checkoutItem: null,
|
|
132
|
+
getCheckoutProgress: () => void 0,
|
|
133
|
+
setCheckoutProgress: () => void 0,
|
|
134
|
+
initNewCheckout: () => "",
|
|
135
|
+
updateModalTitleMeta: () => void 0,
|
|
136
|
+
updatePolymarketPerpsTransferPending: () => void 0,
|
|
137
|
+
updateSourceAsset: () => void 0,
|
|
138
|
+
updateTargetAsset: () => void 0,
|
|
139
|
+
updateTargetAssetAmount: () => void 0,
|
|
140
|
+
updateSelectedPaymentMethodInfo: () => void 0,
|
|
141
|
+
updateCustomRecipient: () => void 0,
|
|
142
|
+
confirmCheckout: () => Promise.resolve({ depositAddress: "0x" }),
|
|
143
|
+
cancelCheckout: () => Promise.resolve(false),
|
|
144
|
+
updateActiveCheckout: () => void 0,
|
|
145
|
+
setCheckout: () => void 0,
|
|
146
|
+
setCompletedTimestamp: () => void 0,
|
|
147
|
+
withdrawalItem: null,
|
|
148
|
+
initNewWithdrawal: () => "",
|
|
149
|
+
updateWithdrawalSourceAssetAmount: () => void 0,
|
|
150
|
+
resetForNewWithdrawal: () => void 0,
|
|
151
|
+
resetForNewDeposit: () => void 0,
|
|
152
|
+
convertActiveCheckoutToWithdrawal: () => void 0,
|
|
153
|
+
revertActiveCheckoutFromWithdrawal: () => void 0,
|
|
154
|
+
applyDynamicRouting: () => void 0,
|
|
155
|
+
updateDynamicRoutingId: () => void 0,
|
|
156
|
+
applyDynamicTargetAssetCandidate: () => void 0
|
|
157
|
+
});
|
|
158
|
+
function useCheckoutContext() {
|
|
159
|
+
return useContext(FunkitCheckoutContext);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/hooks/useHostDepositSettlement.ts
|
|
163
|
+
var HOST_SETTLEMENT_TIMEOUT_MS = 15e3;
|
|
164
|
+
var ACCEPTED_HOST_SETTLEMENT = {
|
|
165
|
+
state: CheckoutState.COMPLETED,
|
|
166
|
+
message: void 0
|
|
167
|
+
};
|
|
168
|
+
function getHostDepositSettlementContext(directExecution, signal) {
|
|
169
|
+
const completionTxInfo = getCompletionTxInfo(directExecution);
|
|
170
|
+
const destinationTxId = resolveOnChainCompletionTxHash(
|
|
171
|
+
directExecution,
|
|
172
|
+
completionTxInfo.txHash
|
|
173
|
+
);
|
|
174
|
+
return {
|
|
175
|
+
checkoutId: directExecution.clientMetadata.id,
|
|
176
|
+
dynamicRoutingId: directExecution.clientMetadata.initSettings.config.dynamicRoutingId,
|
|
177
|
+
destination: {
|
|
178
|
+
chainId: directExecution.toChainId,
|
|
179
|
+
tokenAddress: directExecution.toTokenAddress,
|
|
180
|
+
walletAddress: directExecution.recipientAddr
|
|
181
|
+
},
|
|
182
|
+
sourceTransactions: directExecution.listenerInfo?.inTxHashes.map((txId) => ({
|
|
183
|
+
chainId: directExecution.fromChainId,
|
|
184
|
+
txId
|
|
185
|
+
})) ?? [],
|
|
186
|
+
destinationTransactions: destinationTxId ? (
|
|
187
|
+
// The chain comes with the hash: a LayerZero delivery lands on a chain
|
|
188
|
+
// other than the record's `toChainId`.
|
|
189
|
+
[{ chainId: completionTxInfo.chainId, txId: destinationTxId }]
|
|
190
|
+
) : [],
|
|
191
|
+
signal
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
async function requestHostDepositSettlement({
|
|
195
|
+
directExecution,
|
|
196
|
+
onDepositSettlement,
|
|
197
|
+
signal
|
|
198
|
+
}) {
|
|
199
|
+
const hostAbortController = new AbortController();
|
|
200
|
+
const abortHost = () => hostAbortController.abort();
|
|
201
|
+
signal.addEventListener("abort", abortHost);
|
|
202
|
+
const timer = setTimeout(abortHost, HOST_SETTLEMENT_TIMEOUT_MS);
|
|
203
|
+
const logProps = {
|
|
204
|
+
checkoutId: directExecution.clientMetadata.id,
|
|
205
|
+
txHash: directExecution.txHash
|
|
206
|
+
};
|
|
207
|
+
logger.info("hostDepositSettlement:start", logProps);
|
|
208
|
+
try {
|
|
209
|
+
const response = await Promise.race([
|
|
210
|
+
onDepositSettlement(
|
|
211
|
+
getHostDepositSettlementContext(
|
|
212
|
+
directExecution,
|
|
213
|
+
hostAbortController.signal
|
|
214
|
+
)
|
|
215
|
+
),
|
|
216
|
+
new Promise(
|
|
217
|
+
(resolve) => hostAbortController.signal.addEventListener(
|
|
218
|
+
"abort",
|
|
219
|
+
() => resolve(void 0)
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
]);
|
|
223
|
+
if (signal.aborted) {
|
|
224
|
+
logger.info("hostDepositSettlement:closed", logProps);
|
|
225
|
+
return ACCEPTED_HOST_SETTLEMENT;
|
|
226
|
+
}
|
|
227
|
+
if (hostAbortController.signal.aborted) {
|
|
228
|
+
logger.warn("hostDepositSettlement:timedOut", logProps);
|
|
229
|
+
return ACCEPTED_HOST_SETTLEMENT;
|
|
230
|
+
}
|
|
231
|
+
if (response?.type !== "error") {
|
|
232
|
+
logger.info("hostDepositSettlement:accepted", logProps);
|
|
233
|
+
return ACCEPTED_HOST_SETTLEMENT;
|
|
234
|
+
}
|
|
235
|
+
const message = String(response.message ?? "").trim() || void 0;
|
|
236
|
+
logger.info("hostDepositSettlement:rejected", {
|
|
237
|
+
...logProps,
|
|
238
|
+
hasMessage: !!message
|
|
239
|
+
});
|
|
240
|
+
return { state: CheckoutState.CHECKOUT_ERROR, message };
|
|
241
|
+
} catch (error) {
|
|
242
|
+
logger.warn("hostDepositSettlement:hostThrew", {
|
|
243
|
+
...logProps,
|
|
244
|
+
error: error instanceof Error ? error.message : String(error)
|
|
245
|
+
});
|
|
246
|
+
return ACCEPTED_HOST_SETTLEMENT;
|
|
247
|
+
} finally {
|
|
248
|
+
clearTimeout(timer);
|
|
249
|
+
signal.removeEventListener("abort", abortHost);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function useHostDepositSettlement(directExecution) {
|
|
253
|
+
const { checkoutItem } = useCheckoutContext();
|
|
254
|
+
const onDepositSettlement = checkoutItem?.initSettings.config.onDepositSettlement;
|
|
255
|
+
const isHostCheckDue = !!onDepositSettlement && !!directExecution && directExecution.clientMetadata.id === checkoutItem?.id && directExecution.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === PaymentMethod.ACCOUNT_BALANCE && !directExecution.clientMetadata.isWithdrawal && !directExecution.isIntermediaryPhase && directExecution.listenerInfo?.status === RelayExecutionStatus.SUCCESS;
|
|
256
|
+
const { data: hostSettlement } = useQuery2({
|
|
257
|
+
queryKey: ["hostDepositSettlement", directExecution?.clientMetadata.id],
|
|
258
|
+
queryFn: isHostCheckDue ? ({ client, queryKey, signal }) => (
|
|
259
|
+
// The host app shares this query client. When it invalidates every
|
|
260
|
+
// query, this one runs again, so an answer already held is returned
|
|
261
|
+
// and the host is not asked a second time.
|
|
262
|
+
client.getQueryData(queryKey) ?? requestHostDepositSettlement({
|
|
263
|
+
directExecution,
|
|
264
|
+
onDepositSettlement,
|
|
265
|
+
signal
|
|
266
|
+
})
|
|
267
|
+
) : skipToken,
|
|
268
|
+
// An answer is final: the host is never asked twice for one deposit.
|
|
269
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
270
|
+
gcTime: Number.POSITIVE_INFINITY,
|
|
271
|
+
retry: false,
|
|
272
|
+
refetchOnWindowFocus: false,
|
|
273
|
+
refetchOnReconnect: false
|
|
274
|
+
});
|
|
275
|
+
if (!isHostCheckDue) {
|
|
276
|
+
return void 0;
|
|
277
|
+
}
|
|
278
|
+
return hostSettlement ?? {
|
|
279
|
+
state: CheckoutState.PENDING_RECEIVAL,
|
|
280
|
+
message: void 0
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
87
284
|
// src/hooks/useCheckoutDirectExecutionHistory.ts
|
|
88
285
|
function mapRelayExecutionStatusToRefundState(status) {
|
|
89
286
|
switch (status) {
|
|
90
|
-
case
|
|
287
|
+
case RelayExecutionStatus2.REFUND:
|
|
91
288
|
return CheckoutRefundState.REFUNDED;
|
|
92
289
|
default:
|
|
93
290
|
return void 0;
|
|
@@ -101,21 +298,22 @@ function useCheckoutDirectExecutionHistory({
|
|
|
101
298
|
initDirectExecution,
|
|
102
299
|
disabled
|
|
103
300
|
});
|
|
104
|
-
const status = directExecution?.listenerInfo?.status ??
|
|
301
|
+
const status = directExecution?.listenerInfo?.status ?? RelayExecutionStatus2.PENDING;
|
|
105
302
|
const latestQuote = directExecution?.clientMetadata.latestQuote;
|
|
106
|
-
const
|
|
303
|
+
const hostDepositSettlement = useHostDepositSettlement(directExecution);
|
|
304
|
+
const state = hostDepositSettlement?.state ?? mapRelayExecutionStatusToCheckoutState(status);
|
|
107
305
|
const refundState = mapRelayExecutionStatusToRefundState(status);
|
|
108
|
-
const isDelayed = status ===
|
|
306
|
+
const isDelayed = status === RelayExecutionStatus2.DELAYED;
|
|
109
307
|
return {
|
|
110
308
|
state,
|
|
111
309
|
refundState,
|
|
112
310
|
isAcross: isAcrossRoute(latestQuote?.baseQuote.metadata),
|
|
113
311
|
isLayerZero: latestQuote && !!latestQuote.baseQuote.metadata?.oftEnabled,
|
|
114
312
|
isRefunded: refundState === CheckoutRefundState.REFUNDED,
|
|
115
|
-
isCompleted: state ===
|
|
116
|
-
isFailed: state ===
|
|
313
|
+
isCompleted: state === CheckoutState2.COMPLETED,
|
|
314
|
+
isFailed: state === CheckoutState2.CHECKOUT_ERROR,
|
|
117
315
|
isDelayed,
|
|
118
|
-
isProcessing: state ===
|
|
316
|
+
isProcessing: state === CheckoutState2.PENDING_RECEIVAL,
|
|
119
317
|
directExecution
|
|
120
318
|
};
|
|
121
319
|
}
|
|
@@ -127,7 +325,7 @@ function useNadoWithdrawalStatus({
|
|
|
127
325
|
}) {
|
|
128
326
|
const { apiKey } = useFunkitConfig();
|
|
129
327
|
const { address: walletAddress } = useAccount();
|
|
130
|
-
const [hasSettled, setHasSettled] =
|
|
328
|
+
const [hasSettled, setHasSettled] = useState2(false);
|
|
131
329
|
const { latestStep, isFinalStep } = useDirectExecutionForDepositAddress({
|
|
132
330
|
depositAddress,
|
|
133
331
|
apiKey,
|
|
@@ -144,7 +342,7 @@ function useNadoWithdrawalStatus({
|
|
|
144
342
|
isCompleted: isCompleted && isFinalStep,
|
|
145
343
|
isFailed
|
|
146
344
|
});
|
|
147
|
-
|
|
345
|
+
useEffect2(() => {
|
|
148
346
|
if (status !== "pending") {
|
|
149
347
|
setHasSettled(true);
|
|
150
348
|
}
|
|
@@ -157,12 +355,12 @@ function useNadoWithdrawalStatus({
|
|
|
157
355
|
relayStatus: latestStep?.listenerInfo?.status
|
|
158
356
|
});
|
|
159
357
|
});
|
|
160
|
-
const completionTx =
|
|
358
|
+
const completionTx = useMemo2(() => {
|
|
161
359
|
if (status !== "completed" || !latestStep) {
|
|
162
360
|
return void 0;
|
|
163
361
|
}
|
|
164
|
-
const { chainId, txHash, customRedirectUrl } =
|
|
165
|
-
const onChainTxHash =
|
|
362
|
+
const { chainId, txHash, customRedirectUrl } = getCompletionTxInfo2(latestStep);
|
|
363
|
+
const onChainTxHash = resolveOnChainCompletionTxHash2(latestStep, txHash);
|
|
166
364
|
return onChainTxHash ? { chainId, txHash: onChainTxHash, customRedirectUrl } : void 0;
|
|
167
365
|
}, [status, latestStep]);
|
|
168
366
|
return { status, completionTx };
|