@dynamic-labs/ethereum-core 3.0.0-alpha.65 → 3.0.0-alpha.67
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,34 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.67](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.66...v3.0.0-alpha.67) (2024-09-12)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add blockaid url scanning to sdk api ([#6869](https://github.com/dynamic-labs/DynamicAuth/issues/6869)) ([0a20eef](https://github.com/dynamic-labs/DynamicAuth/commit/0a20eef2eec8793a714f67948ddba2bc1bab06cd))
|
|
8
|
+
* allow selecting which MetaMask account to connect with on sign-in ([#6838](https://github.com/dynamic-labs/DynamicAuth/issues/6838)) ([8a30614](https://github.com/dynamic-labs/DynamicAuth/commit/8a306140563390602a417fd191bc789d6e07c220))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* cach get server snashot to avoid next js rerender loop ([#6867](https://github.com/dynamic-labs/DynamicAuth/issues/6867)) ([6f77c01](https://github.com/dynamic-labs/DynamicAuth/commit/6f77c01663641ab870a8b96fb2d3b5611bc38c2c))
|
|
14
|
+
* clean up console errors on log out ([#6834](https://github.com/dynamic-labs/DynamicAuth/issues/6834)) ([a18a4ce](https://github.com/dynamic-labs/DynamicAuth/commit/a18a4ce57766dec0cc351794ff7a71b3c632d9a3))
|
|
15
|
+
* ensure open url method will be available in the webview controller ([#6852](https://github.com/dynamic-labs/DynamicAuth/issues/6852)) ([bdaf12f](https://github.com/dynamic-labs/DynamicAuth/commit/bdaf12f7a77b801c3dec67163e1fef2fdffc7d2a))
|
|
16
|
+
* solana transaction decoder fallback ([#6868](https://github.com/dynamic-labs/DynamicAuth/issues/6868)) ([38c9242](https://github.com/dynamic-labs/DynamicAuth/commit/38c924253c29e8e3569d9da9bc452a8cdc3af0d2))
|
|
17
|
+
|
|
18
|
+
## [3.0.0-alpha.66](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.65...v3.0.0-alpha.66) (2024-09-11)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add new method to BitcoinWallet to sign message with a specific address type ([#6861](https://github.com/dynamic-labs/DynamicAuth/issues/6861)) ([9284648](https://github.com/dynamic-labs/DynamicAuth/commit/92846488b4d60a498374dd60c4a0be3ab87e4e68))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* fix ethers-v6 exports ([#6863](https://github.com/dynamic-labs/DynamicAuth/issues/6863)) ([27a1aab](https://github.com/dynamic-labs/DynamicAuth/commit/27a1aabe6c5e6ed2501200f435b2cb5110836986))
|
|
29
|
+
* stop infinite rerendering when wagmi config error is thrown ([#6862](https://github.com/dynamic-labs/DynamicAuth/issues/6862)) ([9b2fac0](https://github.com/dynamic-labs/DynamicAuth/commit/9b2fac0a570246f4663057c1ff6c82a1adca64c6))
|
|
30
|
+
* update react-native packages to include correct dependencies ([#6859](https://github.com/dynamic-labs/DynamicAuth/issues/6859)) ([a6f6c1c](https://github.com/dynamic-labs/DynamicAuth/commit/a6f6c1c750d2d6916a94183059369e208ec9afa5))
|
|
31
|
+
|
|
2
32
|
## [3.0.0-alpha.65](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.64...v3.0.0-alpha.65) (2024-09-11)
|
|
3
33
|
|
|
4
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.67",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api-core": "0.0.529"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"viem": "^2.7.6",
|
|
33
|
-
"@dynamic-labs/logger": "3.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/rpc-providers": "3.0.0-alpha.
|
|
35
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/utils": "3.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-book": "3.0.0-alpha.
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.
|
|
33
|
+
"@dynamic-labs/logger": "3.0.0-alpha.67",
|
|
34
|
+
"@dynamic-labs/rpc-providers": "3.0.0-alpha.67",
|
|
35
|
+
"@dynamic-labs/types": "3.0.0-alpha.67",
|
|
36
|
+
"@dynamic-labs/utils": "3.0.0-alpha.67",
|
|
37
|
+
"@dynamic-labs/wallet-book": "3.0.0-alpha.67",
|
|
38
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.67"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -143,38 +143,38 @@ class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
143
143
|
const provider = this.getWalletClient();
|
|
144
144
|
if (!provider)
|
|
145
145
|
return [];
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
try {
|
|
147
|
+
const result = yield provider.requestPermissions({ eth_accounts: {} });
|
|
148
|
+
walletConnectorCore.logger.debug('chooseAccountsToConnect - requestPermissions result', result);
|
|
149
|
+
// this should return the connected addresses for MM
|
|
150
|
+
const addresses = (_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.find((r) => r.parentCapability === 'eth_accounts')) === null || _a === void 0 ? void 0 : _a.caveats) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
|
|
151
|
+
if (typeof addresses === 'string') {
|
|
152
|
+
return [addresses];
|
|
153
|
+
}
|
|
154
|
+
if (Array.isArray(addresses)) {
|
|
155
|
+
return addresses;
|
|
156
|
+
}
|
|
157
|
+
return [];
|
|
152
158
|
}
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
catch (error) {
|
|
160
|
+
walletConnectorCore.logger.debug('chooseAccountsToConnect - error', error);
|
|
161
|
+
// might fail if method is not supported, but just throw if user rejected
|
|
162
|
+
if (error.code === 4001) {
|
|
163
|
+
throw new utils.UserRejectedRequestError();
|
|
164
|
+
}
|
|
155
165
|
}
|
|
156
166
|
return [];
|
|
157
167
|
});
|
|
158
168
|
}
|
|
159
|
-
getConnectedAccounts(
|
|
169
|
+
getConnectedAccounts() {
|
|
160
170
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
161
171
|
const provider = this.getWalletClient();
|
|
162
172
|
if (!provider)
|
|
163
173
|
return [];
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (options === null || options === void 0 ? void 0 : options.chooseAccounts) {
|
|
169
|
-
addresses = yield this.chooseAccountsToConnect();
|
|
170
|
-
walletConnectorCore.logger.debug('getConnectedAccounts - Chosen addresses', addresses);
|
|
171
|
-
}
|
|
172
|
-
if (!addresses.length) {
|
|
173
|
-
addresses = yield utils.retryableFn(provider.getAddresses, {
|
|
174
|
-
fallbackValue: [],
|
|
175
|
-
timeoutMs: 500,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
174
|
+
const addresses = yield utils.retryableFn(provider.getAddresses, {
|
|
175
|
+
fallbackValue: [],
|
|
176
|
+
timeoutMs: 500,
|
|
177
|
+
});
|
|
178
178
|
if (addresses.length) {
|
|
179
179
|
this.setActiveAccount(addresses[0]);
|
|
180
180
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Account, Hex, PublicClient, Transport, Chain as ViemChain, WalletClient } from 'viem';
|
|
2
2
|
import { EvmNetwork, GenericNetwork, IUITransaction, TransactionReceipt } from '@dynamic-labs/types';
|
|
3
3
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
4
|
-
import { ISendBalanceWalletConnector, NameServiceData, WalletConnectorBase
|
|
4
|
+
import { ISendBalanceWalletConnector, NameServiceData, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { IChainRpcProviders } from '../rpc';
|
|
6
6
|
import { EthereumWallet } from '../wallet';
|
|
7
7
|
export type SwitchNetworkOps = {
|
|
@@ -3070,7 +3070,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase<typ
|
|
|
3070
3070
|
supportsNetworkSwitching(): boolean;
|
|
3071
3071
|
switchNetwork({ networkName, networkChainId, }: SwitchNetworkOps): Promise<void>;
|
|
3072
3072
|
chooseAccountsToConnect(): Promise<string[]>;
|
|
3073
|
-
getConnectedAccounts(
|
|
3073
|
+
getConnectedAccounts(): Promise<string[]>;
|
|
3074
3074
|
providerSwitchNetwork({ network, provider, }: {
|
|
3075
3075
|
network: EvmNetwork;
|
|
3076
3076
|
provider: WalletClient;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { getAddress, formatEther } from 'viem';
|
|
4
4
|
import { toAccount } from 'viem/accounts';
|
|
5
|
-
import { parseEvmNetworks, retryableFn, FALLBACK_UNDEFINED, DynamicError } from '@dynamic-labs/utils';
|
|
5
|
+
import { parseEvmNetworks, retryableFn, FALLBACK_UNDEFINED, DynamicError, UserRejectedRequestError } from '@dynamic-labs/utils';
|
|
6
6
|
import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import '../utils/logger.js';
|
|
8
8
|
import '../utils/viem/estimateL1Fee/opStack/estimateL1Fee.js';
|
|
@@ -139,38 +139,38 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
139
139
|
const provider = this.getWalletClient();
|
|
140
140
|
if (!provider)
|
|
141
141
|
return [];
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
try {
|
|
143
|
+
const result = yield provider.requestPermissions({ eth_accounts: {} });
|
|
144
|
+
logger.debug('chooseAccountsToConnect - requestPermissions result', result);
|
|
145
|
+
// this should return the connected addresses for MM
|
|
146
|
+
const addresses = (_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.find((r) => r.parentCapability === 'eth_accounts')) === null || _a === void 0 ? void 0 : _a.caveats) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
|
|
147
|
+
if (typeof addresses === 'string') {
|
|
148
|
+
return [addresses];
|
|
149
|
+
}
|
|
150
|
+
if (Array.isArray(addresses)) {
|
|
151
|
+
return addresses;
|
|
152
|
+
}
|
|
153
|
+
return [];
|
|
148
154
|
}
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
catch (error) {
|
|
156
|
+
logger.debug('chooseAccountsToConnect - error', error);
|
|
157
|
+
// might fail if method is not supported, but just throw if user rejected
|
|
158
|
+
if (error.code === 4001) {
|
|
159
|
+
throw new UserRejectedRequestError();
|
|
160
|
+
}
|
|
151
161
|
}
|
|
152
162
|
return [];
|
|
153
163
|
});
|
|
154
164
|
}
|
|
155
|
-
getConnectedAccounts(
|
|
165
|
+
getConnectedAccounts() {
|
|
156
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
167
|
const provider = this.getWalletClient();
|
|
158
168
|
if (!provider)
|
|
159
169
|
return [];
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (options === null || options === void 0 ? void 0 : options.chooseAccounts) {
|
|
165
|
-
addresses = yield this.chooseAccountsToConnect();
|
|
166
|
-
logger.debug('getConnectedAccounts - Chosen addresses', addresses);
|
|
167
|
-
}
|
|
168
|
-
if (!addresses.length) {
|
|
169
|
-
addresses = yield retryableFn(provider.getAddresses, {
|
|
170
|
-
fallbackValue: [],
|
|
171
|
-
timeoutMs: 500,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
170
|
+
const addresses = yield retryableFn(provider.getAddresses, {
|
|
171
|
+
fallbackValue: [],
|
|
172
|
+
timeoutMs: 500,
|
|
173
|
+
});
|
|
174
174
|
if (addresses.length) {
|
|
175
175
|
this.setActiveAccount(addresses[0]);
|
|
176
176
|
}
|