@dynamic-labs/sdk-react-core 3.0.0-alpha.44 → 3.0.0-alpha.46
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 +23 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.d.ts +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +34 -32
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +34 -32
- package/src/lib/context/DynamicContext/DynamicContext.cjs +16 -12
- package/src/lib/context/DynamicContext/DynamicContext.js +17 -13
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +5 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +5 -1
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +5 -1
- package/src/lib/data/api/api.cjs +2 -4
- package/src/lib/data/api/api.d.ts +6 -2
- package/src/lib/data/api/api.js +2 -4
- package/src/lib/data/api/chains/balances.cjs +5 -2
- package/src/lib/data/api/chains/balances.d.ts +2 -1
- package/src/lib/data/api/chains/balances.js +5 -2
- package/src/lib/events/dynamicEvents.d.ts +2 -1
- package/src/lib/events/tokenBalances.d.ts +3 -0
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +2 -2
- package/src/lib/locale/en/translation.cjs +3 -0
- package/src/lib/locale/en/translation.d.ts +3 -0
- package/src/lib/locale/en/translation.js +3 -0
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +1 -1
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +2 -2
- package/src/lib/store/actions/tokenBalancesActions/index.d.ts +1 -0
- package/src/lib/store/actions/tokenBalancesActions/tokenBalancesActions.cjs +12 -0
- package/src/lib/store/actions/tokenBalancesActions/tokenBalancesActions.d.ts +7 -0
- package/src/lib/store/actions/tokenBalancesActions/tokenBalancesActions.js +8 -0
- package/src/lib/store/hooks/useTokenBalancesState/index.d.ts +1 -0
- package/src/lib/store/hooks/useTokenBalancesState/useTokenBalancesState.cjs +14 -0
- package/src/lib/store/hooks/useTokenBalancesState/useTokenBalancesState.d.ts +1 -0
- package/src/lib/store/hooks/useTokenBalancesState/useTokenBalancesState.js +10 -0
- package/src/lib/store/index.d.ts +2 -0
- package/src/lib/store/store.cjs +6 -0
- package/src/lib/store/store.js +6 -0
- package/src/lib/store/types.d.ts +8 -1
- package/src/lib/utils/functions/socialStorage/socialStorage.d.ts +2 -0
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +8 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +8 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +3 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +3 -2
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +29 -19
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.d.ts +4 -3
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +30 -20
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +2 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +2 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +3 -3
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +3 -3
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +23 -7
- package/src/lib/views/SendBalanceView/SendBalanceView.js +23 -7
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.46](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.45...v3.0.0-alpha.46) (2024-08-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add overrides for chain info ([#6614](https://github.com/dynamic-labs/DynamicAuth/issues/6614)) ([07b76a0](https://github.com/dynamic-labs/DynamicAuth/commit/07b76a0887d3147a00d93a37bdf49a83bfec0ceb))
|
|
8
|
+
* add use token balances state in global store ([#6598](https://github.com/dynamic-labs/DynamicAuth/issues/6598)) ([05baefe](https://github.com/dynamic-labs/DynamicAuth/commit/05baefe7155f197c048557b15240ad93556a8604))
|
|
9
|
+
* refresh token balances ([#6578](https://github.com/dynamic-labs/DynamicAuth/issues/6578)) ([0768857](https://github.com/dynamic-labs/DynamicAuth/commit/0768857c924ce0e01b736173e50ea85b956ab067))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* createEmbeddedWalletAccount ([#6642](https://github.com/dynamic-labs/DynamicAuth/issues/6642)) ([bce08de](https://github.com/dynamic-labs/DynamicAuth/commit/bce08deaa4a5e1ea0b134efb5c4d252c82af5eec))
|
|
15
|
+
* jwt x error when singing with embedded wallet ([#6633](https://github.com/dynamic-labs/DynamicAuth/issues/6633)) ([7d1a6d4](https://github.com/dynamic-labs/DynamicAuth/commit/7d1a6d432807c5b361ff31e6feac2e10d0145d90))
|
|
16
|
+
|
|
17
|
+
## [3.0.0-alpha.45](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.44...v3.0.0-alpha.45) (2024-08-16)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* always check for dynamicOauthCode and use during signin or verify ([#6618](https://github.com/dynamic-labs/DynamicAuth/issues/6618)) ([dd33231](https://github.com/dynamic-labs/DynamicAuth/commit/dd332310c9fdfa7bb593b7f567751133a93c6938))
|
|
23
|
+
* display qr code when no primary is selected ([#6605](https://github.com/dynamic-labs/DynamicAuth/issues/6605)) ([406afa3](https://github.com/dynamic-labs/DynamicAuth/commit/406afa32b38a29a2d8ce96803ae45ab35adb5ce3))
|
|
24
|
+
|
|
2
25
|
## [3.0.0-alpha.44](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.43...v3.0.0-alpha.44) (2024-08-15)
|
|
3
26
|
|
|
4
27
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.46",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "3.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "3.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/message-transport": "3.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "3.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "3.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/store": "3.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/utils": "3.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/viem-utils": "3.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "3.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.
|
|
20
|
+
"@dynamic-labs/iconic": "3.0.0-alpha.46",
|
|
21
|
+
"@dynamic-labs/logger": "3.0.0-alpha.46",
|
|
22
|
+
"@dynamic-labs/message-transport": "3.0.0-alpha.46",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "3.0.0-alpha.46",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "3.0.0-alpha.46",
|
|
25
|
+
"@dynamic-labs/store": "3.0.0-alpha.46",
|
|
26
|
+
"@dynamic-labs/types": "3.0.0-alpha.46",
|
|
27
|
+
"@dynamic-labs/utils": "3.0.0-alpha.46",
|
|
28
|
+
"@dynamic-labs/viem-utils": "3.0.0-alpha.46",
|
|
29
|
+
"@dynamic-labs/wallet-book": "3.0.0-alpha.46",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.46",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -98,7 +98,7 @@ require('qrcode');
|
|
|
98
98
|
const NonNetworkSwitchingSupportedControl = ({ walletConnector, className, showNetworkName = false, }) => {
|
|
99
99
|
const { chain, isLoading } = useFetchChain.useFetchChain(walletConnector);
|
|
100
100
|
const chainName = (chain === null || chain === void 0 ? void 0 : chain.name) || '';
|
|
101
|
-
const ChainIcon = getChainIcon.getChainIcon(
|
|
101
|
+
const ChainIcon = getChainIcon.getChainIcon(walletConnector.connectedChain || '');
|
|
102
102
|
if (isLoading) {
|
|
103
103
|
return jsxRuntime.jsx(NetworkControlSkeleton.NetworkControlSkeleton, { className: className });
|
|
104
104
|
}
|
|
@@ -94,7 +94,7 @@ import 'qrcode';
|
|
|
94
94
|
const NonNetworkSwitchingSupportedControl = ({ walletConnector, className, showNetworkName = false, }) => {
|
|
95
95
|
const { chain, isLoading } = useFetchChain(walletConnector);
|
|
96
96
|
const chainName = (chain === null || chain === void 0 ? void 0 : chain.name) || '';
|
|
97
|
-
const ChainIcon = getChainIcon(
|
|
97
|
+
const ChainIcon = getChainIcon(walletConnector.connectedChain || '');
|
|
98
98
|
if (isLoading) {
|
|
99
99
|
return jsx(NetworkControlSkeleton, { className: className });
|
|
100
100
|
}
|
|
@@ -175,7 +175,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
175
175
|
paddingLeft: `${leftSymbolPadding}px`,
|
|
176
176
|
} }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(fiatValue) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: fiatValue < 0 || !(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price)
|
|
177
177
|
? '--'
|
|
178
|
-
: utils.getDisplayFiatPrice(fiatValue, currentToken) })] })) })] }), jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', children: jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', children: (_a = roundToNthDecimal.roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', children: "Recipient Address" }), jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
|
|
178
|
+
: utils.getDisplayFiatPrice(fiatValue, currentToken) })] })) })] }), jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = roundToNthDecimal.roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', children: "Recipient Address" }), jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
|
|
179
179
|
getDisplayErrorMessage(errors, t, 'recipient') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'large', buttonClassName: 'send-balance-form__button', copykey: 'dyn_send_transaction.preview_transaction', children: t('dyn_send_transaction.preview_transaction') })] }));
|
|
180
180
|
} }));
|
|
181
181
|
};
|
|
@@ -14,7 +14,7 @@ export type Props = {
|
|
|
14
14
|
currentToken: TokenBalance | undefined;
|
|
15
15
|
tokenBalances: TokenBalance[] | undefined;
|
|
16
16
|
setCurrentToken: Dispatch<SetStateAction<TokenBalance | undefined>>;
|
|
17
|
-
isLoading
|
|
17
|
+
isLoading?: boolean;
|
|
18
18
|
transaction: IUITransaction;
|
|
19
19
|
setFiatValue: Dispatch<SetStateAction<number>>;
|
|
20
20
|
fiatValue: number;
|
|
@@ -171,7 +171,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
171
171
|
paddingLeft: `${leftSymbolPadding}px`,
|
|
172
172
|
} }), jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsx(Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(fiatValue) && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsx(Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: fiatValue < 0 || !(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price)
|
|
173
173
|
? '--'
|
|
174
|
-
: getDisplayFiatPrice(fiatValue, currentToken) })] })) })] }), jsx(Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', children: jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsx(Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', children: (_a = roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsx(Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', children: "Recipient Address" }), jsx(Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
|
|
174
|
+
: getDisplayFiatPrice(fiatValue, currentToken) })] })) })] }), jsx(Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsx(Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsx(Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', children: "Recipient Address" }), jsx(Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
|
|
175
175
|
getDisplayErrorMessage(errors, t, 'recipient') }), jsx(TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'large', buttonClassName: 'send-balance-form__button', copykey: 'dyn_send_transaction.preview_transaction', children: t('dyn_send_transaction.preview_transaction') })] }));
|
|
176
176
|
} }));
|
|
177
177
|
};
|
|
@@ -16,7 +16,7 @@ export type SendBalancePageLayoutProps = {
|
|
|
16
16
|
tokenBalances: TokenBalance[] | undefined;
|
|
17
17
|
currentToken: TokenBalance | undefined;
|
|
18
18
|
setCurrentToken: Dispatch<SetStateAction<TokenBalance | undefined>>;
|
|
19
|
-
isLoading
|
|
19
|
+
isLoading?: boolean;
|
|
20
20
|
isNativeToken: boolean;
|
|
21
21
|
chainName: string;
|
|
22
22
|
setNativePrice: Dispatch<SetStateAction<number>>;
|
|
@@ -5,7 +5,7 @@ type TokensBalanceDropdownProps = {
|
|
|
5
5
|
currentToken: TokenBalance | undefined;
|
|
6
6
|
setCurrentToken: Dispatch<SetStateAction<TokenBalance | undefined>>;
|
|
7
7
|
setFiatValue: Dispatch<SetStateAction<number>>;
|
|
8
|
-
isLoading
|
|
8
|
+
isLoading?: boolean;
|
|
9
9
|
setFieldValue: (field: string, value: string) => void;
|
|
10
10
|
setErrors: (errors: any) => void;
|
|
11
11
|
setNativePrice: Dispatch<SetStateAction<number>>;
|
|
@@ -5,14 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
|
-
|
|
9
|
-
var
|
|
8
|
+
require('../Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
9
|
+
var Alert = require('../Alert/Alert.cjs');
|
|
10
|
+
var AnimatePresence = require('../AnimatePresence/AnimatePresence.cjs');
|
|
11
|
+
require('react');
|
|
12
|
+
var Typography = require('../Typography/Typography.cjs');
|
|
13
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
10
14
|
require('@dynamic-labs/sdk-api-core');
|
|
11
15
|
require('../../shared/logger.cjs');
|
|
12
16
|
require('@dynamic-labs/iconic');
|
|
13
17
|
require('@dynamic-labs/wallet-connector-core');
|
|
14
18
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
15
|
-
require('react');
|
|
16
19
|
var checkBlue = require('../../shared/assets/check-blue.cjs');
|
|
17
20
|
var close = require('../../shared/assets/close.cjs');
|
|
18
21
|
require('@dynamic-labs/wallet-book');
|
|
@@ -24,13 +27,11 @@ require('../../shared/utils/classes/storage/sessionStorage.cjs');
|
|
|
24
27
|
require('@dynamic-labs/utils');
|
|
25
28
|
require('../../shared/consts/index.cjs');
|
|
26
29
|
var Icon = require('../Icon/Icon.cjs');
|
|
27
|
-
var Typography = require('../Typography/Typography.cjs');
|
|
28
|
-
var PoweredByDynamic = require('../PoweredByDynamic/PoweredByDynamic.cjs');
|
|
29
30
|
var TypographyButton = require('../TypographyButton/TypographyButton.cjs');
|
|
30
|
-
|
|
31
|
-
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
31
|
+
require('react-dom');
|
|
32
32
|
require('../../events/dynamicEvents.cjs');
|
|
33
|
-
require('
|
|
33
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
34
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
34
35
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
35
36
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
36
37
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -38,11 +39,11 @@ require('react-international-phone');
|
|
|
38
39
|
require('../../config/ApiEndpoint.cjs');
|
|
39
40
|
require('@dynamic-labs/store');
|
|
40
41
|
require('../../locale/locale.cjs');
|
|
42
|
+
var fiatUtils = require('../../utils/functions/fiatUtils/fiatUtils.cjs');
|
|
41
43
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
44
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
45
|
-
require('react-dom');
|
|
46
47
|
require('../../context/WalletContext/WalletContext.cjs');
|
|
47
48
|
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
48
49
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -55,49 +56,50 @@ require('../../views/CollectUserDataView/useFields.cjs');
|
|
|
55
56
|
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
56
57
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
57
58
|
require('@dynamic-labs/rpc-providers');
|
|
58
|
-
require('../
|
|
59
|
-
require('
|
|
59
|
+
var PoweredByDynamic = require('../PoweredByDynamic/PoweredByDynamic.cjs');
|
|
60
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
60
61
|
require('../ShadowDOM/ShadowDOM.cjs');
|
|
61
|
-
require('../InlineWidget/InlineWidget.cjs');
|
|
62
|
-
require('../Input/Input.cjs');
|
|
63
|
-
require('../IsBrowser/IsBrowser.cjs');
|
|
64
|
-
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
65
62
|
require('../Transition/ZoomTransition/ZoomTransition.cjs');
|
|
66
63
|
require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
67
64
|
require('../Transition/OpacityTransition/OpacityTransition.cjs');
|
|
65
|
+
var VerticalDrawerTransition = require('../Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
|
|
68
66
|
require('../OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
69
|
-
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
70
|
-
require('../Popper/Popper/Popper.cjs');
|
|
71
|
-
require('../Popper/PopperContext/PopperContext.cjs');
|
|
72
|
-
require('react-focus-lock');
|
|
73
|
-
require('qrcode');
|
|
74
|
-
require('formik');
|
|
75
|
-
require('../../views/WalletList/WalletList.cjs');
|
|
76
67
|
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
77
|
-
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
78
|
-
require('@hcaptcha/react-hcaptcha');
|
|
79
|
-
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
80
|
-
require('../../context/FooterAnimationContext/index.cjs');
|
|
81
68
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
82
|
-
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
83
|
-
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
84
|
-
require('@dynamic-labs/viem-utils');
|
|
85
|
-
var utils = require('../TransactionConfirmationPageLayout/utils.cjs');
|
|
86
69
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
70
|
+
require('react-focus-lock');
|
|
71
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
72
|
+
var IconButton = require('../IconButton/IconButton.cjs');
|
|
73
|
+
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
74
|
+
require('formik');
|
|
87
75
|
require('../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
76
|
+
var ModalHeader = require('../ModalHeader/ModalHeader.cjs');
|
|
77
|
+
require('../Input/Input.cjs');
|
|
78
|
+
require('@dynamic-labs/viem-utils');
|
|
79
|
+
var utils = require('../TransactionConfirmationPageLayout/utils.cjs');
|
|
80
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
88
81
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
89
82
|
require('../../../polyfills.cjs');
|
|
90
83
|
require('../../context/ErrorBoundary/ErrorBoundaryBase.cjs');
|
|
91
84
|
require('../../context/ErrorBoundary/ErrorBoundaryContext.cjs');
|
|
92
85
|
require('../../widgets/DynamicBridgeWidget/context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.cjs');
|
|
93
86
|
require('../../widgets/DynamicWidget/components/DynamicWidgetCard/DynamicWidgetCard.cjs');
|
|
87
|
+
require('../IsBrowser/IsBrowser.cjs');
|
|
94
88
|
require('../../context/WidgetRegistry/WidgetRegistryContextProvider.cjs');
|
|
95
89
|
require('../../context/FundingContext/FundingContext.cjs');
|
|
90
|
+
require('../Popper/Popper/Popper.cjs');
|
|
91
|
+
require('../Popper/PopperContext/PopperContext.cjs');
|
|
92
|
+
require('../../views/WalletList/WalletList.cjs');
|
|
93
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
94
|
+
require('@hcaptcha/react-hcaptcha');
|
|
95
|
+
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
96
|
+
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
96
97
|
require('../../context/SendBalanceContext/SendBalanceContext.cjs');
|
|
97
98
|
require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
98
99
|
require('../../context/ConnectWithOtpContext/constants.cjs');
|
|
99
100
|
require('../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
100
|
-
|
|
101
|
+
require('../InlineWidget/InlineWidget.cjs');
|
|
102
|
+
require('qrcode');
|
|
101
103
|
|
|
102
104
|
const TransactionStatusLayout = ({ destinationAddress, transactionValue, networkCurrency, onDone, displayPoweredByDynamicFooter = true, onClickClose, transaction, currentToken, nativePrice, isNativeToken, }) => {
|
|
103
105
|
const { t } = reactI18next.useTranslation();
|
|
@@ -106,7 +108,7 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
106
108
|
const totalFiatCost = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
107
109
|
return (jsxRuntime.jsxs("div", { className: 'transaction-status-layout', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(Icon.Icon, { size: 'large', className: 'transaction-status-layout__status-icon', children: jsxRuntime.jsx(checkBlue.ReactComponent, {}) }) }), jsxRuntime.jsxs("div", { className: 'transaction-status-layout__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-status-layout__sent_to', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [t('dyn_send_transaction.succeeded.title'), ' '] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: shortenWalletAddress.shortenWalletAddress(destinationAddress, 3, 3) })] }), jsxRuntime.jsx("div", { className: 'transaction-status-layout__content', children: jsxRuntime.jsx("div", { className: 'transaction-status-layout__rows', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'title', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [`${utils.getValueRounded(isNativeToken, transaction)} ${networkCurrency} `, showFiat &&
|
|
108
110
|
(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) &&
|
|
109
|
-
`($${Number(totalFiatCost) <= 0.01 ? '<0.01' : totalFiatCost})`] }) }) }), jsxRuntime.jsx("div", { className: 'transaction-status-layout__actions', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', expanded: true, onClick: onDone, loading: false, copykey: 'dyn_send_transaction.succeeded.continue_button', dataTestId: 'transaction-done-continue', children: t('dyn_send_transaction.succeeded.continue_button') }) }), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] })] }));
|
|
111
|
+
`($${Number(totalFiatCost) <= 0.01 ? '<0.01' : totalFiatCost})`] }) }) }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: jsxRuntime.jsx(Alert.Alert, { variant: 'info', copykey: 'dyn_send_transaction.info_message.refresh_balance_time', children: t('dyn_send_transaction.info_message.refresh_balance_time') }) }) }), jsxRuntime.jsx("div", { className: 'transaction-status-layout__actions', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', expanded: true, onClick: onDone, loading: false, copykey: 'dyn_send_transaction.succeeded.continue_button', dataTestId: 'transaction-done-continue', children: t('dyn_send_transaction.succeeded.continue_button') }) }), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] })] }));
|
|
110
112
|
};
|
|
111
113
|
|
|
112
114
|
exports.TransactionStatusLayout = TransactionStatusLayout;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import '../Accordion/components/AccordionItem/AccordionItem.js';
|
|
5
|
+
import { Alert } from '../Alert/Alert.js';
|
|
6
|
+
import { AnimatePresence } from '../AnimatePresence/AnimatePresence.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { Typography } from '../Typography/Typography.js';
|
|
9
|
+
import '../../../../_virtual/_tslib.js';
|
|
6
10
|
import '@dynamic-labs/sdk-api-core';
|
|
7
11
|
import '../../shared/logger.js';
|
|
8
12
|
import '@dynamic-labs/iconic';
|
|
9
13
|
import '@dynamic-labs/wallet-connector-core';
|
|
10
14
|
import '../../context/ViewContext/ViewContext.js';
|
|
11
|
-
import 'react';
|
|
12
15
|
import { ReactComponent as SvgCheckBlue } from '../../shared/assets/check-blue.js';
|
|
13
16
|
import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
14
17
|
import '@dynamic-labs/wallet-book';
|
|
@@ -20,13 +23,11 @@ import '../../shared/utils/classes/storage/sessionStorage.js';
|
|
|
20
23
|
import '@dynamic-labs/utils';
|
|
21
24
|
import '../../shared/consts/index.js';
|
|
22
25
|
import { Icon } from '../Icon/Icon.js';
|
|
23
|
-
import { Typography } from '../Typography/Typography.js';
|
|
24
|
-
import { PoweredByDynamic } from '../PoweredByDynamic/PoweredByDynamic.js';
|
|
25
26
|
import { TypographyButton } from '../TypographyButton/TypographyButton.js';
|
|
26
|
-
import
|
|
27
|
-
import '../../context/DynamicContext/DynamicContext.js';
|
|
27
|
+
import 'react-dom';
|
|
28
28
|
import '../../events/dynamicEvents.js';
|
|
29
|
-
import '
|
|
29
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
30
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
30
31
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
31
32
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
32
33
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -34,11 +35,11 @@ import 'react-international-phone';
|
|
|
34
35
|
import '../../config/ApiEndpoint.js';
|
|
35
36
|
import '@dynamic-labs/store';
|
|
36
37
|
import '../../locale/locale.js';
|
|
38
|
+
import { getTotalFiatCost } from '../../utils/functions/fiatUtils/fiatUtils.js';
|
|
37
39
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
40
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
41
|
-
import 'react-dom';
|
|
42
43
|
import '../../context/WalletContext/WalletContext.js';
|
|
43
44
|
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
44
45
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
@@ -51,49 +52,50 @@ import '../../views/CollectUserDataView/useFields.js';
|
|
|
51
52
|
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
52
53
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
53
54
|
import '@dynamic-labs/rpc-providers';
|
|
54
|
-
import '../
|
|
55
|
-
import '
|
|
55
|
+
import { PoweredByDynamic } from '../PoweredByDynamic/PoweredByDynamic.js';
|
|
56
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
56
57
|
import '../ShadowDOM/ShadowDOM.js';
|
|
57
|
-
import '../InlineWidget/InlineWidget.js';
|
|
58
|
-
import '../Input/Input.js';
|
|
59
|
-
import '../IsBrowser/IsBrowser.js';
|
|
60
|
-
import '../MenuList/Dropdown/Dropdown.js';
|
|
61
58
|
import '../Transition/ZoomTransition/ZoomTransition.js';
|
|
62
59
|
import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
63
60
|
import '../Transition/OpacityTransition/OpacityTransition.js';
|
|
61
|
+
import { VerticalDrawerTransition } from '../Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
|
|
64
62
|
import '../OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
65
|
-
import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
66
|
-
import '../Popper/Popper/Popper.js';
|
|
67
|
-
import '../Popper/PopperContext/PopperContext.js';
|
|
68
|
-
import 'react-focus-lock';
|
|
69
|
-
import 'qrcode';
|
|
70
|
-
import 'formik';
|
|
71
|
-
import '../../views/WalletList/WalletList.js';
|
|
72
63
|
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
73
|
-
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
74
|
-
import '@hcaptcha/react-hcaptcha';
|
|
75
|
-
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
76
|
-
import '../../context/FooterAnimationContext/index.js';
|
|
77
64
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
78
|
-
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
79
|
-
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
80
|
-
import '@dynamic-labs/viem-utils';
|
|
81
|
-
import { getValueRounded } from '../TransactionConfirmationPageLayout/utils.js';
|
|
82
65
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
66
|
+
import 'react-focus-lock';
|
|
67
|
+
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
68
|
+
import { IconButton } from '../IconButton/IconButton.js';
|
|
69
|
+
import '../MenuList/Dropdown/Dropdown.js';
|
|
70
|
+
import 'formik';
|
|
83
71
|
import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
72
|
+
import { ModalHeader } from '../ModalHeader/ModalHeader.js';
|
|
73
|
+
import '../Input/Input.js';
|
|
74
|
+
import '@dynamic-labs/viem-utils';
|
|
75
|
+
import { getValueRounded } from '../TransactionConfirmationPageLayout/utils.js';
|
|
76
|
+
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
84
77
|
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
85
78
|
import '../../../polyfills.js';
|
|
86
79
|
import '../../context/ErrorBoundary/ErrorBoundaryBase.js';
|
|
87
80
|
import '../../context/ErrorBoundary/ErrorBoundaryContext.js';
|
|
88
81
|
import '../../widgets/DynamicBridgeWidget/context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.js';
|
|
89
82
|
import '../../widgets/DynamicWidget/components/DynamicWidgetCard/DynamicWidgetCard.js';
|
|
83
|
+
import '../IsBrowser/IsBrowser.js';
|
|
90
84
|
import '../../context/WidgetRegistry/WidgetRegistryContextProvider.js';
|
|
91
85
|
import '../../context/FundingContext/FundingContext.js';
|
|
86
|
+
import '../Popper/Popper/Popper.js';
|
|
87
|
+
import '../Popper/PopperContext/PopperContext.js';
|
|
88
|
+
import '../../views/WalletList/WalletList.js';
|
|
89
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
90
|
+
import '@hcaptcha/react-hcaptcha';
|
|
91
|
+
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
92
|
+
import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
92
93
|
import '../../context/SendBalanceContext/SendBalanceContext.js';
|
|
93
94
|
import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
94
95
|
import '../../context/ConnectWithOtpContext/constants.js';
|
|
95
96
|
import '../../context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
96
|
-
import
|
|
97
|
+
import '../InlineWidget/InlineWidget.js';
|
|
98
|
+
import 'qrcode';
|
|
97
99
|
|
|
98
100
|
const TransactionStatusLayout = ({ destinationAddress, transactionValue, networkCurrency, onDone, displayPoweredByDynamicFooter = true, onClickClose, transaction, currentToken, nativePrice, isNativeToken, }) => {
|
|
99
101
|
const { t } = useTranslation();
|
|
@@ -102,7 +104,7 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
102
104
|
const totalFiatCost = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
103
105
|
return (jsxs("div", { className: 'transaction-status-layout', children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(Icon, { size: 'large', className: 'transaction-status-layout__status-icon', children: jsx(SvgCheckBlue, {}) }) }), jsxs("div", { className: 'transaction-status-layout__body', children: [jsxs("div", { className: 'transaction-status-layout__sent_to', children: [jsxs(Typography, { variant: 'body_small', color: 'secondary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [t('dyn_send_transaction.succeeded.title'), ' '] }), jsx(Typography, { variant: 'body_small', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: shortenWalletAddress(destinationAddress, 3, 3) })] }), jsx("div", { className: 'transaction-status-layout__content', children: jsx("div", { className: 'transaction-status-layout__rows', children: jsxs(Typography, { variant: 'title', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [`${getValueRounded(isNativeToken, transaction)} ${networkCurrency} `, showFiat &&
|
|
104
106
|
(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) &&
|
|
105
|
-
`($${Number(totalFiatCost) <= 0.01 ? '<0.01' : totalFiatCost})`] }) }) }), jsx("div", { className: 'transaction-status-layout__actions', children: jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', expanded: true, onClick: onDone, loading: false, copykey: 'dyn_send_transaction.succeeded.continue_button', dataTestId: 'transaction-done-continue', children: t('dyn_send_transaction.succeeded.continue_button') }) }), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] })] }));
|
|
107
|
+
`($${Number(totalFiatCost) <= 0.01 ? '<0.01' : totalFiatCost})`] }) }) }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: jsx("div", { className: 'transaction-confirmation__warning', children: jsx(Alert, { variant: 'info', copykey: 'dyn_send_transaction.info_message.refresh_balance_time', children: t('dyn_send_transaction.info_message.refresh_balance_time') }) }) }), jsx("div", { className: 'transaction-status-layout__actions', children: jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', expanded: true, onClick: onDone, loading: false, copykey: 'dyn_send_transaction.succeeded.continue_button', dataTestId: 'transaction-done-continue', children: t('dyn_send_transaction.succeeded.continue_button') }) }), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] })] }));
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
export { TransactionStatusLayout };
|
|
@@ -145,7 +145,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
|
|
|
145
145
|
const DynamicContext = React.createContext(undefined);
|
|
146
146
|
/** The context provider itself we only use internally */
|
|
147
147
|
const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, locale: locale$1, enableInstrumentation = false, }) => {
|
|
148
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
148
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
149
149
|
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings$1;
|
|
150
150
|
localStorage.LocalStorage.setSuffix(settings$1.localStorageSuffix);
|
|
151
151
|
/**
|
|
@@ -155,13 +155,17 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
155
155
|
environmentId,
|
|
156
156
|
storageSuffix: settings$1.localStorageSuffix,
|
|
157
157
|
});
|
|
158
|
+
/**
|
|
159
|
+
* Sets the chain info overrides if they are present
|
|
160
|
+
*/
|
|
161
|
+
walletConnectorCore.setChainInfoOverrides((_a = settings$1.overrides) === null || _a === void 0 ? void 0 : _a.chainDisplayValues);
|
|
158
162
|
/**
|
|
159
163
|
* For backwards compatibility, we allow the client to pass in
|
|
160
164
|
* `eventsCallbacks` instead of `events`. It should remove this
|
|
161
165
|
* in version 3.0.0.
|
|
162
166
|
* ticket: QNTM-1504
|
|
163
167
|
*/
|
|
164
|
-
const events = (
|
|
168
|
+
const events = (_b = settings$1.events) !== null && _b !== void 0 ? _b : settings$1.eventsCallbacks;
|
|
165
169
|
const networkValidationMode = helpers.resolveNetworkValidationMode({
|
|
166
170
|
bridgeChains: settings$1.bridgeChains,
|
|
167
171
|
networkValidationMode: settings$1.networkValidationMode,
|
|
@@ -175,7 +179,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
175
179
|
if (environmentId === PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID) {
|
|
176
180
|
logger$1.logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
177
181
|
}
|
|
178
|
-
ApiEndpoint.setBaseUrl((
|
|
182
|
+
ApiEndpoint.setBaseUrl((_c = process.env.DYNAMIC_API_BASE_URL) !== null && _c !== void 0 ? _c : apiBaseUrl);
|
|
179
183
|
const i18nSDKInstance = locale.Locale.setup(locale$1);
|
|
180
184
|
const isBridgeFlow = Boolean(bridgeChains);
|
|
181
185
|
const deepLinkPreference = helpers.getDeepLinkPreference(deepLinkPreferenceProp, isBridgeFlow);
|
|
@@ -206,16 +210,16 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
206
210
|
useSendDynamicProps.useSendDynamicProps({ environmentId, settings: settings$1 });
|
|
207
211
|
const multiWallet = useMultiWallet.useMultiWallet({
|
|
208
212
|
isBridgeFlow,
|
|
209
|
-
multiWalletOverride: (
|
|
210
|
-
multiWalletSettings: (
|
|
213
|
+
multiWalletOverride: (_d = settings$1.overrides) === null || _d === void 0 ? void 0 : _d.multiWallet,
|
|
214
|
+
multiWalletSettings: (_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _e === void 0 ? void 0 : _e.multiWallet,
|
|
211
215
|
});
|
|
212
216
|
const multiAsset = useMultiAsset.useMultiAsset({
|
|
213
|
-
multiAssetOverride: (
|
|
214
|
-
multiAssetSettings: (
|
|
217
|
+
multiAssetOverride: (_f = settings$1.overrides) === null || _f === void 0 ? void 0 : _f.multiAsset,
|
|
218
|
+
multiAssetSettings: (_g = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _g === void 0 ? void 0 : _g.enableMultiAsset,
|
|
215
219
|
});
|
|
216
220
|
const showFiat = useShowFiat.useShowFiat({
|
|
217
|
-
showFiatOverride: (
|
|
218
|
-
showFiatSettings: (
|
|
221
|
+
showFiatOverride: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.showFiat,
|
|
222
|
+
showFiatSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.showFiat,
|
|
219
223
|
});
|
|
220
224
|
// ensures that when user comes back to site and primary wallet is out of sync, we don't show widget popup
|
|
221
225
|
const [showWidgetStatePopup, setShowWidgetStatePopup] = React.useState(!multiWallet);
|
|
@@ -224,7 +228,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
224
228
|
const walletBook$1 = walletBook.useWalletBookCdn();
|
|
225
229
|
const { networkConfigurations: serverNetworkConfigurations } = useNetworkConfigurations.useNetworkConfigurations({
|
|
226
230
|
environmentId,
|
|
227
|
-
evmNetworksOverrides: (
|
|
231
|
+
evmNetworksOverrides: (_k = settings$1.overrides) === null || _k === void 0 ? void 0 : _k.evmNetworks,
|
|
228
232
|
projectSettings,
|
|
229
233
|
});
|
|
230
234
|
const { imageUserInAccessList, imageUserNotInAccessList, displayName, appLogo, } = (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) || {};
|
|
@@ -236,7 +240,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
236
240
|
appLogoUrl,
|
|
237
241
|
appName,
|
|
238
242
|
getAppOrigin: () => window.location.origin,
|
|
239
|
-
hideEmbeddedWalletTransactionUIs: hideEmbeddedWalletTransactionUIs !== null && hideEmbeddedWalletTransactionUIs !== void 0 ? hideEmbeddedWalletTransactionUIs : !((
|
|
243
|
+
hideEmbeddedWalletTransactionUIs: hideEmbeddedWalletTransactionUIs !== null && hideEmbeddedWalletTransactionUIs !== void 0 ? hideEmbeddedWalletTransactionUIs : !((_m = (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.embeddedWallets) === null || _m === void 0 ? void 0 : _m.showEmbeddedWalletActionsUI),
|
|
240
244
|
});
|
|
241
245
|
const { walletConnectorOptions } = useWalletConnectorOptions.useWalletConnectorOptions({
|
|
242
246
|
appLogoUrl,
|
|
@@ -715,7 +719,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
715
719
|
}
|
|
716
720
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
717
721
|
}, [multiWallet, multiWalletWidgetState, showDynamicUserProfile]);
|
|
718
|
-
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((
|
|
722
|
+
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((_o = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _o === void 0 ? void 0 : _o.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialView: helpers.getInitialView({
|
|
719
723
|
bridgeOnboardingCompleted,
|
|
720
724
|
connectedWallets,
|
|
721
725
|
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|