@dynamic-labs/sdk-react-core 4.56.0 → 4.57.1

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 (31) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.cjs +3 -3
  3. package/package.js +3 -3
  4. package/package.json +14 -14
  5. package/src/lib/components/TransactionCard/SendBalanceTransactionCard.cjs +48 -6
  6. package/src/lib/components/TransactionCard/SendBalanceTransactionCard.d.ts +3 -2
  7. package/src/lib/components/TransactionCard/SendBalanceTransactionCard.js +48 -6
  8. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +2 -2
  9. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +1 -0
  10. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +2 -2
  11. package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.cjs +4 -2
  12. package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.js +4 -2
  13. package/src/lib/context/DynamicContext/DynamicContext.cjs +18 -17
  14. package/src/lib/context/DynamicContext/DynamicContext.js +18 -17
  15. package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +10 -0
  16. package/src/lib/store/utils/settingsUtils/index.d.ts +1 -1
  17. package/src/lib/store/utils/settingsUtils/settingsUtils.cjs +2 -0
  18. package/src/lib/store/utils/settingsUtils/settingsUtils.d.ts +1 -0
  19. package/src/lib/store/utils/settingsUtils/settingsUtils.js +2 -1
  20. package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.cjs +5 -1
  21. package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.js +5 -1
  22. package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.cjs +7 -2
  23. package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.d.ts +2 -1
  24. package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.js +7 -2
  25. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +5 -1
  26. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +5 -1
  27. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -0
  28. package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -0
  29. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +8 -1
  30. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +8 -1
  31. package/src/lib/views/WalletList/data.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,24 @@
1
1
 
2
+ ### [4.57.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.57.0...v4.57.1) (2026-01-22)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * prevent No wallet provider found error when initializating ([#10277](https://github.com/dynamic-labs/dynamic-auth/issues/10277)) ([7427765](https://github.com/dynamic-labs/dynamic-auth/commit/74277654f2c823b6dd66a7cace29ea62f832bb77))
8
+
9
+ ## [4.57.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.56.0...v4.57.0) (2026-01-20)
10
+
11
+
12
+ ### Features
13
+
14
+ * auto redirect back from wallet connect ([#10257](https://github.com/dynamic-labs/dynamic-auth/issues/10257)) ([92994da](https://github.com/dynamic-labs/dynamic-auth/commit/92994dadaae851e309b5f889c0e415241cb2d00f))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * metamask console noise when signing in with wallet connect ([#10263](https://github.com/dynamic-labs/dynamic-auth/issues/10263)) ([1861e4a](https://github.com/dynamic-labs/dynamic-auth/commit/1861e4a3e78dd7d7a5a250da32f722a7bf972083))
20
+ * only throw webview did not load error after retries ([#10255](https://github.com/dynamic-labs/dynamic-auth/issues/10255)) ([7c11824](https://github.com/dynamic-labs/dynamic-auth/commit/7c11824c32c9058c12aa5d6998b8cc3fe7e75938))
21
+
2
22
  ## [4.56.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.55.0...v4.56.0) (2026-01-19)
3
23
 
4
24
 
package/package.cjs CHANGED
@@ -3,10 +3,10 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.56.0";
6
+ var version = "4.57.1";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.855",
9
- "@dynamic-labs-sdk/client": "0.2.4",
8
+ "@dynamic-labs/sdk-api-core": "0.0.860",
9
+ "@dynamic-labs-sdk/client": "0.4.0",
10
10
  "@hcaptcha/react-hcaptcha": "1.4.4",
11
11
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
12
12
  "country-list": "2.3.0",
package/package.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client'
2
- var version = "4.56.0";
2
+ var version = "4.57.1";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.855",
5
- "@dynamic-labs-sdk/client": "0.2.4",
4
+ "@dynamic-labs/sdk-api-core": "0.0.860",
5
+ "@dynamic-labs-sdk/client": "0.4.0",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
7
7
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
8
8
  "country-list": "2.3.0",
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.56.0",
3
+ "version": "4.57.1",
4
4
  "dependencies": {
5
- "@dynamic-labs/sdk-api-core": "0.0.855",
6
- "@dynamic-labs-sdk/client": "0.2.4",
5
+ "@dynamic-labs/sdk-api-core": "0.0.860",
6
+ "@dynamic-labs-sdk/client": "0.4.0",
7
7
  "@hcaptcha/react-hcaptcha": "1.4.4",
8
8
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
9
9
  "country-list": "2.3.0",
@@ -15,17 +15,17 @@
15
15
  "yup": "0.32.11",
16
16
  "react-international-phone": "4.5.0",
17
17
  "bs58": "5.0.0",
18
- "@dynamic-labs/assert-package-version": "4.56.0",
19
- "@dynamic-labs/iconic": "4.56.0",
20
- "@dynamic-labs/locale": "4.56.0",
21
- "@dynamic-labs/logger": "4.56.0",
22
- "@dynamic-labs/multi-wallet": "4.56.0",
23
- "@dynamic-labs/rpc-providers": "4.56.0",
24
- "@dynamic-labs/store": "4.56.0",
25
- "@dynamic-labs/types": "4.56.0",
26
- "@dynamic-labs/utils": "4.56.0",
27
- "@dynamic-labs/wallet-book": "4.56.0",
28
- "@dynamic-labs/wallet-connector-core": "4.56.0",
18
+ "@dynamic-labs/assert-package-version": "4.57.1",
19
+ "@dynamic-labs/iconic": "4.57.1",
20
+ "@dynamic-labs/locale": "4.57.1",
21
+ "@dynamic-labs/logger": "4.57.1",
22
+ "@dynamic-labs/multi-wallet": "4.57.1",
23
+ "@dynamic-labs/rpc-providers": "4.57.1",
24
+ "@dynamic-labs/store": "4.57.1",
25
+ "@dynamic-labs/types": "4.57.1",
26
+ "@dynamic-labs/utils": "4.57.1",
27
+ "@dynamic-labs/wallet-book": "4.57.1",
28
+ "@dynamic-labs/wallet-connector-core": "4.57.1",
29
29
  "eventemitter3": "5.0.1"
30
30
  },
31
31
  "devDependencies": {
@@ -3,10 +3,12 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
+ var _tslib = require('../../../../_virtual/_tslib.cjs');
6
7
  var jsxRuntime = require('react/jsx-runtime');
8
+ var React = require('react');
9
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
10
  require('@dynamic-labs/iconic');
8
- require('@dynamic-labs/wallet-connector-core');
9
- require('react');
11
+ var chevronDown = require('../../shared/assets/chevron-down.cjs');
10
12
  var tooltip = require('../../shared/assets/tooltip.cjs');
11
13
  require('../../context/ViewContext/ViewContext.cjs');
12
14
  require('../../shared/logger.cjs');
@@ -20,7 +22,6 @@ var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAd
20
22
  require('../../context/DynamicContext/DynamicContext.cjs');
21
23
  require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
22
24
  require('../../events/dynamicEvents.cjs');
23
- require('../../../../_virtual/_tslib.cjs');
24
25
  require('../../context/CaptchaContext/CaptchaContext.cjs');
25
26
  require('../../context/ErrorContext/ErrorContext.cjs');
26
27
  require('@dynamic-labs/multi-wallet');
@@ -115,8 +116,8 @@ require('../../store/state/multichainBalances.cjs');
115
116
  require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
116
117
  var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
117
118
 
118
- const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, }) => {
119
- var _a;
119
+ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, onFeeUpdate, }) => {
120
+ var _a, _b;
120
121
  const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext.useInternalDynamicContext();
121
122
  const networkInfo = useNetworkConfigurationsFromProjectSettings.useNetworkConfigurationsFromProjectSettings({
122
123
  evmNetworksOverrides: overrides === null || overrides === void 0 ? void 0 : overrides.evmNetworks,
@@ -128,6 +129,21 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
128
129
  networkId: chain === null || chain === void 0 ? void 0 : chain.chainId,
129
130
  networkInfo,
130
131
  });
132
+ // Check if this is a Bitcoin transaction
133
+ const isBitcoinTransaction = transaction.chain === 'BTC' ||
134
+ ((_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _b === void 0 ? void 0 : _b.connectedChain) === 'BTC' ||
135
+ ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) && walletConnectorCore.isBitcoinConnector(primaryWallet.connector));
136
+ const bitcoinTransaction = transaction;
137
+ const [feePriority, setFeePriority] = React.useState((bitcoinTransaction === null || bitcoinTransaction === void 0 ? void 0 : bitcoinTransaction.feePriority) || 'medium');
138
+ const handleFeePriorityChange = React.useCallback((newPriority) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
139
+ var _c;
140
+ if (!isBitcoinTransaction || feePriority === newPriority) {
141
+ return;
142
+ }
143
+ setFeePriority(newPriority);
144
+ yield ((_c = bitcoinTransaction.updateFeePriority) === null || _c === void 0 ? void 0 : _c.call(bitcoinTransaction, newPriority));
145
+ onFeeUpdate === null || onFeeUpdate === void 0 ? void 0 : onFeeUpdate();
146
+ }), [isBitcoinTransaction, feePriority, bitcoinTransaction, onFeeUpdate]);
131
147
  const renderTransferDetails = () => (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsx("div", { className: 'transaction-card__assets-container', children: jsxRuntime.jsx("div", { className: 'transaction-card__out', children: jsxRuntime.jsxs("div", { className: 'transaction-card__info-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: t('dyn_send_transaction.confirmation.data.transfer.send') }), jsxRuntime.jsxs("div", { className: 'transaction-card__amount-symbol', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__token-info', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__token-row', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'error-1', "data-testid": 'transaction-transfer-amount', children: ["-", valueRounded ||
132
148
  ((transaction === null || transaction === void 0 ? void 0 : transaction.value)
133
149
  ? transaction.format(transaction.value, {
@@ -135,7 +151,33 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
135
151
  })
136
152
  : '')] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: currencySymbol })] }), transactionValue && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'error-1', "data-testid": 'transaction-transfer-amount-fiat', children: ["$", utils.getDisplayFiatPrice(Number(transactionValue) || Number(valueRounded) || 0, currentToken)] }))] }), jsxRuntime.jsx("div", { className: 'transaction-card__icon', children: jsxRuntime.jsx("div", { className: 'transaction-card__icon__container', children: jsxRuntime.jsx("img", { src: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.logoURI) ||
137
153
  (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: currencySymbol, width: 32, height: 32, className: 'transaction-card__icon__container__main' }) }) })] })] }) }) }) }));
138
- const renderTransactionDetails = () => (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsxs("div", { className: 'transaction-card__details', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress.shortenWalletAddress(transaction.to) })] }), !isGasSponsored && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxRuntime.jsxs("div", { className: 'transaction-card__network-info', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) || 'Ethereum' }), jsxRuntime.jsx("img", { src: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.iconUrls[0]) || (chain === null || chain === void 0 ? void 0 : chain.icon), alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) || 'Network icon', width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.gas_estimate', children: t('dyn_send_transaction.confirmation.data.gas_estimate') }), jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Network fees are paid to process your transaction', className: 'transaction-confirmation', children: jsxRuntime.jsx(Icon.Icon, { size: 'small', className: 'fee-tooltip', children: jsxRuntime.jsx(tooltip.ReactComponent, {}) }) })] }), jsxRuntime.jsx("div", { className: 'transaction-card__value', children: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: Number(gasFiatValue) <= 0.01
154
+ const renderTransactionDetails = () => (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsxs("div", { className: 'transaction-card__details', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress.shortenWalletAddress(transaction.to) })] }), !isGasSponsored && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxRuntime.jsxs("div", { className: 'transaction-card__network-info', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
155
+ (isBitcoinTransaction ? 'Bitcoin' : 'Ethereum') }), jsxRuntime.jsx("img", { src: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.iconUrls[0]) || (chain === null || chain === void 0 ? void 0 : chain.icon), alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
156
+ (isBitcoinTransaction ? 'Bitcoin' : 'Network icon'), width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), isBitcoinTransaction && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.fee_priority', children: "Fee Priority" }), jsxRuntime.jsxs("div", { className: 'transaction-card__value', style: {
157
+ alignItems: 'center',
158
+ display: 'inline-flex',
159
+ position: 'relative',
160
+ }, children: [jsxRuntime.jsxs("select", { id: 'fee-priority-select', value: feePriority, onChange: (e) => handleFeePriorityChange(e.target.value), "data-testid": 'fee-priority-select', style: {
161
+ MozAppearance: 'none',
162
+ WebkitAppearance: 'none',
163
+ appearance: 'none',
164
+ background: 'transparent',
165
+ border: 'none',
166
+ color: 'inherit',
167
+ cursor: 'pointer',
168
+ fontSize: 'inherit',
169
+ fontWeight: 'inherit',
170
+ outline: 'none',
171
+ padding: 0,
172
+ paddingRight: '20px',
173
+ }, children: [jsxRuntime.jsx("option", { value: 'high', children: "High" }), jsxRuntime.jsx("option", { value: 'medium', children: "Medium" }), jsxRuntime.jsx("option", { value: 'low', children: "Low" })] }), jsxRuntime.jsx("div", { style: {
174
+ alignItems: 'center',
175
+ display: 'flex',
176
+ opacity: 0.6,
177
+ pointerEvents: 'none',
178
+ position: 'absolute',
179
+ right: 0,
180
+ }, children: jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) }) })] })] })] })), jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.gas_estimate', children: t('dyn_send_transaction.confirmation.data.gas_estimate') }), jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Network fees are paid to process your transaction', className: 'transaction-confirmation', children: jsxRuntime.jsx(Icon.Icon, { size: 'small', className: 'fee-tooltip', children: jsxRuntime.jsx(tooltip.ReactComponent, {}) }) })] }), jsxRuntime.jsx("div", { className: 'transaction-card__value', children: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: Number(gasFiatValue) <= 0.01
139
181
  ? '<$0.01'
140
182
  : `$${gasFiatValue}` })) : (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: [transaction.fee.gas
141
183
  ? transaction.format(transaction.fee.gas, {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TokenBalance } from '@dynamic-labs/sdk-api-core';
3
3
  import { IUITransaction } from '@dynamic-labs/types';
4
- export declare const SendBalanceTransactionCard: ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, }: {
4
+ export declare const SendBalanceTransactionCard: ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, onFeeUpdate, }: {
5
5
  transaction: IUITransaction;
6
6
  currentToken: TokenBalance | undefined;
7
7
  currencySymbol: string | undefined;
@@ -12,5 +12,6 @@ export declare const SendBalanceTransactionCard: ({ transaction, currentToken, c
12
12
  totalGasFiatValue: string;
13
13
  currency: string | undefined;
14
14
  total: bigint | undefined;
15
- t: any;
15
+ t: (key: string) => string;
16
+ onFeeUpdate?: () => void;
16
17
  }) => JSX.Element;
@@ -1,8 +1,10 @@
1
1
  'use client'
2
+ import { __awaiter } from '../../../../_virtual/_tslib.js';
2
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
+ import { useState, useCallback } from 'react';
5
+ import { isBitcoinConnector } from '@dynamic-labs/wallet-connector-core';
3
6
  import '@dynamic-labs/iconic';
4
- import '@dynamic-labs/wallet-connector-core';
5
- import 'react';
7
+ import { ReactComponent as SvgChevronDown } from '../../shared/assets/chevron-down.js';
6
8
  import { ReactComponent as SvgTooltip } from '../../shared/assets/tooltip.js';
7
9
  import '../../context/ViewContext/ViewContext.js';
8
10
  import '../../shared/logger.js';
@@ -16,7 +18,6 @@ import { shortenWalletAddress } from '../../shared/utils/functions/shortenWallet
16
18
  import '../../context/DynamicContext/DynamicContext.js';
17
19
  import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
18
20
  import '../../events/dynamicEvents.js';
19
- import '../../../../_virtual/_tslib.js';
20
21
  import '../../context/CaptchaContext/CaptchaContext.js';
21
22
  import '../../context/ErrorContext/ErrorContext.js';
22
23
  import '@dynamic-labs/multi-wallet';
@@ -111,8 +112,8 @@ import '../../store/state/multichainBalances.js';
111
112
  import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
112
113
  import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
113
114
 
114
- const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, }) => {
115
- var _a;
115
+ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, onFeeUpdate, }) => {
116
+ var _a, _b;
116
117
  const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext();
117
118
  const networkInfo = useNetworkConfigurationsFromProjectSettings({
118
119
  evmNetworksOverrides: overrides === null || overrides === void 0 ? void 0 : overrides.evmNetworks,
@@ -124,6 +125,21 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
124
125
  networkId: chain === null || chain === void 0 ? void 0 : chain.chainId,
125
126
  networkInfo,
126
127
  });
128
+ // Check if this is a Bitcoin transaction
129
+ const isBitcoinTransaction = transaction.chain === 'BTC' ||
130
+ ((_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _b === void 0 ? void 0 : _b.connectedChain) === 'BTC' ||
131
+ ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) && isBitcoinConnector(primaryWallet.connector));
132
+ const bitcoinTransaction = transaction;
133
+ const [feePriority, setFeePriority] = useState((bitcoinTransaction === null || bitcoinTransaction === void 0 ? void 0 : bitcoinTransaction.feePriority) || 'medium');
134
+ const handleFeePriorityChange = useCallback((newPriority) => __awaiter(void 0, void 0, void 0, function* () {
135
+ var _c;
136
+ if (!isBitcoinTransaction || feePriority === newPriority) {
137
+ return;
138
+ }
139
+ setFeePriority(newPriority);
140
+ yield ((_c = bitcoinTransaction.updateFeePriority) === null || _c === void 0 ? void 0 : _c.call(bitcoinTransaction, newPriority));
141
+ onFeeUpdate === null || onFeeUpdate === void 0 ? void 0 : onFeeUpdate();
142
+ }), [isBitcoinTransaction, feePriority, bitcoinTransaction, onFeeUpdate]);
127
143
  const renderTransferDetails = () => (jsx("div", { className: 'transaction-card', children: jsx("div", { className: 'transaction-card__assets-container', children: jsx("div", { className: 'transaction-card__out', children: jsxs("div", { className: 'transaction-card__info-container', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', children: t('dyn_send_transaction.confirmation.data.transfer.send') }), jsxs("div", { className: 'transaction-card__amount-symbol', children: [jsxs("div", { className: 'transaction-card__token-info', children: [jsxs("div", { className: 'transaction-card__token-row', children: [jsxs(Typography, { variant: 'body_normal', color: 'error-1', "data-testid": 'transaction-transfer-amount', children: ["-", valueRounded ||
128
144
  ((transaction === null || transaction === void 0 ? void 0 : transaction.value)
129
145
  ? transaction.format(transaction.value, {
@@ -131,7 +147,33 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
131
147
  })
132
148
  : '')] }), jsx(Typography, { variant: 'body_normal', color: 'secondary', children: currencySymbol })] }), transactionValue && (jsxs(Typography, { variant: 'body_small', color: 'error-1', "data-testid": 'transaction-transfer-amount-fiat', children: ["$", getDisplayFiatPrice(Number(transactionValue) || Number(valueRounded) || 0, currentToken)] }))] }), jsx("div", { className: 'transaction-card__icon', children: jsx("div", { className: 'transaction-card__icon__container', children: jsx("img", { src: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.logoURI) ||
133
149
  (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: currencySymbol, width: 32, height: 32, className: 'transaction-card__icon__container__main' }) }) })] })] }) }) }) }));
134
- const renderTransactionDetails = () => (jsx("div", { className: 'transaction-card', children: jsxs("div", { className: 'transaction-card__details', children: [jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress(transaction.to) })] }), !isGasSponsored && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxs("div", { className: 'transaction-card__network-info', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) || 'Ethereum' }), jsx("img", { src: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.iconUrls[0]) || (chain === null || chain === void 0 ? void 0 : chain.icon), alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) || 'Network icon', width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.gas_estimate', children: t('dyn_send_transaction.confirmation.data.gas_estimate') }), jsx(Tooltip, { content: 'Network fees are paid to process your transaction', className: 'transaction-confirmation', children: jsx(Icon, { size: 'small', className: 'fee-tooltip', children: jsx(SvgTooltip, {}) }) })] }), jsx("div", { className: 'transaction-card__value', children: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? (jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: Number(gasFiatValue) <= 0.01
150
+ const renderTransactionDetails = () => (jsx("div", { className: 'transaction-card', children: jsxs("div", { className: 'transaction-card__details', children: [jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress(transaction.to) })] }), !isGasSponsored && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxs("div", { className: 'transaction-card__network-info', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
151
+ (isBitcoinTransaction ? 'Bitcoin' : 'Ethereum') }), jsx("img", { src: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.iconUrls[0]) || (chain === null || chain === void 0 ? void 0 : chain.icon), alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
152
+ (isBitcoinTransaction ? 'Bitcoin' : 'Network icon'), width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), isBitcoinTransaction && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.fee_priority', children: "Fee Priority" }), jsxs("div", { className: 'transaction-card__value', style: {
153
+ alignItems: 'center',
154
+ display: 'inline-flex',
155
+ position: 'relative',
156
+ }, children: [jsxs("select", { id: 'fee-priority-select', value: feePriority, onChange: (e) => handleFeePriorityChange(e.target.value), "data-testid": 'fee-priority-select', style: {
157
+ MozAppearance: 'none',
158
+ WebkitAppearance: 'none',
159
+ appearance: 'none',
160
+ background: 'transparent',
161
+ border: 'none',
162
+ color: 'inherit',
163
+ cursor: 'pointer',
164
+ fontSize: 'inherit',
165
+ fontWeight: 'inherit',
166
+ outline: 'none',
167
+ padding: 0,
168
+ paddingRight: '20px',
169
+ }, children: [jsx("option", { value: 'high', children: "High" }), jsx("option", { value: 'medium', children: "Medium" }), jsx("option", { value: 'low', children: "Low" })] }), jsx("div", { style: {
170
+ alignItems: 'center',
171
+ display: 'flex',
172
+ opacity: 0.6,
173
+ pointerEvents: 'none',
174
+ position: 'absolute',
175
+ right: 0,
176
+ }, children: jsx(Icon, { size: 'small', children: jsx(SvgChevronDown, {}) }) })] })] })] })), jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.gas_estimate', children: t('dyn_send_transaction.confirmation.data.gas_estimate') }), jsx(Tooltip, { content: 'Network fees are paid to process your transaction', className: 'transaction-confirmation', children: jsx(Icon, { size: 'small', className: 'fee-tooltip', children: jsx(SvgTooltip, {}) }) })] }), jsx("div", { className: 'transaction-card__value', children: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? (jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: Number(gasFiatValue) <= 0.01
135
177
  ? '<$0.01'
136
178
  : `$${gasFiatValue}` })) : (jsxs(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: [transaction.fee.gas
137
179
  ? transaction.format(transaction.fee.gas, {
@@ -124,7 +124,7 @@ require('../../store/state/multichainBalances.cjs');
124
124
  require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
125
125
  var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
126
126
 
127
- const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, error, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, isNativeToken, walletKey, simulationResult, sendBalanceTransaction, recipient, }) => {
127
+ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, error, fetchTransactionFee, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, isNativeToken, walletKey, simulationResult, sendBalanceTransaction, recipient, }) => {
128
128
  var _a;
129
129
  const { t } = reactI18next.useTranslation();
130
130
  const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
@@ -153,7 +153,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
153
153
  const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
154
154
  const gasFiatValue = fiatUtils.getGasFiatValue(currentToken, transaction, nativePrice);
155
155
  const totalGasFiatValue = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
156
- return hideModal ? null : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__banner', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsxRuntime.jsx(TransactionCard.TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsxRuntime.jsx(SendBalanceTransactionCard.SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = utils.getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t })), children && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: alert && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, { walletCredential: walletCredential }), displayPoweredByDynamicFooter && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-confirmation__divider' }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
156
+ return hideModal ? null : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__banner', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsxRuntime.jsx(TransactionCard.TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsxRuntime.jsx(SendBalanceTransactionCard.SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = utils.getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t, onFeeUpdate: fetchTransactionFee })), children && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: alert && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, { walletCredential: walletCredential }), displayPoweredByDynamicFooter && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-confirmation__divider' }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
157
157
  };
158
158
 
159
159
  exports.TransactionConfirmationPageLayout = TransactionConfirmationPageLayout;
@@ -7,6 +7,7 @@ type TransactionConfirmationPageLayoutProps = {
7
7
  disableSendButton?: boolean;
8
8
  displayPoweredByDynamicFooter?: boolean;
9
9
  error?: string;
10
+ fetchTransactionFee?: () => void;
10
11
  isLoading: boolean;
11
12
  onClickBack?: MouseEventHandler<HTMLButtonElement>;
12
13
  onClickClose?: MouseEventHandler<HTMLButtonElement>;
@@ -120,7 +120,7 @@ import '../../store/state/multichainBalances.js';
120
120
  import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
121
121
  import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
122
122
 
123
- const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, error, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, isNativeToken, walletKey, simulationResult, sendBalanceTransaction, recipient, }) => {
123
+ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, error, fetchTransactionFee, alert, walletConnector, transaction, currentToken, children, hideModal, onSuccess, transactionValue, total, isGasSponsored, isNativeToken, walletKey, simulationResult, sendBalanceTransaction, recipient, }) => {
124
124
  var _a;
125
125
  const { t } = useTranslation();
126
126
  const { isTurnkeyWallet } = useIsTurnkeyWallet();
@@ -149,7 +149,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
149
149
  const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
150
150
  const gasFiatValue = getGasFiatValue(currentToken, transaction, nativePrice);
151
151
  const totalGasFiatValue = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
152
- return hideModal ? null : (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsx("div", { className: 'transaction-confirmation__banner', children: jsx(Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'transaction-confirmation__body', children: [jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsx("div", { className: 'transaction-confirmation__error', children: jsx(ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsx(TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsx(SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t })), children && (jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: alert && (jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsx(NeedHelpSection, { walletCredential: walletCredential }), displayPoweredByDynamicFooter && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-confirmation__divider' }), jsx(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
152
+ return hideModal ? null : (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), !sendBalanceTransaction && (jsx("div", { className: 'transaction-confirmation__banner', children: jsx(Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_send_transaction.data.banner', children: t('dyn_send_transaction.data.banner') }) })), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'transaction-confirmation__body', children: [jsxs("div", { className: 'transaction-confirmation__content', children: [error && (jsx("div", { className: 'transaction-confirmation__error', children: jsx(ErrorContainer, { children: error }) })), !sendBalanceTransaction ? (jsx(TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient })) : (jsx(SendBalanceTransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, valueRounded: (_a = getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), transactionValue: transactionValue, isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency === null || currency === void 0 ? void 0 : currency.symbol, total: total, t: t, onFeeUpdate: fetchTransactionFee })), children && (jsx("div", { className: 'transaction-confirmation__rows', children: children }))] }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: alert && (jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'medium', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'medium', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), jsx(NeedHelpSection, { walletCredential: walletCredential }), displayPoweredByDynamicFooter && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-confirmation__divider' }), jsx(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' })] }))] })] }));
153
153
  };
154
154
 
155
155
  export { TransactionConfirmationPageLayout };
@@ -59,6 +59,7 @@ require('../../context/MockContext/MockContext.cjs');
59
59
  require('../../views/CollectUserDataView/useFields.cjs');
60
60
  require('../../context/FieldsStateContext/FieldsStateContext.cjs');
61
61
  require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
62
+ var settingsUtils = require('../../store/utils/settingsUtils/settingsUtils.cjs');
62
63
  require('react-i18next');
63
64
  require('../Accordion/components/AccordionItem/AccordionItem.cjs');
64
65
  require('../Alert/Alert.cjs');
@@ -111,6 +112,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
111
112
  const WalletConnectorEvents = ({ connectorProps, }) => {
112
113
  const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
113
114
  const { handleWalletItemClick } = useWalletItemActions.useWalletItemActions();
115
+ const redirectUrl = settingsUtils.useRedirectUrl();
114
116
  const pendingConstructorRef = React.useRef([]);
115
117
  const injectedDebounceTimeoutRef = React.useRef();
116
118
  const pendingReadyConnectorsRef = React.useRef([]);
@@ -129,8 +131,8 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
129
131
  !walletBook.isWalletBookPopulated(connectorProps.walletBook)) {
130
132
  return;
131
133
  }
132
- return multiWallet.getWalletConnectorConstructorOptions(Object.assign(Object.assign({}, connectorProps), { chainRpcProviders: rpcProviders.ChainRpcProviders, settings: connectorProps.projectSettings, walletConnectProjectId: (_b = (_a = connectorProps.projectSettings) === null || _a === void 0 ? void 0 : _a.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId }));
133
- }, [connectorProps]);
134
+ return multiWallet.getWalletConnectorConstructorOptions(Object.assign(Object.assign({}, connectorProps), { chainRpcProviders: rpcProviders.ChainRpcProviders, redirectUrl, settings: connectorProps.projectSettings, walletConnectProjectId: (_b = (_a = connectorProps.projectSettings) === null || _a === void 0 ? void 0 : _a.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId }));
135
+ }, [connectorProps, redirectUrl]);
134
136
  // add listener for providerInjected event
135
137
  React.useEffect(() => {
136
138
  const processPendingConstructors = () => {
@@ -55,6 +55,7 @@ import '../../context/MockContext/MockContext.js';
55
55
  import '../../views/CollectUserDataView/useFields.js';
56
56
  import '../../context/FieldsStateContext/FieldsStateContext.js';
57
57
  import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
58
+ import { useRedirectUrl } from '../../store/utils/settingsUtils/settingsUtils.js';
58
59
  import 'react-i18next';
59
60
  import '../Accordion/components/AccordionItem/AccordionItem.js';
60
61
  import '../Alert/Alert.js';
@@ -107,6 +108,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
107
108
  const WalletConnectorEvents = ({ connectorProps, }) => {
108
109
  const { primaryWallet } = useInternalDynamicContext();
109
110
  const { handleWalletItemClick } = useWalletItemActions();
111
+ const redirectUrl = useRedirectUrl();
110
112
  const pendingConstructorRef = useRef([]);
111
113
  const injectedDebounceTimeoutRef = useRef();
112
114
  const pendingReadyConnectorsRef = useRef([]);
@@ -125,8 +127,8 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
125
127
  !isWalletBookPopulated(connectorProps.walletBook)) {
126
128
  return;
127
129
  }
128
- return getWalletConnectorConstructorOptions(Object.assign(Object.assign({}, connectorProps), { chainRpcProviders: ChainRpcProviders, settings: connectorProps.projectSettings, walletConnectProjectId: (_b = (_a = connectorProps.projectSettings) === null || _a === void 0 ? void 0 : _a.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId }));
129
- }, [connectorProps]);
130
+ return getWalletConnectorConstructorOptions(Object.assign(Object.assign({}, connectorProps), { chainRpcProviders: ChainRpcProviders, redirectUrl, settings: connectorProps.projectSettings, walletConnectProjectId: (_b = (_a = connectorProps.projectSettings) === null || _a === void 0 ? void 0 : _a.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId }));
131
+ }, [connectorProps, redirectUrl]);
130
132
  // add listener for providerInjected event
131
133
  useEffect(() => {
132
134
  const processPendingConstructors = () => {
@@ -179,7 +179,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
179
179
  const DynamicContext = React.createContext(undefined);
180
180
  /** The context provider itself we only use internally */
181
181
  const InnerDynamicContextProvider = (props) => {
182
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
182
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
183
183
  const { children, theme, settings: settings$1, locale: locale$1, enableInstrumentation = false, } = props;
184
184
  const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.defaultDynamicSettings.deepLinkPreference, bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = defaultDynamicSettings.defaultDynamicSettings.initialAuthenticationMode, debugError = defaultDynamicSettings.defaultDynamicSettings.debugError, displaySiweStatement = defaultDynamicSettings.defaultDynamicSettings.displaySiweStatement, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = defaultDynamicSettings.defaultDynamicSettings.enableVisitTrackingOnConnectOnly, environmentId, walletsFilter, logLevel = defaultDynamicSettings.defaultDynamicSettings.logLevel, mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, siweStatement, shadowDOMEnabled = defaultDynamicSettings.defaultDynamicSettings.shadowDOMEnabled, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = defaultDynamicSettings.defaultDynamicSettings.showLockedWalletView, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, handlers, suppressEndUserConsoleWarning, transactionConfirmation: transactionConfirmationSettings, useMetamaskSdk = defaultDynamicSettings.defaultDynamicSettings.useMetamaskSdk, } = settings$1;
185
185
  let { appLogoUrl = defaultDynamicSettings.defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.defaultDynamicSettings.appName, } = settings$1;
@@ -243,13 +243,14 @@ const InnerDynamicContextProvider = (props) => {
243
243
  const refetchProjectSettings = useRefetchProjectSettings.useRefetchProjectSettings();
244
244
  const serverNetworkConfigurations = useNetworkConfigurationsFromProjectSettings.useNetworkConfigurationsFromProjectSettings({
245
245
  aptosNetworksOverrides: (_b = settings$1.overrides) === null || _b === void 0 ? void 0 : _b.aptosNetworks,
246
- cosmosNetworkOverrides: (_c = settings$1.overrides) === null || _c === void 0 ? void 0 : _c.cosmosNetworks,
247
- evmNetworksOverrides: (_d = settings$1.overrides) === null || _d === void 0 ? void 0 : _d.evmNetworks,
246
+ bitcoinNetworksOverrides: (_c = settings$1.overrides) === null || _c === void 0 ? void 0 : _c.bitcoinNetworks,
247
+ cosmosNetworkOverrides: (_d = settings$1.overrides) === null || _d === void 0 ? void 0 : _d.cosmosNetworks,
248
+ evmNetworksOverrides: (_e = settings$1.overrides) === null || _e === void 0 ? void 0 : _e.evmNetworks,
248
249
  projectSettings,
249
- solanaNetworksOverrides: (_e = settings$1.overrides) === null || _e === void 0 ? void 0 : _e.solNetworks,
250
- stellarNetworksOverrides: (_f = settings$1.overrides) === null || _f === void 0 ? void 0 : _f.stellarNetworks,
251
- tonNetworksOverrides: (_g = settings$1.overrides) === null || _g === void 0 ? void 0 : _g.tonNetworks,
252
- tronNetworksOverrides: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.tronNetworks,
250
+ solanaNetworksOverrides: (_f = settings$1.overrides) === null || _f === void 0 ? void 0 : _f.solNetworks,
251
+ stellarNetworksOverrides: (_g = settings$1.overrides) === null || _g === void 0 ? void 0 : _g.stellarNetworks,
252
+ tonNetworksOverrides: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.tonNetworks,
253
+ tronNetworksOverrides: (_j = settings$1.overrides) === null || _j === void 0 ? void 0 : _j.tronNetworks,
253
254
  });
254
255
  useSendDynamicProps.useSendDynamicProps({ environmentId, settings: settings$1 });
255
256
  // Console warning for end user safety
@@ -259,16 +260,16 @@ const InnerDynamicContextProvider = (props) => {
259
260
  });
260
261
  const multiWallet = useMultiWallet.useMultiWallet({
261
262
  isBridgeFlow,
262
- multiWalletOverride: (_j = settings$1.overrides) === null || _j === void 0 ? void 0 : _j.multiWallet,
263
- multiWalletSettings: (_k = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _k === void 0 ? void 0 : _k.multiWallet,
263
+ multiWalletOverride: (_k = settings$1.overrides) === null || _k === void 0 ? void 0 : _k.multiWallet,
264
+ multiWalletSettings: (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.multiWallet,
264
265
  });
265
266
  const multiAsset = useMultiAsset.useMultiAsset({
266
- multiAssetOverride: (_l = settings$1.overrides) === null || _l === void 0 ? void 0 : _l.multiAsset,
267
- multiAssetSettings: (_m = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _m === void 0 ? void 0 : _m.enableMultiAsset,
267
+ multiAssetOverride: (_m = settings$1.overrides) === null || _m === void 0 ? void 0 : _m.multiAsset,
268
+ multiAssetSettings: (_o = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _o === void 0 ? void 0 : _o.enableMultiAsset,
268
269
  });
269
270
  const showFiat = useShowFiat.useShowFiat({
270
- showFiatOverride: (_o = settings$1.overrides) === null || _o === void 0 ? void 0 : _o.showFiat,
271
- showFiatSettings: (_p = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _p === void 0 ? void 0 : _p.showFiat,
271
+ showFiatOverride: (_p = settings$1.overrides) === null || _p === void 0 ? void 0 : _p.showFiat,
272
+ showFiatSettings: (_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _q === void 0 ? void 0 : _q.showFiat,
272
273
  });
273
274
  // Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
274
275
  const [legacyIsVerifying, setLegacyIsVerifying] = React.useState(false);
@@ -343,7 +344,7 @@ const InnerDynamicContextProvider = (props) => {
343
344
  canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
344
345
  connectedWallets,
345
346
  primaryWalletId: primaryWalletId$1,
346
- separateSmartWalletAndSigner: (_r = (_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _q === void 0 ? void 0 : _q.accountAbstraction) === null || _r === void 0 ? void 0 : _r.separateSmartWalletAndSigner,
347
+ separateSmartWalletAndSigner: (_s = (_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _r === void 0 ? void 0 : _r.accountAbstraction) === null || _s === void 0 ? void 0 : _s.separateSmartWalletAndSigner,
347
348
  setMultiWalletWidgetState,
348
349
  user: user || userWithMissingInfo,
349
350
  walletConnectorOptions,
@@ -447,8 +448,8 @@ const InnerDynamicContextProvider = (props) => {
447
448
  const { walletsForChainsMap } = useFetchWalletsForChainsMap.useFetchWalletsForChainsMap(newToWeb3WalletChainMap);
448
449
  const { setCallback } = useCustomerCallbacks.useCustomerCallbacks({
449
450
  callbacks: {
450
- onAuthSuccess: (_s = settings$1.events) === null || _s === void 0 ? void 0 : _s.onAuthSuccess,
451
- onUserProfileUpdate: (_t = settings$1.events) === null || _t === void 0 ? void 0 : _t.onUserProfileUpdate,
451
+ onAuthSuccess: (_t = settings$1.events) === null || _t === void 0 ? void 0 : _t.onAuthSuccess,
452
+ onUserProfileUpdate: (_u = settings$1.events) === null || _u === void 0 ? void 0 : _u.onUserProfileUpdate,
452
453
  },
453
454
  handleLogOut,
454
455
  isAuthenticated,
@@ -736,7 +737,7 @@ const InnerDynamicContextProvider = (props) => {
736
737
  isBridgeFlow,
737
738
  isMultiWalletEnabled: multiWallet,
738
739
  });
739
- 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, ((_u = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _u === void 0 ? void 0 : _u.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(OnrampContext.OnrampContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(OnrampWidget.OnrampWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), jsxRuntime.jsx(WalletConnectorEvents.WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
740
+ 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, ((_v = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _v === void 0 ? void 0 : _v.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(OnrampContext.OnrampContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(OnrampWidget.OnrampWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), jsxRuntime.jsx(WalletConnectorEvents.WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
740
741
  };
741
742
  /** The context provider you need to have access too all of Dynamic's hooks */
742
743
  const DynamicContextProvider = (props) => {
@@ -175,7 +175,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
175
175
  const DynamicContext = createContext(undefined);
176
176
  /** The context provider itself we only use internally */
177
177
  const InnerDynamicContextProvider = (props) => {
178
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
178
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
179
179
  const { children, theme, settings, locale, enableInstrumentation = false, } = props;
180
180
  const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.deepLinkPreference, bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = defaultDynamicSettings.initialAuthenticationMode, debugError = defaultDynamicSettings.debugError, displaySiweStatement = defaultDynamicSettings.displaySiweStatement, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = defaultDynamicSettings.enableVisitTrackingOnConnectOnly, environmentId, walletsFilter, logLevel = defaultDynamicSettings.logLevel, mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, siweStatement, shadowDOMEnabled = defaultDynamicSettings.shadowDOMEnabled, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = defaultDynamicSettings.showLockedWalletView, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, handlers, suppressEndUserConsoleWarning, transactionConfirmation: transactionConfirmationSettings, useMetamaskSdk = defaultDynamicSettings.useMetamaskSdk, } = settings;
181
181
  let { appLogoUrl = defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.appName, } = settings;
@@ -239,13 +239,14 @@ const InnerDynamicContextProvider = (props) => {
239
239
  const refetchProjectSettings = useRefetchProjectSettings();
240
240
  const serverNetworkConfigurations = useNetworkConfigurationsFromProjectSettings({
241
241
  aptosNetworksOverrides: (_b = settings.overrides) === null || _b === void 0 ? void 0 : _b.aptosNetworks,
242
- cosmosNetworkOverrides: (_c = settings.overrides) === null || _c === void 0 ? void 0 : _c.cosmosNetworks,
243
- evmNetworksOverrides: (_d = settings.overrides) === null || _d === void 0 ? void 0 : _d.evmNetworks,
242
+ bitcoinNetworksOverrides: (_c = settings.overrides) === null || _c === void 0 ? void 0 : _c.bitcoinNetworks,
243
+ cosmosNetworkOverrides: (_d = settings.overrides) === null || _d === void 0 ? void 0 : _d.cosmosNetworks,
244
+ evmNetworksOverrides: (_e = settings.overrides) === null || _e === void 0 ? void 0 : _e.evmNetworks,
244
245
  projectSettings,
245
- solanaNetworksOverrides: (_e = settings.overrides) === null || _e === void 0 ? void 0 : _e.solNetworks,
246
- stellarNetworksOverrides: (_f = settings.overrides) === null || _f === void 0 ? void 0 : _f.stellarNetworks,
247
- tonNetworksOverrides: (_g = settings.overrides) === null || _g === void 0 ? void 0 : _g.tonNetworks,
248
- tronNetworksOverrides: (_h = settings.overrides) === null || _h === void 0 ? void 0 : _h.tronNetworks,
246
+ solanaNetworksOverrides: (_f = settings.overrides) === null || _f === void 0 ? void 0 : _f.solNetworks,
247
+ stellarNetworksOverrides: (_g = settings.overrides) === null || _g === void 0 ? void 0 : _g.stellarNetworks,
248
+ tonNetworksOverrides: (_h = settings.overrides) === null || _h === void 0 ? void 0 : _h.tonNetworks,
249
+ tronNetworksOverrides: (_j = settings.overrides) === null || _j === void 0 ? void 0 : _j.tronNetworks,
249
250
  });
250
251
  useSendDynamicProps({ environmentId, settings });
251
252
  // Console warning for end user safety
@@ -255,16 +256,16 @@ const InnerDynamicContextProvider = (props) => {
255
256
  });
256
257
  const multiWallet = useMultiWallet({
257
258
  isBridgeFlow,
258
- multiWalletOverride: (_j = settings.overrides) === null || _j === void 0 ? void 0 : _j.multiWallet,
259
- multiWalletSettings: (_k = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _k === void 0 ? void 0 : _k.multiWallet,
259
+ multiWalletOverride: (_k = settings.overrides) === null || _k === void 0 ? void 0 : _k.multiWallet,
260
+ multiWalletSettings: (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.multiWallet,
260
261
  });
261
262
  const multiAsset = useMultiAsset({
262
- multiAssetOverride: (_l = settings.overrides) === null || _l === void 0 ? void 0 : _l.multiAsset,
263
- multiAssetSettings: (_m = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _m === void 0 ? void 0 : _m.enableMultiAsset,
263
+ multiAssetOverride: (_m = settings.overrides) === null || _m === void 0 ? void 0 : _m.multiAsset,
264
+ multiAssetSettings: (_o = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _o === void 0 ? void 0 : _o.enableMultiAsset,
264
265
  });
265
266
  const showFiat = useShowFiat({
266
- showFiatOverride: (_o = settings.overrides) === null || _o === void 0 ? void 0 : _o.showFiat,
267
- showFiatSettings: (_p = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _p === void 0 ? void 0 : _p.showFiat,
267
+ showFiatOverride: (_p = settings.overrides) === null || _p === void 0 ? void 0 : _p.showFiat,
268
+ showFiatSettings: (_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _q === void 0 ? void 0 : _q.showFiat,
268
269
  });
269
270
  // Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
270
271
  const [legacyIsVerifying, setLegacyIsVerifying] = useState(false);
@@ -339,7 +340,7 @@ const InnerDynamicContextProvider = (props) => {
339
340
  canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
340
341
  connectedWallets,
341
342
  primaryWalletId,
342
- separateSmartWalletAndSigner: (_r = (_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _q === void 0 ? void 0 : _q.accountAbstraction) === null || _r === void 0 ? void 0 : _r.separateSmartWalletAndSigner,
343
+ separateSmartWalletAndSigner: (_s = (_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _r === void 0 ? void 0 : _r.accountAbstraction) === null || _s === void 0 ? void 0 : _s.separateSmartWalletAndSigner,
343
344
  setMultiWalletWidgetState,
344
345
  user: user || userWithMissingInfo,
345
346
  walletConnectorOptions,
@@ -443,8 +444,8 @@ const InnerDynamicContextProvider = (props) => {
443
444
  const { walletsForChainsMap } = useFetchWalletsForChainsMap(newToWeb3WalletChainMap);
444
445
  const { setCallback } = useCustomerCallbacks({
445
446
  callbacks: {
446
- onAuthSuccess: (_s = settings.events) === null || _s === void 0 ? void 0 : _s.onAuthSuccess,
447
- onUserProfileUpdate: (_t = settings.events) === null || _t === void 0 ? void 0 : _t.onUserProfileUpdate,
447
+ onAuthSuccess: (_t = settings.events) === null || _t === void 0 ? void 0 : _t.onAuthSuccess,
448
+ onUserProfileUpdate: (_u = settings.events) === null || _u === void 0 ? void 0 : _u.onUserProfileUpdate,
448
449
  },
449
450
  handleLogOut,
450
451
  isAuthenticated,
@@ -732,7 +733,7 @@ const InnerDynamicContextProvider = (props) => {
732
733
  isBridgeFlow,
733
734
  isMultiWalletEnabled: multiWallet,
734
735
  });
735
- return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_u = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _u === void 0 ? void 0 : _u.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(OnrampContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(OnrampWidget, {}), jsx(SyncAuthFlow, {}), jsx(WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
736
+ return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_v = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _v === void 0 ? void 0 : _v.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(OnrampContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(OnrampWidget, {}), jsx(SyncAuthFlow, {}), jsx(WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
736
737
  };
737
738
  /** The context provider you need to have access too all of Dynamic's hooks */
738
739
  const DynamicContextProvider = (props) => {
@@ -123,6 +123,16 @@ export type SettingsOverrides = {
123
123
  * the SDK can react to this value changing (for ex, toggling a chain off).
124
124
  */
125
125
  stellarNetworks?: NetworksOverrides;
126
+ /**
127
+ * Allows overriding which bitcoin networks the SDK has access to.
128
+ * If an array is provided, it is used instead of whatever is obtained from dashboard configs.
129
+ * If a callback is passed, the callback will be called with the values obtained from dashboard, and
130
+ * it must return the network values that will be used.
131
+ *
132
+ * WARNING: this callback must be memoized as it will be used in a dependency array to ensure
133
+ * the SDK can react to this value changing (for ex, toggling a chain off).
134
+ */
135
+ bitcoinNetworks?: NetworksOverrides;
126
136
  /**
127
137
  * Allows overriding the multi-wallet feature from the dashboard.
128
138
  */
@@ -1 +1 @@
1
- export { useAppName } from './settingsUtils';
1
+ export { useAppName, useRedirectUrl } from './settingsUtils';
@@ -38,5 +38,7 @@ const useDynamicSettingsValue = (projectSettingName, dynamicSettingName) => {
38
38
  return ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general[projectSettingName]) !== null && _a !== void 0 ? _a : dynamicSettings[dynamicSettingName]);
39
39
  };
40
40
  const useAppName = () => useDynamicSettingsValue('displayName', 'appName');
41
+ const useRedirectUrl = () => dynamicContextProps.useDynamicSettings().redirectUrl;
41
42
 
42
43
  exports.useAppName = useAppName;
44
+ exports.useRedirectUrl = useRedirectUrl;
@@ -1 +1,2 @@
1
1
  export declare const useAppName: () => string | undefined;
2
+ export declare const useRedirectUrl: () => string | undefined;
@@ -34,5 +34,6 @@ const useDynamicSettingsValue = (projectSettingName, dynamicSettingName) => {
34
34
  return ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general[projectSettingName]) !== null && _a !== void 0 ? _a : dynamicSettings[dynamicSettingName]);
35
35
  };
36
36
  const useAppName = () => useDynamicSettingsValue('displayName', 'appName');
37
+ const useRedirectUrl = () => useDynamicSettings().redirectUrl;
37
38
 
38
- export { useAppName };
39
+ export { useAppName, useRedirectUrl };
@@ -32,23 +32,27 @@ require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
32
32
  require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
33
33
  require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
34
34
  var walletOptions = require('../../../store/state/walletOptions/walletOptions.cjs');
35
+ var settingsUtils = require('../../../store/utils/settingsUtils/settingsUtils.cjs');
35
36
  var verifyRequiredConnectorsAreSetup = require('./utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.cjs');
36
37
 
37
38
  const useCreateWalletConnectorOptions = (_a) => {
38
39
  var { projectSettings, networkConfigurations, walletBook: walletBook$1, walletConnectorsProp, walletConnectorExtensions } = _a, props = _tslib.__rest(_a, ["projectSettings", "networkConfigurations", "walletBook", "walletConnectorsProp", "walletConnectorExtensions"]);
40
+ const redirectUrl = settingsUtils.useRedirectUrl();
39
41
  const walletConnectorsKey = React.useMemo(() => { var _a; return (_a = serializeWalletConnectors.serializeWalletConnectors(walletConnectorsProp)) === null || _a === void 0 ? void 0 : _a.join(','); }, [walletConnectorsProp]);
40
42
  const isWalletBookLoaded = React.useMemo(() => walletBook.isWalletBookPopulated(walletBook$1), [walletBook$1]);
41
43
  const walletConnectorOptions = React.useMemo(() => {
42
44
  if (!projectSettings || !isWalletBookLoaded || !networkConfigurations)
43
45
  return [];
44
46
  return data.getWallets({
45
- getSupportedWalletOpts: Object.assign({ networkConfigurations, settings: projectSettings, skipMemo: true, walletBook: walletBook$1, walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [] }, props),
47
+ getSupportedWalletOpts: Object.assign({ networkConfigurations,
48
+ redirectUrl, settings: projectSettings, skipMemo: true, walletBook: walletBook$1, walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [] }, props),
46
49
  walletConnectorExtensions,
47
50
  });
48
51
  // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
49
52
  // eslint-disable-next-line react-hooks/exhaustive-deps
50
53
  }, [
51
54
  projectSettings,
55
+ redirectUrl,
52
56
  walletConnectorsKey,
53
57
  isWalletBookLoaded,
54
58
  networkConfigurations,
@@ -28,23 +28,27 @@ import '../../../store/state/primaryWalletId/primaryWalletId.js';
28
28
  import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
29
29
  import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
30
30
  import { mergeWalletConnectorOptions } from '../../../store/state/walletOptions/walletOptions.js';
31
+ import { useRedirectUrl } from '../../../store/utils/settingsUtils/settingsUtils.js';
31
32
  import { verifyRequiredConnectorsAreSetup } from './utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.js';
32
33
 
33
34
  const useCreateWalletConnectorOptions = (_a) => {
34
35
  var { projectSettings, networkConfigurations, walletBook, walletConnectorsProp, walletConnectorExtensions } = _a, props = __rest(_a, ["projectSettings", "networkConfigurations", "walletBook", "walletConnectorsProp", "walletConnectorExtensions"]);
36
+ const redirectUrl = useRedirectUrl();
35
37
  const walletConnectorsKey = useMemo(() => { var _a; return (_a = serializeWalletConnectors(walletConnectorsProp)) === null || _a === void 0 ? void 0 : _a.join(','); }, [walletConnectorsProp]);
36
38
  const isWalletBookLoaded = useMemo(() => isWalletBookPopulated(walletBook), [walletBook]);
37
39
  const walletConnectorOptions = useMemo(() => {
38
40
  if (!projectSettings || !isWalletBookLoaded || !networkConfigurations)
39
41
  return [];
40
42
  return getWallets({
41
- getSupportedWalletOpts: Object.assign({ networkConfigurations, settings: projectSettings, skipMemo: true, walletBook, walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [] }, props),
43
+ getSupportedWalletOpts: Object.assign({ networkConfigurations,
44
+ redirectUrl, settings: projectSettings, skipMemo: true, walletBook, walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [] }, props),
42
45
  walletConnectorExtensions,
43
46
  });
44
47
  // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
45
48
  // eslint-disable-next-line react-hooks/exhaustive-deps
46
49
  }, [
47
50
  projectSettings,
51
+ redirectUrl,
48
52
  walletConnectorsKey,
49
53
  isWalletBookLoaded,
50
54
  networkConfigurations,
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var React = require('react');
7
7
 
8
- const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, stellarNetworksOverrides, tonNetworksOverrides, }) => React.useMemo(() => {
9
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
8
+ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, stellarNetworksOverrides, tonNetworksOverrides, bitcoinNetworksOverrides, }) => React.useMemo(() => {
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10
10
  const networks = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks;
11
11
  if (!networks)
12
12
  return {};
@@ -20,6 +20,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
20
20
  const tron = networks.find((configurations) => configurations.chainName === 'tron');
21
21
  const aptos = networks.find((configurations) => configurations.chainName === 'aptos');
22
22
  const ton = networks.find((configurations) => configurations.chainName === 'ton');
23
+ const bitcoin = networks.find((configurations) => configurations.chainName === 'bitcoin');
23
24
  let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, Number.parseInt));
24
25
  cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
25
26
  let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, Number.parseInt));
@@ -45,8 +46,11 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
45
46
  tonNetworks = overrideNetworks(tonNetworksOverrides, tonNetworks);
46
47
  let stellarNetworks = (_k = stellar === null || stellar === void 0 ? void 0 : stellar.networks) === null || _k === void 0 ? void 0 : _k.map((net) => createNetwork(net));
47
48
  stellarNetworks = overrideNetworks(stellarNetworksOverrides, stellarNetworks);
49
+ let bitcoinNetworks = (_l = bitcoin === null || bitcoin === void 0 ? void 0 : bitcoin.networks) === null || _l === void 0 ? void 0 : _l.map((net) => createNetwork(net, Number.parseInt));
50
+ bitcoinNetworks = overrideNetworks(bitcoinNetworksOverrides, bitcoinNetworks);
48
51
  const networkConfigurations = {
49
52
  aptos: aptosNetworks,
53
+ bitcoin: bitcoinNetworks,
50
54
  cosmos: cosmosNetworks,
51
55
  eclipse: eclipseNetworks,
52
56
  evm: evmNetworks,
@@ -67,6 +71,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
67
71
  aptosNetworksOverrides,
68
72
  tonNetworksOverrides,
69
73
  stellarNetworksOverrides,
74
+ bitcoinNetworksOverrides,
70
75
  ]);
71
76
  const createNetwork = (network, parser = (input) => input) => {
72
77
  const result = {
@@ -9,6 +9,7 @@ type UseNetworkConfigurationsFromProjectSettingsProps = {
9
9
  aptosNetworksOverrides?: NetworksOverrides;
10
10
  stellarNetworksOverrides?: NetworksOverrides;
11
11
  tonNetworksOverrides?: NetworksOverrides;
12
+ bitcoinNetworksOverrides?: NetworksOverrides;
12
13
  };
13
- export declare const useNetworkConfigurationsFromProjectSettings: ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, stellarNetworksOverrides, tonNetworksOverrides, }: UseNetworkConfigurationsFromProjectSettingsProps) => {};
14
+ export declare const useNetworkConfigurationsFromProjectSettings: ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, stellarNetworksOverrides, tonNetworksOverrides, bitcoinNetworksOverrides, }: UseNetworkConfigurationsFromProjectSettingsProps) => {};
14
15
  export {};
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import { useMemo } from 'react';
3
3
 
4
- const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, stellarNetworksOverrides, tonNetworksOverrides, }) => useMemo(() => {
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
4
+ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, aptosNetworksOverrides, stellarNetworksOverrides, tonNetworksOverrides, bitcoinNetworksOverrides, }) => useMemo(() => {
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6
6
  const networks = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks;
7
7
  if (!networks)
8
8
  return {};
@@ -16,6 +16,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
16
16
  const tron = networks.find((configurations) => configurations.chainName === 'tron');
17
17
  const aptos = networks.find((configurations) => configurations.chainName === 'aptos');
18
18
  const ton = networks.find((configurations) => configurations.chainName === 'ton');
19
+ const bitcoin = networks.find((configurations) => configurations.chainName === 'bitcoin');
19
20
  let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, Number.parseInt));
20
21
  cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
21
22
  let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, Number.parseInt));
@@ -41,8 +42,11 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
41
42
  tonNetworks = overrideNetworks(tonNetworksOverrides, tonNetworks);
42
43
  let stellarNetworks = (_k = stellar === null || stellar === void 0 ? void 0 : stellar.networks) === null || _k === void 0 ? void 0 : _k.map((net) => createNetwork(net));
43
44
  stellarNetworks = overrideNetworks(stellarNetworksOverrides, stellarNetworks);
45
+ let bitcoinNetworks = (_l = bitcoin === null || bitcoin === void 0 ? void 0 : bitcoin.networks) === null || _l === void 0 ? void 0 : _l.map((net) => createNetwork(net, Number.parseInt));
46
+ bitcoinNetworks = overrideNetworks(bitcoinNetworksOverrides, bitcoinNetworks);
44
47
  const networkConfigurations = {
45
48
  aptos: aptosNetworks,
49
+ bitcoin: bitcoinNetworks,
46
50
  cosmos: cosmosNetworks,
47
51
  eclipse: eclipseNetworks,
48
52
  evm: evmNetworks,
@@ -63,6 +67,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
63
67
  aptosNetworksOverrides,
64
68
  tonNetworksOverrides,
65
69
  stellarNetworksOverrides,
70
+ bitcoinNetworksOverrides,
66
71
  ]);
67
72
  const createNetwork = (network, parser = (input) => input) => {
68
73
  const result = {
@@ -264,7 +264,11 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
264
264
  const authMode$1 = authMode.getAuthMode();
265
265
  // in connect only we only allow one account to be connected in the same wallet
266
266
  // also this is only a feature in MM
267
- if (authMode$1 !== 'connect-only' && isMetamask) {
267
+ // NOTE: WalletConnect doesn't support requestPermissions - it uses enable() to connect
268
+ // So we skip chooseAccountsToConnect for WalletConnect connectors
269
+ if (authMode$1 !== 'connect-only' &&
270
+ isMetamask &&
271
+ !walletConnector.isWalletConnect) {
268
272
  try {
269
273
  setSelectedWalletConnectorKey({
270
274
  chain: walletConnector.connectedChain,
@@ -260,7 +260,11 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
260
260
  const authMode = getAuthMode();
261
261
  // in connect only we only allow one account to be connected in the same wallet
262
262
  // also this is only a feature in MM
263
- if (authMode !== 'connect-only' && isMetamask) {
263
+ // NOTE: WalletConnect doesn't support requestPermissions - it uses enable() to connect
264
+ // So we skip chooseAccountsToConnect for WalletConnect connectors
265
+ if (authMode !== 'connect-only' &&
266
+ isMetamask &&
267
+ !walletConnector.isWalletConnect) {
264
268
  try {
265
269
  setSelectedWalletConnectorKey({
266
270
  chain: walletConnector.connectedChain,
@@ -129,6 +129,7 @@ const getTransactionValue = (transaction, isNativeToken) => {
129
129
  const getSupportedChainName = (connectedChain) => {
130
130
  const supportedChains = {
131
131
  APTOS: sdkApiCore.ChainEnum.Aptos,
132
+ BTC: sdkApiCore.ChainEnum.Btc,
132
133
  EVM: sdkApiCore.ChainEnum.Evm,
133
134
  SOL: sdkApiCore.ChainEnum.Sol,
134
135
  SUI: sdkApiCore.ChainEnum.Sui,
@@ -125,6 +125,7 @@ const getTransactionValue = (transaction, isNativeToken) => {
125
125
  const getSupportedChainName = (connectedChain) => {
126
126
  const supportedChains = {
127
127
  APTOS: ChainEnum.Aptos,
128
+ BTC: ChainEnum.Btc,
128
129
  EVM: ChainEnum.Evm,
129
130
  SOL: ChainEnum.Sol,
130
131
  SUI: ChainEnum.Sui,
@@ -285,7 +285,12 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
285
285
  (primaryWallet && ((_a = primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'zerodev')) {
286
286
  return;
287
287
  }
288
- transaction.fetchFee().finally(update);
288
+ if (transaction.fetchFee) {
289
+ const feePromise = transaction.fetchFee();
290
+ if (feePromise && typeof feePromise.finally === 'function') {
291
+ feePromise.finally(update);
292
+ }
293
+ }
289
294
  }, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain, transaction, update]);
290
295
  React.useEffect(() => {
291
296
  var _a;
@@ -400,6 +405,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
400
405
  disableSendButton: isBalanceLoading,
401
406
  displayPoweredByDynamicFooter,
402
407
  error: errorMessage,
408
+ fetchTransactionFee,
403
409
  hideModal,
404
410
  isGasSponsored,
405
411
  isGasSponsoredLoading,
@@ -444,6 +450,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
444
450
  primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.key,
445
451
  simulationState.result,
446
452
  sendBalanceTransaction,
453
+ fetchTransactionFee,
447
454
  ]);
448
455
  return simulationState.status === SimulationStatus.LOADING ? null : (jsxRuntime.jsx(TransactionConfirmationPageLayout.TransactionConfirmationPageLayout, Object.assign({}, layoutProps)));
449
456
  };
@@ -277,7 +277,12 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
277
277
  (primaryWallet && ((_a = primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'zerodev')) {
278
278
  return;
279
279
  }
280
- transaction.fetchFee().finally(update);
280
+ if (transaction.fetchFee) {
281
+ const feePromise = transaction.fetchFee();
282
+ if (feePromise && typeof feePromise.finally === 'function') {
283
+ feePromise.finally(update);
284
+ }
285
+ }
281
286
  }, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain, transaction, update]);
282
287
  useEffect(() => {
283
288
  var _a;
@@ -392,6 +397,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
392
397
  disableSendButton: isBalanceLoading,
393
398
  displayPoweredByDynamicFooter,
394
399
  error: errorMessage,
400
+ fetchTransactionFee,
395
401
  hideModal,
396
402
  isGasSponsored,
397
403
  isGasSponsoredLoading,
@@ -436,6 +442,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
436
442
  primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.key,
437
443
  simulationState.result,
438
444
  sendBalanceTransaction,
445
+ fetchTransactionFee,
439
446
  ]);
440
447
  return simulationState.status === SimulationStatus.LOADING ? null : (jsx(TransactionConfirmationPageLayout, Object.assign({}, layoutProps)));
441
448
  };
@@ -4,7 +4,7 @@ interface IChain {
4
4
  enabled: boolean;
5
5
  name: string;
6
6
  }
7
- export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ALGO" | "APTOS" | "ATOM" | "BTC" | "COSMOS" | "ECLIPSE" | "ETH" | "EVM" | "FLOW" | "SOL" | "SPARK" | "SUI" | "TRON" | "TON")[];
7
+ export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ALGO" | "APTOS" | "ATOM" | "BTC" | "COSMOS" | "ECLIPSE" | "ETH" | "EVM" | "FLOW" | "SOL" | "SPARK" | "STELLAR" | "SUI" | "TRON" | "TON")[];
8
8
  type BaseGetSupportedWalletOpts = Omit<GetSupportedWalletsOpts, 'walletConnectProjectId' | 'chainRpcProviders'>;
9
9
  export declare const getWallets: (props: {
10
10
  getSupportedWalletOpts: BaseGetSupportedWalletOpts;