@dynamic-labs/ethereum 3.4.5 → 3.4.6
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 +14 -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,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.4.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.5...v3.4.6) (2024-10-31)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for compass and leap wallets ([ab170c9](https://github.com/dynamic-labs/DynamicAuth/commit/ab170c962099ed6356d2f31c947b122f1aa7ec73))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* prevent use-wallet-options from reading empty wallet-book ([#7320](https://github.com/dynamic-labs/DynamicAuth/issues/7320)) ([24c6cb1](https://github.com/dynamic-labs/DynamicAuth/commit/24c6cb14ce324925b120d363e029e29b72560895))
|
|
13
|
+
* sats-connect wallets not prompting correctly to sync account when making a transaction ([#7311](https://github.com/dynamic-labs/DynamicAuth/issues/7311)) ([#7312](https://github.com/dynamic-labs/DynamicAuth/issues/7312)) ([2026be4](https://github.com/dynamic-labs/DynamicAuth/commit/2026be412edcbb7e98341a5a5b2a3bd75ffdb83f))
|
|
14
|
+
* update check for wallet provider event listeners support ([#7303](https://github.com/dynamic-labs/DynamicAuth/issues/7303)) ([#7304](https://github.com/dynamic-labs/DynamicAuth/issues/7304)) ([1e91c76](https://github.com/dynamic-labs/DynamicAuth/commit/1e91c767ebe078f63c27884e4a8e7729d49b2114))
|
|
15
|
+
|
|
2
16
|
### [3.4.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.4...v3.4.5) (2024-10-30)
|
|
3
17
|
|
|
4
18
|
|
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": "3.4.
|
|
3
|
+
"version": "3.4.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@walletconnect/types": "2.10.6",
|
|
32
32
|
"eventemitter3": "5.0.1",
|
|
33
33
|
"buffer": "6.0.3",
|
|
34
|
-
"@dynamic-labs/assert-package-version": "3.4.
|
|
35
|
-
"@dynamic-labs/embedded-wallet-evm": "3.4.
|
|
36
|
-
"@dynamic-labs/ethereum-core": "3.4.
|
|
37
|
-
"@dynamic-labs/types": "3.4.
|
|
38
|
-
"@dynamic-labs/utils": "3.4.
|
|
39
|
-
"@dynamic-labs/wallet-book": "3.4.
|
|
40
|
-
"@dynamic-labs/wallet-connector-core": "3.4.
|
|
34
|
+
"@dynamic-labs/assert-package-version": "3.4.6",
|
|
35
|
+
"@dynamic-labs/embedded-wallet-evm": "3.4.6",
|
|
36
|
+
"@dynamic-labs/ethereum-core": "3.4.6",
|
|
37
|
+
"@dynamic-labs/types": "3.4.6",
|
|
38
|
+
"@dynamic-labs/utils": "3.4.6",
|
|
39
|
+
"@dynamic-labs/wallet-book": "3.4.6",
|
|
40
|
+
"@dynamic-labs/wallet-connector-core": "3.4.6"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"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;
|
|
@@ -130,43 +130,44 @@ class EthProviderHelper {
|
|
|
130
130
|
}
|
|
131
131
|
_setupEventListeners(walletConnector) {
|
|
132
132
|
const web3Provider = this.findProvider();
|
|
133
|
-
if (web3Provider && 'on' in web3Provider) {
|
|
134
|
-
const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(walletConnector);
|
|
135
|
-
web3Provider.on('accountsChanged', handleAccountChange);
|
|
136
|
-
web3Provider.on('chainChanged', handleChainChange);
|
|
137
|
-
web3Provider.on('disconnect', handleDisconnect);
|
|
138
|
-
const tearDownEventListeners = () => {
|
|
139
|
-
const web3Provider = this.findProvider();
|
|
140
|
-
if (!web3Provider) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (handleAccountChange) {
|
|
144
|
-
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
145
|
-
}
|
|
146
|
-
if (handleChainChange) {
|
|
147
|
-
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
148
|
-
}
|
|
149
|
-
if (handleDisconnect) {
|
|
150
|
-
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
return {
|
|
154
|
-
tearDownEventListeners,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
133
|
if (!web3Provider) {
|
|
158
134
|
walletConnectorCore.logger.warn('Provider not found', {
|
|
159
135
|
connector: walletConnector,
|
|
160
136
|
});
|
|
137
|
+
return {
|
|
138
|
+
tearDownEventListeners: () => { },
|
|
139
|
+
};
|
|
161
140
|
}
|
|
162
|
-
|
|
141
|
+
if (!web3Provider.on) {
|
|
163
142
|
walletConnectorCore.logger.warn('Provider does not support event listeners', {
|
|
164
143
|
connector: walletConnector,
|
|
165
144
|
provider: web3Provider,
|
|
166
145
|
});
|
|
146
|
+
return {
|
|
147
|
+
tearDownEventListeners: () => { },
|
|
148
|
+
};
|
|
167
149
|
}
|
|
150
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(walletConnector);
|
|
151
|
+
web3Provider.on('accountsChanged', handleAccountChange);
|
|
152
|
+
web3Provider.on('chainChanged', handleChainChange);
|
|
153
|
+
web3Provider.on('disconnect', handleDisconnect);
|
|
154
|
+
const tearDownEventListeners = () => {
|
|
155
|
+
const web3Provider = this.findProvider();
|
|
156
|
+
if (!web3Provider) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (handleAccountChange) {
|
|
160
|
+
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
161
|
+
}
|
|
162
|
+
if (handleChainChange) {
|
|
163
|
+
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
164
|
+
}
|
|
165
|
+
if (handleDisconnect) {
|
|
166
|
+
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
168
169
|
return {
|
|
169
|
-
tearDownEventListeners
|
|
170
|
+
tearDownEventListeners,
|
|
170
171
|
};
|
|
171
172
|
}
|
|
172
173
|
}
|
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
|
|
|
@@ -126,43 +126,44 @@ class EthProviderHelper {
|
|
|
126
126
|
}
|
|
127
127
|
_setupEventListeners(walletConnector) {
|
|
128
128
|
const web3Provider = this.findProvider();
|
|
129
|
-
if (web3Provider && 'on' in web3Provider) {
|
|
130
|
-
const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector);
|
|
131
|
-
web3Provider.on('accountsChanged', handleAccountChange);
|
|
132
|
-
web3Provider.on('chainChanged', handleChainChange);
|
|
133
|
-
web3Provider.on('disconnect', handleDisconnect);
|
|
134
|
-
const tearDownEventListeners = () => {
|
|
135
|
-
const web3Provider = this.findProvider();
|
|
136
|
-
if (!web3Provider) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (handleAccountChange) {
|
|
140
|
-
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
141
|
-
}
|
|
142
|
-
if (handleChainChange) {
|
|
143
|
-
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
144
|
-
}
|
|
145
|
-
if (handleDisconnect) {
|
|
146
|
-
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
return {
|
|
150
|
-
tearDownEventListeners,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
129
|
if (!web3Provider) {
|
|
154
130
|
logger.warn('Provider not found', {
|
|
155
131
|
connector: walletConnector,
|
|
156
132
|
});
|
|
133
|
+
return {
|
|
134
|
+
tearDownEventListeners: () => { },
|
|
135
|
+
};
|
|
157
136
|
}
|
|
158
|
-
|
|
137
|
+
if (!web3Provider.on) {
|
|
159
138
|
logger.warn('Provider does not support event listeners', {
|
|
160
139
|
connector: walletConnector,
|
|
161
140
|
provider: web3Provider,
|
|
162
141
|
});
|
|
142
|
+
return {
|
|
143
|
+
tearDownEventListeners: () => { },
|
|
144
|
+
};
|
|
163
145
|
}
|
|
146
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector);
|
|
147
|
+
web3Provider.on('accountsChanged', handleAccountChange);
|
|
148
|
+
web3Provider.on('chainChanged', handleChainChange);
|
|
149
|
+
web3Provider.on('disconnect', handleDisconnect);
|
|
150
|
+
const tearDownEventListeners = () => {
|
|
151
|
+
const web3Provider = this.findProvider();
|
|
152
|
+
if (!web3Provider) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (handleAccountChange) {
|
|
156
|
+
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
157
|
+
}
|
|
158
|
+
if (handleChainChange) {
|
|
159
|
+
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
160
|
+
}
|
|
161
|
+
if (handleDisconnect) {
|
|
162
|
+
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
164
165
|
return {
|
|
165
|
-
tearDownEventListeners
|
|
166
|
+
tearDownEventListeners,
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
169
|
}
|
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);
|