@dynamic-labs/wallet-connector-core 4.0.0-alpha.3 → 4.0.0-alpha.31

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 (101) hide show
  1. package/CHANGELOG.md +261 -0
  2. package/package.cjs +8 -0
  3. package/package.js +4 -0
  4. package/package.json +9 -16
  5. package/src/{lib/wallets/Wallet → Wallet}/Wallet.cjs +3 -5
  6. package/src/{lib/wallets/Wallet → Wallet}/Wallet.d.ts +1 -1
  7. package/src/{lib/wallets/Wallet → Wallet}/Wallet.js +3 -5
  8. package/src/{lib → WalletBookSingleton}/WalletBookSingleton.cjs +3 -0
  9. package/src/{lib → WalletBookSingleton}/WalletBookSingleton.d.ts +1 -0
  10. package/src/{lib → WalletBookSingleton}/WalletBookSingleton.js +3 -0
  11. package/src/WalletBookSingleton/index.d.ts +1 -0
  12. package/src/{lib/WalletConnector.cjs → WalletConnectorBase/WalletConnectorBase.cjs} +18 -29
  13. package/src/{lib/WalletConnector.d.ts → WalletConnectorBase/WalletConnectorBase.d.ts} +13 -44
  14. package/src/{lib/WalletConnector.js → WalletConnectorBase/WalletConnectorBase.js} +19 -28
  15. package/src/WalletConnectorBase/index.d.ts +2 -0
  16. package/src/WalletConnectorBase/types.cjs +33 -0
  17. package/src/WalletConnectorBase/types.d.ts +54 -0
  18. package/src/WalletConnectorBase/types.js +28 -0
  19. package/src/events/index.d.ts +1 -0
  20. package/src/events/walletConnectorEvents.cjs +14 -0
  21. package/src/events/walletConnectorEvents.d.ts +26 -0
  22. package/src/events/walletConnectorEvents.js +6 -0
  23. package/src/index.cjs +20 -7
  24. package/src/index.d.ts +7 -4
  25. package/src/index.js +12 -2
  26. package/src/{lib → interfaces}/IAccountAbstractionWalletConnector.d.ts +11 -2
  27. package/src/{lib → interfaces}/IBitcoinWalletConnector.d.ts +1 -1
  28. package/src/{lib → interfaces}/ICoinbaseMPCWalletConnector.d.ts +1 -1
  29. package/src/{lib → interfaces}/IEmailWalletConnector.d.ts +1 -1
  30. package/src/{lib → interfaces}/IHardwareWalletConnector.d.ts +1 -1
  31. package/src/{lib → interfaces}/IPasskeyWalletConnector.d.ts +1 -1
  32. package/src/{lib → interfaces}/IPhantomRedirectConnector.d.ts +1 -1
  33. package/src/{lib → interfaces}/ISMSWalletConnector.d.ts +1 -1
  34. package/src/{lib → interfaces}/ISendBalanceWalletConnector.d.ts +1 -1
  35. package/src/{lib → interfaces}/ISessionKeyCompatibleWalletConnector.d.ts +1 -1
  36. package/src/{lib → interfaces}/ITurnkeyWalletConnector.d.ts +1 -1
  37. package/src/interfaces/ITurnkeyWalletConnectorStamper.d.ts +35 -0
  38. package/src/{lib → interfaces}/IWalletConnectConnector.d.ts +1 -1
  39. package/src/{lib → interfaces}/index.d.ts +7 -10
  40. package/src/types.d.ts +50 -0
  41. package/src/utils/eventListenerHandlers.d.ts +1 -1
  42. package/src/utils/getChainInfo/getChainInfo.cjs +4 -4
  43. package/src/utils/getChainInfo/getChainInfo.d.ts +2 -2
  44. package/src/utils/getChainInfo/getChainInfo.js +4 -4
  45. package/src/utils/getWalletConnectorByKey.d.ts +1 -1
  46. package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/getDeepLinks.cjs +16 -0
  47. package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/getDeepLinks.d.ts +3 -0
  48. package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/getDeepLinks.js +12 -0
  49. package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/index.d.ts +1 -0
  50. package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/getDownloadLinks.cjs +36 -0
  51. package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/getDownloadLinks.d.ts +3 -0
  52. package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/getDownloadLinks.js +32 -0
  53. package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/index.d.ts +1 -0
  54. package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/getIconUrl.cjs +15 -0
  55. package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/getIconUrl.d.ts +1 -0
  56. package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/getIconUrl.js +11 -0
  57. package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/index.d.ts +1 -0
  58. package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/getValidHexColor.cjs +15 -0
  59. package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/getValidHexColor.d.ts +1 -0
  60. package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/getValidHexColor.js +11 -0
  61. package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/index.d.ts +1 -0
  62. package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/getWalletLimitations.cjs +19 -0
  63. package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/getWalletLimitations.d.ts +3 -0
  64. package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/getWalletLimitations.js +15 -0
  65. package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/index.d.ts +1 -0
  66. package/src/utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.cjs +42 -0
  67. package/src/utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.d.ts +10 -0
  68. package/src/utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.js +38 -0
  69. package/src/utils/getWalletMetadataFromWalletBook/index.d.ts +1 -0
  70. package/src/utils/index.d.ts +3 -0
  71. package/src/utils/isAccountAbstractionConnector/isAccountAbstractionConnector.d.ts +1 -1
  72. package/src/utils/isBitcoinConnector/isBitcoinConnector.d.ts +1 -1
  73. package/src/utils/isBloctoConnector/isBloctoConnector.d.ts +1 -1
  74. package/src/utils/isCoinbaseMpcWalletConnector/isCoinbaseMpcWalletConnector.d.ts +1 -1
  75. package/src/utils/isConnectorEventSupported/index.d.ts +1 -0
  76. package/src/utils/isConnectorEventSupported/isConnectorEventSupported.cjs +11 -0
  77. package/src/utils/isConnectorEventSupported/isConnectorEventSupported.d.ts +3 -0
  78. package/src/utils/isConnectorEventSupported/isConnectorEventSupported.js +7 -0
  79. package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.cjs +2 -5
  80. package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.d.ts +3 -3
  81. package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.js +2 -5
  82. package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.d.ts +1 -1
  83. package/src/utils/isEmailWalletConnector/isEmailWalletConnector.d.ts +1 -1
  84. package/src/utils/isEmbeddedConnector/isEmbeddedConnector.d.ts +1 -1
  85. package/src/utils/isHardwareWalletConnector/isHardwareWalletConnector.d.ts +1 -1
  86. package/src/utils/isMagicConnector/isMagicConnector.d.ts +1 -1
  87. package/src/utils/isPasskeyWalletConnector/isPasskeyWalletConnector.d.ts +1 -1
  88. package/src/utils/isPhantomRedirectConnector/isPhantomRedirectConnector.d.ts +1 -1
  89. package/src/utils/isSendBalanceWalletConnector/isSendBalanceWalletConnector.d.ts +2 -2
  90. package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.d.ts +1 -1
  91. package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWalletConnector/isSessionKeyCompatibleWalletConnector.d.ts +2 -2
  92. package/src/utils/isSocialWalletConnector/isSocialWalletConnector.d.ts +1 -1
  93. package/src/utils/isTurnkeyWalletConnector/isTurnkeyWalletConnector.d.ts +1 -1
  94. package/src/utils/isWalletConnectConnector/isWalletConnectConnector.d.ts +1 -1
  95. package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.d.ts +1 -1
  96. package/src/lib/ITurnkeyWalletConnectorStamper.d.ts +0 -18
  97. package/src/lib/WalletConnectorExtension.d.ts +0 -7
  98. package/src/lib/types.d.ts +0 -8
  99. package/src/lib/wallets/index.d.ts +0 -1
  100. /package/src/{lib/wallets/Wallet → Wallet}/index.d.ts +0 -0
  101. /package/src/{lib → interfaces}/IEmailOTPWalletConnector.d.ts +0 -0
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const getDeepLinks = (mobile) => {
7
+ if (!mobile) {
8
+ return;
9
+ }
10
+ return {
11
+ native: mobile.native,
12
+ universal: mobile.universal,
13
+ };
14
+ };
15
+
16
+ exports.getDeepLinks = getDeepLinks;
@@ -0,0 +1,3 @@
1
+ import { WalletSchema } from '@dynamic-labs/wallet-book';
2
+ import { WalletDeepLinks } from '../../../types';
3
+ export declare const getDeepLinks: (mobile?: WalletSchema['mobile']) => WalletDeepLinks | undefined;
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ const getDeepLinks = (mobile) => {
3
+ if (!mobile) {
4
+ return;
5
+ }
6
+ return {
7
+ native: mobile.native,
8
+ universal: mobile.universal,
9
+ };
10
+ };
11
+
12
+ export { getDeepLinks };
@@ -0,0 +1 @@
1
+ export * from './getDeepLinks';
@@ -0,0 +1,36 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const getMobileDownloadLinks = (mobile) => {
7
+ if (!mobile) {
8
+ return;
9
+ }
10
+ return {
11
+ androidId: mobile.androidId,
12
+ iosId: mobile.iosId,
13
+ };
14
+ };
15
+ const getDesktopDownloadLinks = (desktop) => {
16
+ if (!desktop) {
17
+ return;
18
+ }
19
+ return {
20
+ chromeId: desktop.chromeId,
21
+ edgeId: desktop.edgeId,
22
+ firefoxId: desktop.firefoxId,
23
+ operaId: desktop.operaId,
24
+ safariId: desktop.safariId,
25
+ };
26
+ };
27
+ const getDownloadLinks = (wallet) => {
28
+ const mobileLinks = getMobileDownloadLinks(wallet.mobile);
29
+ const desktopLinks = getDesktopDownloadLinks(wallet.desktop);
30
+ if (!mobileLinks && !desktopLinks) {
31
+ return;
32
+ }
33
+ return Object.assign(Object.assign({}, mobileLinks), desktopLinks);
34
+ };
35
+
36
+ exports.getDownloadLinks = getDownloadLinks;
@@ -0,0 +1,3 @@
1
+ import { WalletSchema } from '@dynamic-labs/wallet-book';
2
+ import { WalletDownloadLinks } from '../../../types';
3
+ export declare const getDownloadLinks: (wallet: WalletSchema) => WalletDownloadLinks | undefined;
@@ -0,0 +1,32 @@
1
+ 'use client'
2
+ const getMobileDownloadLinks = (mobile) => {
3
+ if (!mobile) {
4
+ return;
5
+ }
6
+ return {
7
+ androidId: mobile.androidId,
8
+ iosId: mobile.iosId,
9
+ };
10
+ };
11
+ const getDesktopDownloadLinks = (desktop) => {
12
+ if (!desktop) {
13
+ return;
14
+ }
15
+ return {
16
+ chromeId: desktop.chromeId,
17
+ edgeId: desktop.edgeId,
18
+ firefoxId: desktop.firefoxId,
19
+ operaId: desktop.operaId,
20
+ safariId: desktop.safariId,
21
+ };
22
+ };
23
+ const getDownloadLinks = (wallet) => {
24
+ const mobileLinks = getMobileDownloadLinks(wallet.mobile);
25
+ const desktopLinks = getDesktopDownloadLinks(wallet.desktop);
26
+ if (!mobileLinks && !desktopLinks) {
27
+ return;
28
+ }
29
+ return Object.assign(Object.assign({}, mobileLinks), desktopLinks);
30
+ };
31
+
32
+ export { getDownloadLinks };
@@ -0,0 +1 @@
1
+ export * from './getDownloadLinks';
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var walletBook = require('@dynamic-labs/wallet-book');
7
+
8
+ const getIconUrl = (spriteId) => {
9
+ if (!spriteId) {
10
+ return walletBook.renderTemplate('iconicUrl', 'defaultwallet');
11
+ }
12
+ return walletBook.renderTemplate('iconicUrl', spriteId);
13
+ };
14
+
15
+ exports.getIconUrl = getIconUrl;
@@ -0,0 +1 @@
1
+ export declare const getIconUrl: (spriteId?: string) => string | undefined;
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ import { renderTemplate } from '@dynamic-labs/wallet-book';
3
+
4
+ const getIconUrl = (spriteId) => {
5
+ if (!spriteId) {
6
+ return renderTemplate('iconicUrl', 'defaultwallet');
7
+ }
8
+ return renderTemplate('iconicUrl', spriteId);
9
+ };
10
+
11
+ export { getIconUrl };
@@ -0,0 +1 @@
1
+ export * from './getIconUrl';
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const getValidHexColor = (color) => {
7
+ if (!color) {
8
+ return;
9
+ }
10
+ // Check if string starts with # and is followed by either 3 or 6 valid hex characters
11
+ const hexColorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
12
+ return hexColorRegex.test(color) ? color : undefined;
13
+ };
14
+
15
+ exports.getValidHexColor = getValidHexColor;
@@ -0,0 +1 @@
1
+ export declare const getValidHexColor: (color?: string) => `#${string}` | undefined;
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ const getValidHexColor = (color) => {
3
+ if (!color) {
4
+ return;
5
+ }
6
+ // Check if string starts with # and is followed by either 3 or 6 valid hex characters
7
+ const hexColorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
8
+ return hexColorRegex.test(color) ? color : undefined;
9
+ };
10
+
11
+ export { getValidHexColor };
@@ -0,0 +1 @@
1
+ export * from './getValidHexColor';
@@ -0,0 +1,19 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const getWalletLimitations = (walletLimitations) => {
7
+ if (!(walletLimitations === null || walletLimitations === void 0 ? void 0 : walletLimitations.browserExtension)) {
8
+ return;
9
+ }
10
+ const { unsupportedEvents, unsupportedMethods } = walletLimitations.browserExtension;
11
+ return {
12
+ browserExtension: {
13
+ unsupportedEvents: unsupportedEvents,
14
+ unsupportedMethods: unsupportedMethods,
15
+ },
16
+ };
17
+ };
18
+
19
+ exports.getWalletLimitations = getWalletLimitations;
@@ -0,0 +1,3 @@
1
+ import { WalletSchema } from '@dynamic-labs/wallet-book';
2
+ import { WalletLimitations } from '../../../types';
3
+ export declare const getWalletLimitations: (walletLimitations: WalletSchema['walletLimitations']) => WalletLimitations | undefined;
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ const getWalletLimitations = (walletLimitations) => {
3
+ if (!(walletLimitations === null || walletLimitations === void 0 ? void 0 : walletLimitations.browserExtension)) {
4
+ return;
5
+ }
6
+ const { unsupportedEvents, unsupportedMethods } = walletLimitations.browserExtension;
7
+ return {
8
+ browserExtension: {
9
+ unsupportedEvents: unsupportedEvents,
10
+ unsupportedMethods: unsupportedMethods,
11
+ },
12
+ };
13
+ };
14
+
15
+ export { getWalletLimitations };
@@ -0,0 +1 @@
1
+ export * from './getWalletLimitations';
@@ -0,0 +1,42 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var walletBook = require('@dynamic-labs/wallet-book');
7
+ var logger = require('../logger.cjs');
8
+ require('@dynamic-labs/utils');
9
+ require('../../../_virtual/_tslib.cjs');
10
+ var getIconUrl = require('./getIconUrl/getIconUrl.cjs');
11
+ var getValidHexColor = require('./getValidHexColor/getValidHexColor.cjs');
12
+ var getDeepLinks = require('./getDeepLinks/getDeepLinks.cjs');
13
+ var getDownloadLinks = require('./getDownloadLinks/getDownloadLinks.cjs');
14
+ var getWalletLimitations = require('./getWalletLimitations/getWalletLimitations.cjs');
15
+
16
+ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBook: walletBook$1, walletFallback, }) => {
17
+ var _a, _b, _c, _d, _e, _f, _g;
18
+ if (!walletBook$1 && !walletFallback) {
19
+ logger.logger.warn('Wallet book is required');
20
+ return;
21
+ }
22
+ const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : walletBook.getWalletBookWallet(walletBook$1, walletKey, walletFallback);
23
+ // if no walletBookWallet is provided and no wallet is found in the wallet book, throw an error
24
+ if (!wallet) {
25
+ logger.logger.warn('Wallet not found in wallet book');
26
+ return;
27
+ }
28
+ return {
29
+ brandColor: getValidHexColor.getValidHexColor((_a = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _a === void 0 ? void 0 : _a.primaryColor),
30
+ deepLinks: getDeepLinks.getDeepLinks(wallet === null || wallet === void 0 ? void 0 : wallet.mobile),
31
+ downloadLinks: getDownloadLinks.getDownloadLinks(wallet),
32
+ groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
33
+ icon: (_d = getIconUrl.getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
34
+ id: walletKey,
35
+ inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
36
+ name: wallet.name,
37
+ rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
38
+ walletLimitations: getWalletLimitations.getWalletLimitations(wallet.walletLimitations),
39
+ };
40
+ };
41
+
42
+ exports.getWalletMetadataFromWalletBook = getWalletMetadataFromWalletBook;
@@ -0,0 +1,10 @@
1
+ import { WalletBookSchema, WalletSchema } from '@dynamic-labs/wallet-book';
2
+ import { WalletMetadata } from '../../types';
3
+ type GetWalletMetadataFromWalletBookOpts = {
4
+ walletKey: string;
5
+ walletBookWallet?: WalletSchema;
6
+ walletBook?: WalletBookSchema;
7
+ walletFallback?: WalletSchema;
8
+ };
9
+ export declare const getWalletMetadataFromWalletBook: ({ walletKey, walletBookWallet, walletBook, walletFallback, }: GetWalletMetadataFromWalletBookOpts) => WalletMetadata | undefined;
10
+ export {};
@@ -0,0 +1,38 @@
1
+ 'use client'
2
+ import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
3
+ import { logger } from '../logger.js';
4
+ import '@dynamic-labs/utils';
5
+ import '../../../_virtual/_tslib.js';
6
+ import { getIconUrl } from './getIconUrl/getIconUrl.js';
7
+ import { getValidHexColor } from './getValidHexColor/getValidHexColor.js';
8
+ import { getDeepLinks } from './getDeepLinks/getDeepLinks.js';
9
+ import { getDownloadLinks } from './getDownloadLinks/getDownloadLinks.js';
10
+ import { getWalletLimitations } from './getWalletLimitations/getWalletLimitations.js';
11
+
12
+ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBook, walletFallback, }) => {
13
+ var _a, _b, _c, _d, _e, _f, _g;
14
+ if (!walletBook && !walletFallback) {
15
+ logger.warn('Wallet book is required');
16
+ return;
17
+ }
18
+ const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : getWalletBookWallet(walletBook, walletKey, walletFallback);
19
+ // if no walletBookWallet is provided and no wallet is found in the wallet book, throw an error
20
+ if (!wallet) {
21
+ logger.warn('Wallet not found in wallet book');
22
+ return;
23
+ }
24
+ return {
25
+ brandColor: getValidHexColor((_a = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _a === void 0 ? void 0 : _a.primaryColor),
26
+ deepLinks: getDeepLinks(wallet === null || wallet === void 0 ? void 0 : wallet.mobile),
27
+ downloadLinks: getDownloadLinks(wallet),
28
+ groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
29
+ icon: (_d = getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
30
+ id: walletKey,
31
+ inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
32
+ name: wallet.name,
33
+ rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
34
+ walletLimitations: getWalletLimitations(wallet.walletLimitations),
35
+ };
36
+ };
37
+
38
+ export { getWalletMetadataFromWalletBook };
@@ -0,0 +1 @@
1
+ export * from './getWalletMetadataFromWalletBook';
@@ -26,3 +26,6 @@ export * from './isWalletConnectConnector';
26
26
  export * from './isSendBalanceWalletConnector';
27
27
  export * from './isSessionKeyCompatible';
28
28
  export * from './getMobileExperience';
29
+ export * from './getWalletMetadataFromWalletBook';
30
+ export * from './isConnectorMethodSupported';
31
+ export * from './isConnectorEventSupported';
@@ -1,2 +1,2 @@
1
- import { IAccountAbstractionWalletConnector } from '../../lib';
1
+ import { IAccountAbstractionWalletConnector } from '../..';
2
2
  export declare const isAccountAbstractionConnector: (walletConnector: IAccountAbstractionWalletConnector | unknown) => walletConnector is IAccountAbstractionWalletConnector;
@@ -1,2 +1,2 @@
1
- import { IBitcoinWalletConnector, WalletConnector } from '../../lib';
1
+ import { IBitcoinWalletConnector, WalletConnector } from '../..';
2
2
  export declare const isBitcoinConnector: (connector: WalletConnector | IBitcoinWalletConnector) => connector is IBitcoinWalletConnector;
@@ -1,2 +1,2 @@
1
- import { WalletConnector } from '../../lib';
1
+ import { WalletConnector } from '../..';
2
2
  export declare const isBloctoConnector: (connector: WalletConnector) => boolean;
@@ -1,2 +1,2 @@
1
- import { ICoinbaseMPCWalletConnector, WalletConnector } from '../../lib';
1
+ import { ICoinbaseMPCWalletConnector, WalletConnector } from '../..';
2
2
  export declare const isCoinbaseMpcWalletConnector: (connector?: WalletConnector | ICoinbaseMPCWalletConnector) => connector is ICoinbaseMPCWalletConnector;
@@ -0,0 +1 @@
1
+ export { isConnectorEventSupported } from './isConnectorEventSupported';
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const isConnectorEventSupported = (connector, event, platform) => {
7
+ var _a, _b, _c;
8
+ return !((_c = (_b = (_a = connector.metadata.walletLimitations) === null || _a === void 0 ? void 0 : _a[platform]) === null || _b === void 0 ? void 0 : _b.unsupportedEvents) === null || _c === void 0 ? void 0 : _c.includes(event));
9
+ };
10
+
11
+ exports.isConnectorEventSupported = isConnectorEventSupported;
@@ -0,0 +1,3 @@
1
+ import { WalletLimitations, WalletEvent } from '../../types';
2
+ import { InternalWalletConnector } from '../../WalletConnectorBase';
3
+ export declare const isConnectorEventSupported: (connector: InternalWalletConnector, event: WalletEvent, platform: keyof NonNullable<WalletLimitations>) => boolean;
@@ -0,0 +1,7 @@
1
+ 'use client'
2
+ const isConnectorEventSupported = (connector, event, platform) => {
3
+ var _a, _b, _c;
4
+ return !((_c = (_b = (_a = connector.metadata.walletLimitations) === null || _a === void 0 ? void 0 : _a[platform]) === null || _b === void 0 ? void 0 : _b.unsupportedEvents) === null || _c === void 0 ? void 0 : _c.includes(event));
5
+ };
6
+
7
+ export { isConnectorEventSupported };
@@ -3,12 +3,9 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var walletBook = require('@dynamic-labs/wallet-book');
7
-
8
6
  const isConnectorMethodSupported = (connector, method, platform) => {
9
- const walletBookWallet = connector.constructorProps.walletData ||
10
- walletBook.getWalletBookWallet(connector.walletBook, connector.key);
11
- return walletBook.isWalletMethodSupported(walletBookWallet, method, platform);
7
+ var _a, _b, _c;
8
+ return !((_c = (_b = (_a = connector.metadata.walletLimitations) === null || _a === void 0 ? void 0 : _a[platform]) === null || _b === void 0 ? void 0 : _b.unsupportedMethods) === null || _c === void 0 ? void 0 : _c.includes(method));
12
9
  };
13
10
 
14
11
  exports.isConnectorMethodSupported = isConnectorMethodSupported;
@@ -1,3 +1,3 @@
1
- import { WalletSchema } from '@dynamic-labs/wallet-book';
2
- import { InternalWalletConnector } from '../../lib';
3
- export declare const isConnectorMethodSupported: (connector: InternalWalletConnector, method: string, platform: keyof NonNullable<WalletSchema['walletLimitations']>) => boolean;
1
+ import { InternalWalletConnector } from '../..';
2
+ import { WalletLimitations, WalletMethod } from '../../types';
3
+ export declare const isConnectorMethodSupported: (connector: InternalWalletConnector, method: WalletMethod, platform: keyof NonNullable<WalletLimitations>) => boolean;
@@ -1,10 +1,7 @@
1
1
  'use client'
2
- import { getWalletBookWallet, isWalletMethodSupported } from '@dynamic-labs/wallet-book';
3
-
4
2
  const isConnectorMethodSupported = (connector, method, platform) => {
5
- const walletBookWallet = connector.constructorProps.walletData ||
6
- getWalletBookWallet(connector.walletBook, connector.key);
7
- return isWalletMethodSupported(walletBookWallet, method, platform);
3
+ var _a, _b, _c;
4
+ return !((_c = (_b = (_a = connector.metadata.walletLimitations) === null || _a === void 0 ? void 0 : _a[platform]) === null || _b === void 0 ? void 0 : _b.unsupportedMethods) === null || _c === void 0 ? void 0 : _c.includes(method));
8
5
  };
9
6
 
10
7
  export { isConnectorMethodSupported };
@@ -1,2 +1,2 @@
1
- import { IEmailOTPWalletConnector, WalletConnector } from '../../lib';
1
+ import { IEmailOTPWalletConnector, WalletConnector } from '../..';
2
2
  export declare const isEmailOTPWalletConnector: (walletConnector: WalletConnector | IEmailOTPWalletConnector) => walletConnector is IEmailOTPWalletConnector;
@@ -1,2 +1,2 @@
1
- import { WalletConnector, IEmailWalletConnector } from '../../lib';
1
+ import { WalletConnector, IEmailWalletConnector } from '../..';
2
2
  export declare const isEmailWalletConnector: (walletConnector: WalletConnector | IEmailWalletConnector) => walletConnector is IEmailWalletConnector;
@@ -1,2 +1,2 @@
1
- import { WalletConnector } from '../../lib';
1
+ import { WalletConnector } from '../..';
2
2
  export declare const isEmbeddedConnector: (connector: WalletConnector) => boolean;
@@ -1,2 +1,2 @@
1
- import { IHardwareWalletConnector, WalletConnector } from '../../lib';
1
+ import { IHardwareWalletConnector, WalletConnector } from '../..';
2
2
  export declare const isHardwareWalletConnector: (connector: WalletConnector | IHardwareWalletConnector) => connector is IHardwareWalletConnector;
@@ -1,2 +1,2 @@
1
- import { WalletConnector } from '../../lib';
1
+ import { WalletConnector } from '../..';
2
2
  export declare const isMagicConnector: (connector: WalletConnector) => boolean;
@@ -1,2 +1,2 @@
1
- import { WalletConnector, IPasskeyWalletConnector } from '../../lib';
1
+ import { WalletConnector, IPasskeyWalletConnector } from '../..';
2
2
  export declare const isPasskeyWalletConnector: (walletConnector: WalletConnector | IPasskeyWalletConnector) => walletConnector is IPasskeyWalletConnector;
@@ -1,2 +1,2 @@
1
- import { IPhantomRedirectConnectorWithEvents } from '../../lib';
1
+ import { IPhantomRedirectConnectorWithEvents } from '../..';
2
2
  export declare const isPhantomRedirectConnector: (connector: unknown) => connector is IPhantomRedirectConnectorWithEvents;
@@ -1,3 +1,3 @@
1
- import { WalletConnector } from '../../lib';
2
- import { ISendBalanceWalletConnector } from '../../lib/ISendBalanceWalletConnector';
1
+ import { WalletConnector } from '../..';
2
+ import { ISendBalanceWalletConnector } from '../../interfaces/ISendBalanceWalletConnector';
3
3
  export declare const isSendBalanceWalletConnector: (walletConnector: WalletConnector | ISendBalanceWalletConnector) => walletConnector is ISendBalanceWalletConnector;
@@ -1,2 +1,2 @@
1
- import { Wallet } from '../../../lib/wallets/Wallet';
1
+ import { Wallet } from '../../../Wallet';
2
2
  export declare const isSessionKeyCompatibleWallet: (wallet: Wallet) => boolean;
@@ -1,3 +1,3 @@
1
- import { ISessionKeyCompatibleWalletConnector } from '../../../lib/ISessionKeyCompatibleWalletConnector';
2
- import { WalletConnector } from '../../../lib/WalletConnector';
1
+ import { ISessionKeyCompatibleWalletConnector } from '../../../interfaces/ISessionKeyCompatibleWalletConnector';
2
+ import { WalletConnector } from '../../../WalletConnectorBase';
3
3
  export declare const isSessionKeyCompatibleWalletConnector: (walletConnector: WalletConnector | ISessionKeyCompatibleWalletConnector | undefined | null) => walletConnector is ISessionKeyCompatibleWalletConnector;
@@ -1,2 +1,2 @@
1
- import { WalletConnector } from '../../lib';
1
+ import { WalletConnector } from '../..';
2
2
  export declare const isSocialWalletConnector: (walletConnector: WalletConnector) => boolean;
@@ -1,2 +1,2 @@
1
- import { WalletConnector, ITurnkeyWalletConnector } from '../../lib';
1
+ import { WalletConnector, ITurnkeyWalletConnector } from '../..';
2
2
  export declare const isTurnkeyWalletConnector: (walletConnector: WalletConnector) => walletConnector is ITurnkeyWalletConnector;
@@ -1,2 +1,2 @@
1
- import { IWalletConnectConnector, WalletConnector } from '../../lib';
1
+ import { IWalletConnectConnector, WalletConnector } from '../..';
2
2
  export declare const isWalletConnectConnector: (connector?: WalletConnector) => connector is IWalletConnectConnector;
@@ -1,4 +1,4 @@
1
1
  import type { WalletSchema } from '@dynamic-labs/wallet-book';
2
- import type { GetAddressOpts } from '../../lib';
2
+ import type { GetAddressOpts } from '../..';
3
3
  import { DeepLinkVariant } from './walletConnectDeepLinks';
4
4
  export declare const performPlatformSpecificConnectionMethod: (uri: string, metadata: WalletSchema, opts: Pick<GetAddressOpts, 'onDesktopUri' | 'onDisplayUri'>, preference: DeepLinkVariant) => void;
@@ -1,18 +0,0 @@
1
- import { WalletConnectorBase } from './WalletConnector';
2
- export interface ITurnkeyWalletConnectorStamper extends WalletConnectorBase {
3
- stampCreateWalletAccountRequest: ({ request, }: {
4
- request: {
5
- type: string;
6
- timestampMs: string;
7
- organizationId: string;
8
- parameters: any;
9
- };
10
- }) => Promise<{
11
- body: string;
12
- url: string;
13
- stamp: {
14
- stampHeaderName: string;
15
- stampHeaderValue: string;
16
- };
17
- }>;
18
- }
@@ -1,7 +0,0 @@
1
- import { InternalWalletConnector } from '.';
2
- export interface WalletConnectorExtension {
3
- extend(connector: InternalWalletConnector, settings?: {
4
- walletConnectDappProjectId?: string;
5
- }): void;
6
- name: string;
7
- }
@@ -1,8 +0,0 @@
1
- import { Chain } from './WalletConnector';
2
- export type ChainInfo = {
3
- blockchainName: string;
4
- displayName: string;
5
- name: string;
6
- symbol: Chain;
7
- };
8
- export declare namespace WalletConnectorCore { }
@@ -1 +0,0 @@
1
- export * from './Wallet';
File without changes