@funkit/connect 7.0.3-next.1 → 7.1.0-next.2
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 +28 -0
- package/dist/__generated__/default_configs.d.ts +0 -18
- package/dist/components/Dropdown/TokenAndChainDropdown.css.d.ts +1 -0
- package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +1 -1
- package/dist/domains/asset.d.ts +2 -2
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +1 -2
- package/dist/hooks/useBluvo.d.ts +0 -1
- package/dist/hooks/useIsDynamicRoutingEnabled.d.ts +4 -0
- package/dist/index.css +7 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +307 -191
- package/dist/modals/CheckoutModal/FunCheckoutModal.d.ts +3 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +13 -0
- package/dist/providers/ModalContext.d.ts +7 -0
- package/dist/utils/customer.d.ts +0 -4
- package/dist/utils/flags/config.d.ts +3 -3
- package/dist/utils/lighter.d.ts +1 -1
- package/dist/wallets/walletConnectors/index.js +10 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 7.1.0-next.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fa6cb1f: Add soft-close feature for checkout modal when transaction is in progress
|
|
8
|
+
|
|
9
|
+
- When a transaction is in progress (checkoutProgress.step >= 1), the close button now hides the modal instead of closing it, preserving state
|
|
10
|
+
- Added `useSoftHiddenCheckout` hook for managing soft-hidden checkout state
|
|
11
|
+
- Added internal `onCheckoutConflict` handler to resolve conflicts when `beginCheckout` is called while a checkout is soft-hidden
|
|
12
|
+
- Extended `FunkitCheckoutOnCloseResult` with optional `isSoftHidden` field
|
|
13
|
+
- Added `MODAL_SOFT_HIDDEN` analytics event
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 13a6a7b: feat(connect): hide min amount from supported chain label on xs viewport
|
|
18
|
+
- 923b998: Fix RemoveScroll to not block scrolling when dialog is hidden
|
|
19
|
+
- 1e7f994: feat(connect): update lighter time to 2min
|
|
20
|
+
- cf4f7ba: fix(connect): disable is same asset check for wallet flow if dynamicRoutingId is provided
|
|
21
|
+
- 17dd504: fix(connect): relax withMoonpayMeldQuote error logs
|
|
22
|
+
- 0ad5896: fix withdraw amount is NaN
|
|
23
|
+
- b09006f: add lighter chain to destination
|
|
24
|
+
- 8b8d030: feat(connect,api-base): pass api key to bluvo requests to frog
|
|
25
|
+
- 0b85676: feat(connect): token transfer ui - default to arbitrum chain for lighter
|
|
26
|
+
- Updated dependencies [e009c8d]
|
|
27
|
+
- Updated dependencies [8b8d030]
|
|
28
|
+
- @funkit/fun-relay@2.1.16-next.2
|
|
29
|
+
- @funkit/api-base@1.12.22-next.1
|
|
30
|
+
|
|
3
31
|
## 7.0.3-next.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -177,15 +177,6 @@ declare const _default: {
|
|
|
177
177
|
readonly targetAssetTicker: "ETH (Spot)";
|
|
178
178
|
readonly iconSrc: "https://sdk-cdn.fun.xyz/images/eth.svg";
|
|
179
179
|
};
|
|
180
|
-
}, {
|
|
181
|
-
readonly dynamicRoutingId: "LIGHTER_ETH_SPOT_NEW_USER";
|
|
182
|
-
readonly params: {
|
|
183
|
-
readonly targetChain: "1";
|
|
184
|
-
readonly targetAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
185
|
-
readonly targetAssetTicker: "USDC (Perps)";
|
|
186
|
-
readonly iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg";
|
|
187
|
-
readonly qrcodeActionType: "LIGHTER_USDC_DEPOSIT";
|
|
188
|
-
};
|
|
189
180
|
}, {
|
|
190
181
|
readonly dynamicRoutingId: "LIGHTER_USDC_PERPS";
|
|
191
182
|
readonly params: {
|
|
@@ -194,15 +185,6 @@ declare const _default: {
|
|
|
194
185
|
readonly targetAssetTicker: "USDC (Perps)";
|
|
195
186
|
readonly iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg";
|
|
196
187
|
};
|
|
197
|
-
}, {
|
|
198
|
-
readonly dynamicRoutingId: "LIGHTER_USDC_PERPS_NEW_USER";
|
|
199
|
-
readonly params: {
|
|
200
|
-
readonly targetChain: "1";
|
|
201
|
-
readonly targetAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
202
|
-
readonly targetAssetTicker: "USDC (Perps)";
|
|
203
|
-
readonly iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg";
|
|
204
|
-
readonly qrcodeActionType: "LIGHTER_USDC_DEPOSIT";
|
|
205
|
-
};
|
|
206
188
|
}];
|
|
207
189
|
};
|
|
208
190
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const hideOnXsmallScreenSize: string;
|
|
@@ -9,5 +9,5 @@ interface PaymentAmountSummaryProps {
|
|
|
9
9
|
quote: FunkitCheckoutQuoteResult | null;
|
|
10
10
|
directExecutionType?: DirectExecutionType | null;
|
|
11
11
|
}
|
|
12
|
-
export declare function PaymentAmountSummary({ isLoading, targetChainId, quote, checkoutItem, directExecutionType, }: PaymentAmountSummaryProps): React.JSX.Element;
|
|
12
|
+
export declare function PaymentAmountSummary({ isLoading, targetChainId: originalChainId, quote, checkoutItem, directExecutionType, }: PaymentAmountSummaryProps): React.JSX.Element;
|
|
13
13
|
export {};
|
package/dist/domains/asset.d.ts
CHANGED
|
@@ -19,10 +19,10 @@ interface AssetUsableToPayParms {
|
|
|
19
19
|
assetUsdAmount: number | null;
|
|
20
20
|
isAllowedForCheckout: boolean;
|
|
21
21
|
minUsdRequired?: number;
|
|
22
|
-
|
|
22
|
+
isDynamicRoutingEnabled: boolean;
|
|
23
23
|
t: TFunction;
|
|
24
24
|
}
|
|
25
|
-
export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired,
|
|
25
|
+
export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired, isDynamicRoutingEnabled, t, }: AssetUsableToPayParms) => {
|
|
26
26
|
isUsable: boolean;
|
|
27
27
|
reason: string;
|
|
28
28
|
minUsdRequired?: number;
|
|
@@ -2,7 +2,6 @@ import type { Address } from 'viem';
|
|
|
2
2
|
import { type FunkitWithdrawalConfig } from '~/providers/FunkitCheckoutContext';
|
|
3
3
|
interface CheckoutQuoteParams {
|
|
4
4
|
recipientAddress: string;
|
|
5
|
-
sourceAmount: number;
|
|
6
5
|
chainId: string;
|
|
7
6
|
symbol: string;
|
|
8
7
|
targetAsset: Address | undefined;
|
|
@@ -11,7 +10,7 @@ interface CheckoutQuoteParams {
|
|
|
11
10
|
/**
|
|
12
11
|
* Simplified quoting logic used for withdrawal UI only.
|
|
13
12
|
*/
|
|
14
|
-
export declare function useWithdrawalQuote({ recipientAddress,
|
|
13
|
+
export declare function useWithdrawalQuote({ recipientAddress, chainId, symbol, targetAsset, config, }: CheckoutQuoteParams): {
|
|
15
14
|
quoteEnabled: boolean;
|
|
16
15
|
isInstantQuoting: boolean;
|
|
17
16
|
data: {
|
package/dist/hooks/useBluvo.d.ts
CHANGED
package/dist/index.css
CHANGED
|
@@ -10024,6 +10024,13 @@
|
|
|
10024
10024
|
opacity: 0.5;
|
|
10025
10025
|
}
|
|
10026
10026
|
|
|
10027
|
+
/* vanilla-extract-css-ns:src/components/Dropdown/TokenAndChainDropdown.css.ts.vanilla.css?source=QG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogNDMwcHgpIHsKICAuXzZ5ZDR0MjAgewogICAgZGlzcGxheTogbm9uZTsKICB9Cn0= */
|
|
10028
|
+
@media screen and (max-width: 430px) {
|
|
10029
|
+
[data-rk] ._6yd4t20 {
|
|
10030
|
+
display: none;
|
|
10031
|
+
}
|
|
10032
|
+
}
|
|
10033
|
+
|
|
10027
10034
|
/* vanilla-extract-css-ns:src/components/FunBadge/FunBadge.css.ts.vanilla.css?source=QGtleWZyYW1lcyBiYzJ1enkwIHsKICAwJSB7CiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoLTIwMCUpOwogIH0KICAzNSUsIDEwMCUgewogICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKDIwMCUpOwogIH0KfQouYmMydXp5MSB7CiAgZGlzcGxheTogZmxleDsKICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjsKICBhbGlnbi1pdGVtczogY2VudGVyOwogIHdpZHRoOiBmaXQtY29udGVudDsKICB3aGl0ZS1zcGFjZTogbm93cmFwOwp9Ci5iYzJ1enkyIHsKICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgb3ZlcmZsb3c6IGhpZGRlbjsKfQouYmMydXp5Mjo6YmVmb3JlIHsKICBjb250ZW50OiAiIjsKICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgaW5zZXQ6IDA7CiAgZGlzcGxheTogYmxvY2s7CiAgd2lkdGg6IDEwMCU7CiAgaGVpZ2h0OiAxMDAlOwogIGJhY2tncm91bmQ6IGxpbmVhci1ncmFkaWVudCg5MGRlZywgdHJhbnNwYXJlbnQgMzAlLCB3aGl0ZSA0NSUsIHdoaXRlIDU1JSwgdHJhbnNwYXJlbnQgNzAlKSBuby1yZXBlYXQ7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKC0yMDAlKTsKICBiYWNrZ3JvdW5kLXNpemU6IDIwMCUgMTAwJTsKICBvcGFjaXR5OiAwLjk7CiAgZmlsdGVyOiBibHVyKDJweCk7CiAgYW5pbWF0aW9uOiBiYzJ1enkwIDVzIGxpbmVhciBpbmZpbml0ZSAxczsKICBtaXgtYmxlbmQtbW9kZTogc29mdC1saWdodDsKfQ== */
|
|
10028
10035
|
@keyframes bc2uzy0 {
|
|
10029
10036
|
0% {
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { AuthenticationConfig, AuthenticationStatus, } from './providers/Au
|
|
|
19
19
|
export { createAuthenticationAdapter, FunkitConnectAuthenticationProvider, } from './providers/AuthenticationContext';
|
|
20
20
|
export type { AuthenticationAdapter, FunkitConnectAuthenticationProviderProps, } from './providers/AuthenticationContext';
|
|
21
21
|
export type { AvatarComponent } from './providers/AvatarContext';
|
|
22
|
-
export type { FunkitCheckoutActionParams, FunkitCheckoutConfig, FunkitWithdrawalConfig, UseFunkitCheckoutPropsWithFullConfig, UseFunkitCheckoutProps, FunkitCheckoutValidationResult, FunkitCheckoutResult, DynamicTargetAssetCandidate, TokenInfo, } from './providers/FunkitCheckoutContext';
|
|
22
|
+
export type { FunkitCheckoutActionParams, FunkitCheckoutConfig, FunkitCheckoutOnCloseResult, FunkitWithdrawalConfig, UseFunkitCheckoutPropsWithFullConfig, UseFunkitCheckoutProps, FunkitCheckoutValidationResult, FunkitCheckoutResult, DynamicTargetAssetCandidate, TokenInfo, } from './providers/FunkitCheckoutContext';
|
|
23
23
|
export { useFunkitCheckout, FunCheckoutStartingStep, } from './providers/FunkitCheckoutContext';
|
|
24
24
|
export type { FunkitCheckoutQuoteResult } from './domains/quote';
|
|
25
25
|
export type { FunkitConfig } from './providers/FunkitConfigContext';
|
|
@@ -31,7 +31,7 @@ export { FunkitProvider } from './providers/FunkitProvider';
|
|
|
31
31
|
export type { Theme, ThemeSet } from './providers/FunkitThemeProvider';
|
|
32
32
|
export { useActiveTheme } from './providers/FunkitThemeProvider';
|
|
33
33
|
export { useFunkitUserInfo } from './providers/GeneralWalletProvider';
|
|
34
|
-
export { useAccountModal, useChainModal, useConnectModal, } from './providers/ModalContext';
|
|
34
|
+
export { useAccountModal, useChainModal, useConnectModal, useSoftHiddenCheckout, } from './providers/ModalContext';
|
|
35
35
|
export type { FunkitUserInfo } from './consts/funkit';
|
|
36
36
|
export { systemFontStack, type ThemeOptions } from './themes/baseTheme';
|
|
37
37
|
export { darkTheme } from './themes/darkTheme';
|
package/dist/index.js
CHANGED
|
@@ -1076,6 +1076,61 @@ import React234, {
|
|
|
1076
1076
|
import { flushSync } from "react-dom";
|
|
1077
1077
|
import { v4 as uuid2 } from "uuid";
|
|
1078
1078
|
|
|
1079
|
+
// src/consts/customers.ts
|
|
1080
|
+
import {
|
|
1081
|
+
AVANTIS_API_KEY,
|
|
1082
|
+
BANKR_API_KEY,
|
|
1083
|
+
BASED_API_KEY,
|
|
1084
|
+
BSX_API_KEY,
|
|
1085
|
+
ETHEREAL_API_KEY,
|
|
1086
|
+
HYENA_API_KEY,
|
|
1087
|
+
HYPERBEAT_API_KEY,
|
|
1088
|
+
HYPERDASH_API_KEY,
|
|
1089
|
+
KATANA_API_KEY,
|
|
1090
|
+
LIGHTERXYZ_API_KEY,
|
|
1091
|
+
MONAD_API_KEY,
|
|
1092
|
+
MONKEY_TILT_API_KEY,
|
|
1093
|
+
OSTIUM_API_KEY,
|
|
1094
|
+
PERPL_API_KEY,
|
|
1095
|
+
POLYMARKET_API_KEY
|
|
1096
|
+
} from "@funkit/api-base";
|
|
1097
|
+
import { mainnet as mainnet4 } from "viem/chains";
|
|
1098
|
+
function isPolymarketCustomer(apiKey) {
|
|
1099
|
+
return apiKey === POLYMARKET_API_KEY;
|
|
1100
|
+
}
|
|
1101
|
+
function isOstiumCustomer(apiKey) {
|
|
1102
|
+
return apiKey === OSTIUM_API_KEY;
|
|
1103
|
+
}
|
|
1104
|
+
function isBankrCustomer(apiKey) {
|
|
1105
|
+
return apiKey === BANKR_API_KEY;
|
|
1106
|
+
}
|
|
1107
|
+
function isEtherealCustomer(apiKey) {
|
|
1108
|
+
return apiKey === ETHEREAL_API_KEY;
|
|
1109
|
+
}
|
|
1110
|
+
function isKatanaCustomer(apiKey) {
|
|
1111
|
+
return apiKey === KATANA_API_KEY;
|
|
1112
|
+
}
|
|
1113
|
+
function isMonadCustomer(apiKey) {
|
|
1114
|
+
return apiKey === MONAD_API_KEY;
|
|
1115
|
+
}
|
|
1116
|
+
function isBasedCustomer(apiKey) {
|
|
1117
|
+
return apiKey === BASED_API_KEY;
|
|
1118
|
+
}
|
|
1119
|
+
function isHyenaCustomer(apiKey) {
|
|
1120
|
+
return apiKey === HYENA_API_KEY;
|
|
1121
|
+
}
|
|
1122
|
+
function isLighterxyzCustomer(apiKey) {
|
|
1123
|
+
return apiKey === LIGHTERXYZ_API_KEY;
|
|
1124
|
+
}
|
|
1125
|
+
function isLighterEthSpot(apiKey, checkoutConfig) {
|
|
1126
|
+
return checkoutConfig && isLighterxyzCustomer(apiKey) && ["LIGHTER_ETH_SPOT_NEW_USER", "LIGHTER_ETH_SPOT"].includes(
|
|
1127
|
+
checkoutConfig.dynamicRoutingId || ""
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
function isLighterNativeFlow(apiKey, checkoutConfig) {
|
|
1131
|
+
return !!checkoutConfig && isLighterxyzCustomer(apiKey) && checkoutConfig.targetChain === mainnet4.id.toString();
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1079
1134
|
// src/domains/checkoutRecipient.ts
|
|
1080
1135
|
function getCheckoutRecipient({
|
|
1081
1136
|
walletAddress,
|
|
@@ -1089,7 +1144,7 @@ function getCheckoutRecipient({
|
|
|
1089
1144
|
import { exhaustiveCheck, formatAddress } from "@funkit/utils";
|
|
1090
1145
|
|
|
1091
1146
|
// src/consts/bluvo.tsx
|
|
1092
|
-
import { ETHEREAL_API_KEY } from "@funkit/api-base";
|
|
1147
|
+
import { ETHEREAL_API_KEY as ETHEREAL_API_KEY2 } from "@funkit/api-base";
|
|
1093
1148
|
import React16 from "react";
|
|
1094
1149
|
|
|
1095
1150
|
// src/components/Icons/BinanceIcon.tsx
|
|
@@ -1205,7 +1260,7 @@ var KrakenIcon = ({ size = 24 }) => {
|
|
|
1205
1260
|
|
|
1206
1261
|
// src/consts/bluvo.tsx
|
|
1207
1262
|
var BLUVO_MIN_DEPOSIT_BY_CUSTOMER = {
|
|
1208
|
-
[
|
|
1263
|
+
[ETHEREAL_API_KEY2]: 15
|
|
1209
1264
|
};
|
|
1210
1265
|
var SUPPORTED_EXCHANGES = [
|
|
1211
1266
|
{ exchange: "coinbase" /* Coinbase */, status: "live" /* Live */ },
|
|
@@ -1377,7 +1432,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
1377
1432
|
localStorage.setItem(storageKey, version);
|
|
1378
1433
|
}
|
|
1379
1434
|
function getCurrentSdkVersion() {
|
|
1380
|
-
return "7.0
|
|
1435
|
+
return "7.1.0-next.2";
|
|
1381
1436
|
}
|
|
1382
1437
|
function useFingerprint() {
|
|
1383
1438
|
const fingerprint = useCallback3(() => {
|
|
@@ -1782,63 +1837,6 @@ import {
|
|
|
1782
1837
|
|
|
1783
1838
|
// src/utils/customer.ts
|
|
1784
1839
|
import { useQuery } from "@tanstack/react-query";
|
|
1785
|
-
|
|
1786
|
-
// src/consts/customers.ts
|
|
1787
|
-
import {
|
|
1788
|
-
AVANTIS_API_KEY,
|
|
1789
|
-
BANKR_API_KEY,
|
|
1790
|
-
BASED_API_KEY,
|
|
1791
|
-
BSX_API_KEY,
|
|
1792
|
-
ETHEREAL_API_KEY as ETHEREAL_API_KEY2,
|
|
1793
|
-
HYENA_API_KEY,
|
|
1794
|
-
HYPERBEAT_API_KEY,
|
|
1795
|
-
HYPERDASH_API_KEY,
|
|
1796
|
-
KATANA_API_KEY,
|
|
1797
|
-
LIGHTERXYZ_API_KEY,
|
|
1798
|
-
MONAD_API_KEY,
|
|
1799
|
-
MONKEY_TILT_API_KEY,
|
|
1800
|
-
OSTIUM_API_KEY,
|
|
1801
|
-
PERPL_API_KEY,
|
|
1802
|
-
POLYMARKET_API_KEY
|
|
1803
|
-
} from "@funkit/api-base";
|
|
1804
|
-
import { mainnet as mainnet4 } from "viem/chains";
|
|
1805
|
-
function isPolymarketCustomer(apiKey) {
|
|
1806
|
-
return apiKey === POLYMARKET_API_KEY;
|
|
1807
|
-
}
|
|
1808
|
-
function isOstiumCustomer(apiKey) {
|
|
1809
|
-
return apiKey === OSTIUM_API_KEY;
|
|
1810
|
-
}
|
|
1811
|
-
function isBankrCustomer(apiKey) {
|
|
1812
|
-
return apiKey === BANKR_API_KEY;
|
|
1813
|
-
}
|
|
1814
|
-
function isEtherealCustomer(apiKey) {
|
|
1815
|
-
return apiKey === ETHEREAL_API_KEY2;
|
|
1816
|
-
}
|
|
1817
|
-
function isKatanaCustomer(apiKey) {
|
|
1818
|
-
return apiKey === KATANA_API_KEY;
|
|
1819
|
-
}
|
|
1820
|
-
function isMonadCustomer(apiKey) {
|
|
1821
|
-
return apiKey === MONAD_API_KEY;
|
|
1822
|
-
}
|
|
1823
|
-
function isBasedCustomer(apiKey) {
|
|
1824
|
-
return apiKey === BASED_API_KEY;
|
|
1825
|
-
}
|
|
1826
|
-
function isHyenaCustomer(apiKey) {
|
|
1827
|
-
return apiKey === HYENA_API_KEY;
|
|
1828
|
-
}
|
|
1829
|
-
function isLighterxyzCustomer(apiKey) {
|
|
1830
|
-
return apiKey === LIGHTERXYZ_API_KEY;
|
|
1831
|
-
}
|
|
1832
|
-
function isLighterEthSpot(apiKey, checkoutConfig) {
|
|
1833
|
-
return checkoutConfig && isLighterxyzCustomer(apiKey) && ["LIGHTER_ETH_SPOT_NEW_USER", "LIGHTER_ETH_SPOT"].includes(
|
|
1834
|
-
checkoutConfig.dynamicRoutingId || ""
|
|
1835
|
-
);
|
|
1836
|
-
}
|
|
1837
|
-
function isLighterNativeFlow(apiKey, checkoutConfig) {
|
|
1838
|
-
return !!checkoutConfig && isLighterxyzCustomer(apiKey) && checkoutConfig.targetChain === mainnet4.id.toString();
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
// src/utils/customer.ts
|
|
1842
1840
|
function isKatanaEarnFlow({
|
|
1843
1841
|
apiKey,
|
|
1844
1842
|
checkoutConfig
|
|
@@ -1876,19 +1874,6 @@ function useLighterAccounts({
|
|
|
1876
1874
|
subAccounts: query.data?.sub_accounts
|
|
1877
1875
|
};
|
|
1878
1876
|
}
|
|
1879
|
-
function useLighterNativeFlowNeeded(apiKey, checkoutConfig) {
|
|
1880
|
-
const { walletAddress } = useGeneralWallet();
|
|
1881
|
-
const isLighter = isLighterxyzCustomer(apiKey);
|
|
1882
|
-
const { mainAccountIndex, isLoading } = useLighterAccounts({
|
|
1883
|
-
address: walletAddress || "0x",
|
|
1884
|
-
isEnabled: isLighter && !!walletAddress && walletAddress !== "0x"
|
|
1885
|
-
});
|
|
1886
|
-
const lighterNativeNeeded = checkoutConfig && isLighter && mainAccountIndex === void 0 && checkoutConfig.qrcodeActionType === "LIGHTER_ETH_SPOT_DEPOSIT";
|
|
1887
|
-
return {
|
|
1888
|
-
isLoading,
|
|
1889
|
-
lighterNativeNeeded
|
|
1890
|
-
};
|
|
1891
|
-
}
|
|
1892
1877
|
|
|
1893
1878
|
// src/utils/funkitProvider.ts
|
|
1894
1879
|
function getInitialChainIdFromFunkitProviderProps(props) {
|
|
@@ -2272,6 +2257,7 @@ import {
|
|
|
2272
2257
|
HYPEREDGE_API_KEY,
|
|
2273
2258
|
HYPERSWAP_API_KEY,
|
|
2274
2259
|
KATANA_API_KEY as KATANA_API_KEY2,
|
|
2260
|
+
LIGHTERXYZ_API_KEY as LIGHTERXYZ_API_KEY2,
|
|
2275
2261
|
MEGAPOT_API_KEY,
|
|
2276
2262
|
MONAD_API_KEY as MONAD_API_KEY2,
|
|
2277
2263
|
OSTIUM_API_KEY as OSTIUM_API_KEY2,
|
|
@@ -2613,7 +2599,7 @@ var flagConfig = {
|
|
|
2613
2599
|
{
|
|
2614
2600
|
key: "apiKey",
|
|
2615
2601
|
type: "isAnyOf",
|
|
2616
|
-
values: [OSTIUM_API_KEY2, ETHEREAL_API_KEY3]
|
|
2602
|
+
values: [OSTIUM_API_KEY2, ETHEREAL_API_KEY3, LIGHTERXYZ_API_KEY2]
|
|
2617
2603
|
}
|
|
2618
2604
|
],
|
|
2619
2605
|
value: arbitrum.id.toString()
|
|
@@ -2802,6 +2788,7 @@ var flagConfig = {
|
|
|
2802
2788
|
HYPEREDGE_API_KEY,
|
|
2803
2789
|
HYPERSWAP_API_KEY,
|
|
2804
2790
|
MEGAPOT_API_KEY,
|
|
2791
|
+
LIGHTERXYZ_API_KEY2,
|
|
2805
2792
|
MONAD_API_KEY2,
|
|
2806
2793
|
OSTIUM_API_KEY2,
|
|
2807
2794
|
PERPL_API_KEY2,
|
|
@@ -2846,6 +2833,7 @@ var flagConfig = {
|
|
|
2846
2833
|
HYPERBEAT_API_KEY2,
|
|
2847
2834
|
HYPEREDGE_API_KEY,
|
|
2848
2835
|
HYPERSWAP_API_KEY,
|
|
2836
|
+
LIGHTERXYZ_API_KEY2,
|
|
2849
2837
|
MEGAPOT_API_KEY,
|
|
2850
2838
|
MONAD_API_KEY2,
|
|
2851
2839
|
OSTIUM_API_KEY2,
|
|
@@ -3634,6 +3622,15 @@ import { lighterChain } from "@funkit/chains";
|
|
|
3634
3622
|
import { FlagKey as FlagKey4 } from "@funkit/utils";
|
|
3635
3623
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
3636
3624
|
|
|
3625
|
+
// src/hooks/useIsDynamicRoutingEnabled.ts
|
|
3626
|
+
var useIsDynamicRoutingEnabled = ({
|
|
3627
|
+
checkoutConfig: _checkoutConfig
|
|
3628
|
+
} = {}) => {
|
|
3629
|
+
const { checkoutItem } = useCheckoutContext();
|
|
3630
|
+
const checkoutConfig = _checkoutConfig || checkoutItem?.initSettings.config;
|
|
3631
|
+
return checkoutConfig?.dynamicRoutingId !== void 0;
|
|
3632
|
+
};
|
|
3633
|
+
|
|
3637
3634
|
// src/hooks/useUDAParams.ts
|
|
3638
3635
|
import { useMemo as useMemo12 } from "react";
|
|
3639
3636
|
|
|
@@ -3864,16 +3861,6 @@ var default_configs_default = {
|
|
|
3864
3861
|
iconSrc: "https://sdk-cdn.fun.xyz/images/eth.svg"
|
|
3865
3862
|
}
|
|
3866
3863
|
},
|
|
3867
|
-
{
|
|
3868
|
-
dynamicRoutingId: "LIGHTER_ETH_SPOT_NEW_USER",
|
|
3869
|
-
params: {
|
|
3870
|
-
targetChain: "1",
|
|
3871
|
-
targetAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
3872
|
-
targetAssetTicker: "USDC (Perps)",
|
|
3873
|
-
iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg",
|
|
3874
|
-
qrcodeActionType: "LIGHTER_USDC_DEPOSIT"
|
|
3875
|
-
}
|
|
3876
|
-
},
|
|
3877
3864
|
{
|
|
3878
3865
|
dynamicRoutingId: "LIGHTER_USDC_PERPS",
|
|
3879
3866
|
params: {
|
|
@@ -3882,16 +3869,6 @@ var default_configs_default = {
|
|
|
3882
3869
|
targetAssetTicker: "USDC (Perps)",
|
|
3883
3870
|
iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg"
|
|
3884
3871
|
}
|
|
3885
|
-
},
|
|
3886
|
-
{
|
|
3887
|
-
dynamicRoutingId: "LIGHTER_USDC_PERPS_NEW_USER",
|
|
3888
|
-
params: {
|
|
3889
|
-
targetChain: "1",
|
|
3890
|
-
targetAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
3891
|
-
targetAssetTicker: "USDC (Perps)",
|
|
3892
|
-
iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg",
|
|
3893
|
-
qrcodeActionType: "LIGHTER_USDC_DEPOSIT"
|
|
3894
|
-
}
|
|
3895
3872
|
}
|
|
3896
3873
|
]
|
|
3897
3874
|
}
|
|
@@ -3988,12 +3965,14 @@ function useIsQRCodeTransferEnabled() {
|
|
|
3988
3965
|
const { checkoutItem } = useCheckoutContext();
|
|
3989
3966
|
const isQrCodeEnabled = useFlag(FlagKey4.EnableTokenTransfer, false);
|
|
3990
3967
|
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
3968
|
+
const isDynamicRoutingEnabled = useIsDynamicRoutingEnabled({
|
|
3969
|
+
checkoutConfig
|
|
3970
|
+
});
|
|
3991
3971
|
const udaParams = useUDAParams();
|
|
3992
3972
|
if (!isQrCodeEnabled) {
|
|
3993
3973
|
return false;
|
|
3994
3974
|
}
|
|
3995
|
-
|
|
3996
|
-
if (dynamicRoutingId) {
|
|
3975
|
+
if (isDynamicRoutingEnabled) {
|
|
3997
3976
|
return !!udaParams;
|
|
3998
3977
|
}
|
|
3999
3978
|
return true;
|
|
@@ -4616,7 +4595,7 @@ import { getAddress } from "viem";
|
|
|
4616
4595
|
var LIGHTER_DEPOSIT_ADDRESS = getAddress(
|
|
4617
4596
|
"0x3b4d794a66304f130a4db8f2551b0070dfcf5ca7"
|
|
4618
4597
|
);
|
|
4619
|
-
var LIGHTER_NATIVE_FLOW_TIME_ESTIMATE_SECONDS =
|
|
4598
|
+
var LIGHTER_NATIVE_FLOW_TIME_ESTIMATE_SECONDS = 60 * 2;
|
|
4620
4599
|
var LIGHTER_DELAYED_AUTO_TRIGGER_CUTOFF = 60 * 5;
|
|
4621
4600
|
|
|
4622
4601
|
// src/components/FunCheckoutHistory/FunCheckoutStatus.tsx
|
|
@@ -7294,7 +7273,7 @@ function Dialog({
|
|
|
7294
7273
|
return null;
|
|
7295
7274
|
}
|
|
7296
7275
|
return createPortal(
|
|
7297
|
-
/* @__PURE__ */ React45.createElement(AnimatePresence2, null, open && /* @__PURE__ */ React45.createElement(RemoveScroll, { enabled:
|
|
7276
|
+
/* @__PURE__ */ React45.createElement(AnimatePresence2, null, open && /* @__PURE__ */ React45.createElement(RemoveScroll, { enabled: !isHidden, allowPinchZoom: true }, /* @__PURE__ */ React45.createElement(
|
|
7298
7277
|
Box,
|
|
7299
7278
|
{
|
|
7300
7279
|
...themeRootProps,
|
|
@@ -8816,6 +8795,9 @@ var ChainDropdown = ({
|
|
|
8816
8795
|
);
|
|
8817
8796
|
};
|
|
8818
8797
|
|
|
8798
|
+
// src/components/Dropdown/TokenAndChainDropdown.css.ts
|
|
8799
|
+
var hideOnXsmallScreenSize = "_6yd4t20";
|
|
8800
|
+
|
|
8819
8801
|
// src/components/Dropdown/TokenDropdown.tsx
|
|
8820
8802
|
import { FlagKey as FlagKey7 } from "@funkit/utils";
|
|
8821
8803
|
import React61, { useState as useState19 } from "react";
|
|
@@ -9097,6 +9079,7 @@ var TokenAndChainDropdown = ({
|
|
|
9097
9079
|
hideNewTokenBadge
|
|
9098
9080
|
}) => {
|
|
9099
9081
|
const { t } = useFunkitTranslation();
|
|
9082
|
+
const { apiKey } = useFunkitConfig();
|
|
9100
9083
|
const finalTokenLabel = tokenLabel ?? t("transferToken.supportedToken");
|
|
9101
9084
|
const finalChainLabel = chainLabel ?? t("transferToken.supportedChain");
|
|
9102
9085
|
return /* @__PURE__ */ React62.createElement(
|
|
@@ -9131,7 +9114,18 @@ var TokenAndChainDropdown = ({
|
|
|
9131
9114
|
gap: "4"
|
|
9132
9115
|
},
|
|
9133
9116
|
/* @__PURE__ */ React62.createElement(Text, { size: "12", weight: "medium", testId: "chain-selector-label" }, finalChainLabel),
|
|
9134
|
-
|
|
9117
|
+
/* @__PURE__ */ React62.createElement(
|
|
9118
|
+
Box,
|
|
9119
|
+
{
|
|
9120
|
+
display: {
|
|
9121
|
+
// PM ui breaks at <768px
|
|
9122
|
+
smallScreen: isPolymarketCustomer(apiKey) ? "none" : "block",
|
|
9123
|
+
largeScreen: "block"
|
|
9124
|
+
},
|
|
9125
|
+
className: hideOnXsmallScreenSize
|
|
9126
|
+
},
|
|
9127
|
+
chainLabelAddon
|
|
9128
|
+
)
|
|
9135
9129
|
), /* @__PURE__ */ React62.createElement(
|
|
9136
9130
|
ChainDropdown,
|
|
9137
9131
|
{
|
|
@@ -10487,7 +10481,6 @@ function isAddressCompatibleWithChain(address, chainId) {
|
|
|
10487
10481
|
var QUOTE_REFRESH_INTERVAL_MS = 25e3;
|
|
10488
10482
|
function useWithdrawalQuote({
|
|
10489
10483
|
recipientAddress,
|
|
10490
|
-
sourceAmount,
|
|
10491
10484
|
chainId,
|
|
10492
10485
|
symbol,
|
|
10493
10486
|
targetAsset,
|
|
@@ -10508,13 +10501,12 @@ function useWithdrawalQuote({
|
|
|
10508
10501
|
recipientAddress,
|
|
10509
10502
|
Number(chainId)
|
|
10510
10503
|
);
|
|
10511
|
-
const enabled = !!apiKey && !!targetAsset && !!
|
|
10504
|
+
const enabled = !!apiKey && !!targetAsset && !!checkoutItem?.sourceAssetAmount && !!recipientAddress && !!chainId && !!symbol && !!isValidAddress && !!checkoutItem;
|
|
10512
10505
|
const { logEvent } = useTrack();
|
|
10513
10506
|
const query = useQuery7({
|
|
10514
10507
|
queryKey: [
|
|
10515
10508
|
"withdrawal",
|
|
10516
10509
|
"quote",
|
|
10517
|
-
sourceAmount,
|
|
10518
10510
|
targetAsset,
|
|
10519
10511
|
recipientAddress,
|
|
10520
10512
|
chainId,
|
|
@@ -10523,7 +10515,7 @@ function useWithdrawalQuote({
|
|
|
10523
10515
|
withdrawalWalletAddress
|
|
10524
10516
|
],
|
|
10525
10517
|
queryFn: async () => {
|
|
10526
|
-
if (!apiKey || !targetAsset
|
|
10518
|
+
if (!apiKey || !targetAsset) {
|
|
10527
10519
|
return null;
|
|
10528
10520
|
}
|
|
10529
10521
|
const directExecutionInfo = getWithdrawalDirectExecution();
|
|
@@ -10544,7 +10536,7 @@ function useWithdrawalQuote({
|
|
|
10544
10536
|
recipientAddress,
|
|
10545
10537
|
chainId,
|
|
10546
10538
|
tokenSymbol: symbol,
|
|
10547
|
-
sourceAmountUSD:
|
|
10539
|
+
sourceAmountUSD: checkoutItem?.sourceAssetAmount,
|
|
10548
10540
|
targetAsset,
|
|
10549
10541
|
withdrawalWalletAddress
|
|
10550
10542
|
});
|
|
@@ -11634,6 +11626,7 @@ var FunkitBrokerageProvider = ({
|
|
|
11634
11626
|
const minTransferRef = useRef14(useMinTransferLimits());
|
|
11635
11627
|
const ORG_ID = isSandboxMode ? STAGE_ORG_ID : PROD_ORG_ID;
|
|
11636
11628
|
const PROJECT_ID = isSandboxMode ? STAGE_PROJECT_ID : PROD_PROJECT_ID;
|
|
11629
|
+
const apiBaseConfig = { apiKey, logger };
|
|
11637
11630
|
const [authConnections, setAuthConnections] = useState23(
|
|
11638
11631
|
{}
|
|
11639
11632
|
);
|
|
@@ -11641,15 +11634,21 @@ var FunkitBrokerageProvider = ({
|
|
|
11641
11634
|
const bluvoClient = useBluvoFlow({
|
|
11642
11635
|
orgId: ORG_ID,
|
|
11643
11636
|
projectId: PROJECT_ID,
|
|
11644
|
-
listExchangesFn: (status) => bluvoListExchanges({ status
|
|
11645
|
-
fetchWithdrawableBalanceFn: (id) => bluvoGetWithdrawableBalanceById({ id,
|
|
11637
|
+
listExchangesFn: (status = "live") => bluvoListExchanges({ status, ...apiBaseConfig }),
|
|
11638
|
+
fetchWithdrawableBalanceFn: (id) => bluvoGetWithdrawableBalanceById({ id, ...apiBaseConfig }),
|
|
11646
11639
|
pingWalletByIdFn: () => {
|
|
11647
11640
|
throw new Error("Not implemented");
|
|
11648
11641
|
},
|
|
11649
|
-
requestQuotationFn: (id, params) => bluvoRequestQuotation({ id, params,
|
|
11650
|
-
executeWithdrawalFn: (id, idempotencyKey, quoteId, params) => bluvoExecuteWithdrawal({
|
|
11642
|
+
requestQuotationFn: (id, params) => bluvoRequestQuotation({ id, params, ...apiBaseConfig }),
|
|
11643
|
+
executeWithdrawalFn: (id, idempotencyKey, quoteId, params) => bluvoExecuteWithdrawal({
|
|
11644
|
+
id,
|
|
11645
|
+
idempotencyKey,
|
|
11646
|
+
quoteId,
|
|
11647
|
+
params,
|
|
11648
|
+
...apiBaseConfig
|
|
11649
|
+
}),
|
|
11651
11650
|
onWalletConnectedFn: (id, exchange) => handleOnWalletConnected(id, exchange),
|
|
11652
|
-
getWalletByIdFn: (id) => bluvoGetWalletById({ id,
|
|
11651
|
+
getWalletByIdFn: (id) => bluvoGetWalletById({ id, ...apiBaseConfig }),
|
|
11653
11652
|
options: {
|
|
11654
11653
|
customDomain: "bluvo.fun.xyz",
|
|
11655
11654
|
autoRefreshQuotation: false
|
|
@@ -11737,6 +11736,7 @@ var useBluvoExchangeBalance = ({
|
|
|
11737
11736
|
exchange,
|
|
11738
11737
|
refetchOnMount = false
|
|
11739
11738
|
}) => {
|
|
11739
|
+
const { apiKey } = useFunkitConfig();
|
|
11740
11740
|
const { checkoutItem } = useCheckoutContext();
|
|
11741
11741
|
const { authorizedConnections, purgeAuthConnectedExchange } = useFunkitBrokerageContext();
|
|
11742
11742
|
const deviceId = exchange && authorizedConnections?.[exchange] || "";
|
|
@@ -11750,7 +11750,8 @@ var useBluvoExchangeBalance = ({
|
|
|
11750
11750
|
}
|
|
11751
11751
|
const response = await bluvoGetWithdrawableBalanceById2({
|
|
11752
11752
|
id: deviceId,
|
|
11753
|
-
logger
|
|
11753
|
+
logger,
|
|
11754
|
+
apiKey
|
|
11754
11755
|
});
|
|
11755
11756
|
if (response.error && response.error.type === "WALLET_NOT_FOUND") {
|
|
11756
11757
|
purgeAuthConnectedExchange(exchange);
|
|
@@ -12747,7 +12748,6 @@ var WithdrawContent = ({
|
|
|
12747
12748
|
} = useWithdrawalQuote({
|
|
12748
12749
|
config,
|
|
12749
12750
|
recipientAddress,
|
|
12750
|
-
sourceAmount: Number(debouncedUSD),
|
|
12751
12751
|
chainId: selectedChainId.toString(),
|
|
12752
12752
|
symbol: selectedToken,
|
|
12753
12753
|
targetAsset: targetAssetInfo?.address
|
|
@@ -20224,6 +20224,7 @@ function BrokerageTwoFA({
|
|
|
20224
20224
|
setModalState
|
|
20225
20225
|
}) {
|
|
20226
20226
|
const { t } = useFunkitTranslation();
|
|
20227
|
+
const { apiKey } = useFunkitConfig();
|
|
20227
20228
|
const { bluvoClient, exchangeType } = useBluvo();
|
|
20228
20229
|
const { getBluvoCheckoutQuote } = useBluvoCheckoutQuote();
|
|
20229
20230
|
const requiresValid2FAMethod = bluvoClient?.requiresValid2FAMethod;
|
|
@@ -20338,7 +20339,8 @@ function BrokerageTwoFA({
|
|
|
20338
20339
|
quoteId,
|
|
20339
20340
|
params: {
|
|
20340
20341
|
twofa: finalOtpInput
|
|
20341
|
-
}
|
|
20342
|
+
},
|
|
20343
|
+
apiKey
|
|
20342
20344
|
});
|
|
20343
20345
|
logger.info(`${logPrefix2}handleEnterTwoFactor:submit2FAResponse`, {
|
|
20344
20346
|
response: _response
|
|
@@ -20392,7 +20394,8 @@ function BrokerageTwoFA({
|
|
|
20392
20394
|
id: walletId,
|
|
20393
20395
|
idempotencyKey: uuidv4(),
|
|
20394
20396
|
quoteId: quote.id,
|
|
20395
|
-
params: {}
|
|
20397
|
+
params: {},
|
|
20398
|
+
apiKey
|
|
20396
20399
|
});
|
|
20397
20400
|
if (newResponse.success && newResponse.data?.type?.startsWith("WITHDRAWAL_2FA_REQUIRED")) {
|
|
20398
20401
|
return await handleEnterTwoFactor(
|
|
@@ -21218,6 +21221,7 @@ import {
|
|
|
21218
21221
|
import NumberFlow from "@number-flow/react";
|
|
21219
21222
|
import { motion as motion9 } from "motion/react";
|
|
21220
21223
|
import React147, { useMemo as useMemo32 } from "react";
|
|
21224
|
+
import { LIGHTER_CHAIN_ID } from "@funkit/chains";
|
|
21221
21225
|
|
|
21222
21226
|
// src/consts/design.ts
|
|
21223
21227
|
var mapFontLineHeightToNumberFlowHeight = {
|
|
@@ -21327,11 +21331,13 @@ function FunAssetAvatar({
|
|
|
21327
21331
|
// src/components/FunTransactionSummary/PaymentAmountSummary.tsx
|
|
21328
21332
|
function PaymentAmountSummary({
|
|
21329
21333
|
isLoading,
|
|
21330
|
-
targetChainId,
|
|
21334
|
+
targetChainId: originalChainId,
|
|
21331
21335
|
quote,
|
|
21332
21336
|
checkoutItem,
|
|
21333
21337
|
directExecutionType = null
|
|
21334
21338
|
}) {
|
|
21339
|
+
const { apiKey } = useFunkitConfig();
|
|
21340
|
+
const targetChainId = isLighterxyzCustomer(apiKey) ? String(LIGHTER_CHAIN_ID) : originalChainId;
|
|
21335
21341
|
const { textCustomizations, uiCustomizations } = useFunkitConfig();
|
|
21336
21342
|
const paymentMethod = checkoutItem?.selectedPaymentMethodInfo?.paymentMethod;
|
|
21337
21343
|
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
@@ -23949,6 +23955,7 @@ var SourcePaymentMethodItem = ({
|
|
|
23949
23955
|
};
|
|
23950
23956
|
|
|
23951
23957
|
// src/components/YouPayYouReceive/YouPayYouReceive.tsx
|
|
23958
|
+
import { LIGHTER_CHAIN_ID as LIGHTER_CHAIN_ID2 } from "@funkit/chains";
|
|
23952
23959
|
import { isMobile as isMobile5 } from "@funkit/utils";
|
|
23953
23960
|
import React164 from "react";
|
|
23954
23961
|
|
|
@@ -23994,6 +24001,8 @@ var YouPayYouReceive = ({
|
|
|
23994
24001
|
prioritizeDefaults = true,
|
|
23995
24002
|
isYouPayChainIconHidden
|
|
23996
24003
|
}) => {
|
|
24004
|
+
const { apiKey } = useFunkitConfig();
|
|
24005
|
+
const patchedReceiveChainId = isLighterxyzCustomer(apiKey) ? LIGHTER_CHAIN_ID2 : receiveTokenChainId;
|
|
23997
24006
|
return /* @__PURE__ */ React164.createElement(
|
|
23998
24007
|
Box,
|
|
23999
24008
|
{
|
|
@@ -24083,7 +24092,7 @@ var YouPayYouReceive = ({
|
|
|
24083
24092
|
assetTicker: receiveTokenSymbol,
|
|
24084
24093
|
assetName: receiveTokenSymbol,
|
|
24085
24094
|
assetSrc: receiveTokenIconSrc,
|
|
24086
|
-
chainId:
|
|
24095
|
+
chainId: patchedReceiveChainId,
|
|
24087
24096
|
prioritizeDefaults
|
|
24088
24097
|
}
|
|
24089
24098
|
), /* @__PURE__ */ React164.createElement(Box, { display: "flex", flexDirection: "column" }, /* @__PURE__ */ React164.createElement(Text, { size: "10", color: "youPayYouReceiveSecondaryText" }, receiveLabel), /* @__PURE__ */ React164.createElement(Text, { size: "12", color: "youPayYouReceivePrimaryText" }, receiveTokenSymbol)))
|
|
@@ -25177,9 +25186,14 @@ function createMoonpayMeldQuote(quote) {
|
|
|
25177
25186
|
};
|
|
25178
25187
|
}
|
|
25179
25188
|
function withMoonpayMeldQuote(quotes) {
|
|
25180
|
-
if (!quotes
|
|
25181
|
-
|
|
25182
|
-
|
|
25189
|
+
if (!quotes) {
|
|
25190
|
+
return quotes;
|
|
25191
|
+
}
|
|
25192
|
+
if (quotes.length === 0) {
|
|
25193
|
+
logger.error("withMoonpayMeldQuote:error", {
|
|
25194
|
+
message: "No quotes could be found."
|
|
25195
|
+
});
|
|
25196
|
+
return quotes;
|
|
25183
25197
|
}
|
|
25184
25198
|
const topQuote = quotes[0];
|
|
25185
25199
|
const moonpay = createMoonpayMeldQuote(topQuote);
|
|
@@ -26071,7 +26085,7 @@ function InputAmountLoading({
|
|
|
26071
26085
|
icon: /* @__PURE__ */ React172.createElement(SwitchIcon, null),
|
|
26072
26086
|
paddingY: "1",
|
|
26073
26087
|
paddingX: "6",
|
|
26074
|
-
color: { base: "
|
|
26088
|
+
color: { base: "secondaryText" }
|
|
26075
26089
|
},
|
|
26076
26090
|
targetAssetAmount !== void 0 ? /* @__PURE__ */ React172.createElement(Text, { color: "secondaryText", size: "14" }, formatCryptoAndStringify6(
|
|
26077
26091
|
targetAssetAmount,
|
|
@@ -27193,12 +27207,11 @@ function useEnrichedAccountHoldings({
|
|
|
27193
27207
|
accountHoldings,
|
|
27194
27208
|
targetAssetInfo
|
|
27195
27209
|
}) {
|
|
27196
|
-
const { apiKey } = useFunkitConfig();
|
|
27197
27210
|
const { t } = useFunkitTranslation();
|
|
27198
27211
|
const { isAllowed, isLoading } = useAllowedAssets();
|
|
27199
27212
|
const { walletAddress } = useGeneralWallet();
|
|
27200
27213
|
const minTransferLimits = useMinTransferLimits();
|
|
27201
|
-
const
|
|
27214
|
+
const isDynamicRoutingEnabled = useIsDynamicRoutingEnabled();
|
|
27202
27215
|
const enrichedAccountHoldings = useMemo44(() => {
|
|
27203
27216
|
if (!checkoutConfig) {
|
|
27204
27217
|
return [];
|
|
@@ -27224,7 +27237,7 @@ function useEnrichedAccountHoldings({
|
|
|
27224
27237
|
asset.pickedChainId,
|
|
27225
27238
|
asset.tokenAddress
|
|
27226
27239
|
),
|
|
27227
|
-
|
|
27240
|
+
isDynamicRoutingEnabled,
|
|
27228
27241
|
t
|
|
27229
27242
|
});
|
|
27230
27243
|
return { asset, usableForCheckout };
|
|
@@ -27237,10 +27250,10 @@ function useEnrichedAccountHoldings({
|
|
|
27237
27250
|
walletAddress,
|
|
27238
27251
|
targetAssetInfo,
|
|
27239
27252
|
minTransferLimits,
|
|
27240
|
-
|
|
27253
|
+
isDynamicRoutingEnabled,
|
|
27241
27254
|
t
|
|
27242
27255
|
]);
|
|
27243
|
-
return { enrichedAccountHoldings, isLoading
|
|
27256
|
+
return { enrichedAccountHoldings, isLoading };
|
|
27244
27257
|
}
|
|
27245
27258
|
function useAssetOptions({
|
|
27246
27259
|
enrichedAccountHoldings,
|
|
@@ -29840,26 +29853,47 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
|
|
|
29840
29853
|
[logEvent]
|
|
29841
29854
|
);
|
|
29842
29855
|
const { clearCheckoutQuoteMessages } = useCheckoutQuoteNotification();
|
|
29856
|
+
const { getCheckoutProgress } = useCheckoutContext();
|
|
29857
|
+
const { softHide } = useSoftHiddenCheckout();
|
|
29843
29858
|
const onCloseWrapper = useCallback44(
|
|
29844
29859
|
(options) => {
|
|
29845
29860
|
const normalizedIsNewDeposit = !!options?.isNewDeposit;
|
|
29846
|
-
checkoutItem.initSettings.onClose?.({
|
|
29847
|
-
isNewDeposit: normalizedIsNewDeposit
|
|
29848
|
-
});
|
|
29849
29861
|
const metadata = {
|
|
29850
29862
|
checkoutStep: modalState.step,
|
|
29851
29863
|
checkoutId: checkoutItem.id,
|
|
29852
29864
|
checkoutItem,
|
|
29853
29865
|
isNewDeposit: normalizedIsNewDeposit
|
|
29854
29866
|
};
|
|
29855
|
-
|
|
29867
|
+
const checkoutProgress = getCheckoutProgress(checkoutItem.id);
|
|
29868
|
+
const isTransactionInProgress = checkoutProgress && checkoutProgress.step >= 1;
|
|
29869
|
+
const isSoftHidden = isTransactionInProgress && !normalizedIsNewDeposit;
|
|
29870
|
+
checkoutItem.initSettings.onClose?.({
|
|
29871
|
+
isNewDeposit: normalizedIsNewDeposit,
|
|
29872
|
+
isSoftHidden
|
|
29873
|
+
});
|
|
29874
|
+
if (isSoftHidden) {
|
|
29875
|
+
softHide();
|
|
29876
|
+
} else {
|
|
29877
|
+
onClose();
|
|
29878
|
+
}
|
|
29879
|
+
logger.log("closingCheckoutModal", {
|
|
29880
|
+
...metadata,
|
|
29881
|
+
checkoutProgress,
|
|
29882
|
+
isSoftHidden: isTransactionInProgress
|
|
29883
|
+
});
|
|
29856
29884
|
logEvent({
|
|
29857
29885
|
eventName: "fc::modal_closed" /* MODAL_CLOSED */,
|
|
29858
|
-
metadata
|
|
29886
|
+
metadata: { ...metadata, checkoutProgress }
|
|
29859
29887
|
});
|
|
29860
|
-
onClose();
|
|
29861
29888
|
},
|
|
29862
|
-
[
|
|
29889
|
+
[
|
|
29890
|
+
checkoutItem,
|
|
29891
|
+
modalState.step,
|
|
29892
|
+
onClose,
|
|
29893
|
+
logEvent,
|
|
29894
|
+
getCheckoutProgress,
|
|
29895
|
+
softHide
|
|
29896
|
+
]
|
|
29863
29897
|
);
|
|
29864
29898
|
const { animation, animate } = useAnimatedNavigation(void 0);
|
|
29865
29899
|
const [stateHistory, setHistory] = useState65([]);
|
|
@@ -31937,7 +31971,8 @@ function FunCheckoutModalStepComponent(props) {
|
|
|
31937
31971
|
function FunCheckoutModalInner({
|
|
31938
31972
|
checkoutItem,
|
|
31939
31973
|
onClose,
|
|
31940
|
-
open
|
|
31974
|
+
open,
|
|
31975
|
+
isSoftHidden: externalSoftHidden
|
|
31941
31976
|
}) {
|
|
31942
31977
|
const { isUserGeoblocked } = useFunkitUserIp();
|
|
31943
31978
|
const {
|
|
@@ -32022,7 +32057,7 @@ function FunCheckoutModalInner({
|
|
|
32022
32057
|
onClose: onCloseWrapper,
|
|
32023
32058
|
onAnimationComplete: handleAnimationComplete,
|
|
32024
32059
|
titleId: "fun-checkout-modal",
|
|
32025
|
-
isHidden: modalState.isSoftHidden,
|
|
32060
|
+
isHidden: modalState.isSoftHidden || externalSoftHidden,
|
|
32026
32061
|
withoutBottomPadding: modalState.step === "meld_currency_select" /* MELD_CURRENCY_SELECT */,
|
|
32027
32062
|
testId: "checkout-modal"
|
|
32028
32063
|
},
|
|
@@ -32069,7 +32104,11 @@ function FunCheckoutModalInner({
|
|
|
32069
32104
|
))
|
|
32070
32105
|
);
|
|
32071
32106
|
}
|
|
32072
|
-
function FunCheckoutModal({
|
|
32107
|
+
function FunCheckoutModal({
|
|
32108
|
+
onClose,
|
|
32109
|
+
open,
|
|
32110
|
+
isSoftHidden
|
|
32111
|
+
}) {
|
|
32073
32112
|
const { checkoutItem } = useCheckoutContext();
|
|
32074
32113
|
if (!checkoutItem) {
|
|
32075
32114
|
return null;
|
|
@@ -32079,7 +32118,8 @@ function FunCheckoutModal({ onClose, open }) {
|
|
|
32079
32118
|
{
|
|
32080
32119
|
checkoutItem,
|
|
32081
32120
|
onClose,
|
|
32082
|
-
open
|
|
32121
|
+
open,
|
|
32122
|
+
isSoftHidden
|
|
32083
32123
|
}
|
|
32084
32124
|
);
|
|
32085
32125
|
}
|
|
@@ -32159,7 +32199,11 @@ var ModalContext = createContext16({
|
|
|
32159
32199
|
connectModalOpen: false,
|
|
32160
32200
|
isWalletConnectModalOpen: false,
|
|
32161
32201
|
setIsWalletConnectModalOpen: () => void {},
|
|
32162
|
-
funCheckoutModalOpen: false
|
|
32202
|
+
funCheckoutModalOpen: false,
|
|
32203
|
+
softHiddenCheckoutId: null,
|
|
32204
|
+
softHideFunCheckoutModal: () => void {},
|
|
32205
|
+
resumeSoftHiddenCheckout: () => void {},
|
|
32206
|
+
discardSoftHiddenCheckout: () => void {}
|
|
32163
32207
|
});
|
|
32164
32208
|
function ModalProvider({ children }) {
|
|
32165
32209
|
const {
|
|
@@ -32185,6 +32229,22 @@ function ModalProvider({ children }) {
|
|
|
32185
32229
|
openModal: openFunCheckoutModal,
|
|
32186
32230
|
prop: funCheckoutModalId
|
|
32187
32231
|
} = useModalStateValueWithProp();
|
|
32232
|
+
const [softHiddenCheckoutId, setSoftHiddenCheckoutId] = useState73(null);
|
|
32233
|
+
const softHideFunCheckoutModal = useCallback48(() => {
|
|
32234
|
+
if (funCheckoutModalId) {
|
|
32235
|
+
setSoftHiddenCheckoutId(funCheckoutModalId);
|
|
32236
|
+
}
|
|
32237
|
+
closeFunCheckoutModal();
|
|
32238
|
+
}, [funCheckoutModalId, closeFunCheckoutModal]);
|
|
32239
|
+
const resumeSoftHiddenCheckout = useCallback48(() => {
|
|
32240
|
+
if (softHiddenCheckoutId) {
|
|
32241
|
+
openFunCheckoutModal(softHiddenCheckoutId);
|
|
32242
|
+
setSoftHiddenCheckoutId(null);
|
|
32243
|
+
}
|
|
32244
|
+
}, [softHiddenCheckoutId, openFunCheckoutModal]);
|
|
32245
|
+
const discardSoftHiddenCheckout = useCallback48(() => {
|
|
32246
|
+
setSoftHiddenCheckoutId(null);
|
|
32247
|
+
}, []);
|
|
32188
32248
|
const {
|
|
32189
32249
|
closeModal: closeWithdrawalModal,
|
|
32190
32250
|
isModalOpen: withdrawalModalOpen,
|
|
@@ -32229,7 +32289,11 @@ function ModalProvider({ children }) {
|
|
|
32229
32289
|
funCheckoutModalOpen,
|
|
32230
32290
|
funCheckoutModalId,
|
|
32231
32291
|
openFunCheckoutModal,
|
|
32232
|
-
openWithdrawalModal
|
|
32292
|
+
openWithdrawalModal,
|
|
32293
|
+
softHiddenCheckoutId,
|
|
32294
|
+
softHideFunCheckoutModal,
|
|
32295
|
+
resumeSoftHiddenCheckout,
|
|
32296
|
+
discardSoftHiddenCheckout
|
|
32233
32297
|
}),
|
|
32234
32298
|
[
|
|
32235
32299
|
accountModalOpen,
|
|
@@ -32245,7 +32309,11 @@ function ModalProvider({ children }) {
|
|
|
32245
32309
|
funCheckoutModalOpen,
|
|
32246
32310
|
funCheckoutModalId,
|
|
32247
32311
|
openFunCheckoutModal,
|
|
32248
|
-
openWithdrawalModal
|
|
32312
|
+
openWithdrawalModal,
|
|
32313
|
+
softHiddenCheckoutId,
|
|
32314
|
+
softHideFunCheckoutModal,
|
|
32315
|
+
resumeSoftHiddenCheckout,
|
|
32316
|
+
discardSoftHiddenCheckout
|
|
32249
32317
|
]
|
|
32250
32318
|
)
|
|
32251
32319
|
},
|
|
@@ -32264,8 +32332,9 @@ function ModalProvider({ children }) {
|
|
|
32264
32332
|
FunCheckoutModal,
|
|
32265
32333
|
{
|
|
32266
32334
|
onClose: closeFunCheckoutModal,
|
|
32267
|
-
open: funCheckoutModalOpen,
|
|
32268
|
-
|
|
32335
|
+
open: funCheckoutModalOpen || !!softHiddenCheckoutId,
|
|
32336
|
+
isSoftHidden: !!softHiddenCheckoutId,
|
|
32337
|
+
key: softHiddenCheckoutId ?? funCheckoutModalId
|
|
32269
32338
|
}
|
|
32270
32339
|
),
|
|
32271
32340
|
withdrawalModalConfig && /* @__PURE__ */ React233.createElement(
|
|
@@ -32321,6 +32390,21 @@ function useWithdrawalModal() {
|
|
|
32321
32390
|
const { openWithdrawalModal } = useContext16(ModalContext);
|
|
32322
32391
|
return { openWithdrawalModal };
|
|
32323
32392
|
}
|
|
32393
|
+
function useSoftHiddenCheckout() {
|
|
32394
|
+
const {
|
|
32395
|
+
softHiddenCheckoutId,
|
|
32396
|
+
softHideFunCheckoutModal,
|
|
32397
|
+
resumeSoftHiddenCheckout,
|
|
32398
|
+
discardSoftHiddenCheckout
|
|
32399
|
+
} = useContext16(ModalContext);
|
|
32400
|
+
return {
|
|
32401
|
+
hasSoftHiddenCheckout: !!softHiddenCheckoutId,
|
|
32402
|
+
softHiddenCheckoutId,
|
|
32403
|
+
softHide: softHideFunCheckoutModal,
|
|
32404
|
+
resume: resumeSoftHiddenCheckout,
|
|
32405
|
+
discard: discardSoftHiddenCheckout
|
|
32406
|
+
};
|
|
32407
|
+
}
|
|
32324
32408
|
|
|
32325
32409
|
// src/providers/FunkitCheckoutContext/types.ts
|
|
32326
32410
|
var FunCheckoutStartingStep = /* @__PURE__ */ ((FunCheckoutStartingStep2) => {
|
|
@@ -32900,13 +32984,21 @@ function useFunkitCheckout(props) {
|
|
|
32900
32984
|
initNewCheckout,
|
|
32901
32985
|
initNewWithdrawal,
|
|
32902
32986
|
updateSourceAsset,
|
|
32903
|
-
updateSelectedPaymentMethodInfo
|
|
32987
|
+
updateSelectedPaymentMethodInfo,
|
|
32988
|
+
checkoutItem
|
|
32904
32989
|
} = useContext17(FunkitCheckoutContext);
|
|
32905
32990
|
const { openFunCheckoutModal } = useFunCheckoutModal();
|
|
32906
32991
|
const { openWithdrawalModal } = useWithdrawalModal();
|
|
32907
32992
|
const { connectModalOpen, openConnectModal } = useConnectModal();
|
|
32908
32993
|
const { isUserLoggedIn } = useGeneralWallet();
|
|
32909
32994
|
const isCheckoutActivated = useFlag(FlagKey21.IsCheckoutActivated);
|
|
32995
|
+
const { apiKey } = useFunkitConfig();
|
|
32996
|
+
const {
|
|
32997
|
+
hasSoftHiddenCheckout,
|
|
32998
|
+
softHiddenCheckoutId,
|
|
32999
|
+
resume: resumeSoftHiddenCheckout,
|
|
33000
|
+
discard: discardSoftHiddenCheckout
|
|
33001
|
+
} = useSoftHiddenCheckout();
|
|
32910
33002
|
const onErrorWrapper = useCallback49(
|
|
32911
33003
|
(payload) => {
|
|
32912
33004
|
logger.warn(payload.message, payload);
|
|
@@ -32922,6 +33014,53 @@ function useFunkitCheckout(props) {
|
|
|
32922
33014
|
[openFunCheckoutModal, props]
|
|
32923
33015
|
);
|
|
32924
33016
|
const [pendingCheckoutConfig, setPendingCheckoutConfig] = useState74();
|
|
33017
|
+
const onCheckoutConflict = ({
|
|
33018
|
+
newConfig,
|
|
33019
|
+
resume,
|
|
33020
|
+
replace
|
|
33021
|
+
}) => {
|
|
33022
|
+
const lastConfig = checkoutItem?.initSettings.config;
|
|
33023
|
+
if (lastConfig?.targetAsset === newConfig.targetAsset && isLighterxyzCustomer(apiKey)) {
|
|
33024
|
+
resume();
|
|
33025
|
+
return false;
|
|
33026
|
+
}
|
|
33027
|
+
replace();
|
|
33028
|
+
return true;
|
|
33029
|
+
};
|
|
33030
|
+
const maybeUpdateSourceAsset = (config) => {
|
|
33031
|
+
if (config.sourceTokenAddress && config.sourceTokenSymbol && config.sourceChain) {
|
|
33032
|
+
updateSourceAsset({
|
|
33033
|
+
tokenAddress: config.sourceTokenAddress,
|
|
33034
|
+
symbol: config.sourceTokenSymbol,
|
|
33035
|
+
pickedChainId: config.sourceChain,
|
|
33036
|
+
iconSrc: config.iconSrc ?? void 0
|
|
33037
|
+
});
|
|
33038
|
+
}
|
|
33039
|
+
};
|
|
33040
|
+
const isTestnetCheckoutBlocked = (config) => {
|
|
33041
|
+
return isUserLoggedIn && !FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12?.[config.targetChain]?.isMainnet;
|
|
33042
|
+
};
|
|
33043
|
+
const handleLoggedInCheckout = (config, checkoutId) => {
|
|
33044
|
+
setPendingCheckoutConfig(void 0);
|
|
33045
|
+
if (isTestnetCheckoutBlocked(config)) {
|
|
33046
|
+
onErrorWrapper?.({
|
|
33047
|
+
type: "error",
|
|
33048
|
+
message: "Unable to begin a new checkout: Insufficient funds on testnet account",
|
|
33049
|
+
metadata: {}
|
|
33050
|
+
});
|
|
33051
|
+
return false;
|
|
33052
|
+
}
|
|
33053
|
+
onOpenWrapper?.(checkoutId);
|
|
33054
|
+
return true;
|
|
33055
|
+
};
|
|
33056
|
+
const handleNotLoggedInCheckout = (config) => {
|
|
33057
|
+
if (props.onLoginRequired) {
|
|
33058
|
+
props.onLoginRequired({});
|
|
33059
|
+
} else {
|
|
33060
|
+
openConnectModal?.();
|
|
33061
|
+
}
|
|
33062
|
+
setPendingCheckoutConfig(config);
|
|
33063
|
+
};
|
|
32925
33064
|
const beginCheckout = useEffectEvent(
|
|
32926
33065
|
async (inputConfig) => {
|
|
32927
33066
|
if (!props.config && !inputConfig) {
|
|
@@ -32933,57 +33072,41 @@ function useFunkitCheckout(props) {
|
|
|
32933
33072
|
return { isActivated: isCheckoutActivated };
|
|
32934
33073
|
}
|
|
32935
33074
|
if (!isCheckoutActivated) {
|
|
32936
|
-
return {
|
|
32937
|
-
isActivated: false
|
|
32938
|
-
};
|
|
33075
|
+
return { isActivated: false };
|
|
32939
33076
|
}
|
|
32940
33077
|
const validationResult = await validateCheckoutConfig({
|
|
32941
33078
|
...props.config,
|
|
32942
33079
|
...inputConfig
|
|
32943
33080
|
});
|
|
32944
33081
|
onValidation?.(validationResult);
|
|
32945
|
-
if (validationResult.isValid) {
|
|
32946
|
-
const finalConfig = validationResult.config;
|
|
32947
|
-
const newId = initNewCheckout({ ...props, config: finalConfig });
|
|
32948
|
-
if (finalConfig.sourceTokenAddress && finalConfig.sourceTokenSymbol && finalConfig.sourceChain) {
|
|
32949
|
-
updateSourceAsset({
|
|
32950
|
-
tokenAddress: finalConfig.sourceTokenAddress,
|
|
32951
|
-
symbol: finalConfig.sourceTokenSymbol,
|
|
32952
|
-
pickedChainId: finalConfig.sourceChain,
|
|
32953
|
-
iconSrc: finalConfig.iconSrc ?? void 0
|
|
32954
|
-
});
|
|
32955
|
-
}
|
|
32956
|
-
if (isUserLoggedIn || !!finalConfig.customRecipient) {
|
|
32957
|
-
setPendingCheckoutConfig(void 0);
|
|
32958
|
-
if (isUserLoggedIn && !FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12?.[finalConfig.targetChain]?.isMainnet) {
|
|
32959
|
-
onErrorWrapper?.({
|
|
32960
|
-
type: "error",
|
|
32961
|
-
message: "Unable to begin a new checkout: Insufficient funds on testnet account",
|
|
32962
|
-
metadata: {}
|
|
32963
|
-
});
|
|
32964
|
-
return {
|
|
32965
|
-
isActivated: isCheckoutActivated
|
|
32966
|
-
};
|
|
32967
|
-
}
|
|
32968
|
-
onOpenWrapper?.(newId);
|
|
32969
|
-
} else {
|
|
32970
|
-
if (props.onLoginRequired) {
|
|
32971
|
-
props.onLoginRequired({});
|
|
32972
|
-
} else {
|
|
32973
|
-
openConnectModal?.();
|
|
32974
|
-
}
|
|
32975
|
-
setPendingCheckoutConfig(finalConfig);
|
|
32976
|
-
}
|
|
32977
|
-
} else {
|
|
33082
|
+
if (!validationResult.isValid) {
|
|
32978
33083
|
onErrorWrapper?.({
|
|
32979
33084
|
type: "error",
|
|
32980
33085
|
message: `Unable to begin a new checkout: ${validationResult.message}`,
|
|
32981
33086
|
metadata: {}
|
|
32982
33087
|
});
|
|
33088
|
+
return { isActivated: isCheckoutActivated };
|
|
32983
33089
|
}
|
|
32984
|
-
|
|
32985
|
-
|
|
32986
|
-
|
|
33090
|
+
if (hasSoftHiddenCheckout && softHiddenCheckoutId) {
|
|
33091
|
+
const shouldContinue = onCheckoutConflict({
|
|
33092
|
+
newConfig: validationResult.config,
|
|
33093
|
+
hiddenCheckoutId: softHiddenCheckoutId,
|
|
33094
|
+
resume: resumeSoftHiddenCheckout,
|
|
33095
|
+
replace: discardSoftHiddenCheckout
|
|
33096
|
+
});
|
|
33097
|
+
if (!shouldContinue) {
|
|
33098
|
+
return { isActivated: isCheckoutActivated };
|
|
33099
|
+
}
|
|
33100
|
+
}
|
|
33101
|
+
const finalConfig = validationResult.config;
|
|
33102
|
+
const newId = initNewCheckout({ ...props, config: finalConfig });
|
|
33103
|
+
maybeUpdateSourceAsset(finalConfig);
|
|
33104
|
+
if (isUserLoggedIn || finalConfig.customRecipient) {
|
|
33105
|
+
handleLoggedInCheckout(finalConfig, newId);
|
|
33106
|
+
} else {
|
|
33107
|
+
handleNotLoggedInCheckout(finalConfig);
|
|
33108
|
+
}
|
|
33109
|
+
return { isActivated: isCheckoutActivated };
|
|
32987
33110
|
}
|
|
32988
33111
|
);
|
|
32989
33112
|
const beginWithdrawal = useEffectEvent((config) => {
|
|
@@ -33374,7 +33497,7 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
33374
33497
|
assetUsdAmount,
|
|
33375
33498
|
isAllowedForCheckout,
|
|
33376
33499
|
minUsdRequired,
|
|
33377
|
-
|
|
33500
|
+
isDynamicRoutingEnabled,
|
|
33378
33501
|
t
|
|
33379
33502
|
}) => {
|
|
33380
33503
|
const finalCheckoutRecipient = getCheckoutRecipient({
|
|
@@ -33391,7 +33514,7 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
33391
33514
|
minUsdRequired ?? 0
|
|
33392
33515
|
);
|
|
33393
33516
|
const isSameAsPurchasingToken = (() => {
|
|
33394
|
-
if (
|
|
33517
|
+
if (isDynamicRoutingEnabled) {
|
|
33395
33518
|
return false;
|
|
33396
33519
|
}
|
|
33397
33520
|
if (isCheckoutPostActionRequired(config)) {
|
|
@@ -33432,15 +33555,7 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
33432
33555
|
minUsdRequired: minValueThreshold + feeEstimate
|
|
33433
33556
|
};
|
|
33434
33557
|
}
|
|
33435
|
-
|
|
33436
|
-
if (isSupported && isLighterNative) {
|
|
33437
|
-
isSupported = isTokenEquivalent7({
|
|
33438
|
-
firstTokenChainId: assetChainId,
|
|
33439
|
-
firstTokenAddress: assetTokenAddress,
|
|
33440
|
-
secondTokenChainId: mainnet13.id.toString(),
|
|
33441
|
-
secondTokenAddress: NATIVE_TOKEN
|
|
33442
|
-
});
|
|
33443
|
-
}
|
|
33558
|
+
const isSupported = isAllowedForCheckout && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO14[assetChainId]?.isCheckoutSupported;
|
|
33444
33559
|
return {
|
|
33445
33560
|
isUsable: !!isSupported,
|
|
33446
33561
|
reason: !isSupported ? t("payment.unsupported") : ""
|
|
@@ -38762,5 +38877,6 @@ export {
|
|
|
38762
38877
|
useFunkitSwitchChains,
|
|
38763
38878
|
useFunkitTranslation,
|
|
38764
38879
|
useFunkitUserInfo,
|
|
38880
|
+
useSoftHiddenCheckout,
|
|
38765
38881
|
useUpdateActiveFunkitCheckout
|
|
38766
38882
|
};
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
interface FunCheckoutModalProps {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
|
+
/** External soft-hidden state from ModalContext */
|
|
6
|
+
isSoftHidden?: boolean;
|
|
5
7
|
}
|
|
6
|
-
export declare function FunCheckoutModal({ onClose, open }: FunCheckoutModalProps): React.JSX.Element | null;
|
|
8
|
+
export declare function FunCheckoutModal({ onClose, open, isSoftHidden, }: FunCheckoutModalProps): React.JSX.Element | null;
|
|
7
9
|
export {};
|
|
@@ -117,6 +117,19 @@ export interface FunkitCheckoutValidationResult {
|
|
|
117
117
|
}
|
|
118
118
|
export interface FunkitCheckoutOnCloseResult {
|
|
119
119
|
isNewDeposit: boolean;
|
|
120
|
+
/** True if the modal was soft-hidden (state preserved) instead of hard-closed */
|
|
121
|
+
isSoftHidden?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Conflict resolution options when beginCheckout is called while a soft-hidden checkout exists
|
|
125
|
+
*/
|
|
126
|
+
export interface CheckoutConflictResolution {
|
|
127
|
+
/** The ID of the hidden checkout */
|
|
128
|
+
hiddenCheckoutId: string;
|
|
129
|
+
/** Resume the hidden checkout (reshow the modal without starting new checkout) */
|
|
130
|
+
resume: () => void;
|
|
131
|
+
/** Replace the hidden checkout with a new one (discard hidden state, proceed with new checkout) */
|
|
132
|
+
replace: () => void;
|
|
120
133
|
}
|
|
121
134
|
export type FunkitCheckoutResult = {
|
|
122
135
|
type: 'error' | 'success';
|
|
@@ -35,4 +35,11 @@ export declare function useWithdrawalModal(): {
|
|
|
35
35
|
withdrawalId: string;
|
|
36
36
|
}) => void) | undefined;
|
|
37
37
|
};
|
|
38
|
+
export declare function useSoftHiddenCheckout(): {
|
|
39
|
+
hasSoftHiddenCheckout: boolean;
|
|
40
|
+
softHiddenCheckoutId: string | null;
|
|
41
|
+
softHide: () => void;
|
|
42
|
+
resume: () => void;
|
|
43
|
+
discard: () => void;
|
|
44
|
+
};
|
|
38
45
|
export {};
|
package/dist/utils/customer.d.ts
CHANGED
|
@@ -196,7 +196,3 @@ export declare function useLighterAccounts({ address, isEnabled, }: {
|
|
|
196
196
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
197
197
|
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
198
198
|
};
|
|
199
|
-
export declare function useLighterNativeFlowNeeded(apiKey: string, checkoutConfig: FunkitCheckoutConfig | undefined): {
|
|
200
|
-
isLoading: boolean;
|
|
201
|
-
lighterNativeNeeded: boolean | undefined;
|
|
202
|
-
};
|
|
@@ -116,7 +116,7 @@ export declare const flagConfig: {
|
|
|
116
116
|
readonly if_any: [{
|
|
117
117
|
readonly key: "apiKey";
|
|
118
118
|
readonly type: "isAnyOf";
|
|
119
|
-
readonly values: ["SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um"];
|
|
119
|
+
readonly values: ["SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2"];
|
|
120
120
|
}];
|
|
121
121
|
readonly value: string;
|
|
122
122
|
}, {
|
|
@@ -205,7 +205,7 @@ export declare const flagConfig: {
|
|
|
205
205
|
readonly if_any: [{
|
|
206
206
|
readonly key: "apiKey";
|
|
207
207
|
readonly type: "isAnyOf";
|
|
208
|
-
readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
|
|
208
|
+
readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
|
|
209
209
|
}];
|
|
210
210
|
readonly value: true;
|
|
211
211
|
}];
|
|
@@ -224,7 +224,7 @@ export declare const flagConfig: {
|
|
|
224
224
|
readonly if_any: [{
|
|
225
225
|
readonly key: "apiKey";
|
|
226
226
|
readonly type: "isAnyOf";
|
|
227
|
-
readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
|
|
227
|
+
readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
|
|
228
228
|
}];
|
|
229
229
|
readonly value: true;
|
|
230
230
|
}, {
|
package/dist/utils/lighter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Address } from 'viem';
|
|
2
2
|
export declare const LIGHTER_DEPOSIT_ADDRESS: Address;
|
|
3
|
-
export declare const LIGHTER_NATIVE_FLOW_TIME_ESTIMATE_SECONDS
|
|
3
|
+
export declare const LIGHTER_NATIVE_FLOW_TIME_ESTIMATE_SECONDS: number;
|
|
4
4
|
export declare const LIGHTER_DELAYED_AUTO_TRIGGER_CUTOFF: number;
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
tokenPocketWallet
|
|
16
16
|
} from "./chunk-2L43XSW3.js";
|
|
17
|
-
import {
|
|
18
|
-
tokenaryWallet
|
|
19
|
-
} from "./chunk-D6AOOO5F.js";
|
|
20
17
|
import {
|
|
21
18
|
trustWallet
|
|
22
19
|
} from "./chunk-VYBAYMP3.js";
|
|
23
20
|
import {
|
|
24
21
|
uniswapWallet
|
|
25
22
|
} from "./chunk-LH7BMNFZ.js";
|
|
23
|
+
import {
|
|
24
|
+
tokenaryWallet
|
|
25
|
+
} from "./chunk-D6AOOO5F.js";
|
|
26
26
|
import {
|
|
27
27
|
walletConnectWallet
|
|
28
28
|
} from "./chunk-NP5QGWNL.js";
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
xdefiWallet
|
|
31
31
|
} from "./chunk-BOU4WKRZ.js";
|
|
32
32
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
33
|
+
rabbyWallet
|
|
34
|
+
} from "./chunk-BBOM42DL.js";
|
|
35
35
|
import {
|
|
36
36
|
rainbowWallet
|
|
37
37
|
} from "./chunk-2KUBG3S6.js";
|
|
@@ -75,8 +75,8 @@ import {
|
|
|
75
75
|
oneKeyWallet
|
|
76
76
|
} from "./chunk-SHBUZ7U7.js";
|
|
77
77
|
import {
|
|
78
|
-
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
phantomWallet
|
|
79
|
+
} from "./chunk-362NXNTM.js";
|
|
80
80
|
import {
|
|
81
81
|
foxWallet
|
|
82
82
|
} from "./chunk-7QONTUXT.js";
|
|
@@ -92,15 +92,15 @@ import {
|
|
|
92
92
|
import {
|
|
93
93
|
imTokenWallet
|
|
94
94
|
} from "./chunk-COZ7MIQS.js";
|
|
95
|
+
import {
|
|
96
|
+
injectedWallet
|
|
97
|
+
} from "./chunk-XWUJE7MW.js";
|
|
95
98
|
import {
|
|
96
99
|
kresusWallet
|
|
97
100
|
} from "./chunk-MJXPRJZT.js";
|
|
98
101
|
import {
|
|
99
102
|
ledgerWallet
|
|
100
103
|
} from "./chunk-BRBKM4PW.js";
|
|
101
|
-
import {
|
|
102
|
-
injectedWallet
|
|
103
|
-
} from "./chunk-XWUJE7MW.js";
|
|
104
104
|
import {
|
|
105
105
|
bybitWallet
|
|
106
106
|
} from "./chunk-2STUC6QL.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0-next.2",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"ua-parser-js": "^1.0.37",
|
|
101
101
|
"use-debounce": "^10.0.5",
|
|
102
102
|
"uuid": "^9.0.1",
|
|
103
|
-
"@funkit/api-base": "1.12.22-next.
|
|
103
|
+
"@funkit/api-base": "1.12.22-next.1",
|
|
104
104
|
"@funkit/chains": "0.5.2-next.0",
|
|
105
|
-
"@funkit/fun-relay": "2.1.16-next.
|
|
105
|
+
"@funkit/fun-relay": "2.1.16-next.2",
|
|
106
106
|
"@funkit/utils": "1.1.22-next.0"
|
|
107
107
|
},
|
|
108
108
|
"repository": {
|