@openfort/react 1.1.4 → 1.3.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 (182) hide show
  1. package/build/assets/icons.js +1 -1
  2. package/build/assets/logos.d.ts +15 -0
  3. package/build/assets/logos.js +9 -0
  4. package/build/assets/logos.js.map +1 -1
  5. package/build/components/Common/CopyToClipboard/CopyIconButton.d.ts +3 -1
  6. package/build/components/Common/CopyToClipboard/CopyIconButton.js +4 -4
  7. package/build/components/Common/CustomQRCode/index.d.ts +1 -1
  8. package/build/components/Common/CustomQRCode/index.js +3 -3
  9. package/build/components/Common/CustomQRCode/styles.d.ts +1 -0
  10. package/build/components/Common/CustomQRCode/styles.js +4 -4
  11. package/build/components/Common/CustomQRCode/types.d.ts +2 -0
  12. package/build/components/Common/Modal/styles.js +4 -1
  13. package/build/components/Common/Modal/styles.js.map +1 -1
  14. package/build/components/Common/SolanaChain/index.d.ts +8 -0
  15. package/build/components/Common/SolanaChain/index.js +40 -0
  16. package/build/components/Common/SolanaChain/index.js.map +1 -0
  17. package/build/components/ConnectModal/index.js +16 -2
  18. package/build/components/ConnectModal/index.js.map +1 -1
  19. package/build/components/Openfort/OpenfortProvider.js +4 -1
  20. package/build/components/Openfort/OpenfortProvider.js.map +1 -1
  21. package/build/components/Openfort/types.d.ts +92 -0
  22. package/build/components/Openfort/types.js +23 -1
  23. package/build/components/Openfort/types.js.map +1 -1
  24. package/build/components/Pages/AssetInventory/SolanaAssetInventory.d.ts +6 -0
  25. package/build/components/Pages/AssetInventory/SolanaAssetInventory.js +42 -0
  26. package/build/components/Pages/AssetInventory/SolanaAssetInventory.js.map +1 -0
  27. package/build/components/Pages/Buy/coinbaseApi.d.ts +1 -1
  28. package/build/components/Pages/Buy/coinbaseApi.js +2 -13
  29. package/build/components/Pages/Buy/coinbaseApi.js.map +1 -1
  30. package/build/components/Pages/Buy/evmCurrencies.d.ts +11 -0
  31. package/build/components/Pages/Buy/evmCurrencies.js +27 -0
  32. package/build/components/Pages/Buy/evmCurrencies.js.map +1 -0
  33. package/build/components/Pages/Buy/index.js +11 -3
  34. package/build/components/Pages/Buy/index.js.map +1 -1
  35. package/build/components/Pages/Buy/onrampApi.d.ts +8 -1
  36. package/build/components/Pages/Buy/onrampApi.js +24 -14
  37. package/build/components/Pages/Buy/onrampApi.js.map +1 -1
  38. package/build/components/Pages/Buy/solanaCurrencies.d.ts +9 -0
  39. package/build/components/Pages/Buy/solanaCurrencies.js +25 -0
  40. package/build/components/Pages/Buy/solanaCurrencies.js.map +1 -0
  41. package/build/components/Pages/Buy/stripeApi.d.ts +1 -1
  42. package/build/components/Pages/Buy/stripeApi.js +2 -13
  43. package/build/components/Pages/Buy/stripeApi.js.map +1 -1
  44. package/build/components/Pages/BuyComplete/index.js +7 -1
  45. package/build/components/Pages/BuyComplete/index.js.map +1 -1
  46. package/build/components/Pages/BuyProcessing/index.js +9 -5
  47. package/build/components/Pages/BuyProcessing/index.js.map +1 -1
  48. package/build/components/Pages/BuySelectProvider/index.js +11 -6
  49. package/build/components/Pages/BuySelectProvider/index.js.map +1 -1
  50. package/build/components/Pages/Connected/EthereumConnected.js +8 -32
  51. package/build/components/Pages/Connected/EthereumConnected.js.map +1 -1
  52. package/build/components/Pages/Connected/SolanaConnected.js +11 -5
  53. package/build/components/Pages/Connected/SolanaConnected.js.map +1 -1
  54. package/build/components/Pages/Deposit/AddressPageLink.d.ts +7 -0
  55. package/build/components/Pages/Deposit/AddressPageLink.js +17 -0
  56. package/build/components/Pages/Deposit/AddressPageLink.js.map +1 -0
  57. package/build/components/Pages/Deposit/AssetChainLogo.d.ts +9 -0
  58. package/build/components/Pages/Deposit/AssetChainLogo.js +24 -0
  59. package/build/components/Pages/Deposit/AssetChainLogo.js.map +1 -0
  60. package/build/components/Pages/Deposit/DepositAddressBlock.d.ts +21 -0
  61. package/build/components/Pages/Deposit/DepositAddressBlock.js +28 -0
  62. package/build/components/Pages/Deposit/DepositAddressBlock.js.map +1 -0
  63. package/build/components/Pages/Deposit/DepositProgress.d.ts +15 -0
  64. package/build/components/Pages/Deposit/DepositProgress.js +111 -0
  65. package/build/components/Pages/Deposit/DepositProgress.js.map +1 -0
  66. package/build/components/Pages/Deposit/DepositStatus.d.ts +9 -0
  67. package/build/components/Pages/Deposit/DepositStatus.js +43 -0
  68. package/build/components/Pages/Deposit/DepositStatus.js.map +1 -0
  69. package/build/components/Pages/Deposit/DepositSuccess.d.ts +6 -0
  70. package/build/components/Pages/Deposit/DepositSuccess.js +25 -0
  71. package/build/components/Pages/Deposit/DepositSuccess.js.map +1 -0
  72. package/build/components/Pages/Deposit/Details.d.ts +12 -0
  73. package/build/components/Pages/Deposit/Details.js +40 -0
  74. package/build/components/Pages/Deposit/Details.js.map +1 -0
  75. package/build/components/Pages/Deposit/LogoSelect.d.ts +12 -0
  76. package/build/components/Pages/Deposit/LogoSelect.js +95 -0
  77. package/build/components/Pages/Deposit/LogoSelect.js.map +1 -0
  78. package/build/components/Pages/Deposit/OrDivider.d.ts +2 -0
  79. package/build/components/Pages/Deposit/OrDivider.js +10 -0
  80. package/build/components/Pages/Deposit/OrDivider.js.map +1 -0
  81. package/build/components/Pages/Deposit/RouteSelectors.d.ts +13 -0
  82. package/build/components/Pages/Deposit/RouteSelectors.js +19 -0
  83. package/build/components/Pages/Deposit/RouteSelectors.js.map +1 -0
  84. package/build/components/Pages/Deposit/cexChains.d.ts +9 -0
  85. package/build/components/Pages/Deposit/cexChains.js +23 -0
  86. package/build/components/Pages/Deposit/cexChains.js.map +1 -0
  87. package/build/components/Pages/Deposit/formStyles.d.ts +24 -0
  88. package/build/components/Pages/Deposit/formStyles.js +83 -0
  89. package/build/components/Pages/Deposit/formStyles.js.map +1 -0
  90. package/build/components/Pages/Deposit/index.d.ts +7 -0
  91. package/build/components/Pages/Deposit/index.js +114 -0
  92. package/build/components/Pages/Deposit/index.js.map +1 -0
  93. package/build/components/Pages/Deposit/paymentOptions.d.ts +49 -0
  94. package/build/components/Pages/Deposit/paymentOptions.js +63 -0
  95. package/build/components/Pages/Deposit/paymentOptions.js.map +1 -0
  96. package/build/components/Pages/Deposit/sources.d.ts +17 -0
  97. package/build/components/Pages/Deposit/sources.js +22 -0
  98. package/build/components/Pages/Deposit/sources.js.map +1 -0
  99. package/build/components/Pages/Deposit/styles.d.ts +25 -0
  100. package/build/components/Pages/Deposit/styles.js +167 -0
  101. package/build/components/Pages/Deposit/styles.js.map +1 -0
  102. package/build/components/Pages/Deposit/useDepositRoute.d.ts +34 -0
  103. package/build/components/Pages/Deposit/useDepositRoute.js +106 -0
  104. package/build/components/Pages/Deposit/useDepositRoute.js.map +1 -0
  105. package/build/components/Pages/Deposit/useFundingTarget.d.ts +11 -0
  106. package/build/components/Pages/Deposit/useFundingTarget.js +25 -0
  107. package/build/components/Pages/Deposit/useFundingTarget.js.map +1 -0
  108. package/build/components/Pages/DepositCex/index.d.ts +11 -0
  109. package/build/components/Pages/DepositCex/index.js +229 -0
  110. package/build/components/Pages/DepositCex/index.js.map +1 -0
  111. package/build/components/Pages/DepositCrypto/index.d.ts +8 -0
  112. package/build/components/Pages/DepositCrypto/index.js +31 -0
  113. package/build/components/Pages/DepositCrypto/index.js.map +1 -0
  114. package/build/components/Pages/DepositWallet/DepositWalletDesktop.d.ts +20 -0
  115. package/build/components/Pages/DepositWallet/DepositWalletDesktop.js +139 -0
  116. package/build/components/Pages/DepositWallet/DepositWalletDesktop.js.map +1 -0
  117. package/build/components/Pages/DepositWallet/index.d.ts +9 -0
  118. package/build/components/Pages/DepositWallet/index.js +107 -0
  119. package/build/components/Pages/DepositWallet/index.js.map +1 -0
  120. package/build/components/Pages/DepositWallet/walletDeeplinks.d.ts +50 -0
  121. package/build/components/Pages/DepositWallet/walletDeeplinks.js +109 -0
  122. package/build/components/Pages/DepositWallet/walletDeeplinks.js.map +1 -0
  123. package/build/components/Pages/ExportKey/index.js +10 -2
  124. package/build/components/Pages/ExportKey/index.js.map +1 -1
  125. package/build/components/Pages/NoAssetsAvailable/index.js +5 -21
  126. package/build/components/Pages/NoAssetsAvailable/index.js.map +1 -1
  127. package/build/components/Pages/SelectToken/SolanaSelectToken.d.ts +1 -0
  128. package/build/components/Pages/SelectToken/SolanaSelectToken.js +50 -0
  129. package/build/components/Pages/SelectToken/SolanaSelectToken.js.map +1 -0
  130. package/build/components/Pages/SelectToken/index.js +13 -2
  131. package/build/components/Pages/SelectToken/index.js.map +1 -1
  132. package/build/components/Pages/SelectToken/styles.js +1 -1
  133. package/build/components/Pages/Send/SolanaSend.d.ts +1 -0
  134. package/build/components/Pages/Send/SolanaSend.js +89 -0
  135. package/build/components/Pages/Send/SolanaSend.js.map +1 -0
  136. package/build/components/Pages/Send/index.d.ts +2 -1
  137. package/build/components/Pages/Send/index.js +0 -1
  138. package/build/components/Pages/Send/index.js.map +1 -1
  139. package/build/components/Pages/Send/utils.js +4 -1
  140. package/build/components/Pages/Send/utils.js.map +1 -1
  141. package/build/components/Pages/SendConfirmation/EstimatedFees.js +5 -3
  142. package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -1
  143. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.d.ts +1 -0
  144. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js +121 -0
  145. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js.map +1 -0
  146. package/build/components/Pages/SendConfirmation/index.js +4 -3
  147. package/build/components/Pages/SendConfirmation/index.js.map +1 -1
  148. package/build/constants/logos.js +1 -0
  149. package/build/constants/logos.js.map +1 -1
  150. package/build/ethereum/hooks/useEthereumWalletAssets.js +212 -95
  151. package/build/ethereum/hooks/useEthereumWalletAssets.js.map +1 -1
  152. package/build/hooks/openfort/fundingClient.d.ts +34 -0
  153. package/build/hooks/openfort/fundingClient.js +60 -0
  154. package/build/hooks/openfort/fundingClient.js.map +1 -0
  155. package/build/hooks/openfort/useFunding.d.ts +159 -0
  156. package/build/hooks/openfort/useFunding.js +204 -0
  157. package/build/hooks/openfort/useFunding.js.map +1 -0
  158. package/build/hooks/openfort/useFundingChains.d.ts +49 -0
  159. package/build/hooks/openfort/useFundingChains.js +100 -0
  160. package/build/hooks/openfort/useFundingChains.js.map +1 -0
  161. package/build/hooks/useBalance.js +6 -1
  162. package/build/hooks/useBalance.js.map +1 -1
  163. package/build/index.d.ts +4 -1
  164. package/build/index.js +2 -1
  165. package/build/index.js.map +1 -1
  166. package/build/shared/hooks/useAsyncData.d.ts +11 -0
  167. package/build/shared/hooks/useAsyncData.js +73 -13
  168. package/build/shared/hooks/useAsyncData.js.map +1 -1
  169. package/build/solana/hooks/useSolanaWalletAssets.d.ts +24 -0
  170. package/build/solana/hooks/useSolanaWalletAssets.js +86 -0
  171. package/build/solana/hooks/useSolanaWalletAssets.js.map +1 -0
  172. package/build/solana/transfer.d.ts +61 -0
  173. package/build/solana/transfer.js +219 -0
  174. package/build/solana/transfer.js.map +1 -0
  175. package/build/solana/types.d.ts +8 -0
  176. package/build/utils/index.d.ts +2 -1
  177. package/build/utils/index.js +1 -1
  178. package/build/version.d.ts +1 -1
  179. package/build/version.js +1 -1
  180. package/build/wagmi/defaultConnectors.js +5 -1
  181. package/build/wagmi/defaultConnectors.js.map +1 -1
  182. package/package.json +13 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteSelectors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * CAIP-2 chains the CEX rail (Coinbase Onramp "send") can deliver to, with their
3
+ * display names. Single source of truth shared by the cex pay-link page
4
+ * (DepositCex) and the exchange-withdraw source filter (useDepositRoute), so a
5
+ * new deliverable chain is added in one place.
6
+ */
7
+ export declare const CEX_CHAIN_NAMES: Record<string, string>;
8
+ /** Whether the CEX rail can deliver to the given CAIP-2 chain. */
9
+ export declare function isCexDeliverable(chain: string): boolean;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * CAIP-2 chains the CEX rail (Coinbase Onramp "send") can deliver to, with their
3
+ * display names. Single source of truth shared by the cex pay-link page
4
+ * (DepositCex) and the exchange-withdraw source filter (useDepositRoute), so a
5
+ * new deliverable chain is added in one place.
6
+ */
7
+ const CEX_CHAIN_NAMES = {
8
+ 'eip155:1': 'Ethereum',
9
+ 'eip155:10': 'Optimism',
10
+ 'eip155:137': 'Polygon',
11
+ 'eip155:8453': 'Base',
12
+ 'eip155:42161': 'Arbitrum',
13
+ 'eip155:43114': 'Avalanche',
14
+ 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': 'Solana',
15
+ };
16
+ const CEX_CHAINS = new Set(Object.keys(CEX_CHAIN_NAMES));
17
+ /** Whether the CEX rail can deliver to the given CAIP-2 chain. */
18
+ function isCexDeliverable(chain) {
19
+ return CEX_CHAINS.has(chain);
20
+ }
21
+
22
+ export { CEX_CHAIN_NAMES, isCexDeliverable };
23
+ //# sourceMappingURL=cexChains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cexChains.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import type { CSSProperties } from 'react';
2
+ /** Shared inline styles for the Deposit crypto/exchange forms (ConnectKit CSS vars). */
3
+ export declare const field: CSSProperties;
4
+ /** Deposit address — kept to a single line so the full address reads cleanly. */
5
+ export declare const codeStyle: CSSProperties;
6
+ /** "Your deposit address" label above the address box. */
7
+ export declare const depositAddressLabel: CSSProperties;
8
+ /** Shadow card around the deposit address + copy button. */
9
+ export declare const addressBox: CSSProperties;
10
+ /** "── or ──" separator between the scan/copy path and the open-wallet path. */
11
+ export declare const orRow: CSSProperties;
12
+ export declare const orLine: CSSProperties;
13
+ export declare const orText: CSSProperties;
14
+ /** Chain + token selectors side by side. */
15
+ export declare const twoCol: CSSProperties;
16
+ /** Full-width wallet row for the one-column "Transfer from wallet" deeplink list. */
17
+ export declare const walletListBtn: CSSProperties;
18
+ /** Collapsible "Details" panel (min / fee / processing / max). */
19
+ export declare const detailsBox: CSSProperties;
20
+ export declare const detailsToggle: CSSProperties;
21
+ export declare const detailsRow: CSSProperties;
22
+ export declare const detailsLabel: CSSProperties;
23
+ export declare const detailsValue: CSSProperties;
24
+ export declare const chevron: CSSProperties;
@@ -0,0 +1,83 @@
1
+ /** Shared inline styles for the Deposit crypto/exchange forms (ConnectKit CSS vars). */
2
+ const field = { display: 'grid', gap: 6, fontSize: 13, textAlign: 'left' };
3
+ /** Deposit address — kept to a single line so the full address reads cleanly. */
4
+ const codeStyle = {
5
+ flex: 1,
6
+ minWidth: 0,
7
+ fontSize: 12,
8
+ fontFamily: 'monospace',
9
+ whiteSpace: 'nowrap',
10
+ overflow: 'hidden',
11
+ textAlign: 'center',
12
+ };
13
+ /** "Your deposit address" label above the address box. */
14
+ const depositAddressLabel = {
15
+ marginTop: 14,
16
+ fontSize: 13,
17
+ fontWeight: 600,
18
+ textAlign: 'left',
19
+ color: 'var(--ck-body-color, #1a1a2e)',
20
+ };
21
+ /** Shadow card around the deposit address + copy button. */
22
+ const addressBox = {
23
+ display: 'flex',
24
+ alignItems: 'center',
25
+ justifyContent: 'center',
26
+ gap: 8,
27
+ marginTop: 6,
28
+ padding: '12px 14px',
29
+ borderRadius: 12,
30
+ background: 'var(--ck-body-background, #fff)',
31
+ border: '1px solid var(--ck-body-divider, #ededed)',
32
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.06)',
33
+ };
34
+ /** "── or ──" separator between the scan/copy path and the open-wallet path. */
35
+ const orRow = { display: 'flex', alignItems: 'center', gap: 10, margin: '16px 0 4px' };
36
+ const orLine = { flex: 1, height: 1, background: 'var(--ck-body-divider, #ededed)' };
37
+ const orText = { fontSize: 12, fontWeight: 500, color: 'var(--ck-body-color-muted, #6b7280)' };
38
+ /** Chain + token selectors side by side. */
39
+ const twoCol = { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10, marginTop: 12 };
40
+ /** Full-width wallet row for the one-column "Transfer from wallet" deeplink list. */
41
+ const walletListBtn = {
42
+ display: 'block',
43
+ width: '100%',
44
+ boxSizing: 'border-box',
45
+ textAlign: 'center',
46
+ padding: '14px 16px',
47
+ borderRadius: 10,
48
+ fontSize: 14,
49
+ fontWeight: 600,
50
+ textDecoration: 'none',
51
+ background: 'var(--ck-secondary-button-background, #f3f3f5)',
52
+ color: 'var(--ck-body-color, #1a1a2e)',
53
+ border: '1px solid var(--ck-body-divider, #e4e4e7)',
54
+ };
55
+ /** Collapsible "Details" panel (min / fee / processing / max). */
56
+ const detailsBox = {
57
+ marginTop: 14,
58
+ };
59
+ const detailsToggle = {
60
+ display: 'flex',
61
+ alignItems: 'center',
62
+ justifyContent: 'space-between',
63
+ width: '100%',
64
+ background: 'transparent',
65
+ border: 'none',
66
+ cursor: 'pointer',
67
+ padding: '6px 0',
68
+ color: 'var(--ck-body-color, #1a1a2e)',
69
+ fontSize: 14,
70
+ fontWeight: 600,
71
+ };
72
+ const detailsRow = {
73
+ display: 'flex',
74
+ justifyContent: 'space-between',
75
+ padding: '4px 0',
76
+ fontSize: 13,
77
+ };
78
+ const detailsLabel = { color: 'var(--ck-body-color-muted, #6b7280)' };
79
+ const detailsValue = { color: 'var(--ck-body-color, #1a1a2e)' };
80
+ const chevron = { color: 'var(--ck-body-color-muted, #6b7280)', fontSize: 12 };
81
+
82
+ export { addressBox, chevron, codeStyle, depositAddressLabel, detailsBox, detailsLabel, detailsRow, detailsToggle, detailsValue, field, orLine, orRow, orText, twoCol, walletListBtn };
83
+ //# sourceMappingURL=formStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formStyles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Deposit hub — one entry point, a method selector. Each row shows an action
3
+ * icon on the left and the tokens/wallets/exchanges it covers on the right.
4
+ * Crypto/CEX route into the funding-session Pages; fiat rows reuse the Buy flow.
5
+ */
6
+ declare const Deposit: () => import("react/jsx-runtime").JSX.Element;
7
+ export default Deposit;
@@ -0,0 +1,114 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { ChainTypeEnum } from '@openfort/openfort-js';
3
+ import { DollarIcon, BuyIcon, WalletIcon, ReceiveIcon, ExternalLinkIcon } from '../../../assets/icons.js';
4
+ import Logos from '../../../assets/logos.js';
5
+ import { useFunding } from '../../../hooks/openfort/useFunding.js';
6
+ import { useFundingChains } from '../../../hooks/openfort/useFundingChains.js';
7
+ import useIsMobile from '../../../hooks/useIsMobile.js';
8
+ import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
9
+ import { ModalHeading } from '../../Common/Modal/styles.js';
10
+ import PoweredByFooter from '../../Common/PoweredByFooter/index.js';
11
+ import { FundingMethod, routes } from '../../Openfort/types.js';
12
+ import { useOpenfort } from '../../Openfort/useOpenfort.js';
13
+ import { PageContent } from '../../PageContent/index.js';
14
+ import { EVM_BUY_CURRENCIES } from '../Buy/evmCurrencies.js';
15
+ import { SOLANA_BUY_CURRENCIES } from '../Buy/solanaCurrencies.js';
16
+ import { getPaymentOptions } from './paymentOptions.js';
17
+ import { DepositContent, OptionList, OptionButton, OptionLeft, OptionIconBadge, OptionInfo, OptionTitle, OptionSubtitle, LogoCluster } from './styles.js';
18
+
19
+ /** The action icon shown in each row's left badge (icons default to 20×20). */
20
+ const METHOD_ICON = {
21
+ [FundingMethod.APPLE_PAY]: jsx(DollarIcon, {}),
22
+ [FundingMethod.CARD]: jsx(BuyIcon, {}),
23
+ [FundingMethod.WALLET]: jsx(WalletIcon, {}),
24
+ [FundingMethod.ADDRESS]: jsx(ReceiveIcon, {}),
25
+ [FundingMethod.EXCHANGE]: jsx(ExternalLinkIcon, {}),
26
+ };
27
+ /** Brand logos previewed on the right of each row (vendored SVGs, no external URLs). */
28
+ const BRAND_LOGOS = {
29
+ [FundingMethod.WALLET]: [
30
+ jsx(Logos.MetaMask, { background: true }, "mm"),
31
+ jsx(Logos.Phantom, { background: true }, "ph"),
32
+ jsx(Logos.Coinbase, { background: true }, "cb"),
33
+ jsx(Logos.Trust, {}, "tw"),
34
+ jsx(Logos.Rainbow, { round: true }, "rb"),
35
+ ],
36
+ [FundingMethod.EXCHANGE]: [jsx(Logos.Coinbase, { background: true }, "cb"), jsx(Logos.Binance, {}, "bn")],
37
+ [FundingMethod.CARD]: [jsx(Logos.Visa, {}, "visa"), jsx(Logos.Mastercard, {}, "mc")],
38
+ [FundingMethod.APPLE_PAY]: [jsx(Logos.Apple, {}, "apple")],
39
+ };
40
+ const hideBrokenLogo = (e) => {
41
+ e.currentTarget.style.display = 'none';
42
+ };
43
+ /**
44
+ * Deposit hub — one entry point, a method selector. Each row shows an action
45
+ * icon on the left and the tokens/wallets/exchanges it covers on the right.
46
+ * Crypto/CEX route into the funding-session Pages; fiat rows reuse the Buy flow.
47
+ */
48
+ const Deposit = () => {
49
+ var _a;
50
+ const { setRoute, setBuyForm, uiConfig } = useOpenfort();
51
+ const { chainType } = useOpenfortCore();
52
+ const isMobile = useIsMobile();
53
+ const { isAvailable } = useFunding();
54
+ const { chains } = useFundingChains();
55
+ const options = getPaymentOptions({
56
+ isMobile,
57
+ fundingAvailable: isAvailable,
58
+ methods: (_a = uiConfig.funding) === null || _a === void 0 ? void 0 : _a.methods,
59
+ });
60
+ // Distinct source-currency logos (USDC, USDT, ETH, …) for the "from address" row.
61
+ const currencyLogos = [];
62
+ const seenSymbols = new Set();
63
+ for (const c of chains) {
64
+ for (const cur of c.currencies) {
65
+ if (cur.logo && !seenSymbols.has(cur.symbol)) {
66
+ seenSymbols.add(cur.symbol);
67
+ currencyLogos.push(cur.logo);
68
+ }
69
+ }
70
+ }
71
+ // Keep the preview compact: at most 4 logos (fewer on mobile).
72
+ const maxLogos = isMobile ? 3 : 4;
73
+ /** The logos to preview on the right of a row. */
74
+ const clusterFor = (id) => {
75
+ var _a;
76
+ if (id === FundingMethod.ADDRESS) {
77
+ return currencyLogos.slice(0, maxLogos).map((src) => jsx("img", { src: src, alt: "", onError: hideBrokenLogo }, src));
78
+ }
79
+ return ((_a = BRAND_LOGOS[id]) !== null && _a !== void 0 ? _a : []).slice(0, maxLogos);
80
+ };
81
+ const go = (target) => {
82
+ if (target.kind === 'crypto') {
83
+ setRoute(routes.DEPOSIT_CRYPTO);
84
+ return;
85
+ }
86
+ if (target.kind === 'wallet') {
87
+ setRoute(routes.DEPOSIT_WALLET);
88
+ return;
89
+ }
90
+ if (target.kind === 'cex') {
91
+ setRoute(routes.DEPOSIT_CEX);
92
+ return;
93
+ }
94
+ // Fiat rails reuse the existing Buy flow; preselect the chosen provider so
95
+ // Apple Pay / Card land on the right rail.
96
+ setBuyForm((prev) => ({
97
+ ...prev,
98
+ providerId: target.providerId,
99
+ // Default the card-buy to USDC per chain family. Without this the EVM default
100
+ // resolves to the wallet's (often empty) asset list — "no supported tokens" —
101
+ // and the Solana native default would resolve to SOL (isSameToken treats any
102
+ // two natives as equal).
103
+ asset: chainType === ChainTypeEnum.SVM ? SOLANA_BUY_CURRENCIES[0] : EVM_BUY_CURRENCIES[0],
104
+ }));
105
+ setRoute(routes.BUY);
106
+ };
107
+ return (jsxs(PageContent, { onBack: routes.CONNECTED, children: [jsx(ModalHeading, { children: "Add funds" }), jsx(DepositContent, { children: jsx(OptionList, { children: options.map((option) => {
108
+ var _a;
109
+ return (jsxs(OptionButton, { type: "button", disabled: option.disabled, onClick: () => go(option.target), children: [jsxs(OptionLeft, { children: [jsx(OptionIconBadge, { children: METHOD_ICON[option.id] }), jsxs(OptionInfo, { children: [jsx(OptionTitle, { children: option.title }), jsx(OptionSubtitle, { children: (_a = option.disabledReason) !== null && _a !== void 0 ? _a : option.subtitle })] })] }), jsx(LogoCluster, { children: clusterFor(option.id) })] }, option.id));
110
+ }) }) }), jsx(PoweredByFooter, {})] }));
111
+ };
112
+
113
+ export { Deposit as default };
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,49 @@
1
+ import { type BuyProviderId, FundingMethod } from '../../Openfort/types';
2
+ /**
3
+ * What a row routes into:
4
+ * - `buy`: the existing fiat onramp flow, with a rail (provider) preselected.
5
+ * - `crypto` / `wallet` / `cex`: the new funding-session Pages.
6
+ */
7
+ export type DepositMethodTarget = {
8
+ kind: 'buy';
9
+ providerId: BuyProviderId;
10
+ } | {
11
+ kind: 'crypto';
12
+ } | {
13
+ kind: 'wallet';
14
+ } | {
15
+ kind: 'cex';
16
+ };
17
+ type DepositMethod = {
18
+ id: FundingMethod;
19
+ title: string;
20
+ /** Speed/fee hint, e.g. "instant, ~4% fee". */
21
+ subtitle: string;
22
+ target: DepositMethodTarget;
23
+ /** Only show on mobile devices (e.g. Apple Pay). */
24
+ mobileOnly?: boolean;
25
+ };
26
+ /** Context used to order/filter the rows for the current device. */
27
+ type PaymentOptionsContext = {
28
+ isMobile: boolean;
29
+ /** When the funding backend is unavailable, crypto/CEX rows are disabled. */
30
+ fundingAvailable: boolean;
31
+ /**
32
+ * Integrator-selected methods, in display order. When set, only these show
33
+ * (still subject to device/availability gating). Omit to show all.
34
+ */
35
+ methods?: FundingMethod[];
36
+ };
37
+ /** A row ready to render: resolved order, plus disabled state + reason. */
38
+ type ResolvedDepositOption = DepositMethod & {
39
+ disabled: boolean;
40
+ disabledReason?: string;
41
+ };
42
+ /**
43
+ * Resolve the deposit rows for the current context: pick the integrator's
44
+ * `methods` (or all) in order, filter device-incompatible rails, default-order
45
+ * Apple Pay first on mobile when the order isn't explicit, and mark disabled
46
+ * rows with a reason.
47
+ */
48
+ export declare function getPaymentOptions(ctx: PaymentOptionsContext): ResolvedDepositOption[];
49
+ export {};
@@ -0,0 +1,63 @@
1
+ import { FundingMethod } from '../../Openfort/types.js';
2
+
3
+ const ALL_METHODS = [
4
+ {
5
+ id: FundingMethod.APPLE_PAY,
6
+ title: 'Apple Pay',
7
+ subtitle: 'No min · ~3.5% fee · Instant',
8
+ target: { kind: 'buy', providerId: 'stripe' },
9
+ mobileOnly: true,
10
+ },
11
+ {
12
+ id: FundingMethod.CARD,
13
+ title: 'Card',
14
+ subtitle: 'Min $10 · ~4% fee · Instant',
15
+ target: { kind: 'buy', providerId: 'stripe' },
16
+ },
17
+ {
18
+ id: FundingMethod.WALLET,
19
+ title: 'Transfer from wallet',
20
+ subtitle: 'Min $1 · Bridge fee · 10 sec',
21
+ target: { kind: 'wallet' },
22
+ },
23
+ {
24
+ id: FundingMethod.ADDRESS,
25
+ title: 'Transfer from address',
26
+ subtitle: 'Min $1 · Bridge fee · 10 sec',
27
+ target: { kind: 'crypto' },
28
+ },
29
+ {
30
+ id: FundingMethod.EXCHANGE,
31
+ title: 'Transfer from Exchange',
32
+ subtitle: 'Min $5 · Network fee · 2 min',
33
+ target: { kind: 'cex' },
34
+ },
35
+ ];
36
+ /**
37
+ * Resolve the deposit rows for the current context: pick the integrator's
38
+ * `methods` (or all) in order, filter device-incompatible rails, default-order
39
+ * Apple Pay first on mobile when the order isn't explicit, and mark disabled
40
+ * rows with a reason.
41
+ */
42
+ function getPaymentOptions(ctx) {
43
+ const explicitMethods = ctx.methods && ctx.methods.length > 0 ? ctx.methods : null;
44
+ const byId = new Map(ALL_METHODS.map((m) => [m.id, m]));
45
+ const base = explicitMethods
46
+ ? explicitMethods.map((id) => byId.get(id)).filter((m) => m !== undefined)
47
+ : ALL_METHODS;
48
+ const visible = base.filter((m) => (m.mobileOnly ? ctx.isMobile : true));
49
+ // Honor the integrator's explicit order; otherwise float Apple Pay first on mobile.
50
+ const ordered = !explicitMethods && ctx.isMobile
51
+ ? [...visible].sort((a, b) => Number(b.id === FundingMethod.APPLE_PAY) - Number(a.id === FundingMethod.APPLE_PAY))
52
+ : visible;
53
+ return ordered.map((method) => {
54
+ const fundingRail = method.target.kind === 'crypto' || method.target.kind === 'wallet' || method.target.kind === 'cex';
55
+ if (fundingRail && !ctx.fundingAvailable) {
56
+ return { ...method, disabled: true, disabledReason: 'Coming soon' };
57
+ }
58
+ return { ...method, disabled: false };
59
+ });
60
+ }
61
+
62
+ export { getPaymentOptions };
63
+ //# sourceMappingURL=paymentOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentOptions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Funding destination defaults + small formatting helpers. The source chain/token
3
+ * registry is no longer hardcoded here — it's fetched live from Relay via
4
+ * `useFundingChains`.
5
+ */
6
+ /** Destination default: USDC on Base (used when the integrator doesn't override). */
7
+ export declare const DEST_CHAIN = "eip155:8453";
8
+ export declare const DEST_USDC = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
9
+ /**
10
+ * Solana destination default: USDC on Solana mainnet, used for SVM wallets when the
11
+ * integrator doesn't override. The chain id must match the Solana entry in
12
+ * {@link DEFAULT_SOURCE_CHAINS} so a same-chain selection resolves to the wallet address.
13
+ */
14
+ export declare const DEST_CHAIN_SOL = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
15
+ export declare const DEST_USDC_SOL = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
16
+ /** True for a CAIP-2 Solana chain id. */
17
+ export declare function isSolana(chain: string): boolean;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Funding destination defaults + small formatting helpers. The source chain/token
3
+ * registry is no longer hardcoded here — it's fetched live from Relay via
4
+ * `useFundingChains`.
5
+ */
6
+ /** Destination default: USDC on Base (used when the integrator doesn't override). */
7
+ const DEST_CHAIN = 'eip155:8453';
8
+ const DEST_USDC = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
9
+ /**
10
+ * Solana destination default: USDC on Solana mainnet, used for SVM wallets when the
11
+ * integrator doesn't override. The chain id must match the Solana entry in
12
+ * {@link DEFAULT_SOURCE_CHAINS} so a same-chain selection resolves to the wallet address.
13
+ */
14
+ const DEST_CHAIN_SOL = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp';
15
+ const DEST_USDC_SOL = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
16
+ /** True for a CAIP-2 Solana chain id. */
17
+ function isSolana(chain) {
18
+ return chain.startsWith('solana:');
19
+ }
20
+
21
+ export { DEST_CHAIN, DEST_CHAIN_SOL, DEST_USDC, DEST_USDC_SOL, isSolana };
22
+ //# sourceMappingURL=sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,25 @@
1
+ /** Sizes to the content so short method lists don't leave a cut-looking gap. */
2
+ export declare const DepositContent: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ /** Separates the chain/currency step (above) from the action buttons (below). */
4
+ export declare const StepDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ /** Sizes a brand logo (svg/img) to 20px for use inside wallet/exchange buttons. */
6
+ export declare const ButtonLogo: import("styled-components").StyledComponent<"span", any, {}, never>;
7
+ /** Loading placeholder block. */
8
+ export declare const Skeleton: import("styled-components").StyledComponent<"div", any, {
9
+ $w?: string;
10
+ $h?: string;
11
+ $r?: string;
12
+ }, never>;
13
+ export declare const OptionList: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export declare const OptionButton: import("styled-components").StyledComponent<"button", any, {}, never>;
15
+ /** Left group: action icon badge + the title/subtitle text. */
16
+ export declare const OptionLeft: import("styled-components").StyledComponent<"div", any, {}, never>;
17
+ /** Holds the per-action icon on the left of each row (no background). */
18
+ export declare const OptionIconBadge: import("styled-components").StyledComponent<"div", any, {}, never>;
19
+ /** Overlapping strip of token/wallet/exchange logos on the right of each row. */
20
+ export declare const LogoCluster: import("styled-components").StyledComponent<"div", any, {}, never>;
21
+ export declare const OptionInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
22
+ export declare const OptionTitle: import("styled-components").StyledComponent<"span", any, {}, never>;
23
+ export declare const OptionSubtitle: import("styled-components").StyledComponent<"span", any, {}, never>;
24
+ /** Sized, centered wrapper so the QR (which sizes off its parent width) renders. */
25
+ export declare const QRWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,167 @@
1
+ import { keyframes } from 'styled-components';
2
+ import styled from '../../../styles/styled/index.js';
3
+
4
+ /** Sizes to the content so short method lists don't leave a cut-looking gap. */
5
+ const DepositContent = styled.div `
6
+ display: flex;
7
+ flex-direction: column;
8
+ `;
9
+ const pulse = keyframes `
10
+ 0%, 100% { opacity: 1; }
11
+ 50% { opacity: 0.45; }
12
+ `;
13
+ /** Separates the chain/currency step (above) from the action buttons (below). */
14
+ const StepDivider = styled.div `
15
+ margin-top: 20px;
16
+ padding-top: 14px;
17
+ border-top: 1px solid var(--ck-body-divider, #ededed);
18
+ font-size: 11px;
19
+ font-weight: 600;
20
+ text-transform: uppercase;
21
+ letter-spacing: 0.4px;
22
+ color: var(--ck-body-color-muted, #6b7280);
23
+ `;
24
+ /** Sizes a brand logo (svg/img) to 20px for use inside wallet/exchange buttons. */
25
+ const ButtonLogo = styled.span `
26
+ display: inline-flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ flex-shrink: 0;
30
+
31
+ svg,
32
+ img {
33
+ width: 20px;
34
+ height: 20px;
35
+ border-radius: 50%;
36
+ }
37
+ `;
38
+ /** Loading placeholder block. */
39
+ const Skeleton = styled.div `
40
+ width: ${(p) => { var _a; return (_a = p.$w) !== null && _a !== void 0 ? _a : '100%'; }};
41
+ height: ${(p) => { var _a; return (_a = p.$h) !== null && _a !== void 0 ? _a : '16px'; }};
42
+ border-radius: ${(p) => { var _a; return (_a = p.$r) !== null && _a !== void 0 ? _a : '8px'; }};
43
+ background: var(--ck-body-divider, #ededed);
44
+ animation: ${pulse} 1.4s ease-in-out infinite;
45
+ `;
46
+ const OptionList = styled.div `
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: 8px;
50
+ margin-top: 12px;
51
+ `;
52
+ const OptionButton = styled.button `
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: space-between;
56
+ width: 100%;
57
+ min-height: 52px;
58
+ box-sizing: border-box;
59
+ padding: 10px 14px;
60
+ border-radius: var(--ck-secondary-button-border-radius);
61
+ border: 1px solid var(--ck-body-divider);
62
+ background: var(--ck-secondary-button-background);
63
+ color: var(--ck-body-color);
64
+ cursor: pointer;
65
+ transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
66
+ text-align: left;
67
+
68
+ &:hover:not(:disabled) {
69
+ background: var(--ck-secondary-button-hover-background);
70
+ border-color: var(--ck-body-color-muted);
71
+ }
72
+
73
+ &:disabled {
74
+ opacity: 0.5;
75
+ cursor: not-allowed;
76
+ }
77
+ `;
78
+ /** Left group: action icon badge + the title/subtitle text. */
79
+ const OptionLeft = styled.div `
80
+ display: flex;
81
+ align-items: center;
82
+ gap: 12px;
83
+ min-width: 0;
84
+ `;
85
+ /** Holds the per-action icon on the left of each row (no background). */
86
+ const OptionIconBadge = styled.div `
87
+ flex-shrink: 0;
88
+ width: 28px;
89
+ height: 28px;
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ color: var(--ck-body-color, #1a1a2e);
94
+ `;
95
+ /** Overlapping strip of token/wallet/exchange logos on the right of each row. */
96
+ const LogoCluster = styled.div `
97
+ display: flex;
98
+ flex-shrink: 0;
99
+ align-items: center;
100
+ padding-left: 2px;
101
+
102
+ img,
103
+ svg {
104
+ width: 18px;
105
+ height: 18px;
106
+ border-radius: 50%;
107
+ margin-left: -7px;
108
+ border: 1.5px solid var(--ck-secondary-button-background, #fff);
109
+ background: var(--ck-body-background, #fff);
110
+ object-fit: cover;
111
+ box-sizing: content-box;
112
+ }
113
+ img:first-child,
114
+ svg:first-child {
115
+ margin-left: 0;
116
+ }
117
+
118
+ @media (max-width: 420px) {
119
+ padding-left: 2px;
120
+ img,
121
+ svg {
122
+ width: 16px;
123
+ height: 16px;
124
+ }
125
+ }
126
+ `;
127
+ const OptionInfo = styled.div `
128
+ display: flex;
129
+ flex-direction: column;
130
+ gap: 4px;
131
+ overflow: hidden;
132
+ `;
133
+ const OptionTitle = styled.span `
134
+ font-size: 14px;
135
+ font-weight: 600;
136
+ color: var(--ck-body-color);
137
+
138
+ @media (max-width: 420px) {
139
+ font-size: 13px;
140
+ }
141
+ `;
142
+ const OptionSubtitle = styled.span `
143
+ font-size: 11px;
144
+ font-weight: 500;
145
+ color: var(--ck-body-color-muted);
146
+ white-space: nowrap;
147
+ overflow: hidden;
148
+ text-overflow: clip;
149
+
150
+ @media (max-width: 420px) {
151
+ font-size: 10px;
152
+ }
153
+ `;
154
+ /** Sized, centered wrapper so the QR (which sizes off its parent width) renders. */
155
+ const QRWrapper = styled.div `
156
+ display: block;
157
+ margin: 14px auto;
158
+ width: 100%;
159
+ max-width: 300px;
160
+
161
+ > div {
162
+ width: 100%;
163
+ }
164
+ `;
165
+
166
+ export { ButtonLogo, DepositContent, LogoCluster, OptionButton, OptionIconBadge, OptionInfo, OptionLeft, OptionList, OptionSubtitle, OptionTitle, QRWrapper, Skeleton, StepDivider };
167
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}