@dynamic-labs/ethereum 1.4.3 → 1.4.5

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,24 @@
1
1
 
2
+ ### [1.4.5](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.4...v1.4.5) (2024-04-05)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * use in-app browser deeplink for metamask ([#5176](https://github.com/dynamic-labs/DynamicAuth/issues/5176)) ([#5203](https://github.com/dynamic-labs/DynamicAuth/issues/5203)) ([63951d8](https://github.com/dynamic-labs/DynamicAuth/commit/63951d8896ea073e595e4a1e92bfe22731b012f4))
8
+ * clear user wallets immediately on logout ([#5238](https://github.com/dynamic-labs/DynamicAuth/issues/5238)) ([13b55a7](https://github.com/dynamic-labs/DynamicAuth/commit/13b55a7070f6f159504bf05b503848cc2c5ed445)), closes [#5211](https://github.com/dynamic-labs/DynamicAuth/issues/5211)
9
+
10
+ ### [1.4.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.3...v1.4.4) (2024-04-01)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Multiple WC bug fixes ([#5132](https://github.com/dynamic-labs/DynamicAuth/issues/5132)) ([#5133](https://github.com/dynamic-labs/DynamicAuth/issues/5133)) ([88affaf](https://github.com/dynamic-labs/DynamicAuth/commit/88affaff291391f5f633f7f3bb1ecd5219705117))
16
+ * apply network validation in mobile auth flow ([#5142](https://github.com/dynamic-labs/DynamicAuth/issues/5142)) ([#5159](https://github.com/dynamic-labs/DynamicAuth/issues/5159)) ([f8a6202](https://github.com/dynamic-labs/DynamicAuth/commit/f8a6202f9af8f234c723cfd05f4438536eb30fd0))
17
+ * Better handling of empty callback queue ([#5147](https://github.com/dynamic-labs/DynamicAuth/issues/5147)) ([#5149](https://github.com/dynamic-labs/DynamicAuth/issues/5149)) ([f520f25](https://github.com/dynamic-labs/DynamicAuth/commit/f520f25f2a0faf12567db29f6712cc2f8e421cff))
18
+ * multiple improvements to the wallet list ([#5155](https://github.com/dynamic-labs/DynamicAuth/issues/5155)) ([582ac0e](https://github.com/dynamic-labs/DynamicAuth/commit/582ac0e8baf0fd0eec1246219a5eda730c99f290)), closes [#5112](https://github.com/dynamic-labs/DynamicAuth/issues/5112)
19
+ * Improved scroll experience on ios [48873da](https://github.com/dynamic-labs/DynamicAuth/commit/48873da25bafd07104cebf3bcbb8e2a787c8092c))
20
+ * better handling of multiwallet state ([#5146](https://github.com/dynamic-labs/DynamicAuth/issues/5146)) ([#5148](https://github.com/dynamic-labs/DynamicAuth/issues/5148)) ([dabb780](https://github.com/dynamic-labs/DynamicAuth/commit/dabb7808c94cfa4da7d0c7a058f04d69ffdb301a))
21
+
2
22
  ### [1.4.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.2...v1.4.3) (2024-03-28)
3
23
 
4
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,18 +26,18 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@coinbase/wallet-sdk": "3.9.2",
30
29
  "@walletconnect/client": "1.8.0",
30
+ "@coinbase/wallet-sdk": "3.9.3",
31
31
  "@walletconnect/ethereum-provider": "2.11.2",
32
32
  "eventemitter3": "5.0.1",
33
33
  "buffer": "6.0.3",
34
- "@dynamic-labs/rpc-providers": "1.4.3",
35
- "@dynamic-labs/turnkey": "1.4.3",
36
- "@dynamic-labs/types": "1.4.3",
37
- "@dynamic-labs/utils": "1.4.3",
38
- "@dynamic-labs/viem-utils": "1.4.3",
39
- "@dynamic-labs/wallet-book": "1.4.3",
40
- "@dynamic-labs/wallet-connector-core": "1.4.3",
34
+ "@dynamic-labs/rpc-providers": "1.4.5",
35
+ "@dynamic-labs/turnkey": "1.4.5",
36
+ "@dynamic-labs/types": "1.4.5",
37
+ "@dynamic-labs/utils": "1.4.5",
38
+ "@dynamic-labs/viem-utils": "1.4.5",
39
+ "@dynamic-labs/wallet-book": "1.4.5",
40
+ "@dynamic-labs/wallet-connector-core": "1.4.5",
41
41
  "stream": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
@@ -6,12 +6,8 @@ var _tslib = require('../../_virtual/_tslib.cjs');
6
6
  var viem = require('viem');
7
7
  var walletBook = require('@dynamic-labs/wallet-book');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
- require('../polyfills.cjs');
10
- require('@dynamic-labs/turnkey');
11
- require('@dynamic-labs/utils');
12
9
  var ethProviderHelper = require('../ethProviderHelper.cjs');
13
10
  var EthWalletConnector = require('../EthWalletConnector.cjs');
14
- require('../walletConnect/walletConnectV2.cjs');
15
11
  var client = require('./client/client.cjs');
16
12
 
17
13
  class Coinbase extends EthWalletConnector.EthWalletConnector {
@@ -1,5 +1,5 @@
1
1
  import { Chain, FetchPublicAddressOpts } from '@dynamic-labs/wallet-connector-core';
2
- import { EthProviderHelper } from '..';
2
+ import { EthProviderHelper } from '../ethProviderHelper';
3
3
  import { EthWalletConnector, EthWalletConnectorOpts } from '../EthWalletConnector';
4
4
  type CoinbaseOpts = EthWalletConnectorOpts & {
5
5
  appLogoUrl?: string;
@@ -2,12 +2,8 @@ import { __rest, __awaiter } from '../../_virtual/_tslib.js';
2
2
  import { createWalletClient, custom } from 'viem';
3
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
4
  import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
5
- import '../polyfills.js';
6
- import '@dynamic-labs/turnkey';
7
- import '@dynamic-labs/utils';
8
5
  import { EthProviderHelper } from '../ethProviderHelper.js';
9
6
  import { EthWalletConnector } from '../EthWalletConnector.js';
10
- import '../walletConnect/walletConnectV2.js';
11
7
  import { getCoinbaseProvider, fetchPublicAddress, signMessage, killCoinbaseSession } from './client/client.js';
12
8
 
13
9
  class Coinbase extends EthWalletConnector {
@@ -4,7 +4,7 @@ var _tslib = require('../../_virtual/_tslib.cjs');
4
4
  var walletBook = require('@dynamic-labs/wallet-book');
5
5
  var ethProviderHelper = require('../ethProviderHelper.cjs');
6
6
  var EthWalletConnector = require('../EthWalletConnector.cjs');
7
- var walletConnectV2 = require('../walletConnect/walletConnectV2.cjs');
7
+ require('../walletConnect/walletConnectV2.cjs');
8
8
  var walletConnect = require('../walletConnect/walletConnect.cjs');
9
9
 
10
10
  class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
@@ -27,19 +27,24 @@ class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
27
27
  return this.ethProviderHelper;
28
28
  }
29
29
  getMobileOrInstalledWallet() {
30
- var _a, _b, _c, _d;
31
- if (this.walletConnectorFallback && !this.isInstalledOnBrowser()) {
32
- if (!this.wallet)
33
- this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
34
- if (((_a = this.constructorProps) === null || _a === void 0 ? void 0 : _a.isWalletConnectV2Enabled) &&
35
- ((_d = (_c = (_b = this.wallet) === null || _b === void 0 ? void 0 : _b.walletConnect) === null || _c === void 0 ? void 0 : _c.sdks) === null || _d === void 0 ? void 0 : _d.includes('sign_v2'))) {
36
- return new walletConnectV2.WalletConnectV2(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
37
- }
38
- else {
39
- return new walletConnect.WalletConnect(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
40
- }
30
+ var _a, _b;
31
+ if (!this.wallet) {
32
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
33
+ }
34
+ if (this.isInstalledOnBrowser()) {
35
+ return this;
36
+ }
37
+ if (((_b = (_a = this.wallet) === null || _a === void 0 ? void 0 : _a.mobile) === null || _b === void 0 ? void 0 : _b.inAppBrowser) &&
38
+ this.constructorProps.deepLinkPreference !== 'universal') {
39
+ return this;
40
+ }
41
+ // this is the case where the wallet is not installed on the browser and
42
+ // it does not support WalletConnect. in this case, the SDK will instruct
43
+ // the user to download the wallet extension
44
+ if (!this.walletConnectorFallback) {
45
+ return this;
41
46
  }
42
- return this;
47
+ return new walletConnect.WalletConnect(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
43
48
  }
44
49
  setupEventListeners() {
45
50
  const provider = this.getWalletClient();
@@ -2,7 +2,7 @@ import { __awaiter } from '../../_virtual/_tslib.js';
2
2
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
3
  import { EthProviderHelper } from '../ethProviderHelper.js';
4
4
  import { EthWalletConnector } from '../EthWalletConnector.js';
5
- import { WalletConnectV2 } from '../walletConnect/walletConnectV2.js';
5
+ import '../walletConnect/walletConnectV2.js';
6
6
  import { WalletConnect } from '../walletConnect/walletConnect.js';
7
7
 
8
8
  class InjectedWalletBase extends EthWalletConnector {
@@ -25,19 +25,24 @@ class InjectedWalletBase extends EthWalletConnector {
25
25
  return this.ethProviderHelper;
26
26
  }
27
27
  getMobileOrInstalledWallet() {
28
- var _a, _b, _c, _d;
29
- if (this.walletConnectorFallback && !this.isInstalledOnBrowser()) {
30
- if (!this.wallet)
31
- this.wallet = findWalletBookWallet(this.walletBook, this.key);
32
- if (((_a = this.constructorProps) === null || _a === void 0 ? void 0 : _a.isWalletConnectV2Enabled) &&
33
- ((_d = (_c = (_b = this.wallet) === null || _b === void 0 ? void 0 : _b.walletConnect) === null || _c === void 0 ? void 0 : _c.sdks) === null || _d === void 0 ? void 0 : _d.includes('sign_v2'))) {
34
- return new WalletConnectV2(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
35
- }
36
- else {
37
- return new WalletConnect(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
38
- }
28
+ var _a, _b;
29
+ if (!this.wallet) {
30
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
31
+ }
32
+ if (this.isInstalledOnBrowser()) {
33
+ return this;
34
+ }
35
+ if (((_b = (_a = this.wallet) === null || _a === void 0 ? void 0 : _a.mobile) === null || _b === void 0 ? void 0 : _b.inAppBrowser) &&
36
+ this.constructorProps.deepLinkPreference !== 'universal') {
37
+ return this;
38
+ }
39
+ // this is the case where the wallet is not installed on the browser and
40
+ // it does not support WalletConnect. in this case, the SDK will instruct
41
+ // the user to download the wallet extension
42
+ if (!this.walletConnectorFallback) {
43
+ return this;
39
44
  }
40
- return this;
45
+ return new WalletConnect(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
41
46
  }
42
47
  setupEventListeners() {
43
48
  const provider = this.getWalletClient();
@@ -1,23 +1,10 @@
1
+ import { WalletSchema } from '@dynamic-labs/wallet-book';
1
2
  import { EthWalletConnectorOpts } from '../EthWalletConnector';
2
3
  import InjectedWalletBase from './InjectedWalletBase';
3
4
  export declare class Zerion extends InjectedWalletBase {
4
5
  name: string;
5
6
  overrideKey: string;
6
- wallet: {
7
- eip6963Config: {
8
- rdns: string;
9
- };
10
- filterFromWalletConnect: boolean;
11
- injectedConfig: {
12
- chain: string;
13
- extensionLocators: {
14
- flag: string;
15
- value: boolean;
16
- }[];
17
- windowLocations: string[];
18
- }[];
19
- name: string;
20
- };
7
+ wallet: WalletSchema;
21
8
  constructor(props: EthWalletConnectorOpts);
22
9
  isInstalledOnBrowser(): boolean;
23
10
  }
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _tslib = require('../../_virtual/_tslib.cjs');
6
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
5
7
  var InjectedWalletBase = require('./InjectedWalletBase.cjs');
6
8
  var PhantomEvm = require('./PhantomEvm.cjs');
7
9
  var ExodusEvm = require('./ExodusEvm.cjs');
@@ -39,6 +41,26 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
39
41
  // this is the key from the wallet book entry so that we don't purely rely on the normalized name
40
42
  this.overrideKey = key;
41
43
  }
44
+ fetchPublicAddress() {
45
+ const _super = Object.create(null, {
46
+ fetchPublicAddress: { get: () => super.fetchPublicAddress }
47
+ });
48
+ var _a;
49
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
50
+ if (this.isInstalledOnBrowser()) {
51
+ return _super.fetchPublicAddress.call(this);
52
+ }
53
+ const inAppBrowserBase = (_a = this.wallet.mobile) === null || _a === void 0 ? void 0 : _a.inAppBrowser;
54
+ if (!inAppBrowserBase) {
55
+ const error = new Error(`No inAppBrowserBase found for ${this.name}.`);
56
+ walletConnectorCore.logger.error(error.message);
57
+ throw error;
58
+ }
59
+ const cleanedTargetUrl = window.location.href.replace('https://', '');
60
+ window.location.href = `${inAppBrowserBase}/${cleanedTargetUrl}`;
61
+ return undefined;
62
+ });
63
+ }
42
64
  };
43
65
  });
44
66
  };
@@ -1,3 +1,5 @@
1
+ import { __awaiter } from '../../_virtual/_tslib.js';
2
+ import { logger } from '@dynamic-labs/wallet-connector-core';
1
3
  import InjectedWalletBase from './InjectedWalletBase.js';
2
4
  import { PhantomEvm } from './PhantomEvm.js';
3
5
  import { ExodusEvm } from './ExodusEvm.js';
@@ -35,6 +37,26 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
35
37
  // this is the key from the wallet book entry so that we don't purely rely on the normalized name
36
38
  this.overrideKey = key;
37
39
  }
40
+ fetchPublicAddress() {
41
+ const _super = Object.create(null, {
42
+ fetchPublicAddress: { get: () => super.fetchPublicAddress }
43
+ });
44
+ var _a;
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ if (this.isInstalledOnBrowser()) {
47
+ return _super.fetchPublicAddress.call(this);
48
+ }
49
+ const inAppBrowserBase = (_a = this.wallet.mobile) === null || _a === void 0 ? void 0 : _a.inAppBrowser;
50
+ if (!inAppBrowserBase) {
51
+ const error = new Error(`No inAppBrowserBase found for ${this.name}.`);
52
+ logger.error(error.message);
53
+ throw error;
54
+ }
55
+ const cleanedTargetUrl = window.location.href.replace('https://', '');
56
+ window.location.href = `${inAppBrowserBase}/${cleanedTargetUrl}`;
57
+ return undefined;
58
+ });
59
+ }
38
60
  };
39
61
  });
40
62
  };