@dynamic-labs/ethereum 4.0.0-alpha.33 → 4.0.0-alpha.34
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 +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/injected/ExodusEvm.cjs +2 -4
- package/src/injected/ExodusEvm.d.ts +0 -2
- package/src/injected/ExodusEvm.js +2 -4
- package/src/injected/FallbackEvmConnector.cjs +2 -4
- package/src/injected/FallbackEvmConnector.d.ts +0 -2
- package/src/injected/FallbackEvmConnector.js +2 -4
- package/src/injected/InjectedWalletBase.cjs +6 -8
- package/src/injected/InjectedWalletBase.d.ts +71 -1
- package/src/injected/InjectedWalletBase.js +6 -8
- package/src/injected/PhantomEvm.cjs +2 -4
- package/src/injected/PhantomEvm.d.ts +0 -2
- package/src/injected/PhantomEvm.js +2 -4
- package/src/injected/UnknownInjected.cjs +2 -4
- package/src/injected/UnknownInjected.d.ts +0 -2
- package/src/injected/UnknownInjected.js +2 -4
- package/src/injected/fetchInjectedWalletConnectors.cjs +8 -5
- package/src/injected/fetchInjectedWalletConnectors.js +8 -5
- package/src/walletConnect/walletConnect.cjs +2 -5
- package/src/walletConnect/walletConnect.js +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.34](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.33...v4.0.0-alpha.34) (2024-11-20)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* remove `supportsSatsConnect` helper ([#7453](https://github.com/dynamic-labs/dynamic-auth/issues/7453)) ([920c63b](https://github.com/dynamic-labs/dynamic-auth/commit/920c63bbb5a38dc3d676664db512a4da539c0909))
|
|
8
|
+
* moved `getWalletLinks` helper from `@dynamic-labs/wallet-book` to `@dynamic-labs/wallet-connector-core` ([#7416](https://github.com/dynamic-labs/dynamic-auth/issues/7416)) ([73fdfa8](https://github.com/dynamic-labs/dynamic-auth/commit/73fdfa8a19fe4c2cca55410d5ed3cb7b5bd8cdfd))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* allow listening to dynamic events without using a hook ([#7466](https://github.com/dynamic-labs/dynamic-auth/issues/7466)) ([3b34e1b](https://github.com/dynamic-labs/dynamic-auth/commit/3b34e1bd2737003b987887a02d0e21436e9bf908))
|
|
13
|
+
* emit primaryWalletChanged event when primary wallets changes ([#7464](https://github.com/dynamic-labs/dynamic-auth/issues/7464)) ([3bc6ba0](https://github.com/dynamic-labs/dynamic-auth/commit/3bc6ba055e0232bff3c6c6bb93d3d57b1dd90bc6))
|
|
14
|
+
* emit primaryWalletNetworkChanged event when primary wallet network changes ([#7465](https://github.com/dynamic-labs/dynamic-auth/issues/7465)) ([33cc629](https://github.com/dynamic-labs/dynamic-auth/commit/33cc629d3c6a03c381b7e5591a8f4557987cc6fc))
|
|
15
|
+
|
|
16
|
+
|
|
2
17
|
## [4.0.0-alpha.33](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.32...v4.0.0-alpha.33) (2024-11-18)
|
|
3
18
|
|
|
4
19
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.34",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"eventemitter3": "5.0.1",
|
|
25
25
|
"buffer": "6.0.3",
|
|
26
26
|
"@metamask/sdk": "0.30.1",
|
|
27
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/embedded-wallet-evm": "4.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/ethereum-core": "4.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
31
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
33
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
27
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.34",
|
|
28
|
+
"@dynamic-labs/embedded-wallet-evm": "4.0.0-alpha.34",
|
|
29
|
+
"@dynamic-labs/ethereum-core": "4.0.0-alpha.34",
|
|
30
|
+
"@dynamic-labs/logger": "4.0.0-alpha.34",
|
|
31
|
+
"@dynamic-labs/types": "4.0.0-alpha.34",
|
|
32
|
+
"@dynamic-labs/utils": "4.0.0-alpha.34",
|
|
33
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.34",
|
|
34
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.34"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"viem": "^2.7.6"
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
6
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
8
7
|
|
|
9
8
|
// leaving ExodusEvm in here due to a backwards compatibility issue with this one wallet and v18
|
|
10
9
|
class ExodusEvm extends InjectedWalletBase.InjectedWalletBase {
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
13
12
|
this.name = 'ExodusEvm';
|
|
14
13
|
this.overrideKey = 'exodusevm';
|
|
15
14
|
this.walletConnectorFallback = true;
|
|
16
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class ExodusEvm extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
5
|
walletConnectorFallback: boolean;
|
|
7
|
-
constructor(props: EthereumWalletConnectorOpts);
|
|
8
6
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
2
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
4
3
|
|
|
5
4
|
// leaving ExodusEvm in here due to a backwards compatibility issue with this one wallet and v18
|
|
6
5
|
class ExodusEvm extends InjectedWalletBase {
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
9
8
|
this.name = 'ExodusEvm';
|
|
10
9
|
this.overrideKey = 'exodusevm';
|
|
11
10
|
this.walletConnectorFallback = true;
|
|
12
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
13
|
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
6
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
8
7
|
|
|
9
8
|
class FallbackEvmConnector extends InjectedWalletBase.InjectedWalletBase {
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
12
11
|
this.name = 'Fallback Connector';
|
|
13
12
|
this.overrideKey = 'fallbackconnector';
|
|
14
13
|
this.isAvailable = false;
|
|
15
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
16
14
|
}
|
|
17
15
|
isInstalledOnBrowser() {
|
|
18
16
|
return false;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class FallbackEvmConnector extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
5
|
isAvailable: boolean;
|
|
7
|
-
constructor(props: EthereumWalletConnectorOpts);
|
|
8
6
|
isInstalledOnBrowser(): boolean;
|
|
9
7
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
2
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
4
3
|
|
|
5
4
|
class FallbackEvmConnector extends InjectedWalletBase {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
8
7
|
this.name = 'Fallback Connector';
|
|
9
8
|
this.overrideKey = 'fallbackconnector';
|
|
10
9
|
this.isAvailable = false;
|
|
11
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
12
10
|
}
|
|
13
11
|
isInstalledOnBrowser() {
|
|
14
12
|
return false;
|
|
@@ -15,12 +15,13 @@ class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
|
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.walletConnectorFallback = false;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
if (!this.
|
|
20
|
-
|
|
21
|
-
// allows the getEthProviderHelper to return undefined if the wallet is not installed
|
|
22
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
18
|
+
get wallet() {
|
|
19
|
+
if (!this._wallet) {
|
|
20
|
+
this._wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
23
21
|
}
|
|
22
|
+
return this._wallet;
|
|
23
|
+
}
|
|
24
|
+
getEthProviderHelper() {
|
|
24
25
|
if (this.wallet && !this.ethProviderHelper) {
|
|
25
26
|
this.ethProviderHelper = new ethProviderHelper.EthProviderHelper(this.wallet, this);
|
|
26
27
|
}
|
|
@@ -29,9 +30,6 @@ class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
|
|
|
29
30
|
}
|
|
30
31
|
getMobileOrInstalledWallet() {
|
|
31
32
|
var _a;
|
|
32
|
-
if (!this.wallet) {
|
|
33
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
34
|
-
}
|
|
35
33
|
if (this.isInstalledOnBrowser()) {
|
|
36
34
|
return this;
|
|
37
35
|
}
|
|
@@ -8,7 +8,77 @@ export declare abstract class InjectedWalletBase extends EthereumWalletConnector
|
|
|
8
8
|
publicAddress: string | undefined;
|
|
9
9
|
walletConnectorFallback: boolean;
|
|
10
10
|
ethProviderHelper: EthProviderHelper | undefined;
|
|
11
|
-
|
|
11
|
+
_wallet: WalletSchema | undefined;
|
|
12
|
+
get wallet(): {
|
|
13
|
+
name: string;
|
|
14
|
+
brand?: {
|
|
15
|
+
alt?: string | undefined;
|
|
16
|
+
primaryColor?: string | undefined;
|
|
17
|
+
spriteId?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
chainGroup?: string | undefined;
|
|
20
|
+
chains?: string[] | undefined;
|
|
21
|
+
desktop?: {
|
|
22
|
+
chromeId?: string | undefined;
|
|
23
|
+
edgeId?: string | undefined;
|
|
24
|
+
firefoxId?: string | undefined;
|
|
25
|
+
native?: string | undefined;
|
|
26
|
+
operaId?: string | undefined;
|
|
27
|
+
safariId?: string | undefined;
|
|
28
|
+
universal?: string | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
eip6963Config?: {
|
|
31
|
+
rdns: string;
|
|
32
|
+
} | undefined;
|
|
33
|
+
filterFromWalletConnect?: boolean | undefined;
|
|
34
|
+
group?: string | undefined;
|
|
35
|
+
hardwareWallets?: string[] | undefined;
|
|
36
|
+
injectedConfig?: {
|
|
37
|
+
chain: string;
|
|
38
|
+
extensionLocators: {
|
|
39
|
+
value: boolean;
|
|
40
|
+
flag: string;
|
|
41
|
+
}[];
|
|
42
|
+
providerInterface?: string | undefined;
|
|
43
|
+
walletStandard?: {
|
|
44
|
+
features: string[];
|
|
45
|
+
name: string;
|
|
46
|
+
providerId?: string | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
walletStandardLocators?: {
|
|
49
|
+
name: string;
|
|
50
|
+
locator: string;
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
windowLocations?: string[] | undefined;
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
mobile?: {
|
|
55
|
+
android?: string | null | undefined;
|
|
56
|
+
androidId?: string | undefined;
|
|
57
|
+
inAppBrowser?: string | null | undefined;
|
|
58
|
+
ios?: string | null | undefined;
|
|
59
|
+
iosId?: string | undefined;
|
|
60
|
+
native?: string | undefined;
|
|
61
|
+
universal?: string | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
mobileExperience?: "in-app-browser" | "redirect" | undefined;
|
|
64
|
+
shortName?: string | undefined;
|
|
65
|
+
showOnlyIfInstalled?: boolean | undefined;
|
|
66
|
+
switchNetworkOnlyFromWallet?: boolean | undefined;
|
|
67
|
+
walletConnect?: {
|
|
68
|
+
sdks?: string[] | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
walletGroup?: string | undefined;
|
|
71
|
+
walletLimitations?: {
|
|
72
|
+
browserExtension?: {
|
|
73
|
+
unsupportedEvents?: string[] | undefined;
|
|
74
|
+
unsupportedMethods?: string[] | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
mobile?: {
|
|
77
|
+
unsupportedEvents?: string[] | undefined;
|
|
78
|
+
unsupportedMethods?: string[] | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
} | undefined;
|
|
12
82
|
getEthProviderHelper(): EthProviderHelper | undefined;
|
|
13
83
|
getMobileOrInstalledWallet(): InjectedWalletBase;
|
|
14
84
|
findProvider(): IEthereum | undefined;
|
|
@@ -11,12 +11,13 @@ class InjectedWalletBase extends EthereumWalletConnector {
|
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.walletConnectorFallback = false;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
if (!this.
|
|
16
|
-
|
|
17
|
-
// allows the getEthProviderHelper to return undefined if the wallet is not installed
|
|
18
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
14
|
+
get wallet() {
|
|
15
|
+
if (!this._wallet) {
|
|
16
|
+
this._wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
19
17
|
}
|
|
18
|
+
return this._wallet;
|
|
19
|
+
}
|
|
20
|
+
getEthProviderHelper() {
|
|
20
21
|
if (this.wallet && !this.ethProviderHelper) {
|
|
21
22
|
this.ethProviderHelper = new EthProviderHelper(this.wallet, this);
|
|
22
23
|
}
|
|
@@ -25,9 +26,6 @@ class InjectedWalletBase extends EthereumWalletConnector {
|
|
|
25
26
|
}
|
|
26
27
|
getMobileOrInstalledWallet() {
|
|
27
28
|
var _a;
|
|
28
|
-
if (!this.wallet) {
|
|
29
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
30
|
-
}
|
|
31
29
|
if (this.isInstalledOnBrowser()) {
|
|
32
30
|
return this;
|
|
33
31
|
}
|
|
@@ -5,15 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
8
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
10
9
|
|
|
11
10
|
class PhantomEvm extends InjectedWalletBase.InjectedWalletBase {
|
|
12
|
-
constructor(
|
|
13
|
-
super(
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
14
13
|
this.name = 'Phantom';
|
|
15
14
|
this.overrideKey = 'phantomevm';
|
|
16
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
17
15
|
}
|
|
18
16
|
getAddress() {
|
|
19
17
|
const _super = Object.create(null, {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class PhantomEvm extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(props: EthereumWalletConnectorOpts);
|
|
7
5
|
getAddress(): Promise<string | undefined>;
|
|
8
6
|
canGetChainAddress(): boolean;
|
|
9
7
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { isMobile, handleMobileWalletRedirect } from '@dynamic-labs/utils';
|
|
4
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
5
4
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
6
5
|
|
|
7
6
|
class PhantomEvm extends InjectedWalletBase {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
10
9
|
this.name = 'Phantom';
|
|
11
10
|
this.overrideKey = 'phantomevm';
|
|
12
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
13
11
|
}
|
|
14
12
|
getAddress() {
|
|
15
13
|
const _super = Object.create(null, {
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
6
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
8
7
|
|
|
9
8
|
class UnknownInjected extends InjectedWalletBase.InjectedWalletBase {
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
12
11
|
this.name = 'Unknown';
|
|
13
12
|
this.overrideKey = 'unknown';
|
|
14
|
-
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
15
13
|
}
|
|
16
14
|
isInstalledOnBrowser() {
|
|
17
15
|
return false;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
1
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
2
|
export declare class UnknownInjected extends InjectedWalletBase {
|
|
4
3
|
name: string;
|
|
5
4
|
overrideKey: string;
|
|
6
|
-
constructor(props: EthereumWalletConnectorOpts);
|
|
7
5
|
isInstalledOnBrowser(): boolean;
|
|
8
6
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
2
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
4
3
|
|
|
5
4
|
class UnknownInjected extends InjectedWalletBase {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
8
7
|
this.name = 'Unknown';
|
|
9
8
|
this.overrideKey = 'unknown';
|
|
10
|
-
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
11
9
|
}
|
|
12
10
|
isInstalledOnBrowser() {
|
|
13
11
|
return false;
|
|
@@ -13,12 +13,13 @@ const injectedWalletOverrides = [
|
|
|
13
13
|
PhantomEvm.PhantomEvm,
|
|
14
14
|
ExodusEvm.ExodusEvm,
|
|
15
15
|
];
|
|
16
|
-
const
|
|
16
|
+
const walletsWithCustomConnectors = [
|
|
17
17
|
'phantomevm',
|
|
18
18
|
'coinbase',
|
|
19
19
|
'exodusevm',
|
|
20
20
|
'abstract',
|
|
21
21
|
'metamask',
|
|
22
|
+
'edenonline',
|
|
22
23
|
];
|
|
23
24
|
const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
24
25
|
var _a;
|
|
@@ -26,21 +27,23 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
|
26
27
|
.filter(([key, wallet]) => {
|
|
27
28
|
var _a;
|
|
28
29
|
return ((_a = wallet.injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.chain === 'evm')) &&
|
|
29
|
-
!
|
|
30
|
+
!walletsWithCustomConnectors.includes(key);
|
|
30
31
|
})
|
|
31
32
|
.map(([key, wallet]) => {
|
|
32
33
|
const { shortName } = wallet;
|
|
33
34
|
const name = shortName || wallet.name;
|
|
34
35
|
const walletConnectorFallback = Boolean(wallet.walletConnect);
|
|
35
36
|
return class extends InjectedWalletBase.InjectedWalletBase {
|
|
36
|
-
constructor(
|
|
37
|
-
super(
|
|
37
|
+
constructor() {
|
|
38
|
+
super(...arguments);
|
|
38
39
|
this.name = name;
|
|
39
|
-
this.wallet = wallet;
|
|
40
40
|
this.walletConnectorFallback = walletConnectorFallback;
|
|
41
41
|
// this is the key from the wallet book entry so that we don't purely rely on the normalized name
|
|
42
42
|
this.overrideKey = key;
|
|
43
43
|
}
|
|
44
|
+
get wallet() {
|
|
45
|
+
return wallet;
|
|
46
|
+
}
|
|
44
47
|
getAddress() {
|
|
45
48
|
const _super = Object.create(null, {
|
|
46
49
|
getAddress: { get: () => super.getAddress }
|
|
@@ -9,12 +9,13 @@ const injectedWalletOverrides = [
|
|
|
9
9
|
PhantomEvm,
|
|
10
10
|
ExodusEvm,
|
|
11
11
|
];
|
|
12
|
-
const
|
|
12
|
+
const walletsWithCustomConnectors = [
|
|
13
13
|
'phantomevm',
|
|
14
14
|
'coinbase',
|
|
15
15
|
'exodusevm',
|
|
16
16
|
'abstract',
|
|
17
17
|
'metamask',
|
|
18
|
+
'edenonline',
|
|
18
19
|
];
|
|
19
20
|
const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
20
21
|
var _a;
|
|
@@ -22,21 +23,23 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
|
22
23
|
.filter(([key, wallet]) => {
|
|
23
24
|
var _a;
|
|
24
25
|
return ((_a = wallet.injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.chain === 'evm')) &&
|
|
25
|
-
!
|
|
26
|
+
!walletsWithCustomConnectors.includes(key);
|
|
26
27
|
})
|
|
27
28
|
.map(([key, wallet]) => {
|
|
28
29
|
const { shortName } = wallet;
|
|
29
30
|
const name = shortName || wallet.name;
|
|
30
31
|
const walletConnectorFallback = Boolean(wallet.walletConnect);
|
|
31
32
|
return class extends InjectedWalletBase {
|
|
32
|
-
constructor(
|
|
33
|
-
super(
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
34
35
|
this.name = name;
|
|
35
|
-
this.wallet = wallet;
|
|
36
36
|
this.walletConnectorFallback = walletConnectorFallback;
|
|
37
37
|
// this is the key from the wallet book entry so that we don't purely rely on the normalized name
|
|
38
38
|
this.overrideKey = key;
|
|
39
39
|
}
|
|
40
|
+
get wallet() {
|
|
41
|
+
return wallet;
|
|
42
|
+
}
|
|
40
43
|
getAddress() {
|
|
41
44
|
const _super = Object.create(null, {
|
|
42
45
|
getAddress: { get: () => super.getAddress }
|
|
@@ -8,7 +8,6 @@ var EthereumProvider = require('@walletconnect/ethereum-provider');
|
|
|
8
8
|
var EventEmitter = require('eventemitter3');
|
|
9
9
|
var viem = require('viem');
|
|
10
10
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
|
-
var walletBook = require('@dynamic-labs/wallet-book');
|
|
12
11
|
var utils = require('@dynamic-labs/utils');
|
|
13
12
|
var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
14
13
|
var parseIntSafe = require('../utils/parseIntSafe.cjs');
|
|
@@ -269,8 +268,7 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
269
268
|
throw new utils.DynamicError('No provider found');
|
|
270
269
|
}
|
|
271
270
|
}
|
|
272
|
-
|
|
273
|
-
walletConnectorCore.performPlatformSpecificConnectionMethod(WalletConnect.provider.signer.uri, metadata, {
|
|
271
|
+
walletConnectorCore.performPlatformSpecificConnectionMethod(WalletConnect.provider.signer.uri, this.metadata.deepLinks, {
|
|
274
272
|
onDesktopUri: opts === null || opts === void 0 ? void 0 : opts.onDesktopUri,
|
|
275
273
|
onDisplayUri: opts === null || opts === void 0 ? void 0 : opts.onDisplayUri,
|
|
276
274
|
}, this.deepLinkPreference);
|
|
@@ -355,9 +353,8 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
355
353
|
if (!this.session) {
|
|
356
354
|
return;
|
|
357
355
|
}
|
|
358
|
-
const metadata = walletBook.getWalletBookWallet(this.walletBook, this.key);
|
|
359
356
|
const deepLink = walletConnectorCore.getDeepLink({
|
|
360
|
-
metadata,
|
|
357
|
+
deepLinks: this.metadata.deepLinks,
|
|
361
358
|
mode: 'regular',
|
|
362
359
|
preference: this.deepLinkPreference,
|
|
363
360
|
uri: (_a = WalletConnect.provider) === null || _a === void 0 ? void 0 : _a.signer.uri,
|
|
@@ -4,7 +4,6 @@ import EthereumProvider from '@walletconnect/ethereum-provider';
|
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import { createWalletClient, custom } from 'viem';
|
|
6
6
|
import { logger, performPlatformSpecificConnectionMethod, getDeepLink } from '@dynamic-labs/wallet-connector-core';
|
|
7
|
-
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
8
7
|
import { DynamicError, sleep, isMobile } from '@dynamic-labs/utils';
|
|
9
8
|
import { EthereumWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
|
|
10
9
|
import { parseIntSafe } from '../utils/parseIntSafe.js';
|
|
@@ -260,8 +259,7 @@ class WalletConnect extends EthereumWalletConnector {
|
|
|
260
259
|
throw new DynamicError('No provider found');
|
|
261
260
|
}
|
|
262
261
|
}
|
|
263
|
-
|
|
264
|
-
performPlatformSpecificConnectionMethod(WalletConnect.provider.signer.uri, metadata, {
|
|
262
|
+
performPlatformSpecificConnectionMethod(WalletConnect.provider.signer.uri, this.metadata.deepLinks, {
|
|
265
263
|
onDesktopUri: opts === null || opts === void 0 ? void 0 : opts.onDesktopUri,
|
|
266
264
|
onDisplayUri: opts === null || opts === void 0 ? void 0 : opts.onDisplayUri,
|
|
267
265
|
}, this.deepLinkPreference);
|
|
@@ -346,9 +344,8 @@ class WalletConnect extends EthereumWalletConnector {
|
|
|
346
344
|
if (!this.session) {
|
|
347
345
|
return;
|
|
348
346
|
}
|
|
349
|
-
const metadata = getWalletBookWallet(this.walletBook, this.key);
|
|
350
347
|
const deepLink = getDeepLink({
|
|
351
|
-
metadata,
|
|
348
|
+
deepLinks: this.metadata.deepLinks,
|
|
352
349
|
mode: 'regular',
|
|
353
350
|
preference: this.deepLinkPreference,
|
|
354
351
|
uri: (_a = WalletConnect.provider) === null || _a === void 0 ? void 0 : _a.signer.uri,
|