@dynamic-labs/sdk-react-core 3.9.5 → 3.9.7
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
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.9.7](https://github.com/dynamic-labs/DynamicAuth/compare/v3.9.6...v3.9.7) (2025-01-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* wc wallet client interactions on some wallets ([#7728](https://github.com/dynamic-labs/DynamicAuth/issues/7728)) ([f1190d9](https://github.com/dynamic-labs/DynamicAuth/commit/f1190d9bd119f00787b61009d28c2d0f564f1ed8))
|
|
8
|
+
|
|
9
|
+
### [3.9.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.9.5...v3.9.6) (2024-12-28)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* properly cancel transaction confirmation UI when using account abstraction and embedded wallets ([#7713](https://github.com/dynamic-labs/DynamicAuth/issues/7713)) ([ef3020b](https://github.com/dynamic-labs/DynamicAuth/commit/ef3020b5985928178c7cda7bbeb9e96dcbc3a925)), closes [#7669](https://github.com/dynamic-labs/DynamicAuth/issues/7669)
|
|
15
|
+
|
|
2
16
|
### [3.9.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.9.4...v3.9.5) (2024-12-20)
|
|
3
17
|
|
|
4
18
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/assert-package-version": "3.9.
|
|
21
|
-
"@dynamic-labs/iconic": "3.9.
|
|
22
|
-
"@dynamic-labs/logger": "3.9.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "3.9.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "3.9.
|
|
25
|
-
"@dynamic-labs/store": "3.9.
|
|
26
|
-
"@dynamic-labs/types": "3.9.
|
|
27
|
-
"@dynamic-labs/utils": "3.9.
|
|
28
|
-
"@dynamic-labs/wallet-book": "3.9.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "3.9.
|
|
20
|
+
"@dynamic-labs/assert-package-version": "3.9.7",
|
|
21
|
+
"@dynamic-labs/iconic": "3.9.7",
|
|
22
|
+
"@dynamic-labs/logger": "3.9.7",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "3.9.7",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "3.9.7",
|
|
25
|
+
"@dynamic-labs/store": "3.9.7",
|
|
26
|
+
"@dynamic-labs/types": "3.9.7",
|
|
27
|
+
"@dynamic-labs/utils": "3.9.7",
|
|
28
|
+
"@dynamic-labs/wallet-book": "3.9.7",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "3.9.7",
|
|
30
30
|
"bs58": "5.0.0",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var utils = require('@dynamic-labs/utils');
|
|
10
9
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
11
10
|
require('../../components/Alert/Alert.cjs');
|
|
12
11
|
require('../../events/dynamicEvents.cjs');
|
|
12
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
13
13
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
14
14
|
require('@dynamic-labs/sdk-api-core');
|
|
15
15
|
require('../../shared/logger.cjs');
|
|
@@ -84,41 +84,27 @@ require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
|
84
84
|
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
85
85
|
require('@hcaptcha/react-hcaptcha');
|
|
86
86
|
|
|
87
|
-
const
|
|
87
|
+
const TransactionConfirmationModal = ({ title, onReject, onTransactionResponseSuccess, transaction, copykey, walletConnector, hideModal, isNativeToken, currentToken, }) => {
|
|
88
88
|
usePreventPageScroll.usePreventPageScroll(true);
|
|
89
|
+
const [show, setShow] = React.useState(true);
|
|
89
90
|
const errorRef = React.useRef(null);
|
|
90
91
|
const transactionResponseRef = React.useRef(null);
|
|
91
|
-
const isClosingRef = React.useRef(false);
|
|
92
|
-
const isTransactionPendingRef = React.useRef(false);
|
|
93
|
-
const [show, setShow] = React.useState(true);
|
|
94
92
|
const closeModal = React.useCallback(() => {
|
|
95
|
-
if (transactionResponseRef.current) {
|
|
96
|
-
onTransactionResponseSuccess(transactionResponseRef.current);
|
|
97
|
-
}
|
|
98
|
-
isClosingRef.current = true;
|
|
99
93
|
setShow(false);
|
|
100
|
-
}, [
|
|
94
|
+
}, [setShow]);
|
|
101
95
|
const handleOnModalUnmount = React.useCallback(() => {
|
|
102
96
|
if (transactionResponseRef.current) {
|
|
103
97
|
return onTransactionResponseSuccess(transactionResponseRef.current);
|
|
104
98
|
}
|
|
105
99
|
return onReject(errorRef.current || new utils.UserRejectedTransactionError());
|
|
106
100
|
}, [onTransactionResponseSuccess, onReject]);
|
|
107
|
-
if (isClosingRef.current)
|
|
108
|
-
return null;
|
|
109
101
|
return (jsxRuntime.jsx(Portal.Portal, { handleClose: closeModal, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
110
102
|
onUnmount: handleOnModalUnmount,
|
|
111
|
-
}, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () =>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, walletConnector: walletConnector, onSuccess: (receipt) => {
|
|
115
|
-
transactionResponseRef.current = receipt;
|
|
116
|
-
isTransactionPendingRef.current = false;
|
|
103
|
+
}, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () => transaction.submit(), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, walletConnector: walletConnector, onSuccess: (transactionResponse) => {
|
|
104
|
+
errorRef.current = null;
|
|
105
|
+
transactionResponseRef.current = transactionResponse;
|
|
117
106
|
closeModal();
|
|
118
107
|
}, isNativeToken: isNativeToken, currentToken: currentToken, isModal: true }) }) }) }));
|
|
119
108
|
};
|
|
120
|
-
const TransactionConfirmationModal = (props) => (jsxRuntime.jsx(TransactionModalContent
|
|
121
|
-
// force re-render for each new transaction
|
|
122
|
-
, Object.assign({}, props), `${props.transaction.to}-${Date.now()}`));
|
|
123
109
|
|
|
124
110
|
exports.TransactionConfirmationModal = TransactionConfirmationModal;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
2
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import {
|
|
3
|
+
import { useState, useRef, useCallback } from 'react';
|
|
5
4
|
import { UserRejectedTransactionError } from '@dynamic-labs/utils';
|
|
6
5
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
7
6
|
import '../../components/Alert/Alert.js';
|
|
8
7
|
import '../../events/dynamicEvents.js';
|
|
8
|
+
import '../../../../_virtual/_tslib.js';
|
|
9
9
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
10
10
|
import '@dynamic-labs/sdk-api-core';
|
|
11
11
|
import '../../shared/logger.js';
|
|
@@ -80,41 +80,27 @@ import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
|
80
80
|
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
81
81
|
import '@hcaptcha/react-hcaptcha';
|
|
82
82
|
|
|
83
|
-
const
|
|
83
|
+
const TransactionConfirmationModal = ({ title, onReject, onTransactionResponseSuccess, transaction, copykey, walletConnector, hideModal, isNativeToken, currentToken, }) => {
|
|
84
84
|
usePreventPageScroll(true);
|
|
85
|
+
const [show, setShow] = useState(true);
|
|
85
86
|
const errorRef = useRef(null);
|
|
86
87
|
const transactionResponseRef = useRef(null);
|
|
87
|
-
const isClosingRef = useRef(false);
|
|
88
|
-
const isTransactionPendingRef = useRef(false);
|
|
89
|
-
const [show, setShow] = useState(true);
|
|
90
88
|
const closeModal = useCallback(() => {
|
|
91
|
-
if (transactionResponseRef.current) {
|
|
92
|
-
onTransactionResponseSuccess(transactionResponseRef.current);
|
|
93
|
-
}
|
|
94
|
-
isClosingRef.current = true;
|
|
95
89
|
setShow(false);
|
|
96
|
-
}, [
|
|
90
|
+
}, [setShow]);
|
|
97
91
|
const handleOnModalUnmount = useCallback(() => {
|
|
98
92
|
if (transactionResponseRef.current) {
|
|
99
93
|
return onTransactionResponseSuccess(transactionResponseRef.current);
|
|
100
94
|
}
|
|
101
95
|
return onReject(errorRef.current || new UserRejectedTransactionError());
|
|
102
96
|
}, [onTransactionResponseSuccess, onReject]);
|
|
103
|
-
if (isClosingRef.current)
|
|
104
|
-
return null;
|
|
105
97
|
return (jsx(Portal, { handleClose: closeModal, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
106
98
|
onUnmount: handleOnModalUnmount,
|
|
107
|
-
}, children: jsx(Modal, { children: jsx(ModalCard, { children: jsx(TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () =>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, walletConnector: walletConnector, onSuccess: (receipt) => {
|
|
111
|
-
transactionResponseRef.current = receipt;
|
|
112
|
-
isTransactionPendingRef.current = false;
|
|
99
|
+
}, children: jsx(Modal, { children: jsx(ModalCard, { children: jsx(TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () => transaction.submit(), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, walletConnector: walletConnector, onSuccess: (transactionResponse) => {
|
|
100
|
+
errorRef.current = null;
|
|
101
|
+
transactionResponseRef.current = transactionResponse;
|
|
113
102
|
closeModal();
|
|
114
103
|
}, isNativeToken: isNativeToken, currentToken: currentToken, isModal: true }) }) }) }));
|
|
115
104
|
};
|
|
116
|
-
const TransactionConfirmationModal = (props) => (jsx(TransactionModalContent
|
|
117
|
-
// force re-render for each new transaction
|
|
118
|
-
, Object.assign({}, props), `${props.transaction.to}-${Date.now()}`));
|
|
119
105
|
|
|
120
106
|
export { TransactionConfirmationModal };
|