@openfort/react 1.5.0 → 1.6.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 (84) hide show
  1. package/build/components/Common/Chain/styles.d.ts +10 -0
  2. package/build/components/Common/Chain/styles.js +103 -1
  3. package/build/components/Common/Chain/styles.js.map +1 -1
  4. package/build/components/Common/Modal/index.js +2 -0
  5. package/build/components/Common/Modal/index.js.map +1 -1
  6. package/build/components/Common/SolanaChain/index.d.ts +5 -4
  7. package/build/components/Common/SolanaChain/index.js +9 -17
  8. package/build/components/Common/SolanaChain/index.js.map +1 -1
  9. package/build/components/ConnectModal/index.js +2 -0
  10. package/build/components/ConnectModal/index.js.map +1 -1
  11. package/build/components/Openfort/OpenfortProvider.js +4 -0
  12. package/build/components/Openfort/OpenfortProvider.js.map +1 -1
  13. package/build/components/Openfort/context.d.ts +4 -1
  14. package/build/components/Openfort/types.d.ts +22 -0
  15. package/build/components/Openfort/types.js +1 -0
  16. package/build/components/Openfort/types.js.map +1 -1
  17. package/build/components/Pages/Buy/styles.js +10 -10
  18. package/build/components/Pages/BuySelectProvider/index.js +9 -1
  19. package/build/components/Pages/BuySelectProvider/index.js.map +1 -1
  20. package/build/components/Pages/Connected/EthereumConnected.js +7 -1
  21. package/build/components/Pages/Connected/EthereumConnected.js.map +1 -1
  22. package/build/components/Pages/Deposit/TestnetNotice.js +15 -3
  23. package/build/components/Pages/Deposit/TestnetNotice.js.map +1 -1
  24. package/build/components/Pages/Deposit/UnsupportedNetworkNotice.d.ts +9 -0
  25. package/build/components/Pages/Deposit/UnsupportedNetworkNotice.js +11 -1
  26. package/build/components/Pages/Deposit/UnsupportedNetworkNotice.js.map +1 -1
  27. package/build/components/Pages/Deposit/index.js +2 -5
  28. package/build/components/Pages/Deposit/index.js.map +1 -1
  29. package/build/components/Pages/Deposit/paymentOptions.d.ts +0 -6
  30. package/build/components/Pages/Deposit/paymentOptions.js +3 -5
  31. package/build/components/Pages/Deposit/paymentOptions.js.map +1 -1
  32. package/build/components/Pages/Deposit/sources.d.ts +3 -0
  33. package/build/components/Pages/Deposit/sources.js +4 -1
  34. package/build/components/Pages/Deposit/sources.js.map +1 -1
  35. package/build/components/Pages/Deposit/useDepositRoute.d.ts +1 -0
  36. package/build/components/Pages/Deposit/useDepositRoute.js +37 -10
  37. package/build/components/Pages/Deposit/useDepositRoute.js.map +1 -1
  38. package/build/components/Pages/Deposit/useFundingTarget.d.ts +6 -4
  39. package/build/components/Pages/Deposit/useFundingTarget.js +18 -7
  40. package/build/components/Pages/Deposit/useFundingTarget.js.map +1 -1
  41. package/build/components/Pages/DepositCex/index.js +24 -5
  42. package/build/components/Pages/DepositCex/index.js.map +1 -1
  43. package/build/components/Pages/DepositCrypto/index.js +2 -2
  44. package/build/components/Pages/DepositWallet/index.js +2 -2
  45. package/build/components/Pages/Send/EthereumSend.js +10 -4
  46. package/build/components/Pages/Send/EthereumSend.js.map +1 -1
  47. package/build/components/Pages/Send/SolanaSend.js +9 -4
  48. package/build/components/Pages/Send/SolanaSend.js.map +1 -1
  49. package/build/components/Pages/Send/styles.d.ts +0 -1
  50. package/build/components/Pages/Send/styles.js +2 -13
  51. package/build/components/Pages/Send/styles.js.map +1 -1
  52. package/build/components/Pages/SendConfirmation/ConfirmationSummary.d.ts +27 -0
  53. package/build/components/Pages/SendConfirmation/ConfirmationSummary.js +15 -0
  54. package/build/components/Pages/SendConfirmation/ConfirmationSummary.js.map +1 -0
  55. package/build/components/Pages/SendConfirmation/SolanaSendConfirmation.js +3 -3
  56. package/build/components/Pages/SendConfirmation/index.js +14 -30
  57. package/build/components/Pages/SendConfirmation/index.js.map +1 -1
  58. package/build/components/Pages/SendConfirmation/styles.d.ts +7 -1
  59. package/build/components/Pages/SendConfirmation/styles.js +49 -17
  60. package/build/components/Pages/SendConfirmation/styles.js.map +1 -1
  61. package/build/components/Pages/SignMessage/index.d.ts +2 -0
  62. package/build/components/Pages/SignMessage/index.js +81 -0
  63. package/build/components/Pages/SignMessage/index.js.map +1 -0
  64. package/build/components/Pages/SignMessage/styles.d.ts +14 -0
  65. package/build/components/Pages/SignMessage/styles.js +82 -0
  66. package/build/components/Pages/SignMessage/styles.js.map +1 -0
  67. package/build/hooks/openfort/useSignMessage.d.ts +27 -0
  68. package/build/hooks/openfort/useSignMessage.js +52 -0
  69. package/build/hooks/openfort/useSignMessage.js.map +1 -0
  70. package/build/hooks/openfort/useUI.d.ts +6 -1
  71. package/build/hooks/openfort/useUI.js +12 -2
  72. package/build/hooks/openfort/useUI.js.map +1 -1
  73. package/build/index.d.ts +2 -1
  74. package/build/index.js +1 -0
  75. package/build/index.js.map +1 -1
  76. package/build/localizations/locales/en-US.js +1 -1
  77. package/build/utils/rpc.d.ts +6 -0
  78. package/build/utils/rpc.js +12 -1
  79. package/build/utils/rpc.js.map +1 -1
  80. package/build/version.d.ts +1 -1
  81. package/build/version.js +1 -1
  82. package/build/wagmi/components/ChainSelect/index.js +2 -94
  83. package/build/wagmi/components/ChainSelect/index.js.map +1 -1
  84. package/package.json +1 -1
@@ -8,13 +8,13 @@ import { sendSplTokenGasless, sendSplToken, sendSolGasless, sendSol } from '../.
8
8
  import 'detect-browser';
9
9
  import { truncateSolanaAddress } from '../../../utils/format.js';
10
10
  import Button from '../../Common/Button/index.js';
11
- import { CopyText } from '../../Common/CopyToClipboard/CopyText.js';
12
11
  import Loader from '../../Common/Loading/index.js';
13
12
  import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
14
13
  import { routes } from '../../Openfort/types.js';
15
14
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
16
15
  import { PageContent } from '../../PageContent/index.js';
17
- import { ButtonRow, SummaryList, SummaryItem, SummaryLabel, AmountValue, AddressValue, FeesValue, ErrorContainer, ErrorTitle, ErrorMessage } from './styles.js';
16
+ import { ConfirmationSummary } from './ConfirmationSummary.js';
17
+ import { ButtonRow, SponsoredFee, FeesValue, ErrorContainer, ErrorTitle, ErrorMessage } from './styles.js';
18
18
 
19
19
  const SOL_DECIMALS = 9;
20
20
  const SolanaSendConfirmation = () => {
@@ -114,7 +114,7 @@ const SolanaSendConfirmation = () => {
114
114
  if (signature) {
115
115
  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
116
  }
117
- 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', " ", symbol] })] }), 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) })) : ('--') })] }), isSponsored && (jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Network fee" }), jsx(FeesValue, { "$completed": true, children: "Sponsored" })] }))] }), 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" })] })] }));
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" })] })] }));
118
118
  };
119
119
 
120
120
  export { SolanaSendConfirmation };
@@ -13,23 +13,18 @@ import 'detect-browser';
13
13
  import { truncateEthAddress } from '../../../utils/format.js';
14
14
  import { parseTransactionError } from '../../../utils/errorHandling.js';
15
15
  import { logger } from '../../../utils/logger.js';
16
- import { getChainName, getDefaultEthereumRpcUrl } from '../../../utils/rpc.js';
16
+ import { getDefaultEthereumRpcUrl, getChainName } from '../../../utils/rpc.js';
17
17
  import Button from '../../Common/Button/index.js';
18
- import { CopyText } from '../../Common/CopyToClipboard/CopyText.js';
19
18
  import Loader from '../../Common/Loading/index.js';
20
19
  import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
21
20
  import { routes } from '../../Openfort/types.js';
22
21
  import { useOpenfort } from '../../Openfort/useOpenfort.js';
23
22
  import { PageContent } from '../../PageContent/index.js';
24
23
  import { sanitizeForParsing, isSameToken, getAssetDecimals, getAssetSymbol } from '../Send/utils.js';
24
+ import { ConfirmationSummary } from './ConfirmationSummary.js';
25
25
  import { EstimatedFees } from './EstimatedFees.js';
26
- import { ButtonRow, SummaryList, SummaryItem, SummaryLabel, AmountValue, AddressValue, FeesValue, CheckIconWrapper, StatusMessage, ErrorContainer, ErrorTitle, ErrorMessage, ErrorAction } from './styles.js';
26
+ import { ButtonRow, SponsoredFee, FeesValue, StatusMessage, ErrorContainer, ErrorTitle, ErrorMessage, ErrorAction } from './styles.js';
27
27
 
28
- /** Check if chain is a testnet */
29
- function isTestnetChain(chainId) {
30
- const testnets = new Set([5, 11155111, 80001, 84532, 421614, 97, 4002]);
31
- return testnets.has(chainId);
32
- }
33
28
  const SendConfirmation = () => {
34
29
  var _a, _b, _c, _d, _e, _f;
35
30
  const wallet = useEthereumEmbeddedWallet();
@@ -37,19 +32,7 @@ const SendConfirmation = () => {
37
32
  const { sendForm, setRoute, triggerResize, walletConfig } = useOpenfort();
38
33
  const address = wallet.status === 'connected' ? wallet.address : undefined;
39
34
  const chainId = wallet.status === 'connected' ? wallet.chainId : undefined;
40
- // Build chain info for block explorer
41
- const chain = chainId
42
- ? {
43
- id: chainId,
44
- name: getChainName(chainId),
45
- blockExplorers: {
46
- default: {
47
- url: getExplorerUrl(ChainTypeEnum.EVM, { chainId }),
48
- },
49
- },
50
- testnet: isTestnetChain(chainId),
51
- }
52
- : undefined;
35
+ const blockExplorerUrl = chainId ? getExplorerUrl(ChainTypeEnum.EVM, { chainId }) : undefined;
53
36
  const recipientAddress = isAddress(sendForm.recipient) ? sendForm.recipient : undefined;
54
37
  const normalisedAmount = sanitizeForParsing(sendForm.amount);
55
38
  const { data: assets } = useEthereumWalletAssets();
@@ -308,7 +291,6 @@ const SendConfirmation = () => {
308
291
  };
309
292
  const status = isSuccess ? 'success' : firstError ? 'error' : 'idle';
310
293
  const errorDetails = status === 'error' ? parseTransactionError(firstError) : null;
311
- const blockExplorerUrl = (_e = (_d = chain === null || chain === void 0 ? void 0 : chain.blockExplorers) === null || _d === void 0 ? void 0 : _d.default) === null || _e === void 0 ? void 0 : _e.url;
312
294
  const handleOpenBlockExplorer = () => {
313
295
  if ((receipt === null || receipt === void 0 ? void 0 : receipt.transactionHash) && blockExplorerUrl) {
314
296
  window.open(`${blockExplorerUrl}/tx/${receipt.transactionHash}`, '_blank', 'noopener,noreferrer');
@@ -325,19 +307,21 @@ const SendConfirmation = () => {
325
307
  if (typeof feeSponsorship === 'string')
326
308
  return true;
327
309
  return feeSponsorship[chainId !== null && chainId !== void 0 ? chainId : 0] !== undefined;
328
- }, [(_f = walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.ethereum) === null || _f === void 0 ? void 0 : _f.ethereumFeeSponsorshipId, chainId]);
310
+ }, [(_d = walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.ethereum) === null || _d === void 0 ? void 0 : _d.ethereumFeeSponsorshipId, chainId]);
311
+ const fiatTotal = useMemo(() => {
312
+ var _a, _b;
313
+ const perToken = (_b = (_a = token.metadata) === null || _a === void 0 ? void 0 : _a.fiat) === null || _b === void 0 ? void 0 : _b.value;
314
+ const n = Number(normalisedAmount);
315
+ if (!perToken || !Number.isFinite(n) || n <= 0)
316
+ return null;
317
+ return `$${(n * perToken).toFixed(2)}`;
318
+ }, [(_f = (_e = token.metadata) === null || _e === void 0 ? void 0 : _e.fiat) === null || _f === void 0 ? void 0 : _f.value, normalisedAmount]);
329
319
  if (isSuccess) {
330
320
  const successAmount = normalisedAmount || '0';
331
321
  const successSymbol = getAssetSymbol(token);
332
322
  return (jsxs(PageContent, { children: [jsx(Loader, { isSuccess: true, header: "Transfer Sent", description: `${successAmount} ${successSymbol} sent successfully` }), jsxs(ButtonRow, { children: [blockExplorerUrl && (jsx(Button, { variant: "primary", onClick: handleOpenBlockExplorer, children: "View on Explorer" })), jsx(Button, { variant: "secondary", onClick: handleFinish, children: "Back to profile" })] })] }));
333
323
  }
334
- return (jsxs(PageContent, { 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: [normalisedAmount || '0', " ", getAssetSymbol(token)] })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "From" }), jsx(AddressValue, { children: address ? (jsx(CopyText, { size: "1rem", value: address, children: truncateEthAddress(address) })) : ('--') })] }), jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "To" }), jsx(AddressValue, { children: recipientAddress ? (jsx(CopyText, { size: "1rem", value: recipientAddress, children: truncateEthAddress(recipientAddress) })) : ('--') })] }), jsxs("div", { children: [jsxs(SummaryItem, { children: [jsx(SummaryLabel, { children: "Estimated fees" }), jsxs(FeesValue, { "$completed": isSponsored, children: [jsx(EstimatedFees, { account: address, to: token.type === 'erc20' ? token.address : recipientAddress, value: token.type === 'native' && parsedAmount ? parsedAmount : undefined, data: transferData, chainId: chainId, nativeSymbol: nativeSymbol, enabled: Boolean(address && recipientAddress && parsedAmount && parsedAmount > BigInt(0)), hideInfoIcon: isSponsored }), jsx(CheckIconWrapper, { children: jsx(TickIcon, {}) })] })] }), isSponsored && (jsx("div", { style: {
335
- textAlign: 'end',
336
- marginTop: '4px',
337
- width: '100%',
338
- color: 'var(--ck-body-color-valid)',
339
- fontSize: '12px',
340
- }, children: "Sponsored transaction" }))] })] }), insufficientBalance && !isSuccess && (jsx(StatusMessage, { "$status": "error", children: "Insufficient balance for this transfer." })), errorDetails && (jsxs(ErrorContainer, { children: [jsx(ErrorTitle, { children: errorDetails.title }), jsx(ErrorMessage, { children: errorDetails.message }), errorDetails.action && jsx(ErrorAction, { children: errorDetails.action })] })), jsxs(ButtonRow, { children: [jsx(Button, { variant: "primary", onClick: isSuccess ? handleOpenBlockExplorer : handleConfirm, disabled: isSuccess
324
+ return (jsxs(PageContent, { children: [jsx(ModalHeading, { children: "Confirm transfer" }), jsx(ModalBody, { children: "Review the transaction before sending." }), jsx(ConfirmationSummary, { amount: normalisedAmount || '0', symbol: getAssetSymbol(token), fiat: fiatTotal, to: recipientAddress ? { display: truncateEthAddress(recipientAddress), value: recipientAddress } : undefined, networkName: getChainName(chainId !== null && chainId !== void 0 ? chainId : 0), payWith: address ? { display: truncateEthAddress(address), value: address } : undefined, fee: isSponsored ? (jsx(SponsoredFee, { children: "Sponsored \u00B7 gasless" })) : (jsx(FeesValue, { children: jsx(EstimatedFees, { account: address, to: token.type === 'erc20' ? token.address : recipientAddress, value: token.type === 'native' && parsedAmount ? parsedAmount : undefined, data: transferData, chainId: chainId, nativeSymbol: nativeSymbol, enabled: Boolean(address && recipientAddress && parsedAmount && parsedAmount > BigInt(0)), hideInfoIcon: false }) })) }), insufficientBalance && !isSuccess && (jsx(StatusMessage, { "$status": "error", children: "Insufficient balance for this transfer." })), errorDetails && (jsxs(ErrorContainer, { children: [jsx(ErrorTitle, { children: errorDetails.title }), jsx(ErrorMessage, { children: errorDetails.message }), errorDetails.action && jsx(ErrorAction, { children: errorDetails.action })] })), jsxs(ButtonRow, { children: [jsx(Button, { variant: "primary", onClick: isSuccess ? handleOpenBlockExplorer : handleConfirm, disabled: isSuccess
341
325
  ? false
342
326
  : isLoading ||
343
327
  Boolean(transactionHash) ||
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,13 @@ export declare const AddressValue: import("styled-components").StyledComponent<"
6
6
  export declare const FeesValue: import("styled-components").StyledComponent<"span", any, {
7
7
  $completed?: boolean;
8
8
  }, never>;
9
- export declare const CheckIconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
9
+ export declare const FiatValue: import("styled-components").StyledComponent<"span", any, {}, never>;
10
+ export declare const NetworkValue: import("styled-components").StyledComponent<"span", any, {}, never>;
11
+ export declare const SponsoredFee: import("styled-components").StyledComponent<"span", any, {}, never>;
12
+ export declare const PayWithCard: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export declare const PayWithMeta: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export declare const PayWithAddress: import("styled-components").StyledComponent<"span", any, {}, never>;
15
+ export declare const PayWithBadge: import("styled-components").StyledComponent<"span", any, {}, never>;
10
16
  export declare const InfoIconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
11
17
  export declare const ButtonRow: import("styled-components").StyledComponent<"div", any, {}, never>;
12
18
  export declare const StatusMessage: import("styled-components").StyledComponent<"div", any, {
@@ -45,26 +45,58 @@ const FeesValue = styled(SummaryValue) `
45
45
  text-decoration: ${(props) => (props.$completed ? 'line-through' : 'none')};
46
46
  opacity: ${(props) => (props.$completed ? 0.6 : 1)};
47
47
  `;
48
- const CheckIconWrapper = styled.span `
49
- color: var(--ck-body-color);
50
- line-height: 0;
48
+ const FiatValue = styled.span `
49
+ margin-left: 6px;
50
+ font-size: 13px;
51
+ font-weight: 400;
52
+ color: var(--ck-body-color-muted);
53
+ `;
54
+ const NetworkValue = styled(SummaryValue) `
51
55
  display: inline-flex;
52
56
  align-items: center;
53
-
54
- svg {
55
- width: 16px;
56
- height: 16px;
57
+ justify-content: flex-end;
58
+ gap: 6px;
59
+
60
+ svg,
61
+ img {
62
+ width: 18px;
63
+ height: 18px;
64
+ border-radius: 50%;
57
65
  }
58
66
  `;
59
- // export const BalanceSpinnerWrapper = styled.span`
60
- // display: inline-flex;
61
- // align-items: center;
62
- // margin-left: 8px;
63
- // svg {
64
- // width: 14px;
65
- // height: 14px;
66
- // }
67
- // `
67
+ const SponsoredFee = styled(SummaryValue) `
68
+ color: var(--ck-body-color-valid, #16a34a);
69
+ `;
70
+ const PayWithCard = styled.div `
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: space-between;
74
+ gap: 12px;
75
+ margin-top: 4px;
76
+ padding: 12px 14px;
77
+ border-radius: 14px;
78
+ background: var(--ck-body-background-secondary, rgba(0, 0, 0, 0.04));
79
+ `;
80
+ const PayWithMeta = styled.div `
81
+ display: flex;
82
+ flex-direction: column;
83
+ gap: 2px;
84
+ text-align: left;
85
+ `;
86
+ const PayWithAddress = styled.span `
87
+ font-size: 14px;
88
+ font-weight: 600;
89
+ color: var(--ck-body-color);
90
+ `;
91
+ const PayWithBadge = styled.span `
92
+ flex-shrink: 0;
93
+ padding: 4px 10px;
94
+ border-radius: 999px;
95
+ font-size: 13px;
96
+ font-weight: 600;
97
+ color: var(--ck-body-color-valid, #16a34a);
98
+ background: var(--ck-body-background, rgba(22, 163, 74, 0.12));
99
+ `;
68
100
  const InfoIconWrapper = styled.span `
69
101
  color: var(--ck-body-color-muted);
70
102
  opacity: 0.6;
@@ -125,5 +157,5 @@ const ErrorAction = styled.div `
125
157
  line-height: 1.4;
126
158
  `;
127
159
 
128
- export { AddressValue, AmountValue, ButtonRow, CheckIconWrapper, ErrorAction, ErrorContainer, ErrorMessage, ErrorTitle, FeesValue, InfoIconWrapper, StatusMessage, SummaryItem, SummaryLabel, SummaryList };
160
+ export { AddressValue, AmountValue, ButtonRow, ErrorAction, ErrorContainer, ErrorMessage, ErrorTitle, FeesValue, FiatValue, InfoIconWrapper, NetworkValue, PayWithAddress, PayWithBadge, PayWithCard, PayWithMeta, SponsoredFee, StatusMessage, SummaryItem, SummaryLabel, SummaryList };
129
161
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ declare const SignMessage: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default SignMessage;
@@ -0,0 +1,81 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
4
+ import Button from '../../Common/Button/index.js';
5
+ import { CopyButton } from '../../Common/CopyToClipboard/CopyButton.js';
6
+ import { useOpenfort } from '../../Openfort/useOpenfort.js';
7
+ import { PageContent } from '../../PageContent/index.js';
8
+ import { SuccessWrap, SuccessCircle, SuccessTitle, SignaturePreview, SignContent, Subtitle, MessageBox, CopyRow, ErrorText, DataList, DataItem, DataKey } from './styles.js';
9
+
10
+ /** Renders an EIP-712 value as a readable nested bullet list. */
11
+ function DataNode({ value }) {
12
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
13
+ return (jsx(DataList, { children: Object.entries(value).map(([key, child]) => (jsxs(DataItem, { children: [jsxs(DataKey, { children: [key, ":"] }), ' ', child !== null && typeof child === 'object' ? jsx(DataNode, { value: child }) : String(child)] }, key))) }));
14
+ }
15
+ return jsx(Fragment, { children: String(value) });
16
+ }
17
+ const SignMessage = () => {
18
+ var _a;
19
+ const { signRequest, setSignRequest, setOpen, uiConfig, triggerResize } = useOpenfort();
20
+ const wallet = useEthereumEmbeddedWallet();
21
+ const [signing, setSigning] = useState(false);
22
+ const [error, setError] = useState(null);
23
+ const [signature, setSignature] = useState(null);
24
+ const settledRef = useRef(false);
25
+ // Reject the pending request if the screen unmounts before signing (the user
26
+ // closed the modal or navigated away).
27
+ useEffect(() => {
28
+ return () => {
29
+ if (!settledRef.current)
30
+ signRequest === null || signRequest === void 0 ? void 0 : signRequest.reject(new Error('User rejected the signature request'));
31
+ };
32
+ }, [signRequest]);
33
+ // Content height changes between the views; re-measure.
34
+ useEffect(() => {
35
+ triggerResize();
36
+ }, [triggerResize]);
37
+ if (!signRequest)
38
+ return null;
39
+ const appName = (_a = uiConfig.appName) !== null && _a !== void 0 ? _a : 'This app';
40
+ const close = () => {
41
+ setSignRequest(null);
42
+ setOpen(false);
43
+ };
44
+ const handleSign = async () => {
45
+ var _a;
46
+ setError(null);
47
+ setSigning(true);
48
+ try {
49
+ const provider = await ((_a = wallet.activeWallet) === null || _a === void 0 ? void 0 : _a.getProvider());
50
+ const address = wallet.address;
51
+ if (!provider || !address)
52
+ throw new Error('No connected wallet to sign with');
53
+ const signed = (signRequest.kind === 'message'
54
+ ? await provider.request({ method: 'personal_sign', params: [signRequest.message, address] })
55
+ : await provider.request({
56
+ method: 'eth_signTypedData_v4',
57
+ params: [address, JSON.stringify(signRequest.typedData)],
58
+ }));
59
+ settledRef.current = true;
60
+ signRequest.resolve(signed);
61
+ setSignature(signed);
62
+ setSigning(false);
63
+ triggerResize();
64
+ }
65
+ catch (e) {
66
+ setError(e instanceof Error ? e.message : 'Failed to sign the message');
67
+ setSigning(false);
68
+ }
69
+ };
70
+ if (signature) {
71
+ return (jsx(PageContent, { onBack: null, children: jsxs(SuccessWrap, { children: [jsx(SuccessCircle, { children: jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: jsx("path", { d: "M20 6 9 17l-5-5", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), jsx(SuccessTitle, { children: "Message signed" }), jsx(SignaturePreview, { children: `${signature.slice(0, 14)}…${signature.slice(-12)}` }), jsx(Button, { variant: "primary", onClick: close, children: "Done" })] }) }));
72
+ }
73
+ return (jsx(PageContent, { onBack: null, children: jsxs(SignContent, { children: [jsxs(Subtitle, { children: [appName, " wants you to sign a message. It will not cost you any fees."] }), signRequest.kind === 'message' ? (jsx(MessageBox, { children: signRequest.message })) : (jsxs(Fragment, { children: [jsx(MessageBox, { "$scroll": true, children: jsx(DataNode, { value: {
74
+ domain: signRequest.typedData.domain,
75
+ primaryType: signRequest.typedData.primaryType,
76
+ message: signRequest.typedData.message,
77
+ } }) }), jsx(CopyRow, { children: jsx(CopyButton, { value: JSON.stringify(signRequest.typedData, null, 2), children: "Copy to clipboard" }) })] })), error && jsx(ErrorText, { children: error }), jsx(Button, { variant: "primary", onClick: handleSign, waiting: signing, disabled: signing, arrow: true, children: "Sign and continue" })] }) }));
78
+ };
79
+
80
+ export { SignMessage as default };
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,14 @@
1
+ export declare const SignContent: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const Subtitle: import("styled-components").StyledComponent<"p", any, {}, never>;
3
+ export declare const MessageBox: import("styled-components").StyledComponent<"div", any, {
4
+ $scroll?: boolean;
5
+ }, never>;
6
+ export declare const DataList: import("styled-components").StyledComponent<"ul", any, {}, never>;
7
+ export declare const DataItem: import("styled-components").StyledComponent<"li", any, {}, never>;
8
+ export declare const DataKey: import("styled-components").StyledComponent<"span", any, {}, never>;
9
+ export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export declare const CopyRow: import("styled-components").StyledComponent<"div", any, {}, never>;
11
+ export declare const SuccessWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const SuccessCircle: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export declare const SuccessTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export declare const SignaturePreview: import("styled-components").StyledComponent<"code", any, {}, never>;
@@ -0,0 +1,82 @@
1
+ import styled from '../../../styles/styled/index.js';
2
+
3
+ const SignContent = styled.div `
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 16px;
7
+ `;
8
+ const Subtitle = styled.p `
9
+ margin: 0;
10
+ text-align: center;
11
+ font-size: 15px;
12
+ line-height: 1.4;
13
+ color: var(--ck-body-color-muted, #999);
14
+ `;
15
+ const MessageBox = styled.div `
16
+ padding: 16px;
17
+ border-radius: 12px;
18
+ background: var(--ck-body-background-secondary, rgba(0, 0, 0, 0.04));
19
+ color: var(--ck-body-color, #111);
20
+ font-size: 14px;
21
+ line-height: 1.45;
22
+ text-align: left;
23
+ word-break: break-word;
24
+ white-space: pre-wrap;
25
+ ${({ $scroll }) => $scroll && 'max-height: 320px; overflow-y: auto;'}
26
+ `;
27
+ const DataList = styled.ul `
28
+ margin: 0;
29
+ padding-left: 18px;
30
+ list-style: disc;
31
+ `;
32
+ const DataItem = styled.li `
33
+ margin: 2px 0;
34
+ `;
35
+ const DataKey = styled.span `
36
+ color: var(--ck-body-color-muted, #777);
37
+ `;
38
+ const ErrorText = styled.div `
39
+ text-align: center;
40
+ font-size: 13px;
41
+ color: var(--ck-body-color-danger, #e7000b);
42
+ `;
43
+ const CopyRow = styled.div `
44
+ display: flex;
45
+ justify-content: center;
46
+ `;
47
+ const SuccessWrap = styled.div `
48
+ display: flex;
49
+ flex-direction: column;
50
+ align-items: center;
51
+ gap: 12px;
52
+ padding: 12px 0 4px;
53
+ `;
54
+ const SuccessCircle = styled.div `
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ width: 56px;
59
+ height: 56px;
60
+ border-radius: 50%;
61
+ color: #fff;
62
+ background: var(--ck-body-color-valid, #16a34a);
63
+ `;
64
+ const SuccessTitle = styled.div `
65
+ font-size: 17px;
66
+ font-weight: 600;
67
+ color: var(--ck-body-color, #111);
68
+ `;
69
+ const SignaturePreview = styled.code `
70
+ display: block;
71
+ max-width: 100%;
72
+ padding: 10px 12px;
73
+ border-radius: 10px;
74
+ background: var(--ck-body-background-secondary, rgba(0, 0, 0, 0.04));
75
+ color: var(--ck-body-color-muted, #777);
76
+ font-size: 12px;
77
+ word-break: break-all;
78
+ text-align: center;
79
+ `;
80
+
81
+ export { CopyRow, DataItem, DataKey, DataList, ErrorText, MessageBox, SignContent, SignaturePreview, Subtitle, SuccessCircle, SuccessTitle, SuccessWrap };
82
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,27 @@
1
+ import { type SignTypedDataPayload } from '../../components/Openfort/types';
2
+ /**
3
+ * Hook for signing messages with a confirmation modal (EVM only).
4
+ *
5
+ * Opens the Openfort "Sign message" screen, shows the message (or EIP-712 typed
6
+ * data) to the user, and resolves with the signature once they confirm. Rejects
7
+ * if the user dismisses the modal.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const { signMessage, signTypedData, isPending } = useSignMessage()
12
+ *
13
+ * const signature = await signMessage('I hereby vote for foobar')
14
+ *
15
+ * const typedSignature = await signTypedData({
16
+ * domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0x…' },
17
+ * types: { Person: [{ name: 'name', type: 'string' }] },
18
+ * primaryType: 'Person',
19
+ * message: { name: 'Cow' },
20
+ * })
21
+ * ```
22
+ */
23
+ export declare function useSignMessage(): {
24
+ signMessage: (message: string) => Promise<`0x${string}`>;
25
+ signTypedData: (typedData: SignTypedDataPayload) => Promise<`0x${string}`>;
26
+ isPending: boolean;
27
+ };
@@ -0,0 +1,52 @@
1
+ import { useState, useCallback } from 'react';
2
+ import { routes } from '../../components/Openfort/types.js';
3
+ import { useOpenfort } from '../../components/Openfort/useOpenfort.js';
4
+
5
+ /**
6
+ * Hook for signing messages with a confirmation modal (EVM only).
7
+ *
8
+ * Opens the Openfort "Sign message" screen, shows the message (or EIP-712 typed
9
+ * data) to the user, and resolves with the signature once they confirm. Rejects
10
+ * if the user dismisses the modal.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * const { signMessage, signTypedData, isPending } = useSignMessage()
15
+ *
16
+ * const signature = await signMessage('I hereby vote for foobar')
17
+ *
18
+ * const typedSignature = await signTypedData({
19
+ * domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0x…' },
20
+ * types: { Person: [{ name: 'name', type: 'string' }] },
21
+ * primaryType: 'Person',
22
+ * message: { name: 'Cow' },
23
+ * })
24
+ * ```
25
+ */
26
+ function useSignMessage() {
27
+ const { setSignRequest, setRoute, setOpen } = useOpenfort();
28
+ const [isPending, setIsPending] = useState(false);
29
+ const request = useCallback((args) => new Promise((resolve, reject) => {
30
+ setIsPending(true);
31
+ // setOpen(true) resets route/history, so it MUST run before setRoute.
32
+ setOpen(true);
33
+ setSignRequest({
34
+ ...args,
35
+ resolve: (signature) => {
36
+ setIsPending(false);
37
+ resolve(signature);
38
+ },
39
+ reject: (reason) => {
40
+ setIsPending(false);
41
+ reject(reason);
42
+ },
43
+ });
44
+ setRoute(routes.SIGN_MESSAGE);
45
+ }), [setSignRequest, setRoute, setOpen]);
46
+ const signMessage = useCallback((message) => request({ kind: 'message', message }), [request]);
47
+ const signTypedData = useCallback((typedData) => request({ kind: 'typedData', typedData }), [request]);
48
+ return { signMessage, signTypedData, isPending };
49
+ }
50
+
51
+ export { useSignMessage };
52
+ //# sourceMappingURL=useSignMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSignMessage.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import { type Asset } from '../../components/Openfort/types';
1
2
  /**
2
3
  * Hook for controlling Openfort UI modal and navigation
3
4
  *
@@ -35,7 +36,11 @@ export declare function useUI(): {
35
36
  openSwitchNetworks: () => void;
36
37
  openProviders: () => void;
37
38
  openWallets: () => void;
38
- openSend: () => void;
39
+ openSend: (tx?: {
40
+ to: string;
41
+ amount: string;
42
+ asset?: Asset;
43
+ }) => void;
39
44
  openReceive: () => void;
40
45
  openFunding: () => void;
41
46
  openBuy: () => void;
@@ -68,7 +68,7 @@ function isAccountId(id) {
68
68
  */
69
69
  function useUI() {
70
70
  var _a;
71
- const { open, setOpen, setRoute, setConnector, connector, chainType } = useOpenfort();
71
+ const { open, setOpen, setRoute, setConnector, setSendForm, connector, chainType } = useOpenfort();
72
72
  const { isLoading, user, needsRecovery, embeddedAccounts, activeEmbeddedAddress, embeddedState } = useOpenfortCore();
73
73
  const bridge = useEthereumBridge();
74
74
  const strategy = useConnectionStrategy();
@@ -100,6 +100,16 @@ function useUI() {
100
100
  else
101
101
  setRoute(routes.CONNECTED);
102
102
  }
103
+ /**
104
+ * Prefill the send form and jump straight to the confirmation (preview) screen
105
+ * for the active chain, skipping asset/amount/recipient entry.
106
+ */
107
+ const openSendPreview = (tx) => {
108
+ var _a;
109
+ setSendForm({ recipient: tx.to, amount: tx.amount, asset: (_a = tx.asset) !== null && _a !== void 0 ? _a : { type: 'native', balance: BigInt(0) } });
110
+ setOpen(true);
111
+ setRoute(chainType === ChainTypeEnum.SVM ? routes.SOL_SEND_CONFIRMATION : routes.SEND_CONFIRMATION);
112
+ };
103
113
  const gotoAndOpen = (route) => {
104
114
  const safeList = isConnected ? safeRoutes.connected : safeRoutes.disconnected;
105
115
  const fallback = isConnected ? routes.CONNECTED : routes.PROVIDERS;
@@ -123,7 +133,7 @@ function useUI() {
123
133
  openSwitchNetworks: () => gotoAndOpen(routes.ETH_SWITCH_NETWORK),
124
134
  openProviders: () => gotoAndOpen(routes.PROVIDERS),
125
135
  openWallets: () => gotoAndOpen({ route: routes.CONNECTORS, connectType: 'linkIfUserConnectIfNoUser' }),
126
- openSend: () => gotoAndOpen(routes.SEND),
136
+ openSend: (tx) => tx ? openSendPreview(tx) : gotoAndOpen(routes.SEND),
127
137
  openReceive: () => gotoAndOpen(routes.RECEIVE),
128
138
  openFunding: () => gotoAndOpen(routes.DEPOSIT),
129
139
  openBuy: () => gotoAndOpen(routes.BUY),
@@ -1 +1 @@
1
- {"version":3,"file":"useUI.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"useUI.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/build/index.d.ts CHANGED
@@ -44,7 +44,7 @@ export { default as Avatar } from './components/Common/Avatar';
44
44
  export { default as ChainIcon } from './components/Common/Chain';
45
45
  export { OpenfortButton } from './components/ConnectButton';
46
46
  export { OpenfortProvider } from './components/Openfort/OpenfortProvider';
47
- export type { CustomizableRoutes, MultiChainAsset } from './components/Openfort/types';
47
+ export type { CustomizableRoutes, MultiChainAsset, SignTypedDataPayload } from './components/Openfort/types';
48
48
  export { FundingMethod, LinkWalletOnSignUpOption, UIAuthProvider as AuthProvider } from './components/Openfort/types';
49
49
  export { embeddedWalletId } from './constants/openfort';
50
50
  export { OpenfortError, OpenfortReactErrorType, OpenfortReactErrorType as OpenfortErrorType, } from './core/errors';
@@ -64,6 +64,7 @@ export type { FundingSession, FundingTarget, PaymentMethod, PaymentMethodInput,
64
64
  export { useFunding } from './hooks/openfort/useFunding';
65
65
  export { useGrantPermissions } from './hooks/openfort/useGrantPermissions';
66
66
  export { useRevokePermissions } from './hooks/openfort/useRevokePermissions';
67
+ export { useSignMessage } from './hooks/openfort/useSignMessage';
67
68
  export { useUI } from './hooks/openfort/useUI';
68
69
  export { useUser } from './hooks/openfort/useUser';
69
70
  export type { UserWallet } from './hooks/openfort/walletTypes';
package/build/index.js CHANGED
@@ -17,6 +17,7 @@ export { use7702Authorization } from './hooks/openfort/use7702Authorization.js';
17
17
  export { useFunding } from './hooks/openfort/useFunding.js';
18
18
  export { useGrantPermissions } from './hooks/openfort/useGrantPermissions.js';
19
19
  export { useRevokePermissions } from './hooks/openfort/useRevokePermissions.js';
20
+ export { useSignMessage } from './hooks/openfort/useSignMessage.js';
20
21
  export { useUI } from './hooks/openfort/useUI.js';
21
22
  export { useUser } from './hooks/openfort/useUser.js';
22
23
  export { invalidateBalance } from './hooks/useBalance.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -86,7 +86,7 @@ const enUS = {
86
86
  injectionScreen_notconnected_h1: `Login to {{ CONNECTORNAME }}`,
87
87
  injectionScreen_notconnected_p: `To continue, please login to your {{ CONNECTORNAME }} extension.`,
88
88
  profileScreen_heading: 'Connected',
89
- buyScreen_heading: 'Add funds',
89
+ buyScreen_heading: 'Add funds from card',
90
90
  buyScreen_subheading: 'Select an amount and token to top up.',
91
91
  buyScreen_payWithCard_title: 'Pay with card',
92
92
  buyScreen_payWithCard_description: 'Use Stripe or Google Pay for a quick card purchase.',
@@ -6,6 +6,12 @@
6
6
  */
7
7
  import type { Chain } from 'viem';
8
8
  import type { SolanaCluster } from '../solana/types';
9
+ /**
10
+ * Whether an EVM chain id is a testnet. Reads viem's chain metadata (`testnet`)
11
+ * for the chains the SDK bundles, falling back to a small extra set. Use this to
12
+ * key behaviour off the wallet's active chain rather than the publishable key.
13
+ */
14
+ export declare function isTestnetChainId(chainId: number): boolean;
9
15
  export declare function getDefaultEthereumRpcUrl(chainId: number): string;
10
16
  /**
11
17
  * Get default Solana RPC URL for a cluster.