@funkit/connect 1.0.22 → 1.0.24
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 +25 -0
- package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.d.ts +2 -1
- package/dist/components/FunTransactionSummary/FunTransactionSummary.d.ts +1 -0
- package/dist/components/FunkitProvider/FunkitConfigContext.d.ts +2 -0
- package/dist/components/FunkitProvider/FunkitMoonpayProvider.d.ts +20 -0
- package/dist/components/FunkitProvider/GeneralWalletProvider.d.ts +2 -2
- package/dist/consts/funkit.d.ts +3 -0
- package/dist/consts/moonpay.d.ts +3 -0
- package/dist/index.css +12 -0
- package/dist/index.js +748 -519
- package/dist/utils/checkout.d.ts +1 -1
- package/dist/utils/mesh.d.ts +9 -7
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +54 -54
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +3 -3
- package/dist/wallets/walletConnectors/chunk-2B3SPBRY.js +0 -100
- package/dist/wallets/walletConnectors/chunk-2GAW2UBU.js +0 -102
- package/dist/wallets/walletConnectors/chunk-7KDOXASH.js +0 -95
- package/dist/wallets/walletConnectors/chunk-CRSPGVPF.js +0 -105
- package/dist/wallets/walletConnectors/chunk-CUKVUCIP.js +0 -98
- package/dist/wallets/walletConnectors/chunk-DV3SI63E.js +0 -96
- package/dist/wallets/walletConnectors/chunk-GW6EF4G2.js +0 -92
- package/dist/wallets/walletConnectors/chunk-HD5VYJNC.js +0 -98
- package/dist/wallets/walletConnectors/chunk-IBWFKX7P.js +0 -94
- package/dist/wallets/walletConnectors/chunk-KGTZ6E7L.js +0 -71
- package/dist/wallets/walletConnectors/chunk-OKWOB3DN.js +0 -66
- package/dist/wallets/walletConnectors/chunk-RCWZ4KBR.js +0 -73
- package/dist/wallets/walletConnectors/chunk-RTW6PVQI.js +0 -107
- package/dist/wallets/walletConnectors/chunk-T6JVHES7.js +0 -87
- package/dist/wallets/walletConnectors/chunk-VSZ7PAHS.js +0 -94
- package/dist/wallets/walletConnectors/chunk-XNNLZXHE.js +0 -102
- package/dist/wallets/walletConnectors/chunk-XRMAVTK7.js +0 -178
- package/dist/wallets/walletConnectors/chunk-Z2HIQYVN.js +0 -96
package/dist/index.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
en_US_default
|
|
4
4
|
} from "./chunk-SW6GAS7K.js";
|
|
5
|
-
import {
|
|
6
|
-
lightTheme
|
|
7
|
-
} from "./chunk-RA4J3G3B.js";
|
|
8
5
|
import {
|
|
9
6
|
darkTheme
|
|
10
7
|
} from "./chunk-2GFNZKMA.js";
|
|
8
|
+
import {
|
|
9
|
+
lightTheme
|
|
10
|
+
} from "./chunk-RA4J3G3B.js";
|
|
11
11
|
import "./chunk-UK5FXGK3.js";
|
|
12
12
|
|
|
13
13
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
14
|
-
import
|
|
14
|
+
import React152, { useContext as useContext28, useEffect as useEffect35, useState as useState48 } from "react";
|
|
15
15
|
|
|
16
16
|
// src/css/sprinkles.css.ts
|
|
17
17
|
import { createMapValueFn as _51c72 } from "@vanilla-extract/sprinkles/createUtils";
|
|
@@ -131,13 +131,13 @@ import PrivyJS, {
|
|
|
131
131
|
getUserEmbeddedWallet,
|
|
132
132
|
LocalStorage
|
|
133
133
|
} from "@privy-io/js-sdk-core";
|
|
134
|
-
import
|
|
135
|
-
createContext as
|
|
136
|
-
useCallback as
|
|
137
|
-
useContext as
|
|
138
|
-
useEffect as
|
|
134
|
+
import React147, {
|
|
135
|
+
createContext as createContext18,
|
|
136
|
+
useCallback as useCallback30,
|
|
137
|
+
useContext as useContext24,
|
|
138
|
+
useEffect as useEffect31,
|
|
139
139
|
useMemo as useMemo36,
|
|
140
|
-
useState as
|
|
140
|
+
useState as useState43
|
|
141
141
|
} from "react";
|
|
142
142
|
import { useConnect as useConnect2, useDisconnect as useDisconnect3 } from "wagmi";
|
|
143
143
|
|
|
@@ -483,13 +483,13 @@ var useFunkitConnectChainsById = () => {
|
|
|
483
483
|
};
|
|
484
484
|
|
|
485
485
|
// src/components/FunkitProvider/ModalContext.tsx
|
|
486
|
-
import
|
|
487
|
-
createContext as
|
|
488
|
-
useCallback as
|
|
489
|
-
useContext as
|
|
490
|
-
useEffect as
|
|
486
|
+
import React146, {
|
|
487
|
+
createContext as createContext17,
|
|
488
|
+
useCallback as useCallback29,
|
|
489
|
+
useContext as useContext23,
|
|
490
|
+
useEffect as useEffect30,
|
|
491
491
|
useMemo as useMemo35,
|
|
492
|
-
useState as
|
|
492
|
+
useState as useState42
|
|
493
493
|
} from "react";
|
|
494
494
|
import { useAccount as useAccount11, useAccountEffect as useAccountEffect2, useConfig as useConfig4 } from "wagmi";
|
|
495
495
|
|
|
@@ -620,7 +620,7 @@ var DEFAULT_FUNKIT_CONFIG = {
|
|
|
620
620
|
["apple_oauth" /* APPLE */]: false
|
|
621
621
|
}
|
|
622
622
|
},
|
|
623
|
-
accountModalConfig: { allowDepositing: false },
|
|
623
|
+
accountModalConfig: { showUnknownTokens: false, allowDepositing: false },
|
|
624
624
|
paymentsConfig: {
|
|
625
625
|
allowBrokerageUnlinking: false,
|
|
626
626
|
defaultPaymentMethod: void 0,
|
|
@@ -1465,7 +1465,7 @@ var GeneralWalletContext = createContext8({
|
|
|
1465
1465
|
isUserLoggedIn: false,
|
|
1466
1466
|
isWeb2Login: false,
|
|
1467
1467
|
isWeb3Login: false,
|
|
1468
|
-
userInfo: PLACEHOLDER_FUNKIT_USER_INFO,
|
|
1468
|
+
userInfo: { ...PLACEHOLDER_FUNKIT_USER_INFO, globalFunkitUserId: "" },
|
|
1469
1469
|
isFetchingAssets: false,
|
|
1470
1470
|
walletAssets: null,
|
|
1471
1471
|
startAssetsListener: () => void 0,
|
|
@@ -1480,6 +1480,7 @@ function GeneralWalletProvider({ children }) {
|
|
|
1480
1480
|
const { connectors, disconnectAsync } = useDisconnect();
|
|
1481
1481
|
const ensName = useMainnetEnsName(address);
|
|
1482
1482
|
const { web2AccountInfo, handleFunkitWeb2Logout } = useFunkitWeb2Login();
|
|
1483
|
+
const { apiKey, accountModalConfig } = useFunkitConfig();
|
|
1483
1484
|
const isWeb2Login = useMemo5(() => {
|
|
1484
1485
|
return connector && connector.id === FUNKIT_CONNECT_WALLET_ID;
|
|
1485
1486
|
}, [connector]);
|
|
@@ -1490,28 +1491,36 @@ function GeneralWalletProvider({ children }) {
|
|
|
1490
1491
|
return isWeb2Login || isWeb3Login;
|
|
1491
1492
|
}, [isWeb2Login, isWeb3Login]);
|
|
1492
1493
|
const userInfo = useMemo5(() => {
|
|
1494
|
+
let baseInfo;
|
|
1493
1495
|
if (isWeb2Login) {
|
|
1494
|
-
|
|
1496
|
+
baseInfo = web2AccountInfo;
|
|
1495
1497
|
} else if (isWeb3Login) {
|
|
1496
|
-
|
|
1498
|
+
baseInfo = {
|
|
1497
1499
|
userId: address,
|
|
1498
1500
|
accountLabel: connector == null ? void 0 : connector.name,
|
|
1499
1501
|
accountName: ensName ? formatENS(ensName) : formatAddress(address || "")
|
|
1500
1502
|
};
|
|
1501
1503
|
} else {
|
|
1502
|
-
|
|
1504
|
+
baseInfo = PLACEHOLDER_FUNKIT_USER_INFO;
|
|
1503
1505
|
}
|
|
1506
|
+
return {
|
|
1507
|
+
...baseInfo,
|
|
1508
|
+
globalFunkitUserId: isUserLoggedIn ? `${address}|${baseInfo.accountName}|${apiKey}` : `0x|UnknownGuest|${apiKey}`
|
|
1509
|
+
};
|
|
1504
1510
|
}, [
|
|
1505
1511
|
address,
|
|
1512
|
+
apiKey,
|
|
1506
1513
|
connector == null ? void 0 : connector.name,
|
|
1507
1514
|
ensName,
|
|
1515
|
+
isUserLoggedIn,
|
|
1508
1516
|
isWeb2Login,
|
|
1509
1517
|
isWeb3Login,
|
|
1510
1518
|
web2AccountInfo
|
|
1511
1519
|
]);
|
|
1512
1520
|
useEffect6(() => {
|
|
1513
|
-
if (userInfo.
|
|
1514
|
-
logger.
|
|
1521
|
+
if (userInfo.globalFunkitUserId !== logger.getUserId()) {
|
|
1522
|
+
logger.log("settingUserId", { newUserId: userInfo.globalFunkitUserId });
|
|
1523
|
+
logger.setUserId(userInfo.globalFunkitUserId);
|
|
1515
1524
|
}
|
|
1516
1525
|
}, [userInfo]);
|
|
1517
1526
|
const intervalRef = useRef2();
|
|
@@ -1529,6 +1538,9 @@ function GeneralWalletProvider({ children }) {
|
|
|
1529
1538
|
const modifiedAssets = Object.keys(chainAssets).reduce(
|
|
1530
1539
|
(acc2, curAddress) => {
|
|
1531
1540
|
const asset = chainAssets[curAddress];
|
|
1541
|
+
if ((!asset.price || !asset.totalUsdValue) && !accountModalConfig.showUnknownTokens) {
|
|
1542
|
+
return acc2;
|
|
1543
|
+
}
|
|
1532
1544
|
const chainAddress = combineChainSymbolOrAddress({
|
|
1533
1545
|
chainId: asset.chainId,
|
|
1534
1546
|
symbolOrAddress: curAddress
|
|
@@ -1800,6 +1812,74 @@ import {
|
|
|
1800
1812
|
import { getBalance } from "@wagmi/core";
|
|
1801
1813
|
import { isAddress } from "viem";
|
|
1802
1814
|
|
|
1815
|
+
// src/consts/moonpay.ts
|
|
1816
|
+
var MOONPAY_TOKENS_SUPPORTED_REGIONS = {
|
|
1817
|
+
usdc: {
|
|
1818
|
+
isSupportedInUS: true,
|
|
1819
|
+
notAllowedUSStates: ["VI"],
|
|
1820
|
+
notAllowedCountries: ["CA"],
|
|
1821
|
+
minBuyAmount: 15,
|
|
1822
|
+
maxBuyAmount: 3e4,
|
|
1823
|
+
precision: 2
|
|
1824
|
+
},
|
|
1825
|
+
usdc_arbitrum: {
|
|
1826
|
+
isSupportedInUS: true,
|
|
1827
|
+
notAllowedUSStates: ["NY", "TX", "VI"],
|
|
1828
|
+
notAllowedCountries: ["CA"],
|
|
1829
|
+
minBuyAmount: 15,
|
|
1830
|
+
maxBuyAmount: 3e4,
|
|
1831
|
+
precision: 2
|
|
1832
|
+
},
|
|
1833
|
+
usdc_base: {
|
|
1834
|
+
isSupportedInUS: true,
|
|
1835
|
+
notAllowedUSStates: ["NY", "TX", "VI"],
|
|
1836
|
+
notAllowedCountries: ["CA"],
|
|
1837
|
+
minBuyAmount: 15,
|
|
1838
|
+
maxBuyAmount: 3e4,
|
|
1839
|
+
precision: 2
|
|
1840
|
+
},
|
|
1841
|
+
usdc_polygon: {
|
|
1842
|
+
isSupportedInUS: true,
|
|
1843
|
+
notAllowedUSStates: ["NY", "TX", "VI"],
|
|
1844
|
+
notAllowedCountries: ["CA"],
|
|
1845
|
+
minBuyAmount: 15,
|
|
1846
|
+
maxBuyAmount: 3e4,
|
|
1847
|
+
precision: 2
|
|
1848
|
+
},
|
|
1849
|
+
eth: {
|
|
1850
|
+
isSupportedInUS: true,
|
|
1851
|
+
notAllowedUSStates: ["VI"],
|
|
1852
|
+
notAllowedCountries: [],
|
|
1853
|
+
minBuyAmount: 48e-4,
|
|
1854
|
+
maxBuyAmount: 3e4,
|
|
1855
|
+
precision: 4
|
|
1856
|
+
},
|
|
1857
|
+
eth_arbitrum: {
|
|
1858
|
+
isSupportedInUS: true,
|
|
1859
|
+
notAllowedUSStates: ["NY", "TX", "VI"],
|
|
1860
|
+
notAllowedCountries: [],
|
|
1861
|
+
minBuyAmount: 11e-4,
|
|
1862
|
+
maxBuyAmount: 1e9,
|
|
1863
|
+
precision: 4
|
|
1864
|
+
},
|
|
1865
|
+
eth_base: {
|
|
1866
|
+
isSupportedInUS: true,
|
|
1867
|
+
notAllowedUSStates: ["NY", "TX", "VI"],
|
|
1868
|
+
notAllowedCountries: [],
|
|
1869
|
+
minBuyAmount: 48e-4,
|
|
1870
|
+
maxBuyAmount: 9999999,
|
|
1871
|
+
precision: 4
|
|
1872
|
+
},
|
|
1873
|
+
eth_polygon: {
|
|
1874
|
+
isSupportedInUS: true,
|
|
1875
|
+
notAllowedUSStates: ["NY", "TX", "VI"],
|
|
1876
|
+
notAllowedCountries: [],
|
|
1877
|
+
minBuyAmount: 48e-4,
|
|
1878
|
+
maxBuyAmount: 9999999,
|
|
1879
|
+
precision: 4
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
|
|
1803
1883
|
// src/utils/formatNumber.ts
|
|
1804
1884
|
var FORMAT_NUMBER_DEFAULT = {
|
|
1805
1885
|
minBeforeUseScientific: 1e-5,
|
|
@@ -2207,8 +2287,9 @@ function getCheckoutStateStepNumber(state) {
|
|
|
2207
2287
|
return 0;
|
|
2208
2288
|
}
|
|
2209
2289
|
}
|
|
2210
|
-
function formatTokenAmountForMoonpay(amount) {
|
|
2211
|
-
const
|
|
2290
|
+
function formatTokenAmountForMoonpay(amount, mpCurrencyCode) {
|
|
2291
|
+
const precision = MOONPAY_TOKENS_SUPPORTED_REGIONS[mpCurrencyCode.toLowerCase()].precision;
|
|
2292
|
+
const formattedNumber = roundUpToXDecimalPlaces(amount.toString(), precision);
|
|
2212
2293
|
return formattedNumber.toString();
|
|
2213
2294
|
}
|
|
2214
2295
|
function combineChainSymbolOrAddress2({
|
|
@@ -2690,7 +2771,8 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2690
2771
|
const moonpayEstimation = await getMoonpayBuyQuoteForCreditCard({
|
|
2691
2772
|
currencyCode: mpCurrencyCode,
|
|
2692
2773
|
quoteCurrencyAmount: formatTokenAmountForMoonpay(
|
|
2693
|
-
parseFloat(baseQuote.estTotalFromAmount)
|
|
2774
|
+
parseFloat(baseQuote.estTotalFromAmount),
|
|
2775
|
+
mpCurrencyCode
|
|
2694
2776
|
),
|
|
2695
2777
|
baseCurrencyCode: "usd",
|
|
2696
2778
|
areFeesIncluded: true,
|
|
@@ -2708,9 +2790,9 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2708
2790
|
} else if (newPaymentMethodInfo.paymentMethod === "brokerage" /* BROKERAGE */) {
|
|
2709
2791
|
const meshMeta = newPaymentMethodInfo.meta;
|
|
2710
2792
|
const meshAccessToken = (_c = (_b = (_a = meshMeta == null ? void 0 : meshMeta.accessToken) == null ? void 0 : _a.accountTokens) == null ? void 0 : _b[0]) == null ? void 0 : _c.accessToken;
|
|
2711
|
-
const
|
|
2793
|
+
const meshExchangeType = (_d = meshMeta == null ? void 0 : meshMeta.accessToken) == null ? void 0 : _d.brokerType;
|
|
2712
2794
|
const meshNetworkId = meshMeta == null ? void 0 : meshMeta.checkoutMeshNetworkId;
|
|
2713
|
-
if (!meshMeta || !meshAccessToken || !
|
|
2795
|
+
if (!meshMeta || !meshAccessToken || !meshNetworkId || !meshExchangeType) {
|
|
2714
2796
|
throw new Error("Missing mesh meta information");
|
|
2715
2797
|
}
|
|
2716
2798
|
const amountInCrypto = roundUpToXDecimalPlaces(
|
|
@@ -2719,7 +2801,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2719
2801
|
);
|
|
2720
2802
|
const dummyPreviewTransfer = await meshPreviewTransfer(
|
|
2721
2803
|
meshAccessToken,
|
|
2722
|
-
|
|
2804
|
+
meshExchangeType,
|
|
2723
2805
|
null,
|
|
2724
2806
|
null,
|
|
2725
2807
|
meshNetworkId,
|
|
@@ -3990,7 +4072,7 @@ import {
|
|
|
3990
4072
|
meshGetLinkToken,
|
|
3991
4073
|
meshGetTransferIntegrations
|
|
3992
4074
|
} from "@funkit/core";
|
|
3993
|
-
var FUNKIT_MESH_CLIENT_ID = "
|
|
4075
|
+
var FUNKIT_MESH_CLIENT_ID = "8132aff4-56c9-4b1d-85b4-08dbdcc6199d";
|
|
3994
4076
|
var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
|
|
3995
4077
|
MeshExchanges4["Robinhood"] = "Robinhood";
|
|
3996
4078
|
MeshExchanges4["ETrade"] = "ETrade";
|
|
@@ -4004,13 +4086,12 @@ var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
|
|
|
4004
4086
|
MeshExchanges4["CoinbasePro"] = "CoinbasePro";
|
|
4005
4087
|
MeshExchanges4["CryptoCom"] = "CryptoCom";
|
|
4006
4088
|
MeshExchanges4["Binance"] = "Binance";
|
|
4089
|
+
MeshExchanges4["BinanceUs"] = "BinanceUs";
|
|
4007
4090
|
MeshExchanges4["Gemini"] = "Gemini";
|
|
4008
4091
|
MeshExchanges4["OkCoin"] = "OkCoin";
|
|
4009
|
-
MeshExchanges4["Bittrex"] = "Bittrex";
|
|
4010
4092
|
MeshExchanges4["KuCoin"] = "KuCoin";
|
|
4011
4093
|
MeshExchanges4["Etoro"] = "Etoro";
|
|
4012
4094
|
MeshExchanges4["CexIo"] = "CexIo";
|
|
4013
|
-
MeshExchanges4["BinanceInternational"] = "BinanceInternational";
|
|
4014
4095
|
MeshExchanges4["Bitstamp"] = "Bitstamp";
|
|
4015
4096
|
MeshExchanges4["GateIo"] = "GateIo";
|
|
4016
4097
|
MeshExchanges4["Acorns"] = "Acorns";
|
|
@@ -4021,24 +4102,55 @@ var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
|
|
|
4021
4102
|
MeshExchanges4["Bitfinex"] = "Bitfinex";
|
|
4022
4103
|
MeshExchanges4["KrakenDirect"] = "KrakenDirect";
|
|
4023
4104
|
MeshExchanges4["Vanguard"] = "Vanguard";
|
|
4024
|
-
MeshExchanges4["BinanceInternationalDirect"] = "BinanceInternationalDirect";
|
|
4025
4105
|
MeshExchanges4["BitfinexDirect"] = "BitfinexDirect";
|
|
4026
4106
|
MeshExchanges4["Bybit"] = "Bybit";
|
|
4027
4107
|
return MeshExchanges4;
|
|
4028
4108
|
})(MeshExchanges || {});
|
|
4029
|
-
|
|
4109
|
+
var EXCHANGE_NAME_TO_TYPE = {
|
|
4110
|
+
["Robinhood" /* Robinhood */]: "robinhood",
|
|
4111
|
+
["ETrade" /* ETrade */]: "eTrade",
|
|
4112
|
+
["Alpaca" /* Alpaca */]: "alpaca",
|
|
4113
|
+
["WeBull" /* WeBull */]: "weBull",
|
|
4114
|
+
["Stash" /* Stash */]: "stash",
|
|
4115
|
+
["InteractiveBrokers" /* InteractiveBrokers */]: "interactiveBrokers",
|
|
4116
|
+
["Public" /* Public */]: "public",
|
|
4117
|
+
["Coinbase" /* Coinbase */]: "coinbase",
|
|
4118
|
+
["Kraken" /* Kraken */]: "kraken",
|
|
4119
|
+
["CryptoCom" /* CryptoCom */]: "cryptoCom",
|
|
4120
|
+
["CoinbasePro" /* CoinbasePro */]: "coinbasePro",
|
|
4121
|
+
["Gemini" /* Gemini */]: "gemini",
|
|
4122
|
+
["Binance" /* Binance */]: "binanceInternationalDirect",
|
|
4123
|
+
["BinanceUs" /* BinanceUs */]: "binanceUs",
|
|
4124
|
+
["OkCoin" /* OkCoin */]: "okCoin",
|
|
4125
|
+
["Etoro" /* Etoro */]: "etoro",
|
|
4126
|
+
["KuCoin" /* KuCoin */]: "kuCoin",
|
|
4127
|
+
["CexIo" /* CexIo */]: "cexIo",
|
|
4128
|
+
["GateIo" /* GateIo */]: "gateIo",
|
|
4129
|
+
["Bitstamp" /* Bitstamp */]: "bitstamp",
|
|
4130
|
+
["Okx" /* Okx */]: "okx",
|
|
4131
|
+
["Acorns" /* Acorns */]: "acorns",
|
|
4132
|
+
["Coinlist" /* Coinlist */]: "coinlist",
|
|
4133
|
+
["BitFlyer" /* BitFlyer */]: "bitFlyer",
|
|
4134
|
+
["Bitfinex" /* Bitfinex */]: "bitfinex",
|
|
4135
|
+
["Huobi" /* Huobi */]: "huobi",
|
|
4136
|
+
["KrakenDirect" /* KrakenDirect */]: "krakenDirect",
|
|
4137
|
+
["Vanguard" /* Vanguard */]: "vanguard",
|
|
4138
|
+
["Bybit" /* Bybit */]: "bybit",
|
|
4139
|
+
["BitfinexDirect" /* BitfinexDirect */]: "bitfinexDirect"
|
|
4140
|
+
};
|
|
4141
|
+
async function fetchMeshLinkToken(funkitUserId, selectedExchange, funApiKey) {
|
|
4030
4142
|
return await meshGetLinkToken(
|
|
4031
|
-
|
|
4143
|
+
funkitUserId,
|
|
4032
4144
|
selectedExchange,
|
|
4033
4145
|
true,
|
|
4034
4146
|
null,
|
|
4035
4147
|
funApiKey
|
|
4036
4148
|
);
|
|
4037
4149
|
}
|
|
4038
|
-
async function executeBrokerageDeposit(fromAuthToken,
|
|
4150
|
+
async function executeBrokerageDeposit(fromAuthToken, fromType, previewId, apiKey, mfaCode) {
|
|
4039
4151
|
const executeTransfer = await meshExecuteTransfer(
|
|
4040
4152
|
fromAuthToken,
|
|
4041
|
-
|
|
4153
|
+
fromType,
|
|
4042
4154
|
previewId,
|
|
4043
4155
|
mfaCode,
|
|
4044
4156
|
apiKey
|
|
@@ -4050,7 +4162,8 @@ async function fetchMeshAccountCryptoHoldings({
|
|
|
4050
4162
|
apiKey,
|
|
4051
4163
|
exchange
|
|
4052
4164
|
}) {
|
|
4053
|
-
const
|
|
4165
|
+
const type = EXCHANGE_NAME_TO_TYPE[exchange];
|
|
4166
|
+
const res = await meshGetCryptocurrencyHoldings(authToken, type, apiKey);
|
|
4054
4167
|
return res.cryptocurrencyPositions;
|
|
4055
4168
|
}
|
|
4056
4169
|
async function fetchMeshSupportedTokensByBrokerageAndSupportedFunkitChains({
|
|
@@ -4059,7 +4172,7 @@ async function fetchMeshSupportedTokensByBrokerageAndSupportedFunkitChains({
|
|
|
4059
4172
|
}) {
|
|
4060
4173
|
const res = await meshGetTransferIntegrations(apiKey);
|
|
4061
4174
|
const item = res.integrations.find(
|
|
4062
|
-
(item2) => item2.type ===
|
|
4175
|
+
(item2) => item2.type === EXCHANGE_NAME_TO_TYPE[exchange]
|
|
4063
4176
|
);
|
|
4064
4177
|
const filteredNetworks = ((item == null ? void 0 : item.networks) || []).filter((networkItem) => {
|
|
4065
4178
|
return (networkItem == null ? void 0 : networkItem.chainId) && FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST.includes(
|
|
@@ -4149,6 +4262,7 @@ function useFunkitMesh({
|
|
|
4149
4262
|
}) {
|
|
4150
4263
|
const { apiKey } = useFunkitConfig();
|
|
4151
4264
|
const { meshBrokerDataMap, setDataMapAndCache } = useContext10(FunkitMeshContext);
|
|
4265
|
+
const { userInfo } = useGeneralWallet();
|
|
4152
4266
|
const handleIntegrationConnected = useCallback8(
|
|
4153
4267
|
(brokerData) => {
|
|
4154
4268
|
var _a;
|
|
@@ -4191,7 +4305,11 @@ function useFunkitMesh({
|
|
|
4191
4305
|
if (hasActiveConnectionCheck(brokerage)) {
|
|
4192
4306
|
onConnected == null ? void 0 : onConnected(meshBrokerDataMap[brokerage]);
|
|
4193
4307
|
} else {
|
|
4194
|
-
const response = await fetchMeshLinkToken(
|
|
4308
|
+
const response = await fetchMeshLinkToken(
|
|
4309
|
+
"meshconnectkit",
|
|
4310
|
+
brokerage,
|
|
4311
|
+
apiKey
|
|
4312
|
+
);
|
|
4195
4313
|
const linkToken = response.linkToken;
|
|
4196
4314
|
const linkConnection = getLinkConnection();
|
|
4197
4315
|
if (linkConnection && linkToken) {
|
|
@@ -5377,7 +5495,7 @@ function FunMeshVerificationStep({
|
|
|
5377
5495
|
logger.log("inputs", { finalOtpInput });
|
|
5378
5496
|
const res = await executeBrokerageDeposit(
|
|
5379
5497
|
accessToken,
|
|
5380
|
-
exchange,
|
|
5498
|
+
EXCHANGE_NAME_TO_TYPE[exchange],
|
|
5381
5499
|
previewId,
|
|
5382
5500
|
funkitConfig == null ? void 0 : funkitConfig.apiKey,
|
|
5383
5501
|
finalOtpInput
|
|
@@ -5443,7 +5561,7 @@ function FunMeshVerificationStep({
|
|
|
5443
5561
|
case "mfaRequired" /* mfaRequired */:
|
|
5444
5562
|
case "mfaFailed" /* mfaFailed */:
|
|
5445
5563
|
case "secondMfaRequired" /* secondMfaRequired */:
|
|
5446
|
-
return `Please enter the two factor code associated with your ${exchange} account. Once done, click "Continue" below.`;
|
|
5564
|
+
return `Please enter the${(executionContent == null ? void 0 : executionContent.mfaType) && (executionContent == null ? void 0 : executionContent.mfaType) !== "unspecified" /* unspecified */ ? ` ${executionContent.mfaType} ` : " "}two factor code associated with your ${exchange} account. Once done, click "Continue" below.`;
|
|
5447
5565
|
case "deviceConfirmationRequired" /* deviceConfirmationRequired */:
|
|
5448
5566
|
return `Open the ${exchange} app on your mobile device and verify that you are trying to transfer crypto. Once done, click "Continue" below.`;
|
|
5449
5567
|
case "emailConfirmationRequired" /* emailConfirmationRequired */:
|
|
@@ -5453,7 +5571,7 @@ function FunMeshVerificationStep({
|
|
|
5453
5571
|
case "failed" /* failed */:
|
|
5454
5572
|
return "An error occurred during checkout but your brokerage funds are unaffected. To retry, please go back and re-confirm a new checkout. If the error still persists, please reach out to support for help.";
|
|
5455
5573
|
}
|
|
5456
|
-
}, [exchange, executionStatus]);
|
|
5574
|
+
}, [exchange, executionContent == null ? void 0 : executionContent.mfaType, executionStatus]);
|
|
5457
5575
|
return /* @__PURE__ */ React53.createElement(Box, null, screen === 0 /* INITIAL */ ? /* @__PURE__ */ React53.createElement(Box, {
|
|
5458
5576
|
width: "full",
|
|
5459
5577
|
height: "200",
|
|
@@ -5985,7 +6103,7 @@ function AddPaymentMethodItem({
|
|
|
5985
6103
|
}) {
|
|
5986
6104
|
const config = PAYMENT_METHOD_CONFIG[paymentMethod];
|
|
5987
6105
|
const { textCustomizations, paymentsConfig } = useFunkitConfig();
|
|
5988
|
-
const { walletAddress } = useGeneralWallet();
|
|
6106
|
+
const { walletAddress, walletAssets } = useGeneralWallet();
|
|
5989
6107
|
const isEnabledForFlow = useMemo14(() => {
|
|
5990
6108
|
if (paymentFlow === 1 /* CHECKOUT */) {
|
|
5991
6109
|
return config.isEnabledForCheckout;
|
|
@@ -5999,7 +6117,12 @@ function AddPaymentMethodItem({
|
|
|
5999
6117
|
textCustomizations,
|
|
6000
6118
|
formatAddressLastFour(walletAddress || "")
|
|
6001
6119
|
);
|
|
6002
|
-
const
|
|
6120
|
+
const isWalletBalanceAndAssetStillLoading = useMemo14(() => {
|
|
6121
|
+
return paymentMethod === "balance" /* ACCOUNT_BALANCE */ && walletAssets == null;
|
|
6122
|
+
}, [paymentMethod, walletAssets]);
|
|
6123
|
+
const isDisabled = useMemo14(() => {
|
|
6124
|
+
return !isClickable || !isEnabledForFlow || isWalletBalanceAndAssetStillLoading;
|
|
6125
|
+
}, [isClickable, isEnabledForFlow, isWalletBalanceAndAssetStillLoading]);
|
|
6003
6126
|
const valueIcon = disclaimerText ? config.timeIcon : /* @__PURE__ */ React63.createElement(Box, {
|
|
6004
6127
|
display: "flex",
|
|
6005
6128
|
gap: "4",
|
|
@@ -6009,7 +6132,10 @@ function AddPaymentMethodItem({
|
|
|
6009
6132
|
return /* @__PURE__ */ React63.createElement(React63.Fragment, null);
|
|
6010
6133
|
}
|
|
6011
6134
|
return /* @__PURE__ */ React63.createElement(FunKeyValue, {
|
|
6012
|
-
keyIcon:
|
|
6135
|
+
keyIcon: isWalletBalanceAndAssetStillLoading ? /* @__PURE__ */ React63.createElement(SpinnerIcon, {
|
|
6136
|
+
width: 24,
|
|
6137
|
+
height: 24
|
|
6138
|
+
}) : config.icon,
|
|
6013
6139
|
keyText: labelText,
|
|
6014
6140
|
valueIcon,
|
|
6015
6141
|
valueText: config.timeRange,
|
|
@@ -6021,7 +6147,7 @@ function AddPaymentMethodItem({
|
|
|
6021
6147
|
valueTextColor: isActive ? "buttonTextPrimary" : "modalText",
|
|
6022
6148
|
onClick: isActive ? null : () => onClick == null ? void 0 : onClick(),
|
|
6023
6149
|
isDisabled,
|
|
6024
|
-
disclaimerText
|
|
6150
|
+
disclaimerText: isWalletBalanceAndAssetStillLoading ? "Fetching balance..." : disclaimerText
|
|
6025
6151
|
});
|
|
6026
6152
|
}
|
|
6027
6153
|
function ExistingPaymentMethodItem({
|
|
@@ -6523,7 +6649,9 @@ function FeesLineItem({
|
|
|
6523
6649
|
}) {
|
|
6524
6650
|
const [isExpanded, setIsExpanded] = useState16(false);
|
|
6525
6651
|
const toggle = () => setIsExpanded(!isExpanded);
|
|
6526
|
-
return /* @__PURE__ */ React68.createElement(
|
|
6652
|
+
return /* @__PURE__ */ React68.createElement(Box, {
|
|
6653
|
+
width: "full"
|
|
6654
|
+
}, /* @__PURE__ */ React68.createElement(LineItem, {
|
|
6527
6655
|
onClick: isLoading ? () => void 0 : () => toggle == null ? void 0 : toggle(),
|
|
6528
6656
|
paddingY: isLoading ? "8" : "5",
|
|
6529
6657
|
color: { base: "modalTextDim", hover: "accentColor" },
|
|
@@ -6547,7 +6675,9 @@ function FeesLineItem({
|
|
|
6547
6675
|
size: "14"
|
|
6548
6676
|
}, formatCurrencyAndStringify(
|
|
6549
6677
|
parseFloat(feesItem.totalUsd.toString())
|
|
6550
|
-
)), isExpanded ? /* @__PURE__ */ React68.createElement(FunUpArrow, null) : /* @__PURE__ */ React68.createElement(FunDownArrow, null)) : null),
|
|
6678
|
+
)), isExpanded ? /* @__PURE__ */ React68.createElement(FunUpArrow, null) : /* @__PURE__ */ React68.createElement(FunDownArrow, null)) : null), /* @__PURE__ */ React68.createElement(Box, {
|
|
6679
|
+
className: isExpanded ? "fun-container-content-expanded" : "fun-container-content-collapsed"
|
|
6680
|
+
}, /* @__PURE__ */ React68.createElement(LineItem, null, /* @__PURE__ */ React68.createElement(Text, {
|
|
6551
6681
|
weight: "medium",
|
|
6552
6682
|
color: "modalTextDim",
|
|
6553
6683
|
size: "14"
|
|
@@ -6564,9 +6694,7 @@ function FeesLineItem({
|
|
|
6564
6694
|
color: "modalTextDim",
|
|
6565
6695
|
size: "14"
|
|
6566
6696
|
}, "(", formatCryptoAndStringify(
|
|
6567
|
-
parseFloat(
|
|
6568
|
-
feesItem.transactionFeesTokenAmount.toString()
|
|
6569
|
-
),
|
|
6697
|
+
parseFloat(feesItem.transactionFeesTokenAmount.toString()),
|
|
6570
6698
|
feesItem.transactionFeesTokenSymbol
|
|
6571
6699
|
), ")\xA0") : null, /* @__PURE__ */ React68.createElement(Text, {
|
|
6572
6700
|
weight: "medium",
|
|
@@ -6599,7 +6727,7 @@ function FeesLineItem({
|
|
|
6599
6727
|
size: "14"
|
|
6600
6728
|
}, formatCurrencyAndStringify(
|
|
6601
6729
|
parseFloat(feesItem.platformFeesUsd.toString())
|
|
6602
|
-
))) : null))
|
|
6730
|
+
))) : null)));
|
|
6603
6731
|
}
|
|
6604
6732
|
function FunTxSummaryDivider() {
|
|
6605
6733
|
return /* @__PURE__ */ React68.createElement(Box, {
|
|
@@ -7476,10 +7604,14 @@ function FunPaymentMoonpayType({
|
|
|
7476
7604
|
const [isSupportedRegion, setIsSupportedRegion] = useState20(true);
|
|
7477
7605
|
const [isBackToHomeDisabled, setIsBackToHomeDisabled] = useState20(true);
|
|
7478
7606
|
const funkitConfig = useFunkitConfig();
|
|
7607
|
+
const { userInfo } = useGeneralWallet();
|
|
7479
7608
|
const currencyCode = useMemo19(() => {
|
|
7480
7609
|
return generateMoonpayCurrencyCode(depositToken, depositTokenChainId);
|
|
7481
7610
|
}, [depositToken, depositTokenChainId]);
|
|
7482
|
-
const depositTokenAmountStringFormatted = formatTokenAmountForMoonpay(
|
|
7611
|
+
const depositTokenAmountStringFormatted = formatTokenAmountForMoonpay(
|
|
7612
|
+
depositTokenAmount,
|
|
7613
|
+
currencyCode
|
|
7614
|
+
);
|
|
7483
7615
|
const handleGetSignature = async (url) => {
|
|
7484
7616
|
const res = await getMoonpayUrlSignature(
|
|
7485
7617
|
url,
|
|
@@ -7506,7 +7638,6 @@ function FunPaymentMoonpayType({
|
|
|
7506
7638
|
}, [finalConvertedAssetName, funkitConfig == null ? void 0 : funkitConfig.appName, depositToken]);
|
|
7507
7639
|
const moonpayButtonColor = useMemo19(() => {
|
|
7508
7640
|
const primaryButtonHex = colorToHex(active2.colors.buttonPrimary);
|
|
7509
|
-
console.log("primaryButonHex", primaryButtonHex);
|
|
7510
7641
|
if (["#FFF", "#FFFF", "#FFFFFF", "#FFFFFFFF"].includes(primaryButtonHex)) {
|
|
7511
7642
|
return void 0;
|
|
7512
7643
|
} else {
|
|
@@ -7560,7 +7691,8 @@ function FunPaymentMoonpayType({
|
|
|
7560
7691
|
border: `1px solid ${active2.colors.modalTextDim}`
|
|
7561
7692
|
},
|
|
7562
7693
|
theme: active2.moonpayTheme,
|
|
7563
|
-
colorCode: moonpayButtonColor
|
|
7694
|
+
colorCode: moonpayButtonColor,
|
|
7695
|
+
externalCustomerId: userInfo.globalFunkitUserId
|
|
7564
7696
|
})), paymentFlow === 0 /* DEPOSIT */ ? /* @__PURE__ */ React79.createElement(Box, {
|
|
7565
7697
|
width: "full"
|
|
7566
7698
|
}, /* @__PURE__ */ React79.createElement(FunButton, {
|
|
@@ -7900,7 +8032,7 @@ function Deposit({
|
|
|
7900
8032
|
}
|
|
7901
8033
|
const previewTransfer = await meshPreviewTransfer2(
|
|
7902
8034
|
(_f2 = (_e2 = (_d2 = selectedPaymentMethodInfo == null ? void 0 : selectedPaymentMethodInfo.meta) == null ? void 0 : _d2.accessToken) == null ? void 0 : _e2.accountTokens) == null ? void 0 : _f2[0].accessToken,
|
|
7903
|
-
(_h2 = (_g2 = selectedPaymentMethodInfo == null ? void 0 : selectedPaymentMethodInfo.meta) == null ? void 0 : _g2.accessToken) == null ? void 0 : _h2.
|
|
8035
|
+
(_h2 = (_g2 = selectedPaymentMethodInfo == null ? void 0 : selectedPaymentMethodInfo.meta) == null ? void 0 : _g2.accessToken) == null ? void 0 : _h2.brokerType,
|
|
7904
8036
|
null,
|
|
7905
8037
|
null,
|
|
7906
8038
|
meshNetworkInfo.meshNetworkId,
|
|
@@ -8423,7 +8555,8 @@ var HomeTokenBalanceDisplayRow = ({ asset }) => {
|
|
|
8423
8555
|
assetSrc: asset.logo,
|
|
8424
8556
|
assetName: asset.name,
|
|
8425
8557
|
assetTicker: asset.symbol,
|
|
8426
|
-
chainId: asset.chainId
|
|
8558
|
+
chainId: asset.chainId,
|
|
8559
|
+
chainIconSize: "14"
|
|
8427
8560
|
}), /* @__PURE__ */ React92.createElement(Box, {
|
|
8428
8561
|
display: "flex",
|
|
8429
8562
|
flexDirection: "column",
|
|
@@ -8611,7 +8744,6 @@ function Home({
|
|
|
8611
8744
|
}
|
|
8612
8745
|
|
|
8613
8746
|
// src/components/ProfileDetails/FunProfileViews/Settings/Settings.tsx
|
|
8614
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5 } from "@funkit/core";
|
|
8615
8747
|
import React96, { useCallback as useCallback16, useState as useState24 } from "react";
|
|
8616
8748
|
import { useAccount as useAccount6 } from "wagmi";
|
|
8617
8749
|
|
|
@@ -8762,9 +8894,10 @@ function Settings({
|
|
|
8762
8894
|
}), /* @__PURE__ */ React96.createElement(FunIconButton, {
|
|
8763
8895
|
icon: /* @__PURE__ */ React96.createElement(RedirectIcon, null),
|
|
8764
8896
|
onClick: () => {
|
|
8897
|
+
var _a;
|
|
8765
8898
|
if (activeChain == null ? void 0 : activeChain.id) {
|
|
8766
8899
|
window.open(
|
|
8767
|
-
`${
|
|
8900
|
+
`${(_a = activeChain.blockExplorers) == null ? void 0 : _a.default.url}/address/${walletAddress}`,
|
|
8768
8901
|
"_blank"
|
|
8769
8902
|
);
|
|
8770
8903
|
}
|
|
@@ -11409,14 +11542,28 @@ function ConnectDetail({
|
|
|
11409
11542
|
alignItems: "center",
|
|
11410
11543
|
display: "flex",
|
|
11411
11544
|
height: "full",
|
|
11412
|
-
justifyContent: "center"
|
|
11545
|
+
justifyContent: "center",
|
|
11546
|
+
flexDirection: "column"
|
|
11413
11547
|
}, /* @__PURE__ */ React127.createElement(QRCode, {
|
|
11414
11548
|
logoBackground: iconBackground,
|
|
11415
11549
|
logoSize: compactModeEnabled ? 60 : 72,
|
|
11416
11550
|
logoUrl: iconUrl,
|
|
11417
11551
|
size: compactModeEnabled ? 318 : smallWindow ? Math.max(280, Math.min(windowWidth - 308, 382)) : 382,
|
|
11418
11552
|
uri: qrCodeUri
|
|
11419
|
-
})
|
|
11553
|
+
}), /* @__PURE__ */ React127.createElement(Box, {
|
|
11554
|
+
display: "flex",
|
|
11555
|
+
alignItems: "center",
|
|
11556
|
+
justifyContent: "center",
|
|
11557
|
+
paddingTop: "20"
|
|
11558
|
+
}, /* @__PURE__ */ React127.createElement(Text, {
|
|
11559
|
+
weight: "medium",
|
|
11560
|
+
color: "modalText",
|
|
11561
|
+
size: "14",
|
|
11562
|
+
style: { paddingRight: 8 }
|
|
11563
|
+
}, "Copy Link"), /* @__PURE__ */ React127.createElement(CopyAddress, {
|
|
11564
|
+
address: qrCodeUri,
|
|
11565
|
+
type: "button"
|
|
11566
|
+
}))) : /* @__PURE__ */ React127.createElement(Box, {
|
|
11420
11567
|
alignItems: "center",
|
|
11421
11568
|
display: "flex",
|
|
11422
11569
|
justifyContent: "center",
|
|
@@ -12367,16 +12514,16 @@ function ConnectModal({ onClose, open }) {
|
|
|
12367
12514
|
}
|
|
12368
12515
|
|
|
12369
12516
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
|
|
12370
|
-
import
|
|
12517
|
+
import React144, { useCallback as useCallback28, useMemo as useMemo34, useState as useState41 } from "react";
|
|
12371
12518
|
|
|
12372
12519
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
|
|
12373
12520
|
import {
|
|
12374
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
12521
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8
|
|
12375
12522
|
} from "@funkit/core";
|
|
12376
|
-
import
|
|
12523
|
+
import React141, { useMemo as useMemo32 } from "react";
|
|
12377
12524
|
|
|
12378
12525
|
// src/components/FunCheckoutModal/FunCheckoutPrimaryInfo.tsx
|
|
12379
|
-
import
|
|
12526
|
+
import React140, { useCallback as useCallback27, useEffect as useEffect29, useMemo as useMemo31, useState as useState39 } from "react";
|
|
12380
12527
|
|
|
12381
12528
|
// src/components/Icons/EditIcon.tsx
|
|
12382
12529
|
import React132 from "react";
|
|
@@ -12396,10 +12543,11 @@ var EditIcon = ({ size = "24" }) => /* @__PURE__ */ React132.createElement("svg"
|
|
|
12396
12543
|
|
|
12397
12544
|
// src/components/FunCheckoutModal/FunCheckoutModal.tsx
|
|
12398
12545
|
import {
|
|
12399
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
12546
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7,
|
|
12400
12547
|
getTokenInfo as getTokenInfo2
|
|
12401
12548
|
} from "@funkit/core";
|
|
12402
|
-
import
|
|
12549
|
+
import React139, { useCallback as useCallback26, useEffect as useEffect28, useMemo as useMemo30, useState as useState38 } from "react";
|
|
12550
|
+
import { mainnet as mainnet3 } from "viem/chains";
|
|
12403
12551
|
|
|
12404
12552
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
12405
12553
|
import { useCallback as useCallback22 } from "react";
|
|
@@ -12456,15 +12604,72 @@ function useCheckoutAccountBalanceTransfer(checkoutId) {
|
|
|
12456
12604
|
};
|
|
12457
12605
|
}
|
|
12458
12606
|
|
|
12607
|
+
// src/components/FunkitProvider/FunkitMoonpayProvider.tsx
|
|
12608
|
+
import React133, { createContext as createContext16, useContext as useContext22, useEffect as useEffect25, useState as useState34 } from "react";
|
|
12609
|
+
var MoonPayOriginalProvider = (props) => {
|
|
12610
|
+
const [MoonPayProviderInner, setMoonPayProviderInner] = useState34(null);
|
|
12611
|
+
useEffect25(() => {
|
|
12612
|
+
const loadMoonPayProviderInner = async () => {
|
|
12613
|
+
try {
|
|
12614
|
+
const module = await import("@moonpay/moonpay-react");
|
|
12615
|
+
setMoonPayProviderInner(() => module.MoonPayProvider);
|
|
12616
|
+
} catch (error) {
|
|
12617
|
+
logger.error("Failed to load MoonPayProvider", error);
|
|
12618
|
+
}
|
|
12619
|
+
};
|
|
12620
|
+
loadMoonPayProviderInner();
|
|
12621
|
+
}, []);
|
|
12622
|
+
if (!MoonPayProviderInner)
|
|
12623
|
+
return /* @__PURE__ */ React133.createElement(React133.Fragment, null, props.children);
|
|
12624
|
+
return /* @__PURE__ */ React133.createElement(MoonPayProviderInner, {
|
|
12625
|
+
...props
|
|
12626
|
+
}, props.children);
|
|
12627
|
+
};
|
|
12628
|
+
var FunkitMoonpayContext = createContext16({
|
|
12629
|
+
moonpayApiKey: ""
|
|
12630
|
+
});
|
|
12631
|
+
function FunkitMoonpayProvider({
|
|
12632
|
+
children,
|
|
12633
|
+
debug
|
|
12634
|
+
}) {
|
|
12635
|
+
const isSandboxMode = useIsFunkitSandboxMode();
|
|
12636
|
+
const moonpayApiKey = isSandboxMode ? "pk_test_dWfAhBbvVexIId9S5hPd78mKM7ivIsqu" : "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO";
|
|
12637
|
+
return /* @__PURE__ */ React133.createElement(MoonPayOriginalProvider, {
|
|
12638
|
+
apiKey: moonpayApiKey,
|
|
12639
|
+
debug
|
|
12640
|
+
}, /* @__PURE__ */ React133.createElement(FunkitMoonpayContext.Provider, {
|
|
12641
|
+
value: { moonpayApiKey }
|
|
12642
|
+
}, children));
|
|
12643
|
+
}
|
|
12644
|
+
function useFunkitMoonpayUserIp() {
|
|
12645
|
+
const [userIpInfo, setUserIpInfo] = useState34(
|
|
12646
|
+
null
|
|
12647
|
+
);
|
|
12648
|
+
const { moonpayApiKey } = useContext22(FunkitMoonpayContext);
|
|
12649
|
+
const getUserIpViaMoonpay = async () => {
|
|
12650
|
+
const response = await fetch(
|
|
12651
|
+
`https://api.moonpay.com/v3/ip_address?apiKey=${moonpayApiKey}`
|
|
12652
|
+
);
|
|
12653
|
+
const responseJson = await response.json();
|
|
12654
|
+
setUserIpInfo(responseJson);
|
|
12655
|
+
};
|
|
12656
|
+
useEffect25(() => {
|
|
12657
|
+
getUserIpViaMoonpay().catch(
|
|
12658
|
+
(err) => logger.error("getUserIpViaMoonpay:error", err)
|
|
12659
|
+
);
|
|
12660
|
+
}, []);
|
|
12661
|
+
return userIpInfo;
|
|
12662
|
+
}
|
|
12663
|
+
|
|
12459
12664
|
// src/components/FunCheckoutModal/FunCheckoutConfirmationStep.tsx
|
|
12460
12665
|
import {
|
|
12461
12666
|
ERC20_ABI,
|
|
12462
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
12667
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5,
|
|
12463
12668
|
getPaymasterDataForCheckoutSponsoredTransfer,
|
|
12464
12669
|
isAddress as isAddress3,
|
|
12465
12670
|
meshPreviewTransfer as meshPreviewTransfer3
|
|
12466
12671
|
} from "@funkit/core";
|
|
12467
|
-
import
|
|
12672
|
+
import React134, { useCallback as useCallback23, useMemo as useMemo27, useState as useState35 } from "react";
|
|
12468
12673
|
import { useAccount as useAccount10, useSendTransaction, useWriteContract } from "wagmi";
|
|
12469
12674
|
function FunCheckoutConfirmationStep({
|
|
12470
12675
|
checkoutId,
|
|
@@ -12489,16 +12694,16 @@ function FunCheckoutConfirmationStep({
|
|
|
12489
12694
|
const hasDraftValueAndMethodError = ((_a = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a.paymentMethod) === "card" /* CARD */ && isAmountValidForMoonpay({
|
|
12490
12695
|
amountUsd: ((checkoutItem == null ? void 0 : checkoutItem.draftDollarValue) || 0).toString()
|
|
12491
12696
|
});
|
|
12492
|
-
const [isConfirming, setIsConfirming] =
|
|
12493
|
-
const [checkoutStepMessage, setCheckoutStepMessage] =
|
|
12494
|
-
const [confirmationError, setConfirmationError] =
|
|
12697
|
+
const [isConfirming, setIsConfirming] = useState35(false);
|
|
12698
|
+
const [checkoutStepMessage, setCheckoutStepMessage] = useState35("");
|
|
12699
|
+
const [confirmationError, setConfirmationError] = useState35("");
|
|
12495
12700
|
const hasCheckoutConfirmationError = useMemo27(
|
|
12496
12701
|
() => confirmationError !== "",
|
|
12497
12702
|
[confirmationError]
|
|
12498
12703
|
);
|
|
12499
|
-
const [isPostCheckoutLoading, setIsPostCheckoutLoading] =
|
|
12500
|
-
const [postCheckoutStepMessage, setPostCheckoutStepMessage] =
|
|
12501
|
-
const [postCheckoutError, setPostCheckoutError] =
|
|
12704
|
+
const [isPostCheckoutLoading, setIsPostCheckoutLoading] = useState35(false);
|
|
12705
|
+
const [postCheckoutStepMessage, setPostCheckoutStepMessage] = useState35("");
|
|
12706
|
+
const [postCheckoutError, setPostCheckoutError] = useState35("");
|
|
12502
12707
|
const hasPostCheckoutError = useMemo27(
|
|
12503
12708
|
() => postCheckoutError !== "",
|
|
12504
12709
|
[postCheckoutError]
|
|
@@ -12517,7 +12722,7 @@ function FunCheckoutConfirmationStep({
|
|
|
12517
12722
|
}
|
|
12518
12723
|
return await meshPreviewTransfer3(
|
|
12519
12724
|
(_h2 = (_g2 = (_f2 = (_e2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _e2.meta) == null ? void 0 : _f2.accessToken) == null ? void 0 : _g2.accountTokens) == null ? void 0 : _h2[0].accessToken,
|
|
12520
|
-
(_k2 = (_j2 = (_i2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _i2.meta) == null ? void 0 : _j2.accessToken) == null ? void 0 : _k2.
|
|
12725
|
+
(_k2 = (_j2 = (_i2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _i2.meta) == null ? void 0 : _j2.accessToken) == null ? void 0 : _k2.brokerType,
|
|
12521
12726
|
null,
|
|
12522
12727
|
null,
|
|
12523
12728
|
(_m2 = (_l2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _l2.meta) == null ? void 0 : _m2.checkoutMeshNetworkId,
|
|
@@ -12535,7 +12740,7 @@ function FunCheckoutConfirmationStep({
|
|
|
12535
12740
|
[
|
|
12536
12741
|
(_b = checkoutItem == null ? void 0 : checkoutItem.latestQuote) == null ? void 0 : _b.baseQuote.estTotalFromAmount,
|
|
12537
12742
|
(_e = (_d = (_c = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _c.meta) == null ? void 0 : _d.accessToken) == null ? void 0 : _e.accountTokens,
|
|
12538
|
-
(_h = (_g = (_f = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _f.meta) == null ? void 0 : _g.accessToken) == null ? void 0 : _h.
|
|
12743
|
+
(_h = (_g = (_f = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _f.meta) == null ? void 0 : _g.accessToken) == null ? void 0 : _h.brokerType,
|
|
12539
12744
|
(_j = (_i = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _i.meta) == null ? void 0 : _j.checkoutMeshNetworkId,
|
|
12540
12745
|
(_k = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _k.symbol,
|
|
12541
12746
|
funkitConfig.apiKey
|
|
@@ -12593,13 +12798,15 @@ function FunCheckoutConfirmationStep({
|
|
|
12593
12798
|
return;
|
|
12594
12799
|
const sourceAssetChainId = checkoutItem.selectedSourceAssetInfo.chainId;
|
|
12595
12800
|
const sourceAssetAddress = (_b2 = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _b2.address;
|
|
12596
|
-
const sourceAssetAmountBaseUnit =
|
|
12801
|
+
const sourceAssetAmountBaseUnit = BigInt(
|
|
12802
|
+
checkoutItem.latestQuote.baseQuote.estTotalFromAmountBaseUnit
|
|
12803
|
+
);
|
|
12597
12804
|
if (parseInt(sourceAssetChainId) !== (chain == null ? void 0 : chain.id)) {
|
|
12598
12805
|
logger.log("handleWeb3AccountBalancePostCheckout_needToSwitchChhain", {
|
|
12599
12806
|
sourceAssetChainId,
|
|
12600
12807
|
currentChain: chain
|
|
12601
12808
|
});
|
|
12602
|
-
const chainName =
|
|
12809
|
+
const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5[sourceAssetChainId].chainInfo.name;
|
|
12603
12810
|
setPostCheckoutStepMessage(
|
|
12604
12811
|
WEB3_ACCOUNT_BALANCE_MESSAGE_GENERATOR[1 /* SWITCH_CHAIN */](chainName)
|
|
12605
12812
|
);
|
|
@@ -12612,9 +12819,12 @@ function FunCheckoutConfirmationStep({
|
|
|
12612
12819
|
const hash = await sendTransactionAsync({
|
|
12613
12820
|
chainId: parseInt(sourceAssetChainId),
|
|
12614
12821
|
to: depositAddress,
|
|
12615
|
-
value:
|
|
12822
|
+
value: sourceAssetAmountBaseUnit
|
|
12823
|
+
});
|
|
12824
|
+
logger.log("handleWeb3AccountBalancePostCheckout_hash", {
|
|
12825
|
+
hash,
|
|
12826
|
+
sourceAssetAmountBaseUnit
|
|
12616
12827
|
});
|
|
12617
|
-
logger.log("handleWeb3AccountBalancePostCheckout_hash", { hash });
|
|
12618
12828
|
} else {
|
|
12619
12829
|
const hash = await writeContractAsync({
|
|
12620
12830
|
chainId: parseInt(sourceAssetChainId),
|
|
@@ -12623,7 +12833,10 @@ function FunCheckoutConfirmationStep({
|
|
|
12623
12833
|
functionName: "transfer",
|
|
12624
12834
|
args: [depositAddress, sourceAssetAmountBaseUnit]
|
|
12625
12835
|
});
|
|
12626
|
-
logger.log("handleWeb3AccountBalancePostCheckout_hash", {
|
|
12836
|
+
logger.log("handleWeb3AccountBalancePostCheckout_hash", {
|
|
12837
|
+
hash,
|
|
12838
|
+
sourceAssetAmountBaseUnit
|
|
12839
|
+
});
|
|
12627
12840
|
}
|
|
12628
12841
|
setPostCheckoutStepMessage("");
|
|
12629
12842
|
},
|
|
@@ -12775,7 +12988,7 @@ function FunCheckoutConfirmationStep({
|
|
|
12775
12988
|
]);
|
|
12776
12989
|
const paymentTokenString = useMemo27(() => {
|
|
12777
12990
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
12778
|
-
const sourceChainName = ((_a2 = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _a2.chainId) ? (_d2 = (_c2 =
|
|
12991
|
+
const sourceChainName = ((_a2 = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _a2.chainId) ? (_d2 = (_c2 = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5) == null ? void 0 : _c2[(_b2 = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _b2.chainId]) == null ? void 0 : _d2.name : "";
|
|
12779
12992
|
return formatCryptoAndStringify(
|
|
12780
12993
|
parseFloat(((_e2 = checkoutItem == null ? void 0 : checkoutItem.latestQuote) == null ? void 0 : _e2.finalPaymentTokenAmount) || "0"),
|
|
12781
12994
|
`${(_f2 = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _f2.symbol}${sourceChainName ? ` (${sourceChainName})` : ""}` || ""
|
|
@@ -12786,23 +12999,23 @@ function FunCheckoutConfirmationStep({
|
|
|
12786
12999
|
(_q = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _q.symbol
|
|
12787
13000
|
]);
|
|
12788
13001
|
const hasError = hasDraftValueAndMethodError || hasQuoteError || hasCheckoutConfirmationError || hasPostCheckoutError;
|
|
12789
|
-
return /* @__PURE__ */
|
|
13002
|
+
return /* @__PURE__ */ React134.createElement(Box, {
|
|
12790
13003
|
display: "flex",
|
|
12791
13004
|
flexDirection: "column",
|
|
12792
13005
|
gap: "24",
|
|
12793
13006
|
paddingY: "24",
|
|
12794
13007
|
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
12795
|
-
}, /* @__PURE__ */
|
|
13008
|
+
}, /* @__PURE__ */ React134.createElement(CheckoutPrimaryInfo, {
|
|
12796
13009
|
checkoutId,
|
|
12797
13010
|
checkoutStep
|
|
12798
|
-
}), /* @__PURE__ */
|
|
13011
|
+
}), /* @__PURE__ */ React134.createElement(Box, {
|
|
12799
13012
|
display: "flex",
|
|
12800
13013
|
flexDirection: "column",
|
|
12801
13014
|
gap: "24"
|
|
12802
|
-
}, (checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) ? /* @__PURE__ */
|
|
13015
|
+
}, (checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) ? /* @__PURE__ */ React134.createElement(ExistingPaymentMethodItem, {
|
|
12803
13016
|
paymentMethodInfo: checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo,
|
|
12804
13017
|
isClickable: false
|
|
12805
|
-
}) : null, /* @__PURE__ */
|
|
13018
|
+
}) : null, /* @__PURE__ */ React134.createElement(FunTransactionSummary, {
|
|
12806
13019
|
estFees: {
|
|
12807
13020
|
totalUsd: parseInputToNumber(
|
|
12808
13021
|
(_r = checkoutItem == null ? void 0 : checkoutItem.latestQuote) == null ? void 0 : _r.finalFeesBreakdown.totalFeesUsd
|
|
@@ -12825,31 +13038,31 @@ function FunCheckoutConfirmationStep({
|
|
|
12825
13038
|
1 /* CHECKOUT */,
|
|
12826
13039
|
false
|
|
12827
13040
|
) : hasQuoteError ? checkoutItem == null ? void 0 : checkoutItem.quoteErrorMessage : hasCheckoutConfirmationError ? confirmationError : hasPostCheckoutError ? postCheckoutError : ""
|
|
12828
|
-
})), !hasError && (postCheckoutStepMessage || checkoutStepMessage) ? /* @__PURE__ */
|
|
13041
|
+
})), !hasError && (postCheckoutStepMessage || checkoutStepMessage) ? /* @__PURE__ */ React134.createElement(FunNotification, {
|
|
12829
13042
|
description: postCheckoutStepMessage || checkoutStepMessage,
|
|
12830
13043
|
type: "default"
|
|
12831
|
-
}) : null, /* @__PURE__ */
|
|
13044
|
+
}) : null, /* @__PURE__ */ React134.createElement(Box, {
|
|
12832
13045
|
display: "flex",
|
|
12833
13046
|
flexDirection: "column",
|
|
12834
13047
|
gap: "4"
|
|
12835
|
-
}, /* @__PURE__ */
|
|
13048
|
+
}, /* @__PURE__ */ React134.createElement(FunButton, {
|
|
12836
13049
|
title: "Confirm Order",
|
|
12837
13050
|
isDisabled: (checkoutItem == null ? void 0 : checkoutItem.isQuoting) || (checkoutItem == null ? void 0 : checkoutItem.isDrafting) || isConfirming || hasDraftValueAndMethodError || hasQuoteError || isPostCheckoutLoading || hasCheckoutConfirmationError || hasPostCheckoutError,
|
|
12838
|
-
titleSuffix: isConfirming || isPostCheckoutLoading ? /* @__PURE__ */
|
|
13051
|
+
titleSuffix: isConfirming || isPostCheckoutLoading ? /* @__PURE__ */ React134.createElement(Box, {
|
|
12839
13052
|
display: "flex",
|
|
12840
13053
|
alignItems: "center",
|
|
12841
13054
|
color: "modalText"
|
|
12842
|
-
}, /* @__PURE__ */
|
|
13055
|
+
}, /* @__PURE__ */ React134.createElement(SpinnerIcon, {
|
|
12843
13056
|
height: 16,
|
|
12844
13057
|
width: 16
|
|
12845
13058
|
})) : null,
|
|
12846
13059
|
onClick: onClickConfirm
|
|
12847
|
-
}), /* @__PURE__ */
|
|
13060
|
+
}), /* @__PURE__ */ React134.createElement(FunTermsAndConditionsTextButton, null)));
|
|
12848
13061
|
}
|
|
12849
13062
|
|
|
12850
13063
|
// src/components/FunCheckoutModal/FunCheckoutInputAmountStep.tsx
|
|
12851
13064
|
import { getAssetPriceInfoForCheckout as getAssetPriceInfoForCheckout3 } from "@funkit/core";
|
|
12852
|
-
import
|
|
13065
|
+
import React135, { useCallback as useCallback24, useEffect as useEffect26, useMemo as useMemo28, useState as useState36 } from "react";
|
|
12853
13066
|
function FunCheckoutInputAmountStep({
|
|
12854
13067
|
checkoutId,
|
|
12855
13068
|
onContinue,
|
|
@@ -12858,12 +13071,12 @@ function FunCheckoutInputAmountStep({
|
|
|
12858
13071
|
const { active: active2 } = useActiveTheme();
|
|
12859
13072
|
const { checkoutItem, updateTargetAssetAmount, getCheckoutDraftDollarValue } = useFunkitPreCheckoutInternal(checkoutId);
|
|
12860
13073
|
const initialAmount = (checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetAssetAmount) || 0;
|
|
12861
|
-
const [amountInput, setAmountInput] =
|
|
13074
|
+
const [amountInput, setAmountInput] = useState36(
|
|
12862
13075
|
initialAmount === 0 ? "" : initialAmount.toFixed(4)
|
|
12863
13076
|
);
|
|
12864
|
-
const [unitPrice, setUnitPrice] =
|
|
12865
|
-
const [errorMessage, setErrorMessage] =
|
|
12866
|
-
|
|
13077
|
+
const [unitPrice, setUnitPrice] = useState36(0);
|
|
13078
|
+
const [errorMessage, setErrorMessage] = useState36("");
|
|
13079
|
+
useEffect26(() => {
|
|
12867
13080
|
const fetchPrice = async () => {
|
|
12868
13081
|
var _a, _b, _c, _d;
|
|
12869
13082
|
try {
|
|
@@ -12886,7 +13099,7 @@ function FunCheckoutInputAmountStep({
|
|
|
12886
13099
|
const usdEquivalent = useMemo28(() => {
|
|
12887
13100
|
return unitPrice * Number(amountInput);
|
|
12888
13101
|
}, [amountInput, unitPrice]);
|
|
12889
|
-
const [isContinuing, setIsContinuing] =
|
|
13102
|
+
const [isContinuing, setIsContinuing] = useState36(false);
|
|
12890
13103
|
const onClickContinue = useCallback24(async () => {
|
|
12891
13104
|
setIsContinuing(true);
|
|
12892
13105
|
await updateTargetAssetAmount(parseFloat(amountInput));
|
|
@@ -12899,21 +13112,21 @@ function FunCheckoutInputAmountStep({
|
|
|
12899
13112
|
onContinue,
|
|
12900
13113
|
updateTargetAssetAmount
|
|
12901
13114
|
]);
|
|
12902
|
-
return /* @__PURE__ */
|
|
13115
|
+
return /* @__PURE__ */ React135.createElement(Box, {
|
|
12903
13116
|
display: "flex",
|
|
12904
13117
|
flexDirection: "column",
|
|
12905
13118
|
gap: "24",
|
|
12906
13119
|
paddingY: "24",
|
|
12907
13120
|
width: "full",
|
|
12908
13121
|
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
12909
|
-
}, /* @__PURE__ */
|
|
13122
|
+
}, /* @__PURE__ */ React135.createElement(Box, {
|
|
12910
13123
|
display: "flex",
|
|
12911
13124
|
flexDirection: "column",
|
|
12912
13125
|
justifyContent: "center",
|
|
12913
13126
|
alignItems: "center",
|
|
12914
13127
|
gap: "8",
|
|
12915
13128
|
width: "full"
|
|
12916
|
-
}, /* @__PURE__ */
|
|
13129
|
+
}, /* @__PURE__ */ React135.createElement(FunInput, {
|
|
12917
13130
|
value: amountInput,
|
|
12918
13131
|
placeholder: "0",
|
|
12919
13132
|
onChange: (newAmount) => setAmountInput(newAmount.target.value),
|
|
@@ -12931,22 +13144,22 @@ function FunCheckoutInputAmountStep({
|
|
|
12931
13144
|
},
|
|
12932
13145
|
hasBackground: false,
|
|
12933
13146
|
textColor: "modalText"
|
|
12934
|
-
}), /* @__PURE__ */
|
|
13147
|
+
}), /* @__PURE__ */ React135.createElement(Text, {
|
|
12935
13148
|
color: "modalTextSecondary"
|
|
12936
|
-
}, formatCurrencyAndStringify(usdEquivalent)), errorMessage ? /* @__PURE__ */
|
|
13149
|
+
}, formatCurrencyAndStringify(usdEquivalent)), errorMessage ? /* @__PURE__ */ React135.createElement(Box, {
|
|
12937
13150
|
width: "full",
|
|
12938
13151
|
paddingTop: "16"
|
|
12939
|
-
}, /* @__PURE__ */
|
|
13152
|
+
}, /* @__PURE__ */ React135.createElement(FunNotification, {
|
|
12940
13153
|
type: "error",
|
|
12941
13154
|
description: errorMessage
|
|
12942
|
-
})) : null), /* @__PURE__ */
|
|
13155
|
+
})) : null), /* @__PURE__ */ React135.createElement(FunButton, {
|
|
12943
13156
|
title: "Continue",
|
|
12944
13157
|
isDisabled: isContinuing || (parseFloat(amountInput) || 0) <= 0 || usdEquivalent <= 0,
|
|
12945
|
-
titleSuffix: isContinuing ? /* @__PURE__ */
|
|
13158
|
+
titleSuffix: isContinuing ? /* @__PURE__ */ React135.createElement(Box, {
|
|
12946
13159
|
display: "flex",
|
|
12947
13160
|
alignItems: "center",
|
|
12948
13161
|
color: "modalText"
|
|
12949
|
-
}, /* @__PURE__ */
|
|
13162
|
+
}, /* @__PURE__ */ React135.createElement(SpinnerIcon, {
|
|
12950
13163
|
height: 16,
|
|
12951
13164
|
width: 16
|
|
12952
13165
|
})) : null,
|
|
@@ -12957,19 +13170,19 @@ function FunCheckoutInputAmountStep({
|
|
|
12957
13170
|
// src/components/FunCheckoutModal/FunCheckoutSelectAssetStep.tsx
|
|
12958
13171
|
import {
|
|
12959
13172
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
|
|
12960
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
13173
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6
|
|
12961
13174
|
} from "@funkit/core";
|
|
12962
|
-
import
|
|
13175
|
+
import React137, { useCallback as useCallback25, useEffect as useEffect27, useMemo as useMemo29, useState as useState37 } from "react";
|
|
12963
13176
|
|
|
12964
13177
|
// src/components/FunBadge/FunBadge.tsx
|
|
12965
|
-
import
|
|
13178
|
+
import React136 from "react";
|
|
12966
13179
|
function FunBadge({ text }) {
|
|
12967
|
-
return /* @__PURE__ */
|
|
13180
|
+
return /* @__PURE__ */ React136.createElement(Box, {
|
|
12968
13181
|
background: "notificationPrimary",
|
|
12969
13182
|
paddingX: "8",
|
|
12970
13183
|
borderRadius: "6",
|
|
12971
13184
|
style: { width: "fit-content" }
|
|
12972
|
-
}, /* @__PURE__ */
|
|
13185
|
+
}, /* @__PURE__ */ React136.createElement(Text, {
|
|
12973
13186
|
size: "10",
|
|
12974
13187
|
color: "modalTextSecondary",
|
|
12975
13188
|
weight: "medium"
|
|
@@ -12984,9 +13197,9 @@ function MeshOrAccountSelectAsset({
|
|
|
12984
13197
|
isOnFinishLoading
|
|
12985
13198
|
}) {
|
|
12986
13199
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
12987
|
-
const [accountHoldingsMap, setAccountHoldingsMap] =
|
|
12988
|
-
const [isLoadingAssets, setIsLoadingAssets] =
|
|
12989
|
-
const [selectedChainTokenSymbol, setSelectedChainTokenSymbol] =
|
|
13200
|
+
const [accountHoldingsMap, setAccountHoldingsMap] = useState37({});
|
|
13201
|
+
const [isLoadingAssets, setIsLoadingAssets] = useState37(true);
|
|
13202
|
+
const [selectedChainTokenSymbol, setSelectedChainTokenSymbol] = useState37("");
|
|
12990
13203
|
const { checkoutItem, updateSourceAsset } = useFunkitPreCheckoutInternal(checkoutId);
|
|
12991
13204
|
const { isCheckoutCrFlow } = useCheckoutType(checkoutItem);
|
|
12992
13205
|
const draftDollarValueNormalized = (checkoutItem == null ? void 0 : checkoutItem.draftDollarValue) || 0;
|
|
@@ -13078,18 +13291,18 @@ function MeshOrAccountSelectAsset({
|
|
|
13078
13291
|
const generateAccountHoldingsMapForBalance = useCallback25(async () => {
|
|
13079
13292
|
const itemMap = {};
|
|
13080
13293
|
const checkoutTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain;
|
|
13081
|
-
const isCheckoutOnMainnet =
|
|
13294
|
+
const isCheckoutOnMainnet = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[checkoutTargetChainId || ""].isFiatCheckoutSupported;
|
|
13082
13295
|
Object.values(walletAssets || {}).forEach((fwAsset) => {
|
|
13083
13296
|
var _a2, _b2, _c2, _d2;
|
|
13084
13297
|
if (!fwAsset.symbol || !fwAsset.contractAddress)
|
|
13085
13298
|
return;
|
|
13086
|
-
const isAssetOnMainnet =
|
|
13299
|
+
const isAssetOnMainnet = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[fwAsset.chainId].isFiatCheckoutSupported;
|
|
13087
13300
|
if (isCheckoutOnMainnet && !isAssetOnMainnet)
|
|
13088
13301
|
return;
|
|
13089
13302
|
if (!isCheckoutOnMainnet && checkoutTargetChainId !== fwAsset.chainId)
|
|
13090
13303
|
return;
|
|
13091
13304
|
let normalizedTokenAddress = fwAsset.contractAddress;
|
|
13092
|
-
if (((_d2 = (_c2 = (_b2 = (_a2 =
|
|
13305
|
+
if (((_d2 = (_c2 = (_b2 = (_a2 = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6) == null ? void 0 : _a2[fwAsset.chainId]) == null ? void 0 : _b2.nativeCurrency) == null ? void 0 : _c2.symbol) == null ? void 0 : _d2.toUpperCase()) === fwAsset.symbol.toUpperCase()) {
|
|
13093
13306
|
normalizedTokenAddress = FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3;
|
|
13094
13307
|
}
|
|
13095
13308
|
const chainSymbol = combineChainSymbolOrAddress2({
|
|
@@ -13112,7 +13325,7 @@ function MeshOrAccountSelectAsset({
|
|
|
13112
13325
|
});
|
|
13113
13326
|
return itemMap;
|
|
13114
13327
|
}, [checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain, walletAssets]);
|
|
13115
|
-
|
|
13328
|
+
useEffect27(() => {
|
|
13116
13329
|
async function fetchAccountHoldings() {
|
|
13117
13330
|
var _a2;
|
|
13118
13331
|
const isMapInited = Object.keys(accountHoldingsMap).length > 0;
|
|
@@ -13155,33 +13368,33 @@ function MeshOrAccountSelectAsset({
|
|
|
13155
13368
|
return {
|
|
13156
13369
|
value: chainSymbolKey,
|
|
13157
13370
|
isDisabled: isTokenDisabled,
|
|
13158
|
-
label: /* @__PURE__ */
|
|
13371
|
+
label: /* @__PURE__ */ React137.createElement(Box, {
|
|
13159
13372
|
alignItems: "center",
|
|
13160
13373
|
display: "flex",
|
|
13161
13374
|
flexDirection: "row",
|
|
13162
13375
|
justifyContent: "space-between",
|
|
13163
13376
|
style: { fontSize: 12 },
|
|
13164
13377
|
key: chainSymbolKey
|
|
13165
|
-
}, /* @__PURE__ */
|
|
13378
|
+
}, /* @__PURE__ */ React137.createElement(Box, {
|
|
13166
13379
|
display: "flex",
|
|
13167
13380
|
justifyContent: "flex-start",
|
|
13168
13381
|
alignItems: "center",
|
|
13169
13382
|
gap: "8"
|
|
13170
|
-
}, /* @__PURE__ */
|
|
13383
|
+
}, /* @__PURE__ */ React137.createElement(FunAssetAvatar, {
|
|
13171
13384
|
assetSrc: item.iconSrc,
|
|
13172
13385
|
assetTicker: item.symbol,
|
|
13173
13386
|
assetName: item.symbol,
|
|
13174
13387
|
assetIconSize: "24",
|
|
13175
13388
|
chainId: item.pickedChainId,
|
|
13176
13389
|
chainIconSize: "10"
|
|
13177
|
-
}), /* @__PURE__ */
|
|
13390
|
+
}), /* @__PURE__ */ React137.createElement(Box, null, /* @__PURE__ */ React137.createElement("div", null, item.symbol), isNotNullish(item.amount) ? /* @__PURE__ */ React137.createElement("div", null, formatCryptoAndStringify(item.amount)) : null)), /* @__PURE__ */ React137.createElement(Box, {
|
|
13178
13391
|
display: "flex",
|
|
13179
13392
|
alignItems: "center",
|
|
13180
13393
|
justifyContent: "flex-end",
|
|
13181
13394
|
gap: "8"
|
|
13182
|
-
}, badgeText ? /* @__PURE__ */
|
|
13395
|
+
}, badgeText ? /* @__PURE__ */ React137.createElement(FunBadge, {
|
|
13183
13396
|
text: badgeText
|
|
13184
|
-
}) : null, /* @__PURE__ */
|
|
13397
|
+
}) : null, /* @__PURE__ */ React137.createElement("div", null, formatCurrencyAndStringify(item.usdAmount || 0)))),
|
|
13185
13398
|
labelMeta: item.usdAmount
|
|
13186
13399
|
};
|
|
13187
13400
|
}).sort(
|
|
@@ -13210,36 +13423,36 @@ function MeshOrAccountSelectAsset({
|
|
|
13210
13423
|
quoteNotificationMessage,
|
|
13211
13424
|
clearCheckoutQuoteMessages
|
|
13212
13425
|
} = useCheckoutQuoteNotification(checkoutId || "");
|
|
13213
|
-
const [insufficientAssetError, setInsufficientAssetError] =
|
|
13426
|
+
const [insufficientAssetError, setInsufficientAssetError] = useState37("");
|
|
13214
13427
|
const hasInsufficientAssetError = !!insufficientAssetError;
|
|
13215
|
-
|
|
13428
|
+
useEffect27(() => {
|
|
13216
13429
|
if (checkoutItem == null ? void 0 : checkoutItem.isDrafting) {
|
|
13217
13430
|
setSelectedChainTokenSymbol("");
|
|
13218
13431
|
setInsufficientAssetError("");
|
|
13219
13432
|
}
|
|
13220
13433
|
}, [checkoutItem == null ? void 0 : checkoutItem.isDrafting]);
|
|
13221
|
-
return /* @__PURE__ */
|
|
13434
|
+
return /* @__PURE__ */ React137.createElement(Box, null, /* @__PURE__ */ React137.createElement(CheckoutPrimaryInfo, {
|
|
13222
13435
|
checkoutId,
|
|
13223
13436
|
checkoutStep
|
|
13224
|
-
}), /* @__PURE__ */
|
|
13437
|
+
}), /* @__PURE__ */ React137.createElement(Box, {
|
|
13225
13438
|
display: "flex",
|
|
13226
13439
|
flexDirection: "column",
|
|
13227
13440
|
gap: "10",
|
|
13228
13441
|
paddingTop: "24"
|
|
13229
|
-
}, /* @__PURE__ */
|
|
13442
|
+
}, /* @__PURE__ */ React137.createElement(Text, {
|
|
13230
13443
|
color: "modalTextSecondary",
|
|
13231
13444
|
size: "18",
|
|
13232
13445
|
weight: "semibold"
|
|
13233
|
-
}, funkitConfig.textCustomizations.payWith)), /* @__PURE__ */
|
|
13446
|
+
}, funkitConfig.textCustomizations.payWith)), /* @__PURE__ */ React137.createElement(Box, {
|
|
13234
13447
|
paddingBottom: "24",
|
|
13235
13448
|
paddingTop: "8"
|
|
13236
|
-
}, isLoadingAssets ? /* @__PURE__ */
|
|
13449
|
+
}, isLoadingAssets ? /* @__PURE__ */ React137.createElement(Box, {
|
|
13237
13450
|
display: "flex",
|
|
13238
13451
|
flexDirection: "column",
|
|
13239
13452
|
gap: "10"
|
|
13240
|
-
}, /* @__PURE__ */
|
|
13453
|
+
}, /* @__PURE__ */ React137.createElement(SkeletalLoader, {
|
|
13241
13454
|
key: "skeletal-loader"
|
|
13242
|
-
})) : /* @__PURE__ */
|
|
13455
|
+
})) : /* @__PURE__ */ React137.createElement(FunSelectDropdown, {
|
|
13243
13456
|
handleSelect: (newValue) => {
|
|
13244
13457
|
setSelectedChainTokenSymbol(newValue);
|
|
13245
13458
|
clearCheckoutQuoteMessages();
|
|
@@ -13258,20 +13471,20 @@ function MeshOrAccountSelectAsset({
|
|
|
13258
13471
|
selectedValue: selectedChainTokenSymbol || "",
|
|
13259
13472
|
optionItemPadding: "12",
|
|
13260
13473
|
showBorder: false
|
|
13261
|
-
})), hasInsufficientAssetError || showQuoteNotification ? /* @__PURE__ */
|
|
13474
|
+
})), hasInsufficientAssetError || showQuoteNotification ? /* @__PURE__ */ React137.createElement(Box, {
|
|
13262
13475
|
paddingBottom: "24"
|
|
13263
|
-
}, /* @__PURE__ */
|
|
13476
|
+
}, /* @__PURE__ */ React137.createElement(FunNotification, {
|
|
13264
13477
|
type: hasQuoteError ? "error" : "default",
|
|
13265
13478
|
description: quoteNotificationMessage || insufficientAssetError
|
|
13266
|
-
})) : null, /* @__PURE__ */
|
|
13479
|
+
})) : null, /* @__PURE__ */ React137.createElement(FunButton, {
|
|
13267
13480
|
type: "primary",
|
|
13268
13481
|
title: "Continue",
|
|
13269
13482
|
isDisabled: !selectedChainTokenSymbol || hasInsufficientAssetError || (checkoutItem == null ? void 0 : checkoutItem.isDrafting) || showQuoteNotification || isOnFinishLoading,
|
|
13270
|
-
titleSuffix: isOnFinishLoading ? /* @__PURE__ */
|
|
13483
|
+
titleSuffix: isOnFinishLoading ? /* @__PURE__ */ React137.createElement(Box, {
|
|
13271
13484
|
display: "flex",
|
|
13272
13485
|
alignItems: "center",
|
|
13273
13486
|
color: "modalText"
|
|
13274
|
-
}, /* @__PURE__ */
|
|
13487
|
+
}, /* @__PURE__ */ React137.createElement(SpinnerIcon, {
|
|
13275
13488
|
height: 16,
|
|
13276
13489
|
width: 16
|
|
13277
13490
|
})) : null,
|
|
@@ -13287,7 +13500,7 @@ function FunCheckoutSelectAssetStep({
|
|
|
13287
13500
|
}) {
|
|
13288
13501
|
var _a, _b;
|
|
13289
13502
|
const { checkoutItem } = useFunkitPreCheckoutInternal(checkoutId);
|
|
13290
|
-
return /* @__PURE__ */
|
|
13503
|
+
return /* @__PURE__ */ React137.createElement(Box, {
|
|
13291
13504
|
display: "flex",
|
|
13292
13505
|
flexDirection: "column",
|
|
13293
13506
|
gap: "24",
|
|
@@ -13295,18 +13508,18 @@ function FunCheckoutSelectAssetStep({
|
|
|
13295
13508
|
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
13296
13509
|
}, isNotNullish((_a = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a.paymentMethod) && ["brokerage" /* BROKERAGE */, "balance" /* ACCOUNT_BALANCE */].includes(
|
|
13297
13510
|
(_b = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _b.paymentMethod
|
|
13298
|
-
) ? /* @__PURE__ */
|
|
13511
|
+
) ? /* @__PURE__ */ React137.createElement(MeshOrAccountSelectAsset, {
|
|
13299
13512
|
isOnFinishLoading,
|
|
13300
13513
|
onFinish,
|
|
13301
13514
|
checkoutId,
|
|
13302
13515
|
checkoutStep
|
|
13303
|
-
}) : /* @__PURE__ */
|
|
13516
|
+
}) : /* @__PURE__ */ React137.createElement(Text, {
|
|
13304
13517
|
color: "modalTextSecondary"
|
|
13305
13518
|
}, "Unsupported payment method"));
|
|
13306
13519
|
}
|
|
13307
13520
|
|
|
13308
13521
|
// src/components/FunCheckoutModal/FunCheckoutVerifyDetailsStep.tsx
|
|
13309
|
-
import
|
|
13522
|
+
import React138 from "react";
|
|
13310
13523
|
function FunCheckoutVerifyDetailsStep({
|
|
13311
13524
|
checkoutId,
|
|
13312
13525
|
checkoutStep,
|
|
@@ -13314,16 +13527,16 @@ function FunCheckoutVerifyDetailsStep({
|
|
|
13314
13527
|
}) {
|
|
13315
13528
|
const { checkoutItem } = useFunkitPreCheckoutInternal(checkoutId);
|
|
13316
13529
|
const isDraftDollarValueReady = isNotNullish(checkoutItem == null ? void 0 : checkoutItem.draftDollarValue) && !(checkoutItem == null ? void 0 : checkoutItem.isDrafting);
|
|
13317
|
-
return /* @__PURE__ */
|
|
13530
|
+
return /* @__PURE__ */ React138.createElement(Box, {
|
|
13318
13531
|
display: "flex",
|
|
13319
13532
|
flexDirection: "column",
|
|
13320
13533
|
gap: "24",
|
|
13321
13534
|
paddingTop: "24",
|
|
13322
13535
|
paddingBottom: "16"
|
|
13323
|
-
}, /* @__PURE__ */
|
|
13536
|
+
}, /* @__PURE__ */ React138.createElement(CheckoutPrimaryInfo, {
|
|
13324
13537
|
checkoutId,
|
|
13325
13538
|
checkoutStep
|
|
13326
|
-
}), /* @__PURE__ */
|
|
13539
|
+
}), /* @__PURE__ */ React138.createElement(FunPaymentMethods, {
|
|
13327
13540
|
checkoutId,
|
|
13328
13541
|
paymentFlow: 1 /* CHECKOUT */,
|
|
13329
13542
|
onSelect: onSelectPaymentMethod,
|
|
@@ -13348,25 +13561,26 @@ function FunCheckoutModal({
|
|
|
13348
13561
|
}
|
|
13349
13562
|
const { textCustomizations } = useFunkitConfig();
|
|
13350
13563
|
const { accountBalancePaymentDefaultInfo, isWeb2Login } = useGeneralWallet();
|
|
13564
|
+
const userIpInfo = useFunkitMoonpayUserIp();
|
|
13351
13565
|
const { updateSourceAsset, updateSelectedPaymentMethodInfo, reDraftSymbol } = useFunkitPreCheckoutInternal(checkoutId);
|
|
13352
13566
|
const { openFunCheckoutHistoryModal } = useFunCheckoutHistoryModal();
|
|
13353
|
-
const [isSoftHidden, setIsSoftHidden] =
|
|
13354
|
-
const [animateOut, setAnimateOut] =
|
|
13567
|
+
const [isSoftHidden, setIsSoftHidden] = useState38(false);
|
|
13568
|
+
const [animateOut, setAnimateOut] = useState38(false);
|
|
13355
13569
|
const { checkoutItem, getCheckoutQuote } = useFunkitPreCheckoutInternal(
|
|
13356
13570
|
checkoutId || ""
|
|
13357
13571
|
);
|
|
13358
13572
|
const { clearCheckoutQuoteMessages } = useCheckoutQuoteNotification(
|
|
13359
13573
|
checkoutId || ""
|
|
13360
13574
|
);
|
|
13361
|
-
const [checkoutStep, setCheckoutStep] =
|
|
13575
|
+
const [checkoutStep, setCheckoutStep] = useState38(
|
|
13362
13576
|
(checkoutItem == null ? void 0 : checkoutItem.isFastForwarded) ? "confirmation" /* CONFIRMATION */ : (checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetAssetAmount) === 0 && !checkoutItem.initSettings.config.disableEditing ? "input_amount" /* INPUT_AMOUNT */ : "select_payment" /* SELECT_PAYMENT_METHOD */
|
|
13363
13577
|
);
|
|
13364
|
-
|
|
13578
|
+
useEffect28(() => {
|
|
13365
13579
|
return () => {
|
|
13366
13580
|
setCheckoutStep("select_payment" /* SELECT_PAYMENT_METHOD */);
|
|
13367
13581
|
};
|
|
13368
13582
|
}, []);
|
|
13369
|
-
|
|
13583
|
+
useEffect28(() => {
|
|
13370
13584
|
clearCheckoutQuoteMessages();
|
|
13371
13585
|
}, [checkoutStep]);
|
|
13372
13586
|
const { generateCheckoutTransferOpItems } = useCheckoutAccountBalanceTransfer(checkoutId);
|
|
@@ -13501,7 +13715,7 @@ function FunCheckoutModal({
|
|
|
13501
13715
|
},
|
|
13502
13716
|
[checkoutItem, onCloseWrapper, openFunCheckoutHistoryModal]
|
|
13503
13717
|
);
|
|
13504
|
-
const [isSourceAssetConfirming, setIsSourceAssetConfirming] =
|
|
13718
|
+
const [isSourceAssetConfirming, setIsSourceAssetConfirming] = useState38(false);
|
|
13505
13719
|
const onSourceAssetConfirmed = useCallback26(async () => {
|
|
13506
13720
|
var _a2, _b2, _c2, _d2;
|
|
13507
13721
|
try {
|
|
@@ -13526,9 +13740,9 @@ function FunCheckoutModal({
|
|
|
13526
13740
|
newPaymentMethodInfo = {
|
|
13527
13741
|
paymentMethod: "card" /* CARD */,
|
|
13528
13742
|
title: textCustomizations.debitOrCredit,
|
|
13529
|
-
titleIcon: /* @__PURE__ */
|
|
13743
|
+
titleIcon: /* @__PURE__ */ React139.createElement(CreditCardIcon, null),
|
|
13530
13744
|
description: "",
|
|
13531
|
-
descriptionIcon: /* @__PURE__ */
|
|
13745
|
+
descriptionIcon: /* @__PURE__ */ React139.createElement(CombinedCreditCardOptionsIcon, null),
|
|
13532
13746
|
meta: {}
|
|
13533
13747
|
};
|
|
13534
13748
|
} else if (selectedPaymentMethod === "brokerage" /* BROKERAGE */) {
|
|
@@ -13572,43 +13786,80 @@ function FunCheckoutModal({
|
|
|
13572
13786
|
textCustomizations.debitOrCredit
|
|
13573
13787
|
]);
|
|
13574
13788
|
const [triggerSymbol, triggerSourceAssetConfirmedFn] = useSymbolRefresh_default();
|
|
13575
|
-
|
|
13789
|
+
useEffect28(() => {
|
|
13576
13790
|
onSourceAssetConfirmed();
|
|
13577
13791
|
}, [triggerSymbol]);
|
|
13578
|
-
|
|
13792
|
+
useEffect28(() => {
|
|
13579
13793
|
if (checkoutItem && isCheckoutCrFlow && checkoutStep === "confirmation" /* CONFIRMATION */) {
|
|
13580
13794
|
onSourceAssetConfirmed();
|
|
13581
13795
|
}
|
|
13582
13796
|
}, [reDraftSymbol]);
|
|
13797
|
+
const pickSourceAssetForCard = useCallback26(async () => {
|
|
13798
|
+
var _a2;
|
|
13799
|
+
if (!(checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain)) {
|
|
13800
|
+
throw new Error("pickSourceAssetForCard: Missing targetChain");
|
|
13801
|
+
}
|
|
13802
|
+
logger.log(
|
|
13803
|
+
"pickSourceAssetForCard:begin",
|
|
13804
|
+
checkoutItem == null ? void 0 : checkoutItem.initSettings.config
|
|
13805
|
+
);
|
|
13806
|
+
const isNyOrTxOrVi = userIpInfo ? userIpInfo.alpha2 === "US" && ["NY", "TX", "VI"].includes(userIpInfo.state) : false;
|
|
13807
|
+
const isCanada = userIpInfo ? userIpInfo.alpha2 === "CA" : false;
|
|
13808
|
+
const targetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
|
|
13809
|
+
const wethAddrOnTargetChain = (await getTokenInfo2("weth", targetChainId)).toLowerCase();
|
|
13810
|
+
const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
13811
|
+
(_a2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a2.config.targetAsset
|
|
13812
|
+
) && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[targetChainId].nativeCurrency.symbol === "ETH" /* ETH */;
|
|
13813
|
+
let sourceTokenAddress;
|
|
13814
|
+
let sourceTokenTicker;
|
|
13815
|
+
let sourceTokenChainId;
|
|
13816
|
+
if (isCanada) {
|
|
13817
|
+
sourceTokenTicker = "ETH" /* ETH */;
|
|
13818
|
+
sourceTokenAddress = NATIVE_TOKEN;
|
|
13819
|
+
sourceTokenChainId = targetChainId;
|
|
13820
|
+
} else {
|
|
13821
|
+
sourceTokenChainId = isNyOrTxOrVi ? mainnet3.id.toString() : targetChainId;
|
|
13822
|
+
if (isTargetAssetEthOrWeth) {
|
|
13823
|
+
sourceTokenTicker = "ETH" /* ETH */;
|
|
13824
|
+
sourceTokenAddress = NATIVE_TOKEN;
|
|
13825
|
+
} else {
|
|
13826
|
+
sourceTokenTicker = "USDC" /* USDC */;
|
|
13827
|
+
sourceTokenAddress = await getTokenAddress(
|
|
13828
|
+
"USDC" /* USDC */,
|
|
13829
|
+
sourceTokenChainId
|
|
13830
|
+
);
|
|
13831
|
+
}
|
|
13832
|
+
}
|
|
13833
|
+
logger.log("pickSourceAssetForCard:result", {
|
|
13834
|
+
targetAssetInfo: checkoutItem == null ? void 0 : checkoutItem.initSettings.config,
|
|
13835
|
+
isNyOrTxOrVi,
|
|
13836
|
+
isCanada,
|
|
13837
|
+
isTargetAssetEthOrWeth,
|
|
13838
|
+
sourceTokenAddress,
|
|
13839
|
+
sourceTokenChainId,
|
|
13840
|
+
sourceTokenTicker
|
|
13841
|
+
});
|
|
13842
|
+
return {
|
|
13843
|
+
pickedSourceTokenAddress: sourceTokenAddress,
|
|
13844
|
+
pickedSourceTokenTicker: sourceTokenTicker,
|
|
13845
|
+
pickedSourceTokenChainId: sourceTokenChainId
|
|
13846
|
+
};
|
|
13847
|
+
}, [checkoutItem == null ? void 0 : checkoutItem.initSettings.config, userIpInfo]);
|
|
13583
13848
|
const onSelectPaymentMethod = useCallback26(
|
|
13584
13849
|
async (partialPaymentMethodInfo) => {
|
|
13585
|
-
var _a2;
|
|
13586
13850
|
updateSelectedPaymentMethodInfo(partialPaymentMethodInfo);
|
|
13587
13851
|
if (partialPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
|
|
13588
13852
|
setCheckoutStep("select_asset" /* SELECT_ASSET */);
|
|
13589
13853
|
} else if (partialPaymentMethodInfo.paymentMethod === "card" /* CARD */) {
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
const wethAddrOnTargetChain = (await getTokenInfo2("weth", targetChainId)).toLowerCase();
|
|
13596
|
-
if ([NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
13597
|
-
(_a2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a2.config.targetAsset
|
|
13598
|
-
) && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[targetChainId].nativeCurrency.symbol === "ETH" /* ETH */) {
|
|
13599
|
-
sourceTokenAddress = NATIVE_TOKEN;
|
|
13600
|
-
sourceTokenTicker = "ETH" /* ETH */;
|
|
13601
|
-
} else {
|
|
13602
|
-
sourceTokenAddress = await getTokenAddress(
|
|
13603
|
-
"USDC" /* USDC */,
|
|
13604
|
-
targetChainId
|
|
13605
|
-
);
|
|
13606
|
-
sourceTokenTicker = "USDC" /* USDC */;
|
|
13607
|
-
}
|
|
13854
|
+
const {
|
|
13855
|
+
pickedSourceTokenAddress,
|
|
13856
|
+
pickedSourceTokenChainId,
|
|
13857
|
+
pickedSourceTokenTicker
|
|
13858
|
+
} = await pickSourceAssetForCard();
|
|
13608
13859
|
updateSourceAsset(
|
|
13609
|
-
|
|
13610
|
-
|
|
13611
|
-
|
|
13860
|
+
pickedSourceTokenAddress,
|
|
13861
|
+
pickedSourceTokenTicker,
|
|
13862
|
+
pickedSourceTokenChainId
|
|
13612
13863
|
);
|
|
13613
13864
|
triggerSourceAssetConfirmedFn();
|
|
13614
13865
|
} else {
|
|
@@ -13616,8 +13867,7 @@ function FunCheckoutModal({
|
|
|
13616
13867
|
}
|
|
13617
13868
|
},
|
|
13618
13869
|
[
|
|
13619
|
-
|
|
13620
|
-
checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain,
|
|
13870
|
+
pickSourceAssetForCard,
|
|
13621
13871
|
triggerSourceAssetConfirmedFn,
|
|
13622
13872
|
updateSelectedPaymentMethodInfo,
|
|
13623
13873
|
updateSourceAsset
|
|
@@ -13627,35 +13877,35 @@ function FunCheckoutModal({
|
|
|
13627
13877
|
const meshAccessInfo = meshMeta == null ? void 0 : meshMeta.accessToken;
|
|
13628
13878
|
const meshPreviewResult = (_i = meshMeta == null ? void 0 : meshMeta.previewTransfer) == null ? void 0 : _i.previewResult;
|
|
13629
13879
|
const meshPreviewExpirationMs = meshMeta == null ? void 0 : meshMeta.computedPreviewExpirationMs;
|
|
13630
|
-
return /* @__PURE__ */
|
|
13880
|
+
return /* @__PURE__ */ React139.createElement(Dialog, {
|
|
13631
13881
|
open,
|
|
13632
13882
|
onClose: onCloseWrapper,
|
|
13633
13883
|
titleId: "fun-checkout-modal",
|
|
13634
13884
|
isHidden: isSoftHidden
|
|
13635
|
-
}, /* @__PURE__ */
|
|
13885
|
+
}, /* @__PURE__ */ React139.createElement(DialogContent, {
|
|
13636
13886
|
bottomSheetOnMobile: true,
|
|
13637
13887
|
padding: "0"
|
|
13638
|
-
}, /* @__PURE__ */
|
|
13888
|
+
}, /* @__PURE__ */ React139.createElement(Box, {
|
|
13639
13889
|
paddingTop: "20",
|
|
13640
13890
|
paddingX: "20"
|
|
13641
|
-
}, /* @__PURE__ */
|
|
13891
|
+
}, /* @__PURE__ */ React139.createElement(FunModalTitleSection, {
|
|
13642
13892
|
hasBackButton: titleConfig.hasBack,
|
|
13643
13893
|
onBack: titleConfig.onBack,
|
|
13644
13894
|
title: titleConfig.title,
|
|
13645
13895
|
hasCloseButton: true,
|
|
13646
13896
|
onClose: onCloseWrapper
|
|
13647
|
-
}), checkoutStep === "input_amount" /* INPUT_AMOUNT */ ? /* @__PURE__ */
|
|
13897
|
+
}), checkoutStep === "input_amount" /* INPUT_AMOUNT */ ? /* @__PURE__ */ React139.createElement(FunCheckoutInputAmountStep, {
|
|
13648
13898
|
checkoutId: checkoutId || "",
|
|
13649
13899
|
onContinue: () => setCheckoutStep("select_payment" /* SELECT_PAYMENT_METHOD */),
|
|
13650
13900
|
animateOut
|
|
13651
|
-
}) : checkoutStep === "select_payment" /* SELECT_PAYMENT_METHOD */ ? /* @__PURE__ */
|
|
13901
|
+
}) : checkoutStep === "select_payment" /* SELECT_PAYMENT_METHOD */ ? /* @__PURE__ */ React139.createElement(FunCheckoutVerifyDetailsStep, {
|
|
13652
13902
|
checkoutId,
|
|
13653
13903
|
checkoutStep,
|
|
13654
13904
|
onSelectPaymentMethod
|
|
13655
|
-
}) : checkoutStep === "payment_setup" /* PAYMENT_SETUP */ ? /* @__PURE__ */
|
|
13905
|
+
}) : checkoutStep === "payment_setup" /* PAYMENT_SETUP */ ? /* @__PURE__ */ React139.createElement(Box, {
|
|
13656
13906
|
paddingY: "24",
|
|
13657
13907
|
width: "full"
|
|
13658
|
-
}, /* @__PURE__ */
|
|
13908
|
+
}, /* @__PURE__ */ React139.createElement(FunPaymentSetup, {
|
|
13659
13909
|
key: checkoutStep,
|
|
13660
13910
|
paymentFlow: 1 /* CHECKOUT */,
|
|
13661
13911
|
paymentAddress: checkoutItem == null ? void 0 : checkoutItem.depositAddress,
|
|
@@ -13674,13 +13924,13 @@ function FunCheckoutModal({
|
|
|
13674
13924
|
redirectToCheckoutHistory,
|
|
13675
13925
|
isParentLoading: !!(checkoutItem == null ? void 0 : checkoutItem.isDrafting),
|
|
13676
13926
|
finalConvertedAssetName: checkoutItem == null ? void 0 : checkoutItem.initSettings.config.checkoutItemTitle
|
|
13677
|
-
})) : checkoutStep === "select_asset" /* SELECT_ASSET */ ? /* @__PURE__ */
|
|
13927
|
+
})) : checkoutStep === "select_asset" /* SELECT_ASSET */ ? /* @__PURE__ */ React139.createElement(FunCheckoutSelectAssetStep, {
|
|
13678
13928
|
checkoutId,
|
|
13679
13929
|
checkoutStep,
|
|
13680
13930
|
isOnFinishLoading: isSourceAssetConfirming,
|
|
13681
13931
|
onFinish: triggerSourceAssetConfirmedFn,
|
|
13682
13932
|
animateOut
|
|
13683
|
-
}) : checkoutStep === "confirmation" /* CONFIRMATION */ ? /* @__PURE__ */
|
|
13933
|
+
}) : checkoutStep === "confirmation" /* CONFIRMATION */ ? /* @__PURE__ */ React139.createElement(FunCheckoutConfirmationStep, {
|
|
13684
13934
|
checkoutId,
|
|
13685
13935
|
checkoutStep,
|
|
13686
13936
|
regenerateQuoteFn: triggerSourceAssetConfirmedFn,
|
|
@@ -13696,9 +13946,9 @@ function FunCheckoutModal({
|
|
|
13696
13946
|
}
|
|
13697
13947
|
},
|
|
13698
13948
|
animateOut
|
|
13699
|
-
}) : checkoutStep === "mesh_verification" /* MESH_VERIFICATION */ ? /* @__PURE__ */
|
|
13949
|
+
}) : checkoutStep === "mesh_verification" /* MESH_VERIFICATION */ ? /* @__PURE__ */ React139.createElement(Box, {
|
|
13700
13950
|
paddingY: "24"
|
|
13701
|
-
}, /* @__PURE__ */
|
|
13951
|
+
}, /* @__PURE__ */ React139.createElement(FunMeshVerificationStep, {
|
|
13702
13952
|
previewId: meshPreviewResult == null ? void 0 : meshPreviewResult.previewId,
|
|
13703
13953
|
previewExpirationMs: meshPreviewExpirationMs,
|
|
13704
13954
|
transferToAddress: meshPreviewResult == null ? void 0 : meshPreviewResult.toAddress,
|
|
@@ -13727,8 +13977,8 @@ function CheckoutPrimaryInfoSnapshot({
|
|
|
13727
13977
|
const showCheckoutItemAmount = isEditable || isNotNullish(checkoutConfig == null ? void 0 : checkoutConfig.checkoutItemAmount) && checkoutConfig.checkoutItemAmount > 0;
|
|
13728
13978
|
const checkoutItemAmountRaw = (checkoutConfig == null ? void 0 : checkoutConfig.checkoutItemAmount) || 0;
|
|
13729
13979
|
const checkoutItemAmountFormatted = showCheckoutItemAmount ? formatCryptoAndStringify(checkoutItemAmountRaw) : FALLBACK_CHECKOUT_ITEM_AMOUNT;
|
|
13730
|
-
const [isEditing, setIsEditing] =
|
|
13731
|
-
const [editedValue, setEditedValue] =
|
|
13980
|
+
const [isEditing, setIsEditing] = useState39(false);
|
|
13981
|
+
const [editedValue, setEditedValue] = useState39(
|
|
13732
13982
|
checkoutItemAmountRaw.toString()
|
|
13733
13983
|
);
|
|
13734
13984
|
const hasInputError = useMemo31(() => {
|
|
@@ -13742,25 +13992,25 @@ function CheckoutPrimaryInfoSnapshot({
|
|
|
13742
13992
|
}
|
|
13743
13993
|
}
|
|
13744
13994
|
}, [editedValue, hasInputError, isEditable, isEditing, onConfirmEdit]);
|
|
13745
|
-
return /* @__PURE__ */
|
|
13995
|
+
return /* @__PURE__ */ React140.createElement(Box, {
|
|
13746
13996
|
display: "flex",
|
|
13747
13997
|
gap: "12",
|
|
13748
13998
|
borderRadius: "menuButton",
|
|
13749
13999
|
background: "notificationPrimary",
|
|
13750
14000
|
padding: "14"
|
|
13751
|
-
}, (checkoutConfig == null ? void 0 : checkoutConfig.iconSrc) ? /* @__PURE__ */
|
|
14001
|
+
}, (checkoutConfig == null ? void 0 : checkoutConfig.iconSrc) ? /* @__PURE__ */ React140.createElement(FunAssetAvatar, {
|
|
13752
14002
|
assetSrc: checkoutConfig.iconSrc,
|
|
13753
14003
|
assetName: "checkout-asset",
|
|
13754
14004
|
assetIconSize: "50",
|
|
13755
14005
|
chainId: checkoutConfig.targetChain,
|
|
13756
14006
|
chainIconSize: "16",
|
|
13757
14007
|
prioritizeDefaults: false
|
|
13758
|
-
}) : null, /* @__PURE__ */
|
|
14008
|
+
}) : null, /* @__PURE__ */ React140.createElement(Box, {
|
|
13759
14009
|
display: "flex",
|
|
13760
14010
|
flexDirection: "column",
|
|
13761
14011
|
gap: "6",
|
|
13762
14012
|
width: "full"
|
|
13763
|
-
}, /* @__PURE__ */
|
|
14013
|
+
}, /* @__PURE__ */ React140.createElement(FunKeyValue, {
|
|
13764
14014
|
keyText: checkoutConfig.checkoutItemTitle,
|
|
13765
14015
|
keyTextColor: "modalText",
|
|
13766
14016
|
keyTextSize: "18",
|
|
@@ -13768,7 +14018,7 @@ function CheckoutPrimaryInfoSnapshot({
|
|
|
13768
14018
|
valueText: isLoading ? "" : `${formatCurrencyAndStringify(
|
|
13769
14019
|
(checkoutItem == null ? void 0 : checkoutItem.draftDollarValue) || 0
|
|
13770
14020
|
)} USD`,
|
|
13771
|
-
valueIcon: isLoading ? /* @__PURE__ */
|
|
14021
|
+
valueIcon: isLoading ? /* @__PURE__ */ React140.createElement(SpinnerIcon, {
|
|
13772
14022
|
height: 16,
|
|
13773
14023
|
width: 16
|
|
13774
14024
|
}) : void 0,
|
|
@@ -13778,15 +14028,15 @@ function CheckoutPrimaryInfoSnapshot({
|
|
|
13778
14028
|
hasBorder: false,
|
|
13779
14029
|
paddingY: "0",
|
|
13780
14030
|
paddingX: "0"
|
|
13781
|
-
}), showCheckoutItemDescription || showCheckoutItemAmount ? /* @__PURE__ */
|
|
14031
|
+
}), showCheckoutItemDescription || showCheckoutItemAmount ? /* @__PURE__ */ React140.createElement(FunKeyValue, {
|
|
13782
14032
|
keyText: (checkoutConfig == null ? void 0 : checkoutConfig.checkoutItemDescription) || FALLBACK_CHECKOUT_ITEM_DESCRIPTION,
|
|
13783
14033
|
keyTextSize: "14",
|
|
13784
14034
|
keyTextColor: "modalTextDim",
|
|
13785
14035
|
keyTextWeight: "medium",
|
|
13786
|
-
valueIcon: isEditable ? /* @__PURE__ */
|
|
13787
|
-
icon: isEditing ? /* @__PURE__ */
|
|
14036
|
+
valueIcon: isEditable ? /* @__PURE__ */ React140.createElement(FunIconButton, {
|
|
14037
|
+
icon: isEditing ? /* @__PURE__ */ React140.createElement(CopiedIcon, {
|
|
13788
14038
|
size: "10"
|
|
13789
|
-
}) : /* @__PURE__ */
|
|
14039
|
+
}) : /* @__PURE__ */ React140.createElement(EditIcon, null),
|
|
13790
14040
|
size: "14",
|
|
13791
14041
|
showBorder: false,
|
|
13792
14042
|
onClick: handleEditInputConfirm,
|
|
@@ -13801,7 +14051,7 @@ function CheckoutPrimaryInfoSnapshot({
|
|
|
13801
14051
|
valueTextWeight: "medium",
|
|
13802
14052
|
valueGap: "4",
|
|
13803
14053
|
reverseValueItems: true,
|
|
13804
|
-
customValueComponent: isEditing ? /* @__PURE__ */
|
|
14054
|
+
customValueComponent: isEditing ? /* @__PURE__ */ React140.createElement(FunInput, {
|
|
13805
14055
|
value: editedValue,
|
|
13806
14056
|
onChange: (e) => {
|
|
13807
14057
|
var _a;
|
|
@@ -13828,12 +14078,12 @@ function CheckoutPrimaryInfoSnapshot({
|
|
|
13828
14078
|
inputProps: { autoFocus: true },
|
|
13829
14079
|
error: hasInputError,
|
|
13830
14080
|
overrideBorderWidth: "1"
|
|
13831
|
-
}) : isEditable ? /* @__PURE__ */
|
|
14081
|
+
}) : isEditable ? /* @__PURE__ */ React140.createElement(Box, {
|
|
13832
14082
|
height: "max",
|
|
13833
14083
|
flexDirection: "row",
|
|
13834
14084
|
style: { cursor: "pointer" },
|
|
13835
14085
|
onClick: () => setIsEditing(true)
|
|
13836
|
-
}, /* @__PURE__ */
|
|
14086
|
+
}, /* @__PURE__ */ React140.createElement(Text, {
|
|
13837
14087
|
weight: "medium",
|
|
13838
14088
|
color: { base: "modalTextDim", hover: "accentColor" },
|
|
13839
14089
|
size: "14"
|
|
@@ -13856,8 +14106,8 @@ function CheckoutPrimaryInfo({
|
|
|
13856
14106
|
clearCheckoutQuoteMessages
|
|
13857
14107
|
} = useFunkitPreCheckoutInternal(checkoutId);
|
|
13858
14108
|
const { isCheckoutCrFlow } = useCheckoutType(checkoutItem);
|
|
13859
|
-
const [isForceRefresh, setIsForceRefresh] =
|
|
13860
|
-
|
|
14109
|
+
const [isForceRefresh, setIsForceRefresh] = useState39(false);
|
|
14110
|
+
useEffect29(() => {
|
|
13861
14111
|
if (isForceRefresh || !isNotNullish(checkoutItem == null ? void 0 : checkoutItem.draftDollarValue)) {
|
|
13862
14112
|
setIsForceRefresh(false);
|
|
13863
14113
|
getCheckoutDraftDollarValue().catch(
|
|
@@ -13871,7 +14121,7 @@ function CheckoutPrimaryInfo({
|
|
|
13871
14121
|
const isCheckoutTargetAssetEditable = isCheckoutCrFlow && !(checkoutStep === "confirmation" /* CONFIRMATION */ && ((_c = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _c.paymentMethod) && ["brokerage" /* BROKERAGE */, "balance" /* ACCOUNT_BALANCE */].includes(
|
|
13872
14122
|
checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo.paymentMethod
|
|
13873
14123
|
)) && !(checkoutItem == null ? void 0 : checkoutItem.initSettings.config.disableEditing);
|
|
13874
|
-
return checkoutItem ? /* @__PURE__ */
|
|
14124
|
+
return checkoutItem ? /* @__PURE__ */ React140.createElement(CheckoutPrimaryInfoSnapshot, {
|
|
13875
14125
|
isLoading: checkoutItem.isDrafting,
|
|
13876
14126
|
checkoutItem,
|
|
13877
14127
|
isEditable: isCheckoutTargetAssetEditable,
|
|
@@ -13918,8 +14168,8 @@ function FunCheckoutHistoryDetail({
|
|
|
13918
14168
|
};
|
|
13919
14169
|
}, [checkoutHistoryInfo.createdTimeMs, checkoutItem]);
|
|
13920
14170
|
const timelineLabels = useMemo32(() => {
|
|
13921
|
-
const fromExplorerInfo =
|
|
13922
|
-
const toExplorerInfo =
|
|
14171
|
+
const fromExplorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[checkoutHistoryInfo.fromChainId].explorerInfo;
|
|
14172
|
+
const toExplorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[checkoutHistoryInfo.toChainId].explorerInfo;
|
|
13923
14173
|
return [
|
|
13924
14174
|
{
|
|
13925
14175
|
text: "Order Submitted",
|
|
@@ -13975,7 +14225,7 @@ function FunCheckoutHistoryDetail({
|
|
|
13975
14225
|
isCompleted
|
|
13976
14226
|
]);
|
|
13977
14227
|
const GetHelpButton = ({ text = "Get Help \u{1F449}" }) => {
|
|
13978
|
-
return /* @__PURE__ */
|
|
14228
|
+
return /* @__PURE__ */ React141.createElement(FunLinkButton, {
|
|
13979
14229
|
hasPadding: false,
|
|
13980
14230
|
text,
|
|
13981
14231
|
textProps: {
|
|
@@ -13986,56 +14236,56 @@ function FunCheckoutHistoryDetail({
|
|
|
13986
14236
|
onClick: () => setCurrentPage("help" /* HELP */)
|
|
13987
14237
|
});
|
|
13988
14238
|
};
|
|
13989
|
-
return /* @__PURE__ */
|
|
14239
|
+
return /* @__PURE__ */ React141.createElement(Box, {
|
|
13990
14240
|
display: "flex",
|
|
13991
14241
|
flexDirection: "column",
|
|
13992
14242
|
gap: "24",
|
|
13993
14243
|
paddingY: "24",
|
|
13994
14244
|
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
13995
|
-
}, /* @__PURE__ */
|
|
14245
|
+
}, /* @__PURE__ */ React141.createElement(Box, {
|
|
13996
14246
|
display: "flex",
|
|
13997
14247
|
flexDirection: "column",
|
|
13998
14248
|
gap: "24",
|
|
13999
14249
|
style: { opacity: isFailedFinal ? 0.5 : 1 }
|
|
14000
|
-
}, /* @__PURE__ */
|
|
14250
|
+
}, /* @__PURE__ */ React141.createElement(CheckoutPrimaryInfoSnapshot, {
|
|
14001
14251
|
checkoutItem,
|
|
14002
14252
|
isLoading: false,
|
|
14003
14253
|
isEditable: false
|
|
14004
|
-
}), isTerminal ? null : /* @__PURE__ */
|
|
14254
|
+
}), isTerminal ? null : /* @__PURE__ */ React141.createElement(FunNotification, {
|
|
14005
14255
|
description: isCheckoutDirectCrFlow ? "Funds may take up to 10 minutes to arrive." : "We are currently processing your order."
|
|
14006
|
-
}), /* @__PURE__ */
|
|
14256
|
+
}), /* @__PURE__ */ React141.createElement(FunVerticalProgressBar, {
|
|
14007
14257
|
step: isCheckoutDirectCrFlow ? 2 : isTerminal ? 3 : 2,
|
|
14008
14258
|
totalSteps: timelineLabels.length,
|
|
14009
14259
|
labels: timelineLabels
|
|
14010
|
-
})), isFailedFinal ? /* @__PURE__ */
|
|
14260
|
+
})), isFailedFinal ? /* @__PURE__ */ React141.createElement(FunToast, {
|
|
14011
14261
|
type: 1 /* ERROR */,
|
|
14012
14262
|
title: "Order Failed",
|
|
14013
14263
|
isDescriptionText: false,
|
|
14014
|
-
description: /* @__PURE__ */
|
|
14264
|
+
description: /* @__PURE__ */ React141.createElement(Text, {
|
|
14015
14265
|
size: "12",
|
|
14016
14266
|
weight: "medium",
|
|
14017
14267
|
color: "modalTextDim"
|
|
14018
|
-
}, "A problem occurred processing your order. We are actively working to resolve this. ", /* @__PURE__ */
|
|
14268
|
+
}, "A problem occurred processing your order. We are actively working to resolve this. ", /* @__PURE__ */ React141.createElement(GetHelpButton, {
|
|
14019
14269
|
text: "Get In Contact \u{1F449}"
|
|
14020
14270
|
})),
|
|
14021
14271
|
hideTitleSuffix: true
|
|
14022
|
-
}) : /* @__PURE__ */
|
|
14272
|
+
}) : /* @__PURE__ */ React141.createElement(Box, {
|
|
14023
14273
|
display: "flex",
|
|
14024
14274
|
flexDirection: "column",
|
|
14025
14275
|
alignItems: "center",
|
|
14026
14276
|
justifyContent: "center"
|
|
14027
|
-
}, /* @__PURE__ */
|
|
14277
|
+
}, /* @__PURE__ */ React141.createElement(Text, {
|
|
14028
14278
|
size: "12",
|
|
14029
14279
|
color: "modalTextDim"
|
|
14030
|
-
}, "Experiencing problems? ", /* @__PURE__ */
|
|
14280
|
+
}, "Experiencing problems? ", /* @__PURE__ */ React141.createElement(GetHelpButton, null))));
|
|
14031
14281
|
}
|
|
14032
14282
|
|
|
14033
14283
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.tsx
|
|
14034
14284
|
import { sendSupportMessage } from "@funkit/core";
|
|
14035
|
-
import
|
|
14285
|
+
import React143, { useMemo as useMemo33, useState as useState40 } from "react";
|
|
14036
14286
|
|
|
14037
14287
|
// src/components/FunInput/FunTextAreaInput.tsx
|
|
14038
|
-
import
|
|
14288
|
+
import React142 from "react";
|
|
14039
14289
|
function FunTextAreaInput({
|
|
14040
14290
|
placeholder,
|
|
14041
14291
|
value,
|
|
@@ -14053,19 +14303,19 @@ function FunTextAreaInput({
|
|
|
14053
14303
|
focused: _focused,
|
|
14054
14304
|
overrideBorderWidth
|
|
14055
14305
|
}) {
|
|
14056
|
-
const [focused, setFocused] =
|
|
14306
|
+
const [focused, setFocused] = React142.useState(false);
|
|
14057
14307
|
const onFocus = () => setFocused(true);
|
|
14058
14308
|
const onBlur = () => setFocused(false);
|
|
14059
|
-
return /* @__PURE__ */
|
|
14309
|
+
return /* @__PURE__ */ React142.createElement(Box, {
|
|
14060
14310
|
color: "modalText",
|
|
14061
14311
|
display: "flex",
|
|
14062
14312
|
flexDirection: "column",
|
|
14063
14313
|
gap: "8"
|
|
14064
|
-
}, label && /* @__PURE__ */
|
|
14314
|
+
}, label && /* @__PURE__ */ React142.createElement(Text, {
|
|
14065
14315
|
color: textColor,
|
|
14066
14316
|
size: "14",
|
|
14067
14317
|
weight: "medium"
|
|
14068
|
-
}, label), /* @__PURE__ */
|
|
14318
|
+
}, label), /* @__PURE__ */ React142.createElement(Box, {
|
|
14069
14319
|
background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
|
|
14070
14320
|
borderRadius: "menuButton",
|
|
14071
14321
|
fontFamily: "body",
|
|
@@ -14076,7 +14326,7 @@ function FunTextAreaInput({
|
|
|
14076
14326
|
borderColor: error ? "error" : focused && _focused ? "accentColor" : void 0,
|
|
14077
14327
|
borderWidth: overrideBorderWidth ? overrideBorderWidth : error && focused ? "2" : error ? "1" : focused && _focused ? "1" : "0",
|
|
14078
14328
|
borderStyle: "solid"
|
|
14079
|
-
}, /* @__PURE__ */
|
|
14329
|
+
}, /* @__PURE__ */ React142.createElement("textarea", {
|
|
14080
14330
|
type: (inputProps == null ? void 0 : inputProps.type) || "text",
|
|
14081
14331
|
value,
|
|
14082
14332
|
placeholder,
|
|
@@ -14100,7 +14350,7 @@ function FunTextAreaInput({
|
|
|
14100
14350
|
fontWeight: value ? "600" : "500",
|
|
14101
14351
|
...inputStyle
|
|
14102
14352
|
}
|
|
14103
|
-
})), error && typeof error === "string" && /* @__PURE__ */
|
|
14353
|
+
})), error && typeof error === "string" && /* @__PURE__ */ React142.createElement(Text, {
|
|
14104
14354
|
color: "error",
|
|
14105
14355
|
size: "14",
|
|
14106
14356
|
weight: "medium"
|
|
@@ -14127,7 +14377,7 @@ var RESOLUTION_OPTIONS = [
|
|
|
14127
14377
|
];
|
|
14128
14378
|
var RESOLUTION_OPTIONS_FORMATTED = RESOLUTION_OPTIONS.map((item) => {
|
|
14129
14379
|
const newItem = { ...item };
|
|
14130
|
-
newItem.label = /* @__PURE__ */
|
|
14380
|
+
newItem.label = /* @__PURE__ */ React143.createElement(Text, {
|
|
14131
14381
|
color: "modalText",
|
|
14132
14382
|
size: "14",
|
|
14133
14383
|
weight: "semibold"
|
|
@@ -14138,18 +14388,19 @@ var FIVE_MINUTES_MS = 3e5;
|
|
|
14138
14388
|
var FIVE_SECONDS_MS = 5e3;
|
|
14139
14389
|
function FunCheckoutHistoryHelp({
|
|
14140
14390
|
checkoutHistoryInfo,
|
|
14141
|
-
animateOut
|
|
14391
|
+
animateOut,
|
|
14392
|
+
onBackFromHelpPage
|
|
14142
14393
|
}) {
|
|
14143
14394
|
const { appName, apiKey } = useFunkitConfig();
|
|
14144
14395
|
const { userInfo } = useGeneralWallet();
|
|
14145
14396
|
const { showToast } = useFunToast();
|
|
14146
|
-
const [isSubmitting, setIsSubmitting] =
|
|
14147
|
-
const [emailInput, setEmailInput] =
|
|
14148
|
-
const [subjectInput, setSubjectInput] =
|
|
14149
|
-
const [resolutionInput, setResolutionInput] =
|
|
14397
|
+
const [isSubmitting, setIsSubmitting] = useState40(false);
|
|
14398
|
+
const [emailInput, setEmailInput] = useState40("");
|
|
14399
|
+
const [subjectInput, setSubjectInput] = useState40("");
|
|
14400
|
+
const [resolutionInput, setResolutionInput] = useState40(
|
|
14150
14401
|
RESOLUTION_OPTIONS[0].value
|
|
14151
14402
|
);
|
|
14152
|
-
const [descriptionInput, setDescriptionInput] =
|
|
14403
|
+
const [descriptionInput, setDescriptionInput] = useState40("");
|
|
14153
14404
|
const isEmailInputValid = useMemo33(() => {
|
|
14154
14405
|
return validateEmailString(emailInput);
|
|
14155
14406
|
}, [emailInput]);
|
|
@@ -14187,7 +14438,7 @@ function FunCheckoutHistoryHelp({
|
|
|
14187
14438
|
|
|
14188
14439
|
App ID: ${apiKey}
|
|
14189
14440
|
|
|
14190
|
-
User ID: ${userInfo.
|
|
14441
|
+
User ID: ${userInfo.globalFunkitUserId}
|
|
14191
14442
|
|
|
14192
14443
|
=========================
|
|
14193
14444
|
|
|
@@ -14215,6 +14466,7 @@ function FunCheckoutHistoryHelp({
|
|
|
14215
14466
|
},
|
|
14216
14467
|
FIVE_SECONDS_MS
|
|
14217
14468
|
);
|
|
14469
|
+
onBackFromHelpPage();
|
|
14218
14470
|
} else {
|
|
14219
14471
|
showToast(
|
|
14220
14472
|
{
|
|
@@ -14239,7 +14491,7 @@ function FunCheckoutHistoryHelp({
|
|
|
14239
14491
|
setIsSubmitting(false);
|
|
14240
14492
|
}
|
|
14241
14493
|
};
|
|
14242
|
-
return /* @__PURE__ */
|
|
14494
|
+
return /* @__PURE__ */ React143.createElement(Box, {
|
|
14243
14495
|
display: "flex",
|
|
14244
14496
|
flexDirection: "column",
|
|
14245
14497
|
gap: "24",
|
|
@@ -14249,26 +14501,26 @@ function FunCheckoutHistoryHelp({
|
|
|
14249
14501
|
animateOut ? animateContentOutClass : animateContentInClass
|
|
14250
14502
|
],
|
|
14251
14503
|
style: { maxHeight: 500, overflow: "auto" }
|
|
14252
|
-
}, /* @__PURE__ */
|
|
14504
|
+
}, /* @__PURE__ */ React143.createElement(Box, {
|
|
14253
14505
|
display: "flex",
|
|
14254
14506
|
flexDirection: "column",
|
|
14255
14507
|
gap: "10"
|
|
14256
|
-
}, /* @__PURE__ */
|
|
14508
|
+
}, /* @__PURE__ */ React143.createElement(Text, {
|
|
14257
14509
|
color: "modalText",
|
|
14258
14510
|
size: "18",
|
|
14259
14511
|
weight: "heavy"
|
|
14260
|
-
}, "Tell us what's wrong"), /* @__PURE__ */
|
|
14512
|
+
}, "Tell us what's wrong"), /* @__PURE__ */ React143.createElement(Text, {
|
|
14261
14513
|
color: "modalTextSecondary",
|
|
14262
14514
|
size: "14",
|
|
14263
14515
|
weight: "medium"
|
|
14264
|
-
}, "If you're experiencing an issue or have a question, please fill out the form below and our support team will get back to you as soon as possible.")), /* @__PURE__ */
|
|
14516
|
+
}, "If you're experiencing an issue or have a question, please fill out the form below and our support team will get back to you as soon as possible.")), /* @__PURE__ */ React143.createElement(FunInput, {
|
|
14265
14517
|
inputProps: { disabled: true },
|
|
14266
14518
|
inputStyle: { fontSize: 14 },
|
|
14267
14519
|
label: "Checkout ID",
|
|
14268
14520
|
placeholder: checkoutHistoryInfo.depositAddr,
|
|
14269
14521
|
value: "",
|
|
14270
14522
|
onChange: () => void 0
|
|
14271
|
-
}), /* @__PURE__ */
|
|
14523
|
+
}), /* @__PURE__ */ React143.createElement(FunInput, {
|
|
14272
14524
|
label: "Your Email*",
|
|
14273
14525
|
inputStyle: { fontSize: 14 },
|
|
14274
14526
|
placeholder: "",
|
|
@@ -14277,7 +14529,7 @@ function FunCheckoutHistoryHelp({
|
|
|
14277
14529
|
var _a;
|
|
14278
14530
|
return setEmailInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
14279
14531
|
}
|
|
14280
|
-
}), /* @__PURE__ */
|
|
14532
|
+
}), /* @__PURE__ */ React143.createElement(FunInput, {
|
|
14281
14533
|
label: "Subject*",
|
|
14282
14534
|
inputStyle: { fontSize: 14 },
|
|
14283
14535
|
placeholder: "",
|
|
@@ -14286,7 +14538,7 @@ function FunCheckoutHistoryHelp({
|
|
|
14286
14538
|
var _a;
|
|
14287
14539
|
return setSubjectInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
14288
14540
|
}
|
|
14289
|
-
}), /* @__PURE__ */
|
|
14541
|
+
}), /* @__PURE__ */ React143.createElement(FunTextAreaInput, {
|
|
14290
14542
|
label: "Description*",
|
|
14291
14543
|
inputStyle: { fontSize: 14, fontFamily: "inherit" },
|
|
14292
14544
|
placeholder: "",
|
|
@@ -14295,21 +14547,21 @@ function FunCheckoutHistoryHelp({
|
|
|
14295
14547
|
var _a;
|
|
14296
14548
|
return setDescriptionInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
14297
14549
|
}
|
|
14298
|
-
}), /* @__PURE__ */
|
|
14550
|
+
}), /* @__PURE__ */ React143.createElement(FunSelect, {
|
|
14299
14551
|
label: "Resolution Preference*",
|
|
14300
14552
|
initValue: RESOLUTION_OPTIONS_FORMATTED[0].value,
|
|
14301
14553
|
options: RESOLUTION_OPTIONS_FORMATTED,
|
|
14302
14554
|
onChange: (newValue) => setResolutionInput(newValue),
|
|
14303
14555
|
showBorder: false
|
|
14304
|
-
}), /* @__PURE__ */
|
|
14556
|
+
}), /* @__PURE__ */ React143.createElement(FunButton, {
|
|
14305
14557
|
title: "Submit",
|
|
14306
14558
|
onClick: (e) => onSubmitIssue(e),
|
|
14307
14559
|
isDisabled: isSubmitting || !subjectInput || !descriptionInput || !emailInput || !isEmailInputValid || !resolutionInput,
|
|
14308
|
-
titleSuffix: isSubmitting ? /* @__PURE__ */
|
|
14560
|
+
titleSuffix: isSubmitting ? /* @__PURE__ */ React143.createElement(Box, {
|
|
14309
14561
|
display: "flex",
|
|
14310
14562
|
alignItems: "center",
|
|
14311
14563
|
color: "modalText"
|
|
14312
|
-
}, /* @__PURE__ */
|
|
14564
|
+
}, /* @__PURE__ */ React143.createElement(SpinnerIcon, {
|
|
14313
14565
|
height: 16,
|
|
14314
14566
|
width: 16
|
|
14315
14567
|
})) : null
|
|
@@ -14329,22 +14581,23 @@ function FunCheckoutHistoryModal({
|
|
|
14329
14581
|
);
|
|
14330
14582
|
}
|
|
14331
14583
|
const { checkoutHistoryInfo, isLoading } = useFunkitPostCheckoutInternal(depositAddress);
|
|
14332
|
-
const [currentPage, setCurrentPage] =
|
|
14584
|
+
const [currentPage, setCurrentPage] = useState41(
|
|
14333
14585
|
initialPage || "detail" /* DETAIL */
|
|
14334
14586
|
);
|
|
14335
14587
|
const ANIMATION_DELAY2 = 150;
|
|
14336
|
-
const [animateOut, setAnimateOut] =
|
|
14588
|
+
const [animateOut, setAnimateOut] = useState41(false);
|
|
14589
|
+
const onBackFromHelpPage = useCallback28(() => {
|
|
14590
|
+
setAnimateOut(true);
|
|
14591
|
+
setTimeout(() => {
|
|
14592
|
+
setCurrentPage("detail" /* DETAIL */);
|
|
14593
|
+
setAnimateOut(false);
|
|
14594
|
+
}, ANIMATION_DELAY2);
|
|
14595
|
+
}, []);
|
|
14337
14596
|
const titleConfig = useMemo34(() => {
|
|
14338
14597
|
if (currentPage === "help" /* HELP */) {
|
|
14339
14598
|
return {
|
|
14340
14599
|
hasBackButton: true,
|
|
14341
|
-
onBack:
|
|
14342
|
-
setAnimateOut(true);
|
|
14343
|
-
setTimeout(() => {
|
|
14344
|
-
setCurrentPage("detail" /* DETAIL */);
|
|
14345
|
-
setAnimateOut(false);
|
|
14346
|
-
}, ANIMATION_DELAY2);
|
|
14347
|
-
},
|
|
14600
|
+
onBack: onBackFromHelpPage,
|
|
14348
14601
|
title: "Get Help"
|
|
14349
14602
|
};
|
|
14350
14603
|
} else {
|
|
@@ -14354,24 +14607,24 @@ function FunCheckoutHistoryModal({
|
|
|
14354
14607
|
title: "Order"
|
|
14355
14608
|
};
|
|
14356
14609
|
}
|
|
14357
|
-
}, [currentPage]);
|
|
14358
|
-
return /* @__PURE__ */
|
|
14610
|
+
}, [currentPage, onBackFromHelpPage]);
|
|
14611
|
+
return /* @__PURE__ */ React144.createElement(Dialog, {
|
|
14359
14612
|
open,
|
|
14360
14613
|
onClose,
|
|
14361
14614
|
titleId: "fun-checkout-history-modal"
|
|
14362
|
-
}, /* @__PURE__ */
|
|
14615
|
+
}, /* @__PURE__ */ React144.createElement(DialogContent, {
|
|
14363
14616
|
bottomSheetOnMobile: true,
|
|
14364
14617
|
padding: "0"
|
|
14365
|
-
}, /* @__PURE__ */
|
|
14618
|
+
}, /* @__PURE__ */ React144.createElement(Box, {
|
|
14366
14619
|
paddingTop: "20",
|
|
14367
14620
|
paddingX: "20"
|
|
14368
|
-
}, /* @__PURE__ */
|
|
14621
|
+
}, /* @__PURE__ */ React144.createElement(FunModalTitleSection, {
|
|
14369
14622
|
hasBackButton: titleConfig.hasBackButton,
|
|
14370
14623
|
onBack: titleConfig.onBack,
|
|
14371
14624
|
title: titleConfig.title,
|
|
14372
14625
|
hasCloseButton: true,
|
|
14373
14626
|
onClose
|
|
14374
|
-
}), isLoading ? /* @__PURE__ */
|
|
14627
|
+
}), isLoading ? /* @__PURE__ */ React144.createElement(Box, {
|
|
14375
14628
|
width: "full",
|
|
14376
14629
|
height: "200",
|
|
14377
14630
|
display: "flex",
|
|
@@ -14379,54 +14632,55 @@ function FunCheckoutHistoryModal({
|
|
|
14379
14632
|
alignItems: "center",
|
|
14380
14633
|
justifyContent: "center",
|
|
14381
14634
|
color: "modalText"
|
|
14382
|
-
}, /* @__PURE__ */
|
|
14635
|
+
}, /* @__PURE__ */ React144.createElement(SpinnerIcon, null)) : checkoutHistoryInfo ? currentPage === "detail" /* DETAIL */ ? /* @__PURE__ */ React144.createElement(FunCheckoutHistoryDetail, {
|
|
14383
14636
|
checkoutHistoryInfo,
|
|
14384
14637
|
setCurrentPage,
|
|
14385
14638
|
animateOut
|
|
14386
|
-
}) : currentPage === "help" /* HELP */ ? /* @__PURE__ */
|
|
14639
|
+
}) : currentPage === "help" /* HELP */ ? /* @__PURE__ */ React144.createElement(FunCheckoutHistoryHelp, {
|
|
14387
14640
|
checkoutHistoryInfo,
|
|
14388
|
-
animateOut
|
|
14641
|
+
animateOut,
|
|
14642
|
+
onBackFromHelpPage
|
|
14389
14643
|
}) : null : null)));
|
|
14390
14644
|
}
|
|
14391
14645
|
|
|
14392
14646
|
// src/components/FunDevTestModal/FunDevTestModal.tsx
|
|
14393
|
-
import
|
|
14647
|
+
import React145 from "react";
|
|
14394
14648
|
function FunDevTestModal({ onClose, open }) {
|
|
14395
|
-
return /* @__PURE__ */
|
|
14649
|
+
return /* @__PURE__ */ React145.createElement(Dialog, {
|
|
14396
14650
|
onClose,
|
|
14397
14651
|
open,
|
|
14398
14652
|
titleId: "dev/test modal"
|
|
14399
|
-
}, /* @__PURE__ */
|
|
14653
|
+
}, /* @__PURE__ */ React145.createElement(DialogContent, {
|
|
14400
14654
|
bottomSheetOnMobile: true
|
|
14401
|
-
}, /* @__PURE__ */
|
|
14655
|
+
}, /* @__PURE__ */ React145.createElement(Box, null)));
|
|
14402
14656
|
}
|
|
14403
14657
|
|
|
14404
14658
|
// src/components/FunkitProvider/ModalContext.tsx
|
|
14405
14659
|
function useModalStateValue() {
|
|
14406
|
-
const [isModalOpen, setModalOpen] =
|
|
14660
|
+
const [isModalOpen, setModalOpen] = useState42(false);
|
|
14407
14661
|
return {
|
|
14408
|
-
closeModal:
|
|
14662
|
+
closeModal: useCallback29(() => setModalOpen(false), []),
|
|
14409
14663
|
isModalOpen,
|
|
14410
|
-
openModal:
|
|
14664
|
+
openModal: useCallback29(() => setModalOpen(true), [])
|
|
14411
14665
|
};
|
|
14412
14666
|
}
|
|
14413
14667
|
function useModalStateValueWithId() {
|
|
14414
|
-
const [isModalOpen, setModalOpen] =
|
|
14415
|
-
const [modalId, setModalId] =
|
|
14668
|
+
const [isModalOpen, setModalOpen] = useState42(false);
|
|
14669
|
+
const [modalId, setModalId] = useState42(null);
|
|
14416
14670
|
return {
|
|
14417
|
-
closeModal:
|
|
14671
|
+
closeModal: useCallback29(() => {
|
|
14418
14672
|
setModalId(null);
|
|
14419
14673
|
setModalOpen(false);
|
|
14420
14674
|
}, []),
|
|
14421
14675
|
isModalOpen,
|
|
14422
14676
|
modalId,
|
|
14423
|
-
openModal:
|
|
14677
|
+
openModal: useCallback29((id) => {
|
|
14424
14678
|
setModalId(id);
|
|
14425
14679
|
setModalOpen(true);
|
|
14426
14680
|
}, [])
|
|
14427
14681
|
};
|
|
14428
14682
|
}
|
|
14429
|
-
var ModalContext =
|
|
14683
|
+
var ModalContext = createContext17({
|
|
14430
14684
|
accountModalOpen: false,
|
|
14431
14685
|
chainModalOpen: false,
|
|
14432
14686
|
connectModalOpen: false,
|
|
@@ -14453,7 +14707,7 @@ function ModalProvider({ children }) {
|
|
|
14453
14707
|
isModalOpen: chainModalOpen,
|
|
14454
14708
|
openModal: openChainModal
|
|
14455
14709
|
} = useModalStateValue();
|
|
14456
|
-
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] =
|
|
14710
|
+
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] = useState42(false);
|
|
14457
14711
|
const {
|
|
14458
14712
|
closeModal: closeFunCheckoutModal,
|
|
14459
14713
|
isModalOpen: funCheckoutModalOpen,
|
|
@@ -14491,11 +14745,11 @@ function ModalProvider({ children }) {
|
|
|
14491
14745
|
onConnect: () => closeModals({ keepConnectModalOpen: isUnauthenticated }),
|
|
14492
14746
|
onDisconnect: () => closeModals()
|
|
14493
14747
|
});
|
|
14494
|
-
|
|
14748
|
+
useEffect30(() => {
|
|
14495
14749
|
if (isUnauthenticated)
|
|
14496
14750
|
closeModals();
|
|
14497
14751
|
}, [isUnauthenticated]);
|
|
14498
|
-
return /* @__PURE__ */
|
|
14752
|
+
return /* @__PURE__ */ React146.createElement(ModalContext.Provider, {
|
|
14499
14753
|
value: useMemo35(
|
|
14500
14754
|
() => ({
|
|
14501
14755
|
accountModalOpen,
|
|
@@ -14535,21 +14789,21 @@ function ModalProvider({ children }) {
|
|
|
14535
14789
|
openFunDevTestModal
|
|
14536
14790
|
]
|
|
14537
14791
|
)
|
|
14538
|
-
}, children, /* @__PURE__ */
|
|
14792
|
+
}, children, /* @__PURE__ */ React146.createElement(ConnectModal, {
|
|
14539
14793
|
onClose: closeConnectModal,
|
|
14540
14794
|
open: connectModalOpen
|
|
14541
|
-
}), /* @__PURE__ */
|
|
14795
|
+
}), /* @__PURE__ */ React146.createElement(AccountModal, {
|
|
14542
14796
|
onClose: closeAccountModal,
|
|
14543
14797
|
open: accountModalOpen
|
|
14544
|
-
}), /* @__PURE__ */
|
|
14798
|
+
}), /* @__PURE__ */ React146.createElement(ChainModal, {
|
|
14545
14799
|
onClose: closeChainModal,
|
|
14546
14800
|
open: chainModalOpen
|
|
14547
|
-
}), /* @__PURE__ */
|
|
14801
|
+
}), /* @__PURE__ */ React146.createElement(FunCheckoutModal, {
|
|
14548
14802
|
onClose: closeFunCheckoutModal,
|
|
14549
14803
|
open: funCheckoutModalOpen,
|
|
14550
14804
|
checkoutId: funCheckoutModalId,
|
|
14551
14805
|
key: funCheckoutModalId
|
|
14552
|
-
}), depositAddressInitialPageCombined ? /* @__PURE__ */
|
|
14806
|
+
}), depositAddressInitialPageCombined ? /* @__PURE__ */ React146.createElement(FunCheckoutHistoryModal, {
|
|
14553
14807
|
onClose: closeFunCheckoutHistoryModal,
|
|
14554
14808
|
open: funCheckoutHistoryModalOpen,
|
|
14555
14809
|
depositAddress: deconstructDepositAddressAndInitialPage(
|
|
@@ -14558,13 +14812,13 @@ function ModalProvider({ children }) {
|
|
|
14558
14812
|
initialPage: deconstructDepositAddressAndInitialPage(
|
|
14559
14813
|
depositAddressInitialPageCombined
|
|
14560
14814
|
).initialPage
|
|
14561
|
-
}) : null, /* @__PURE__ */
|
|
14815
|
+
}) : null, /* @__PURE__ */ React146.createElement(FunDevTestModal, {
|
|
14562
14816
|
onClose: closeFunDevTestModal,
|
|
14563
14817
|
open: funDevTestModalOpen
|
|
14564
14818
|
}));
|
|
14565
14819
|
}
|
|
14566
14820
|
function useModalState() {
|
|
14567
|
-
const { accountModalOpen, chainModalOpen, connectModalOpen } =
|
|
14821
|
+
const { accountModalOpen, chainModalOpen, connectModalOpen } = useContext23(ModalContext);
|
|
14568
14822
|
return {
|
|
14569
14823
|
accountModalOpen,
|
|
14570
14824
|
chainModalOpen,
|
|
@@ -14572,19 +14826,19 @@ function useModalState() {
|
|
|
14572
14826
|
};
|
|
14573
14827
|
}
|
|
14574
14828
|
function useAccountModal() {
|
|
14575
|
-
const { accountModalOpen, openAccountModal } =
|
|
14829
|
+
const { accountModalOpen, openAccountModal } = useContext23(ModalContext);
|
|
14576
14830
|
return { accountModalOpen, openAccountModal };
|
|
14577
14831
|
}
|
|
14578
14832
|
function useChainModal() {
|
|
14579
|
-
const { chainModalOpen, openChainModal } =
|
|
14833
|
+
const { chainModalOpen, openChainModal } = useContext23(ModalContext);
|
|
14580
14834
|
return { chainModalOpen, openChainModal };
|
|
14581
14835
|
}
|
|
14582
14836
|
function useWalletConnectOpenState() {
|
|
14583
|
-
const { isWalletConnectModalOpen, setIsWalletConnectModalOpen } =
|
|
14837
|
+
const { isWalletConnectModalOpen, setIsWalletConnectModalOpen } = useContext23(ModalContext);
|
|
14584
14838
|
return { isWalletConnectModalOpen, setIsWalletConnectModalOpen };
|
|
14585
14839
|
}
|
|
14586
14840
|
function useConnectModal() {
|
|
14587
|
-
const { connectModalOpen, openConnectModal } =
|
|
14841
|
+
const { connectModalOpen, openConnectModal } = useContext23(ModalContext);
|
|
14588
14842
|
const { isWalletConnectModalOpen } = useWalletConnectOpenState();
|
|
14589
14843
|
return {
|
|
14590
14844
|
connectModalOpen: connectModalOpen || isWalletConnectModalOpen,
|
|
@@ -14592,11 +14846,11 @@ function useConnectModal() {
|
|
|
14592
14846
|
};
|
|
14593
14847
|
}
|
|
14594
14848
|
function useFunCheckoutModal() {
|
|
14595
|
-
const { funCheckoutModalOpen, openFunCheckoutModal } =
|
|
14849
|
+
const { funCheckoutModalOpen, openFunCheckoutModal } = useContext23(ModalContext);
|
|
14596
14850
|
return { funCheckoutModalOpen, openFunCheckoutModal };
|
|
14597
14851
|
}
|
|
14598
14852
|
function useFunCheckoutHistoryModal() {
|
|
14599
|
-
const { funCheckoutHistoryModalOpen, openFunCheckoutHistoryModal } =
|
|
14853
|
+
const { funCheckoutHistoryModalOpen, openFunCheckoutHistoryModal } = useContext23(ModalContext);
|
|
14600
14854
|
return { funCheckoutHistoryModalOpen, openFunCheckoutHistoryModal };
|
|
14601
14855
|
}
|
|
14602
14856
|
|
|
@@ -14807,7 +15061,7 @@ var ERROR_MESSAGES = {
|
|
|
14807
15061
|
PRIVY_USER_NOT_INITIALIZED: "Privy user not initialized",
|
|
14808
15062
|
FARCASTER_NOT_INITIALIZED: "Unable to initialize Farcaster login"
|
|
14809
15063
|
};
|
|
14810
|
-
var FunkitWeb2Context =
|
|
15064
|
+
var FunkitWeb2Context = createContext18({
|
|
14811
15065
|
isSendingOtpEmail: false,
|
|
14812
15066
|
isGeneratingFcUri: false,
|
|
14813
15067
|
handleSendOtpEmail: () => Promise.resolve({ success: false, error: "" }),
|
|
@@ -14852,16 +15106,16 @@ var FunkitWeb2Provider = ({
|
|
|
14852
15106
|
const funkitConfig = useFunkitConfig();
|
|
14853
15107
|
const { connectAsync } = useConnect2();
|
|
14854
15108
|
const { connectors, disconnectAsync } = useDisconnect3();
|
|
14855
|
-
const [privy, setPrivy] =
|
|
14856
|
-
const [privyIframeUrl, setPrivyIframeUrl] =
|
|
14857
|
-
const [loginMethod, setLoginMethod] =
|
|
15109
|
+
const [privy, setPrivy] = useState43(null);
|
|
15110
|
+
const [privyIframeUrl, setPrivyIframeUrl] = useState43();
|
|
15111
|
+
const [loginMethod, setLoginMethod] = useState43(
|
|
14858
15112
|
getLoginMethodFromCache() || null
|
|
14859
15113
|
);
|
|
14860
15114
|
const wallets = useWalletConnectors();
|
|
14861
|
-
const [isLoggingIn, setIsLoggingIn] =
|
|
14862
|
-
const [loginErrorMessage, setLoginErrorMessage] =
|
|
14863
|
-
const [loggedInUser, setLoggedInUser] =
|
|
14864
|
-
const setLoginMethodAndCache =
|
|
15115
|
+
const [isLoggingIn, setIsLoggingIn] = useState43(false);
|
|
15116
|
+
const [loginErrorMessage, setLoginErrorMessage] = useState43("");
|
|
15117
|
+
const [loggedInUser, setLoggedInUser] = useState43(null);
|
|
15118
|
+
const setLoginMethodAndCache = useCallback30(
|
|
14865
15119
|
(method) => {
|
|
14866
15120
|
try {
|
|
14867
15121
|
setLoginMethod(method);
|
|
@@ -14876,7 +15130,7 @@ var FunkitWeb2Provider = ({
|
|
|
14876
15130
|
},
|
|
14877
15131
|
[]
|
|
14878
15132
|
);
|
|
14879
|
-
|
|
15133
|
+
useEffect31(() => {
|
|
14880
15134
|
const newPrivy = new PrivyJS({
|
|
14881
15135
|
appId: funkitConfig.privyAppId,
|
|
14882
15136
|
storage: new LocalStorage()
|
|
@@ -14884,7 +15138,7 @@ var FunkitWeb2Provider = ({
|
|
|
14884
15138
|
setPrivyIframeUrl(newPrivy.embeddedWallet.getURL());
|
|
14885
15139
|
setPrivy(newPrivy);
|
|
14886
15140
|
}, [funkitConfig.privyAppId]);
|
|
14887
|
-
const handleIframeMessage =
|
|
15141
|
+
const handleIframeMessage = useCallback30(
|
|
14888
15142
|
(e) => {
|
|
14889
15143
|
if (e.origin === PRIVY_AUTH_URL && privy) {
|
|
14890
15144
|
const iframeHandler = privy.embeddedWallet.getMessageHandler();
|
|
@@ -14893,7 +15147,7 @@ var FunkitWeb2Provider = ({
|
|
|
14893
15147
|
},
|
|
14894
15148
|
[privy]
|
|
14895
15149
|
);
|
|
14896
|
-
const handleFunkitWeb2Logout =
|
|
15150
|
+
const handleFunkitWeb2Logout = useCallback30(async () => {
|
|
14897
15151
|
if (privy) {
|
|
14898
15152
|
logger.log("handleFunkitWeb2Logout_disconnecting_connectors", {
|
|
14899
15153
|
numConnectors: connectors.length
|
|
@@ -14906,7 +15160,7 @@ var FunkitWeb2Provider = ({
|
|
|
14906
15160
|
setLoginMethodAndCache(null);
|
|
14907
15161
|
}
|
|
14908
15162
|
}, [connectors, disconnectAsync, privy, setLoginMethodAndCache]);
|
|
14909
|
-
const handleFreshPrivyLogin =
|
|
15163
|
+
const handleFreshPrivyLogin = useCallback30(
|
|
14910
15164
|
async ({
|
|
14911
15165
|
firstLoginCode,
|
|
14912
15166
|
secondLoginCode,
|
|
@@ -14953,7 +15207,7 @@ var FunkitWeb2Provider = ({
|
|
|
14953
15207
|
},
|
|
14954
15208
|
[handleFunkitWeb2Logout, privy]
|
|
14955
15209
|
);
|
|
14956
|
-
const getPrivyUserEmbeddedWallet =
|
|
15210
|
+
const getPrivyUserEmbeddedWallet = useCallback30(
|
|
14957
15211
|
async (inputPrivyUser) => {
|
|
14958
15212
|
try {
|
|
14959
15213
|
if (!privy || !inputPrivyUser)
|
|
@@ -14971,7 +15225,7 @@ var FunkitWeb2Provider = ({
|
|
|
14971
15225
|
},
|
|
14972
15226
|
[privy]
|
|
14973
15227
|
);
|
|
14974
|
-
const getExistingPrivySession =
|
|
15228
|
+
const getExistingPrivySession = useCallback30(async () => {
|
|
14975
15229
|
try {
|
|
14976
15230
|
if (!privy)
|
|
14977
15231
|
throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
|
|
@@ -14981,7 +15235,7 @@ var FunkitWeb2Provider = ({
|
|
|
14981
15235
|
return null;
|
|
14982
15236
|
}
|
|
14983
15237
|
}, [privy]);
|
|
14984
|
-
const handleFunkitWeb2Login =
|
|
15238
|
+
const handleFunkitWeb2Login = useCallback30(
|
|
14985
15239
|
async ({
|
|
14986
15240
|
chainId,
|
|
14987
15241
|
firstLoginCode,
|
|
@@ -15054,9 +15308,9 @@ var FunkitWeb2Provider = ({
|
|
|
15054
15308
|
wallets
|
|
15055
15309
|
]
|
|
15056
15310
|
);
|
|
15057
|
-
const clearLoginError =
|
|
15311
|
+
const clearLoginError = useCallback30(() => setLoginErrorMessage(""), []);
|
|
15058
15312
|
const initChainId = useInitialChainId();
|
|
15059
|
-
const handleAutoLoginFlows =
|
|
15313
|
+
const handleAutoLoginFlows = useCallback30(async () => {
|
|
15060
15314
|
if (isNotNullish(loginMethod) && isNotNullish(initChainId)) {
|
|
15061
15315
|
const queryParams = new URLSearchParams(window.location.search);
|
|
15062
15316
|
const oauthCode = queryParams.get(PRIVY_OAUTH_CODE_URL_PARAM);
|
|
@@ -15074,7 +15328,7 @@ var FunkitWeb2Provider = ({
|
|
|
15074
15328
|
}
|
|
15075
15329
|
}
|
|
15076
15330
|
}, [handleFunkitWeb2Login, initChainId, loginMethod]);
|
|
15077
|
-
|
|
15331
|
+
useEffect31(() => {
|
|
15078
15332
|
if (privy && privyIframeUrl && isNotNullish(initChainId)) {
|
|
15079
15333
|
const iframe = document.getElementById(
|
|
15080
15334
|
PRIVY_IFRAME_ID
|
|
@@ -15092,7 +15346,7 @@ var FunkitWeb2Provider = ({
|
|
|
15092
15346
|
handleIframeMessage,
|
|
15093
15347
|
initChainId
|
|
15094
15348
|
]);
|
|
15095
|
-
const handleOauthRedirect =
|
|
15349
|
+
const handleOauthRedirect = useCallback30(
|
|
15096
15350
|
async (authProvider) => {
|
|
15097
15351
|
if (!privy)
|
|
15098
15352
|
throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
|
|
@@ -15116,8 +15370,8 @@ var FunkitWeb2Provider = ({
|
|
|
15116
15370
|
},
|
|
15117
15371
|
[privy, setLoginMethodAndCache]
|
|
15118
15372
|
);
|
|
15119
|
-
const [isSendingOtpEmail, setIsSendingOtpEmail] =
|
|
15120
|
-
const handleSendOtpEmail =
|
|
15373
|
+
const [isSendingOtpEmail, setIsSendingOtpEmail] = useState43(false);
|
|
15374
|
+
const handleSendOtpEmail = useCallback30(
|
|
15121
15375
|
async (emailAddress) => {
|
|
15122
15376
|
try {
|
|
15123
15377
|
if (!privy)
|
|
@@ -15144,8 +15398,8 @@ var FunkitWeb2Provider = ({
|
|
|
15144
15398
|
},
|
|
15145
15399
|
[privy, setLoginMethodAndCache]
|
|
15146
15400
|
);
|
|
15147
|
-
const [isGeneratingFcUri, setIsGeneratingFcUri] =
|
|
15148
|
-
const handleGenerateFcUri =
|
|
15401
|
+
const [isGeneratingFcUri, setIsGeneratingFcUri] = useState43(false);
|
|
15402
|
+
const handleGenerateFcUri = useCallback30(async () => {
|
|
15149
15403
|
try {
|
|
15150
15404
|
if (!privy)
|
|
15151
15405
|
throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
|
|
@@ -15171,7 +15425,7 @@ var FunkitWeb2Provider = ({
|
|
|
15171
15425
|
setIsGeneratingFcUri(false);
|
|
15172
15426
|
}
|
|
15173
15427
|
}, [privy]);
|
|
15174
|
-
const getFcConnectionStatus =
|
|
15428
|
+
const getFcConnectionStatus = useCallback30(
|
|
15175
15429
|
async (channelToken) => {
|
|
15176
15430
|
try {
|
|
15177
15431
|
if (!privy)
|
|
@@ -15256,15 +15510,15 @@ var FunkitWeb2Provider = ({
|
|
|
15256
15510
|
handleFunkitWeb2Logout,
|
|
15257
15511
|
web2AccountInfo: userAccountInfo
|
|
15258
15512
|
};
|
|
15259
|
-
return /* @__PURE__ */
|
|
15513
|
+
return /* @__PURE__ */ React147.createElement(FunkitWeb2Context.Provider, {
|
|
15260
15514
|
value: contextValue
|
|
15261
|
-
}, privyIframeUrl ? /* @__PURE__ */
|
|
15515
|
+
}, privyIframeUrl ? /* @__PURE__ */ React147.createElement("iframe", {
|
|
15262
15516
|
id: PRIVY_IFRAME_ID,
|
|
15263
15517
|
src: privyIframeUrl,
|
|
15264
15518
|
style: { display: "none" }
|
|
15265
15519
|
}) : null, children);
|
|
15266
15520
|
};
|
|
15267
|
-
var useFunkitWeb2Login = () =>
|
|
15521
|
+
var useFunkitWeb2Login = () => useContext24(FunkitWeb2Context);
|
|
15268
15522
|
|
|
15269
15523
|
// src/hooks/useConnectionStatus.ts
|
|
15270
15524
|
function useConnectionStatus() {
|
|
@@ -15287,27 +15541,27 @@ function useConnectionStatus() {
|
|
|
15287
15541
|
}
|
|
15288
15542
|
|
|
15289
15543
|
// src/components/FunkitProvider/ShowBalanceContext.tsx
|
|
15290
|
-
import
|
|
15291
|
-
var ShowBalanceContext =
|
|
15544
|
+
import React148, { createContext as createContext19, useContext as useContext25, useState as useState44 } from "react";
|
|
15545
|
+
var ShowBalanceContext = createContext19({
|
|
15292
15546
|
showBalance: void 0,
|
|
15293
15547
|
setShowBalance: () => void 0
|
|
15294
15548
|
});
|
|
15295
15549
|
function ShowBalanceProvider({ children }) {
|
|
15296
|
-
const [showBalance, setShowBalance] =
|
|
15297
|
-
return /* @__PURE__ */
|
|
15550
|
+
const [showBalance, setShowBalance] = useState44();
|
|
15551
|
+
return /* @__PURE__ */ React148.createElement(ShowBalanceContext.Provider, {
|
|
15298
15552
|
value: { showBalance, setShowBalance }
|
|
15299
15553
|
}, children);
|
|
15300
15554
|
}
|
|
15301
|
-
var useShowBalance = () =>
|
|
15555
|
+
var useShowBalance = () => useContext25(ShowBalanceContext);
|
|
15302
15556
|
|
|
15303
15557
|
// src/components/Icons/Dropdown.tsx
|
|
15304
|
-
import
|
|
15305
|
-
var DropdownIcon = () => /* @__PURE__ */
|
|
15558
|
+
import React149 from "react";
|
|
15559
|
+
var DropdownIcon = () => /* @__PURE__ */ React149.createElement("svg", {
|
|
15306
15560
|
fill: "none",
|
|
15307
15561
|
height: "7",
|
|
15308
15562
|
width: "14",
|
|
15309
15563
|
xmlns: "http://www.w3.org/2000/svg"
|
|
15310
|
-
}, /* @__PURE__ */
|
|
15564
|
+
}, /* @__PURE__ */ React149.createElement("path", {
|
|
15311
15565
|
d: "M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",
|
|
15312
15566
|
stroke: "currentColor",
|
|
15313
15567
|
strokeLinecap: "round",
|
|
@@ -15317,30 +15571,30 @@ var DropdownIcon = () => /* @__PURE__ */ React148.createElement("svg", {
|
|
|
15317
15571
|
}));
|
|
15318
15572
|
|
|
15319
15573
|
// src/components/ConnectButton/ConnectButtonRenderer.tsx
|
|
15320
|
-
import
|
|
15574
|
+
import React151, { useContext as useContext27 } from "react";
|
|
15321
15575
|
import { useAccount as useAccount16, useBalance, useConfig as useConfig5 } from "wagmi";
|
|
15322
15576
|
|
|
15323
15577
|
// src/hooks/useIsMounted.ts
|
|
15324
|
-
import { useCallback as
|
|
15578
|
+
import { useCallback as useCallback31, useEffect as useEffect32, useState as useState45 } from "react";
|
|
15325
15579
|
function useIsMounted() {
|
|
15326
|
-
const [isMounted, setIsMounted] =
|
|
15327
|
-
|
|
15580
|
+
const [isMounted, setIsMounted] = useState45(false);
|
|
15581
|
+
useEffect32(() => {
|
|
15328
15582
|
setIsMounted(true);
|
|
15329
15583
|
return () => {
|
|
15330
15584
|
setIsMounted(false);
|
|
15331
15585
|
};
|
|
15332
15586
|
}, []);
|
|
15333
|
-
return
|
|
15587
|
+
return useCallback31(() => isMounted, [isMounted]);
|
|
15334
15588
|
}
|
|
15335
15589
|
|
|
15336
15590
|
// src/hooks/useMainnetEnsAvatar.ts
|
|
15337
15591
|
import { normalize } from "viem/ens";
|
|
15338
15592
|
import { useEnsAvatar } from "wagmi";
|
|
15339
|
-
import { mainnet as
|
|
15593
|
+
import { mainnet as mainnet4 } from "wagmi/chains";
|
|
15340
15594
|
function useMainnetEnsAvatar(name) {
|
|
15341
15595
|
const mainnetConfigured = useIsMainnetConfigured();
|
|
15342
15596
|
const { data: ensAvatar } = useEnsAvatar({
|
|
15343
|
-
chainId:
|
|
15597
|
+
chainId: mainnet4.id,
|
|
15344
15598
|
name: name ? normalize(name) : void 0,
|
|
15345
15599
|
query: {
|
|
15346
15600
|
enabled: mainnetConfigured
|
|
@@ -15350,7 +15604,7 @@ function useMainnetEnsAvatar(name) {
|
|
|
15350
15604
|
}
|
|
15351
15605
|
|
|
15352
15606
|
// src/transactions/useRecentTransactions.ts
|
|
15353
|
-
import { useEffect as
|
|
15607
|
+
import { useEffect as useEffect34, useState as useState47 } from "react";
|
|
15354
15608
|
import { useAccount as useAccount15 } from "wagmi";
|
|
15355
15609
|
|
|
15356
15610
|
// src/hooks/useChainId.ts
|
|
@@ -15362,7 +15616,7 @@ function useChainId() {
|
|
|
15362
15616
|
}
|
|
15363
15617
|
|
|
15364
15618
|
// src/transactions/TransactionStoreContext.tsx
|
|
15365
|
-
import
|
|
15619
|
+
import React150, { createContext as createContext20, useContext as useContext26, useEffect as useEffect33, useState as useState46 } from "react";
|
|
15366
15620
|
import { useAccount as useAccount14, usePublicClient } from "wagmi";
|
|
15367
15621
|
|
|
15368
15622
|
// src/transactions/transactionStore.ts
|
|
@@ -15505,30 +15759,30 @@ function createTransactionStore({
|
|
|
15505
15759
|
|
|
15506
15760
|
// src/transactions/TransactionStoreContext.tsx
|
|
15507
15761
|
var storeSingleton;
|
|
15508
|
-
var TransactionStoreContext =
|
|
15762
|
+
var TransactionStoreContext = createContext20(null);
|
|
15509
15763
|
function TransactionStoreProvider({
|
|
15510
15764
|
children
|
|
15511
15765
|
}) {
|
|
15512
15766
|
const provider = usePublicClient();
|
|
15513
15767
|
const { address } = useAccount14();
|
|
15514
15768
|
const chainId = useChainId();
|
|
15515
|
-
const [store] =
|
|
15769
|
+
const [store] = useState46(
|
|
15516
15770
|
() => storeSingleton != null ? storeSingleton : storeSingleton = createTransactionStore({ provider })
|
|
15517
15771
|
);
|
|
15518
|
-
|
|
15772
|
+
useEffect33(() => {
|
|
15519
15773
|
store.setProvider(provider);
|
|
15520
15774
|
}, [store, provider]);
|
|
15521
|
-
|
|
15775
|
+
useEffect33(() => {
|
|
15522
15776
|
if (address && chainId) {
|
|
15523
15777
|
store.waitForPendingTransactions(address, chainId);
|
|
15524
15778
|
}
|
|
15525
15779
|
}, [store, address, chainId]);
|
|
15526
|
-
return /* @__PURE__ */
|
|
15780
|
+
return /* @__PURE__ */ React150.createElement(TransactionStoreContext.Provider, {
|
|
15527
15781
|
value: store
|
|
15528
15782
|
}, children);
|
|
15529
15783
|
}
|
|
15530
15784
|
function useTransactionStore() {
|
|
15531
|
-
const store =
|
|
15785
|
+
const store = useContext26(TransactionStoreContext);
|
|
15532
15786
|
if (!store) {
|
|
15533
15787
|
throw new Error("Transaction hooks must be used within FunkitProvider");
|
|
15534
15788
|
}
|
|
@@ -15540,10 +15794,10 @@ function useRecentTransactions() {
|
|
|
15540
15794
|
const store = useTransactionStore();
|
|
15541
15795
|
const { address } = useAccount15();
|
|
15542
15796
|
const chainId = useChainId();
|
|
15543
|
-
const [transactions, setTransactions] =
|
|
15797
|
+
const [transactions, setTransactions] = useState47(
|
|
15544
15798
|
() => store && address && chainId ? store.getTransactions(address, chainId) : []
|
|
15545
15799
|
);
|
|
15546
|
-
|
|
15800
|
+
useEffect34(() => {
|
|
15547
15801
|
if (store && address && chainId) {
|
|
15548
15802
|
setTransactions(store.getTransactions(address, chainId));
|
|
15549
15803
|
return store.onChange(() => {
|
|
@@ -15555,8 +15809,8 @@ function useRecentTransactions() {
|
|
|
15555
15809
|
}
|
|
15556
15810
|
|
|
15557
15811
|
// src/components/FunkitProvider/ShowRecentTransactionsContext.ts
|
|
15558
|
-
import { createContext as
|
|
15559
|
-
var ShowRecentTransactionsContext =
|
|
15812
|
+
import { createContext as createContext21 } from "react";
|
|
15813
|
+
var ShowRecentTransactionsContext = createContext21(false);
|
|
15560
15814
|
|
|
15561
15815
|
// src/components/ConnectButton/abbreviateETHBalance.ts
|
|
15562
15816
|
var units = ["k", "m", "b", "t"];
|
|
@@ -15606,7 +15860,7 @@ function ConnectButtonRenderer({
|
|
|
15606
15860
|
const chainIconUrl = (_c = funkitConnectChain == null ? void 0 : funkitConnectChain.iconUrl) != null ? _c : void 0;
|
|
15607
15861
|
const chainIconBackground = (_d = funkitConnectChain == null ? void 0 : funkitConnectChain.iconBackground) != null ? _d : void 0;
|
|
15608
15862
|
const resolvedChainIconUrl = useAsyncImage(chainIconUrl);
|
|
15609
|
-
const showRecentTransactions =
|
|
15863
|
+
const showRecentTransactions = useContext27(ShowRecentTransactionsContext);
|
|
15610
15864
|
const hasPendingTransactions = useRecentTransactions().some(({ status }) => status === "pending") && showRecentTransactions;
|
|
15611
15865
|
const { showBalance } = useShowBalance();
|
|
15612
15866
|
const computeShouldShowBalance = () => {
|
|
@@ -15627,7 +15881,7 @@ function ConnectButtonRenderer({
|
|
|
15627
15881
|
const { openChainModal } = useChainModal();
|
|
15628
15882
|
const { openAccountModal } = useAccountModal();
|
|
15629
15883
|
const { accountModalOpen, chainModalOpen, connectModalOpen } = useModalState();
|
|
15630
|
-
return /* @__PURE__ */
|
|
15884
|
+
return /* @__PURE__ */ React151.createElement(React151.Fragment, null, children({
|
|
15631
15885
|
account: address ? {
|
|
15632
15886
|
address,
|
|
15633
15887
|
balanceDecimals: balanceData == null ? void 0 : balanceData.decimals,
|
|
@@ -15674,8 +15928,8 @@ function ChainSelectorButton({
|
|
|
15674
15928
|
chain
|
|
15675
15929
|
}) {
|
|
15676
15930
|
var _a, _b;
|
|
15677
|
-
const { i18n: i18n2 } =
|
|
15678
|
-
return /* @__PURE__ */
|
|
15931
|
+
const { i18n: i18n2 } = useContext28(I18nContext);
|
|
15932
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
15679
15933
|
alignItems: "center",
|
|
15680
15934
|
"aria-label": "Chain Selector",
|
|
15681
15935
|
as: "button",
|
|
@@ -15701,37 +15955,37 @@ function ChainSelectorButton({
|
|
|
15701
15955
|
testId: unsupportedChain ? "wrong-network-button" : "chain-button",
|
|
15702
15956
|
transition: "default",
|
|
15703
15957
|
type: "button"
|
|
15704
|
-
}, unsupportedChain ? /* @__PURE__ */
|
|
15958
|
+
}, unsupportedChain ? /* @__PURE__ */ React152.createElement(Box, {
|
|
15705
15959
|
alignItems: "center",
|
|
15706
15960
|
display: "flex",
|
|
15707
15961
|
height: "24",
|
|
15708
15962
|
paddingX: "4"
|
|
15709
|
-
}, i18n2.t("connect_wallet.wrong_network.label")) : /* @__PURE__ */
|
|
15963
|
+
}, i18n2.t("connect_wallet.wrong_network.label")) : /* @__PURE__ */ React152.createElement(Box, {
|
|
15710
15964
|
alignItems: "center",
|
|
15711
15965
|
display: "flex",
|
|
15712
15966
|
gap: "6"
|
|
15713
|
-
}, chain.hasIcon ? /* @__PURE__ */
|
|
15967
|
+
}, chain.hasIcon ? /* @__PURE__ */ React152.createElement(Box, {
|
|
15714
15968
|
display: mapResponsiveValue(
|
|
15715
15969
|
chainStatus,
|
|
15716
15970
|
(value) => value === "full" || value === "icon" ? "block" : "none"
|
|
15717
15971
|
),
|
|
15718
15972
|
height: "24",
|
|
15719
15973
|
width: "24"
|
|
15720
|
-
}, /* @__PURE__ */
|
|
15974
|
+
}, /* @__PURE__ */ React152.createElement(AsyncImage, {
|
|
15721
15975
|
alt: (_a = chain.name) != null ? _a : "Chain icon",
|
|
15722
15976
|
background: chain.iconBackground,
|
|
15723
15977
|
borderRadius: "full",
|
|
15724
15978
|
height: "24",
|
|
15725
15979
|
src: chain.iconUrl,
|
|
15726
15980
|
width: "24"
|
|
15727
|
-
})) : null, /* @__PURE__ */
|
|
15981
|
+
})) : null, /* @__PURE__ */ React152.createElement(Box, {
|
|
15728
15982
|
display: mapResponsiveValue(chainStatus, (value) => {
|
|
15729
15983
|
if (value === "icon" && !chain.iconUrl) {
|
|
15730
15984
|
return "block";
|
|
15731
15985
|
}
|
|
15732
15986
|
return value === "full" || value === "name" ? "block" : "none";
|
|
15733
15987
|
})
|
|
15734
|
-
}, (_b = chain.name) != null ? _b : chain.id)), /* @__PURE__ */
|
|
15988
|
+
}, (_b = chain.name) != null ? _b : chain.id)), /* @__PURE__ */ React152.createElement(DropdownIcon, null));
|
|
15735
15989
|
}
|
|
15736
15990
|
function AccountButton({
|
|
15737
15991
|
openAccountModal,
|
|
@@ -15740,7 +15994,7 @@ function AccountButton({
|
|
|
15740
15994
|
accountStatus
|
|
15741
15995
|
}) {
|
|
15742
15996
|
const { userInfo } = useGeneralWallet();
|
|
15743
|
-
return /* @__PURE__ */
|
|
15997
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
15744
15998
|
alignItems: "center",
|
|
15745
15999
|
as: "button",
|
|
15746
16000
|
background: "accentColor",
|
|
@@ -15758,14 +16012,14 @@ function AccountButton({
|
|
|
15758
16012
|
testId: "account-button",
|
|
15759
16013
|
transition: "default",
|
|
15760
16014
|
type: "button"
|
|
15761
|
-
}, account.displayBalance && /* @__PURE__ */
|
|
16015
|
+
}, account.displayBalance && /* @__PURE__ */ React152.createElement(Box, {
|
|
15762
16016
|
display: mapResponsiveValue(
|
|
15763
16017
|
showBalance,
|
|
15764
16018
|
(value) => value ? "block" : "none"
|
|
15765
16019
|
),
|
|
15766
16020
|
padding: "8",
|
|
15767
16021
|
paddingLeft: "12"
|
|
15768
|
-
}, account.displayBalance), /* @__PURE__ */
|
|
16022
|
+
}, account.displayBalance), /* @__PURE__ */ React152.createElement(Box, {
|
|
15769
16023
|
background: "connectButtonInnerBackground",
|
|
15770
16024
|
borderColor: "accentColor",
|
|
15771
16025
|
borderRadius: "connectButton",
|
|
@@ -15777,32 +16031,32 @@ function AccountButton({
|
|
|
15777
16031
|
paddingX: "8",
|
|
15778
16032
|
paddingY: "6",
|
|
15779
16033
|
transition: "default"
|
|
15780
|
-
}, /* @__PURE__ */
|
|
16034
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
15781
16035
|
alignItems: "center",
|
|
15782
16036
|
display: "flex",
|
|
15783
16037
|
gap: "6",
|
|
15784
16038
|
height: "24"
|
|
15785
|
-
}, /* @__PURE__ */
|
|
16039
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
15786
16040
|
display: mapResponsiveValue(
|
|
15787
16041
|
accountStatus,
|
|
15788
16042
|
(value) => value === "full" || value === "avatar" ? "block" : "none"
|
|
15789
16043
|
)
|
|
15790
|
-
}, /* @__PURE__ */
|
|
16044
|
+
}, /* @__PURE__ */ React152.createElement(Avatar, {
|
|
15791
16045
|
address: account.address,
|
|
15792
16046
|
imageUrl: account.ensAvatar || userInfo.accountPicSrc,
|
|
15793
16047
|
loading: account.hasPendingTransactions,
|
|
15794
16048
|
size: 24
|
|
15795
|
-
})), /* @__PURE__ */
|
|
16049
|
+
})), /* @__PURE__ */ React152.createElement(Box, {
|
|
15796
16050
|
alignItems: "center",
|
|
15797
16051
|
display: "flex",
|
|
15798
16052
|
gap: "6"
|
|
15799
|
-
}, /* @__PURE__ */
|
|
16053
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
15800
16054
|
display: mapResponsiveValue(
|
|
15801
16055
|
accountStatus,
|
|
15802
16056
|
(value) => value === "full" || value === "address" ? "block" : "none"
|
|
15803
16057
|
),
|
|
15804
16058
|
style: { textWrap: "nowrap" }
|
|
15805
|
-
}, userInfo.accountName), /* @__PURE__ */
|
|
16059
|
+
}, userInfo.accountName), /* @__PURE__ */ React152.createElement(DropdownIcon, null)))));
|
|
15806
16060
|
}
|
|
15807
16061
|
function ConnectButton({
|
|
15808
16062
|
accountStatus = defaultProps.accountStatus,
|
|
@@ -15814,14 +16068,14 @@ function ConnectButton({
|
|
|
15814
16068
|
const chains = useFunkitConnectChains();
|
|
15815
16069
|
const connectionStatus = useConnectionStatus();
|
|
15816
16070
|
const { setShowBalance } = useShowBalance();
|
|
15817
|
-
const [ready, setReady] =
|
|
15818
|
-
const { i18n: i18n2 } =
|
|
15819
|
-
|
|
16071
|
+
const [ready, setReady] = useState48(false);
|
|
16072
|
+
const { i18n: i18n2 } = useContext28(I18nContext);
|
|
16073
|
+
useEffect35(() => {
|
|
15820
16074
|
setShowBalance(showBalance);
|
|
15821
16075
|
if (!ready)
|
|
15822
16076
|
setReady(true);
|
|
15823
16077
|
}, [showBalance, setShowBalance, ready]);
|
|
15824
|
-
return ready ? /* @__PURE__ */
|
|
16078
|
+
return ready ? /* @__PURE__ */ React152.createElement(ConnectButtonRenderer, null, ({
|
|
15825
16079
|
account,
|
|
15826
16080
|
chain,
|
|
15827
16081
|
mounted,
|
|
@@ -15832,7 +16086,7 @@ function ConnectButton({
|
|
|
15832
16086
|
var _a;
|
|
15833
16087
|
const ready2 = mounted && connectionStatus !== "loading";
|
|
15834
16088
|
const unsupportedChain = (_a = chain == null ? void 0 : chain.unsupported) != null ? _a : false;
|
|
15835
|
-
return /* @__PURE__ */
|
|
16089
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
15836
16090
|
display: "flex",
|
|
15837
16091
|
gap: "12",
|
|
15838
16092
|
...!ready2 && {
|
|
@@ -15843,17 +16097,17 @@ function ConnectButton({
|
|
|
15843
16097
|
userSelect: "none"
|
|
15844
16098
|
}
|
|
15845
16099
|
}
|
|
15846
|
-
}, ready2 && account && connectionStatus === "connected" ? /* @__PURE__ */
|
|
16100
|
+
}, ready2 && account && connectionStatus === "connected" ? /* @__PURE__ */ React152.createElement(React152.Fragment, null, showChainSelector && chain && (chains.length > 1 || unsupportedChain) && /* @__PURE__ */ React152.createElement(ChainSelectorButton, {
|
|
15847
16101
|
unsupportedChain,
|
|
15848
16102
|
chainStatus,
|
|
15849
16103
|
openChainModal,
|
|
15850
16104
|
chain
|
|
15851
|
-
}), !unsupportedChain && /* @__PURE__ */
|
|
16105
|
+
}), !unsupportedChain && /* @__PURE__ */ React152.createElement(AccountButton, {
|
|
15852
16106
|
openAccountModal,
|
|
15853
16107
|
account,
|
|
15854
16108
|
showBalance,
|
|
15855
16109
|
accountStatus
|
|
15856
|
-
})) : /* @__PURE__ */
|
|
16110
|
+
})) : /* @__PURE__ */ React152.createElement(Box, {
|
|
15857
16111
|
as: "button",
|
|
15858
16112
|
background: "accentColor",
|
|
15859
16113
|
borderRadius: "connectButton",
|
|
@@ -15873,14 +16127,14 @@ function ConnectButton({
|
|
|
15873
16127
|
transition: "default",
|
|
15874
16128
|
type: "button"
|
|
15875
16129
|
}, mounted && label === "Connect Wallet" ? i18n2.t("connect_wallet.label") : label));
|
|
15876
|
-
}) : /* @__PURE__ */
|
|
16130
|
+
}) : /* @__PURE__ */ React152.createElement(React152.Fragment, null);
|
|
15877
16131
|
}
|
|
15878
16132
|
ConnectButton.__defaultProps = defaultProps;
|
|
15879
16133
|
ConnectButton.Custom = ConnectButtonRenderer;
|
|
15880
16134
|
|
|
15881
16135
|
// src/components/FunkitProvider/FunkitProvider.tsx
|
|
15882
16136
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
15883
|
-
import
|
|
16137
|
+
import React153, { createContext as createContext22, useContext as useContext29 } from "react";
|
|
15884
16138
|
import { useAccountEffect as useAccountEffect3, WagmiProvider } from "wagmi";
|
|
15885
16139
|
|
|
15886
16140
|
// src/css/cssObjectFromTheme.ts
|
|
@@ -15910,9 +16164,6 @@ function cssStringFromTheme(theme, options = {}) {
|
|
|
15910
16164
|
return Object.entries(cssObjectFromTheme(theme, options)).map(([key, value]) => `${key}:${value.replace(/[:;{}</>]/g, "")};`).join("");
|
|
15911
16165
|
}
|
|
15912
16166
|
|
|
15913
|
-
// src/utils/funkitProvider.ts
|
|
15914
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST as FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST2 } from "@funkit/core";
|
|
15915
|
-
|
|
15916
16167
|
// src/config/getDefaultConfig.ts
|
|
15917
16168
|
import { http } from "wagmi";
|
|
15918
16169
|
import { createConfig } from "wagmi";
|
|
@@ -16608,12 +16859,10 @@ function getInitialChainIdFromFunkitProviderProps(props) {
|
|
|
16608
16859
|
}
|
|
16609
16860
|
function validateChains(props) {
|
|
16610
16861
|
const initialChainId = getInitialChainIdFromFunkitProviderProps(props);
|
|
16611
|
-
props.wagmiConfig.chains.
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
});
|
|
16616
|
-
if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST2.includes(initialChainId.toString())) {
|
|
16862
|
+
const foundInitialChain = props.wagmiConfig.chains.find(
|
|
16863
|
+
(fkcChain) => fkcChain.id.toString() === initialChainId.toString()
|
|
16864
|
+
);
|
|
16865
|
+
if (!foundInitialChain) {
|
|
16617
16866
|
throw new Error(
|
|
16618
16867
|
`Unsupported initialChain ${initialChainId}. Ensure that it is included in 'chains' config as well.`
|
|
16619
16868
|
);
|
|
@@ -16686,30 +16935,30 @@ function generateInnerWagmiConfig(props) {
|
|
|
16686
16935
|
}
|
|
16687
16936
|
|
|
16688
16937
|
// src/components/FunkitProvider/useFingerprint.ts
|
|
16689
|
-
import { useCallback as
|
|
16938
|
+
import { useCallback as useCallback32, useEffect as useEffect36 } from "react";
|
|
16690
16939
|
var storageKey6 = "funkit-connect-version";
|
|
16691
16940
|
function setFunkitConnectVersion({ version }) {
|
|
16692
16941
|
localStorage.setItem(storageKey6, version);
|
|
16693
16942
|
}
|
|
16694
16943
|
function getCurrentSdkVersion() {
|
|
16695
|
-
return "1.0.
|
|
16944
|
+
return "1.0.24";
|
|
16696
16945
|
}
|
|
16697
16946
|
function useFingerprint() {
|
|
16698
|
-
const fingerprint =
|
|
16947
|
+
const fingerprint = useCallback32(() => {
|
|
16699
16948
|
setFunkitConnectVersion({ version: getCurrentSdkVersion() });
|
|
16700
16949
|
}, []);
|
|
16701
|
-
|
|
16950
|
+
useEffect36(() => {
|
|
16702
16951
|
fingerprint();
|
|
16703
16952
|
}, [fingerprint]);
|
|
16704
16953
|
}
|
|
16705
16954
|
|
|
16706
16955
|
// src/components/FunkitProvider/usePreloadImages.ts
|
|
16707
|
-
import { useCallback as
|
|
16956
|
+
import { useCallback as useCallback33, useEffect as useEffect37 } from "react";
|
|
16708
16957
|
function usePreloadImages() {
|
|
16709
16958
|
const funkitConnectChains = useFunkitConnectChains();
|
|
16710
16959
|
const walletConnectors = useWalletConnectors();
|
|
16711
16960
|
const isUnauthenticated = useAuthenticationStatus() === "unauthenticated";
|
|
16712
|
-
const preloadImages =
|
|
16961
|
+
const preloadImages = useCallback33(() => {
|
|
16713
16962
|
loadImages(
|
|
16714
16963
|
...walletConnectors.map((wallet) => wallet.iconUrl),
|
|
16715
16964
|
...funkitConnectChains.map((chain) => chain.iconUrl).filter(isNotNullish)
|
|
@@ -16722,32 +16971,13 @@ function usePreloadImages() {
|
|
|
16722
16971
|
loadImages(signInIcon);
|
|
16723
16972
|
}
|
|
16724
16973
|
}, [walletConnectors, funkitConnectChains, isUnauthenticated]);
|
|
16725
|
-
|
|
16974
|
+
useEffect37(() => {
|
|
16726
16975
|
preloadImages();
|
|
16727
16976
|
}, [preloadImages]);
|
|
16728
16977
|
}
|
|
16729
16978
|
|
|
16730
16979
|
// src/components/FunkitProvider/FunkitProvider.tsx
|
|
16731
|
-
var
|
|
16732
|
-
const [MoonPayProviderInner, setMoonPayProviderInner] = React152.useState(null);
|
|
16733
|
-
useEffect37(() => {
|
|
16734
|
-
const loadMoonPayProviderInner = async () => {
|
|
16735
|
-
try {
|
|
16736
|
-
const module = await import("@moonpay/moonpay-react");
|
|
16737
|
-
setMoonPayProviderInner(() => module.MoonPayProvider);
|
|
16738
|
-
} catch (error) {
|
|
16739
|
-
logger.error("Failed to load MoonPayProvider", error);
|
|
16740
|
-
}
|
|
16741
|
-
};
|
|
16742
|
-
loadMoonPayProviderInner();
|
|
16743
|
-
}, []);
|
|
16744
|
-
if (!MoonPayProviderInner)
|
|
16745
|
-
return /* @__PURE__ */ React152.createElement(React152.Fragment, null, props.children);
|
|
16746
|
-
return /* @__PURE__ */ React152.createElement(MoonPayProviderInner, {
|
|
16747
|
-
...props
|
|
16748
|
-
}, props.children);
|
|
16749
|
-
};
|
|
16750
|
-
var ThemeIdContext2 = createContext21(void 0);
|
|
16980
|
+
var ThemeIdContext2 = createContext22(void 0);
|
|
16751
16981
|
var attr2 = "data-rk";
|
|
16752
16982
|
var createThemeRootProps2 = (id) => ({ [attr2]: id || "" });
|
|
16753
16983
|
var createThemeRootSelector = (id) => {
|
|
@@ -16765,13 +16995,13 @@ function FunkitProvider(props) {
|
|
|
16765
16995
|
getCurrentSdkVersion()
|
|
16766
16996
|
);
|
|
16767
16997
|
const initialChainId = getInitialChainIdFromFunkitProviderProps(props);
|
|
16768
|
-
return /* @__PURE__ */
|
|
16998
|
+
return /* @__PURE__ */ React153.createElement(WagmiProvider, {
|
|
16769
16999
|
config: finalWagmiConfig
|
|
16770
|
-
}, /* @__PURE__ */
|
|
17000
|
+
}, /* @__PURE__ */ React153.createElement(QueryClientProvider, {
|
|
16771
17001
|
client: props.queryClient
|
|
16772
|
-
}, /* @__PURE__ */
|
|
17002
|
+
}, /* @__PURE__ */ React153.createElement(FunkitThemeProvider, {
|
|
16773
17003
|
theme: props.theme
|
|
16774
|
-
}, /* @__PURE__ */
|
|
17004
|
+
}, /* @__PURE__ */ React153.createElement(FunkitProviderInner, {
|
|
16775
17005
|
appInfo: props.appInfo,
|
|
16776
17006
|
avatar: props.avatar,
|
|
16777
17007
|
id: props.id,
|
|
@@ -16807,36 +17037,35 @@ function FunkitProviderInner({
|
|
|
16807
17037
|
const modalSize = ModalSizeOptions.WIDE;
|
|
16808
17038
|
const coolMode = false;
|
|
16809
17039
|
const showRecentTransactions = false;
|
|
16810
|
-
return /* @__PURE__ */
|
|
17040
|
+
return /* @__PURE__ */ React153.createElement(FunkitConnectChainProvider, {
|
|
16811
17041
|
initialChain
|
|
16812
|
-
}, /* @__PURE__ */
|
|
17042
|
+
}, /* @__PURE__ */ React153.createElement(FunkitConfigContext.Provider, {
|
|
16813
17043
|
value: funkitConfig
|
|
16814
|
-
}, /* @__PURE__ */
|
|
17044
|
+
}, /* @__PURE__ */ React153.createElement(WalletButtonProvider, null, /* @__PURE__ */ React153.createElement(I18nProvider, {
|
|
16815
17045
|
locale
|
|
16816
|
-
}, /* @__PURE__ */
|
|
17046
|
+
}, /* @__PURE__ */ React153.createElement(CoolModeContext.Provider, {
|
|
16817
17047
|
value: coolMode
|
|
16818
|
-
}, /* @__PURE__ */
|
|
17048
|
+
}, /* @__PURE__ */ React153.createElement(ModalSizeProvider, {
|
|
16819
17049
|
modalSize
|
|
16820
|
-
}, /* @__PURE__ */
|
|
17050
|
+
}, /* @__PURE__ */ React153.createElement(FunkitWeb2Provider, null, /* @__PURE__ */ React153.createElement(GeneralWalletProvider, null, /* @__PURE__ */ React153.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React153.createElement(ShowRecentTransactionsContext.Provider, {
|
|
16821
17051
|
value: showRecentTransactions
|
|
16822
|
-
}, /* @__PURE__ */
|
|
17052
|
+
}, /* @__PURE__ */ React153.createElement(FunkitSandboxContext.Provider, {
|
|
16823
17053
|
value: isSandboxMode
|
|
16824
|
-
}, /* @__PURE__ */
|
|
17054
|
+
}, /* @__PURE__ */ React153.createElement(FunkitMeshProvider, null, /* @__PURE__ */ React153.createElement(TransactionStoreProvider, null, /* @__PURE__ */ React153.createElement(AvatarContext.Provider, {
|
|
16825
17055
|
value: avatarContext
|
|
16826
|
-
}, /* @__PURE__ */
|
|
17056
|
+
}, /* @__PURE__ */ React153.createElement(AppContext.Provider, {
|
|
16827
17057
|
value: appContext
|
|
16828
|
-
}, /* @__PURE__ */
|
|
17058
|
+
}, /* @__PURE__ */ React153.createElement(ThemeIdContext2.Provider, {
|
|
16829
17059
|
value: id
|
|
16830
|
-
}, /* @__PURE__ */
|
|
16831
|
-
apiKey: isSandboxMode ? "pk_test_dWfAhBbvVexIId9S5hPd78mKM7ivIsqu" : "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO",
|
|
17060
|
+
}, /* @__PURE__ */ React153.createElement(ShowBalanceProvider, null, /* @__PURE__ */ React153.createElement(FunToastProvider, null, /* @__PURE__ */ React153.createElement(FunkitMoonpayProvider, {
|
|
16832
17061
|
debug: !!debug
|
|
16833
|
-
}, /* @__PURE__ */
|
|
17062
|
+
}, /* @__PURE__ */ React153.createElement(ModalProvider, null, activeTheme ? /* @__PURE__ */ React153.createElement("div", {
|
|
16834
17063
|
...createThemeRootProps2(id),
|
|
16835
17064
|
style: {
|
|
16836
17065
|
width: "100%",
|
|
16837
17066
|
height: "100%"
|
|
16838
17067
|
}
|
|
16839
|
-
}, /* @__PURE__ */
|
|
17068
|
+
}, /* @__PURE__ */ React153.createElement("style", {
|
|
16840
17069
|
dangerouslySetInnerHTML: {
|
|
16841
17070
|
__html: [
|
|
16842
17071
|
`${selector}{${cssStringFromTheme(
|
|
@@ -16848,18 +17077,18 @@ function FunkitProviderInner({
|
|
|
16848
17077
|
}
|
|
16849
17078
|
|
|
16850
17079
|
// src/components/WalletButton/WalletButton.tsx
|
|
16851
|
-
import
|
|
17080
|
+
import React155, { useContext as useContext31 } from "react";
|
|
16852
17081
|
|
|
16853
17082
|
// src/components/WalletButton/WalletButton.css.ts
|
|
16854
17083
|
var border = "_85s11r0";
|
|
16855
17084
|
var maxWidth = "_85s11r1";
|
|
16856
17085
|
|
|
16857
17086
|
// src/components/WalletButton/WalletButtonRenderer.tsx
|
|
16858
|
-
import
|
|
16859
|
-
useContext as
|
|
17087
|
+
import React154, {
|
|
17088
|
+
useContext as useContext30,
|
|
16860
17089
|
useEffect as useEffect38,
|
|
16861
17090
|
useMemo as useMemo37,
|
|
16862
|
-
useState as
|
|
17091
|
+
useState as useState49
|
|
16863
17092
|
} from "react";
|
|
16864
17093
|
import { useAccount as useAccount17, useAccountEffect as useAccountEffect4 } from "wagmi";
|
|
16865
17094
|
function WalletButtonRenderer({
|
|
@@ -16869,14 +17098,14 @@ function WalletButtonRenderer({
|
|
|
16869
17098
|
const isMounted = useIsMounted();
|
|
16870
17099
|
const { openConnectModal } = useConnectModal();
|
|
16871
17100
|
const { connectModalOpen } = useModalState();
|
|
16872
|
-
const { connector, setConnector } =
|
|
17101
|
+
const { connector, setConnector } = useContext30(WalletButtonContext);
|
|
16873
17102
|
const [firstConnector] = useWalletConnectors().filter((wallet2) => wallet2.isFunkitSdkConnector).filter((_wallet) => _wallet.id.toLowerCase() === wallet.toLowerCase()).sort((a, b) => a.groupIndex - b.groupIndex);
|
|
16874
17103
|
if (!firstConnector) {
|
|
16875
17104
|
throw new Error("Connector not found");
|
|
16876
17105
|
}
|
|
16877
17106
|
const connectionStatus = useConnectionStatus();
|
|
16878
|
-
const [loading, setLoading] =
|
|
16879
|
-
const [isError, setIsError] =
|
|
17107
|
+
const [loading, setLoading] = useState49(false);
|
|
17108
|
+
const [isError, setIsError] = useState49(false);
|
|
16880
17109
|
const mobile = isMobile();
|
|
16881
17110
|
useEffect38(() => {
|
|
16882
17111
|
if (!connectModalOpen && connector)
|
|
@@ -16915,7 +17144,7 @@ function WalletButtonRenderer({
|
|
|
16915
17144
|
const isStatusLoading = connectionStatus === "loading";
|
|
16916
17145
|
const ready = !isConnecting && !!openConnectModal && firstConnector && !isStatusLoading;
|
|
16917
17146
|
const isNotSupported = !(firstConnector == null ? void 0 : firstConnector.installed) || !(firstConnector == null ? void 0 : firstConnector.ready);
|
|
16918
|
-
return /* @__PURE__ */
|
|
17147
|
+
return /* @__PURE__ */ React154.createElement(React154.Fragment, null, children({
|
|
16919
17148
|
error: isError,
|
|
16920
17149
|
loading,
|
|
16921
17150
|
connected: isLastWalletIdConnected,
|
|
@@ -16936,15 +17165,15 @@ function WalletButtonRenderer({
|
|
|
16936
17165
|
|
|
16937
17166
|
// src/components/WalletButton/WalletButton.tsx
|
|
16938
17167
|
var WalletButton = ({ wallet }) => {
|
|
16939
|
-
const { i18n: i18n2 } =
|
|
16940
|
-
return /* @__PURE__ */
|
|
17168
|
+
const { i18n: i18n2 } = useContext31(I18nContext);
|
|
17169
|
+
return /* @__PURE__ */ React155.createElement(WalletButtonRenderer, {
|
|
16941
17170
|
wallet
|
|
16942
17171
|
}, ({ ready, connect, connected, mounted, connector, loading }) => {
|
|
16943
17172
|
const isDisabled = !ready || loading;
|
|
16944
17173
|
const connectorName = (connector == null ? void 0 : connector.name) || "";
|
|
16945
17174
|
if (!mounted)
|
|
16946
17175
|
return;
|
|
16947
|
-
return /* @__PURE__ */
|
|
17176
|
+
return /* @__PURE__ */ React155.createElement(Box, {
|
|
16948
17177
|
display: "flex",
|
|
16949
17178
|
flexDirection: "column",
|
|
16950
17179
|
alignItems: "center",
|
|
@@ -16952,7 +17181,7 @@ var WalletButton = ({ wallet }) => {
|
|
|
16952
17181
|
style: {
|
|
16953
17182
|
pointerEvents: isDisabled ? "none" : "all"
|
|
16954
17183
|
}
|
|
16955
|
-
}, /* @__PURE__ */
|
|
17184
|
+
}, /* @__PURE__ */ React155.createElement(Box, {
|
|
16956
17185
|
as: "button",
|
|
16957
17186
|
borderRadius: "menuButton",
|
|
16958
17187
|
borderStyle: "solid",
|
|
@@ -16974,7 +17203,7 @@ var WalletButton = ({ wallet }) => {
|
|
|
16974
17203
|
transition: "default",
|
|
16975
17204
|
width: "full",
|
|
16976
17205
|
background: "connectButtonBackground"
|
|
16977
|
-
}, /* @__PURE__ */
|
|
17206
|
+
}, /* @__PURE__ */ React155.createElement(Box, {
|
|
16978
17207
|
color: "modalText",
|
|
16979
17208
|
fontFamily: "body",
|
|
16980
17209
|
fontSize: "16",
|
|
@@ -16982,28 +17211,28 @@ var WalletButton = ({ wallet }) => {
|
|
|
16982
17211
|
transition: "default",
|
|
16983
17212
|
display: "flex",
|
|
16984
17213
|
alignItems: "center"
|
|
16985
|
-
}, /* @__PURE__ */
|
|
17214
|
+
}, /* @__PURE__ */ React155.createElement(Box, {
|
|
16986
17215
|
alignItems: "center",
|
|
16987
17216
|
display: "flex",
|
|
16988
17217
|
flexDirection: "row",
|
|
16989
17218
|
gap: "12",
|
|
16990
17219
|
paddingRight: "6"
|
|
16991
|
-
}, /* @__PURE__ */
|
|
17220
|
+
}, /* @__PURE__ */ React155.createElement(Box, null, loading ? /* @__PURE__ */ React155.createElement(SpinnerIcon, null) : /* @__PURE__ */ React155.createElement(AsyncImage, {
|
|
16992
17221
|
background: connector == null ? void 0 : connector.iconBackground,
|
|
16993
17222
|
borderRadius: "6",
|
|
16994
17223
|
height: "28",
|
|
16995
17224
|
src: connector == null ? void 0 : connector.iconUrl,
|
|
16996
17225
|
width: "28"
|
|
16997
|
-
})), /* @__PURE__ */
|
|
17226
|
+
})), /* @__PURE__ */ React155.createElement(Box, {
|
|
16998
17227
|
alignItems: "center",
|
|
16999
17228
|
display: "flex",
|
|
17000
17229
|
flexDirection: "column",
|
|
17001
17230
|
color: "modalText"
|
|
17002
|
-
}, /* @__PURE__ */
|
|
17231
|
+
}, /* @__PURE__ */ React155.createElement(Box, {
|
|
17003
17232
|
testId: `wallet-button-label-${(connector == null ? void 0 : connector.id) || ""}`
|
|
17004
17233
|
}, loading ? i18n2.t("connect.status.connecting", {
|
|
17005
17234
|
wallet: connectorName
|
|
17006
|
-
}) : connectorName)), connected ? /* @__PURE__ */
|
|
17235
|
+
}) : connectorName)), connected ? /* @__PURE__ */ React155.createElement(Box, {
|
|
17007
17236
|
background: "connectionIndicator",
|
|
17008
17237
|
borderColor: "selectedOptionBorder",
|
|
17009
17238
|
borderRadius: "full",
|
|
@@ -17041,12 +17270,12 @@ function getDefaultWallets(parameters) {
|
|
|
17041
17270
|
}
|
|
17042
17271
|
|
|
17043
17272
|
// src/components/ConnectOptions/MobileOptions.tsx
|
|
17044
|
-
import
|
|
17045
|
-
useCallback as
|
|
17046
|
-
useContext as
|
|
17273
|
+
import React156, {
|
|
17274
|
+
useCallback as useCallback34,
|
|
17275
|
+
useContext as useContext32,
|
|
17047
17276
|
useEffect as useEffect39,
|
|
17048
17277
|
useRef as useRef12,
|
|
17049
|
-
useState as
|
|
17278
|
+
useState as useState50
|
|
17050
17279
|
} from "react";
|
|
17051
17280
|
|
|
17052
17281
|
// src/components/ConnectOptions/MobileOptions.css.ts
|
|
@@ -17060,12 +17289,12 @@ var LoadingSpinner = ({ wallet }) => {
|
|
|
17060
17289
|
const height = 80;
|
|
17061
17290
|
const radiusFactor = 20;
|
|
17062
17291
|
const perimeter = 2 * (width + height - 4 * radiusFactor);
|
|
17063
|
-
return /* @__PURE__ */
|
|
17292
|
+
return /* @__PURE__ */ React156.createElement("svg", {
|
|
17064
17293
|
className: spinner,
|
|
17065
17294
|
viewBox: "0 0 86 86",
|
|
17066
17295
|
width: "86",
|
|
17067
17296
|
height: "86"
|
|
17068
|
-
}, /* @__PURE__ */
|
|
17297
|
+
}, /* @__PURE__ */ React156.createElement("title", null, "Loading"), /* @__PURE__ */ React156.createElement("rect", {
|
|
17069
17298
|
x: "3",
|
|
17070
17299
|
y: "3",
|
|
17071
17300
|
width,
|
|
@@ -17098,8 +17327,8 @@ function WalletButton2({
|
|
|
17098
17327
|
} = wallet;
|
|
17099
17328
|
const coolModeRef = useCoolMode(iconUrl);
|
|
17100
17329
|
const initialized = useRef12(false);
|
|
17101
|
-
const { i18n: i18n2 } =
|
|
17102
|
-
const onConnect =
|
|
17330
|
+
const { i18n: i18n2 } = useContext32(I18nContext);
|
|
17331
|
+
const onConnect = useCallback34(async () => {
|
|
17103
17332
|
const onMobileUri = async () => {
|
|
17104
17333
|
const mobileUri = await (getMobileUri == null ? void 0 : getMobileUri());
|
|
17105
17334
|
if (!mobileUri)
|
|
@@ -17132,7 +17361,7 @@ function WalletButton2({
|
|
|
17132
17361
|
initialized.current = true;
|
|
17133
17362
|
}
|
|
17134
17363
|
}, [connecting, onConnect]);
|
|
17135
|
-
return /* @__PURE__ */
|
|
17364
|
+
return /* @__PURE__ */ React156.createElement(Box, {
|
|
17136
17365
|
as: "button",
|
|
17137
17366
|
color: ready ? "modalText" : "modalTextSecondary",
|
|
17138
17367
|
disabled: !ready,
|
|
@@ -17144,40 +17373,40 @@ function WalletButton2({
|
|
|
17144
17373
|
testId: `wallet-option-${id}`,
|
|
17145
17374
|
type: "button",
|
|
17146
17375
|
width: "full"
|
|
17147
|
-
}, /* @__PURE__ */
|
|
17376
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17148
17377
|
alignItems: "center",
|
|
17149
17378
|
display: "flex",
|
|
17150
17379
|
flexDirection: "column",
|
|
17151
17380
|
justifyContent: "center"
|
|
17152
|
-
}, /* @__PURE__ */
|
|
17381
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17153
17382
|
display: "flex",
|
|
17154
17383
|
alignItems: "center",
|
|
17155
17384
|
justifyContent: "center",
|
|
17156
17385
|
paddingBottom: "8",
|
|
17157
17386
|
paddingTop: "10",
|
|
17158
17387
|
position: "relative"
|
|
17159
|
-
}, connecting ? /* @__PURE__ */
|
|
17388
|
+
}, connecting ? /* @__PURE__ */ React156.createElement(LoadingSpinner, {
|
|
17160
17389
|
wallet
|
|
17161
|
-
}) : null, /* @__PURE__ */
|
|
17390
|
+
}) : null, /* @__PURE__ */ React156.createElement(AsyncImage, {
|
|
17162
17391
|
background: iconBackground,
|
|
17163
17392
|
borderRadius: "13",
|
|
17164
17393
|
boxShadow: "walletLogo",
|
|
17165
17394
|
height: "60",
|
|
17166
17395
|
src: iconUrl,
|
|
17167
17396
|
width: "60"
|
|
17168
|
-
})), !connecting ? /* @__PURE__ */
|
|
17397
|
+
})), !connecting ? /* @__PURE__ */ React156.createElement(Box, {
|
|
17169
17398
|
display: "flex",
|
|
17170
17399
|
flexDirection: "column",
|
|
17171
17400
|
textAlign: "center"
|
|
17172
|
-
}, /* @__PURE__ */
|
|
17401
|
+
}, /* @__PURE__ */ React156.createElement(Text, {
|
|
17173
17402
|
as: "h2",
|
|
17174
17403
|
color: wallet.ready ? "modalText" : "modalTextSecondary",
|
|
17175
17404
|
size: "13",
|
|
17176
17405
|
weight: "medium"
|
|
17177
|
-
}, /* @__PURE__ */
|
|
17406
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17178
17407
|
as: "span",
|
|
17179
17408
|
position: "relative"
|
|
17180
|
-
}, shortName != null ? shortName : name, !wallet.ready && " (unsupported)")), wallet.recent && /* @__PURE__ */
|
|
17409
|
+
}, shortName != null ? shortName : name, !wallet.ready && " (unsupported)")), wallet.recent && /* @__PURE__ */ React156.createElement(Text, {
|
|
17181
17410
|
color: "accentColor",
|
|
17182
17411
|
size: "12",
|
|
17183
17412
|
weight: "medium"
|
|
@@ -17189,85 +17418,85 @@ function MobileOptions({ onClose }) {
|
|
|
17189
17418
|
const wallets = useWalletConnectors().filter(
|
|
17190
17419
|
(wallet) => wallet.isFunkitSdkConnector
|
|
17191
17420
|
);
|
|
17192
|
-
const { disclaimer: Disclaimer, learnMoreUrl } =
|
|
17421
|
+
const { disclaimer: Disclaimer, learnMoreUrl } = useContext32(AppContext);
|
|
17193
17422
|
let headerLabel = null;
|
|
17194
17423
|
let walletContent = null;
|
|
17195
17424
|
let headerBackgroundContrast = false;
|
|
17196
17425
|
let headerBackButtonLink = null;
|
|
17197
|
-
const [walletStep, setWalletStep] =
|
|
17426
|
+
const [walletStep, setWalletStep] = useState50(
|
|
17198
17427
|
"CONNECT" /* Connect */
|
|
17199
17428
|
);
|
|
17200
|
-
const { i18n: i18n2 } =
|
|
17429
|
+
const { i18n: i18n2 } = useContext32(I18nContext);
|
|
17201
17430
|
const ios = isIOS();
|
|
17202
17431
|
switch (walletStep) {
|
|
17203
17432
|
case "CONNECT" /* Connect */: {
|
|
17204
17433
|
headerLabel = i18n2.t("connect.title");
|
|
17205
17434
|
headerBackgroundContrast = true;
|
|
17206
|
-
walletContent = /* @__PURE__ */
|
|
17435
|
+
walletContent = /* @__PURE__ */ React156.createElement(Box, null, /* @__PURE__ */ React156.createElement(Box, {
|
|
17207
17436
|
background: "profileForeground",
|
|
17208
17437
|
className: scroll,
|
|
17209
17438
|
display: "flex",
|
|
17210
17439
|
paddingBottom: "20",
|
|
17211
17440
|
paddingTop: "6"
|
|
17212
|
-
}, /* @__PURE__ */
|
|
17441
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17213
17442
|
display: "flex",
|
|
17214
17443
|
style: { margin: "0 auto" }
|
|
17215
17444
|
}, wallets.filter((wallet) => wallet.ready).map((wallet) => {
|
|
17216
|
-
return /* @__PURE__ */
|
|
17445
|
+
return /* @__PURE__ */ React156.createElement(Box, {
|
|
17217
17446
|
key: wallet.id,
|
|
17218
17447
|
paddingX: "20"
|
|
17219
|
-
}, /* @__PURE__ */
|
|
17448
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17220
17449
|
width: "60"
|
|
17221
|
-
}, /* @__PURE__ */
|
|
17450
|
+
}, /* @__PURE__ */ React156.createElement(WalletButton2, {
|
|
17222
17451
|
onClose,
|
|
17223
17452
|
wallet
|
|
17224
17453
|
})));
|
|
17225
|
-
}))), /* @__PURE__ */
|
|
17454
|
+
}))), /* @__PURE__ */ React156.createElement(Box, {
|
|
17226
17455
|
background: "generalBorder",
|
|
17227
17456
|
height: "1",
|
|
17228
17457
|
marginBottom: "32",
|
|
17229
17458
|
marginTop: "-1"
|
|
17230
|
-
}), /* @__PURE__ */
|
|
17459
|
+
}), /* @__PURE__ */ React156.createElement(Box, {
|
|
17231
17460
|
alignItems: "center",
|
|
17232
17461
|
display: "flex",
|
|
17233
17462
|
flexDirection: "column",
|
|
17234
17463
|
gap: "32",
|
|
17235
17464
|
paddingX: "32",
|
|
17236
17465
|
style: { textAlign: "center" }
|
|
17237
|
-
}, /* @__PURE__ */
|
|
17466
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17238
17467
|
display: "flex",
|
|
17239
17468
|
flexDirection: "column",
|
|
17240
17469
|
gap: "8",
|
|
17241
17470
|
textAlign: "center"
|
|
17242
|
-
}, /* @__PURE__ */
|
|
17471
|
+
}, /* @__PURE__ */ React156.createElement(Text, {
|
|
17243
17472
|
color: "modalText",
|
|
17244
17473
|
size: "16",
|
|
17245
17474
|
weight: "bold"
|
|
17246
|
-
}, i18n2.t("intro.title")), /* @__PURE__ */
|
|
17475
|
+
}, i18n2.t("intro.title")), /* @__PURE__ */ React156.createElement(Text, {
|
|
17247
17476
|
color: "modalTextSecondary",
|
|
17248
17477
|
size: "16"
|
|
17249
|
-
}, i18n2.t("intro.description")))), /* @__PURE__ */
|
|
17478
|
+
}, i18n2.t("intro.description")))), /* @__PURE__ */ React156.createElement(Box, {
|
|
17250
17479
|
paddingTop: "32",
|
|
17251
17480
|
paddingX: "20"
|
|
17252
|
-
}, /* @__PURE__ */
|
|
17481
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17253
17482
|
display: "flex",
|
|
17254
17483
|
gap: "14",
|
|
17255
17484
|
justifyContent: "center"
|
|
17256
|
-
}, /* @__PURE__ */
|
|
17485
|
+
}, /* @__PURE__ */ React156.createElement(ActionButton, {
|
|
17257
17486
|
label: i18n2.t("intro.get.label"),
|
|
17258
17487
|
onClick: () => setWalletStep("GET" /* Get */),
|
|
17259
17488
|
size: "large",
|
|
17260
17489
|
type: "secondary"
|
|
17261
|
-
}), /* @__PURE__ */
|
|
17490
|
+
}), /* @__PURE__ */ React156.createElement(ActionButton, {
|
|
17262
17491
|
href: learnMoreUrl,
|
|
17263
17492
|
label: i18n2.t("intro.learn_more.label"),
|
|
17264
17493
|
size: "large",
|
|
17265
17494
|
type: "secondary"
|
|
17266
|
-
}))), Disclaimer && /* @__PURE__ */
|
|
17495
|
+
}))), Disclaimer && /* @__PURE__ */ React156.createElement(Box, {
|
|
17267
17496
|
marginTop: "28",
|
|
17268
17497
|
marginX: "32",
|
|
17269
17498
|
textAlign: "center"
|
|
17270
|
-
}, /* @__PURE__ */
|
|
17499
|
+
}, /* @__PURE__ */ React156.createElement(Disclaimer, {
|
|
17271
17500
|
Link: DisclaimerLink,
|
|
17272
17501
|
Text: DisclaimerText
|
|
17273
17502
|
})));
|
|
@@ -17282,7 +17511,7 @@ function MobileOptions({ onClose }) {
|
|
|
17282
17511
|
return ((_a2 = wallet.downloadUrls) == null ? void 0 : _a2.ios) || ((_b = wallet.downloadUrls) == null ? void 0 : _b.android) || ((_c = wallet.downloadUrls) == null ? void 0 : _c.mobile);
|
|
17283
17512
|
}
|
|
17284
17513
|
)) == null ? void 0 : _a.splice(0, 3);
|
|
17285
|
-
walletContent = /* @__PURE__ */
|
|
17514
|
+
walletContent = /* @__PURE__ */ React156.createElement(Box, null, /* @__PURE__ */ React156.createElement(Box, {
|
|
17286
17515
|
alignItems: "center",
|
|
17287
17516
|
display: "flex",
|
|
17288
17517
|
flexDirection: "column",
|
|
@@ -17296,88 +17525,88 @@ function MobileOptions({ onClose }) {
|
|
|
17296
17525
|
if (!(downloadUrls == null ? void 0 : downloadUrls.ios) && !(downloadUrls == null ? void 0 : downloadUrls.android) && !(downloadUrls == null ? void 0 : downloadUrls.mobile)) {
|
|
17297
17526
|
return null;
|
|
17298
17527
|
}
|
|
17299
|
-
return /* @__PURE__ */
|
|
17528
|
+
return /* @__PURE__ */ React156.createElement(Box, {
|
|
17300
17529
|
display: "flex",
|
|
17301
17530
|
gap: "16",
|
|
17302
17531
|
key: wallet.id,
|
|
17303
17532
|
paddingX: "20",
|
|
17304
17533
|
width: "full"
|
|
17305
|
-
}, /* @__PURE__ */
|
|
17534
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17306
17535
|
style: { minHeight: 48, minWidth: 48 }
|
|
17307
|
-
}, /* @__PURE__ */
|
|
17536
|
+
}, /* @__PURE__ */ React156.createElement(AsyncImage, {
|
|
17308
17537
|
background: iconBackground,
|
|
17309
17538
|
borderColor: "generalBorder",
|
|
17310
17539
|
borderRadius: "10",
|
|
17311
17540
|
height: "48",
|
|
17312
17541
|
src: iconUrl,
|
|
17313
17542
|
width: "48"
|
|
17314
|
-
})), /* @__PURE__ */
|
|
17543
|
+
})), /* @__PURE__ */ React156.createElement(Box, {
|
|
17315
17544
|
display: "flex",
|
|
17316
17545
|
flexDirection: "column",
|
|
17317
17546
|
width: "full"
|
|
17318
|
-
}, /* @__PURE__ */
|
|
17547
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17319
17548
|
alignItems: "center",
|
|
17320
17549
|
display: "flex",
|
|
17321
17550
|
height: "48"
|
|
17322
|
-
}, /* @__PURE__ */
|
|
17551
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17323
17552
|
width: "full"
|
|
17324
|
-
}, /* @__PURE__ */
|
|
17553
|
+
}, /* @__PURE__ */ React156.createElement(Text, {
|
|
17325
17554
|
color: "modalText",
|
|
17326
17555
|
size: "18",
|
|
17327
17556
|
weight: "bold"
|
|
17328
|
-
}, name)), /* @__PURE__ */
|
|
17557
|
+
}, name)), /* @__PURE__ */ React156.createElement(ActionButton, {
|
|
17329
17558
|
href: (ios ? downloadUrls == null ? void 0 : downloadUrls.ios : downloadUrls == null ? void 0 : downloadUrls.android) || (downloadUrls == null ? void 0 : downloadUrls.mobile),
|
|
17330
17559
|
label: i18n2.t("get.action.label"),
|
|
17331
17560
|
size: "small",
|
|
17332
17561
|
type: "secondary"
|
|
17333
|
-
})), index < mobileWallets.length - 1 && /* @__PURE__ */
|
|
17562
|
+
})), index < mobileWallets.length - 1 && /* @__PURE__ */ React156.createElement(Box, {
|
|
17334
17563
|
background: "generalBorderDim",
|
|
17335
17564
|
height: "1",
|
|
17336
17565
|
marginY: "10",
|
|
17337
17566
|
width: "full"
|
|
17338
17567
|
})));
|
|
17339
|
-
})), /* @__PURE__ */
|
|
17568
|
+
})), /* @__PURE__ */ React156.createElement(Box, {
|
|
17340
17569
|
style: { marginBottom: "42px" }
|
|
17341
|
-
}), /* @__PURE__ */
|
|
17570
|
+
}), /* @__PURE__ */ React156.createElement(Box, {
|
|
17342
17571
|
alignItems: "center",
|
|
17343
17572
|
display: "flex",
|
|
17344
17573
|
flexDirection: "column",
|
|
17345
17574
|
gap: "36",
|
|
17346
17575
|
paddingX: "36",
|
|
17347
17576
|
style: { textAlign: "center" }
|
|
17348
|
-
}, /* @__PURE__ */
|
|
17577
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17349
17578
|
display: "flex",
|
|
17350
17579
|
flexDirection: "column",
|
|
17351
17580
|
gap: "12",
|
|
17352
17581
|
textAlign: "center"
|
|
17353
|
-
}, /* @__PURE__ */
|
|
17582
|
+
}, /* @__PURE__ */ React156.createElement(Text, {
|
|
17354
17583
|
color: "modalText",
|
|
17355
17584
|
size: "16",
|
|
17356
17585
|
weight: "bold"
|
|
17357
|
-
}, i18n2.t("get.looking_for.title")), /* @__PURE__ */
|
|
17586
|
+
}, i18n2.t("get.looking_for.title")), /* @__PURE__ */ React156.createElement(Text, {
|
|
17358
17587
|
color: "modalTextSecondary",
|
|
17359
17588
|
size: "16"
|
|
17360
17589
|
}, i18n2.t("get.looking_for.mobile.description")))));
|
|
17361
17590
|
break;
|
|
17362
17591
|
}
|
|
17363
17592
|
}
|
|
17364
|
-
return /* @__PURE__ */
|
|
17593
|
+
return /* @__PURE__ */ React156.createElement(Box, {
|
|
17365
17594
|
display: "flex",
|
|
17366
17595
|
flexDirection: "column",
|
|
17367
17596
|
paddingBottom: "36"
|
|
17368
|
-
}, /* @__PURE__ */
|
|
17597
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17369
17598
|
background: headerBackgroundContrast ? "profileForeground" : "modalBackground",
|
|
17370
17599
|
display: "flex",
|
|
17371
17600
|
flexDirection: "column",
|
|
17372
17601
|
paddingBottom: "4",
|
|
17373
17602
|
paddingTop: "14"
|
|
17374
|
-
}, /* @__PURE__ */
|
|
17603
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17375
17604
|
display: "flex",
|
|
17376
17605
|
justifyContent: "center",
|
|
17377
17606
|
paddingBottom: "6",
|
|
17378
17607
|
paddingX: "20",
|
|
17379
17608
|
position: "relative"
|
|
17380
|
-
}, headerBackButtonLink && /* @__PURE__ */
|
|
17609
|
+
}, headerBackButtonLink && /* @__PURE__ */ React156.createElement(Box, {
|
|
17381
17610
|
display: "flex",
|
|
17382
17611
|
position: "absolute",
|
|
17383
17612
|
style: {
|
|
@@ -17385,7 +17614,7 @@ function MobileOptions({ onClose }) {
|
|
|
17385
17614
|
marginBottom: -20,
|
|
17386
17615
|
marginTop: -20
|
|
17387
17616
|
}
|
|
17388
|
-
}, /* @__PURE__ */
|
|
17617
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17389
17618
|
alignItems: "center",
|
|
17390
17619
|
as: "button",
|
|
17391
17620
|
className: touchableStyles({
|
|
@@ -17401,28 +17630,28 @@ function MobileOptions({ onClose }) {
|
|
|
17401
17630
|
style: { height: 17, willChange: "transform" },
|
|
17402
17631
|
transition: "default",
|
|
17403
17632
|
type: "button"
|
|
17404
|
-
}, /* @__PURE__ */
|
|
17633
|
+
}, /* @__PURE__ */ React156.createElement(BackIcon, null))), /* @__PURE__ */ React156.createElement(Box, {
|
|
17405
17634
|
marginTop: "4",
|
|
17406
17635
|
textAlign: "center",
|
|
17407
17636
|
width: "full"
|
|
17408
|
-
}, /* @__PURE__ */
|
|
17637
|
+
}, /* @__PURE__ */ React156.createElement(Text, {
|
|
17409
17638
|
as: "h1",
|
|
17410
17639
|
color: "modalText",
|
|
17411
17640
|
id: titleId,
|
|
17412
17641
|
size: "20",
|
|
17413
17642
|
weight: "bold"
|
|
17414
|
-
}, headerLabel)), /* @__PURE__ */
|
|
17643
|
+
}, headerLabel)), /* @__PURE__ */ React156.createElement(Box, {
|
|
17415
17644
|
alignItems: "center",
|
|
17416
17645
|
display: "flex",
|
|
17417
17646
|
height: "32",
|
|
17418
17647
|
paddingRight: "14",
|
|
17419
17648
|
position: "absolute",
|
|
17420
17649
|
right: "0"
|
|
17421
|
-
}, /* @__PURE__ */
|
|
17650
|
+
}, /* @__PURE__ */ React156.createElement(Box, {
|
|
17422
17651
|
style: { marginBottom: -20, marginTop: -20 }
|
|
17423
|
-
}, /* @__PURE__ */
|
|
17652
|
+
}, /* @__PURE__ */ React156.createElement(CloseButton, {
|
|
17424
17653
|
onClose
|
|
17425
|
-
}))))), /* @__PURE__ */
|
|
17654
|
+
}))))), /* @__PURE__ */ React156.createElement(Box, {
|
|
17426
17655
|
display: "flex",
|
|
17427
17656
|
flexDirection: "column"
|
|
17428
17657
|
}, walletContent));
|
|
@@ -17437,13 +17666,13 @@ var __private__ = {
|
|
|
17437
17666
|
};
|
|
17438
17667
|
|
|
17439
17668
|
// src/transactions/useAddRecentTransaction.ts
|
|
17440
|
-
import { useCallback as
|
|
17669
|
+
import { useCallback as useCallback35 } from "react";
|
|
17441
17670
|
import { useAccount as useAccount18 } from "wagmi";
|
|
17442
17671
|
function useAddRecentTransaction() {
|
|
17443
17672
|
const store = useTransactionStore();
|
|
17444
17673
|
const { address } = useAccount18();
|
|
17445
17674
|
const chainId = useChainId();
|
|
17446
|
-
return
|
|
17675
|
+
return useCallback35(
|
|
17447
17676
|
(transaction) => {
|
|
17448
17677
|
if (!address || !chainId) {
|
|
17449
17678
|
throw new Error("No address or chain ID found");
|