@dynamic-labs/sdk-react-core 4.96.3 → 4.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/components/TransactionCard/TransactionCard.cjs +21 -13
- package/src/lib/components/TransactionCard/TransactionCard.d.ts +2 -0
- package/src/lib/components/TransactionCard/TransactionCard.js +21 -13
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -0
- package/src/lib/context/ErrorContext/hooks/useErrorText/useErrorText.cjs +1 -0
- package/src/lib/context/ErrorContext/hooks/useErrorText/useErrorText.js +2 -1
- package/src/lib/data/api/transactions/index.d.ts +1 -0
- package/src/lib/data/api/transactions/screenTransaction.cjs +107 -0
- package/src/lib/data/api/transactions/screenTransaction.d.ts +12 -0
- package/src/lib/data/api/transactions/screenTransaction.js +101 -0
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +1 -1
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +1 -1
- package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.d.ts +2 -1
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -1
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +1 -1
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.97.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.96.4...v4.97.0) (2026-08-27)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **screening:** connected-wallet transaction screening [v4 backport] (DYNT-1663) ([#12284](https://github.com/dynamic-labs/dynamic-auth/issues/12284)) ([294adba](https://github.com/dynamic-labs/dynamic-auth/commit/294adba7dba8f321f3b1e8413f73545701e51252)), closes [#12160](https://github.com/dynamic-labs/dynamic-auth/issues/12160) [#12167](https://github.com/dynamic-labs/dynamic-auth/issues/12167) [#12168](https://github.com/dynamic-labs/dynamic-auth/issues/12168) [#12169](https://github.com/dynamic-labs/dynamic-auth/issues/12169) [#12172](https://github.com/dynamic-labs/dynamic-auth/issues/12172)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **screening:** wire connected-wallet screening into the Send Balance UI (DYNT-1663) ([#12289](https://github.com/dynamic-labs/dynamic-auth/issues/12289)) ([1587cd8](https://github.com/dynamic-labs/dynamic-auth/commit/1587cd833370e18fa383f942521500e4c1576390))
|
|
13
|
+
|
|
14
|
+
### [4.96.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.96.3...v4.96.4) (2026-08-26)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* remediate high-severity tar, nanoid and js-yaml vulnerabilities (v4) ([#12269](https://github.com/dynamic-labs/dynamic-auth/issues/12269)) ([15a32fe](https://github.com/dynamic-labs/dynamic-auth/commit/15a32fe023038efaa3298d6792997a86b5f0cb0b))
|
|
20
|
+
* **transaction-card:** use walletConnector prop for network/fee instead of primaryWallet [v4 backport] ([#12065](https://github.com/dynamic-labs/dynamic-auth/issues/12065)) ([699c42b](https://github.com/dynamic-labs/dynamic-auth/commit/699c42b876eba7e1b0129eda27fa096ba7e567fc)), closes [#12063](https://github.com/dynamic-labs/dynamic-auth/issues/12063)
|
|
21
|
+
* **waas-svm:** instrument sponsorship retry attempts [v4 backport] ([#12282](https://github.com/dynamic-labs/dynamic-auth/issues/12282)) ([b2f2392](https://github.com/dynamic-labs/dynamic-auth/commit/b2f23929093ebb48214c1ddb65b3e56a58e9f8da))
|
|
22
|
+
* **wallet-connect:** reopen WalletConnect IndexedDB when the browser closes the connection (v4 backport) ([#12263](https://github.com/dynamic-labs/dynamic-auth/issues/12263)) ([4d0105d](https://github.com/dynamic-labs/dynamic-auth/commit/4d0105d2343c5bf75f89382e4be01b75413569e7))
|
|
23
|
+
|
|
2
24
|
### [4.96.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.96.2...v4.96.3) (2026-08-19)
|
|
3
25
|
|
|
4
26
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.97.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.12.0",
|
|
6
6
|
"@dynamic-labs-sdk/client": "1.27.1",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"react-i18next": "13.5.0",
|
|
19
19
|
"react-international-phone": "4.5.0",
|
|
20
20
|
"yup": "0.32.11",
|
|
21
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
22
|
-
"@dynamic-labs/iconic": "4.
|
|
23
|
-
"@dynamic-labs/locale": "4.
|
|
24
|
-
"@dynamic-labs/logger": "4.
|
|
25
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
26
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
27
|
-
"@dynamic-labs/store": "4.
|
|
28
|
-
"@dynamic-labs/types": "4.
|
|
29
|
-
"@dynamic-labs/utils": "4.
|
|
30
|
-
"@dynamic-labs/wallet-book": "4.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
21
|
+
"@dynamic-labs/assert-package-version": "4.97.0",
|
|
22
|
+
"@dynamic-labs/iconic": "4.97.0",
|
|
23
|
+
"@dynamic-labs/locale": "4.97.0",
|
|
24
|
+
"@dynamic-labs/logger": "4.97.0",
|
|
25
|
+
"@dynamic-labs/multi-wallet": "4.97.0",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "4.97.0",
|
|
27
|
+
"@dynamic-labs/store": "4.97.0",
|
|
28
|
+
"@dynamic-labs/types": "4.97.0",
|
|
29
|
+
"@dynamic-labs/utils": "4.97.0",
|
|
30
|
+
"@dynamic-labs/wallet-book": "4.97.0",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "4.97.0",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -126,21 +126,22 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
126
126
|
|
|
127
127
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
128
128
|
|
|
129
|
-
const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATransaction, recipient, }) => {
|
|
130
|
-
var _a, _b, _c, _d, _e, _f
|
|
129
|
+
const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATransaction, recipient, walletConnector, }) => {
|
|
130
|
+
var _a, _b, _c, _d, _e, _f;
|
|
131
131
|
const { t } = reactI18next.useTranslation();
|
|
132
132
|
const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext.useInternalDynamicContext();
|
|
133
133
|
const networkInfo = useNetworkConfigurationsFromProjectSettings.useNetworkConfigurationsFromProjectSettings({
|
|
134
134
|
evmNetworksOverrides: overrides === null || overrides === void 0 ? void 0 : overrides.evmNetworks,
|
|
135
135
|
projectSettings,
|
|
136
136
|
});
|
|
137
|
-
const
|
|
137
|
+
const activeConnector = walletConnector !== null && walletConnector !== void 0 ? walletConnector : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
138
|
+
const { chain } = useFetchChain.useFetchChain(activeConnector);
|
|
138
139
|
const networkInfoEntry = networksAndChains.getNetworkInfoEntry({
|
|
139
|
-
chain:
|
|
140
|
+
chain: activeConnector === null || activeConnector === void 0 ? void 0 : activeConnector.connectedChain,
|
|
140
141
|
networkId: chain === null || chain === void 0 ? void 0 : chain.chainId,
|
|
141
142
|
networkInfo,
|
|
142
143
|
});
|
|
143
|
-
const { symbol: nativeCurrencySymbol, decimals: nativeCurrencyDecimals } = (
|
|
144
|
+
const { symbol: nativeCurrencySymbol, decimals: nativeCurrencyDecimals } = (_a = networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency) !== null && _a !== void 0 ? _a : {};
|
|
144
145
|
const blockaidOn = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.showTotalFiat;
|
|
145
146
|
const feeInUsd = React.useMemo(() => {
|
|
146
147
|
var _a;
|
|
@@ -169,7 +170,14 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
169
170
|
// for solana, the fee is included in the outgoing assets already
|
|
170
171
|
return (outgoingAssetsTotal +
|
|
171
172
|
(nativeCurrencySymbol === 'SOL' || isGasSponsored ? 0 : feeInUsd || 0));
|
|
172
|
-
}, [
|
|
173
|
+
}, [
|
|
174
|
+
simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.outAssets,
|
|
175
|
+
nativeCurrencySymbol,
|
|
176
|
+
feeInUsd,
|
|
177
|
+
blockaidOn,
|
|
178
|
+
isAATransaction,
|
|
179
|
+
isGasSponsored,
|
|
180
|
+
]);
|
|
173
181
|
const getTotalAmountInUsdDisplay = (totalAmountInUsd) => {
|
|
174
182
|
if (!totalAmountInUsd)
|
|
175
183
|
return undefined;
|
|
@@ -178,9 +186,9 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
178
186
|
: `~$${totalAmountInUsd.toFixed(2)}`;
|
|
179
187
|
};
|
|
180
188
|
const renderAssetTransfer = (transfer, index, array) => {
|
|
181
|
-
var _a, _b
|
|
189
|
+
var _a, _b;
|
|
182
190
|
if (['NATIVE', 'SOL', 'ETH'].includes(transfer.asset.type) &&
|
|
183
|
-
(
|
|
191
|
+
(activeConnector === null || activeConnector === void 0 ? void 0 : activeConnector.connectedChain) === 'SOL' &&
|
|
184
192
|
transaction.fee.gas) {
|
|
185
193
|
transfer.amount = (Number(transfer.amount) -
|
|
186
194
|
Number(transaction.fee.gas) / Math.pow(10, 9)).toString();
|
|
@@ -200,10 +208,10 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
200
208
|
}
|
|
201
209
|
return `$${usdPrice.toFixed(2)}`;
|
|
202
210
|
};
|
|
203
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: `transaction-card__${transfer.direction}`, children: jsxRuntime.jsxs("div", { className: 'transaction-card__info-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: transfer.direction === 'in' ? 'Receive' : '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: transfer.direction === 'in' ? 'green-1' : 'error-1', children: [transfer.direction === 'out' ? '-' : '+', getAmountDisplay()] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: (
|
|
204
|
-
(networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: (
|
|
211
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: `transaction-card__${transfer.direction}`, children: jsxRuntime.jsxs("div", { className: 'transaction-card__info-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: transfer.direction === 'in' ? 'Receive' : '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: transfer.direction === 'in' ? 'green-1' : 'error-1', children: [transfer.direction === 'out' ? '-' : '+', getAmountDisplay()] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: (_a = (transfer.asset.symbol || transfer.asset.name)) !== null && _a !== void 0 ? _a : nativeCurrencySymbol })] }), Number(transfer.usdPrice) > 0 && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: transfer.direction === 'in' ? 'green-1' : 'error-1', children: getUsdPriceDisplay() }))] }), jsxRuntime.jsx("div", { className: 'transaction-card__icon', children: jsxRuntime.jsx("div", { className: 'transaction-card__icon__container', children: jsxRuntime.jsx("img", { src: transfer.asset.logoUrl ||
|
|
212
|
+
(networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: (_b = transfer.asset.symbol) !== null && _b !== void 0 ? _b : nativeCurrencySymbol, width: 32, height: 32, className: 'transaction-card__icon__container__main' }) }) })] })] }) }), index < array.length - 1 && (jsxRuntime.jsx("div", { className: 'transaction-card__divider' }))] }));
|
|
205
213
|
};
|
|
206
|
-
const inAssets = ((
|
|
214
|
+
const inAssets = ((_b = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.inAssets) === null || _b === void 0 ? void 0 : _b.flatMap((assetDiff) => {
|
|
207
215
|
var _a;
|
|
208
216
|
return ((_a = assetDiff.transferIn) === null || _a === void 0 ? void 0 : _a.map((inTransfer) => {
|
|
209
217
|
var _a, _b;
|
|
@@ -215,7 +223,7 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
215
223
|
});
|
|
216
224
|
})) || [];
|
|
217
225
|
})) || [];
|
|
218
|
-
const outAssets = ((
|
|
226
|
+
const outAssets = ((_c = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.outAssets) === null || _c === void 0 ? void 0 : _c.flatMap((assetDiff) => {
|
|
219
227
|
var _a;
|
|
220
228
|
return ((_a = assetDiff.transferOut) === null || _a === void 0 ? void 0 : _a.map((outTransfer) => {
|
|
221
229
|
var _a, _b;
|
|
@@ -250,7 +258,7 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
250
258
|
return `-- ${nativeCurrencySymbol}`;
|
|
251
259
|
};
|
|
252
260
|
return (jsxRuntime.jsxs("div", { className: 'transaction-card-container', children: [allAssets.length > 0 && (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsx("div", { className: 'transaction-card__assets-container', children: allAssets.map((asset, index, array) => (jsxRuntime.jsx(React__default["default"].Fragment, { children: renderAssetTransfer(asset, index, array) }, `asset-${index}`))) }) })), jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsxs("div", { className: 'transaction-card__details', children: [recipient && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.recipient', children: t('dyn_send_transaction.confirmation.data.recipient') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-recipient', children: shortenWalletAddress.shortenWalletAddress(recipient) })] }), jsxRuntime.jsx("div", { className: 'transaction-card__divider' })] })), !recipient &&
|
|
253
|
-
(transaction.to || ((
|
|
261
|
+
(transaction.to || ((_d = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.counterparties) === null || _d === void 0 ? void 0 : _d[0])) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { 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((_e = transaction.to) !== null && _e !== void 0 ? _e : (_f = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.counterparties) === null || _f === void 0 ? void 0 : _f[0]) })] }), 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.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], alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) || 'Network icon', width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), !isGasSponsored && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [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: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: getGasFeeDisplay() }) })] })] })), blockaidOn &&
|
|
254
262
|
totalAmountInUsd !== undefined &&
|
|
255
263
|
totalAmountInUsd > 0 &&
|
|
256
264
|
!(isAATransaction && !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', weight: 'bold', copykey: 'dyn_send_transaction.confirmation.data.total', children: t('dyn_send_transaction.confirmation.data.total') }), jsxRuntime.jsx("div", { className: 'transaction-card__total-amount', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-total', children: getTotalAmountInUsdDisplay(totalAmountInUsd) }) })] })] }))] }) })] }));
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IUITransaction } from '@dynamic-labs/types';
|
|
3
3
|
import { SimulateTransactionResponse as SimulationResult } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
5
|
type TransactionCardProps = {
|
|
5
6
|
transaction: IUITransaction;
|
|
6
7
|
simulationResult: SimulationResult | undefined;
|
|
7
8
|
isGasSponsored: boolean;
|
|
8
9
|
isAATransaction: boolean;
|
|
9
10
|
recipient?: string;
|
|
11
|
+
walletConnector?: WalletConnector;
|
|
10
12
|
};
|
|
11
13
|
export declare const TransactionCard: React.FC<TransactionCardProps>;
|
|
12
14
|
export {};
|
|
@@ -118,21 +118,22 @@ import '../../store/state/multichainBalances.js';
|
|
|
118
118
|
import '@dynamic-labs/store';
|
|
119
119
|
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
120
120
|
|
|
121
|
-
const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATransaction, recipient, }) => {
|
|
122
|
-
var _a, _b, _c, _d, _e, _f
|
|
121
|
+
const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATransaction, recipient, walletConnector, }) => {
|
|
122
|
+
var _a, _b, _c, _d, _e, _f;
|
|
123
123
|
const { t } = useTranslation();
|
|
124
124
|
const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext();
|
|
125
125
|
const networkInfo = useNetworkConfigurationsFromProjectSettings({
|
|
126
126
|
evmNetworksOverrides: overrides === null || overrides === void 0 ? void 0 : overrides.evmNetworks,
|
|
127
127
|
projectSettings,
|
|
128
128
|
});
|
|
129
|
-
const
|
|
129
|
+
const activeConnector = walletConnector !== null && walletConnector !== void 0 ? walletConnector : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
130
|
+
const { chain } = useFetchChain(activeConnector);
|
|
130
131
|
const networkInfoEntry = getNetworkInfoEntry({
|
|
131
|
-
chain:
|
|
132
|
+
chain: activeConnector === null || activeConnector === void 0 ? void 0 : activeConnector.connectedChain,
|
|
132
133
|
networkId: chain === null || chain === void 0 ? void 0 : chain.chainId,
|
|
133
134
|
networkInfo,
|
|
134
135
|
});
|
|
135
|
-
const { symbol: nativeCurrencySymbol, decimals: nativeCurrencyDecimals } = (
|
|
136
|
+
const { symbol: nativeCurrencySymbol, decimals: nativeCurrencyDecimals } = (_a = networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency) !== null && _a !== void 0 ? _a : {};
|
|
136
137
|
const blockaidOn = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.showTotalFiat;
|
|
137
138
|
const feeInUsd = useMemo(() => {
|
|
138
139
|
var _a;
|
|
@@ -161,7 +162,14 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
161
162
|
// for solana, the fee is included in the outgoing assets already
|
|
162
163
|
return (outgoingAssetsTotal +
|
|
163
164
|
(nativeCurrencySymbol === 'SOL' || isGasSponsored ? 0 : feeInUsd || 0));
|
|
164
|
-
}, [
|
|
165
|
+
}, [
|
|
166
|
+
simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.outAssets,
|
|
167
|
+
nativeCurrencySymbol,
|
|
168
|
+
feeInUsd,
|
|
169
|
+
blockaidOn,
|
|
170
|
+
isAATransaction,
|
|
171
|
+
isGasSponsored,
|
|
172
|
+
]);
|
|
165
173
|
const getTotalAmountInUsdDisplay = (totalAmountInUsd) => {
|
|
166
174
|
if (!totalAmountInUsd)
|
|
167
175
|
return undefined;
|
|
@@ -170,9 +178,9 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
170
178
|
: `~$${totalAmountInUsd.toFixed(2)}`;
|
|
171
179
|
};
|
|
172
180
|
const renderAssetTransfer = (transfer, index, array) => {
|
|
173
|
-
var _a, _b
|
|
181
|
+
var _a, _b;
|
|
174
182
|
if (['NATIVE', 'SOL', 'ETH'].includes(transfer.asset.type) &&
|
|
175
|
-
(
|
|
183
|
+
(activeConnector === null || activeConnector === void 0 ? void 0 : activeConnector.connectedChain) === 'SOL' &&
|
|
176
184
|
transaction.fee.gas) {
|
|
177
185
|
transfer.amount = (Number(transfer.amount) -
|
|
178
186
|
Number(transaction.fee.gas) / Math.pow(10, 9)).toString();
|
|
@@ -192,10 +200,10 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
192
200
|
}
|
|
193
201
|
return `$${usdPrice.toFixed(2)}`;
|
|
194
202
|
};
|
|
195
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: `transaction-card__${transfer.direction}`, children: jsxs("div", { className: 'transaction-card__info-container', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', children: transfer.direction === 'in' ? 'Receive' : '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: transfer.direction === 'in' ? 'green-1' : 'error-1', children: [transfer.direction === 'out' ? '-' : '+', getAmountDisplay()] }), jsx(Typography, { variant: 'body_normal', color: 'primary', children: (
|
|
196
|
-
(networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: (
|
|
203
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: `transaction-card__${transfer.direction}`, children: jsxs("div", { className: 'transaction-card__info-container', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', children: transfer.direction === 'in' ? 'Receive' : '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: transfer.direction === 'in' ? 'green-1' : 'error-1', children: [transfer.direction === 'out' ? '-' : '+', getAmountDisplay()] }), jsx(Typography, { variant: 'body_normal', color: 'primary', children: (_a = (transfer.asset.symbol || transfer.asset.name)) !== null && _a !== void 0 ? _a : nativeCurrencySymbol })] }), Number(transfer.usdPrice) > 0 && (jsx(Typography, { variant: 'body_small', color: transfer.direction === 'in' ? 'green-1' : 'error-1', children: getUsdPriceDisplay() }))] }), jsx("div", { className: 'transaction-card__icon', children: jsx("div", { className: 'transaction-card__icon__container', children: jsx("img", { src: transfer.asset.logoUrl ||
|
|
204
|
+
(networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: (_b = transfer.asset.symbol) !== null && _b !== void 0 ? _b : nativeCurrencySymbol, width: 32, height: 32, className: 'transaction-card__icon__container__main' }) }) })] })] }) }), index < array.length - 1 && (jsx("div", { className: 'transaction-card__divider' }))] }));
|
|
197
205
|
};
|
|
198
|
-
const inAssets = ((
|
|
206
|
+
const inAssets = ((_b = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.inAssets) === null || _b === void 0 ? void 0 : _b.flatMap((assetDiff) => {
|
|
199
207
|
var _a;
|
|
200
208
|
return ((_a = assetDiff.transferIn) === null || _a === void 0 ? void 0 : _a.map((inTransfer) => {
|
|
201
209
|
var _a, _b;
|
|
@@ -207,7 +215,7 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
207
215
|
});
|
|
208
216
|
})) || [];
|
|
209
217
|
})) || [];
|
|
210
|
-
const outAssets = ((
|
|
218
|
+
const outAssets = ((_c = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.outAssets) === null || _c === void 0 ? void 0 : _c.flatMap((assetDiff) => {
|
|
211
219
|
var _a;
|
|
212
220
|
return ((_a = assetDiff.transferOut) === null || _a === void 0 ? void 0 : _a.map((outTransfer) => {
|
|
213
221
|
var _a, _b;
|
|
@@ -242,7 +250,7 @@ const TransactionCard = ({ transaction, simulationResult, isGasSponsored, isAATr
|
|
|
242
250
|
return `-- ${nativeCurrencySymbol}`;
|
|
243
251
|
};
|
|
244
252
|
return (jsxs("div", { className: 'transaction-card-container', children: [allAssets.length > 0 && (jsx("div", { className: 'transaction-card', children: jsx("div", { className: 'transaction-card__assets-container', children: allAssets.map((asset, index, array) => (jsx(React__default.Fragment, { children: renderAssetTransfer(asset, index, array) }, `asset-${index}`))) }) })), jsx("div", { className: 'transaction-card', children: jsxs("div", { className: 'transaction-card__details', children: [recipient && (jsxs(Fragment, { children: [jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.recipient', children: t('dyn_send_transaction.confirmation.data.recipient') }), jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-recipient', children: shortenWalletAddress(recipient) })] }), jsx("div", { className: 'transaction-card__divider' })] })), !recipient &&
|
|
245
|
-
(transaction.to || ((
|
|
253
|
+
(transaction.to || ((_d = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.counterparties) === null || _d === void 0 ? void 0 : _d[0])) && (jsxs(Fragment, { 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((_e = transaction.to) !== null && _e !== void 0 ? _e : (_f = simulationResult === null || simulationResult === void 0 ? void 0 : simulationResult.counterparties) === null || _f === void 0 ? void 0 : _f[0]) })] }), 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.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], alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) || 'Network icon', width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), !isGasSponsored && (jsxs(Fragment, { children: [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: jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: getGasFeeDisplay() }) })] })] })), blockaidOn &&
|
|
246
254
|
totalAmountInUsd !== undefined &&
|
|
247
255
|
totalAmountInUsd > 0 &&
|
|
248
256
|
!(isAATransaction && !isGasSponsored) && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'bold', copykey: 'dyn_send_transaction.confirmation.data.total', children: t('dyn_send_transaction.confirmation.data.total') }), jsx("div", { className: 'transaction-card__total-amount', children: jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-total', children: getTotalAmountInUsdDisplay(totalAmountInUsd) }) })] })] }))] }) })] }));
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs
CHANGED
|
@@ -176,7 +176,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
176
176
|
const totalGasFiatValue = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
177
177
|
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: transactionLink && transactionSignature ? (jsxRuntime.jsx(reactI18next.Trans, { i18nKey: 'dyn_send_transaction.error_message.confirmation_timeout_with_link', components: {
|
|
178
178
|
link: (jsxRuntime.jsx(Typography.Typography, { as: 'a', href: transactionLink, target: '_blank', rel: 'noreferrer', className: 'transaction-confirmation__error-link', variant: 'body_small' })),
|
|
179
|
-
} })) : (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' })] }))] })] }));
|
|
179
|
+
} })) : (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, walletConnector: walletConnector })) : (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' })] }))] })] }));
|
|
180
180
|
};
|
|
181
181
|
|
|
182
182
|
exports.TransactionConfirmationPageLayout = TransactionConfirmationPageLayout;
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js
CHANGED
|
@@ -172,7 +172,7 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
172
172
|
const totalGasFiatValue = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
173
173
|
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: transactionLink && transactionSignature ? (jsx(Trans, { i18nKey: 'dyn_send_transaction.error_message.confirmation_timeout_with_link', components: {
|
|
174
174
|
link: (jsx(Typography, { as: 'a', href: transactionLink, target: '_blank', rel: 'noreferrer', className: 'transaction-confirmation__error-link', variant: 'body_small' })),
|
|
175
|
-
} })) : (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' })] }))] })] }));
|
|
175
|
+
} })) : (error) }) })), !sendBalanceTransaction ? (jsx(TransactionCard, { transaction: transaction, isGasSponsored: isGasSponsored, isAATransaction: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'zerodev', simulationResult: simulationResult, recipient: recipient, walletConnector: walletConnector })) : (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' })] }))] })] }));
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
export { TransactionConfirmationPageLayout };
|
|
@@ -34,6 +34,7 @@ var nonce = require('../../store/state/nonce/nonce.cjs');
|
|
|
34
34
|
require('@dynamic-labs-wallet/browser-wallet-client');
|
|
35
35
|
var ApiEndpoint = require('../../config/ApiEndpoint.cjs');
|
|
36
36
|
var settings = require('../../data/api/settings/settings.cjs');
|
|
37
|
+
var screenTransaction = require('../../data/api/transactions/screenTransaction.cjs');
|
|
37
38
|
var dynamicContextProps = require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
38
39
|
var primaryWalletId = require('../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
39
40
|
var connectedWalletsInfo = require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
@@ -301,6 +302,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
301
302
|
mobileExperience,
|
|
302
303
|
networkConfigurations: serverNetworkConfigurations,
|
|
303
304
|
projectSettings,
|
|
305
|
+
transactionScreening: screenTransaction.transactionScreeningService,
|
|
304
306
|
useMetamaskSdk,
|
|
305
307
|
walletBook: walletBook$1,
|
|
306
308
|
walletConnectPreferredChains,
|
|
@@ -30,6 +30,7 @@ import { useFetchNonce, useNonce } from '../../store/state/nonce/nonce.js';
|
|
|
30
30
|
import '@dynamic-labs-wallet/browser-wallet-client';
|
|
31
31
|
import ApiEndpoint from '../../config/ApiEndpoint.js';
|
|
32
32
|
import { sendDynamicProps } from '../../data/api/settings/settings.js';
|
|
33
|
+
import { transactionScreeningService } from '../../data/api/transactions/screenTransaction.js';
|
|
33
34
|
import { useSyncDynamicContextProps } from '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
34
35
|
import { usePrimaryWalletId } from '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
35
36
|
import { resetConnectedWalletsInfo } from '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
@@ -297,6 +298,7 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
297
298
|
mobileExperience,
|
|
298
299
|
networkConfigurations: serverNetworkConfigurations,
|
|
299
300
|
projectSettings,
|
|
301
|
+
transactionScreening: transactionScreeningService,
|
|
300
302
|
useMetamaskSdk,
|
|
301
303
|
walletBook,
|
|
302
304
|
walletConnectPreferredChains,
|
|
@@ -23,6 +23,7 @@ const mapErrorCodeToTranslation = {
|
|
|
23
23
|
[utils.ErrorCode.CREDENTIAL_NOT_ENABLED_FOR_SIGN_IN]: 'dyn_error.credential_not_enabled_for_sign_in',
|
|
24
24
|
[utils.ErrorCode.SEI_NOT_ENABLED_IN_KEPLR_WALLET]: 'dyn_error.sei_not_enabled_in_keplr_wallet',
|
|
25
25
|
[utils.RATE_LIMIT_ERROR_CODE]: 'dyn_error.rate_limit_error',
|
|
26
|
+
[utils.TRANSACTION_SCREENING_BLOCKED_ERROR_CODE]: 'dyn_error.transaction_screening_blocked',
|
|
26
27
|
};
|
|
27
28
|
/** A hook that listens to the error context and returns a translated value */
|
|
28
29
|
const useErrorText = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { ErrorCode, RATE_LIMIT_ERROR_CODE } from '@dynamic-labs/utils';
|
|
4
|
+
import { ErrorCode, RATE_LIMIT_ERROR_CODE, TRANSACTION_SCREENING_BLOCKED_ERROR_CODE } from '@dynamic-labs/utils';
|
|
5
5
|
import { useErrorContext } from '../../ErrorContext.js';
|
|
6
6
|
|
|
7
7
|
const mapErrorCodeToTranslation = {
|
|
@@ -19,6 +19,7 @@ const mapErrorCodeToTranslation = {
|
|
|
19
19
|
[ErrorCode.CREDENTIAL_NOT_ENABLED_FOR_SIGN_IN]: 'dyn_error.credential_not_enabled_for_sign_in',
|
|
20
20
|
[ErrorCode.SEI_NOT_ENABLED_IN_KEPLR_WALLET]: 'dyn_error.sei_not_enabled_in_keplr_wallet',
|
|
21
21
|
[RATE_LIMIT_ERROR_CODE]: 'dyn_error.rate_limit_error',
|
|
22
|
+
[TRANSACTION_SCREENING_BLOCKED_ERROR_CODE]: 'dyn_error.transaction_screening_blocked',
|
|
22
23
|
};
|
|
23
24
|
/** A hook that listens to the error context and returns a translated value */
|
|
24
25
|
const useErrorText = () => {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
9
|
+
var api = require('../api.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
+
require('react');
|
|
13
|
+
require('react/jsx-runtime');
|
|
14
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
15
|
+
var logger = require('../../../shared/logger.cjs');
|
|
16
|
+
require('@dynamic-labs/wallet-book');
|
|
17
|
+
require('../../../utils/constants/colors.cjs');
|
|
18
|
+
require('../../../utils/constants/values.cjs');
|
|
19
|
+
require('../../../shared/consts/index.cjs');
|
|
20
|
+
var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
21
|
+
require('@dynamic-labs-sdk/client/core');
|
|
22
|
+
require('eventemitter3');
|
|
23
|
+
require('@dynamic-labs-sdk/client');
|
|
24
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
25
|
+
require('@dynamic-labs/multi-wallet');
|
|
26
|
+
require('react-international-phone');
|
|
27
|
+
require('../../../store/state/nonce/nonce.cjs');
|
|
28
|
+
require('@dynamic-labs-wallet/browser-wallet-client');
|
|
29
|
+
require('@dynamic-labs/locale');
|
|
30
|
+
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
31
|
+
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
32
|
+
require('../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
33
|
+
require('../../../events/dynamicEvents.cjs');
|
|
34
|
+
var getProjectSettings = require('../../../client/extension/projectSettings/getProjectSettings/getProjectSettings.cjs');
|
|
35
|
+
|
|
36
|
+
// The SDK-internal chain union (shared across connector packages) is decoupled
|
|
37
|
+
// from the wire-level enum; this is the one place that needs to know both.
|
|
38
|
+
// Resolved per call rather than as a module-scope map, as is the block decision
|
|
39
|
+
// at the bottom of this file: reading an enum member at module scope resolves it
|
|
40
|
+
// the moment anything in this barrel's import graph loads, which takes down every
|
|
41
|
+
// spec that partially mocks sdk-api-core before a single test can run.
|
|
42
|
+
const chainEnumFor = (chain) => {
|
|
43
|
+
const chainEnumByScreeningChain = {
|
|
44
|
+
BTC: sdkApiCore.ChainEnum.Btc,
|
|
45
|
+
EVM: sdkApiCore.ChainEnum.Evm,
|
|
46
|
+
SOL: sdkApiCore.ChainEnum.Sol,
|
|
47
|
+
};
|
|
48
|
+
return chainEnumByScreeningChain[chain];
|
|
49
|
+
};
|
|
50
|
+
// A human is waiting on this call: it sits between "send" and the wallet
|
|
51
|
+
// prompt, so an unbounded fetch would stall the prompt indefinitely on a
|
|
52
|
+
// redcoast outage. Matches the enclave hook's 2000 ms wall-clock bound
|
|
53
|
+
// (SANCTIONS_SCREENING_TIMEOUT_MS) so both screening paths degrade alike.
|
|
54
|
+
const SCREENING_TIMEOUT_MS = 2000;
|
|
55
|
+
const isScreeningEnabled = () => {
|
|
56
|
+
var _a, _b, _c;
|
|
57
|
+
return Boolean((_c = (_b = (_a = getProjectSettings.getProjectSettings()) === null || _a === void 0 ? void 0 : _a.sdk) === null || _b === void 0 ? void 0 : _b.featureFlags) === null || _c === void 0 ? void 0 : _c.enableExternalWalletOnTransactionSanctions);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Screens a connected-wallet transaction against the environment's sanctions
|
|
61
|
+
* providers before the wallet is prompted. Best-effort by construction:
|
|
62
|
+
* resolves on allow and on any screening failure (fail-open — signing must
|
|
63
|
+
* never hard-fail on a screening outage), and throws
|
|
64
|
+
* TransactionScreeningBlockedError only on an explicit block decision. A
|
|
65
|
+
* screen that outlives SCREENING_TIMEOUT_MS is one of those failures.
|
|
66
|
+
*/
|
|
67
|
+
const screenTransaction = (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
+
let abortTimer;
|
|
69
|
+
let response;
|
|
70
|
+
try {
|
|
71
|
+
// Reading settings can itself throw (e.g. the client store isn't
|
|
72
|
+
// initialized yet), which must fail open like everything else here.
|
|
73
|
+
if (!isScreeningEnabled())
|
|
74
|
+
return;
|
|
75
|
+
// The signal cancels the in-flight request so a hung endpoint can't tie up
|
|
76
|
+
// the browser's connections to the API; the race is what actually bounds the
|
|
77
|
+
// wait, since a host-supplied FetchService implementation need not honour it.
|
|
78
|
+
const abortController = new AbortController();
|
|
79
|
+
abortTimer = setTimeout(() => abortController.abort(), SCREENING_TIMEOUT_MS);
|
|
80
|
+
response = yield utils.promiseWithTimeout(api.sdkApi().screenTransaction({
|
|
81
|
+
environmentId: dynamicContextProps.getEnvironmentId(),
|
|
82
|
+
screenTransactionRequest: Object.assign(Object.assign({}, args), { chain: chainEnumFor(args.chain) }),
|
|
83
|
+
}, { signal: abortController.signal }), SCREENING_TIMEOUT_MS, { timeoutMessage: 'screenTransaction timed out' });
|
|
84
|
+
}
|
|
85
|
+
catch (_a) {
|
|
86
|
+
// Not the raw error: it can carry internal details (endpoint paths,
|
|
87
|
+
// server-side messages) that shouldn't cross the logger's broadcast
|
|
88
|
+
// boundary to whatever a host app has subscribed to its log events.
|
|
89
|
+
logger.logger.warn('screenTransaction error', {
|
|
90
|
+
message: 'Transaction screening failed',
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
clearTimeout(abortTimer);
|
|
96
|
+
}
|
|
97
|
+
if ((response === null || response === void 0 ? void 0 : response.decision) === sdkApiCore.ScreenTransactionResponseDecisionEnum.Block) {
|
|
98
|
+
throw new utils.TransactionScreeningBlockedError(response.blockedAddresses);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const transactionScreeningService = {
|
|
102
|
+
screenTransaction,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.SCREENING_TIMEOUT_MS = SCREENING_TIMEOUT_MS;
|
|
106
|
+
exports.screenTransaction = screenTransaction;
|
|
107
|
+
exports.transactionScreeningService = transactionScreeningService;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScreenTransactionArgs, TransactionScreeningService } from '@dynamic-labs/types';
|
|
2
|
+
export declare const SCREENING_TIMEOUT_MS = 2000;
|
|
3
|
+
/**
|
|
4
|
+
* Screens a connected-wallet transaction against the environment's sanctions
|
|
5
|
+
* providers before the wallet is prompted. Best-effort by construction:
|
|
6
|
+
* resolves on allow and on any screening failure (fail-open — signing must
|
|
7
|
+
* never hard-fail on a screening outage), and throws
|
|
8
|
+
* TransactionScreeningBlockedError only on an explicit block decision. A
|
|
9
|
+
* screen that outlives SCREENING_TIMEOUT_MS is one of those failures.
|
|
10
|
+
*/
|
|
11
|
+
export declare const screenTransaction: (args: ScreenTransactionArgs) => Promise<void>;
|
|
12
|
+
export declare const transactionScreeningService: TransactionScreeningService;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { ScreenTransactionResponseDecisionEnum, ChainEnum } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { promiseWithTimeout, TransactionScreeningBlockedError } from '@dynamic-labs/utils';
|
|
5
|
+
import { sdkApi } from '../api.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import 'react';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import { logger } from '../../../shared/logger.js';
|
|
12
|
+
import '@dynamic-labs/wallet-book';
|
|
13
|
+
import '../../../utils/constants/colors.js';
|
|
14
|
+
import '../../../utils/constants/values.js';
|
|
15
|
+
import '../../../shared/consts/index.js';
|
|
16
|
+
import { getEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
17
|
+
import '@dynamic-labs-sdk/client/core';
|
|
18
|
+
import 'eventemitter3';
|
|
19
|
+
import '@dynamic-labs-sdk/client';
|
|
20
|
+
import '../../../config/ApiEndpoint.js';
|
|
21
|
+
import '@dynamic-labs/multi-wallet';
|
|
22
|
+
import 'react-international-phone';
|
|
23
|
+
import '../../../store/state/nonce/nonce.js';
|
|
24
|
+
import '@dynamic-labs-wallet/browser-wallet-client';
|
|
25
|
+
import '@dynamic-labs/locale';
|
|
26
|
+
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
27
|
+
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
28
|
+
import '../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
29
|
+
import '../../../events/dynamicEvents.js';
|
|
30
|
+
import { getProjectSettings } from '../../../client/extension/projectSettings/getProjectSettings/getProjectSettings.js';
|
|
31
|
+
|
|
32
|
+
// The SDK-internal chain union (shared across connector packages) is decoupled
|
|
33
|
+
// from the wire-level enum; this is the one place that needs to know both.
|
|
34
|
+
// Resolved per call rather than as a module-scope map, as is the block decision
|
|
35
|
+
// at the bottom of this file: reading an enum member at module scope resolves it
|
|
36
|
+
// the moment anything in this barrel's import graph loads, which takes down every
|
|
37
|
+
// spec that partially mocks sdk-api-core before a single test can run.
|
|
38
|
+
const chainEnumFor = (chain) => {
|
|
39
|
+
const chainEnumByScreeningChain = {
|
|
40
|
+
BTC: ChainEnum.Btc,
|
|
41
|
+
EVM: ChainEnum.Evm,
|
|
42
|
+
SOL: ChainEnum.Sol,
|
|
43
|
+
};
|
|
44
|
+
return chainEnumByScreeningChain[chain];
|
|
45
|
+
};
|
|
46
|
+
// A human is waiting on this call: it sits between "send" and the wallet
|
|
47
|
+
// prompt, so an unbounded fetch would stall the prompt indefinitely on a
|
|
48
|
+
// redcoast outage. Matches the enclave hook's 2000 ms wall-clock bound
|
|
49
|
+
// (SANCTIONS_SCREENING_TIMEOUT_MS) so both screening paths degrade alike.
|
|
50
|
+
const SCREENING_TIMEOUT_MS = 2000;
|
|
51
|
+
const isScreeningEnabled = () => {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
return Boolean((_c = (_b = (_a = getProjectSettings()) === null || _a === void 0 ? void 0 : _a.sdk) === null || _b === void 0 ? void 0 : _b.featureFlags) === null || _c === void 0 ? void 0 : _c.enableExternalWalletOnTransactionSanctions);
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Screens a connected-wallet transaction against the environment's sanctions
|
|
57
|
+
* providers before the wallet is prompted. Best-effort by construction:
|
|
58
|
+
* resolves on allow and on any screening failure (fail-open — signing must
|
|
59
|
+
* never hard-fail on a screening outage), and throws
|
|
60
|
+
* TransactionScreeningBlockedError only on an explicit block decision. A
|
|
61
|
+
* screen that outlives SCREENING_TIMEOUT_MS is one of those failures.
|
|
62
|
+
*/
|
|
63
|
+
const screenTransaction = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
let abortTimer;
|
|
65
|
+
let response;
|
|
66
|
+
try {
|
|
67
|
+
// Reading settings can itself throw (e.g. the client store isn't
|
|
68
|
+
// initialized yet), which must fail open like everything else here.
|
|
69
|
+
if (!isScreeningEnabled())
|
|
70
|
+
return;
|
|
71
|
+
// The signal cancels the in-flight request so a hung endpoint can't tie up
|
|
72
|
+
// the browser's connections to the API; the race is what actually bounds the
|
|
73
|
+
// wait, since a host-supplied FetchService implementation need not honour it.
|
|
74
|
+
const abortController = new AbortController();
|
|
75
|
+
abortTimer = setTimeout(() => abortController.abort(), SCREENING_TIMEOUT_MS);
|
|
76
|
+
response = yield promiseWithTimeout(sdkApi().screenTransaction({
|
|
77
|
+
environmentId: getEnvironmentId(),
|
|
78
|
+
screenTransactionRequest: Object.assign(Object.assign({}, args), { chain: chainEnumFor(args.chain) }),
|
|
79
|
+
}, { signal: abortController.signal }), SCREENING_TIMEOUT_MS, { timeoutMessage: 'screenTransaction timed out' });
|
|
80
|
+
}
|
|
81
|
+
catch (_a) {
|
|
82
|
+
// Not the raw error: it can carry internal details (endpoint paths,
|
|
83
|
+
// server-side messages) that shouldn't cross the logger's broadcast
|
|
84
|
+
// boundary to whatever a host app has subscribed to its log events.
|
|
85
|
+
logger.warn('screenTransaction error', {
|
|
86
|
+
message: 'Transaction screening failed',
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
clearTimeout(abortTimer);
|
|
92
|
+
}
|
|
93
|
+
if ((response === null || response === void 0 ? void 0 : response.decision) === ScreenTransactionResponseDecisionEnum.Block) {
|
|
94
|
+
throw new TransactionScreeningBlockedError(response.blockedAddresses);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const transactionScreeningService = {
|
|
98
|
+
screenTransaction,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { SCREENING_TIMEOUT_MS, screenTransaction, transactionScreeningService };
|
|
@@ -25,8 +25,8 @@ require('react-international-phone');
|
|
|
25
25
|
require('../../../store/state/nonce/nonce.cjs');
|
|
26
26
|
require('@dynamic-labs-wallet/browser-wallet-client');
|
|
27
27
|
require('@dynamic-labs/locale');
|
|
28
|
-
var wallets = require('../../../data/api/wallets/wallets.cjs');
|
|
29
28
|
var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
29
|
+
var wallets = require('../../../data/api/wallets/wallets.cjs');
|
|
30
30
|
var primaryWalletId = require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
31
31
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
32
32
|
require('../getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
@@ -21,8 +21,8 @@ import 'react-international-phone';
|
|
|
21
21
|
import '../../../store/state/nonce/nonce.js';
|
|
22
22
|
import '@dynamic-labs-wallet/browser-wallet-client';
|
|
23
23
|
import '@dynamic-labs/locale';
|
|
24
|
-
import { storeSelectedWallet } from '../../../data/api/wallets/wallets.js';
|
|
25
24
|
import { getEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
25
|
+
import { storeSelectedWallet } from '../../../data/api/wallets/wallets.js';
|
|
26
26
|
import { setPrimaryWalletId } from '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
27
27
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
28
28
|
import '../getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import { type MobileExperience, type CoinbaseWalletPreference, type NetworkConfigurationMap, type WalletUiUtils } from '@dynamic-labs/types';
|
|
2
|
+
import { type MobileExperience, type CoinbaseWalletPreference, type NetworkConfigurationMap, type TransactionScreeningService, type WalletUiUtils } from '@dynamic-labs/types';
|
|
3
3
|
import { DeepLinkVariant, InternalWalletConnector, WalletConnectorExtension, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
5
5
|
export type WalletConnectorProps = {
|
|
@@ -11,6 +11,7 @@ export type WalletConnectorProps = {
|
|
|
11
11
|
mobileExperience?: MobileExperience;
|
|
12
12
|
networkConfigurations: NetworkConfigurationMap | undefined;
|
|
13
13
|
projectSettings: ProjectSettings | undefined;
|
|
14
|
+
transactionScreening?: TransactionScreeningService;
|
|
14
15
|
walletBook: WalletBookSchema;
|
|
15
16
|
walletConnectPreferredChains?: `eip155:${number}`[];
|
|
16
17
|
walletConnectorsProp?: WalletConnectorsMethod[];
|
|
@@ -26,8 +26,8 @@ require('react-international-phone');
|
|
|
26
26
|
require('../../../store/state/nonce/nonce.cjs');
|
|
27
27
|
require('@dynamic-labs-wallet/browser-wallet-client');
|
|
28
28
|
require('@dynamic-labs/locale');
|
|
29
|
-
var user = require('../../../data/api/user/user.cjs');
|
|
30
29
|
var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
30
|
+
var user = require('../../../data/api/user/user.cjs');
|
|
31
31
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
32
32
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
33
33
|
require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
@@ -22,8 +22,8 @@ import 'react-international-phone';
|
|
|
22
22
|
import '../../../store/state/nonce/nonce.js';
|
|
23
23
|
import '@dynamic-labs-wallet/browser-wallet-client';
|
|
24
24
|
import '@dynamic-labs/locale';
|
|
25
|
-
import { refreshUserJwt } from '../../../data/api/user/user.js';
|
|
26
25
|
import { getEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
26
|
+
import { refreshUserJwt } from '../../../data/api/user/user.js';
|
|
27
27
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
28
28
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
29
29
|
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs
CHANGED
|
@@ -35,8 +35,8 @@ require('eventemitter3');
|
|
|
35
35
|
require('@dynamic-labs-sdk/client');
|
|
36
36
|
require('../../config/ApiEndpoint.cjs');
|
|
37
37
|
require('@dynamic-labs/locale');
|
|
38
|
-
var user = require('../../data/api/user/user.cjs');
|
|
39
38
|
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
39
|
+
var user = require('../../data/api/user/user.cjs');
|
|
40
40
|
require('../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
41
41
|
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
42
42
|
require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js
CHANGED
|
@@ -31,8 +31,8 @@ import 'eventemitter3';
|
|
|
31
31
|
import '@dynamic-labs-sdk/client';
|
|
32
32
|
import '../../config/ApiEndpoint.js';
|
|
33
33
|
import '@dynamic-labs/locale';
|
|
34
|
-
import { mergeUserAccounts } from '../../data/api/user/user.js';
|
|
35
34
|
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
35
|
+
import { mergeUserAccounts } from '../../data/api/user/user.js';
|
|
36
36
|
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
37
37
|
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
38
38
|
import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|