@funkit/connect 9.24.0-next.0 → 9.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -4
- package/dist/clients/aave.d.ts +9 -0
- package/dist/clients/aave.js +4 -1
- package/dist/clients/{chunk-4HCOSF4M.js → chunk-7G3QEQFB.js} +2 -2
- package/dist/clients/{chunk-7FIVHWNC.js → chunk-7UIDHSYG.js} +47 -0
- package/dist/clients/{chunk-UUHGOBKZ.js → chunk-AHYOV7AV.js} +2 -1
- package/dist/clients/{chunk-S7FRYR55.js → chunk-ME4OAQIY.js} +1 -1
- package/dist/clients/{chunk-CEBG7XQ5.js → chunk-MXPZTW2H.js} +212 -1126
- package/dist/clients/chunk-SQ2RX7WY.js +1110 -0
- package/dist/clients/{chunk-KWIR3HO4.js → chunk-VJZW3MA3.js} +1 -1
- package/dist/clients/{chunk-MRBN4XCA.js → chunk-ZEXZQOAO.js} +1 -1
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +4 -6
- package/dist/clients/lighter.css +2816 -1
- package/dist/clients/lighter.js +44 -28
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +217 -222
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +7 -8
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
- package/dist/clients/polymarket/index.css +217 -222
- package/dist/clients/polymarket/index.js +7 -8
- package/dist/clients/polymarket/polymarket.js +2 -2
- package/dist/clients/polymarket/usePolymarketAccountBalances.js +2 -2
- package/dist/clients/rolly.js +1 -1
- package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +1 -2
- package/dist/components/FunTooltip/FunTooltip.d.ts +10 -5
- package/dist/components/FunTransactionSummary/DestinationHealthFactorRow.d.ts +15 -0
- package/dist/components/FunTransactionSummary/DestinationYieldRows.d.ts +1 -0
- package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +2 -1
- package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +8 -1
- package/dist/domains/aave.d.ts +14 -9
- package/dist/domains/nado.d.ts +9 -0
- package/dist/hooks/track/CheckoutModalEvent.d.ts +0 -1
- package/dist/hooks/track/WithdrawModalEvent.d.ts +9 -1
- package/dist/hooks/useGetAssetHoldingsFromRpc.d.ts +23 -0
- package/dist/hooks/useInjectedAssetHoldings.d.ts +23 -0
- package/dist/hooks/useXstockAssetHoldings.d.ts +15 -0
- package/dist/hooks/useXstocksWrappedTokenAddress.d.ts +16 -0
- package/dist/index.css +11 -16
- package/dist/index.js +4696 -4117
- package/dist/modals/CheckoutModal/CheckoutComplete/CheckoutComplete.d.ts +1 -1
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +0 -1
- package/dist/modals/CheckoutModal/InputAmount/useNadoDirectTransfer.d.ts +64 -0
- package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +1 -1
- package/dist/modals/CheckoutModal/stepTransition.d.ts +0 -3
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +25 -4
- package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +10 -1
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +8 -1
- package/dist/modals/WithdrawalModal/WithdrawalSwappedIframeController.d.ts +11 -0
- package/dist/modals/WithdrawalModal/types.d.ts +1 -0
- package/dist/providers/FunkitCheckoutContext/types.d.ts +29 -12
- package/dist/utils/assets.d.ts +7 -0
- package/dist/utils/checkoutHistory.d.ts +1 -5
- package/dist/utils/customer.d.ts +6 -0
- package/dist/wallets/walletConnectors/index.js +50 -50
- package/package.json +6 -6
- package/dist/__generated__/default_configs.d.ts +0 -901
- package/dist/__generated__/default_feature_gates.d.ts +0 -20
- package/dist/clients/chunk-25ICASD7.js +0 -2371
- package/dist/clients/chunk-3GO74QTP.js +0 -2382
- package/dist/clients/chunk-7GWX2ZS4.js +0 -69
- package/dist/clients/chunk-7HNGV6JU.js +0 -54
- package/dist/clients/chunk-A32VN2DX.js +0 -2382
- package/dist/clients/chunk-ELLXM7RO.js +0 -186
- package/dist/clients/chunk-GGXTLJ7J.js +0 -290
- package/dist/clients/chunk-GUWXVR5S.js +0 -186
- package/dist/clients/chunk-HRWCNZJA.js +0 -230
- package/dist/clients/chunk-JBWB54MX.js +0 -69
- package/dist/clients/chunk-JD3FIVZ7.js +0 -69
- package/dist/clients/chunk-JTGKAPID.js +0 -2382
- package/dist/clients/chunk-L7PABCF2.js +0 -54
- package/dist/clients/chunk-LII3SVUH.js +0 -230
- package/dist/clients/chunk-NCUPPJ2Z.js +0 -2382
- package/dist/clients/chunk-NPPIETHZ.js +0 -54
- package/dist/clients/chunk-NUJ6ZM5F.js +0 -186
- package/dist/clients/chunk-UVWNEQMD.js +0 -186
- package/dist/clients/chunk-VVTNR7YH.js +0 -2382
- package/dist/clients/chunk-YYMIRDCQ.js +0 -230
- package/dist/clients/chunk-ZNVFASTH.js +0 -54
- package/dist/clients/nado.d.ts +0 -78
- package/dist/clients/nado.js +0 -107
- package/dist/clients/polymarket.d.ts +0 -161
- package/dist/clients/polymarket.js +0 -688
- package/dist/components/FunCheckoutHistory/FunCheckoutHistoryHelp.d.ts +0 -10
- package/dist/interfaces/logTransport.d.ts +0 -51
- package/dist/interfaces/swapped-transport.d.ts +0 -78
- package/dist/modals/CheckoutModal/CheckoutHelp/CheckoutHelp.d.ts +0 -9
- package/dist/modals/CheckoutModal/SourceChange/EmptyFormOfPaymentsMessage.d.ts +0 -4
- package/dist/modals/CheckoutModal/SourceChange/useUpdateSourceAssetForCard.d.ts +0 -4
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedErrorMessage.d.ts +0 -6
- package/dist/utils/flags/resolver.d.ts +0 -34
- package/dist/wallets/walletConnectors/chunk-4NV5BYRP.js +0 -95
- package/dist/wallets/walletConnectors/chunk-AVDUNQUW.js +0 -96
- package/dist/wallets/walletConnectors/chunk-GUQM4QSL.js +0 -66
- package/dist/wallets/walletConnectors/chunk-IULPZP2Q.js +0 -69
- package/dist/wallets/walletConnectors/chunk-JPN6TWIT.js +0 -92
- package/dist/wallets/walletConnectors/chunk-KCRO2AGO.js +0 -106
- package/dist/wallets/walletConnectors/chunk-KI5Y2BBF.js +0 -94
- package/dist/wallets/walletConnectors/chunk-NR2OGDHQ.js +0 -103
- package/dist/wallets/walletConnectors/chunk-OEEGYENV.js +0 -87
- package/dist/wallets/walletConnectors/chunk-OX37G4YT.js +0 -98
- package/dist/wallets/walletConnectors/chunk-SWFF3TWJ.js +0 -100
- package/dist/wallets/walletConnectors/chunk-TKB2OY6G.js +0 -99
- package/dist/wallets/walletConnectors/chunk-W2LCLDPX.js +0 -70
- package/dist/wallets/walletConnectors/chunk-WAHGI5L7.js +0 -96
- package/dist/wallets/walletConnectors/chunk-WKNQMP4A.js +0 -93
- package/dist/wallets/walletConnectors/chunk-XCNHV3HS.js +0 -110
- package/dist/wallets/walletConnectors/chunk-YO2K4MBH.js +0 -218
- package/dist/wallets/walletConnectors/chunk-YQFGVZGR.js +0 -92
package/dist/clients/lighter.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
AsyncImage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7G3QEQFB.js";
|
|
5
5
|
import {
|
|
6
6
|
useFunkitConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MXPZTW2H.js";
|
|
8
8
|
import {
|
|
9
9
|
Box,
|
|
10
10
|
useFunkitTranslation
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7UIDHSYG.js";
|
|
12
12
|
import {
|
|
13
13
|
logger
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AHYOV7AV.js";
|
|
15
15
|
|
|
16
16
|
// src/clients/lighter.tsx
|
|
17
17
|
import {
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
createDirectExecution
|
|
21
21
|
} from "@funkit/api-base";
|
|
22
22
|
import { LIGHTER_CHAIN_ID, SOLANA_MAINNET_CHAIN_ID } from "@funkit/chains";
|
|
23
|
-
import { RELAY_LIGHTER_CHAIN_ID } from "@funkit/fun-relay";
|
|
23
|
+
import { RELAY_LIGHTER_CHAIN_ID as RELAY_LIGHTER_CHAIN_ID2 } from "@funkit/fun-relay";
|
|
24
24
|
import { retry } from "@lifeomic/attempt";
|
|
25
25
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
26
26
|
import i18next from "i18next";
|
|
27
|
-
import
|
|
27
|
+
import React3, { useMemo as useMemo2 } from "react";
|
|
28
28
|
import { v4 as uuid } from "uuid";
|
|
29
29
|
import { pad, parseUnits, toHex } from "viem";
|
|
30
|
-
import { arbitrum, base, bsc, mainnet as
|
|
30
|
+
import { arbitrum, base, bsc, mainnet as mainnet3, optimism } from "viem/chains";
|
|
31
31
|
|
|
32
32
|
// src/components/Icons/EvmWallet.tsx
|
|
33
33
|
import React from "react";
|
|
@@ -52,11 +52,18 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React.createElement(
|
|
|
52
52
|
)
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
// src/
|
|
56
|
-
import {
|
|
55
|
+
// src/modals/WithdrawalModal/LighterWithdrawal.tsx
|
|
56
|
+
import { RELAY_LIGHTER_CHAIN_ID } from "@funkit/fun-relay";
|
|
57
|
+
import { formatAddress, formatCryptoAndStringify } from "@funkit/utils";
|
|
58
|
+
import * as dnum from "dnum";
|
|
59
|
+
import React2, { useEffect, useMemo } from "react";
|
|
60
|
+
import { createPortal } from "react-dom";
|
|
61
|
+
import { Trans } from "react-i18next";
|
|
62
|
+
import { mainnet as mainnet2 } from "viem/chains";
|
|
57
63
|
|
|
58
64
|
// src/utils/customer.ts
|
|
59
|
-
import { useQuery } from "@tanstack/react-query";
|
|
65
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
66
|
+
import { useCallback } from "react";
|
|
60
67
|
|
|
61
68
|
// src/consts/customers.ts
|
|
62
69
|
import {
|
|
@@ -121,6 +128,9 @@ function useLighterAccounts({
|
|
|
121
128
|
};
|
|
122
129
|
}
|
|
123
130
|
|
|
131
|
+
// src/providers/provideFunkitConnectChains.ts
|
|
132
|
+
import { chainMetadataById } from "@funkit/chains";
|
|
133
|
+
|
|
124
134
|
// src/utils/timeFormat.ts
|
|
125
135
|
import { formatSecondsToReadableForm } from "@funkit/utils";
|
|
126
136
|
function formatSecondsTranslated(seconds, t, specifyUnderMinute = false, omitSeconds = false) {
|
|
@@ -133,6 +143,11 @@ function formatSecondsTranslated(seconds, t, specifyUnderMinute = false, omitSec
|
|
|
133
143
|
});
|
|
134
144
|
}
|
|
135
145
|
|
|
146
|
+
// src/modals/WithdrawalModal/LighterWithdrawal.tsx
|
|
147
|
+
var LIGHTER_FAST_METHOD_ID = "lighter-fast";
|
|
148
|
+
var LIGHTER_SECURE_METHOD_ID = "lighter-secure";
|
|
149
|
+
var LIGHTER_FAST_MAX_WITHDRAWAL_USD = 3e6;
|
|
150
|
+
|
|
136
151
|
// src/clients/lighter.tsx
|
|
137
152
|
var LIGHTER_USDC_PERPS_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
138
153
|
var MAINNET_USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
@@ -278,7 +293,7 @@ function createLighterAdaptedWallet({
|
|
|
278
293
|
}
|
|
279
294
|
return {
|
|
280
295
|
vmType: "lvm",
|
|
281
|
-
getChainId: async () => Number(
|
|
296
|
+
getChainId: async () => Number(RELAY_LIGHTER_CHAIN_ID2),
|
|
282
297
|
address: async () => accountIndex.toString(),
|
|
283
298
|
handleSignMessageStep: async () => {
|
|
284
299
|
throw new Error("Message signing not implemented for Lighter");
|
|
@@ -356,7 +371,7 @@ async function trackLighterSecureWithdrawal({
|
|
|
356
371
|
recipientAddr,
|
|
357
372
|
fromChainId: LIGHTER_CHAIN_ID.toString(),
|
|
358
373
|
fromTokenAddress,
|
|
359
|
-
toChainId:
|
|
374
|
+
toChainId: mainnet3.id.toString(),
|
|
360
375
|
toTokenAddress: mainnetTokenAddress,
|
|
361
376
|
fromAmountBaseUnit: baseUnitAmount,
|
|
362
377
|
toAmountBaseUnit: baseUnitAmount,
|
|
@@ -373,7 +388,7 @@ async function trackLighterSecureWithdrawal({
|
|
|
373
388
|
initSettings: {
|
|
374
389
|
config: {
|
|
375
390
|
targetAsset: mainnetTokenAddress,
|
|
376
|
-
targetChain:
|
|
391
|
+
targetChain: mainnet3.id.toString(),
|
|
377
392
|
targetAssetTicker: symbol
|
|
378
393
|
}
|
|
379
394
|
},
|
|
@@ -461,7 +476,7 @@ function createLighterSecureWithdrawalConfig(config) {
|
|
|
461
476
|
withdrawCallback: buildSecureWithdrawalCallback({
|
|
462
477
|
exec: config.sendLighterSecureWithdrawal
|
|
463
478
|
}),
|
|
464
|
-
sourceChainId:
|
|
479
|
+
sourceChainId: mainnet3.id.toString(),
|
|
465
480
|
sourceTokenSymbol: "USDC",
|
|
466
481
|
defaultReceiveToken: "USDC",
|
|
467
482
|
sourceTokenAddress: MAINNET_USDC,
|
|
@@ -486,7 +501,7 @@ function buildLighterFastWalletWithdrawalConfig({
|
|
|
486
501
|
_type: "lighter",
|
|
487
502
|
adaptedWallet,
|
|
488
503
|
address: () => String(accountIndex),
|
|
489
|
-
getChainId: async () => Number(
|
|
504
|
+
getChainId: async () => Number(RELAY_LIGHTER_CHAIN_ID2),
|
|
490
505
|
// biome-ignore lint/suspicious/noEmptyBlockStatements: no-op — Lighter has no EVM chain switching
|
|
491
506
|
switchChain: async () => {
|
|
492
507
|
},
|
|
@@ -502,25 +517,26 @@ function buildLighterFastWalletWithdrawalConfig({
|
|
|
502
517
|
disableConnectedWallet,
|
|
503
518
|
onBeforeSign,
|
|
504
519
|
wallet,
|
|
505
|
-
sourceChainId:
|
|
520
|
+
sourceChainId: RELAY_LIGHTER_CHAIN_ID2,
|
|
506
521
|
sourceTokenSymbol: "USDC",
|
|
507
522
|
defaultReceiveToken: "USDC",
|
|
508
523
|
sourceTokenAddress: LIGHTER_USDC_PERPS_ADDRESS,
|
|
509
524
|
iconSrc: iconSrc ?? "https://sdk-cdn.fun.xyz/images/logos/lighter.png",
|
|
510
|
-
getMinWithdrawalUSD: () => 4
|
|
525
|
+
getMinWithdrawalUSD: () => 4,
|
|
526
|
+
getMaxWithdrawalUSD: () => LIGHTER_FAST_MAX_WITHDRAWAL_USD
|
|
511
527
|
};
|
|
512
528
|
}
|
|
513
529
|
function ChainIconStack({ chainIds }) {
|
|
514
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ React3.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, chainIds.map((chainId, index) => {
|
|
515
531
|
const metadata = chainMetadataById[chainId];
|
|
516
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ React3.createElement(
|
|
517
533
|
Box,
|
|
518
534
|
{
|
|
519
535
|
key: chainId,
|
|
520
536
|
position: "relative",
|
|
521
537
|
style: { right: `${(chainIds.length - index - 1) * -2}px` }
|
|
522
538
|
},
|
|
523
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ React3.createElement(
|
|
524
540
|
AsyncImage,
|
|
525
541
|
{
|
|
526
542
|
alt: metadata?.name ?? "",
|
|
@@ -540,7 +556,7 @@ var LIGHTER_FAST_PREVIEW_CHAIN_IDS = [
|
|
|
540
556
|
bsc.id,
|
|
541
557
|
SOLANA_MAINNET_CHAIN_ID
|
|
542
558
|
];
|
|
543
|
-
var LIGHTER_SECURE_PREVIEW_CHAIN_IDS = [
|
|
559
|
+
var LIGHTER_SECURE_PREVIEW_CHAIN_IDS = [mainnet3.id];
|
|
544
560
|
function buildLighterMultiMethodConfig({
|
|
545
561
|
config,
|
|
546
562
|
accountIndex,
|
|
@@ -571,15 +587,15 @@ function buildLighterMultiMethodConfig({
|
|
|
571
587
|
}
|
|
572
588
|
});
|
|
573
589
|
const fast = {
|
|
574
|
-
id:
|
|
590
|
+
id: LIGHTER_FAST_METHOD_ID,
|
|
575
591
|
keyText: t("withdrawal.methodFast"),
|
|
576
592
|
subtitleText: t("withdrawal.fastDisclaimer"),
|
|
577
|
-
icon: /* @__PURE__ */
|
|
578
|
-
valueIcon: /* @__PURE__ */
|
|
593
|
+
icon: /* @__PURE__ */ React3.createElement(EvmWallet, { size: 20 }),
|
|
594
|
+
valueIcon: /* @__PURE__ */ React3.createElement(ChainIconStack, { chainIds: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
|
|
579
595
|
config: fastConfig
|
|
580
596
|
};
|
|
581
597
|
const secure = {
|
|
582
|
-
id:
|
|
598
|
+
id: LIGHTER_SECURE_METHOD_ID,
|
|
583
599
|
keyText: t("withdrawal.methodSecure"),
|
|
584
600
|
subtitleText: t("withdrawal.secureDisclaimer", {
|
|
585
601
|
// Until the live value loads, show the localized "60+ minutes"
|
|
@@ -587,8 +603,8 @@ function buildLighterMultiMethodConfig({
|
|
|
587
603
|
// so it doesn't bleed into live values, which are exact.
|
|
588
604
|
delay: secureDelayText ?? t("withdrawal.secureFallbackDelay")
|
|
589
605
|
}),
|
|
590
|
-
icon: /* @__PURE__ */
|
|
591
|
-
valueIcon: /* @__PURE__ */
|
|
606
|
+
icon: /* @__PURE__ */ React3.createElement(EvmWallet, { size: 20 }),
|
|
607
|
+
valueIcon: /* @__PURE__ */ React3.createElement(ChainIconStack, { chainIds: LIGHTER_SECURE_PREVIEW_CHAIN_IDS }),
|
|
592
608
|
config: secureConfig
|
|
593
609
|
};
|
|
594
610
|
return {
|
|
@@ -604,7 +620,7 @@ function useLighterWithdrawalConfig(config) {
|
|
|
604
620
|
});
|
|
605
621
|
const accountIndex = mainAccountIndex && /^\d+$/.test(mainAccountIndex) ? mainAccountIndex : void 0;
|
|
606
622
|
const secureDelayText = useLighterSecureDelayText();
|
|
607
|
-
return
|
|
623
|
+
return useMemo2(() => {
|
|
608
624
|
if (!config || !accountIndex) {
|
|
609
625
|
return null;
|
|
610
626
|
}
|