@dynamic-labs/sdk-react-core 4.9.3 → 4.9.5
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.
- package/CHANGELOG.md +21 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +0 -2
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.cjs +27 -0
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.js +23 -0
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.types.d.ts +17 -0
- package/src/lib/components/MenuList/DropdownMenu/index.d.ts +2 -0
- package/src/lib/components/MenuList/index.d.ts +1 -0
- package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.cjs +4 -4
- package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.js +4 -4
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +1 -2
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +1 -2
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +0 -3
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +0 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +0 -2
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.cjs +3 -18
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.js +4 -19
- package/src/lib/events/auth.d.ts +0 -5
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/onrampProviders/index.cjs +6 -10
- package/src/lib/utils/functions/onrampProviders/index.d.ts +4 -7
- package/src/lib/utils/functions/onrampProviders/index.js +7 -10
- package/src/lib/utils/functions/openOnrampPopup.cjs +21 -8
- package/src/lib/utils/functions/openOnrampPopup.d.ts +1 -0
- package/src/lib/utils/functions/openOnrampPopup.js +21 -8
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +4 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +4 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +0 -6
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +0 -6
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +1 -1
- package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +9 -15
- package/src/lib/views/LoginView/useLoginView/useLoginView.js +9 -15
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.cjs +1 -1
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.js +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +3 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.d.ts +2 -12
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/index.d.ts +0 -1
- package/src/lib/utils/functions/onrampProviders/coinbase.cjs +0 -55
- package/src/lib/utils/functions/onrampProviders/coinbase.d.ts +0 -15
- package/src/lib/utils/functions/onrampProviders/coinbase.js +0 -50
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +0 -105
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +0 -101
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.types.d.ts +0 -7
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.9.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.4...v4.9.5) (2025-03-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for AA to Global Wallet ([#8294](https://github.com/dynamic-labs/dynamic-auth/issues/8294)) ([173dfb9](https://github.com/dynamic-labs/dynamic-auth/commit/173dfb9c00e4307feec6ab11913f1a80310885eb))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Remove the usage of random uuid in Global Wallet ([#8314](https://github.com/dynamic-labs/dynamic-auth/issues/8314)) ([79a7a64](https://github.com/dynamic-labs/dynamic-auth/commit/79a7a640b9ce470051a3c877ea46e8d4c94ea542))
|
|
13
|
+
* Fix UI when token balance is 0 ([#8299](https://github.com/dynamic-labs/dynamic-auth/issues/8299)) ([e8a2eca](https://github.com/dynamic-labs/dynamic-auth/commit/e8a2eca9876d914db738557a74751537eee2e129))
|
|
14
|
+
|
|
15
|
+
### [4.9.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.3...v4.9.4) (2025-03-17)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **logger:** don't try to store data if localStorage is not available ([#8309](https://github.com/dynamic-labs/dynamic-auth/issues/8309)) ([30164c7](https://github.com/dynamic-labs/dynamic-auth/commit/30164c7de7bbf1463c6f6a7c12c4b60b5cfb6e78))
|
|
21
|
+
* modal corners ([#8308](https://github.com/dynamic-labs/dynamic-auth/issues/8308)) ([2d21d87](https://github.com/dynamic-labs/dynamic-auth/commit/2d21d87466cee4ab3b981b24fa15f5c321b163f5))
|
|
22
|
+
|
|
2
23
|
### [4.9.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.2...v4.9.3) (2025-03-14)
|
|
3
24
|
|
|
4
25
|
|
package/package.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.9.
|
|
6
|
+
var version = "4.9.5";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.644",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
11
11
|
"country-list": "2.3.0",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.9.
|
|
2
|
+
var version = "4.9.5";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.644",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
7
7
|
"country-list": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.5",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.644",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
7
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
8
8
|
"country-list": "2.3.0",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.9.
|
|
18
|
-
"@dynamic-labs/iconic": "4.9.
|
|
19
|
-
"@dynamic-labs/logger": "4.9.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.9.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.9.
|
|
22
|
-
"@dynamic-labs/store": "4.9.
|
|
23
|
-
"@dynamic-labs/types": "4.9.
|
|
24
|
-
"@dynamic-labs/utils": "4.9.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.9.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.9.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.9.5",
|
|
18
|
+
"@dynamic-labs/iconic": "4.9.5",
|
|
19
|
+
"@dynamic-labs/logger": "4.9.5",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.9.5",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.9.5",
|
|
22
|
+
"@dynamic-labs/store": "4.9.5",
|
|
23
|
+
"@dynamic-labs/types": "4.9.5",
|
|
24
|
+
"@dynamic-labs/utils": "4.9.5",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.9.5",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.9.5",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -177,7 +177,6 @@ var getNetwork = require('./lib/utils/functions/getNetwork/getNetwork.cjs');
|
|
|
177
177
|
var useFunding = require('./lib/utils/hooks/useFunding/useFunding.cjs');
|
|
178
178
|
var useOnramp = require('./lib/utils/hooks/useOnramp/useOnramp.cjs');
|
|
179
179
|
var useOpenFundingOptions = require('./lib/utils/hooks/useOpenFundingOptions/useOpenFundingOptions.cjs');
|
|
180
|
-
var coinbase = require('./lib/utils/functions/onrampProviders/coinbase.cjs');
|
|
181
180
|
var SendBalanceContext = require('./lib/context/SendBalanceContext/SendBalanceContext.cjs');
|
|
182
181
|
require('./lib/context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
183
182
|
require('./lib/context/ConnectWithOtpContext/constants.cjs');
|
|
@@ -306,7 +305,6 @@ exports.getNetwork = getNetwork.getNetwork;
|
|
|
306
305
|
exports.useFunding = useFunding.useFunding;
|
|
307
306
|
exports.useOnramp = useOnramp.useOnramp;
|
|
308
307
|
exports.useOpenFundingOptions = useOpenFundingOptions.useOpenFundingOptions;
|
|
309
|
-
exports.formatCoinbaseOnrampUrl = coinbase.formatCoinbaseOnrampUrl;
|
|
310
308
|
exports.useSendBalance = SendBalanceContext.useSendBalance;
|
|
311
309
|
exports.useConnectWithOtp = useConnectWithOtp.useConnectWithOtp;
|
|
312
310
|
exports.useSwitchNetwork = useSwitchNetwork.useSwitchNetwork;
|
package/src/index.d.ts
CHANGED
|
@@ -121,7 +121,6 @@ useFunding, } from './lib/utils/hooks/useFunding';
|
|
|
121
121
|
export { useOnramp } from './lib/utils/hooks/useOnramp';
|
|
122
122
|
export { useOpenFundingOptions } from './lib/utils/hooks/useOpenFundingOptions';
|
|
123
123
|
export { useFundWithWallet } from './lib/utils/hooks/useFundWithWallet';
|
|
124
|
-
export { formatCoinbaseOnrampUrl } from './lib/utils/functions/onrampProviders';
|
|
125
124
|
export { useUserUpdateRequest, useWalletConnectorEvent, } from './lib/utils/hooks';
|
|
126
125
|
export { type VerifyOtp, useOtpVerificationRequest, } from './lib/utils/hooks/authenticationHooks/';
|
|
127
126
|
export type { UpdateUserFieldsArg } from './lib/utils/hooks/';
|
package/src/index.js
CHANGED
|
@@ -173,7 +173,6 @@ export { getNetwork } from './lib/utils/functions/getNetwork/getNetwork.js';
|
|
|
173
173
|
export { useFunding } from './lib/utils/hooks/useFunding/useFunding.js';
|
|
174
174
|
export { useOnramp } from './lib/utils/hooks/useOnramp/useOnramp.js';
|
|
175
175
|
export { useOpenFundingOptions } from './lib/utils/hooks/useOpenFundingOptions/useOpenFundingOptions.js';
|
|
176
|
-
export { formatCoinbaseOnrampUrl } from './lib/utils/functions/onrampProviders/coinbase.js';
|
|
177
176
|
export { useSendBalance } from './lib/context/SendBalanceContext/SendBalanceContext.js';
|
|
178
177
|
import './lib/context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
179
178
|
import './lib/context/ConnectWithOtpContext/constants.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
require('../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
require('@dynamic-labs/utils');
|
|
15
|
+
require('../../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../../utils/constants/values.cjs');
|
|
17
|
+
var index = require('../../../shared/consts/index.cjs');
|
|
18
|
+
var Badge = require('../../Badge/Badge.cjs');
|
|
19
|
+
var Icon = require('../../Icon/Icon.cjs');
|
|
20
|
+
var Typography = require('../../Typography/Typography.cjs');
|
|
21
|
+
|
|
22
|
+
const DropdownMenu = ({ options, setShowMenu, }) => (jsxRuntime.jsx("div", { className: 'dots-menu-dropdown__container', style: { zIndex: index.tooltipZIndex }, children: options.map((option) => option.hide ? null : (jsxRuntime.jsxs("div", { className: 'dots-menu-dropdown__item', onClick: () => {
|
|
23
|
+
option.callback();
|
|
24
|
+
setShowMenu(false);
|
|
25
|
+
}, children: [option.Icon && jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: option.Icon }), jsxRuntime.jsxs(Typography.Typography, { className: 'dots-menu-dropdown__item-text', color: option.fontColor ? option.fontColor : 'secondary', weight: option.fontWeight, children: [option.text, " ", option.badge ? jsxRuntime.jsx(Badge.Badge, { text: option.badge }) : null] }), option.endSlot && (jsxRuntime.jsx("div", { className: 'dots-menu-dropdown__item__end-slot', children: option.endSlot }))] }, option.text))) }));
|
|
26
|
+
|
|
27
|
+
exports.DropdownMenu = DropdownMenu;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import '../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import '@dynamic-labs/utils';
|
|
11
|
+
import '../../../utils/constants/colors.js';
|
|
12
|
+
import '../../../utils/constants/values.js';
|
|
13
|
+
import { tooltipZIndex } from '../../../shared/consts/index.js';
|
|
14
|
+
import { Badge } from '../../Badge/Badge.js';
|
|
15
|
+
import { Icon } from '../../Icon/Icon.js';
|
|
16
|
+
import { Typography } from '../../Typography/Typography.js';
|
|
17
|
+
|
|
18
|
+
const DropdownMenu = ({ options, setShowMenu, }) => (jsx("div", { className: 'dots-menu-dropdown__container', style: { zIndex: tooltipZIndex }, children: options.map((option) => option.hide ? null : (jsxs("div", { className: 'dots-menu-dropdown__item', onClick: () => {
|
|
19
|
+
option.callback();
|
|
20
|
+
setShowMenu(false);
|
|
21
|
+
}, children: [option.Icon && jsx(Icon, { color: 'text-tertiary', children: option.Icon }), jsxs(Typography, { className: 'dots-menu-dropdown__item-text', color: option.fontColor ? option.fontColor : 'secondary', weight: option.fontWeight, children: [option.text, " ", option.badge ? jsx(Badge, { text: option.badge }) : null] }), option.endSlot && (jsx("div", { className: 'dots-menu-dropdown__item__end-slot', children: option.endSlot }))] }, option.text))) }));
|
|
22
|
+
|
|
23
|
+
export { DropdownMenu };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dispatch, FC, ReactElement, SetStateAction } from 'react';
|
|
2
|
+
import { TypographyColor, TypographyWeight } from '../../Typography/Typography.types';
|
|
3
|
+
export type MenuOption = {
|
|
4
|
+
Icon: ReactElement | null;
|
|
5
|
+
callback: VoidFunction;
|
|
6
|
+
text: string;
|
|
7
|
+
hide?: boolean;
|
|
8
|
+
fontColor?: TypographyColor;
|
|
9
|
+
fontWeight?: TypographyWeight;
|
|
10
|
+
endSlot?: ReactElement;
|
|
11
|
+
badge?: string;
|
|
12
|
+
};
|
|
13
|
+
export type DropdownMenuProps = {
|
|
14
|
+
options: MenuOption[];
|
|
15
|
+
setShowMenu: Dispatch<SetStateAction<boolean>>;
|
|
16
|
+
};
|
|
17
|
+
export type DropdownMenuComponent = FC<DropdownMenuProps>;
|
|
@@ -8,10 +8,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
require('../../../MenuList/Dropdown/Dropdown.cjs');
|
|
11
|
-
var MenuList = require('../../../MenuList/MenuList/MenuList.cjs');
|
|
12
|
-
var NetworkAction = require('../NetworkAction/NetworkAction.cjs');
|
|
13
|
-
var isNetworkUnsupported = require('../../../../utils/functions/isNetworkUnsupported/isNetworkUnsupported.cjs');
|
|
14
|
-
var usePromise = require('../../../../utils/hooks/usePromise/usePromise.cjs');
|
|
15
11
|
require('@dynamic-labs/sdk-api-core');
|
|
16
12
|
var logger = require('../../../../shared/logger.cjs');
|
|
17
13
|
require('@dynamic-labs/iconic');
|
|
@@ -21,6 +17,10 @@ require('@dynamic-labs/utils');
|
|
|
21
17
|
require('../../../../utils/constants/colors.cjs');
|
|
22
18
|
require('../../../../utils/constants/values.cjs');
|
|
23
19
|
require('../../../../shared/consts/index.cjs');
|
|
20
|
+
var MenuList = require('../../../MenuList/MenuList/MenuList.cjs');
|
|
21
|
+
var NetworkAction = require('../NetworkAction/NetworkAction.cjs');
|
|
22
|
+
var isNetworkUnsupported = require('../../../../utils/functions/isNetworkUnsupported/isNetworkUnsupported.cjs');
|
|
23
|
+
var usePromise = require('../../../../utils/hooks/usePromise/usePromise.cjs');
|
|
24
24
|
|
|
25
25
|
const NetworkDropdown = ({ anchorRef, connector, customCallbackOnSuccess, setIsNetworkPickerOpen, isNetworkPickerOpen, currentNetwork, className, checkboxClassName, }) => {
|
|
26
26
|
const [newNetworkId, setNewNetworkId] = React.useState(undefined);
|
|
@@ -4,10 +4,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { isWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import '../../../MenuList/Dropdown/Dropdown.js';
|
|
7
|
-
import { MenuList } from '../../../MenuList/MenuList/MenuList.js';
|
|
8
|
-
import { NetworkAction } from '../NetworkAction/NetworkAction.js';
|
|
9
|
-
import { isNetworkUnsupported } from '../../../../utils/functions/isNetworkUnsupported/isNetworkUnsupported.js';
|
|
10
|
-
import { usePromise } from '../../../../utils/hooks/usePromise/usePromise.js';
|
|
11
7
|
import '@dynamic-labs/sdk-api-core';
|
|
12
8
|
import { logger } from '../../../../shared/logger.js';
|
|
13
9
|
import '@dynamic-labs/iconic';
|
|
@@ -17,6 +13,10 @@ import '@dynamic-labs/utils';
|
|
|
17
13
|
import '../../../../utils/constants/colors.js';
|
|
18
14
|
import '../../../../utils/constants/values.js';
|
|
19
15
|
import '../../../../shared/consts/index.js';
|
|
16
|
+
import { MenuList } from '../../../MenuList/MenuList/MenuList.js';
|
|
17
|
+
import { NetworkAction } from '../NetworkAction/NetworkAction.js';
|
|
18
|
+
import { isNetworkUnsupported } from '../../../../utils/functions/isNetworkUnsupported/isNetworkUnsupported.js';
|
|
19
|
+
import { usePromise } from '../../../../utils/hooks/usePromise/usePromise.js';
|
|
20
20
|
|
|
21
21
|
const NetworkDropdown = ({ anchorRef, connector, customCallbackOnSuccess, setIsNetworkPickerOpen, isNetworkPickerOpen, currentNetwork, className, checkboxClassName, }) => {
|
|
22
22
|
const [newNetworkId, setNewNetworkId] = useState(undefined);
|
package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var dynamicEvents = require('../../../../events/dynamicEvents.cjs');
|
|
7
6
|
require('@dynamic-labs/sdk-api-core');
|
|
8
7
|
var logger = require('../../../../shared/logger.cjs');
|
|
9
8
|
require('@dynamic-labs/iconic');
|
|
@@ -33,6 +32,7 @@ require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
|
33
32
|
require('../../../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
34
33
|
require('../../../AccountExistsContext/AccountExistsContext.cjs');
|
|
35
34
|
require('../../../UserWalletsContext/UserWalletsContext.cjs');
|
|
35
|
+
require('../../../../events/dynamicEvents.cjs');
|
|
36
36
|
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
37
37
|
require('../../../VerificationContext/VerificationContext.cjs');
|
|
38
38
|
require('react-dom');
|
|
@@ -122,7 +122,6 @@ const useTieCallbacksToEvents = ({ clientCallbacks, user, }) => {
|
|
|
122
122
|
});
|
|
123
123
|
useDynamicEvents.useInternalDynamicEvents('walletAdded', (wallet, userWallets) => {
|
|
124
124
|
var _a;
|
|
125
|
-
dynamicEvents.dynamicEvents.emit('triggerSessionValidation');
|
|
126
125
|
logger.logger.debug('[walletAdded]', { userWallets, wallet });
|
|
127
126
|
(_a = clientCallbacks === null || clientCallbacks === void 0 ? void 0 : clientCallbacks.onWalletAdded) === null || _a === void 0 ? void 0 : _a.call(clientCallbacks, { userWallets, wallet });
|
|
128
127
|
});
|
package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { dynamicEvents } from '../../../../events/dynamicEvents.js';
|
|
3
2
|
import '@dynamic-labs/sdk-api-core';
|
|
4
3
|
import { logger } from '../../../../shared/logger.js';
|
|
5
4
|
import '@dynamic-labs/iconic';
|
|
@@ -29,6 +28,7 @@ import '../../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
|
29
28
|
import '../../../AccessDeniedContext/AccessDeniedContext.js';
|
|
30
29
|
import '../../../AccountExistsContext/AccountExistsContext.js';
|
|
31
30
|
import '../../../UserWalletsContext/UserWalletsContext.js';
|
|
31
|
+
import '../../../../events/dynamicEvents.js';
|
|
32
32
|
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
33
33
|
import '../../../VerificationContext/VerificationContext.js';
|
|
34
34
|
import 'react-dom';
|
|
@@ -118,7 +118,6 @@ const useTieCallbacksToEvents = ({ clientCallbacks, user, }) => {
|
|
|
118
118
|
});
|
|
119
119
|
useInternalDynamicEvents('walletAdded', (wallet, userWallets) => {
|
|
120
120
|
var _a;
|
|
121
|
-
dynamicEvents.emit('triggerSessionValidation');
|
|
122
121
|
logger.debug('[walletAdded]', { userWallets, wallet });
|
|
123
122
|
(_a = clientCallbacks === null || clientCallbacks === void 0 ? void 0 : clientCallbacks.onWalletAdded) === null || _a === void 0 ? void 0 : _a.call(clientCallbacks, { userWallets, wallet });
|
|
124
123
|
});
|
|
@@ -160,9 +160,6 @@ export interface IDynamicContext {
|
|
|
160
160
|
termsOfServiceUrl?: string;
|
|
161
161
|
theme?: ThemeData | ThemeSetting;
|
|
162
162
|
toolkitEnabled?: boolean;
|
|
163
|
-
/**
|
|
164
|
-
* @deprecated fetch from store instead. Try `getUser` / `useUser` or `useUserCoalesced`.
|
|
165
|
-
*/
|
|
166
163
|
user: UserProfile | undefined;
|
|
167
164
|
userWithMissingInfo: UserProfile | undefined;
|
|
168
165
|
/**
|
|
@@ -16,7 +16,6 @@ require('../../../utils/constants/colors.cjs');
|
|
|
16
16
|
require('../../../utils/constants/values.cjs');
|
|
17
17
|
require('../../../shared/consts/index.cjs');
|
|
18
18
|
var isAuthenticatedWithAWallet = require('../../../utils/functions/isAuthenticatedWithAWallet/isAuthenticatedWithAWallet.cjs');
|
|
19
|
-
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
20
19
|
|
|
21
20
|
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onUserProfileUpdate }, handleLogOut, primaryWallet, user, isAuthenticated, }) => {
|
|
22
21
|
const [callbackQueue, setCallbackQueue] = React.useState([]);
|
|
@@ -30,7 +29,6 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onUserProfileUpdate
|
|
|
30
29
|
primaryWallet,
|
|
31
30
|
user,
|
|
32
31
|
});
|
|
33
|
-
dynamicEvents.dynamicEvents.emit('triggerSessionValidation');
|
|
34
32
|
}
|
|
35
33
|
catch (e) {
|
|
36
34
|
logger.logger.error('Error calling onAuthSuccess: ', e);
|
|
@@ -12,7 +12,6 @@ import '../../../utils/constants/colors.js';
|
|
|
12
12
|
import '../../../utils/constants/values.js';
|
|
13
13
|
import '../../../shared/consts/index.js';
|
|
14
14
|
import { isAuthenticatedWithAWallet } from '../../../utils/functions/isAuthenticatedWithAWallet/isAuthenticatedWithAWallet.js';
|
|
15
|
-
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
16
15
|
|
|
17
16
|
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onUserProfileUpdate }, handleLogOut, primaryWallet, user, isAuthenticated, }) => {
|
|
18
17
|
const [callbackQueue, setCallbackQueue] = useState([]);
|
|
@@ -26,7 +25,6 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onUserProfileUpdate
|
|
|
26
25
|
primaryWallet,
|
|
27
26
|
user,
|
|
28
27
|
});
|
|
29
|
-
dynamicEvents.emit('triggerSessionValidation');
|
|
30
28
|
}
|
|
31
29
|
catch (e) {
|
|
32
30
|
logger.error('Error calling onAuthSuccess: ', e);
|
package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.cjs
CHANGED
|
@@ -10,7 +10,6 @@ var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
|
10
10
|
var getWalletAdditionalAddressByType = require('../../../utils/functions/getWalletAdditionalAddressByType/getWalletAdditionalAddressByType.cjs');
|
|
11
11
|
var usePromise = require('../../../utils/hooks/usePromise/usePromise.cjs');
|
|
12
12
|
var onramp = require('../../../data/api/onramp/onramp.cjs');
|
|
13
|
-
var coinbase = require('../../../utils/functions/onrampProviders/coinbase.cjs');
|
|
14
13
|
|
|
15
14
|
const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, projectSettingsOnramps, target, }) => {
|
|
16
15
|
var _a;
|
|
@@ -21,10 +20,6 @@ const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, proj
|
|
|
21
20
|
walletConnectorCore.isBitcoinConnector(primaryWallet.connector) &&
|
|
22
21
|
getWalletAdditionalAddressByType.getWalletAdditionalAddressByType(sdkApiCore.WalletAddressType.Payment, primaryWallet);
|
|
23
22
|
const chainHasNetwork = network && chainName === 'evm';
|
|
24
|
-
const nonTestnetNetworks = primaryWallet
|
|
25
|
-
? coinbase.getEnabledNonTestnetNetworks(primaryWallet)
|
|
26
|
-
: [];
|
|
27
|
-
const hasNonTestnetNetworks = nonTestnetNetworks.length > 0;
|
|
28
23
|
const { data: onrampProviders } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
24
|
if (!chainName || !(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address))
|
|
30
25
|
return [];
|
|
@@ -47,19 +42,9 @@ const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, proj
|
|
|
47
42
|
enabled: Boolean(projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.length),
|
|
48
43
|
initialData: [],
|
|
49
44
|
});
|
|
50
|
-
return React.useMemo(() =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.filter((p) => {
|
|
54
|
-
// Only apply network filtering to Coinbase
|
|
55
|
-
if (p.provider === sdkApiCore.ProviderEnum.CoinbaseOnramp) {
|
|
56
|
-
return hasNonTestnetNetworks;
|
|
57
|
-
}
|
|
58
|
-
// Always show other providers (like Banxa)
|
|
59
|
-
return true;
|
|
60
|
-
});
|
|
61
|
-
return filteredProviders;
|
|
62
|
-
}, [onrampProviders, projectSettingsOnramps, hasNonTestnetNetworks]);
|
|
45
|
+
return React.useMemo(() =>
|
|
46
|
+
// Filter providers based on what's enabled in project settings
|
|
47
|
+
onrampProviders.filter((p) => projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.includes(p.provider)), [onrampProviders, projectSettingsOnramps]);
|
|
63
48
|
};
|
|
64
49
|
|
|
65
50
|
exports.useEnabledOnrampProviders = useEnabledOnrampProviders;
|
package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { getChainInfo, isBitcoinConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
|
-
import { WalletAddressType
|
|
5
|
+
import { WalletAddressType } from '@dynamic-labs/sdk-api-core';
|
|
6
6
|
import { getWalletAdditionalAddressByType } from '../../../utils/functions/getWalletAdditionalAddressByType/getWalletAdditionalAddressByType.js';
|
|
7
7
|
import { usePromise } from '../../../utils/hooks/usePromise/usePromise.js';
|
|
8
8
|
import { getOnrampProviders } from '../../../data/api/onramp/onramp.js';
|
|
9
|
-
import { getEnabledNonTestnetNetworks } from '../../../utils/functions/onrampProviders/coinbase.js';
|
|
10
9
|
|
|
11
10
|
const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, projectSettingsOnramps, target, }) => {
|
|
12
11
|
var _a;
|
|
@@ -17,10 +16,6 @@ const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, proj
|
|
|
17
16
|
isBitcoinConnector(primaryWallet.connector) &&
|
|
18
17
|
getWalletAdditionalAddressByType(WalletAddressType.Payment, primaryWallet);
|
|
19
18
|
const chainHasNetwork = network && chainName === 'evm';
|
|
20
|
-
const nonTestnetNetworks = primaryWallet
|
|
21
|
-
? getEnabledNonTestnetNetworks(primaryWallet)
|
|
22
|
-
: [];
|
|
23
|
-
const hasNonTestnetNetworks = nonTestnetNetworks.length > 0;
|
|
24
19
|
const { data: onrampProviders } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
20
|
if (!chainName || !(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address))
|
|
26
21
|
return [];
|
|
@@ -43,19 +38,9 @@ const useEnabledOnrampProviders = ({ primaryWallet, network, environmentId, proj
|
|
|
43
38
|
enabled: Boolean(projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.length),
|
|
44
39
|
initialData: [],
|
|
45
40
|
});
|
|
46
|
-
return useMemo(() =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.filter((p) => {
|
|
50
|
-
// Only apply network filtering to Coinbase
|
|
51
|
-
if (p.provider === ProviderEnum.CoinbaseOnramp) {
|
|
52
|
-
return hasNonTestnetNetworks;
|
|
53
|
-
}
|
|
54
|
-
// Always show other providers (like Banxa)
|
|
55
|
-
return true;
|
|
56
|
-
});
|
|
57
|
-
return filteredProviders;
|
|
58
|
-
}, [onrampProviders, projectSettingsOnramps, hasNonTestnetNetworks]);
|
|
41
|
+
return useMemo(() =>
|
|
42
|
+
// Filter providers based on what's enabled in project settings
|
|
43
|
+
onrampProviders.filter((p) => projectSettingsOnramps === null || projectSettingsOnramps === void 0 ? void 0 : projectSettingsOnramps.includes(p.provider)), [onrampProviders, projectSettingsOnramps]);
|
|
59
44
|
};
|
|
60
45
|
|
|
61
46
|
export { useEnabledOnrampProviders };
|
package/src/lib/events/auth.d.ts
CHANGED
|
@@ -15,11 +15,6 @@ export type AuthEvents = {
|
|
|
15
15
|
logout: () => void;
|
|
16
16
|
/** This event is used to trigger logout to be called, DO NOT listen to it. Listen to "logout" instead */
|
|
17
17
|
triggerLogout: () => void;
|
|
18
|
-
/**
|
|
19
|
-
* DO NOT EXPOSE OR RELY ON THIS EVENT.
|
|
20
|
-
* This indicates we should perform session validation.
|
|
21
|
-
*/
|
|
22
|
-
triggerSessionValidation: () => void;
|
|
23
18
|
/**
|
|
24
19
|
* Emitted when the user succesfully completes an MFA challenge
|
|
25
20
|
*/
|