@dynamic-labs/wagmi-connector 2.1.0-alpha.0 → 2.1.0-alpha.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.
- package/CHANGELOG.md +21 -0
- package/_virtual/_tslib.js +1 -0
- package/package.json +6 -6
- package/src/index.js +1 -0
- package/src/lib/Connector.js +9 -8
- package/src/lib/DynamicWagmiConnector.js +1 -0
- package/src/lib/SyncDynamicWagmi.js +1 -0
- package/src/lib/hooks/useConnectorId/useConnectorId.js +1 -0
- package/src/lib/hooks/useFindEvmWallet/useFindEvmWallet.js +1 -0
- package/src/lib/useChainMismatchLogger.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.0...v2.1.0-alpha.1) (2024-04-18)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add frame metadata to demo index page ([#5327](https://github.com/dynamic-labs/DynamicAuth/issues/5327)) ([34a071a](https://github.com/dynamic-labs/DynamicAuth/commit/34a071af8faa8a867ad747ec2a607056a883568d))
|
|
8
|
+
* add MfaChooseDeviceView and MfaSecureDeviceView ([#5343](https://github.com/dynamic-labs/DynamicAuth/issues/5343)) ([4c39b1c](https://github.com/dynamic-labs/DynamicAuth/commit/4c39b1c34b5091190b095770e95a733c8f458ca2)), closes [#5356](https://github.com/dynamic-labs/DynamicAuth/issues/5356)
|
|
9
|
+
* add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([ed13fc2](https://github.com/dynamic-labs/DynamicAuth/commit/ed13fc2948e06df0017ac122db54aca44f264a6d))
|
|
10
|
+
* add useMfa hook ([#5337](https://github.com/dynamic-labs/DynamicAuth/issues/5337)) ([a7682ba](https://github.com/dynamic-labs/DynamicAuth/commit/a7682ba10fd0f0809af802e0172154726f1bd857))
|
|
11
|
+
* headless create session and is session active ([#5346](https://github.com/dynamic-labs/DynamicAuth/issues/5346)) ([a787bbc](https://github.com/dynamic-labs/DynamicAuth/commit/a787bbcbb44104d2d0bd263579bd87a78453681d))
|
|
12
|
+
* secure enclave wallet generate one-time code headless ([#5329](https://github.com/dynamic-labs/DynamicAuth/issues/5329)) ([cab80a2](https://github.com/dynamic-labs/DynamicAuth/commit/cab80a2bfa77e48263d47cdcb813c54ef5b831d5))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* always stringify the message before signing a message using walletUiUtils ([#5325](https://github.com/dynamic-labs/DynamicAuth/issues/5325)) ([7abf094](https://github.com/dynamic-labs/DynamicAuth/commit/7abf09456e30ad0657892e9ba58d7391f0f430e6))
|
|
18
|
+
* bitcoin network connector sendBitcoin methods updates ([#5369](https://github.com/dynamic-labs/DynamicAuth/issues/5369)) ([e9bf444](https://github.com/dynamic-labs/DynamicAuth/commit/e9bf444122ee86030d85b84ede96bdfb9772425e))
|
|
19
|
+
* buffer missing when using buffer util function ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([e998e46](https://github.com/dynamic-labs/DynamicAuth/commit/e998e464bd2671a82aa271b407a7d8fc49a16bd0))
|
|
20
|
+
* embedded solana send transaction shouldn't sign a signed transaction ([#5357](https://github.com/dynamic-labs/DynamicAuth/issues/5357)) ([c2ae2fa](https://github.com/dynamic-labs/DynamicAuth/commit/c2ae2faa509b62fc5ceb345fbc0f0b47217bf4b0))
|
|
21
|
+
* use network.name if vanity name is missing ([#5338](https://github.com/dynamic-labs/DynamicAuth/issues/5338)) ([34ec2ae](https://github.com/dynamic-labs/DynamicAuth/commit/34ec2ae5c4dad5376a3b9c5a07221f68a2f7756c))
|
|
22
|
+
|
|
2
23
|
## [2.1.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.32...v2.1.0-alpha.0) (2024-04-15)
|
|
3
24
|
|
|
4
25
|
## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
|
package/_virtual/_tslib.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wagmi-connector",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"react": "^18.0.0",
|
|
12
12
|
"viem": "^2.7.6",
|
|
13
13
|
"wagmi": "^2.5.7",
|
|
14
|
-
"@dynamic-labs/logger": "2.1.0-alpha.
|
|
15
|
-
"@dynamic-labs/rpc-providers": "2.1.0-alpha.
|
|
16
|
-
"@dynamic-labs/sdk-react-core": "2.1.0-alpha.
|
|
17
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
18
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
14
|
+
"@dynamic-labs/logger": "2.1.0-alpha.1",
|
|
15
|
+
"@dynamic-labs/rpc-providers": "2.1.0-alpha.1",
|
|
16
|
+
"@dynamic-labs/sdk-react-core": "2.1.0-alpha.1",
|
|
17
|
+
"@dynamic-labs/types": "2.1.0-alpha.1",
|
|
18
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.1",
|
|
19
19
|
"eventemitter3": "5.0.1"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
package/src/index.js
CHANGED
package/src/lib/Connector.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client'
|
|
1
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
2
3
|
import { createConnector } from '@wagmi/core';
|
|
3
4
|
import { getAddress, createWalletClient, custom } from 'viem';
|
|
@@ -40,8 +41,8 @@ const getCreateConnectorFn = (parameters) => createConnector((config) => ({
|
|
|
40
41
|
});
|
|
41
42
|
},
|
|
42
43
|
getAccounts() {
|
|
43
|
-
var _a;
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
var _a;
|
|
45
46
|
const address = yield ((_a = parameters.walletConnector) === null || _a === void 0 ? void 0 : _a.getAddress());
|
|
46
47
|
if (!address) {
|
|
47
48
|
throw new Error('Not connected');
|
|
@@ -62,8 +63,8 @@ const getCreateConnectorFn = (parameters) => createConnector((config) => ({
|
|
|
62
63
|
});
|
|
63
64
|
},
|
|
64
65
|
getClient(args) {
|
|
65
|
-
var _a, _b;
|
|
66
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
var _a, _b;
|
|
67
68
|
const signer = yield parameters.walletConnector.getSigner();
|
|
68
69
|
if (signer.account && signer.chain) {
|
|
69
70
|
return signer;
|
|
@@ -77,15 +78,15 @@ const getCreateConnectorFn = (parameters) => createConnector((config) => ({
|
|
|
77
78
|
});
|
|
78
79
|
},
|
|
79
80
|
getProvider() {
|
|
80
|
-
var _a;
|
|
81
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a;
|
|
82
83
|
return (_a = parameters.walletConnector) === null || _a === void 0 ? void 0 : _a.getWalletClient();
|
|
83
84
|
});
|
|
84
85
|
},
|
|
85
86
|
id: parameters.connectorId,
|
|
86
87
|
isAuthorized() {
|
|
87
|
-
var _a, _b;
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
var _a, _b;
|
|
89
90
|
const accounts = (_b = (yield ((_a = parameters.walletConnector) === null || _a === void 0 ? void 0 : _a.getConnectedAccounts()))) !== null && _b !== void 0 ? _b : [];
|
|
90
91
|
return accounts.length > 0;
|
|
91
92
|
});
|
|
@@ -102,14 +103,14 @@ const getCreateConnectorFn = (parameters) => createConnector((config) => ({
|
|
|
102
103
|
});
|
|
103
104
|
},
|
|
104
105
|
onDisconnect() { },
|
|
105
|
-
switchChain(
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
switchChain(_a) {
|
|
107
|
+
return __awaiter(this, arguments, void 0, function* ({ chainId }) {
|
|
108
|
+
var _b;
|
|
108
109
|
const chain = config.chains.find((x) => x.id === chainId);
|
|
109
110
|
if (!chain) {
|
|
110
111
|
throw new Error(`Chain ${chainId} is not supported`);
|
|
111
112
|
}
|
|
112
|
-
yield ((
|
|
113
|
+
yield ((_b = parameters.walletConnector) === null || _b === void 0 ? void 0 : _b.switchNetwork({
|
|
113
114
|
networkChainId: chainId,
|
|
114
115
|
}));
|
|
115
116
|
return chain;
|