@dynamic-labs/ethereum 4.0.0-alpha.21 → 4.0.0-alpha.23
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 +19 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/coinbase/coinbase.cjs +1 -1
- package/src/coinbase/coinbase.d.ts +2 -2
- package/src/coinbase/coinbase.js +2 -2
- package/src/coinbase/types.d.ts +2 -2
- package/src/ethProviderHelper.cjs +27 -26
- package/src/ethProviderHelper.js +28 -27
- package/src/index.cjs +4 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/injected/ExodusEvm.d.ts +2 -2
- package/src/injected/FallbackEvmConnector.d.ts +2 -2
- package/src/injected/InjectedWalletBase.cjs +1 -1
- package/src/injected/InjectedWalletBase.d.ts +2 -2
- package/src/injected/InjectedWalletBase.js +2 -2
- package/src/injected/PhantomEvm.d.ts +2 -2
- package/src/injected/UnknownInjected.d.ts +2 -2
- package/src/walletConnect/walletConnect.cjs +1 -1
- package/src/walletConnect/walletConnect.d.ts +3 -3
- package/src/walletConnect/walletConnect.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.23](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.22...v4.0.0-alpha.23) (2024-10-31)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* allow deletion of embedded wallets ([#7170](https://github.com/dynamic-labs/dynamic-auth/issues/7170)) ([40c5478](https://github.com/dynamic-labs/dynamic-auth/commit/40c54789594ba265a63b24f936da4e72b5b1c5b9))
|
|
8
|
+
|
|
9
|
+
## [4.0.0-alpha.22](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2024-10-30)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **QNTM-522:** add wallet details card ([#7239](https://github.com/dynamic-labs/dynamic-auth/issues/7239)) ([0181c87](https://github.com/dynamic-labs/dynamic-auth/commit/0181c8727af575620525b8ea47b196945c347846))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* update check for wallet provider event listeners support ([#7303](https://github.com/dynamic-labs/dynamic-auth/issues/7303)) ([c5f3766](https://github.com/dynamic-labs/dynamic-auth/commit/c5f376691c87a0999991e477f9acd07eed4774aa))
|
|
20
|
+
|
|
2
21
|
## [4.0.0-alpha.21](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2024-10-30)
|
|
3
22
|
|
|
4
23
|
## [4.0.0-alpha.20](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.19...v4.0.0-alpha.20) (2024-10-30)
|
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.23",
|
|
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",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"@walletconnect/types": "2.10.6",
|
|
24
24
|
"eventemitter3": "5.0.1",
|
|
25
25
|
"buffer": "6.0.3",
|
|
26
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/embedded-wallet-evm": "4.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/ethereum-core": "4.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
31
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
26
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.23",
|
|
27
|
+
"@dynamic-labs/embedded-wallet-evm": "4.0.0-alpha.23",
|
|
28
|
+
"@dynamic-labs/ethereum-core": "4.0.0-alpha.23",
|
|
29
|
+
"@dynamic-labs/types": "4.0.0-alpha.23",
|
|
30
|
+
"@dynamic-labs/utils": "4.0.0-alpha.23",
|
|
31
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.23",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.23"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"viem": "^2.7.6"
|
|
@@ -9,7 +9,7 @@ var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
|
9
9
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
var helpers = require('./helpers.cjs');
|
|
11
11
|
|
|
12
|
-
class Coinbase extends ethereumCore.
|
|
12
|
+
class Coinbase extends ethereumCore.EthereumWalletConnector {
|
|
13
13
|
constructor(_a) {
|
|
14
14
|
var { appName, appLogoUrl, evmNetworks, coinbaseWalletPreference } = _a, props = _tslib.__rest(_a, ["appName", "appLogoUrl", "evmNetworks", "coinbaseWalletPreference"]);
|
|
15
15
|
super(Object.assign({ evmNetworks }, props));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WalletClient, Account, Transport, Chain as ViemChain } from 'viem';
|
|
2
2
|
import { ProviderInterface } from '@coinbase/wallet-sdk';
|
|
3
|
-
import {
|
|
3
|
+
import { EthereumWalletConnector } from '@dynamic-labs/ethereum-core';
|
|
4
4
|
import { Chain } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { CoinbaseOpts, GetCoinbaseProviderOpts } from './types';
|
|
6
|
-
export declare class Coinbase extends
|
|
6
|
+
export declare class Coinbase extends EthereumWalletConnector {
|
|
7
7
|
name: string;
|
|
8
8
|
overrideKey: string;
|
|
9
9
|
supportedChains: Chain[];
|
package/src/coinbase/coinbase.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __rest, __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { toHex, toBytes, createWalletClient, custom } from 'viem';
|
|
4
|
-
import {
|
|
4
|
+
import { EthereumWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
|
|
5
5
|
import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import { getCoinbaseProvider } from './helpers.js';
|
|
7
7
|
|
|
8
|
-
class Coinbase extends
|
|
8
|
+
class Coinbase extends EthereumWalletConnector {
|
|
9
9
|
constructor(_a) {
|
|
10
10
|
var { appName, appLogoUrl, evmNetworks, coinbaseWalletPreference } = _a, props = __rest(_a, ["appName", "appLogoUrl", "evmNetworks", "coinbaseWalletPreference"]);
|
|
11
11
|
super(Object.assign({ evmNetworks }, props));
|
package/src/coinbase/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ProviderInterface } from '@coinbase/wallet-sdk';
|
|
2
2
|
import { type CoinbaseWalletPreference, type GenericNetwork } from '@dynamic-labs/types';
|
|
3
|
-
import { type
|
|
3
|
+
import { type EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
4
4
|
export type GetCoinbaseProviderOpts = {
|
|
5
5
|
appLogoUrl?: string;
|
|
6
6
|
appName?: string;
|
|
@@ -11,7 +11,7 @@ export type CoinbaseProviderHandlerOpts = {
|
|
|
11
11
|
onDisconnect(): Promise<void>;
|
|
12
12
|
};
|
|
13
13
|
export type GetCoinbaseProvider = (opts?: GetCoinbaseProviderOpts) => ProviderInterface;
|
|
14
|
-
export type CoinbaseOpts =
|
|
14
|
+
export type CoinbaseOpts = EthereumWalletConnectorOpts & {
|
|
15
15
|
appLogoUrl?: string;
|
|
16
16
|
appName?: string;
|
|
17
17
|
coinbaseWalletPreference?: CoinbaseWalletPreference;
|
|
@@ -140,43 +140,44 @@ class EthProviderHelper {
|
|
|
140
140
|
}
|
|
141
141
|
_setupEventListeners(walletConnector) {
|
|
142
142
|
const web3Provider = this.findProvider();
|
|
143
|
-
if (web3Provider && 'on' in web3Provider) {
|
|
144
|
-
const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(walletConnector);
|
|
145
|
-
web3Provider.on('accountsChanged', handleAccountChange);
|
|
146
|
-
web3Provider.on('chainChanged', handleChainChange);
|
|
147
|
-
web3Provider.on('disconnect', handleDisconnect);
|
|
148
|
-
const tearDownEventListeners = () => {
|
|
149
|
-
const web3Provider = this.findProvider();
|
|
150
|
-
if (!web3Provider) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (handleAccountChange) {
|
|
154
|
-
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
155
|
-
}
|
|
156
|
-
if (handleChainChange) {
|
|
157
|
-
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
158
|
-
}
|
|
159
|
-
if (handleDisconnect) {
|
|
160
|
-
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
return {
|
|
164
|
-
tearDownEventListeners,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
143
|
if (!web3Provider) {
|
|
168
144
|
walletConnectorCore.logger.warn('Provider not found', {
|
|
169
145
|
connector: walletConnector,
|
|
170
146
|
});
|
|
147
|
+
return {
|
|
148
|
+
tearDownEventListeners: () => { },
|
|
149
|
+
};
|
|
171
150
|
}
|
|
172
|
-
|
|
151
|
+
if (!web3Provider.on) {
|
|
173
152
|
walletConnectorCore.logger.warn('Provider does not support event listeners', {
|
|
174
153
|
connector: walletConnector,
|
|
175
154
|
provider: web3Provider,
|
|
176
155
|
});
|
|
156
|
+
return {
|
|
157
|
+
tearDownEventListeners: () => { },
|
|
158
|
+
};
|
|
177
159
|
}
|
|
160
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(walletConnector);
|
|
161
|
+
web3Provider.on('accountsChanged', handleAccountChange);
|
|
162
|
+
web3Provider.on('chainChanged', handleChainChange);
|
|
163
|
+
web3Provider.on('disconnect', handleDisconnect);
|
|
164
|
+
const tearDownEventListeners = () => {
|
|
165
|
+
const web3Provider = this.findProvider();
|
|
166
|
+
if (!web3Provider) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (handleAccountChange) {
|
|
170
|
+
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
171
|
+
}
|
|
172
|
+
if (handleChainChange) {
|
|
173
|
+
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
174
|
+
}
|
|
175
|
+
if (handleDisconnect) {
|
|
176
|
+
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
178
179
|
return {
|
|
179
|
-
tearDownEventListeners
|
|
180
|
+
tearDownEventListeners,
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
183
|
}
|
package/src/ethProviderHelper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../_virtual/_tslib.js';
|
|
3
3
|
import { createWalletClient, custom, getAddress } from 'viem';
|
|
4
|
-
import { ProviderLookup,
|
|
4
|
+
import { ProviderLookup, logger, eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { getProvidersFromWindow, Eip6963ProviderSingleton } from '@dynamic-labs/utils';
|
|
6
6
|
import { chainsMap } from '@dynamic-labs/ethereum-core';
|
|
7
7
|
|
|
@@ -136,43 +136,44 @@ class EthProviderHelper {
|
|
|
136
136
|
}
|
|
137
137
|
_setupEventListeners(walletConnector) {
|
|
138
138
|
const web3Provider = this.findProvider();
|
|
139
|
-
if (web3Provider && 'on' in web3Provider) {
|
|
140
|
-
const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector);
|
|
141
|
-
web3Provider.on('accountsChanged', handleAccountChange);
|
|
142
|
-
web3Provider.on('chainChanged', handleChainChange);
|
|
143
|
-
web3Provider.on('disconnect', handleDisconnect);
|
|
144
|
-
const tearDownEventListeners = () => {
|
|
145
|
-
const web3Provider = this.findProvider();
|
|
146
|
-
if (!web3Provider) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (handleAccountChange) {
|
|
150
|
-
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
151
|
-
}
|
|
152
|
-
if (handleChainChange) {
|
|
153
|
-
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
154
|
-
}
|
|
155
|
-
if (handleDisconnect) {
|
|
156
|
-
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
return {
|
|
160
|
-
tearDownEventListeners,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
139
|
if (!web3Provider) {
|
|
164
140
|
logger.warn('Provider not found', {
|
|
165
141
|
connector: walletConnector,
|
|
166
142
|
});
|
|
143
|
+
return {
|
|
144
|
+
tearDownEventListeners: () => { },
|
|
145
|
+
};
|
|
167
146
|
}
|
|
168
|
-
|
|
147
|
+
if (!web3Provider.on) {
|
|
169
148
|
logger.warn('Provider does not support event listeners', {
|
|
170
149
|
connector: walletConnector,
|
|
171
150
|
provider: web3Provider,
|
|
172
151
|
});
|
|
152
|
+
return {
|
|
153
|
+
tearDownEventListeners: () => { },
|
|
154
|
+
};
|
|
173
155
|
}
|
|
156
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector);
|
|
157
|
+
web3Provider.on('accountsChanged', handleAccountChange);
|
|
158
|
+
web3Provider.on('chainChanged', handleChainChange);
|
|
159
|
+
web3Provider.on('disconnect', handleDisconnect);
|
|
160
|
+
const tearDownEventListeners = () => {
|
|
161
|
+
const web3Provider = this.findProvider();
|
|
162
|
+
if (!web3Provider) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (handleAccountChange) {
|
|
166
|
+
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
167
|
+
}
|
|
168
|
+
if (handleChainChange) {
|
|
169
|
+
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
170
|
+
}
|
|
171
|
+
if (handleDisconnect) {
|
|
172
|
+
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
174
175
|
return {
|
|
175
|
-
tearDownEventListeners
|
|
176
|
+
tearDownEventListeners,
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
}
|
package/src/index.cjs
CHANGED
|
@@ -39,6 +39,10 @@ exports.FallbackEvmConnector = FallbackEvmConnector.FallbackEvmConnector;
|
|
|
39
39
|
exports.fetchInjectedWalletConnector = fetchInjectedWalletConnectors.fetchInjectedWalletConnector;
|
|
40
40
|
exports.injectedWalletOverrides = fetchInjectedWalletConnectors.injectedWalletOverrides;
|
|
41
41
|
exports.EthereumInjectedConnector = InjectedWalletBase.InjectedWalletBase;
|
|
42
|
+
Object.defineProperty(exports, 'EthereumWalletConnector', {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return ethereumCore.EthereumWalletConnector; }
|
|
45
|
+
});
|
|
42
46
|
Object.defineProperty(exports, 'isEthereumWallet', {
|
|
43
47
|
enumerable: true,
|
|
44
48
|
get: function () { return ethereumCore.isEthereumWallet; }
|
package/src/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export * from './ethProviderHelper';
|
|
|
6
6
|
export * from './constants';
|
|
7
7
|
export * from './types';
|
|
8
8
|
export declare const EthereumWalletConnectors: (props: any) => WalletConnectorConstructor[];
|
|
9
|
-
export { isEthereumWallet } from '@dynamic-labs/ethereum-core';
|
|
9
|
+
export { isEthereumWallet, EthereumWalletConnector, } from '@dynamic-labs/ethereum-core';
|
package/src/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export { InjectedWalletBase as EthereumInjectedConnector } from './injected/Inje
|
|
|
15
15
|
import './walletConnect/walletConnect.js';
|
|
16
16
|
import { fetchWalletConnectWallets, getWalletConnectConnector } from './walletConnect/fetchWalletConnectWallets.js';
|
|
17
17
|
import { Coinbase } from './coinbase/coinbase.js';
|
|
18
|
-
export { isEthereumWallet } from '@dynamic-labs/ethereum-core';
|
|
18
|
+
export { EthereumWalletConnector, isEthereumWallet } from '@dynamic-labs/ethereum-core';
|
|
19
19
|
export { EthProviderHelper } from './ethProviderHelper.js';
|
|
20
20
|
export { INFURA_ID } from './constants.js';
|
|
21
21
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
2
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
3
|
export declare class ExodusEvm extends InjectedWalletBase {
|
|
4
4
|
name: string;
|
|
5
5
|
overrideKey: string;
|
|
6
6
|
walletConnectorFallback: boolean;
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: EthereumWalletConnectorOpts);
|
|
8
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
2
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
3
|
export declare class FallbackEvmConnector extends InjectedWalletBase {
|
|
4
4
|
name: string;
|
|
5
5
|
overrideKey: string;
|
|
6
6
|
isAvailable: boolean;
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: EthereumWalletConnectorOpts);
|
|
8
8
|
isInstalledOnBrowser(): boolean;
|
|
9
9
|
}
|
|
@@ -10,7 +10,7 @@ var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
|
10
10
|
var ethProviderHelper = require('../ethProviderHelper.cjs');
|
|
11
11
|
var walletConnect = require('../walletConnect/walletConnect.cjs');
|
|
12
12
|
|
|
13
|
-
class InjectedWalletBase extends ethereumCore.
|
|
13
|
+
class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.supportedChains = ['ETH', 'EVM'];
|
|
@@ -2,10 +2,10 @@ import { WalletClient, Transport, Account, Chain as ViemChain } from 'viem';
|
|
|
2
2
|
import { Chain } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { EvmNetwork } from '@dynamic-labs/types';
|
|
4
4
|
import { WalletSchema } from '@dynamic-labs/wallet-book';
|
|
5
|
-
import {
|
|
5
|
+
import { EthereumWalletConnector } from '@dynamic-labs/ethereum-core';
|
|
6
6
|
import { EthProviderHelper } from '../ethProviderHelper';
|
|
7
7
|
import { IEthereum } from '../types';
|
|
8
|
-
export declare abstract class InjectedWalletBase extends
|
|
8
|
+
export declare abstract class InjectedWalletBase extends EthereumWalletConnector {
|
|
9
9
|
supportedChains: Chain[];
|
|
10
10
|
connectedChain: Chain;
|
|
11
11
|
publicAddress: string | undefined;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
4
4
|
import { isMobile } from '@dynamic-labs/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { EthereumWalletConnector } from '@dynamic-labs/ethereum-core';
|
|
6
6
|
import { EthProviderHelper } from '../ethProviderHelper.js';
|
|
7
7
|
import { WalletConnect } from '../walletConnect/walletConnect.js';
|
|
8
8
|
|
|
9
|
-
class InjectedWalletBase extends
|
|
9
|
+
class InjectedWalletBase extends EthereumWalletConnector {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.supportedChains = ['ETH', 'EVM'];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
2
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
3
|
export declare class PhantomEvm extends InjectedWalletBase {
|
|
4
4
|
name: string;
|
|
5
5
|
overrideKey: string;
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: EthereumWalletConnectorOpts);
|
|
7
7
|
getAddress(): Promise<string | undefined>;
|
|
8
8
|
canGetChainAddress(): boolean;
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
2
2
|
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
3
|
export declare class UnknownInjected extends InjectedWalletBase {
|
|
4
4
|
name: string;
|
|
5
5
|
overrideKey: string;
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: EthereumWalletConnectorOpts);
|
|
7
7
|
isInstalledOnBrowser(): boolean;
|
|
8
8
|
}
|
|
@@ -23,7 +23,7 @@ const sessionTopicKey = (walletName) => `dynamic-wc2-session-topic-${walletName}
|
|
|
23
23
|
const swicthedNetworkKey = (walletName) => `dynamic-wc2-switched-network-${walletName}`;
|
|
24
24
|
const currentChainKey = (walletName) => `dynamic-wc2-current-chain-${walletName}`;
|
|
25
25
|
const ee = new EventEmitter__default["default"]();
|
|
26
|
-
class WalletConnect extends ethereumCore.
|
|
26
|
+
class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
27
27
|
constructor(opts) {
|
|
28
28
|
var _a;
|
|
29
29
|
super(opts);
|
|
@@ -2,14 +2,14 @@ import type { SessionTypes } from '@walletconnect/types';
|
|
|
2
2
|
import { WalletClient, Account, Transport, Chain as ViemChain } from 'viem';
|
|
3
3
|
import { Chain, GetAddressOpts, DeepLinkVariant, IWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { EvmNetwork } from '@dynamic-labs/types';
|
|
5
|
-
import {
|
|
6
|
-
export type WalletConnectOpts =
|
|
5
|
+
import { EthereumWalletConnector, EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
6
|
+
export type WalletConnectOpts = EthereumWalletConnectorOpts & {
|
|
7
7
|
projectId?: string;
|
|
8
8
|
walletName: string;
|
|
9
9
|
deepLinkPreference?: DeepLinkVariant;
|
|
10
10
|
walletConnectPreferredChains?: `eip155:${number}`[];
|
|
11
11
|
};
|
|
12
|
-
export declare class WalletConnect extends
|
|
12
|
+
export declare class WalletConnect extends EthereumWalletConnector implements IWalletConnectConnector {
|
|
13
13
|
supportedChains: Chain[];
|
|
14
14
|
connectedChain: Chain;
|
|
15
15
|
name: string;
|
|
@@ -6,7 +6,7 @@ import { createWalletClient, custom } from 'viem';
|
|
|
6
6
|
import { logger, performPlatformSpecificConnectionMethod, getDeepLink } from '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
8
8
|
import { DynamicError, sleep, isMobile } from '@dynamic-labs/utils';
|
|
9
|
-
import {
|
|
9
|
+
import { EthereumWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
|
|
10
10
|
import { parseIntSafe } from '../utils/parseIntSafe.js';
|
|
11
11
|
|
|
12
12
|
const activeAccountKey = (walletName) => `dynamic-wc2-active-account-${walletName}`;
|
|
@@ -14,7 +14,7 @@ const sessionTopicKey = (walletName) => `dynamic-wc2-session-topic-${walletName}
|
|
|
14
14
|
const swicthedNetworkKey = (walletName) => `dynamic-wc2-switched-network-${walletName}`;
|
|
15
15
|
const currentChainKey = (walletName) => `dynamic-wc2-current-chain-${walletName}`;
|
|
16
16
|
const ee = new EventEmitter();
|
|
17
|
-
class WalletConnect extends
|
|
17
|
+
class WalletConnect extends EthereumWalletConnector {
|
|
18
18
|
constructor(opts) {
|
|
19
19
|
var _a;
|
|
20
20
|
super(opts);
|