@dynamic-labs/sdk-react-core 1.0.0-alpha.3 → 1.0.0-alpha.4
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 +7 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +2 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +4 -3
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +4 -3
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-11-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* update zerodev provider initialization ([#4015](https://github.com/dynamic-labs/DynamicAuth/issues/4015)) ([8faca00](https://github.com/dynamic-labs/DynamicAuth/commit/8faca00d414677adc5fecde451ca01da53fe9641))
|
|
8
|
+
|
|
2
9
|
## [1.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2023-11-28)
|
|
3
10
|
|
|
4
11
|
|
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": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/ethereum": "1.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "1.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "1.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "1.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/types": "1.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/utils": "1.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/wallet-book": "1.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "1.0.0-alpha.
|
|
20
|
+
"@dynamic-labs/ethereum": "1.0.0-alpha.4",
|
|
21
|
+
"@dynamic-labs/logger": "1.0.0-alpha.4",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "1.0.0-alpha.4",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "1.0.0-alpha.4",
|
|
24
|
+
"@dynamic-labs/types": "1.0.0-alpha.4",
|
|
25
|
+
"@dynamic-labs/utils": "1.0.0-alpha.4",
|
|
26
|
+
"@dynamic-labs/wallet-book": "1.0.0-alpha.4",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "1.0.0-alpha.4",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -96,12 +96,12 @@ const useEmbeddedWallet = () => {
|
|
|
96
96
|
(_b = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _b === void 0 ? void 0 : _b.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
97
97
|
const smartWallet$1 = smartWallet.findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
98
98
|
if (smartWallet$1) {
|
|
99
|
-
|
|
100
|
-
smartWallet.initializeSmartWallet({
|
|
99
|
+
yield smartWallet.initializeSmartWallet({
|
|
101
100
|
account: smartWallet$1,
|
|
102
101
|
verifiedCredentials: decodedJwt.verifiedCredentials,
|
|
103
102
|
walletOptions: wallets,
|
|
104
103
|
});
|
|
104
|
+
setPrimaryWalletId(smartWallet$1.id);
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
@@ -92,12 +92,12 @@ const useEmbeddedWallet = () => {
|
|
|
92
92
|
(_b = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _b === void 0 ? void 0 : _b.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
93
93
|
const smartWallet = findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
94
94
|
if (smartWallet) {
|
|
95
|
-
|
|
96
|
-
initializeSmartWallet({
|
|
95
|
+
yield initializeSmartWallet({
|
|
97
96
|
account: smartWallet,
|
|
98
97
|
verifiedCredentials: decodedJwt.verifiedCredentials,
|
|
99
98
|
walletOptions: wallets,
|
|
100
99
|
});
|
|
100
|
+
setPrimaryWalletId(smartWallet.id);
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
103
103
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _tslib = require('../../../../../../../_virtual/_tslib.cjs');
|
|
5
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
6
7
|
var findWallet = require('../findWallet/findWallet.cjs');
|
|
7
8
|
|
|
@@ -10,7 +11,7 @@ var findWallet = require('../findWallet/findWallet.cjs');
|
|
|
10
11
|
const findOwner = (account, verifiedCredentials) => verifiedCredentials.find((credential) => credential.id === account.signerRefId);
|
|
11
12
|
const findSmartWallet = (account, verifiedCredentials) => verifiedCredentials.find((credential) => credential.signerRefId === account.id);
|
|
12
13
|
const isOwnerOfASmartWallet = (account, verifiedCredentials) => Boolean(findSmartWallet(account, verifiedCredentials));
|
|
13
|
-
const initializeSmartWallet = ({ account, verifiedCredentials, walletOptions, }) => {
|
|
14
|
+
const initializeSmartWallet = ({ account, verifiedCredentials, walletOptions, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
15
|
const owner = findOwner(account, verifiedCredentials);
|
|
15
16
|
if (!owner) {
|
|
16
17
|
throw new Error('could not find associated eoa account for smart wallet');
|
|
@@ -27,8 +28,8 @@ const initializeSmartWallet = ({ account, verifiedCredentials, walletOptions, })
|
|
|
27
28
|
if (!walletConnectorCore.isSmartWalletConnector(connector)) {
|
|
28
29
|
throw new Error('could not initialize smart wallet');
|
|
29
30
|
}
|
|
30
|
-
connector.setEoaConnector(ownerWallet.walletConnector);
|
|
31
|
-
};
|
|
31
|
+
yield connector.setEoaConnector(ownerWallet.walletConnector);
|
|
32
|
+
});
|
|
32
33
|
|
|
33
34
|
exports.findOwner = findOwner;
|
|
34
35
|
exports.findSmartWallet = findSmartWallet;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../../_virtual/_tslib.js';
|
|
1
2
|
import { isSmartWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
3
|
import { findWallet } from '../findWallet/findWallet.js';
|
|
3
4
|
|
|
@@ -6,7 +7,7 @@ import { findWallet } from '../findWallet/findWallet.js';
|
|
|
6
7
|
const findOwner = (account, verifiedCredentials) => verifiedCredentials.find((credential) => credential.id === account.signerRefId);
|
|
7
8
|
const findSmartWallet = (account, verifiedCredentials) => verifiedCredentials.find((credential) => credential.signerRefId === account.id);
|
|
8
9
|
const isOwnerOfASmartWallet = (account, verifiedCredentials) => Boolean(findSmartWallet(account, verifiedCredentials));
|
|
9
|
-
const initializeSmartWallet = ({ account, verifiedCredentials, walletOptions, }) => {
|
|
10
|
+
const initializeSmartWallet = ({ account, verifiedCredentials, walletOptions, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
10
11
|
const owner = findOwner(account, verifiedCredentials);
|
|
11
12
|
if (!owner) {
|
|
12
13
|
throw new Error('could not find associated eoa account for smart wallet');
|
|
@@ -23,7 +24,7 @@ const initializeSmartWallet = ({ account, verifiedCredentials, walletOptions, })
|
|
|
23
24
|
if (!isSmartWalletConnector(connector)) {
|
|
24
25
|
throw new Error('could not initialize smart wallet');
|
|
25
26
|
}
|
|
26
|
-
connector.setEoaConnector(ownerWallet.walletConnector);
|
|
27
|
-
};
|
|
27
|
+
yield connector.setEoaConnector(ownerWallet.walletConnector);
|
|
28
|
+
});
|
|
28
29
|
|
|
29
30
|
export { findOwner, findSmartWallet, initializeSmartWallet, isOwnerOfASmartWallet };
|
|
@@ -103,12 +103,12 @@ const PasskeyIntroView = ({ createEmbeddedWalletMutation = createEmbeddedWalletW
|
|
|
103
103
|
internalEvents.current.emit('embeddedWalletCreated', passkeyWallet);
|
|
104
104
|
const smartWallet$1 = smartWallet.findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
105
105
|
if (smartWallet$1) {
|
|
106
|
-
|
|
107
|
-
smartWallet.initializeSmartWallet({
|
|
106
|
+
yield smartWallet.initializeSmartWallet({
|
|
108
107
|
account: smartWallet$1,
|
|
109
108
|
verifiedCredentials: decodedJwt.verifiedCredentials,
|
|
110
109
|
walletOptions: wallets,
|
|
111
110
|
});
|
|
111
|
+
setPrimaryWalletId(smartWallet$1.id);
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
114
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
@@ -99,12 +99,12 @@ const PasskeyIntroView = ({ createEmbeddedWalletMutation = createEmbeddedWalletW
|
|
|
99
99
|
internalEvents.current.emit('embeddedWalletCreated', passkeyWallet);
|
|
100
100
|
const smartWallet = findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
101
101
|
if (smartWallet) {
|
|
102
|
-
|
|
103
|
-
initializeSmartWallet({
|
|
102
|
+
yield initializeSmartWallet({
|
|
104
103
|
account: smartWallet,
|
|
105
104
|
verifiedCredentials: decodedJwt.verifiedCredentials,
|
|
106
105
|
walletOptions: wallets,
|
|
107
106
|
});
|
|
107
|
+
setPrimaryWalletId(smartWallet.id);
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
110
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|