@dynamic-labs/sdk-react-core 4.80.0 → 4.82.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 (68) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +12 -12
  5. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +63 -3
  6. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +63 -3
  7. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.cjs +40 -0
  8. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.d.ts +16 -0
  9. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.js +36 -0
  10. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.cjs +17 -0
  11. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.d.ts +8 -0
  12. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.js +12 -0
  13. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/index.d.ts +1 -0
  14. package/src/lib/data/api/aleo/getAleoCuratedPrices.cjs +73 -0
  15. package/src/lib/data/api/aleo/getAleoCuratedPrices.d.ts +38 -0
  16. package/src/lib/data/api/aleo/getAleoCuratedPrices.js +69 -0
  17. package/src/lib/shared/assets/index.d.ts +2 -0
  18. package/src/lib/shared/assets/midnight-shielded.cjs +54 -0
  19. package/src/lib/shared/assets/midnight-shielded.js +30 -0
  20. package/src/lib/shared/assets/midnight-unshielded.cjs +54 -0
  21. package/src/lib/shared/assets/midnight-unshielded.js +30 -0
  22. package/src/lib/styles/index.shadow.cjs +1 -1
  23. package/src/lib/styles/index.shadow.js +1 -1
  24. package/src/lib/utils/functions/compareChains/compareChains.cjs +1 -0
  25. package/src/lib/utils/functions/compareChains/compareChains.js +1 -0
  26. package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.cjs +12 -0
  27. package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.js +12 -0
  28. package/src/lib/utils/hooks/useAleoAutoMergeRecords/index.d.ts +1 -0
  29. package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.cjs +246 -0
  30. package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.d.ts +17 -0
  31. package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.js +242 -0
  32. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/index.d.ts +1 -0
  33. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.cjs +263 -0
  34. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.d.ts +59 -0
  35. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.js +259 -0
  36. package/src/lib/utils/hooks/useAleoShieldedBalances/index.d.ts +1 -0
  37. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs +443 -0
  38. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.d.ts +24 -0
  39. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js +439 -0
  40. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +1 -0
  41. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -0
  42. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +1 -0
  43. package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +12 -1
  44. package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +12 -1
  45. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +53 -0
  46. package/src/lib/views/SendBalanceView/SendBalanceView.js +53 -0
  47. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.cjs +193 -0
  48. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.d.ts +7 -0
  49. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.js +189 -0
  50. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/index.d.ts +1 -0
  51. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +216 -11
  52. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +216 -11
  53. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +5 -2
  54. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.d.ts +10 -1
  55. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +5 -2
  56. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/index.d.ts +1 -0
  57. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.cjs +2 -2
  58. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.d.ts +3 -1
  59. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.js +2 -2
  60. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.cjs +124 -0
  61. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.d.ts +9 -0
  62. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.js +120 -0
  63. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/index.d.ts +1 -0
  64. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +21 -10
  65. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +22 -11
  66. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.cjs +22 -2
  67. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.d.ts +8 -1
  68. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.js +23 -3
@@ -71,6 +71,7 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
71
71
  require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
72
72
  require('react-focus-lock');
73
73
  var Icon = require('../../../../components/Icon/Icon.cjs');
74
+ var shortenWalletAddress = require('../../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
74
75
  require('../../context/DynamicWidgetContext.cjs');
75
76
  require('../../../../components/IconButton/IconButton.cjs');
76
77
  require('../../../../utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
@@ -113,11 +114,30 @@ require('../../../../components/IsBrowser/IsBrowser.cjs');
113
114
  require('../../../../components/Popper/Popper/Popper.cjs');
114
115
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
115
116
 
117
+ const MIDNIGHT_ADDRESS_ROWS = [
118
+ {
119
+ field: 'unshielded',
120
+ key: 'dyn_active_wallet_info.midnight_unshielded_address',
121
+ },
122
+ {
123
+ field: 'shielded',
124
+ key: 'dyn_active_wallet_info.midnight_shielded_address',
125
+ },
126
+ {
127
+ field: 'dust',
128
+ key: 'dyn_active_wallet_info.midnight_dust_address',
129
+ },
130
+ ];
116
131
  /** Component for wallet detail overlays */
117
- const WalletDetailsCard = ({ address, open, onClose, }) => {
132
+ const WalletDetailsCard = ({ address, open, onClose, midnightAddresses, }) => {
118
133
  const { t } = reactI18next.useTranslation();
119
134
  const copyIcon = (jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-secondary', children: jsxRuntime.jsx(copy.ReactComponent, {}) }));
120
- return (jsxRuntime.jsxs(OverlayCard.OverlayCard, { isOpen: open, onClose: onClose, children: [jsxRuntime.jsx(OverlayCard.OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsxRuntime.jsxs(OverlayCard.OverlayCard.Content, { className: 'wallet-details-card__body', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })] }));
135
+ return (jsxRuntime.jsxs(OverlayCard.OverlayCard, { isOpen: open, onClose: onClose, children: [jsxRuntime.jsx(OverlayCard.OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsxRuntime.jsx(OverlayCard.OverlayCard.Content, { className: 'wallet-details-card__body', children: midnightAddresses ? (MIDNIGHT_ADDRESS_ROWS.map(({ key, field }) => {
136
+ const addr = midnightAddresses[field];
137
+ if (!addr)
138
+ return null;
139
+ return (jsxRuntime.jsxs("div", { className: 'wallet-details-card__address-block', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: key, children: t(key) }), jsxRuntime.jsxs("div", { className: 'wallet-details-card__address-row', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: shortenWalletAddress.shortenWalletAddress(addr) }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: addr, children: copyIcon })] })] }, field));
140
+ })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })) })] }));
121
141
  };
122
142
 
123
143
  exports.WalletDetailsCard = WalletDetailsCard;
@@ -1,4 +1,9 @@
1
1
  /// <reference types="react" />
2
+ type MidnightAddresses = {
3
+ unshielded?: string;
4
+ shielded?: string;
5
+ dust?: string;
6
+ };
2
7
  type WalletDetailsCardProps = {
3
8
  /** String representation of a wallet address */
4
9
  address: string;
@@ -6,7 +11,9 @@ type WalletDetailsCardProps = {
6
11
  open: boolean;
7
12
  /** Callback when the overlay is closed */
8
13
  onClose: VoidFunction;
14
+ /** When provided, renders separate Midnight address rows instead of a single address */
15
+ midnightAddresses?: MidnightAddresses;
9
16
  };
10
17
  /** Component for wallet detail overlays */
11
- export declare const WalletDetailsCard: ({ address, open, onClose, }: WalletDetailsCardProps) => JSX.Element;
18
+ export declare const WalletDetailsCard: ({ address, open, onClose, midnightAddresses, }: WalletDetailsCardProps) => JSX.Element;
12
19
  export {};
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
5
5
  import 'react';
@@ -67,6 +67,7 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
67
67
  import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
68
68
  import 'react-focus-lock';
69
69
  import { Icon } from '../../../../components/Icon/Icon.js';
70
+ import { shortenWalletAddress } from '../../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
70
71
  import '../../context/DynamicWidgetContext.js';
71
72
  import '../../../../components/IconButton/IconButton.js';
72
73
  import '../../../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
@@ -109,11 +110,30 @@ import '../../../../components/IsBrowser/IsBrowser.js';
109
110
  import '../../../../components/Popper/Popper/Popper.js';
110
111
  import '../../../../components/Popper/PopperContext/PopperContext.js';
111
112
 
113
+ const MIDNIGHT_ADDRESS_ROWS = [
114
+ {
115
+ field: 'unshielded',
116
+ key: 'dyn_active_wallet_info.midnight_unshielded_address',
117
+ },
118
+ {
119
+ field: 'shielded',
120
+ key: 'dyn_active_wallet_info.midnight_shielded_address',
121
+ },
122
+ {
123
+ field: 'dust',
124
+ key: 'dyn_active_wallet_info.midnight_dust_address',
125
+ },
126
+ ];
112
127
  /** Component for wallet detail overlays */
113
- const WalletDetailsCard = ({ address, open, onClose, }) => {
128
+ const WalletDetailsCard = ({ address, open, onClose, midnightAddresses, }) => {
114
129
  const { t } = useTranslation();
115
130
  const copyIcon = (jsx(Icon, { size: 'small', color: 'text-secondary', children: jsx(SvgCopy, {}) }));
116
- return (jsxs(OverlayCard, { isOpen: open, onClose: onClose, children: [jsx(OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsxs(OverlayCard.Content, { className: 'wallet-details-card__body', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsx(CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })] }));
131
+ return (jsxs(OverlayCard, { isOpen: open, onClose: onClose, children: [jsx(OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsx(OverlayCard.Content, { className: 'wallet-details-card__body', children: midnightAddresses ? (MIDNIGHT_ADDRESS_ROWS.map(({ key, field }) => {
132
+ const addr = midnightAddresses[field];
133
+ if (!addr)
134
+ return null;
135
+ return (jsxs("div", { className: 'wallet-details-card__address-block', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: key, children: t(key) }), jsxs("div", { className: 'wallet-details-card__address-row', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: shortenWalletAddress(addr) }), jsx(CopyButton, { textToCopy: addr, children: copyIcon })] })] }, field));
136
+ })) : (jsxs(Fragment, { children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsx(CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })) })] }));
117
137
  };
118
138
 
119
139
  export { WalletDetailsCard };