@funkit/connect 9.27.1 → 9.28.1

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/clients/{chunk-UBBBMSKL.js → chunk-4O4YAFYK.js} +65 -6
  3. package/dist/clients/{chunk-O5CTDT3L.js → chunk-7LKK5QMZ.js} +1 -1
  4. package/dist/clients/{chunk-VT3ERWXE.js → chunk-CGHPNWIF.js} +1 -1
  5. package/dist/clients/{chunk-E36JOYL4.js → chunk-TQVRP3Z2.js} +1 -1
  6. package/dist/clients/lighter.css +7 -1
  7. package/dist/clients/lighter.js +1 -1
  8. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +7 -1
  9. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +4 -5
  10. package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
  11. package/dist/clients/polymarket/index.css +7 -1
  12. package/dist/clients/polymarket/index.js +4 -5
  13. package/dist/clients/polymarket/polymarket.js +1 -1
  14. package/dist/components/BitcoinLightningBanner/BitcoinLightningBanner.d.ts +12 -0
  15. package/dist/domains/clientMetadata.d.ts +2 -3
  16. package/dist/domains/quoteMode/types.d.ts +0 -1
  17. package/dist/hooks/queries/useRecentDeposits.d.ts +1 -1
  18. package/dist/hooks/usePaymentSources.d.ts +1 -1
  19. package/dist/hooks/useStartBitcoinLightning.d.ts +11 -0
  20. package/dist/index.css +7 -1
  21. package/dist/index.js +607 -720
  22. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +4 -9
  23. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +7 -1
  24. package/dist/modals/CheckoutModal/TransferToken/DirectExecutionNotification.d.ts +1 -3
  25. package/dist/modals/CheckoutModal/TransferToken/TransferToken.d.ts +1 -1
  26. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +6 -0
  27. package/dist/providers/FunkitCheckoutContext/types.d.ts +0 -2
  28. package/dist/utils/checkout.d.ts +0 -10
  29. package/dist/utils/withdrawal.d.ts +12 -0
  30. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  31. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  32. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  33. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  34. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  35. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  36. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  37. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  38. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  39. package/dist/wallets/walletConnectors/index.js +56 -56
  40. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  44. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  48. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  49. package/package.json +5 -5
  50. package/dist/clients/chunk-ZEXZQOAO.js +0 -96
  51. package/dist/clients/polymarket/usePolymarketAccountBalances.js +0 -12
  52. package/dist/{clients/polymarket → hooks}/usePolymarketAccountBalances.d.ts +0 -0
  53. package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
  54. package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
  55. package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
  56. package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
  57. package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
  58. package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
  59. package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
  60. package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
  61. package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
  62. package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
  63. package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
  64. package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
  65. package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
  66. package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
  67. package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
  68. package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
  69. package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
  70. package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
@@ -1,96 +0,0 @@
1
- "use client";
2
- import {
3
- logger
4
- } from "./chunk-AHYOV7AV.js";
5
-
6
- // src/clients/polymarket/usePolymarketAccountBalances.ts
7
- import {
8
- skipToken,
9
- useQuery,
10
- useQueryClient
11
- } from "@tanstack/react-query";
12
- import * as dnum from "dnum";
13
- var DEFAULT_BALANCE_REFETCH_MS = 1e3;
14
- var polymarketAccountBalanceQueryKey = (address) => ["polymarket", "accountBalanceUsd", address ?? null];
15
- var polymarketBalanceSettleUntilQueryKey = (address) => ["polymarket", "accountBalanceSettleUntil", address];
16
- var PUSD_DECIMALS = 6;
17
- var SETTLEMENT_WINDOW_MS = 3e4;
18
- function applyOptimisticTransferBalances(queryClient, transfer) {
19
- const { fromAddress, toAddress, amountUsd } = transfer;
20
- const amount = dnum.from(amountUsd, PUSD_DECIMALS);
21
- shiftBalance(queryClient, fromAddress, dnum.multiply(amount, -1));
22
- shiftBalance(queryClient, toAddress, amount);
23
- }
24
- function shiftBalance(queryClient, address, deltaUsd) {
25
- const balanceKey = polymarketAccountBalanceQueryKey(address);
26
- const displayedUsd = queryClient.getQueryData(balanceKey);
27
- if (displayedUsd === void 0) {
28
- return;
29
- }
30
- void queryClient.cancelQueries({ queryKey: balanceKey });
31
- queryClient.setQueryData(
32
- polymarketBalanceSettleUntilQueryKey(address),
33
- Date.now() + SETTLEMENT_WINDOW_MS
34
- );
35
- queryClient.setQueryData(
36
- balanceKey,
37
- Math.max(0, dnum.toNumber(dnum.add(displayedUsd, deltaUsd, PUSD_DECIMALS)))
38
- );
39
- }
40
- async function fetchAccountBalance(queryClient, getBalanceUsd, queryKey) {
41
- const [, , address] = queryKey;
42
- if (address === null) {
43
- throw new Error("polymarket balance query ran without an address");
44
- }
45
- try {
46
- const serverUsd = await getBalanceUsd();
47
- const settleUntil = queryClient.getQueryData(
48
- polymarketBalanceSettleUntilQueryKey(address)
49
- );
50
- const displayedUsd = queryClient.getQueryData(
51
- polymarketAccountBalanceQueryKey(address)
52
- );
53
- if (settleUntil !== void 0 && Date.now() < settleUntil && displayedUsd !== void 0) {
54
- return displayedUsd;
55
- }
56
- return serverUsd;
57
- } catch (error) {
58
- logger.warn("polymarket:accountBalance:fetchFailed", {
59
- address,
60
- error: String(error)
61
- });
62
- throw error;
63
- }
64
- }
65
- function useAccountBalance(account, refetchIntervalMs) {
66
- const queryClient = useQueryClient();
67
- const getBalanceUsd = account?.getBalanceUsd;
68
- const address = account?.address;
69
- const query = useQuery({
70
- queryKey: polymarketAccountBalanceQueryKey(address),
71
- // `skipToken` disables the query when the account isn't configured (the
72
- // perps-transfer config is optional). It is *not* a fallback for a missing
73
- // balance — the getter is the single source of truth.
74
- queryFn: getBalanceUsd && address ? ({ queryKey }) => fetchAccountBalance(queryClient, getBalanceUsd, queryKey) : skipToken,
75
- refetchInterval: refetchIntervalMs,
76
- // The poll interval is the freshness contract: a reader mounting within it
77
- // (e.g. navigating between the deposit picker and the transfer step) reads
78
- // the cached balance as-is instead of kicking off an extra mount fetch —
79
- // that's what makes the navigation flash-free *and* fetch-free.
80
- staleTime: refetchIntervalMs
81
- });
82
- return { balanceUsd: query.data };
83
- }
84
- function usePolymarketAccountBalances(accounts, options) {
85
- const refetchIntervalMs = options?.refetchIntervalMs ?? DEFAULT_BALANCE_REFETCH_MS;
86
- return {
87
- predictions: useAccountBalance(accounts.predictions, refetchIntervalMs),
88
- perps: useAccountBalance(accounts.perps, refetchIntervalMs)
89
- };
90
- }
91
-
92
- export {
93
- polymarketAccountBalanceQueryKey,
94
- applyOptimisticTransferBalances,
95
- usePolymarketAccountBalances
96
- };
@@ -1,12 +0,0 @@
1
- "use client";
2
- import {
3
- applyOptimisticTransferBalances,
4
- polymarketAccountBalanceQueryKey,
5
- usePolymarketAccountBalances
6
- } from "../chunk-ZEXZQOAO.js";
7
- import "../chunk-AHYOV7AV.js";
8
- export {
9
- applyOptimisticTransferBalances,
10
- polymarketAccountBalanceQueryKey,
11
- usePolymarketAccountBalances
12
- };
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/rainbowWallet/rainbowWallet.ts
11
11
  import { isAndroid, isIOS } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/bifrostWallet/bifrostWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/coin98Wallet/coin98Wallet.ts
11
11
  var coin98Wallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
11
11
  import { isAndroid, isIOS } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/bitgetWallet/bitgetWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/bybitWallet/bybitWallet.ts
11
11
  var bybitWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/gateWallet/gateWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.ts
11
11
  import { isMobile } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/foxWallet/foxWallet.ts
11
11
  var foxWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/coreWallet/coreWallet.ts
11
11
  var coreWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/zerionWallet/zerionWallet.ts
11
11
  import { isIOS } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/okxWallet/okxWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/clvWallet/clvWallet.ts
11
11
  var clvWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/roninWallet/roninWallet.ts
11
11
  var roninWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/safepalWallet/safepalWallet.ts
11
11
  var safepalWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/subWallet/subWallet.ts
11
11
  var subWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/frontierWallet/frontierWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import {
3
- getWalletConnectConnector
4
- } from "./chunk-N4IJLYFY.js";
5
2
  import {
6
3
  getInjectedConnector,
7
4
  hasInjectedProvider
8
5
  } from "./chunk-OLZ7626J.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/trustWallet/trustWallet.ts
11
11
  import { isMobile } from "@funkit/utils";