@dynamic-labs/ethereum 2.0.0-alpha.1 → 2.0.0-alpha.10
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 +133 -0
- package/package.json +9 -11
- package/src/EthWalletConnector.cjs +1 -20
- package/src/EthWalletConnector.d.ts +9 -10
- package/src/EthWalletConnector.js +3 -22
- package/src/coinbase/coinbase.cjs +3 -4
- package/src/coinbase/coinbase.d.ts +15 -14
- package/src/coinbase/coinbase.js +3 -4
- package/src/index.cjs +6 -12
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -11
- package/src/injected/ExodusEvm.cjs +1 -0
- package/src/injected/ExodusEvm.d.ts +1 -0
- package/src/injected/ExodusEvm.js +1 -0
- package/src/injected/InjectedWalletBase.cjs +1 -9
- package/src/injected/InjectedWalletBase.js +1 -9
- package/src/injected/PhantomEvm.cjs +1 -0
- package/src/injected/PhantomEvm.d.ts +1 -0
- package/src/injected/PhantomEvm.js +1 -0
- package/src/injected/fetchInjectedWalletConnectors.d.ts +0 -1
- package/src/walletConnect/fetchWalletConnectWallets.cjs +14 -33
- package/src/walletConnect/fetchWalletConnectWallets.d.ts +2 -5
- package/src/walletConnect/fetchWalletConnectWallets.js +14 -33
- package/src/walletConnect/index.d.ts +1 -2
- package/src/walletConnect/walletConnect.cjs +411 -76
- package/src/walletConnect/walletConnect.d.ts +308 -27
- package/src/walletConnect/walletConnect.js +410 -76
- package/src/walletConnect/client/client.cjs +0 -201
- package/src/walletConnect/client/client.d.ts +0 -17
- package/src/walletConnect/client/client.js +0 -187
- package/src/walletConnect/client/index.d.ts +0 -1
- package/src/walletConnect/client/types.d.ts +0 -4
- package/src/walletConnect/walletConnectV2.cjs +0 -475
- package/src/walletConnect/walletConnectV2.d.ts +0 -333
- package/src/walletConnect/walletConnectV2.js +0 -466
|
@@ -4,7 +4,6 @@ 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');
|
|
8
7
|
var walletConnect = require('../walletConnect/walletConnect.cjs');
|
|
9
8
|
|
|
10
9
|
class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
|
|
@@ -27,17 +26,10 @@ class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
|
|
|
27
26
|
return this.ethProviderHelper;
|
|
28
27
|
}
|
|
29
28
|
getMobileOrInstalledWallet() {
|
|
30
|
-
var _a, _b, _c, _d;
|
|
31
29
|
if (this.walletConnectorFallback && !this.isInstalledOnBrowser()) {
|
|
32
30
|
if (!this.wallet)
|
|
33
31
|
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
34
|
-
|
|
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
|
-
}
|
|
32
|
+
return new walletConnect.WalletConnect(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
|
|
41
33
|
}
|
|
42
34
|
return this;
|
|
43
35
|
}
|
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
import { WalletConnect } from '../walletConnect/walletConnect.js';
|
|
7
6
|
|
|
8
7
|
class InjectedWalletBase extends EthWalletConnector {
|
|
@@ -25,17 +24,10 @@ class InjectedWalletBase extends EthWalletConnector {
|
|
|
25
24
|
return this.ethProviderHelper;
|
|
26
25
|
}
|
|
27
26
|
getMobileOrInstalledWallet() {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
29
27
|
if (this.walletConnectorFallback && !this.isInstalledOnBrowser()) {
|
|
30
28
|
if (!this.wallet)
|
|
31
29
|
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
32
|
-
|
|
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
|
-
}
|
|
30
|
+
return new WalletConnect(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
|
|
39
31
|
}
|
|
40
32
|
return this;
|
|
41
33
|
}
|
|
@@ -2,6 +2,7 @@ import { EthWalletConnectorOpts } from '..';
|
|
|
2
2
|
import InjectedWalletBase from './InjectedWalletBase';
|
|
3
3
|
export declare class PhantomEvm extends InjectedWalletBase {
|
|
4
4
|
name: string;
|
|
5
|
+
overrideKey: string;
|
|
5
6
|
constructor(props: EthWalletConnectorOpts);
|
|
6
7
|
fetchPublicAddress(): Promise<string | undefined>;
|
|
7
8
|
}
|
|
@@ -2,6 +2,5 @@ import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core'
|
|
|
2
2
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
3
3
|
export declare const injectedWalletOverrides: WalletConnectorConstructor[];
|
|
4
4
|
export declare const fetchInjectedWalletConnector: ({ walletBook, }: {
|
|
5
|
-
isWalletConnectV2Enabled: boolean;
|
|
6
5
|
walletBook: WalletBookSchema;
|
|
7
6
|
}) => WalletConnectorConstructor[];
|
|
@@ -2,47 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var walletConnectV2 = require('./walletConnectV2.cjs');
|
|
6
5
|
var walletConnect = require('./walletConnect.cjs');
|
|
7
6
|
|
|
8
|
-
const fetchWalletConnectWallets = ({
|
|
7
|
+
const fetchWalletConnectWallets = ({ walletBook, }) => {
|
|
9
8
|
var _a;
|
|
10
|
-
return Object.
|
|
11
|
-
.filter((wallet) => wallet.walletConnect && !wallet.filterFromWalletConnect)
|
|
12
|
-
.map((wallet) => {
|
|
13
|
-
var _a;
|
|
9
|
+
return Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
10
|
+
.filter(([, wallet]) => wallet.walletConnect && !wallet.filterFromWalletConnect)
|
|
11
|
+
.map(([key, wallet]) => {
|
|
14
12
|
const { shortName } = wallet;
|
|
15
13
|
const name = shortName || wallet.name;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
super(Object.assign(Object.assign({}, props), { walletName: name }));
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return class extends walletConnect.WalletConnect {
|
|
28
|
-
constructor(props) {
|
|
29
|
-
super(Object.assign(Object.assign({}, props), { walletName: name }));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
14
|
+
return class extends walletConnect.WalletConnect {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(Object.assign(Object.assign({}, props), { walletName: name }));
|
|
17
|
+
this.overrideKey = key;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
33
20
|
});
|
|
34
21
|
};
|
|
35
|
-
const getWalletConnectConnector = (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
super(Object.assign(Object.assign({}, props), { walletName: 'WalletConnect' }));
|
|
39
|
-
}
|
|
22
|
+
const getWalletConnectConnector = () => class extends walletConnect.WalletConnect {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(Object.assign(Object.assign({}, props), { walletName: 'WalletConnect' }));
|
|
40
25
|
}
|
|
41
|
-
|
|
42
|
-
constructor(props) {
|
|
43
|
-
super(Object.assign(Object.assign({}, props), { walletName: 'WalletConnect' }));
|
|
44
|
-
}
|
|
45
|
-
};
|
|
26
|
+
};
|
|
46
27
|
|
|
47
28
|
exports.fetchWalletConnectWallets = fetchWalletConnectWallets;
|
|
48
29
|
exports.getWalletConnectConnector = getWalletConnectConnector;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
2
2
|
import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
export declare const fetchWalletConnectWallets: ({
|
|
4
|
-
isWalletConnectV2Enabled: boolean;
|
|
3
|
+
export declare const fetchWalletConnectWallets: ({ walletBook, }: {
|
|
5
4
|
walletBook: WalletBookSchema;
|
|
6
5
|
}) => Array<WalletConnectorConstructor>;
|
|
7
|
-
export declare const getWalletConnectConnector: (
|
|
8
|
-
isWalletConnectV2Enabled: boolean;
|
|
9
|
-
}) => WalletConnectorConstructor;
|
|
6
|
+
export declare const getWalletConnectConnector: () => WalletConnectorConstructor;
|
|
@@ -1,43 +1,24 @@
|
|
|
1
|
-
import { WalletConnectV2 } from './walletConnectV2.js';
|
|
2
1
|
import { WalletConnect } from './walletConnect.js';
|
|
3
2
|
|
|
4
|
-
const fetchWalletConnectWallets = ({
|
|
3
|
+
const fetchWalletConnectWallets = ({ walletBook, }) => {
|
|
5
4
|
var _a;
|
|
6
|
-
return Object.
|
|
7
|
-
.filter((wallet) => wallet.walletConnect && !wallet.filterFromWalletConnect)
|
|
8
|
-
.map((wallet) => {
|
|
9
|
-
var _a;
|
|
5
|
+
return Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
6
|
+
.filter(([, wallet]) => wallet.walletConnect && !wallet.filterFromWalletConnect)
|
|
7
|
+
.map(([key, wallet]) => {
|
|
10
8
|
const { shortName } = wallet;
|
|
11
9
|
const name = shortName || wallet.name;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
super(Object.assign(Object.assign({}, props), { walletName: name }));
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return class extends WalletConnect {
|
|
24
|
-
constructor(props) {
|
|
25
|
-
super(Object.assign(Object.assign({}, props), { walletName: name }));
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
10
|
+
return class extends WalletConnect {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(Object.assign(Object.assign({}, props), { walletName: name }));
|
|
13
|
+
this.overrideKey = key;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
29
16
|
});
|
|
30
17
|
};
|
|
31
|
-
const getWalletConnectConnector = (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
super(Object.assign(Object.assign({}, props), { walletName: 'WalletConnect' }));
|
|
35
|
-
}
|
|
18
|
+
const getWalletConnectConnector = () => class extends WalletConnect {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(Object.assign(Object.assign({}, props), { walletName: 'WalletConnect' }));
|
|
36
21
|
}
|
|
37
|
-
|
|
38
|
-
constructor(props) {
|
|
39
|
-
super(Object.assign(Object.assign({}, props), { walletName: 'WalletConnect' }));
|
|
40
|
-
}
|
|
41
|
-
};
|
|
22
|
+
};
|
|
42
23
|
|
|
43
24
|
export { fetchWalletConnectWallets, getWalletConnectConnector };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { WalletConnect } from './walletConnect';
|
|
1
|
+
export { WalletConnect, type WalletConnectOpts } from './walletConnect';
|
|
3
2
|
export { fetchWalletConnectWallets } from './fetchWalletConnectWallets';
|