@openfort/react 1.6.0 → 1.6.2

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 (56) hide show
  1. package/build/components/Common/Modal/index.js +14 -0
  2. package/build/components/Common/Modal/index.js.map +1 -1
  3. package/build/components/Openfort/types.d.ts +1 -1
  4. package/build/components/Pages/AssetInventory/SolanaAssetInventory.js +47 -8
  5. package/build/components/Pages/AssetInventory/SolanaAssetInventory.js.map +1 -1
  6. package/build/components/Pages/AssetInventory/index.js +50 -6
  7. package/build/components/Pages/AssetInventory/index.js.map +1 -1
  8. package/build/components/Pages/Connected/EthereumConnected.js +2 -5
  9. package/build/components/Pages/Connected/EthereumConnected.js.map +1 -1
  10. package/build/components/Pages/DepositWallet/index.js +15 -10
  11. package/build/components/Pages/DepositWallet/index.js.map +1 -1
  12. package/build/components/Pages/ExportKey/index.js +44 -4
  13. package/build/components/Pages/ExportKey/index.js.map +1 -1
  14. package/build/components/Pages/ExportKey/styles.d.ts +5 -0
  15. package/build/components/Pages/ExportKey/styles.js +47 -0
  16. package/build/components/Pages/ExportKey/styles.js.map +1 -0
  17. package/build/components/Pages/Receive/index.js +2 -2
  18. package/build/components/Pages/SelectToken/SolanaSelectToken.js +7 -7
  19. package/build/components/Pages/SelectToken/index.js +7 -3
  20. package/build/components/Pages/SelectToken/index.js.map +1 -1
  21. package/build/components/Pages/Send/EthereumSend.js +25 -5
  22. package/build/components/Pages/Send/EthereumSend.js.map +1 -1
  23. package/build/components/Pages/Send/SolanaSend.js +23 -4
  24. package/build/components/Pages/Send/SolanaSend.js.map +1 -1
  25. package/build/components/Pages/Send/styles.d.ts +17 -11
  26. package/build/components/Pages/Send/styles.js +104 -49
  27. package/build/components/Pages/Send/styles.js.map +1 -1
  28. package/build/components/Pages/SendConfirmation/ConfirmationSummary.d.ts +3 -1
  29. package/build/components/Pages/SendConfirmation/ConfirmationSummary.js +2 -2
  30. package/build/components/Pages/SendConfirmation/EstimatedFees.d.ts +3 -1
  31. package/build/components/Pages/SendConfirmation/EstimatedFees.js +22 -15
  32. package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -1
  33. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js +17 -5
  34. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js.map +1 -1
  35. package/build/components/Pages/SendConfirmation/index.js +11 -5
  36. package/build/components/Pages/SendConfirmation/index.js.map +1 -1
  37. package/build/components/Pages/SendConfirmation/styles.d.ts +3 -1
  38. package/build/components/Pages/SendConfirmation/styles.js +20 -6
  39. package/build/components/Pages/SendConfirmation/styles.js.map +1 -1
  40. package/build/components/Pages/SignMessage/index.js +44 -19
  41. package/build/components/Pages/SignMessage/index.js.map +1 -1
  42. package/build/components/Pages/SignMessage/styles.d.ts +2 -3
  43. package/build/components/Pages/SignMessage/styles.js +19 -2
  44. package/build/components/Pages/SignMessage/styles.js.map +1 -1
  45. package/build/constants/defaultAssets.d.ts +18 -0
  46. package/build/constants/defaultAssets.js +70 -0
  47. package/build/constants/defaultAssets.js.map +1 -0
  48. package/build/hooks/openfort/useSignMessage.d.ts +2 -2
  49. package/build/hooks/openfort/useUI.js +4 -2
  50. package/build/hooks/openfort/useUI.js.map +1 -1
  51. package/build/solana/transfer.d.ts +12 -0
  52. package/build/solana/transfer.js +29 -1
  53. package/build/solana/transfer.js.map +1 -1
  54. package/build/version.d.ts +1 -1
  55. package/build/version.js +1 -1
  56. package/package.json +1 -1
@@ -1,20 +1,21 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useEffect, useMemo } from 'react';
3
3
  import { parseUnits, isAddress, formatUnits } from 'viem';
4
+ import { currencyLogoUrl, chainLogoUrl } from '../../../constants/logos.js';
5
+ import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
4
6
  import { useEthereumWalletAssets } from '../../../ethereum/hooks/useEthereumWalletAssets.js';
5
7
  import Button from '../../Common/Button/index.js';
6
8
  import { Arrow, ArrowChevron } from '../../Common/Button/styles.js';
7
- import Input from '../../Common/Input/index.js';
8
9
  import { ModalHeading } from '../../Common/Modal/styles.js';
9
10
  import { routes } from '../../Openfort/types.js';
10
11
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
11
12
  import { PageContent } from '../../PageContent/index.js';
12
- import { AmountCard, AmountInput } from '../Buy/styles.js';
13
- import { Form, Field, FieldLabel, TokenSelectorButton, TokenSelectorContent, TokenSelectorValue, TokenSelectorRight, MaxButton, HelperText, ErrorText } from './styles.js';
13
+ import { AssetChainLogo } from '../Deposit/AssetChainLogo.js';
14
+ import { Form, SendCard, ToRow, CardLabel, RecipientInput, PasteButton, ErrorText, AmountRow, AmountField, TokenPill, PillLogo, AmountMeta, MetaText, BalanceMeta, UseMaxButton } from './styles.js';
14
15
  import { isSameToken, sanitizeForParsing, formatBalance, sanitizeAmountInput } from './utils.js';
15
16
 
16
17
  const EthereumSend = () => {
17
- var _a, _b, _c, _d;
18
+ var _a, _b, _c, _d, _e, _f;
18
19
  const { sendForm, setSendForm, setRoute, triggerResize } = useOpenfort();
19
20
  // Size the modal to the form on mount. Without this the screen isn't anchored
20
21
  // and scrolls within the modal — every other Page triggers a resize on mount.
@@ -22,6 +23,7 @@ const EthereumSend = () => {
22
23
  triggerResize();
23
24
  }, [triggerResize]);
24
25
  const { data: assets } = useEthereumWalletAssets();
26
+ const { chainId } = useEthereumEmbeddedWallet();
25
27
  const matchedToken = useMemo(() => assets === null || assets === void 0 ? void 0 : assets.find((asset) => isSameToken(asset, sendForm.asset)), [assets, sendForm.asset]);
26
28
  const selectedTokenOption = matchedToken !== null && matchedToken !== void 0 ? matchedToken : assets === null || assets === void 0 ? void 0 : assets[0];
27
29
  const selectedToken = selectedTokenOption !== null && selectedTokenOption !== void 0 ? selectedTokenOption : sendForm.asset;
@@ -64,6 +66,16 @@ const EthereumSend = () => {
64
66
  recipient: event.target.value,
65
67
  }));
66
68
  };
69
+ const handlePaste = async () => {
70
+ try {
71
+ const text = await navigator.clipboard.readText();
72
+ if (text)
73
+ setSendForm((prev) => ({ ...prev, recipient: text.trim() }));
74
+ }
75
+ catch {
76
+ // Clipboard unavailable or permission denied — leave the field as-is.
77
+ }
78
+ };
67
79
  const handleAmountChange = (event) => {
68
80
  const raw = sanitizeAmountInput(event.target.value);
69
81
  if (raw === '' || /^[0-9]*\.?[0-9]*$/.test(raw)) {
@@ -87,7 +99,15 @@ const EthereumSend = () => {
87
99
  };
88
100
  const availableLabel = formatBalance(selectedBalanceValue, selectedDecimalsValue);
89
101
  const maxDisabled = !selectedBalanceValue;
90
- return (jsxs(PageContent, { onBack: routes.CONNECTED, children: [jsx(ModalHeading, { children: "Send assets" }), jsxs(Form, { onSubmit: handleSubmit, children: [jsxs(Field, { children: [jsx(FieldLabel, { children: "Asset" }), jsxs(TokenSelectorButton, { type: "button", onClick: handleOpenTokenSelector, children: [jsx(TokenSelectorContent, { children: jsx(TokenSelectorValue, { "$primary": true, children: selectedSymbol || 'Select token' }) }), jsxs(TokenSelectorRight, { children: [jsx(TokenSelectorValue, { children: availableLabel === '--' ? '--' : `${availableLabel} ${selectedSymbol !== null && selectedSymbol !== void 0 ? selectedSymbol : ''}` }), jsx(Arrow, { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx(ArrowChevron, { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "2", strokeLinecap: "round" }) })] })] })] }), jsxs(Field, { children: [jsx(FieldLabel, { children: "Amount" }), jsxs(AmountCard, { style: { marginTop: 12 }, children: [jsx(AmountInput, { placeholder: "0.00", value: sendForm.amount, onChange: handleAmountChange, inputMode: "decimal", autoComplete: "off" }), jsx(MaxButton, { type: "button", onClick: handleMax, disabled: maxDisabled, children: "Max" })] }), jsxs(HelperText, { children: ["Available: ", availableLabel, " ", selectedSymbol] }), sendForm.amount && parsedAmount === null && jsx(ErrorText, { children: "Enter a valid amount." }), insufficientBalance && jsx(ErrorText, { children: "Insufficient balance for this transfer." })] }), jsxs(Field, { children: [jsx(FieldLabel, { children: "Recipient address" }), jsx(Input, { placeholder: "0x...", value: sendForm.recipient, onChange: handleRecipientChange, autoComplete: "off" }), sendForm.recipient && !recipientValid && jsx(ErrorText, { children: "Enter a valid wallet address." })] }), jsx(Button, { variant: "primary", disabled: !canProceed, children: "Review transfer" })] })] }));
102
+ const fiatValue = useMemo(() => {
103
+ var _a, _b;
104
+ const perToken = (_b = (_a = selectedToken.metadata) === null || _a === void 0 ? void 0 : _a.fiat) === null || _b === void 0 ? void 0 : _b.value;
105
+ const n = Number(sanitizeForParsing(sendForm.amount));
106
+ if (!perToken || !Number.isFinite(n) || n <= 0)
107
+ return null;
108
+ return `$${(n * perToken).toFixed(2)}`;
109
+ }, [selectedToken.metadata, sendForm.amount]);
110
+ return (jsxs(PageContent, { onBack: routes.CONNECTED, children: [jsx(ModalHeading, { children: "Send money" }), jsxs(Form, { onSubmit: handleSubmit, children: [jsxs(SendCard, { children: [jsxs(ToRow, { children: [jsx(CardLabel, { children: "To" }), jsx(RecipientInput, { placeholder: "0x\u2026 or address", value: sendForm.recipient, onChange: handleRecipientChange, autoComplete: "off", spellCheck: false }), jsx(PasteButton, { type: "button", onClick: handlePaste, children: "Paste" })] }), sendForm.recipient && !recipientValid && jsx(ErrorText, { children: "Enter a valid wallet address." })] }), jsxs(SendCard, { children: [jsx(CardLabel, { children: "Amount" }), jsxs(AmountRow, { children: [jsx(AmountField, { placeholder: "0", value: sendForm.amount, onChange: handleAmountChange, inputMode: "decimal", autoComplete: "off" }), jsxs(TokenPill, { type: "button", onClick: handleOpenTokenSelector, children: [selectedSymbol && (jsx(PillLogo, { children: jsx(AssetChainLogo, { assetLogo: (_e = currencyLogoUrl(selectedSymbol)) !== null && _e !== void 0 ? _e : '', chainLogo: (_f = chainLogoUrl(chainId)) !== null && _f !== void 0 ? _f : '', symbol: selectedSymbol }) })), selectedSymbol || 'Select', jsx(Arrow, { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx(ArrowChevron, { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "2", strokeLinecap: "round" }) })] })] }), jsxs(AmountMeta, { children: [jsx(MetaText, { style: { flex: 1, minWidth: 0 }, children: fiatValue !== null && fiatValue !== void 0 ? fiatValue : '' }), jsxs(BalanceMeta, { children: [jsx(MetaText, { children: availableLabel === '--' ? '--' : `${availableLabel} ${selectedSymbol}` }), jsx(UseMaxButton, { type: "button", onClick: handleMax, disabled: maxDisabled, children: "Use max" })] })] }), sendForm.amount && parsedAmount === null && jsx(ErrorText, { children: "Enter a valid amount." }), insufficientBalance && jsx(ErrorText, { children: "Insufficient balance for this transfer." })] }), jsx(Button, { variant: "primary", disabled: !canProceed, children: "Review transfer" })] })] }));
91
111
  };
92
112
 
93
113
  export { EthereumSend };
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumSend.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"EthereumSend.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,16 +1,16 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useEffect, useMemo } from 'react';
3
3
  import { parseUnits, formatUnits } from 'viem';
4
+ import { currencyLogoUrl } from '../../../constants/logos.js';
4
5
  import { useSolanaWalletAssets } from '../../../solana/hooks/useSolanaWalletAssets.js';
5
6
  import Button from '../../Common/Button/index.js';
6
7
  import { Arrow, ArrowChevron } from '../../Common/Button/styles.js';
7
- import Input from '../../Common/Input/index.js';
8
8
  import { ModalHeading } from '../../Common/Modal/styles.js';
9
9
  import { routes } from '../../Openfort/types.js';
10
10
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
11
11
  import { PageContent } from '../../PageContent/index.js';
12
- import { AmountCard, AmountInput } from '../Buy/styles.js';
13
- import { Form, Field, FieldLabel, TokenSelectorButton, TokenSelectorContent, TokenSelectorValue, TokenSelectorRight, MaxButton, HelperText, ErrorText } from './styles.js';
12
+ import { AssetChainLogo } from '../Deposit/AssetChainLogo.js';
13
+ import { Form, SendCard, ToRow, CardLabel, RecipientInput, PasteButton, ErrorText, AmountRow, AmountField, TokenPill, PillLogo, AmountMeta, MetaText, BalanceMeta, UseMaxButton } from './styles.js';
14
14
  import { sanitizeForParsing, formatBalance, sanitizeAmountInput } from './utils.js';
15
15
 
16
16
  const SOL_DECIMALS = 9;
@@ -27,6 +27,7 @@ function solAsset(balance) {
27
27
  };
28
28
  }
29
29
  const SolanaSend = () => {
30
+ var _a, _b;
30
31
  const { sendForm, setSendForm, setRoute, triggerResize } = useOpenfort();
31
32
  const { data: assets } = useSolanaWalletAssets();
32
33
  // Size the modal to the form on mount so it's anchored and doesn't scroll.
@@ -87,7 +88,25 @@ const SolanaSend = () => {
87
88
  setSendForm((prev) => ({ ...prev, amount: formatUnits(balanceBase, selected.decimals) }));
88
89
  };
89
90
  const handleOpenTokenSelector = () => setRoute(routes.SOL_SEND_TOKEN_SELECT);
90
- return (jsxs(PageContent, { onBack: routes.SOL_CONNECTED, children: [jsx(ModalHeading, { children: "Send assets" }), jsxs(Form, { onSubmit: handleSubmit, children: [jsxs(Field, { children: [jsx(FieldLabel, { children: "Asset" }), jsxs(TokenSelectorButton, { type: "button", onClick: handleOpenTokenSelector, children: [jsx(TokenSelectorContent, { children: jsx(TokenSelectorValue, { "$primary": true, children: selected.symbol }) }), jsxs(TokenSelectorRight, { children: [jsx(TokenSelectorValue, { children: availableLabel === '--' ? '--' : `${availableLabel} ${selected.symbol}` }), jsx(Arrow, { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx(ArrowChevron, { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "2", strokeLinecap: "round" }) })] })] })] }), jsxs(Field, { children: [jsx(FieldLabel, { children: "Amount" }), jsxs(AmountCard, { style: { marginTop: 12 }, children: [jsx(AmountInput, { placeholder: "0.00", value: sendForm.amount, onChange: handleAmountChange, inputMode: "decimal", autoComplete: "off" }), jsx(MaxButton, { type: "button", onClick: handleMax, disabled: balanceBase === undefined, children: "Max" })] }), jsxs(HelperText, { children: ["Available: ", availableLabel, " ", selected.symbol] }), sendForm.amount && parsedAmount === null && jsx(ErrorText, { children: "Enter a valid amount." }), insufficientBalance && jsxs(ErrorText, { children: ["Insufficient ", selected.symbol, " balance for this transfer."] })] }), jsxs(Field, { children: [jsx(FieldLabel, { children: "Recipient address" }), jsx(Input, { placeholder: "Solana address", value: sendForm.recipient, onChange: (e) => setSendForm((prev) => ({ ...prev, recipient: e.target.value })), autoComplete: "off" }), sendForm.recipient && !recipientValid && jsx(ErrorText, { children: "Enter a valid Solana address." })] }), jsx(Button, { variant: "primary", disabled: !canProceed, children: "Review transfer" })] })] }));
91
+ const handlePaste = async () => {
92
+ try {
93
+ const text = await navigator.clipboard.readText();
94
+ if (text)
95
+ setSendForm((prev) => ({ ...prev, recipient: text.trim() }));
96
+ }
97
+ catch {
98
+ // Clipboard unavailable or permission denied — leave the field as-is.
99
+ }
100
+ };
101
+ const fiatValue = useMemo(() => {
102
+ var _a, _b;
103
+ const perToken = (_b = (_a = asset.metadata) === null || _a === void 0 ? void 0 : _a.fiat) === null || _b === void 0 ? void 0 : _b.value;
104
+ const n = Number(sanitizeForParsing(sendForm.amount));
105
+ if (!perToken || !Number.isFinite(n) || n <= 0)
106
+ return null;
107
+ return `$${(n * perToken).toFixed(2)}`;
108
+ }, [asset.metadata, sendForm.amount]);
109
+ return (jsxs(PageContent, { onBack: routes.SOL_CONNECTED, children: [jsx(ModalHeading, { children: "Send money" }), jsxs(Form, { onSubmit: handleSubmit, children: [jsxs(SendCard, { children: [jsxs(ToRow, { children: [jsx(CardLabel, { children: "To" }), jsx(RecipientInput, { placeholder: "Solana address", value: sendForm.recipient, onChange: (e) => setSendForm((prev) => ({ ...prev, recipient: e.target.value })), autoComplete: "off", spellCheck: false }), jsx(PasteButton, { type: "button", onClick: handlePaste, children: "Paste" })] }), sendForm.recipient && !recipientValid && jsx(ErrorText, { children: "Enter a valid Solana address." })] }), jsxs(SendCard, { children: [jsx(CardLabel, { children: "Amount" }), jsxs(AmountRow, { children: [jsx(AmountField, { placeholder: "0", value: sendForm.amount, onChange: handleAmountChange, inputMode: "decimal", autoComplete: "off" }), jsxs(TokenPill, { type: "button", onClick: handleOpenTokenSelector, children: [selected.symbol && (jsx(PillLogo, { children: jsx(AssetChainLogo, { assetLogo: (_a = currencyLogoUrl(selected.symbol)) !== null && _a !== void 0 ? _a : '', chainLogo: (_b = currencyLogoUrl('SOL')) !== null && _b !== void 0 ? _b : '', symbol: selected.symbol }) })), selected.symbol, jsx(Arrow, { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx(ArrowChevron, { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "2", strokeLinecap: "round" }) })] })] }), jsxs(AmountMeta, { children: [jsx(MetaText, { style: { flex: 1, minWidth: 0 }, children: fiatValue !== null && fiatValue !== void 0 ? fiatValue : '' }), jsxs(BalanceMeta, { children: [jsx(MetaText, { children: availableLabel === '--' ? '--' : `${availableLabel} ${selected.symbol}` }), jsx(UseMaxButton, { type: "button", onClick: handleMax, disabled: balanceBase === undefined, children: "Use max" })] })] }), sendForm.amount && parsedAmount === null && jsx(ErrorText, { children: "Enter a valid amount." }), insufficientBalance && jsxs(ErrorText, { children: ["Insufficient ", selected.symbol, " balance for this transfer."] })] }), jsx(Button, { variant: "primary", disabled: !canProceed, children: "Review transfer" })] })] }));
91
110
  };
92
111
 
93
112
  export { SolanaSend };
@@ -1 +1 @@
1
- {"version":3,"file":"SolanaSend.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SolanaSend.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,13 +1,19 @@
1
1
  export declare const Form: import("styled-components").StyledComponent<"form", any, {}, never>;
2
- export declare const Field: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const FieldLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
4
- export declare const TokenSelectorButton: import("styled-components").StyledComponent<"button", any, {}, never>;
5
- export declare const TokenSelectorContent: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export declare const TokenSelectorValue: import("styled-components").StyledComponent<"span", any, {
7
- $primary?: boolean;
8
- $muted?: boolean;
9
- }, never>;
10
- export declare const TokenSelectorRight: import("styled-components").StyledComponent<"div", any, {}, never>;
11
- export declare const MaxButton: import("styled-components").StyledComponent<"button", any, {}, never>;
12
- export declare const HelperText: import("styled-components").StyledComponent<"span", any, {}, never>;
2
+ /** Rounded container shared by the "To" and "Amount" boxes. */
3
+ export declare const SendCard: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const CardLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
5
+ /** "To" box: inline label, recipient input, and a Paste button. */
6
+ export declare const ToRow: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const RecipientInput: import("styled-components").StyledComponent<"input", any, {}, never>;
8
+ export declare const PasteButton: import("styled-components").StyledComponent<"button", any, {}, never>;
9
+ /** "Amount" box: large amount input with an inline token selector. */
10
+ export declare const AmountRow: import("styled-components").StyledComponent<"div", any, {}, never>;
11
+ export declare const AmountField: import("styled-components").StyledComponent<"input", any, {}, never>;
12
+ export declare const PillLogo: import("styled-components").StyledComponent<"span", any, {}, never>;
13
+ export declare const TokenPill: import("styled-components").StyledComponent<"button", any, {}, never>;
14
+ /** Bottom row of the amount box: fiat value (left), balance + Use max (right). */
15
+ export declare const AmountMeta: import("styled-components").StyledComponent<"div", any, {}, never>;
16
+ export declare const MetaText: import("styled-components").StyledComponent<"span", any, {}, never>;
17
+ export declare const BalanceMeta: import("styled-components").StyledComponent<"span", any, {}, never>;
18
+ export declare const UseMaxButton: import("styled-components").StyledComponent<"button", any, {}, never>;
13
19
  export declare const ErrorText: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -3,99 +3,154 @@ import styled from '../../../styles/styled/index.js';
3
3
  const Form = styled.form `
4
4
  display: flex;
5
5
  flex-direction: column;
6
- gap: 20px;
6
+ gap: 14px;
7
7
  margin-top: 20px;
8
8
  `;
9
- const Field = styled.div `
9
+ /** Rounded container shared by the "To" and "Amount" boxes. */
10
+ const SendCard = styled.div `
10
11
  display: flex;
11
12
  flex-direction: column;
13
+ gap: 10px;
14
+ padding: 14px 16px;
15
+ border-radius: var(--ck-secondary-button-border-radius);
16
+ border: 1px solid var(--ck-body-divider);
17
+ background: var(--ck-secondary-button-background);
12
18
  text-align: left;
13
19
  `;
14
- const FieldLabel = styled.span `
15
- font-size: 14px;
20
+ const CardLabel = styled.span `
21
+ font-size: 13px;
16
22
  font-weight: 600;
17
- color: var(--ck-body-color);
23
+ color: var(--ck-body-color-muted);
18
24
  `;
19
- const TokenSelectorButton = styled.button `
25
+ /** "To" box: inline label, recipient input, and a Paste button. */
26
+ const ToRow = styled.div `
20
27
  display: flex;
21
28
  align-items: center;
22
- justify-content: space-between;
23
- width: 100%;
24
- margin-top: 12px;
25
- padding: 12px 16px;
26
- border-radius: var(--ck-secondary-button-border-radius);
29
+ gap: 10px;
30
+ `;
31
+ const RecipientInput = styled.input `
32
+ flex: 1;
33
+ min-width: 0;
34
+ border: none;
35
+ background: transparent;
36
+ color: var(--ck-body-color);
37
+ font-size: 15px;
38
+ font-weight: 500;
39
+ padding: 0;
40
+ outline: none;
41
+
42
+ &::placeholder {
43
+ color: var(--ck-body-color-muted);
44
+ }
45
+ `;
46
+ const PasteButton = styled.button `
47
+ flex-shrink: 0;
48
+ padding: 6px 12px;
49
+ border-radius: 16px;
27
50
  border: 1px solid var(--ck-body-divider);
28
- background: var(--ck-secondary-button-background);
51
+ background: var(--ck-body-background);
29
52
  color: var(--ck-body-color);
53
+ font-size: 12px;
54
+ font-weight: 600;
30
55
  cursor: pointer;
31
- transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
32
- text-align: left;
56
+ transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
33
57
 
34
58
  &:hover {
35
59
  background: var(--ck-secondary-button-hover-background);
36
- border-color: var(--ck-body-color-muted);
37
60
  }
38
61
  `;
39
- const TokenSelectorContent = styled.div `
62
+ /** "Amount" box: large amount input with an inline token selector. */
63
+ const AmountRow = styled.div `
40
64
  display: flex;
41
- flex-direction: column;
42
- gap: 2px;
43
- overflow: hidden;
65
+ align-items: center;
66
+ gap: 10px;
44
67
  `;
45
- const TokenSelectorValue = styled.span `
46
- font-size: ${(props) => (props.$primary ? '15px' : '13px')};
47
- font-weight: ${(props) => (props.$primary ? 600 : 500)};
48
- color: ${(props) => {
49
- if (props.$primary)
50
- return 'var(--ck-body-color)';
51
- if (props.$muted)
52
- return 'var(--ck-body-color-muted)';
53
- return 'var(--ck-body-color-muted)';
54
- }};
55
- white-space: nowrap;
56
- overflow: hidden;
57
- text-overflow: ellipsis;
68
+ const AmountField = styled.input `
69
+ flex: 1;
70
+ min-width: 0;
71
+ border: none;
72
+ background: transparent;
73
+ color: var(--ck-body-color);
74
+ font-size: 28px;
75
+ font-weight: 600;
76
+ line-height: 1.1;
77
+ padding: 0;
78
+ outline: none;
79
+
80
+ &::placeholder {
81
+ color: var(--ck-body-color-muted);
82
+ }
58
83
  `;
59
- const TokenSelectorRight = styled.div `
84
+ const PillLogo = styled.span `
60
85
  display: flex;
61
86
  align-items: center;
62
- gap: 6px;
63
- color: var(--ck-body-color-muted);
87
+ width: 22px;
88
+ flex-shrink: 0;
64
89
  `;
65
- const MaxButton = styled.button `
90
+ const TokenPill = styled.button `
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 6px;
66
94
  flex-shrink: 0;
67
- padding: 6px 14px;
68
- border-radius: 16px;
95
+ padding: 7px 12px;
96
+ border-radius: 999px;
69
97
  border: 1px solid var(--ck-body-divider);
70
98
  background: var(--ck-body-background);
71
99
  color: var(--ck-body-color);
72
- font-size: 12px;
100
+ font-size: 14px;
73
101
  font-weight: 600;
74
102
  cursor: pointer;
75
- transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
103
+ transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
76
104
 
77
105
  &:hover {
78
106
  background: var(--ck-secondary-button-hover-background);
107
+ border-color: var(--ck-body-color-muted);
79
108
  }
109
+ `;
110
+ /** Bottom row of the amount box: fiat value (left), balance + Use max (right). */
111
+ const AmountMeta = styled.div `
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: space-between;
115
+ gap: 8px;
116
+ `;
117
+ const MetaText = styled.span `
118
+ font-size: 13px;
119
+ font-weight: 500;
120
+ color: var(--ck-body-color-muted);
121
+ white-space: nowrap;
122
+ overflow: hidden;
123
+ text-overflow: ellipsis;
124
+ `;
125
+ const BalanceMeta = styled.span `
126
+ display: flex;
127
+ align-items: center;
128
+ gap: 6px;
129
+ flex-shrink: 0;
130
+ font-size: 13px;
131
+ font-weight: 500;
132
+ color: var(--ck-body-color-muted);
133
+ `;
134
+ const UseMaxButton = styled.button `
135
+ border: none;
136
+ background: none;
137
+ padding: 0;
138
+ font-size: 13px;
139
+ font-weight: 600;
140
+ color: var(--ck-accent-color, var(--ck-focus-color, #1a88f8));
141
+ cursor: pointer;
80
142
 
81
143
  &:disabled {
82
144
  opacity: 0.5;
83
145
  cursor: not-allowed;
84
- background: var(--ck-body-background-secondary);
85
146
  }
86
147
  `;
87
- const HelperText = styled.span `
88
- display: block;
89
- margin-top: 8px;
90
- font-size: 13px;
91
- color: var(--ck-body-color-muted);
92
- `;
93
148
  const ErrorText = styled.span `
94
149
  display: block;
95
- margin-top: 6px;
150
+ margin-top: 2px;
96
151
  font-size: 13px;
97
152
  color: var(--ck-body-color-danger);
98
153
  `;
99
154
 
100
- export { ErrorText, Field, FieldLabel, Form, HelperText, MaxButton, TokenSelectorButton, TokenSelectorContent, TokenSelectorRight, TokenSelectorValue };
155
+ export { AmountField, AmountMeta, AmountRow, BalanceMeta, CardLabel, ErrorText, Form, MetaText, PasteButton, PillLogo, RecipientInput, SendCard, ToRow, TokenPill, UseMaxButton };
101
156
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,11 +17,13 @@ interface ConfirmationSummaryProps {
17
17
  fee: ReactNode;
18
18
  /** The wallet the funds are paid from. */
19
19
  payWith?: ConfirmationAddress;
20
+ /** Current balance of the pay-with wallet, e.g. "134.32 USDC". */
21
+ balance?: string;
20
22
  }
21
23
  /**
22
24
  * Shared, chain-agnostic transaction preview used by the EVM and Solana send
23
25
  * confirmation screens. Renders the approval-style rows (Total / To / Network /
24
26
  * Estimated fee) plus a "Pay with" card.
25
27
  */
26
- export declare function ConfirmationSummary({ amount, symbol, fiat, to, networkName, networkIcon, fee, payWith, }: ConfirmationSummaryProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function ConfirmationSummary({ amount, symbol, fiat, to, networkName, networkIcon, fee, payWith, balance, }: ConfirmationSummaryProps): import("react/jsx-runtime").JSX.Element;
27
29
  export {};
@@ -7,8 +7,8 @@ import { SummaryList, SummaryItem, SummaryLabel, AmountValue, FiatValue, Address
7
7
  * confirmation screens. Renders the approval-style rows (Total / To / Network /
8
8
  * Estimated fee) plus a "Pay with" card.
9
9
  */
10
- function ConfirmationSummary({ amount, symbol, fiat, to, networkName, networkIcon, fee, payWith, }) {
11
- return (jsxs(Fragment, { children: [jsxs(SummaryList, { children: [jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Total" }), jsxs(AmountValue, { children: [amount || '0', " ", symbol, fiat ? jsxs(FiatValue, { children: ["\u2248 ", fiat] }) : null] })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "To" }), jsx(AddressValue, { children: to ? (jsx(CopyText, { size: "1rem", value: to.value, children: to.display })) : ('--') })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Network" }), jsxs(NetworkValue, { children: [networkIcon, networkName] })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Estimated fee" }), fee] })] }), jsxs(PayWithCard, { children: [jsxs(PayWithMeta, { children: [jsx(SummaryLabel, { children: "Pay with" }), jsx(PayWithAddress, { children: payWith ? (jsx(CopyText, { size: "0.875rem", value: payWith.value, children: payWith.display })) : ('--') })] }), jsxs(PayWithBadge, { children: [amount || '0', " ", symbol] })] })] }));
10
+ function ConfirmationSummary({ amount, symbol, fiat, to, networkName, networkIcon, fee, payWith, balance, }) {
11
+ return (jsxs(Fragment, { children: [jsxs(SummaryList, { children: [jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Total" }), jsxs(AmountValue, { children: [amount || '0', " ", symbol, fiat ? jsxs(FiatValue, { children: ["\u2248 ", fiat] }) : null] })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "To" }), jsx(AddressValue, { children: to ? (jsx(CopyText, { size: "1rem", value: to.value, children: to.display })) : ('--') })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Network" }), jsxs(NetworkValue, { children: [networkIcon, networkName] })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Estimated fee" }), fee] })] }), jsxs(PayWithCard, { children: [jsxs(PayWithMeta, { children: [jsx(SummaryLabel, { children: "Pay with" }), jsx(PayWithAddress, { children: payWith ? (jsx(CopyText, { size: "0.875rem", value: payWith.value, children: payWith.display })) : ('--') })] }), balance ? jsx(PayWithBadge, { children: balance }) : null] })] }));
12
12
  }
13
13
 
14
14
  export { ConfirmationSummary };
@@ -8,6 +8,8 @@ type EstimatedFeesProps = {
8
8
  nativeSymbol: string;
9
9
  enabled?: boolean;
10
10
  hideInfoIcon?: boolean;
11
+ /** When fees are sponsored, show the estimate struck through next to "Sponsored". */
12
+ sponsored?: boolean;
11
13
  };
12
- export declare const EstimatedFees: ({ account, to, value, data, chainId, nativeSymbol, enabled, hideInfoIcon, }: EstimatedFeesProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const EstimatedFees: ({ account, to, value, data, chainId, nativeSymbol, enabled, hideInfoIcon, sponsored, }: EstimatedFeesProps) => import("react/jsx-runtime").JSX.Element;
13
15
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { createPublicClient, http, formatUnits } from 'viem';
3
3
  import { useEthereumWalletAssets } from '../../../ethereum/hooks/useEthereumWalletAssets.js';
4
4
  import { useAsyncData } from '../../../shared/hooks/useAsyncData.js';
@@ -7,7 +7,7 @@ import { getDefaultEthereumRpcUrl } from '../../../utils/rpc.js';
7
7
  import Tooltip from '../../Common/Tooltip/index.js';
8
8
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
9
9
  import { formatBalance } from '../Send/utils.js';
10
- import { InfoIconWrapper } from './styles.js';
10
+ import { InfoIconWrapper, FeeStrike, SponsoredText } from './styles.js';
11
11
 
12
12
  const InfoIcon = () => (jsxs("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("circle", { cx: "7", cy: "7", r: "6", stroke: "currentColor", strokeWidth: "1.5" }), jsx("path", { d: "M7 10V6.5M7 4.5H7.005", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }));
13
13
  const usdFormatter = new Intl.NumberFormat('en-US', {
@@ -16,8 +16,8 @@ const usdFormatter = new Intl.NumberFormat('en-US', {
16
16
  minimumFractionDigits: 2,
17
17
  maximumFractionDigits: 4,
18
18
  });
19
- const EstimatedFees = ({ account, to, value, data, chainId, nativeSymbol, enabled = true, hideInfoIcon = false, }) => {
20
- var _a, _b, _c;
19
+ const EstimatedFees = ({ account, to, value, data, chainId, nativeSymbol, enabled = true, hideInfoIcon = false, sponsored = false, }) => {
20
+ var _a, _b, _c, _d;
21
21
  const { walletConfig } = useOpenfort();
22
22
  const { data: assets } = useEthereumWalletAssets();
23
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;
@@ -49,19 +49,26 @@ const EstimatedFees = ({ account, to, value, data, chainId, nativeSymbol, enable
49
49
  },
50
50
  enabled: enabled && !!account && !!to && !!chainId,
51
51
  });
52
- // Handle query states
53
- if (!gas.data || gas.error) {
54
- return jsx(Fragment, { children: "--" });
52
+ // Format the estimate (USD when a native price is known, otherwise native units).
53
+ const gasUnits = (_d = gas.data) === null || _d === void 0 ? void 0 : _d.gasLimit;
54
+ let feeText = null;
55
+ if (gas.data && !gas.error) {
56
+ const gasCost = gas.data.estimatedCost;
57
+ if (pricePerToken !== undefined) {
58
+ feeText = `≈ ${usdFormatter.format(Number.parseFloat(formatUnits(gasCost, 18)) * pricePerToken)}`;
59
+ }
60
+ else {
61
+ feeText = `≈ ${formatBalance(gasCost, 18)} ${nativeSymbol}`;
62
+ }
55
63
  }
56
- const gasCost = gas.data.estimatedCost;
57
- const gasUnits = gas.data.gasLimit;
58
- if (pricePerToken !== undefined) {
59
- const gasCostInEth = Number.parseFloat(formatUnits(gasCost, 18));
60
- const gasCostInUsd = gasCostInEth * pricePerToken;
61
- return (jsxs(Fragment, { children: ["\u2248 ", usdFormatter.format(gasCostInUsd), !hideInfoIcon && (jsx(Tooltip, { message: `${gasUnits.toString()} gas units (paid in ${nativeSymbol})`, delay: 0.2, children: jsx(InfoIconWrapper, { children: jsx(InfoIcon, {}) }) }))] }));
64
+ const info = !hideInfoIcon && gasUnits ? (jsx(Tooltip, { message: `${gasUnits.toString()} gas units (paid in ${nativeSymbol})`, delay: 0.2, children: jsx(InfoIconWrapper, { children: jsx(InfoIcon, {}) }) })) : null;
65
+ // Sponsored: show what it would have cost, struck through, next to "Sponsored".
66
+ if (sponsored) {
67
+ return (jsxs(Fragment, { children: [feeText && jsx(FeeStrike, { children: feeText }), jsx(SponsoredText, { children: "Sponsored" })] }));
62
68
  }
63
- // Fallback to native token if price not available
64
- return (jsxs(Fragment, { children: ["\u2248 ", formatBalance(gasCost, 18), " ", nativeSymbol, !hideInfoIcon && (jsx(Tooltip, { message: `${gasUnits.toString()} gas units`, delay: 0.2, children: jsx(InfoIconWrapper, { children: jsx(InfoIcon, {}) }) }))] }));
69
+ if (!feeText)
70
+ return jsx(Fragment, { children: "--" });
71
+ return (jsxs(Fragment, { children: [feeText, info] }));
65
72
  };
66
73
 
67
74
  export { EstimatedFees };
@@ -1 +1 @@
1
- {"version":3,"file":"EstimatedFees.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"EstimatedFees.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,12 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { ChainTypeEnum } from '@openfort/openfort-js';
3
3
  import { useState, useEffect } from 'react';
4
4
  import { parseUnits } from 'viem';
5
+ import { currencyLogoUrl } from '../../../constants/logos.js';
6
+ import { useAsyncData } from '../../../shared/hooks/useAsyncData.js';
5
7
  import { getExplorerUrl } from '../../../shared/utils/explorer.js';
6
8
  import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
7
- import { sendSplTokenGasless, sendSplToken, sendSolGasless, sendSol } from '../../../solana/transfer.js';
9
+ import { estimateSolanaTransferFeeLamports, sendSplTokenGasless, sendSplToken, sendSolGasless, sendSol } from '../../../solana/transfer.js';
8
10
  import 'detect-browser';
9
11
  import { truncateSolanaAddress } from '../../../utils/format.js';
10
12
  import Button from '../../Common/Button/index.js';
@@ -13,12 +15,13 @@ import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
13
15
  import { routes } from '../../Openfort/types.js';
14
16
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
15
17
  import { PageContent } from '../../PageContent/index.js';
18
+ import { formatBalance, formatBalanceWithSymbol } from '../Send/utils.js';
16
19
  import { ConfirmationSummary } from './ConfirmationSummary.js';
17
- import { ButtonRow, SponsoredFee, FeesValue, ErrorContainer, ErrorTitle, ErrorMessage } from './styles.js';
20
+ import { ButtonRow, FeesValue, FeeStrike, SponsoredText, ErrorContainer, ErrorTitle, ErrorMessage } from './styles.js';
18
21
 
19
22
  const SOL_DECIMALS = 9;
20
23
  const SolanaSendConfirmation = () => {
21
- var _a, _b;
24
+ var _a, _b, _c;
22
25
  const { sendForm, setRoute, publishableKey, triggerResize, walletConfig } = useOpenfort();
23
26
  const wallet = useSolanaEmbeddedWallet();
24
27
  const address = wallet.status === 'connected' ? wallet.address : undefined;
@@ -32,6 +35,15 @@ const SolanaSendConfirmation = () => {
32
35
  const decimals = asset.type === 'spl' ? asset.metadata.decimals : SOL_DECIMALS;
33
36
  // Fees are sponsored from config (the SVM counterpart of ethereumFeeSponsorshipId).
34
37
  const isSponsored = Boolean((_b = walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.solana) === null || _b === void 0 ? void 0 : _b.sponsorFees);
38
+ // Real network fee from the RPC (getFeeForMessage). Null while loading or on failure.
39
+ const feeQuery = useAsyncData({
40
+ queryKey: ['sol-fee', address, recipient, rpcUrl],
41
+ queryFn: () => address && recipient && rpcUrl
42
+ ? estimateSolanaTransferFeeLamports({ from: address, to: recipient, rpcUrl })
43
+ : Promise.resolve(null),
44
+ enabled: Boolean(address && recipient && rpcUrl),
45
+ });
46
+ const feeText = feeQuery.data != null ? `≈ ${formatBalance(feeQuery.data, SOL_DECIMALS)} SOL` : null;
35
47
  const [isLoading, setIsLoading] = useState(false);
36
48
  const [signature, setSignature] = useState(null);
37
49
  const [error, setError] = useState(null);
@@ -114,7 +126,7 @@ const SolanaSendConfirmation = () => {
114
126
  if (signature) {
115
127
  return (jsxs(PageContent, { children: [jsx(Loader, { isSuccess: true, header: "Transfer sent", description: `${amount} ${symbol} 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" })] })] }));
116
128
  }
117
- return (jsxs(PageContent, { onBack: routes.SOL_SEND, children: [jsx(ModalHeading, { children: "Confirm transfer" }), jsx(ModalBody, { children: "Review the transaction before sending." }), jsx(ConfirmationSummary, { amount: amount || '0', symbol: symbol, to: recipient ? { display: truncateSolanaAddress(recipient), value: recipient } : undefined, networkName: `Solana ${cluster.charAt(0).toUpperCase()}${cluster.slice(1)}`, payWith: address ? { display: truncateSolanaAddress(address), value: address } : undefined, fee: isSponsored ? jsx(SponsoredFee, { children: "Sponsored \u00B7 gasless" }) : jsx(FeesValue, { children: "Network fee" }) }), 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" })] })] }));
129
+ return (jsxs(PageContent, { onBack: routes.SOL_SEND, children: [jsx(ModalHeading, { children: "Confirm transfer" }), jsx(ModalBody, { children: "Review the transaction before sending." }), jsx(ConfirmationSummary, { amount: amount || '0', symbol: symbol, to: recipient ? { display: truncateSolanaAddress(recipient), value: recipient } : undefined, networkName: `Solana ${cluster.charAt(0).toUpperCase()}${cluster.slice(1)}`, networkIcon: currencyLogoUrl('SOL') ? jsx("img", { src: (_c = currencyLogoUrl('SOL')) !== null && _c !== void 0 ? _c : '', alt: "" }) : undefined, balance: formatBalanceWithSymbol(asset.balance, decimals, symbol), payWith: address ? { display: truncateSolanaAddress(address), value: address } : undefined, fee: jsx(FeesValue, { children: isSponsored ? (jsxs(Fragment, { children: [feeText && jsx(FeeStrike, { children: feeText }), " ", jsx(SponsoredText, { children: "Sponsored" })] })) : ((feeText !== null && feeText !== void 0 ? feeText : '--')) }) }), 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" })] })] }));
118
130
  };
119
131
 
120
132
  export { SolanaSendConfirmation };
@@ -1 +1 @@
1
- {"version":3,"file":"SolanaSendConfirmation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SolanaSendConfirmation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}