@dynamic-labs/ethereum 3.0.0-alpha.5 → 3.0.0-alpha.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,44 @@
1
1
 
2
+ ## [3.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-06-19)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * add selectedTabIndex and helpers (#6040)
8
+
9
+ ### Features
10
+
11
+ * add selectedTabIndex and helpers ([#6040](https://github.com/dynamic-labs/DynamicAuth/issues/6040)) ([ae20b80](https://github.com/dynamic-labs/DynamicAuth/commit/ae20b8081376dce97b18fa69c81c9ab73c1ff317))
12
+ * add useRefreshUser to trigger a user state refresh ([#6079](https://github.com/dynamic-labs/DynamicAuth/issues/6079)) ([1236d35](https://github.com/dynamic-labs/DynamicAuth/commit/1236d35fe9fab44ed2114ad9f3c8c6dca7ec27be))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * always return userWallets when available ([#6080](https://github.com/dynamic-labs/DynamicAuth/issues/6080)) ([#6083](https://github.com/dynamic-labs/DynamicAuth/issues/6083)) ([11992d2](https://github.com/dynamic-labs/DynamicAuth/commit/11992d2af5a401ba4ff1dc6904e2a9f8ef5904ca))
18
+ * less solana rpc calls and improve fee fetching ([#6019](https://github.com/dynamic-labs/DynamicAuth/issues/6019)) ([e2609db](https://github.com/dynamic-labs/DynamicAuth/commit/e2609db962c7708ff5b127cb23260a25bc5032e3))
19
+ * make account change idemopotent ([#6061](https://github.com/dynamic-labs/DynamicAuth/issues/6061)) ([8c87513](https://github.com/dynamic-labs/DynamicAuth/commit/8c8751390ea14888c4889679895e2f06d75717b9))
20
+ * only run multi wallet prompt when user profile or auth flow are open ([#6073](https://github.com/dynamic-labs/DynamicAuth/issues/6073)) ([d48ca10](https://github.com/dynamic-labs/DynamicAuth/commit/d48ca105359018457a78588fd8d9aa8a91583a02))
21
+ * recompute multiwallet state after merging accounts ([#6078](https://github.com/dynamic-labs/DynamicAuth/issues/6078)) ([e08a274](https://github.com/dynamic-labs/DynamicAuth/commit/e08a274c4d848f2a8360be7106cfbfa00b9a8f9b))
22
+ * stop querying okx for accounts while locked ([#6081](https://github.com/dynamic-labs/DynamicAuth/issues/6081)) ([#6084](https://github.com/dynamic-labs/DynamicAuth/issues/6084)) ([34365ac](https://github.com/dynamic-labs/DynamicAuth/commit/34365ac1981fe020b03e666c24535a247645d2ad))
23
+ * update copy for primary wallet not connected modal ([#6069](https://github.com/dynamic-labs/DynamicAuth/issues/6069)) ([4a3f43c](https://github.com/dynamic-labs/DynamicAuth/commit/4a3f43ce5585983f7fea0c5b97e812c0ade80e2c))
24
+
25
+ ## [3.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-06-18)
26
+
27
+
28
+ ### Features
29
+
30
+ * implement useExternalAuth hook to signin using external jwt auth ([#6039](https://github.com/dynamic-labs/DynamicAuth/issues/6039)) ([ba90908](https://github.com/dynamic-labs/DynamicAuth/commit/ba90908509ec21f708a4a0782a7f94861fc3b484))
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * allow sign-in with different ME BTC wallet after initial connection ([a527b46](https://github.com/dynamic-labs/DynamicAuth/commit/a527b464f321b4fc27730f57c3812e996b5ed878))
36
+ * close sign modal when signing in with a wallet when embedded wallet is enabled ([#6013](https://github.com/dynamic-labs/DynamicAuth/issues/6013)) ([0f4f3c8](https://github.com/dynamic-labs/DynamicAuth/commit/0f4f3c83db162f7a1794a3549b60bbad6b03e2c0))
37
+ * custom network without a valid icon should still display its name in network picker ([#6018](https://github.com/dynamic-labs/DynamicAuth/issues/6018)) ([0b10df6](https://github.com/dynamic-labs/DynamicAuth/commit/0b10df68950bfc9b8492443158a6bb030dc1122c))
38
+ * e2e: remove page pause ([#6045](https://github.com/dynamic-labs/DynamicAuth/issues/6045)) ([55bba00](https://github.com/dynamic-labs/DynamicAuth/commit/55bba0034255055d6ae266b1296542f47ed48e2b))
39
+ * more fixes for connect starknet button ([#6046](https://github.com/dynamic-labs/DynamicAuth/issues/6046)) ([0fb570a](https://github.com/dynamic-labs/DynamicAuth/commit/0fb570a44e65f8dd6d4d2bf5edb2ee54985ec9d4))
40
+ * set verified credentials on embedded wallet creation ([#6044](https://github.com/dynamic-labs/DynamicAuth/issues/6044)) ([b52a96d](https://github.com/dynamic-labs/DynamicAuth/commit/b52a96d321e7efdb30dce9cdb3f6f176c24ceb81))
41
+
2
42
  ## [3.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-06-14)
3
43
 
4
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "3.0.0-alpha.5",
3
+ "version": "3.0.0-alpha.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,18 +26,18 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/sdk-api-core": "0.0.461",
29
+ "@dynamic-labs/sdk-api-core": "0.0.470",
30
30
  "@coinbase/wallet-sdk": "4.0.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-provider-ethereum": "3.0.0-alpha.5",
35
- "@dynamic-labs/turnkey": "3.0.0-alpha.5",
36
- "@dynamic-labs/types": "3.0.0-alpha.5",
37
- "@dynamic-labs/utils": "3.0.0-alpha.5",
38
- "@dynamic-labs/viem-utils": "3.0.0-alpha.5",
39
- "@dynamic-labs/wallet-book": "3.0.0-alpha.5",
40
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.5",
34
+ "@dynamic-labs/rpc-provider-ethereum": "3.0.0-alpha.7",
35
+ "@dynamic-labs/turnkey": "3.0.0-alpha.7",
36
+ "@dynamic-labs/types": "3.0.0-alpha.7",
37
+ "@dynamic-labs/utils": "3.0.0-alpha.7",
38
+ "@dynamic-labs/viem-utils": "3.0.0-alpha.7",
39
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.7",
40
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.7",
41
41
  "stream": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
@@ -146,7 +146,7 @@ class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
146
146
  return [];
147
147
  const addresses = yield utils.retryableFn(provider.getAddresses, {
148
148
  fallbackValue: [],
149
- timeoutMs: 300,
149
+ timeoutMs: 500,
150
150
  });
151
151
  if (addresses.length) {
152
152
  this.setActiveAccount(addresses[0]);
@@ -142,7 +142,7 @@ class EthWalletConnector extends WalletConnectorBase {
142
142
  return [];
143
143
  const addresses = yield retryableFn(provider.getAddresses, {
144
144
  fallbackValue: [],
145
- timeoutMs: 300,
145
+ timeoutMs: 500,
146
146
  });
147
147
  if (addresses.length) {
148
148
  this.setActiveAccount(addresses[0]);
@@ -8,7 +8,6 @@ var viem = require('viem');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var utils = require('@dynamic-labs/utils');
10
10
  var viemUtils = require('@dynamic-labs/viem-utils');
11
- var eip6963Provider = require('./eip6963Provider.cjs');
12
11
 
13
12
  class EthProviderHelper {
14
13
  constructor(wallet, connector) {
@@ -69,7 +68,7 @@ class EthProviderHelper {
69
68
  }
70
69
  eip6963ProviderLookup(rdns) {
71
70
  var _a;
72
- const { providers } = eip6963Provider.Eip6963ProviderSingleton.get();
71
+ const { providers } = utils.Eip6963ProviderSingleton.get();
73
72
  return (_a = providers.find((provider) => provider.info.rdns === rdns)) === null || _a === void 0 ? void 0 : _a.provider;
74
73
  }
75
74
  isInstalledHelper() {
@@ -2,9 +2,8 @@
2
2
  import { __awaiter } from '../_virtual/_tslib.js';
3
3
  import { createWalletClient, custom, getAddress } from 'viem';
4
4
  import { ProviderLookup, eventListenerHandlers, logger } from '@dynamic-labs/wallet-connector-core';
5
- import { getProvidersFromWindow } from '@dynamic-labs/utils';
5
+ import { getProvidersFromWindow, Eip6963ProviderSingleton } from '@dynamic-labs/utils';
6
6
  import { chainsMap } from '@dynamic-labs/viem-utils';
7
- import { Eip6963ProviderSingleton } from './eip6963Provider.js';
8
7
 
9
8
  class EthProviderHelper {
10
9
  constructor(wallet, connector) {
package/src/index.cjs CHANGED
@@ -8,6 +8,7 @@ var turnkey = require('@dynamic-labs/turnkey');
8
8
  var PhantomEvm = require('./injected/PhantomEvm.cjs');
9
9
  var ExodusEvm = require('./injected/ExodusEvm.cjs');
10
10
  var UnknownInjected = require('./injected/UnknownInjected.cjs');
11
+ var FallbackEvmConnector = require('./injected/FallbackEvmConnector.cjs');
11
12
  var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
12
13
  require('./walletConnect/walletConnect.cjs');
13
14
  var fetchWalletConnectWallets = require('./walletConnect/fetchWalletConnectWallets.cjs');
@@ -26,12 +27,14 @@ const EthereumWalletConnectors = (props) => [
26
27
  ...turnkey.TurnkeyEVMWalletConnectors(props),
27
28
  coinbase.Coinbase,
28
29
  UnknownInjected.UnknownInjected,
30
+ FallbackEvmConnector.FallbackEvmConnector,
29
31
  fetchWalletConnectWallets.getWalletConnectConnector(),
30
32
  ];
31
33
 
32
34
  exports.PhantomEvm = PhantomEvm.PhantomEvm;
33
35
  exports.ExodusEvm = ExodusEvm.ExodusEvm;
34
36
  exports.UnknownInjected = UnknownInjected.UnknownInjected;
37
+ exports.FallbackEvmConnector = FallbackEvmConnector.FallbackEvmConnector;
35
38
  exports.fetchInjectedWalletConnector = fetchInjectedWalletConnectors.fetchInjectedWalletConnector;
36
39
  exports.injectedWalletOverrides = fetchInjectedWalletConnectors.injectedWalletOverrides;
37
40
  exports.EthWalletConnector = EthWalletConnector.EthWalletConnector;
package/src/index.js CHANGED
@@ -5,6 +5,8 @@ export { PhantomEvm } from './injected/PhantomEvm.js';
5
5
  export { ExodusEvm } from './injected/ExodusEvm.js';
6
6
  import { UnknownInjected } from './injected/UnknownInjected.js';
7
7
  export { UnknownInjected } from './injected/UnknownInjected.js';
8
+ import { FallbackEvmConnector } from './injected/FallbackEvmConnector.js';
9
+ export { FallbackEvmConnector } from './injected/FallbackEvmConnector.js';
8
10
  import { injectedWalletOverrides, fetchInjectedWalletConnector } from './injected/fetchInjectedWalletConnectors.js';
9
11
  export { fetchInjectedWalletConnector, injectedWalletOverrides } from './injected/fetchInjectedWalletConnectors.js';
10
12
  import './walletConnect/walletConnect.js';
@@ -24,6 +26,7 @@ const EthereumWalletConnectors = (props) => [
24
26
  ...TurnkeyEVMWalletConnectors(props),
25
27
  Coinbase,
26
28
  UnknownInjected,
29
+ FallbackEvmConnector,
27
30
  getWalletConnectConnector(),
28
31
  ];
29
32
 
@@ -0,0 +1,22 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var walletBook = require('@dynamic-labs/wallet-book');
7
+ var InjectedWalletBase = require('./InjectedWalletBase.cjs');
8
+
9
+ class FallbackEvmConnector extends InjectedWalletBase {
10
+ constructor(props) {
11
+ super(props);
12
+ this.name = 'Fallback Connector';
13
+ this.overrideKey = 'fallbackconnector';
14
+ this.isAvailable = false;
15
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
16
+ }
17
+ isInstalledOnBrowser() {
18
+ return false;
19
+ }
20
+ }
21
+
22
+ exports.FallbackEvmConnector = FallbackEvmConnector;
@@ -0,0 +1,9 @@
1
+ import { EthWalletConnectorOpts } from '..';
2
+ import InjectedWalletBase from './InjectedWalletBase';
3
+ export declare class FallbackEvmConnector extends InjectedWalletBase {
4
+ name: string;
5
+ overrideKey: string;
6
+ isAvailable: boolean;
7
+ constructor(props: EthWalletConnectorOpts);
8
+ isInstalledOnBrowser(): boolean;
9
+ }
@@ -0,0 +1,18 @@
1
+ 'use client'
2
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
+ import InjectedWalletBase from './InjectedWalletBase.js';
4
+
5
+ class FallbackEvmConnector extends InjectedWalletBase {
6
+ constructor(props) {
7
+ super(props);
8
+ this.name = 'Fallback Connector';
9
+ this.overrideKey = 'fallbackconnector';
10
+ this.isAvailable = false;
11
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
12
+ }
13
+ isInstalledOnBrowser() {
14
+ return false;
15
+ }
16
+ }
17
+
18
+ export { FallbackEvmConnector };
@@ -1,4 +1,5 @@
1
1
  export * from './PhantomEvm';
2
2
  export * from './ExodusEvm';
3
3
  export * from './UnknownInjected';
4
+ export * from './FallbackEvmConnector';
4
5
  export * from './fetchInjectedWalletConnectors';
@@ -1,40 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- const isEip9693Event = (event) => event.type === 'eip6963:announceProvider' &&
7
- event.detail !== undefined;
8
- class Eip6963Provider {
9
- constructor() {
10
- this.providers = [];
11
- }
12
- registerProviders() {
13
- if (typeof window === 'undefined') {
14
- return;
15
- }
16
- window.addEventListener('eip6963:announceProvider', (event) => {
17
- if (!isEip9693Event(event)) {
18
- return;
19
- }
20
- this.providers.push(event.detail);
21
- });
22
- window.dispatchEvent(new Event('eip6963:requestProvider'));
23
- }
24
- }
25
- class Eip6963ProviderSingleton {
26
- constructor() {
27
- this.eip6963Provider = new Eip6963Provider();
28
- }
29
- static get() {
30
- var _a;
31
- if (!((_a = Eip6963ProviderSingleton.instance) === null || _a === void 0 ? void 0 : _a.eip6963Provider)) {
32
- Eip6963ProviderSingleton.instance = new Eip6963ProviderSingleton();
33
- Eip6963ProviderSingleton.instance.eip6963Provider.registerProviders();
34
- }
35
- return Eip6963ProviderSingleton.instance.eip6963Provider;
36
- }
37
- }
38
-
39
- exports.Eip6963Provider = Eip6963Provider;
40
- exports.Eip6963ProviderSingleton = Eip6963ProviderSingleton;
@@ -1,25 +0,0 @@
1
- import { IEthereum } from './types';
2
- /**
3
- * Represents the assets needed to display a wallet
4
- */
5
- type Eip6963ProviderInfo = {
6
- uuid: string;
7
- name: string;
8
- icon: string;
9
- rdns: string;
10
- };
11
- type Eip6963ProviderDetail = {
12
- info: Eip6963ProviderInfo;
13
- provider: IEthereum;
14
- };
15
- export declare class Eip6963Provider {
16
- providers: Eip6963ProviderDetail[];
17
- registerProviders(): void;
18
- }
19
- export declare class Eip6963ProviderSingleton {
20
- readonly eip6963Provider: Eip6963Provider;
21
- private constructor();
22
- private static instance;
23
- static get(): Eip6963Provider;
24
- }
25
- export {};
@@ -1,35 +0,0 @@
1
- 'use client'
2
- const isEip9693Event = (event) => event.type === 'eip6963:announceProvider' &&
3
- event.detail !== undefined;
4
- class Eip6963Provider {
5
- constructor() {
6
- this.providers = [];
7
- }
8
- registerProviders() {
9
- if (typeof window === 'undefined') {
10
- return;
11
- }
12
- window.addEventListener('eip6963:announceProvider', (event) => {
13
- if (!isEip9693Event(event)) {
14
- return;
15
- }
16
- this.providers.push(event.detail);
17
- });
18
- window.dispatchEvent(new Event('eip6963:requestProvider'));
19
- }
20
- }
21
- class Eip6963ProviderSingleton {
22
- constructor() {
23
- this.eip6963Provider = new Eip6963Provider();
24
- }
25
- static get() {
26
- var _a;
27
- if (!((_a = Eip6963ProviderSingleton.instance) === null || _a === void 0 ? void 0 : _a.eip6963Provider)) {
28
- Eip6963ProviderSingleton.instance = new Eip6963ProviderSingleton();
29
- Eip6963ProviderSingleton.instance.eip6963Provider.registerProviders();
30
- }
31
- return Eip6963ProviderSingleton.instance.eip6963Provider;
32
- }
33
- }
34
-
35
- export { Eip6963Provider, Eip6963ProviderSingleton };