@dynamic-labs/ethereum 2.0.0-alpha.2 → 2.0.0-alpha.21

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +236 -0
  2. package/package.json +10 -11
  3. package/src/EthWalletConnector.cjs +1 -20
  4. package/src/EthWalletConnector.d.ts +9 -10
  5. package/src/EthWalletConnector.js +3 -22
  6. package/src/coinbase/client/client.cjs +2 -2
  7. package/src/coinbase/client/client.d.ts +2 -2
  8. package/src/coinbase/client/client.js +2 -2
  9. package/src/coinbase/coinbase.cjs +30 -9
  10. package/src/coinbase/coinbase.d.ts +19 -17
  11. package/src/coinbase/coinbase.js +31 -10
  12. package/src/ethProviderHelper.cjs +10 -5
  13. package/src/ethProviderHelper.d.ts +4 -3
  14. package/src/ethProviderHelper.js +10 -5
  15. package/src/index.cjs +7 -13
  16. package/src/index.d.ts +1 -0
  17. package/src/index.js +7 -13
  18. package/src/injected/ExodusEvm.cjs +1 -0
  19. package/src/injected/ExodusEvm.d.ts +1 -0
  20. package/src/injected/ExodusEvm.js +1 -0
  21. package/src/injected/InjectedWalletBase.cjs +6 -14
  22. package/src/injected/InjectedWalletBase.d.ts +2 -2
  23. package/src/injected/InjectedWalletBase.js +6 -14
  24. package/src/injected/PhantomEvm.cjs +4 -3
  25. package/src/injected/PhantomEvm.d.ts +2 -1
  26. package/src/injected/PhantomEvm.js +4 -3
  27. package/src/injected/fetchInjectedWalletConnectors.d.ts +0 -1
  28. package/src/walletConnect/fetchWalletConnectWallets.cjs +14 -33
  29. package/src/walletConnect/fetchWalletConnectWallets.d.ts +2 -5
  30. package/src/walletConnect/fetchWalletConnectWallets.js +14 -33
  31. package/src/walletConnect/index.d.ts +1 -2
  32. package/src/walletConnect/walletConnect.cjs +427 -79
  33. package/src/walletConnect/walletConnect.d.ts +309 -28
  34. package/src/walletConnect/walletConnect.js +426 -79
  35. package/src/walletConnect/client/client.cjs +0 -201
  36. package/src/walletConnect/client/client.d.ts +0 -17
  37. package/src/walletConnect/client/client.js +0 -187
  38. package/src/walletConnect/client/index.d.ts +0 -1
  39. package/src/walletConnect/client/types.d.ts +0 -4
  40. package/src/walletConnect/walletConnectV2.cjs +0 -475
  41. package/src/walletConnect/walletConnectV2.d.ts +0 -333
  42. package/src/walletConnect/walletConnectV2.js +0 -466
@@ -7,15 +7,16 @@ class PhantomEvm extends InjectedWalletBase {
7
7
  constructor(props) {
8
8
  super(props);
9
9
  this.name = 'PhantomEvm';
10
+ this.overrideKey = 'phantomevm';
10
11
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
11
12
  }
12
- fetchPublicAddress() {
13
+ getAddress() {
13
14
  const _super = Object.create(null, {
14
- fetchPublicAddress: { get: () => super.fetchPublicAddress }
15
+ getAddress: { get: () => super.getAddress }
15
16
  });
16
17
  return __awaiter(this, void 0, void 0, function* () {
17
18
  if (this.isInstalledOnBrowser()) {
18
- return _super.fetchPublicAddress.call(this);
19
+ return _super.getAddress.call(this);
19
20
  }
20
21
  if (isMobile()) {
21
22
  handleMobileWalletRedirect({
@@ -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 = ({ isWalletConnectV2Enabled, walletBook, }) => {
7
+ const fetchWalletConnectWallets = ({ walletBook, }) => {
9
8
  var _a;
10
- return Object.values((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
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
- // justification: we filtered out null/undefined above
17
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
18
- if (isWalletConnectV2Enabled &&
19
- ((_a = wallet.walletConnect.sdks) === null || _a === void 0 ? void 0 : _a.includes('sign_v2'))) {
20
- return class extends walletConnectV2.WalletConnectV2 {
21
- constructor(props) {
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 = ({ isWalletConnectV2Enabled, }) => isWalletConnectV2Enabled
36
- ? class extends walletConnectV2.WalletConnectV2 {
37
- constructor(props) {
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
- : class extends walletConnect.WalletConnect {
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: ({ isWalletConnectV2Enabled, walletBook, }: {
4
- isWalletConnectV2Enabled: boolean;
3
+ export declare const fetchWalletConnectWallets: ({ walletBook, }: {
5
4
  walletBook: WalletBookSchema;
6
5
  }) => Array<WalletConnectorConstructor>;
7
- export declare const getWalletConnectConnector: ({ isWalletConnectV2Enabled, }: {
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 = ({ isWalletConnectV2Enabled, walletBook, }) => {
3
+ const fetchWalletConnectWallets = ({ walletBook, }) => {
5
4
  var _a;
6
- return Object.values((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
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
- // justification: we filtered out null/undefined above
13
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14
- if (isWalletConnectV2Enabled &&
15
- ((_a = wallet.walletConnect.sdks) === null || _a === void 0 ? void 0 : _a.includes('sign_v2'))) {
16
- return class extends WalletConnectV2 {
17
- constructor(props) {
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 = ({ isWalletConnectV2Enabled, }) => isWalletConnectV2Enabled
32
- ? class extends WalletConnectV2 {
33
- constructor(props) {
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
- : class extends WalletConnect {
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 { WalletConnectV2, type WalletConnectorV2Opts } from './walletConnectV2';
2
- export { WalletConnect } from './walletConnect';
1
+ export { WalletConnect, type WalletConnectOpts } from './walletConnect';
3
2
  export { fetchWalletConnectWallets } from './fetchWalletConnectWallets';