@funkit/connect 3.3.0 → 3.4.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 (98) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +0 -3
  3. package/dist/{chunk-YOJVBRUJ.js → chunk-77C753LI.js} +2 -2
  4. package/dist/{chunk-HFT6OV3T.js → chunk-BY224HGT.js} +1 -1
  5. package/dist/{chunk-ZGK66FYG.js → chunk-XWW5QOD4.js} +2 -2
  6. package/dist/components/Box/Box.d.ts +36 -36
  7. package/dist/components/Dialog/Dialog.css.d.ts +2 -5
  8. package/dist/components/Dropdown/BaseDropdown.d.ts +4 -2
  9. package/dist/components/Dropdown/ChainDropdown.d.ts +3 -1
  10. package/dist/components/Dropdown/TokenDropdown.d.ts +7 -1
  11. package/dist/components/FunAssetAvatar/FunAssetAvatar.d.ts +1 -1
  12. package/dist/components/FunBottomBar/FunBottomBar.css.d.ts +1 -1
  13. package/dist/components/FunButton/FunIconButton.d.ts +1 -0
  14. package/dist/components/FunCheckoutBlocked/FunCheckoutBlocked.d.ts +6 -1
  15. package/dist/components/FunCountdown/FunCountdown.d.ts +2 -1
  16. package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
  17. package/dist/components/FunPayments/FunPaymentMethods.d.ts +5 -13
  18. package/dist/components/FunPayments/FunPaymentMoonpayType.d.ts +4 -2
  19. package/dist/components/Icons/BrokerageIcon.d.ts +4 -0
  20. package/dist/components/Icons/CreditCardIcon.d.ts +4 -0
  21. package/dist/components/Icons/EvmWallet.d.ts +3 -1
  22. package/dist/components/Icons/LightningBoltIcon.d.ts +3 -1
  23. package/dist/components/Icons/SocialMediaIcons.d.ts +12 -4
  24. package/dist/config/getDefaultConfig.d.ts +33 -33
  25. package/dist/consts/assets.d.ts +2 -3
  26. package/dist/consts/funkit.d.ts +5 -1
  27. package/dist/consts/mesh.d.ts +36 -0
  28. package/dist/css/sprinkles.css.d.ts +38 -38
  29. package/dist/domains/checkoutFees.d.ts +4 -2
  30. package/dist/domains/clientMetadata.d.ts +37 -0
  31. package/dist/domains/paymentMethods.d.ts +28 -17
  32. package/dist/domains/quote.d.ts +31 -0
  33. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
  34. package/dist/hooks/useCheckoutQuoteNotification.d.ts +1 -1
  35. package/dist/hooks/useCheckoutTransferDepositAddress.d.ts +2 -1
  36. package/dist/hooks/useEnabledTokenTransferChainTokens.d.ts +2 -0
  37. package/dist/hooks/useIsCheckoutRisky.d.ts +2 -0
  38. package/dist/hooks/useMesh.d.ts +5 -22
  39. package/dist/hooks/usePaymentMethodIcon.d.ts +22 -0
  40. package/dist/hooks/useUsableWalletAssetsForCheckout.d.ts +3 -2
  41. package/dist/index.css +2156 -2135
  42. package/dist/index.js +13723 -13433
  43. package/dist/modals/CheckoutModal/CheckoutPrimaryInfo.d.ts +1 -2
  44. package/dist/modals/CheckoutModal/ConfirmationStep.d.ts +1 -1
  45. package/dist/modals/CheckoutModal/FunCheckoutModal.d.ts +1 -2
  46. package/dist/modals/CheckoutModal/InputAmount/InputAmountLayout.d.ts +11 -0
  47. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +10 -0
  48. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoading.d.ts +7 -0
  49. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +73 -0
  50. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +9 -0
  51. package/dist/modals/CheckoutModal/InputAmount/useCheckoutQuote.d.ts +17 -0
  52. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +23 -0
  53. package/dist/modals/CheckoutModal/InputAmount.d.ts +1 -1
  54. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
  55. package/dist/modals/CheckoutModal/SelectBrokerage.d.ts +1 -1
  56. package/dist/modals/CheckoutModal/SelectPaymentMethod.d.ts +2 -5
  57. package/dist/modals/CheckoutModal/TransferToken.d.ts +6 -3
  58. package/dist/modals/CheckoutModal/useAccountBalancePostCheckout.d.ts +1 -1
  59. package/dist/modals/CheckoutModal/useAvailableBalanceForCheckout.d.ts +1 -1
  60. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +2 -7
  61. package/dist/modals/CheckoutModal/useUpdateSourceAssetForCard.d.ts +1 -1
  62. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutStatus.css.d.ts +2 -0
  63. package/dist/providers/FunkitCheckoutContext.d.ts +37 -60
  64. package/dist/providers/FunkitFlagsProvider.d.ts +2 -2
  65. package/dist/providers/FunkitMoonpayProvider.d.ts +3 -3
  66. package/dist/providers/FunkitThemeProvider.d.ts +4 -4
  67. package/dist/themes/baseTheme.js +1 -1
  68. package/dist/themes/darkTheme.d.ts +1 -1
  69. package/dist/themes/darkTheme.js +2 -2
  70. package/dist/themes/lightTheme.d.ts +1 -1
  71. package/dist/themes/lightTheme.js +2 -2
  72. package/dist/utils/assets.d.ts +2 -1
  73. package/dist/utils/checkout.d.ts +23 -2
  74. package/dist/utils/deposit.d.ts +10 -2
  75. package/dist/utils/flags/config.d.ts +11 -8
  76. package/dist/utils/formatFees.d.ts +12 -0
  77. package/dist/utils/formatNumber.d.ts +1 -1
  78. package/dist/utils/formatTimestamp.d.ts +8 -8
  79. package/dist/utils/mesh.d.ts +9 -54
  80. package/dist/wallets/walletConnectors/index.js +30 -30
  81. package/package.json +4 -4
  82. package/dist/components/FunToast/FunShortToast.css.d.ts +0 -10
  83. package/dist/components/FunToast/FunShortToast.d.ts +0 -3
  84. package/dist/components/FunToast/FunToast.d.ts +0 -18
  85. package/dist/components/Icons/PaymentMethodIcons.d.ts +0 -27
  86. package/dist/providers/FunToastProvider.d.ts +0 -11
  87. package/dist/providers/useAccountBalancePaymentDefaultInfo.d.ts +0 -4
  88. package/dist/wallets/walletConnectors/chunk-2EMZOYQI.js +0 -101
  89. package/dist/wallets/walletConnectors/chunk-5K4DIMYR.js +0 -95
  90. package/dist/wallets/walletConnectors/chunk-AUVBWDIK.js +0 -102
  91. package/dist/wallets/walletConnectors/chunk-AXPQHNUI.js +0 -71
  92. package/dist/wallets/walletConnectors/chunk-B7FHT3CB.js +0 -94
  93. package/dist/wallets/walletConnectors/chunk-EFIENLEE.js +0 -98
  94. package/dist/wallets/walletConnectors/chunk-FLTQRYFS.js +0 -27
  95. package/dist/wallets/walletConnectors/chunk-L7QI6PBN.js +0 -108
  96. package/dist/wallets/walletConnectors/chunk-QP2BIVXD.js +0 -73
  97. package/dist/wallets/walletConnectors/chunk-UWZQZY4S.js +0 -149
  98. package/dist/wallets/walletConnectors/chunk-UZEMNN3Q.js +0 -96
@@ -1,149 +0,0 @@
1
- "use client";
2
- import {
3
- getInjectedConnector,
4
- hasInjectedProvider
5
- } from "./chunk-WRA2DVJ7.js";
6
- import {
7
- isAndroid,
8
- isIOS
9
- } from "./chunk-RETKWSKD.js";
10
- import {
11
- getWalletConnectConnector
12
- } from "./chunk-23WIEY36.js";
13
-
14
- // src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
15
- function isMetaMask(ethereum) {
16
- if (!ethereum?.isMetaMask) return false;
17
- if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state)
18
- return false;
19
- if (ethereum.isApexWallet) return false;
20
- if (ethereum.isAvalanche) return false;
21
- if (ethereum.isBackpack) return false;
22
- if (ethereum.isBifrost) return false;
23
- if (ethereum.isBitKeep) return false;
24
- if (ethereum.isBitski) return false;
25
- if (ethereum.isBlockWallet) return false;
26
- if (ethereum.isCoinbaseWallet) return false;
27
- if (ethereum.isDawn) return false;
28
- if (ethereum.isEnkrypt) return false;
29
- if (ethereum.isExodus) return false;
30
- if (ethereum.isFrame) return false;
31
- if (ethereum.isFrontier) return false;
32
- if (ethereum.isGamestop) return false;
33
- if (ethereum.isHyperPay) return false;
34
- if (ethereum.isImToken) return false;
35
- if (ethereum.isKuCoinWallet) return false;
36
- if (ethereum.isMathWallet) return false;
37
- if (ethereum.isNestWallet) return false;
38
- if (ethereum.isOkxWallet || ethereum.isOKExWallet) return false;
39
- if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
40
- return false;
41
- if (ethereum.isOpera) return false;
42
- if (ethereum.isPhantom) return false;
43
- if (ethereum.isPortal) return false;
44
- if (ethereum.isRabby) return false;
45
- if (ethereum.isRainbow) return false;
46
- if (ethereum.isStatus) return false;
47
- if (ethereum.isTalisman) return false;
48
- if (ethereum.isTally) return false;
49
- if (ethereum.isTokenPocket) return false;
50
- if (ethereum.isTokenary) return false;
51
- if (ethereum.isTrust || ethereum.isTrustWallet) return false;
52
- if (ethereum.isXDEFI) return false;
53
- if (ethereum.isZeal) return false;
54
- if (ethereum.isZerion) return false;
55
- return true;
56
- }
57
- var metaMaskWallet = ({
58
- projectId,
59
- walletConnectParameters
60
- }) => {
61
- const isMetaMaskInjected = hasInjectedProvider({ flag: "isMetaMask" });
62
- const shouldUseWalletConnect = !isMetaMaskInjected;
63
- const getUri = (uri) => {
64
- return isAndroid() ? uri : isIOS() ? (
65
- // currently broken in MetaMask v6.5.0 https://github.com/MetaMask/metamask-mobile/issues/6457
66
- `metamask://wc?uri=${encodeURIComponent(uri)}`
67
- ) : `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`;
68
- };
69
- return {
70
- id: "metaMask",
71
- name: "MetaMask",
72
- rdns: "io.metamask",
73
- iconUrl: async () => (await import("./metaMaskWallet-YFHEHW7V.js")).default,
74
- iconAccent: "#f6851a",
75
- iconBackground: "#fff",
76
- installed: !shouldUseWalletConnect ? isMetaMaskInjected : void 0,
77
- downloadUrls: {
78
- android: "https://play.google.com/store/apps/details?id=io.metamask",
79
- ios: "https://apps.apple.com/us/app/metamask/id1438144202",
80
- mobile: "https://metamask.io/download",
81
- qrCode: "https://metamask.io/download",
82
- chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
83
- edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",
84
- firefox: "https://addons.mozilla.org/firefox/addon/ether-metamask",
85
- opera: "https://addons.opera.com/extensions/details/metamask-10",
86
- browserExtension: "https://metamask.io/download"
87
- },
88
- mobile: {
89
- getUri: shouldUseWalletConnect ? getUri : void 0
90
- },
91
- qrCode: shouldUseWalletConnect ? {
92
- getUri,
93
- instructions: {
94
- learnMoreUrl: "https://metamask.io/faqs/",
95
- steps: [
96
- {
97
- description: "wallet_connectors.metamask.qr_code.step1.description",
98
- step: "install",
99
- title: "wallet_connectors.metamask.qr_code.step1.title"
100
- },
101
- {
102
- description: "wallet_connectors.metamask.qr_code.step2.description",
103
- step: "create",
104
- title: "wallet_connectors.metamask.qr_code.step2.title"
105
- },
106
- {
107
- description: "wallet_connectors.metamask.qr_code.step3.description",
108
- step: "refresh",
109
- title: "wallet_connectors.metamask.qr_code.step3.title"
110
- }
111
- ]
112
- }
113
- } : void 0,
114
- extension: {
115
- instructions: {
116
- learnMoreUrl: "https://metamask.io/faqs/",
117
- steps: [
118
- {
119
- description: "wallet_connectors.metamask.extension.step1.description",
120
- step: "install",
121
- title: "wallet_connectors.metamask.extension.step1.title"
122
- },
123
- {
124
- description: "wallet_connectors.metamask.extension.step2.description",
125
- step: "create",
126
- title: "wallet_connectors.metamask.extension.step2.title"
127
- },
128
- {
129
- description: "wallet_connectors.metamask.extension.step3.description",
130
- step: "refresh",
131
- title: "wallet_connectors.metamask.extension.step3.title"
132
- }
133
- ]
134
- }
135
- },
136
- createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
137
- projectId,
138
- walletConnectParameters
139
- }) : getInjectedConnector({
140
- target: typeof window !== "undefined" ? window.ethereum?.providers?.find(
141
- isMetaMask
142
- ) ?? window.ethereum : void 0
143
- })
144
- };
145
- };
146
-
147
- export {
148
- metaMaskWallet
149
- };
@@ -1,96 +0,0 @@
1
- "use client";
2
- import {
3
- getInjectedConnector,
4
- hasInjectedProvider
5
- } from "./chunk-WRA2DVJ7.js";
6
- import {
7
- isAndroid
8
- } from "./chunk-RETKWSKD.js";
9
- import {
10
- getWalletConnectConnector
11
- } from "./chunk-23WIEY36.js";
12
-
13
- // src/wallets/walletConnectors/okxWallet/okxWallet.ts
14
- var okxWallet = ({
15
- projectId,
16
- walletConnectParameters
17
- }) => {
18
- const isOKXInjected = hasInjectedProvider({ namespace: "okxwallet" });
19
- const shouldUseWalletConnect = !isOKXInjected;
20
- return {
21
- id: "okx",
22
- name: "OKX Wallet",
23
- rdns: "com.okex.wallet",
24
- iconUrl: async () => (await import("./okxWallet-GJMKZIND.js")).default,
25
- iconAccent: "#000",
26
- iconBackground: "#000",
27
- downloadUrls: {
28
- android: "https://play.google.com/store/apps/details?id=com.okinc.okex.gp",
29
- ios: "https://itunes.apple.com/app/id1327268470?mt=8",
30
- mobile: "https://okx.com/download",
31
- qrCode: "https://okx.com/download",
32
- chrome: "https://chrome.google.com/webstore/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",
33
- edge: "https://microsoftedge.microsoft.com/addons/detail/okx-wallet/pbpjkcldjiffchgbbndmhojiacbgflha",
34
- firefox: "https://addons.mozilla.org/firefox/addon/okexwallet/",
35
- browserExtension: "https://okx.com/download"
36
- },
37
- mobile: {
38
- getUri: shouldUseWalletConnect ? (uri) => {
39
- return isAndroid() ? uri : `okex://main/wc?uri=${encodeURIComponent(uri)}`;
40
- } : void 0
41
- },
42
- qrCode: shouldUseWalletConnect ? {
43
- getUri: (uri) => uri,
44
- instructions: {
45
- learnMoreUrl: "https://okx.com/web3/",
46
- steps: [
47
- {
48
- description: "wallet_connectors.okx.qr_code.step1.description",
49
- step: "install",
50
- title: "wallet_connectors.okx.qr_code.step1.title"
51
- },
52
- {
53
- description: "wallet_connectors.okx.qr_code.step2.description",
54
- step: "create",
55
- title: "wallet_connectors.okx.qr_code.step2.title"
56
- },
57
- {
58
- description: "wallet_connectors.okx.qr_code.step3.description",
59
- step: "scan",
60
- title: "wallet_connectors.okx.qr_code.step3.title"
61
- }
62
- ]
63
- }
64
- } : void 0,
65
- extension: {
66
- instructions: {
67
- learnMoreUrl: "https://okx.com/web3/",
68
- steps: [
69
- {
70
- description: "wallet_connectors.okx.extension.step1.description",
71
- step: "install",
72
- title: "wallet_connectors.okx.extension.step1.title"
73
- },
74
- {
75
- description: "wallet_connectors.okx.extension.step2.description",
76
- step: "create",
77
- title: "wallet_connectors.okx.extension.step2.title"
78
- },
79
- {
80
- description: "wallet_connectors.okx.extension.step3.description",
81
- step: "refresh",
82
- title: "wallet_connectors.okx.extension.step3.title"
83
- }
84
- ]
85
- }
86
- },
87
- createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
88
- projectId,
89
- walletConnectParameters
90
- }) : getInjectedConnector({ namespace: "okxwallet" })
91
- };
92
- };
93
-
94
- export {
95
- okxWallet
96
- };