@funkit/connect 3.2.1 → 3.4.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.
Files changed (140) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +0 -3
  3. package/dist/{chunk-76VEFMWE.js → chunk-77C753LI.js} +6 -2
  4. package/dist/{chunk-HFT6OV3T.js → chunk-BY224HGT.js} +1 -1
  5. package/dist/{chunk-EUSK63OY.js → chunk-XWW5QOD4.js} +6 -2
  6. package/dist/components/Box/Box.d.ts +44 -43
  7. package/dist/components/CopyAddress/CopyAddress.d.ts +7 -1
  8. package/dist/components/Dialog/Dialog.css.d.ts +2 -5
  9. package/dist/components/Dialog/Dialog.d.ts +2 -2
  10. package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +12 -0
  11. package/dist/components/Dropdown/BaseDropdown.d.ts +23 -0
  12. package/dist/components/Dropdown/BaseDropdownItem.d.ts +13 -0
  13. package/dist/components/Dropdown/ChainDropdown.d.ts +8 -0
  14. package/dist/components/Dropdown/TokenDropdown.d.ts +9 -0
  15. package/dist/components/FunAlert/FunAlert.d.ts +6 -3
  16. package/dist/components/FunBottomBar/FunBottomBar.d.ts +2 -1
  17. package/dist/components/FunButton/FunIconButton.d.ts +4 -1
  18. package/dist/components/FunButton/FunSignInButton.d.ts +8 -0
  19. package/dist/components/FunCheckoutBlocked/FunCheckoutBlocked.d.ts +6 -1
  20. package/dist/components/FunConnectOptions/FunConnectOptions.d.ts +5 -2
  21. package/dist/components/FunConnectOptions/FunConnectResultStep.d.ts +1 -3
  22. package/dist/components/FunConnectOptions/FunSignInStep.d.ts +2 -1
  23. package/dist/components/FunConnectOptions/FunWeb3ConnectingStep.d.ts +1 -1
  24. package/dist/components/FunCountdown/FunCountdown.css.d.ts +2 -0
  25. package/dist/components/FunCountdown/FunCountdown.d.ts +2 -1
  26. package/dist/components/FunDivider/FunDivider.d.ts +2 -2
  27. package/dist/components/FunNotification/FunNotification.d.ts +1 -1
  28. package/dist/components/FunPayments/FunPaymentMethods.d.ts +22 -10
  29. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +4 -5
  30. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +6 -0
  31. package/dist/components/Icons/BrokerageIcon.d.ts +4 -0
  32. package/dist/components/Icons/CopyDoublePaperSheetIcon.d.ts +5 -0
  33. package/dist/components/Icons/CopyDoubleRoundedSquareIcon.d.ts +5 -0
  34. package/dist/components/Icons/CreditCardIcon.d.ts +4 -0
  35. package/dist/components/Icons/EvmWallet.d.ts +3 -1
  36. package/dist/components/Icons/Gas.d.ts +4 -0
  37. package/dist/components/Icons/LightningBoltIcon.d.ts +4 -0
  38. package/dist/components/Icons/SocialMediaIcons.d.ts +12 -4
  39. package/dist/components/QRCode/QRCode.d.ts +8 -1
  40. package/dist/consts/assets.d.ts +1 -0
  41. package/dist/consts/funkit.d.ts +5 -1
  42. package/dist/css/sprinkles.css.d.ts +53 -45
  43. package/dist/domains/checkoutFees.d.ts +40 -0
  44. package/dist/domains/clientMetadata.d.ts +37 -0
  45. package/dist/{consts/payment.d.ts → domains/paymentMethods.d.ts} +5 -8
  46. package/dist/domains/quote.d.ts +16 -0
  47. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
  48. package/dist/hooks/useCheckoutQuoteNotification.d.ts +1 -1
  49. package/dist/hooks/useCheckoutStateBooleans.d.ts +5 -1
  50. package/dist/hooks/useCheckoutTransferDepositAddress.d.ts +3 -0
  51. package/dist/hooks/useCheckoutType.d.ts +3 -3
  52. package/dist/hooks/useIsCheckoutRisky.d.ts +2 -0
  53. package/dist/hooks/useMesh.d.ts +4 -4
  54. package/dist/hooks/usePaymentMethodIcon.d.ts +22 -0
  55. package/dist/hooks/useUsableWalletAssetsForCheckout.d.ts +3 -2
  56. package/dist/index.css +2413 -2098
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.js +12541 -11733
  59. package/dist/modals/CheckoutModal/CheckoutPrimaryInfo.d.ts +1 -12
  60. package/dist/modals/CheckoutModal/ConfirmationStep.d.ts +2 -2
  61. package/dist/modals/CheckoutModal/ConnectExchange.d.ts +1 -1
  62. package/dist/modals/CheckoutModal/FunCheckoutModal.d.ts +1 -2
  63. package/dist/modals/CheckoutModal/InputAmount/InputAmountLayout.d.ts +11 -0
  64. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +10 -0
  65. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoading.d.ts +7 -0
  66. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +73 -0
  67. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +9 -0
  68. package/dist/modals/CheckoutModal/InputAmount/useCheckoutQuote.d.ts +17 -0
  69. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +23 -0
  70. package/dist/modals/CheckoutModal/InputAmount.d.ts +2 -2
  71. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
  72. package/dist/modals/CheckoutModal/MeshVerification.d.ts +1 -1
  73. package/dist/modals/CheckoutModal/SelectAsset.d.ts +1 -1
  74. package/dist/modals/CheckoutModal/SelectBrokerage.d.ts +2 -2
  75. package/dist/modals/CheckoutModal/SelectPaymentMethod.d.ts +5 -2
  76. package/dist/modals/CheckoutModal/SourceChange.d.ts +1 -1
  77. package/dist/modals/CheckoutModal/TransferToken.d.ts +18 -0
  78. package/dist/modals/CheckoutModal/stepTransition.d.ts +9 -9
  79. package/dist/modals/CheckoutModal/useAccountBalancePostCheckout.d.ts +1 -2
  80. package/dist/modals/CheckoutModal/useAvailableBalanceForCheckout.d.ts +2 -2
  81. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +2 -7
  82. package/dist/modals/CheckoutModal/useUpdateSourceAssetForCard.d.ts +1 -1
  83. package/dist/modals/ConnectModal/ConnectModal.d.ts +3 -1
  84. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +3 -2
  85. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +8 -6
  86. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.css.d.ts +0 -1
  87. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.d.ts +5 -2
  88. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutStatus.css.d.ts +2 -0
  89. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutStatus.d.ts +2 -1
  90. package/dist/providers/FunkitCheckoutContext.d.ts +36 -43
  91. package/dist/providers/FunkitConfigContext.d.ts +13 -0
  92. package/dist/providers/FunkitFlagsProvider.d.ts +2 -2
  93. package/dist/providers/FunkitMoonpayProvider.d.ts +1 -1
  94. package/dist/providers/FunkitThemeProvider.d.ts +20 -4
  95. package/dist/providers/GeneralWalletProvider.d.ts +12 -13
  96. package/dist/providers/ModalContext.d.ts +1 -1
  97. package/dist/providers/useAccountBalancePaymentDefaultInfo.d.ts +4 -0
  98. package/dist/themes/baseTheme.js +1 -1
  99. package/dist/themes/darkTheme.d.ts +5 -1
  100. package/dist/themes/darkTheme.js +2 -2
  101. package/dist/themes/lightTheme.d.ts +5 -1
  102. package/dist/themes/lightTheme.js +2 -2
  103. package/dist/utils/assets.d.ts +1 -1
  104. package/dist/utils/checkout.d.ts +24 -5
  105. package/dist/utils/deposit.d.ts +10 -2
  106. package/dist/utils/flags/config.d.ts +11 -8
  107. package/dist/utils/formatNumber.d.ts +1 -0
  108. package/dist/utils/formatTimestamp.d.ts +8 -8
  109. package/dist/utils/payment.d.ts +1 -1
  110. package/dist/wallets/walletConnectors/index.js +44 -44
  111. package/package.json +4 -4
  112. package/dist/components/FunCallToAction/FunCallToAction.d.ts +0 -10
  113. package/dist/components/FunContainer/FunContainer.d.ts +0 -9
  114. package/dist/components/FunToast/FunShortToast.css.d.ts +0 -10
  115. package/dist/components/FunToast/FunShortToast.d.ts +0 -3
  116. package/dist/components/FunToast/FunToast.d.ts +0 -18
  117. package/dist/components/FunTransactionSummary/FunTransactionSummary.d.ts +0 -14
  118. package/dist/components/Icons/CopyDoubleIcon.d.ts +0 -2
  119. package/dist/components/Icons/PaymentMethodIcons.d.ts +0 -30
  120. package/dist/consts/checkoutFees.d.ts +0 -27
  121. package/dist/modals/CheckoutModal/TransferSetup.d.ts +0 -14
  122. package/dist/providers/FunToastProvider.d.ts +0 -11
  123. package/dist/wallets/walletConnectors/chunk-25VW5TZP.js +0 -92
  124. package/dist/wallets/walletConnectors/chunk-4HKPVECK.js +0 -95
  125. package/dist/wallets/walletConnectors/chunk-4K3EKHXR.js +0 -71
  126. package/dist/wallets/walletConnectors/chunk-57UUMOOZ.js +0 -95
  127. package/dist/wallets/walletConnectors/chunk-5MVCKMZT.js +0 -94
  128. package/dist/wallets/walletConnectors/chunk-5NZLWT3Y.js +0 -73
  129. package/dist/wallets/walletConnectors/chunk-B5D7DYVV.js +0 -101
  130. package/dist/wallets/walletConnectors/chunk-HCKLWBE5.js +0 -98
  131. package/dist/wallets/walletConnectors/chunk-HLH777AC.js +0 -108
  132. package/dist/wallets/walletConnectors/chunk-HMDUVRZP.js +0 -98
  133. package/dist/wallets/walletConnectors/chunk-IR3YKU2N.js +0 -103
  134. package/dist/wallets/walletConnectors/chunk-J2BF4L2V.js +0 -87
  135. package/dist/wallets/walletConnectors/chunk-KDGMYRMC.js +0 -102
  136. package/dist/wallets/walletConnectors/chunk-OKUX4BC4.js +0 -66
  137. package/dist/wallets/walletConnectors/chunk-VU6B3HMD.js +0 -96
  138. package/dist/wallets/walletConnectors/chunk-WAMHUVNP.js +0 -96
  139. package/dist/wallets/walletConnectors/chunk-YRK6XWL6.js +0 -149
  140. package/dist/wallets/walletConnectors/chunk-ZCKNEKQQ.js +0 -110
@@ -1,149 +0,0 @@
1
- "use client";
2
- import {
3
- isAndroid,
4
- isIOS
5
- } from "./chunk-RETKWSKD.js";
6
- import {
7
- getInjectedConnector,
8
- hasInjectedProvider
9
- } from "./chunk-WRA2DVJ7.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,110 +0,0 @@
1
- "use client";
2
- import {
3
- getInjectedConnector,
4
- hasInjectedProvider
5
- } from "./chunk-WRA2DVJ7.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-23WIEY36.js";
9
-
10
- // src/wallets/walletConnectors/safepalWallet/safepalWallet.ts
11
- var safepalWallet = ({
12
- projectId,
13
- walletConnectParameters
14
- }) => {
15
- const isSafePalWalletInjected = hasInjectedProvider({
16
- namespace: "safepalProvider",
17
- flag: "isSafePal"
18
- });
19
- const shouldUseWalletConnect = !isSafePalWalletInjected;
20
- const getUriMobile = (uri) => {
21
- return `safepalwallet://wc?uri=${encodeURIComponent(uri)}`;
22
- };
23
- const getUriQR = async (uri) => {
24
- return uri;
25
- };
26
- const mobileConnector = {
27
- getUri: shouldUseWalletConnect ? getUriMobile : void 0
28
- };
29
- let qrConnector = void 0;
30
- if (shouldUseWalletConnect) {
31
- qrConnector = {
32
- getUri: getUriQR,
33
- instructions: {
34
- learnMoreUrl: "https://safepal.com/",
35
- steps: [
36
- {
37
- description: "wallet_connectors.safepal.qr_code.step1.description",
38
- step: "install",
39
- title: "wallet_connectors.safepal.qr_code.step1.title"
40
- },
41
- {
42
- description: "wallet_connectors.safepal.qr_code.step2.description",
43
- step: "create",
44
- title: "wallet_connectors.safepal.qr_code.step2.title"
45
- },
46
- {
47
- description: "wallet_connectors.safepal.qr_code.step3.description",
48
- step: "scan",
49
- title: "wallet_connectors.safepal.qr_code.step3.title"
50
- }
51
- ]
52
- }
53
- };
54
- }
55
- const extensionConnector = {
56
- instructions: {
57
- learnMoreUrl: "https://www.safepal.com/download?product=2",
58
- steps: [
59
- {
60
- description: "wallet_connectors.safepal.extension.step1.description",
61
- step: "install",
62
- title: "wallet_connectors.safepal.extension.step1.title"
63
- },
64
- {
65
- description: "wallet_connectors.safepal.extension.step2.description",
66
- step: "create",
67
- title: "wallet_connectors.safepal.extension.step2.title"
68
- },
69
- {
70
- description: "wallet_connectors.safepal.extension.step3.description",
71
- step: "refresh",
72
- title: "wallet_connectors.safepal.extension.step3.title"
73
- }
74
- ]
75
- }
76
- };
77
- return {
78
- id: "safepal",
79
- name: "SafePal Wallet",
80
- iconUrl: async () => (await import("./safepalWallet-KQJ4OCNH.js")).default,
81
- // Note that we never resolve `installed` to `false` because the
82
- // SafePal Wallet provider falls back to other connection methods if
83
- // the injected connector isn't available
84
- installed: isSafePalWalletInjected,
85
- iconAccent: "#3375BB",
86
- iconBackground: "#fff",
87
- downloadUrls: {
88
- android: "https://play.google.com/store/apps/details?id=io.safepal.wallet&referrer=utm_source%3Drainbowkit%26utm_medium%3Ddisplay%26utm_campaign%3Ddownload",
89
- ios: "https://apps.apple.com/app/apple-store/id1548297139?pt=122504219&ct=rainbowkit&mt=8",
90
- mobile: "https://www.safepal.com/en/download",
91
- qrCode: "https://www.safepal.com/en/download",
92
- chrome: "https://chrome.google.com/webstore/detail/safepal-extension-wallet/lgmpcpglpngdoalbgeoldeajfclnhafa",
93
- browserExtension: "https://www.safepal.com/download?product=2"
94
- },
95
- mobile: mobileConnector,
96
- ...qrConnector ? qrConnector : {},
97
- extension: extensionConnector,
98
- createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
99
- projectId,
100
- walletConnectParameters
101
- }) : getInjectedConnector({
102
- namespace: "safepalProvider",
103
- flag: "isSafePal"
104
- })
105
- };
106
- };
107
-
108
- export {
109
- safepalWallet
110
- };