@openfort/react 1.1.3 → 1.2.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 (154) hide show
  1. package/build/assets/icons.js +1 -1
  2. package/build/assets/logos.d.ts +12 -0
  3. package/build/assets/logos.js +7 -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/ConnectModal/index.js +14 -2
  15. package/build/components/ConnectModal/index.js.map +1 -1
  16. package/build/components/Openfort/OpenfortProvider.js +4 -1
  17. package/build/components/Openfort/OpenfortProvider.js.map +1 -1
  18. package/build/components/Openfort/types.d.ts +86 -0
  19. package/build/components/Openfort/types.js +22 -1
  20. package/build/components/Openfort/types.js.map +1 -1
  21. package/build/components/Pages/AssetInventory/SolanaAssetInventory.d.ts +6 -0
  22. package/build/components/Pages/AssetInventory/SolanaAssetInventory.js +42 -0
  23. package/build/components/Pages/AssetInventory/SolanaAssetInventory.js.map +1 -0
  24. package/build/components/Pages/Buy/index.js +3 -2
  25. package/build/components/Pages/Buy/index.js.map +1 -1
  26. package/build/components/Pages/BuySelectProvider/index.js +1 -1
  27. package/build/components/Pages/Connected/EthereumConnected.js +8 -32
  28. package/build/components/Pages/Connected/EthereumConnected.js.map +1 -1
  29. package/build/components/Pages/Connected/SolanaConnected.js +9 -4
  30. package/build/components/Pages/Connected/SolanaConnected.js.map +1 -1
  31. package/build/components/Pages/Deposit/AddressPageLink.d.ts +7 -0
  32. package/build/components/Pages/Deposit/AddressPageLink.js +17 -0
  33. package/build/components/Pages/Deposit/AddressPageLink.js.map +1 -0
  34. package/build/components/Pages/Deposit/AssetChainLogo.d.ts +9 -0
  35. package/build/components/Pages/Deposit/AssetChainLogo.js +24 -0
  36. package/build/components/Pages/Deposit/AssetChainLogo.js.map +1 -0
  37. package/build/components/Pages/Deposit/DepositAddressBlock.d.ts +21 -0
  38. package/build/components/Pages/Deposit/DepositAddressBlock.js +28 -0
  39. package/build/components/Pages/Deposit/DepositAddressBlock.js.map +1 -0
  40. package/build/components/Pages/Deposit/DepositProgress.d.ts +15 -0
  41. package/build/components/Pages/Deposit/DepositProgress.js +110 -0
  42. package/build/components/Pages/Deposit/DepositProgress.js.map +1 -0
  43. package/build/components/Pages/Deposit/DepositStatus.d.ts +9 -0
  44. package/build/components/Pages/Deposit/DepositStatus.js +43 -0
  45. package/build/components/Pages/Deposit/DepositStatus.js.map +1 -0
  46. package/build/components/Pages/Deposit/DepositSuccess.d.ts +6 -0
  47. package/build/components/Pages/Deposit/DepositSuccess.js +24 -0
  48. package/build/components/Pages/Deposit/DepositSuccess.js.map +1 -0
  49. package/build/components/Pages/Deposit/Details.d.ts +12 -0
  50. package/build/components/Pages/Deposit/Details.js +40 -0
  51. package/build/components/Pages/Deposit/Details.js.map +1 -0
  52. package/build/components/Pages/Deposit/LogoSelect.d.ts +12 -0
  53. package/build/components/Pages/Deposit/LogoSelect.js +95 -0
  54. package/build/components/Pages/Deposit/LogoSelect.js.map +1 -0
  55. package/build/components/Pages/Deposit/OrDivider.d.ts +2 -0
  56. package/build/components/Pages/Deposit/OrDivider.js +10 -0
  57. package/build/components/Pages/Deposit/OrDivider.js.map +1 -0
  58. package/build/components/Pages/Deposit/RouteSelectors.d.ts +13 -0
  59. package/build/components/Pages/Deposit/RouteSelectors.js +19 -0
  60. package/build/components/Pages/Deposit/RouteSelectors.js.map +1 -0
  61. package/build/components/Pages/Deposit/cexChains.d.ts +9 -0
  62. package/build/components/Pages/Deposit/cexChains.js +23 -0
  63. package/build/components/Pages/Deposit/cexChains.js.map +1 -0
  64. package/build/components/Pages/Deposit/formStyles.d.ts +24 -0
  65. package/build/components/Pages/Deposit/formStyles.js +83 -0
  66. package/build/components/Pages/Deposit/formStyles.js.map +1 -0
  67. package/build/components/Pages/Deposit/index.d.ts +7 -0
  68. package/build/components/Pages/Deposit/index.js +100 -0
  69. package/build/components/Pages/Deposit/index.js.map +1 -0
  70. package/build/components/Pages/Deposit/paymentOptions.d.ts +49 -0
  71. package/build/components/Pages/Deposit/paymentOptions.js +63 -0
  72. package/build/components/Pages/Deposit/paymentOptions.js.map +1 -0
  73. package/build/components/Pages/Deposit/sources.d.ts +17 -0
  74. package/build/components/Pages/Deposit/sources.js +22 -0
  75. package/build/components/Pages/Deposit/sources.js.map +1 -0
  76. package/build/components/Pages/Deposit/styles.d.ts +25 -0
  77. package/build/components/Pages/Deposit/styles.js +167 -0
  78. package/build/components/Pages/Deposit/styles.js.map +1 -0
  79. package/build/components/Pages/Deposit/useDepositRoute.d.ts +35 -0
  80. package/build/components/Pages/Deposit/useDepositRoute.js +107 -0
  81. package/build/components/Pages/Deposit/useDepositRoute.js.map +1 -0
  82. package/build/components/Pages/Deposit/useFundingTarget.d.ts +13 -0
  83. package/build/components/Pages/Deposit/useFundingTarget.js +27 -0
  84. package/build/components/Pages/Deposit/useFundingTarget.js.map +1 -0
  85. package/build/components/Pages/DepositCex/index.d.ts +11 -0
  86. package/build/components/Pages/DepositCex/index.js +230 -0
  87. package/build/components/Pages/DepositCex/index.js.map +1 -0
  88. package/build/components/Pages/DepositCrypto/index.d.ts +8 -0
  89. package/build/components/Pages/DepositCrypto/index.js +31 -0
  90. package/build/components/Pages/DepositCrypto/index.js.map +1 -0
  91. package/build/components/Pages/DepositWallet/DepositWalletDesktop.d.ts +17 -0
  92. package/build/components/Pages/DepositWallet/DepositWalletDesktop.js +148 -0
  93. package/build/components/Pages/DepositWallet/DepositWalletDesktop.js.map +1 -0
  94. package/build/components/Pages/DepositWallet/index.d.ts +9 -0
  95. package/build/components/Pages/DepositWallet/index.js +102 -0
  96. package/build/components/Pages/DepositWallet/index.js.map +1 -0
  97. package/build/components/Pages/DepositWallet/walletDeeplinks.d.ts +48 -0
  98. package/build/components/Pages/DepositWallet/walletDeeplinks.js +107 -0
  99. package/build/components/Pages/DepositWallet/walletDeeplinks.js.map +1 -0
  100. package/build/components/Pages/ExportKey/index.js +10 -2
  101. package/build/components/Pages/ExportKey/index.js.map +1 -1
  102. package/build/components/Pages/NoAssetsAvailable/index.js +5 -21
  103. package/build/components/Pages/NoAssetsAvailable/index.js.map +1 -1
  104. package/build/components/Pages/SelectToken/styles.js +1 -1
  105. package/build/components/Pages/Send/SolanaSend.d.ts +1 -0
  106. package/build/components/Pages/Send/SolanaSend.js +88 -0
  107. package/build/components/Pages/Send/SolanaSend.js.map +1 -0
  108. package/build/components/Pages/Send/index.d.ts +2 -1
  109. package/build/components/Pages/Send/index.js +0 -1
  110. package/build/components/Pages/Send/index.js.map +1 -1
  111. package/build/components/Pages/SendConfirmation/EstimatedFees.js +5 -3
  112. package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -1
  113. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.d.ts +1 -0
  114. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js +77 -0
  115. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js.map +1 -0
  116. package/build/components/Pages/SendConfirmation/index.js +4 -3
  117. package/build/components/Pages/SendConfirmation/index.js.map +1 -1
  118. package/build/components/Pages/SendConfirmation/styles.d.ts +5 -0
  119. package/build/components/Pages/SendConfirmation/styles.js +39 -1
  120. package/build/components/Pages/SendConfirmation/styles.js.map +1 -1
  121. package/build/constants/logos.js +1 -0
  122. package/build/constants/logos.js.map +1 -1
  123. package/build/ethereum/hooks/useEthereumWalletAssets.js +212 -95
  124. package/build/ethereum/hooks/useEthereumWalletAssets.js.map +1 -1
  125. package/build/hooks/openfort/fundingClient.d.ts +34 -0
  126. package/build/hooks/openfort/fundingClient.js +60 -0
  127. package/build/hooks/openfort/fundingClient.js.map +1 -0
  128. package/build/hooks/openfort/useFunding.d.ts +159 -0
  129. package/build/hooks/openfort/useFunding.js +204 -0
  130. package/build/hooks/openfort/useFunding.js.map +1 -0
  131. package/build/hooks/openfort/useFundingChains.d.ts +49 -0
  132. package/build/hooks/openfort/useFundingChains.js +102 -0
  133. package/build/hooks/openfort/useFundingChains.js.map +1 -0
  134. package/build/hooks/useBalance.js +6 -1
  135. package/build/hooks/useBalance.js.map +1 -1
  136. package/build/index.d.ts +4 -1
  137. package/build/index.js +2 -1
  138. package/build/index.js.map +1 -1
  139. package/build/shared/hooks/useAsyncData.d.ts +11 -0
  140. package/build/shared/hooks/useAsyncData.js +60 -13
  141. package/build/shared/hooks/useAsyncData.js.map +1 -1
  142. package/build/solana/hooks/useSolanaWalletAssets.d.ts +24 -0
  143. package/build/solana/hooks/useSolanaWalletAssets.js +86 -0
  144. package/build/solana/hooks/useSolanaWalletAssets.js.map +1 -0
  145. package/build/solana/transfer.d.ts +32 -0
  146. package/build/solana/transfer.js +125 -0
  147. package/build/solana/transfer.js.map +1 -0
  148. package/build/utils/index.d.ts +2 -1
  149. package/build/utils/index.js +1 -1
  150. package/build/version.d.ts +1 -1
  151. package/build/version.js +1 -1
  152. package/build/wagmi/defaultConnectors.js +5 -1
  153. package/build/wagmi/defaultConnectors.js.map +1 -1
  154. package/package.json +10 -2
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Send page router
3
3
  *
4
- * Picks EthereumSend or SolanaSend based on chainType.
4
+ * Renders the EVM send form. Solana is reached via the dedicated `sol:send`
5
+ * route (registered in ConnectModal), so it isn't in this shared registry.
5
6
  */
6
7
  import type React from 'react';
7
8
  declare const Send: React.FC;
@@ -5,7 +5,6 @@ import { EthereumSend } from './EthereumSend.js';
5
5
 
6
6
  const SEND_REGISTRY = {
7
7
  [ChainTypeEnum.EVM]: EthereumSend,
8
- // [ChainTypeEnum.SVM]: SolanaSend,
9
8
  };
10
9
  const Send = () => {
11
10
  const { chainType } = useOpenfortCore();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -5,6 +5,7 @@ import { useAsyncData } from '../../../shared/hooks/useAsyncData.js';
5
5
  import { logger } from '../../../utils/logger.js';
6
6
  import { getDefaultEthereumRpcUrl } from '../../../utils/rpc.js';
7
7
  import Tooltip from '../../Common/Tooltip/index.js';
8
+ import { useOpenfort } from '../../Openfort/useOpenfort.js';
8
9
  import { formatBalance } from '../Send/utils.js';
9
10
  import { InfoIconWrapper } from './styles.js';
10
11
 
@@ -17,16 +18,17 @@ const usdFormatter = new Intl.NumberFormat('en-US', {
17
18
  });
18
19
  const EstimatedFees = ({ account, to, value, data, chainId, nativeSymbol, enabled = true, hideInfoIcon = false, }) => {
19
20
  var _a, _b, _c;
21
+ const { walletConfig } = useOpenfort();
20
22
  const { data: assets } = useEthereumWalletAssets();
21
23
  const pricePerToken = (_c = (_b = (_a = assets === null || assets === void 0 ? void 0 : assets.find((a) => a.type === 'native')) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fiat) === null || _c === void 0 ? void 0 : _c.value;
22
24
  const gas = useAsyncData({
23
25
  queryKey: ['gas-estimate', account, to, value, data, chainId],
24
26
  queryFn: async () => {
25
- var _a;
27
+ var _a, _b, _c, _d;
26
28
  if (!account || !to || !chainId)
27
29
  return null;
28
30
  try {
29
- const rpcUrl = getDefaultEthereumRpcUrl(chainId);
31
+ const rpcUrl = (_c = (_b = (_a = walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.ethereum) === null || _a === void 0 ? void 0 : _a.rpcUrls) === null || _b === void 0 ? void 0 : _b[chainId]) !== null && _c !== void 0 ? _c : getDefaultEthereumRpcUrl(chainId);
30
32
  const publicClient = createPublicClient({ transport: http(rpcUrl) });
31
33
  const [gasEstimate, feesPerGas] = await Promise.all([
32
34
  publicClient.estimateGas({
@@ -37,7 +39,7 @@ const EstimatedFees = ({ account, to, value, data, chainId, nativeSymbol, enable
37
39
  }),
38
40
  publicClient.estimateFeesPerGas(),
39
41
  ]);
40
- const estimatedCost = gasEstimate * ((_a = feesPerGas.maxFeePerGas) !== null && _a !== void 0 ? _a : BigInt(0));
42
+ const estimatedCost = gasEstimate * ((_d = feesPerGas.maxFeePerGas) !== null && _d !== void 0 ? _d : BigInt(0));
41
43
  return { estimatedCost, gasLimit: gasEstimate };
42
44
  }
43
45
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"EstimatedFees.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"EstimatedFees.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export declare const SolanaSendConfirmation: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,77 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { ChainTypeEnum } from '@openfort/openfort-js';
3
+ import { useState, useEffect } from 'react';
4
+ import { getExplorerUrl } from '../../../shared/utils/explorer.js';
5
+ import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
6
+ import { sendSolGasless, sendSol } from '../../../solana/transfer.js';
7
+ import 'detect-browser';
8
+ import { truncateSolanaAddress } from '../../../utils/format.js';
9
+ import Button from '../../Common/Button/index.js';
10
+ import { CopyText } from '../../Common/CopyToClipboard/CopyText.js';
11
+ import Loader from '../../Common/Loading/index.js';
12
+ import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
13
+ import { routes } from '../../Openfort/types.js';
14
+ import { useOpenfort } from '../../Openfort/useOpenfort.js';
15
+ import { PageContent } from '../../PageContent/index.js';
16
+ import { ButtonRow, SummaryList, SummaryItem, SummaryLabel, AmountValue, AddressValue, GaslessRow, GaslessToggle, ErrorContainer, ErrorTitle, ErrorMessage } from './styles.js';
17
+
18
+ const SolanaSendConfirmation = () => {
19
+ var _a;
20
+ const { sendForm, setRoute, publishableKey, triggerResize } = useOpenfort();
21
+ const wallet = useSolanaEmbeddedWallet();
22
+ const address = wallet.status === 'connected' ? wallet.address : undefined;
23
+ const provider = wallet.status === 'connected' ? wallet.provider : undefined;
24
+ const cluster = (_a = wallet.cluster) !== null && _a !== void 0 ? _a : 'devnet';
25
+ const rpcUrl = wallet.rpcUrl;
26
+ const recipient = sendForm.recipient;
27
+ const amount = sendForm.amount;
28
+ const [gasless, setGasless] = useState(false);
29
+ const [isLoading, setIsLoading] = useState(false);
30
+ const [signature, setSignature] = useState(null);
31
+ const [error, setError] = useState(null);
32
+ // Re-measure the modal when the result/error appears.
33
+ useEffect(() => {
34
+ const id = setTimeout(triggerResize, 10);
35
+ return () => clearTimeout(id);
36
+ }, [signature, error, isLoading, triggerResize]);
37
+ const handleConfirm = async () => {
38
+ if (!address || !provider || isLoading)
39
+ return;
40
+ const amountSol = Number(amount);
41
+ if (!Number.isFinite(amountSol) || amountSol <= 0) {
42
+ setError('Enter a valid amount.');
43
+ return;
44
+ }
45
+ if (!gasless && !rpcUrl) {
46
+ setError('No Solana RPC is configured for this network.');
47
+ return;
48
+ }
49
+ setIsLoading(true);
50
+ setError(null);
51
+ try {
52
+ const sig = gasless
53
+ ? await sendSolGasless({ from: address, to: recipient, amountSol, provider, cluster, publishableKey })
54
+ : await sendSol({ from: address, to: recipient, amountSol, provider, rpcUrl: rpcUrl !== null && rpcUrl !== void 0 ? rpcUrl : '' });
55
+ setSignature(sig);
56
+ }
57
+ catch (err) {
58
+ setError(err instanceof Error ? err.message : 'Transaction failed');
59
+ }
60
+ finally {
61
+ setIsLoading(false);
62
+ }
63
+ };
64
+ const handleFinish = () => setRoute(routes.SOL_CONNECTED);
65
+ const handleViewExplorer = () => {
66
+ if (!signature)
67
+ return;
68
+ window.open(getExplorerUrl(ChainTypeEnum.SVM, { txHash: signature, cluster }), '_blank', 'noopener,noreferrer');
69
+ };
70
+ if (signature) {
71
+ return (jsxs(PageContent, { children: [jsx(Loader, { isSuccess: true, header: "Transfer sent", description: `${amount} SOL sent successfully` }), jsxs(ButtonRow, { children: [jsx(Button, { variant: "primary", onClick: handleViewExplorer, children: "View on Explorer" }), jsx(Button, { variant: "secondary", onClick: handleFinish, children: "Back to profile" })] })] }));
72
+ }
73
+ return (jsxs(PageContent, { onBack: routes.SOL_SEND, children: [jsx(ModalHeading, { children: "Confirm transfer" }), jsx(ModalBody, { children: "Review the transaction details before sending." }), jsxs(SummaryList, { children: [jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Sending" }), jsxs(AmountValue, { children: [amount || '0', " SOL"] })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "From" }), jsx(AddressValue, { children: address ? (jsx(CopyText, { size: "1rem", value: address, children: truncateSolanaAddress(address) })) : ('--') })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "To" }), jsx(AddressValue, { children: recipient ? (jsx(CopyText, { size: "1rem", value: recipient, children: truncateSolanaAddress(recipient) })) : ('--') })] })] }), jsxs(GaslessRow, { children: [jsxs("div", { children: [jsx(SummaryLabel, { children: "Sponsor network fee" }), jsx("div", { style: { fontSize: 12, color: 'var(--ck-body-color-muted)', marginTop: 2 }, children: "Pay no SOL fee (requires a sponsorship policy)" })] }), jsx(GaslessToggle, { type: "button", role: "switch", "aria-checked": gasless, "aria-label": "Sponsor network fee", "$on": gasless, onClick: () => setGasless((v) => !v), disabled: isLoading, children: jsx("span", {}) })] }), error && (jsxs(ErrorContainer, { children: [jsx(ErrorTitle, { children: "Transaction failed" }), jsx(ErrorMessage, { children: error })] })), jsxs(ButtonRow, { children: [jsx(Button, { variant: "primary", onClick: handleConfirm, disabled: !address || isLoading, waiting: isLoading, children: isLoading ? 'Confirming...' : 'Confirm' }), jsx(Button, { variant: "secondary", onClick: () => setRoute(routes.SOL_SEND), disabled: isLoading, children: "Cancel" })] })] }));
74
+ };
75
+
76
+ export { SolanaSendConfirmation };
77
+ //# sourceMappingURL=SolanaSendConfirmation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolanaSendConfirmation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -21,7 +21,7 @@ import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
21
21
  import { routes } from '../../Openfort/types.js';
22
22
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
23
23
  import { PageContent } from '../../PageContent/index.js';
24
- import { sanitizeForParsing, isSameToken, getAssetSymbol, getAssetDecimals } from '../Send/utils.js';
24
+ import { sanitizeForParsing, isSameToken, getAssetDecimals, getAssetSymbol } from '../Send/utils.js';
25
25
  import { EstimatedFees } from './EstimatedFees.js';
26
26
  import { ButtonRow, SummaryList, SummaryItem, SummaryLabel, AmountValue, AddressValue, FeesValue, CheckIconWrapper, StatusMessage, ErrorContainer, ErrorTitle, ErrorMessage, ErrorAction } from './styles.js';
27
27
 
@@ -69,10 +69,11 @@ const SendConfirmation = () => {
69
69
  const erc20Balance = useAsyncData({
70
70
  queryKey: ['erc20-balance', address, token.type === 'erc20' ? token.address : null, chainId],
71
71
  queryFn: async () => {
72
+ var _a, _b, _c, _d;
72
73
  if (!isErc20 || !address || !chainId)
73
74
  return { value: BigInt(0), decimals: 18, symbol: 'ERC20' };
74
75
  try {
75
- const rpcUrl = getDefaultEthereumRpcUrl(chainId);
76
+ const rpcUrl = (_c = (_b = (_a = walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.ethereum) === null || _a === void 0 ? void 0 : _a.rpcUrls) === null || _b === void 0 ? void 0 : _b[chainId]) !== null && _c !== void 0 ? _c : getDefaultEthereumRpcUrl(chainId);
76
77
  const publicClient = createPublicClient({ transport: http(rpcUrl) });
77
78
  const balance = await publicClient.readContract({
78
79
  address: token.address,
@@ -80,7 +81,7 @@ const SendConfirmation = () => {
80
81
  functionName: 'balanceOf',
81
82
  args: [address],
82
83
  });
83
- return { value: balance, decimals: 18, symbol: getAssetSymbol(token) };
84
+ return { value: balance, decimals: (_d = getAssetDecimals(token)) !== null && _d !== void 0 ? _d : 18, symbol: getAssetSymbol(token) };
84
85
  }
85
86
  catch (error) {
86
87
  logger.error('Failed to fetch ERC20 balance:', error);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,3 +16,8 @@ export declare const ErrorContainer: import("styled-components").StyledComponent
16
16
  export declare const ErrorTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
17
17
  export declare const ErrorMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
18
18
  export declare const ErrorAction: import("styled-components").StyledComponent<"div", any, {}, never>;
19
+ export declare const GaslessRow: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ /** A minimal theme-aware switch for the Solana "sponsor fee" toggle. */
21
+ export declare const GaslessToggle: import("styled-components").StyledComponent<"button", any, {
22
+ $on?: boolean;
23
+ }, never>;
@@ -124,6 +124,44 @@ const ErrorAction = styled.div `
124
124
  color: var(--ck-body-color-muted);
125
125
  line-height: 1.4;
126
126
  `;
127
+ const GaslessRow = styled.div `
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: space-between;
131
+ gap: 12px;
132
+ margin: 4px 0 8px;
133
+ text-align: left;
134
+ `;
135
+ /** A minimal theme-aware switch for the Solana "sponsor fee" toggle. */
136
+ const GaslessToggle = styled.button `
137
+ position: relative;
138
+ flex-shrink: 0;
139
+ width: 40px;
140
+ height: 24px;
141
+ border-radius: 999px;
142
+ border: 1px solid var(--ck-body-divider);
143
+ background: ${(props) => (props.$on ? 'var(--ck-body-color-valid, #22c55e)' : 'var(--ck-body-background-secondary)')};
144
+ cursor: pointer;
145
+ transition: background 150ms ease;
146
+ padding: 0;
147
+
148
+ &:disabled {
149
+ opacity: 0.5;
150
+ cursor: not-allowed;
151
+ }
152
+
153
+ > span {
154
+ position: absolute;
155
+ top: 50%;
156
+ left: ${(props) => (props.$on ? '18px' : '2px')};
157
+ transform: translateY(-50%);
158
+ width: 18px;
159
+ height: 18px;
160
+ border-radius: 50%;
161
+ background: #fff;
162
+ transition: left 150ms ease;
163
+ }
164
+ `;
127
165
 
128
- export { AddressValue, AmountValue, ButtonRow, CheckIconWrapper, ErrorAction, ErrorContainer, ErrorMessage, ErrorTitle, FeesValue, InfoIconWrapper, StatusMessage, SummaryItem, SummaryLabel, SummaryList };
166
+ export { AddressValue, AmountValue, ButtonRow, CheckIconWrapper, ErrorAction, ErrorContainer, ErrorMessage, ErrorTitle, FeesValue, GaslessRow, GaslessToggle, InfoIconWrapper, StatusMessage, SummaryItem, SummaryLabel, SummaryList };
129
167
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,6 +7,7 @@ const TOKEN_LOGO = {
7
7
  TBNB: `${TW}/smartchain/info/logo.png`,
8
8
  MATIC: `${TW}/polygon/info/logo.png`,
9
9
  POL: `${TW}/polygon/info/logo.png`,
10
+ SOL: `${TW}/solana/info/logo.png`,
10
11
  AVAX: `${TW}/avalanchec/info/logo.png`,
11
12
  FTM: `${TW}/fantom/info/logo.png`,
12
13
  CELO: `${TW}/celo/info/logo.png`,
@@ -1 +1 @@
1
- {"version":3,"file":"logos.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"logos.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}