@dynamic-labs/solana 2.1.0-alpha.0 → 2.1.0-alpha.1

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 (38) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/_virtual/_tslib.cjs +1 -0
  3. package/_virtual/_tslib.js +1 -0
  4. package/package.json +10 -10
  5. package/src/CoinbaseSolana.cjs +2 -1
  6. package/src/CoinbaseSolana.js +2 -1
  7. package/src/Phantom.cjs +1 -0
  8. package/src/Phantom.js +1 -0
  9. package/src/Solflare.cjs +3 -2
  10. package/src/Solflare.js +3 -2
  11. package/src/errors/SignMessageNotSupportedError.cjs +1 -0
  12. package/src/errors/SignMessageNotSupportedError.js +1 -0
  13. package/src/index.cjs +1 -0
  14. package/src/index.js +1 -0
  15. package/src/injected/BackpackSol.cjs +2 -1
  16. package/src/injected/BackpackSol.js +2 -1
  17. package/src/injected/InjectedWalletBase.cjs +6 -5
  18. package/src/injected/InjectedWalletBase.js +6 -5
  19. package/src/injected/PhantomInjected.cjs +1 -0
  20. package/src/injected/PhantomInjected.js +1 -0
  21. package/src/injected/fetchInjectedWalletConnectors.cjs +1 -0
  22. package/src/injected/fetchInjectedWalletConnectors.js +1 -0
  23. package/src/phantomRedirect/PhantomRedirect.cjs +2 -1
  24. package/src/phantomRedirect/PhantomRedirect.js +2 -1
  25. package/src/phantomRedirect/storage.cjs +1 -0
  26. package/src/phantomRedirect/storage.js +1 -0
  27. package/src/phantomRedirect/utils.cjs +1 -0
  28. package/src/phantomRedirect/utils.js +1 -0
  29. package/src/solProviderHelper.cjs +4 -3
  30. package/src/solProviderHelper.js +4 -3
  31. package/src/solWalletConnector.cjs +3 -5
  32. package/src/solWalletConnector.js +4 -6
  33. package/src/utils/extractNonce.cjs +1 -0
  34. package/src/utils/extractNonce.js +1 -0
  35. package/src/utils/isBackpackSolanaSigner.cjs +1 -0
  36. package/src/utils/isBackpackSolanaSigner.js +1 -0
  37. package/src/utils/isSignedMessage.cjs +1 -0
  38. package/src/utils/isSignedMessage.js +1 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,25 @@
1
1
 
2
+ ## [2.1.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.0...v2.1.0-alpha.1) (2024-04-18)
3
+
4
+
5
+ ### Features
6
+
7
+ * add frame metadata to demo index page ([#5327](https://github.com/dynamic-labs/DynamicAuth/issues/5327)) ([34a071a](https://github.com/dynamic-labs/DynamicAuth/commit/34a071af8faa8a867ad747ec2a607056a883568d))
8
+ * add MfaChooseDeviceView and MfaSecureDeviceView ([#5343](https://github.com/dynamic-labs/DynamicAuth/issues/5343)) ([4c39b1c](https://github.com/dynamic-labs/DynamicAuth/commit/4c39b1c34b5091190b095770e95a733c8f458ca2)), closes [#5356](https://github.com/dynamic-labs/DynamicAuth/issues/5356)
9
+ * add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([ed13fc2](https://github.com/dynamic-labs/DynamicAuth/commit/ed13fc2948e06df0017ac122db54aca44f264a6d))
10
+ * add useMfa hook ([#5337](https://github.com/dynamic-labs/DynamicAuth/issues/5337)) ([a7682ba](https://github.com/dynamic-labs/DynamicAuth/commit/a7682ba10fd0f0809af802e0172154726f1bd857))
11
+ * headless create session and is session active ([#5346](https://github.com/dynamic-labs/DynamicAuth/issues/5346)) ([a787bbc](https://github.com/dynamic-labs/DynamicAuth/commit/a787bbcbb44104d2d0bd263579bd87a78453681d))
12
+ * secure enclave wallet generate one-time code headless ([#5329](https://github.com/dynamic-labs/DynamicAuth/issues/5329)) ([cab80a2](https://github.com/dynamic-labs/DynamicAuth/commit/cab80a2bfa77e48263d47cdcb813c54ef5b831d5))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * always stringify the message before signing a message using walletUiUtils ([#5325](https://github.com/dynamic-labs/DynamicAuth/issues/5325)) ([7abf094](https://github.com/dynamic-labs/DynamicAuth/commit/7abf09456e30ad0657892e9ba58d7391f0f430e6))
18
+ * bitcoin network connector sendBitcoin methods updates ([#5369](https://github.com/dynamic-labs/DynamicAuth/issues/5369)) ([e9bf444](https://github.com/dynamic-labs/DynamicAuth/commit/e9bf444122ee86030d85b84ede96bdfb9772425e))
19
+ * buffer missing when using buffer util function ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([e998e46](https://github.com/dynamic-labs/DynamicAuth/commit/e998e464bd2671a82aa271b407a7d8fc49a16bd0))
20
+ * embedded solana send transaction shouldn't sign a signed transaction ([#5357](https://github.com/dynamic-labs/DynamicAuth/issues/5357)) ([c2ae2fa](https://github.com/dynamic-labs/DynamicAuth/commit/c2ae2faa509b62fc5ceb345fbc0f0b47217bf4b0))
21
+ * use network.name if vanity name is missing ([#5338](https://github.com/dynamic-labs/DynamicAuth/issues/5338)) ([34ec2ae](https://github.com/dynamic-labs/DynamicAuth/commit/34ec2ae5c4dad5376a3b9c5a07221f68a2f7756c))
22
+
2
23
  ## [2.1.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.32...v2.1.0-alpha.0) (2024-04-15)
3
24
 
4
25
  ## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  /******************************************************************************
2
3
  Copyright (c) Microsoft Corporation.
3
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "2.1.0-alpha.0",
3
+ "version": "2.1.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,17 +26,17 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@solana/web3.js": "1.70.1",
30
- "@dynamic-labs/sdk-api-core": "0.0.418",
29
+ "@solana/web3.js": "1.91.6",
30
+ "@dynamic-labs/sdk-api-core": "0.0.422",
31
31
  "bs58": "5.0.0",
32
32
  "tweetnacl": "1.0.3",
33
- "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.0",
34
- "@dynamic-labs/rpc-providers": "2.1.0-alpha.0",
35
- "@dynamic-labs/turnkey": "2.1.0-alpha.0",
36
- "@dynamic-labs/types": "2.1.0-alpha.0",
37
- "@dynamic-labs/utils": "2.1.0-alpha.0",
38
- "@dynamic-labs/wallet-book": "2.1.0-alpha.0",
39
- "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.0",
33
+ "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.1",
34
+ "@dynamic-labs/rpc-providers": "2.1.0-alpha.1",
35
+ "@dynamic-labs/turnkey": "2.1.0-alpha.1",
36
+ "@dynamic-labs/types": "2.1.0-alpha.1",
37
+ "@dynamic-labs/utils": "2.1.0-alpha.1",
38
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.1",
39
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.1",
40
40
  "eventemitter3": "5.0.1"
41
41
  },
42
42
  "peerDependencies": {}
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -21,8 +22,8 @@ class CoinbaseSolana extends InjectedWalletBase.InjectedWalletBase {
21
22
  this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
22
23
  }
23
24
  getSigner() {
24
- var _a;
25
25
  return _tslib.__awaiter(this, void 0, void 0, function* () {
26
+ var _a;
26
27
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
27
28
  });
28
29
  }
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -17,8 +18,8 @@ class CoinbaseSolana extends InjectedWalletBase {
17
18
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
18
19
  }
19
20
  getSigner() {
20
- var _a;
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
+ var _a;
22
23
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
23
24
  });
24
25
  }
package/src/Phantom.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/Phantom.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
4
  import { isMobile } from '@dynamic-labs/utils';
package/src/Solflare.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -15,8 +16,8 @@ class Solflare extends InjectedWalletBase.InjectedWalletBase {
15
16
  this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
16
17
  }
17
18
  getAddress() {
18
- var _a, _b, _c, _d, _e;
19
19
  return _tslib.__awaiter(this, void 0, void 0, function* () {
20
+ var _a, _b, _c, _d, _e;
20
21
  /**
21
22
  * It should redirect to in-app browser if on mobile and if not in the in-app browser,
22
23
  * this checks if it is not in the in-app browser by checking if the provider is not available.
@@ -58,8 +59,8 @@ class Solflare extends InjectedWalletBase.InjectedWalletBase {
58
59
  });
59
60
  }
60
61
  getConnectedAccounts() {
61
- var _a;
62
62
  return _tslib.__awaiter(this, void 0, void 0, function* () {
63
+ var _a;
63
64
  const provider = this.getProvider();
64
65
  if (!provider)
65
66
  return [];
package/src/Solflare.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { isMobile, handleMobileWalletRedirect, bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -11,8 +12,8 @@ class Solflare extends InjectedWalletBase {
11
12
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
12
13
  }
13
14
  getAddress() {
14
- var _a, _b, _c, _d, _e;
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
+ var _a, _b, _c, _d, _e;
16
17
  /**
17
18
  * It should redirect to in-app browser if on mobile and if not in the in-app browser,
18
19
  * this checks if it is not in the in-app browser by checking if the provider is not available.
@@ -54,8 +55,8 @@ class Solflare extends InjectedWalletBase {
54
55
  });
55
56
  }
56
57
  getConnectedAccounts() {
57
- var _a;
58
58
  return __awaiter(this, void 0, void 0, function* () {
59
+ var _a;
59
60
  const provider = this.getProvider();
60
61
  if (!provider)
61
62
  return [];
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { NotSupportedError } from '@dynamic-labs/utils';
2
3
 
3
4
  class SignMessageNotSupportedError extends NotSupportedError {
package/src/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/turnkey';
2
3
  import { Phantom } from './Phantom.js';
3
4
  import { injectedWalletOverrides, fetchInjectedWalletConnectors } from './injected/fetchInjectedWalletConnectors.js';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -15,8 +16,8 @@ class BackpackSol extends InjectedWalletBase.InjectedWalletBase {
15
16
  this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
16
17
  }
17
18
  getSigner() {
18
- var _a;
19
19
  return _tslib.__awaiter(this, void 0, void 0, function* () {
20
+ var _a;
20
21
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
21
22
  });
22
23
  }
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import { bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -11,8 +12,8 @@ class BackpackSol extends InjectedWalletBase {
11
12
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
12
13
  }
13
14
  getSigner() {
14
- var _a;
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
+ var _a;
16
17
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
17
18
  });
18
19
  }
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -31,14 +32,14 @@ class InjectedWalletBase extends solWalletConnector.SolWalletConnector {
31
32
  (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a._teardownEventListeners();
32
33
  }
33
34
  connect() {
34
- var _a;
35
35
  return _tslib.__awaiter(this, void 0, void 0, function* () {
36
+ var _a;
36
37
  yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect());
37
38
  });
38
39
  }
39
40
  getSigner() {
40
- var _a;
41
41
  return _tslib.__awaiter(this, void 0, void 0, function* () {
42
+ var _a;
42
43
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
43
44
  });
44
45
  }
@@ -47,16 +48,16 @@ class InjectedWalletBase extends solWalletConnector.SolWalletConnector {
47
48
  return Boolean((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.isInstalledHelper());
48
49
  }
49
50
  getAddress() {
50
- var _a;
51
51
  return _tslib.__awaiter(this, void 0, void 0, function* () {
52
+ var _a;
52
53
  if (!this.isInstalledOnBrowser())
53
54
  return;
54
55
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress();
55
56
  });
56
57
  }
57
58
  signMessage(messageToSign) {
58
- var _a, _b;
59
59
  return _tslib.__awaiter(this, void 0, void 0, function* () {
60
+ var _a, _b;
60
61
  const walletAddress = yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress());
61
62
  if (walletAddress && this.isLedgerAddress(walletAddress)) {
62
63
  throw new SignMessageNotSupportedError.SignMessageNotSupportedError(this.name);
@@ -65,8 +66,8 @@ class InjectedWalletBase extends solWalletConnector.SolWalletConnector {
65
66
  });
66
67
  }
67
68
  getConnectedAccounts() {
68
- var _a, _b;
69
69
  return _tslib.__awaiter(this, void 0, void 0, function* () {
70
+ var _a, _b;
70
71
  return (_b = (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getConnectedAccounts()) !== null && _b !== void 0 ? _b : [];
71
72
  });
72
73
  }
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
4
  import { SolProviderHelper } from '../solProviderHelper.js';
@@ -27,14 +28,14 @@ class InjectedWalletBase extends SolWalletConnector {
27
28
  (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a._teardownEventListeners();
28
29
  }
29
30
  connect() {
30
- var _a;
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
+ var _a;
32
33
  yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect());
33
34
  });
34
35
  }
35
36
  getSigner() {
36
- var _a;
37
37
  return __awaiter(this, void 0, void 0, function* () {
38
+ var _a;
38
39
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
39
40
  });
40
41
  }
@@ -43,16 +44,16 @@ class InjectedWalletBase extends SolWalletConnector {
43
44
  return Boolean((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.isInstalledHelper());
44
45
  }
45
46
  getAddress() {
46
- var _a;
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
+ var _a;
48
49
  if (!this.isInstalledOnBrowser())
49
50
  return;
50
51
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress();
51
52
  });
52
53
  }
53
54
  signMessage(messageToSign) {
54
- var _a, _b;
55
55
  return __awaiter(this, void 0, void 0, function* () {
56
+ var _a, _b;
56
57
  const walletAddress = yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress());
57
58
  if (walletAddress && this.isLedgerAddress(walletAddress)) {
58
59
  throw new SignMessageNotSupportedError(this.name);
@@ -61,8 +62,8 @@ class InjectedWalletBase extends SolWalletConnector {
61
62
  });
62
63
  }
63
64
  getConnectedAccounts() {
64
- var _a, _b;
65
65
  return __awaiter(this, void 0, void 0, function* () {
66
+ var _a, _b;
66
67
  return (_b = (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getConnectedAccounts()) !== null && _b !== void 0 ? _b : [];
67
68
  });
68
69
  }
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import { isMobile, handleMobileWalletRedirect } from '@dynamic-labs/utils';
3
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { CoinbaseSolana } from '../CoinbaseSolana.js';
2
3
  import { Solflare } from '../Solflare.js';
3
4
  import { InjectedWalletBase } from './InjectedWalletBase.js';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -35,8 +36,8 @@ class PhantomRedirect extends solWalletConnector.SolWalletConnector {
35
36
  });
36
37
  }
37
38
  connect() {
38
- var _a, _b;
39
39
  return _tslib.__awaiter(this, void 0, void 0, function* () {
40
+ var _a, _b;
40
41
  // Generate a new key pair
41
42
  const keyPair = nacl__default["default"].box.keyPair();
42
43
  storage.storage.encryptionPublicKey.set(keyPair.publicKey);
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import nacl from 'tweetnacl';
3
4
  import bs58 from 'bs58';
@@ -26,8 +27,8 @@ class PhantomRedirect extends SolWalletConnector {
26
27
  });
27
28
  }
28
29
  connect() {
29
- var _a, _b;
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ var _a, _b;
31
32
  // Generate a new key pair
32
33
  const keyPair = nacl.box.keyPair();
33
34
  storage.encryptionPublicKey.set(keyPair.publicKey);
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const storage = {
2
3
  address: {
3
4
  get: () => { var _a; return (_a = localStorage.getItem('dynamic_phantom_wallet_address')) !== null && _a !== void 0 ? _a : undefined; },
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../../_virtual/_tslib.js';
2
3
  import nacl from 'tweetnacl';
3
4
  import bs58 from 'bs58';
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -61,8 +62,8 @@ class SolProviderHelper {
61
62
  return this.findProvider() !== undefined;
62
63
  }
63
64
  getAddress() {
64
- var _a;
65
65
  return _tslib.__awaiter(this, void 0, void 0, function* () {
66
+ var _a;
66
67
  const provider = this.findProvider();
67
68
  if (!provider) {
68
69
  return undefined;
@@ -108,8 +109,8 @@ class SolProviderHelper {
108
109
  });
109
110
  }
110
111
  handleAccountChange(walletConnector, web3Provider, address) {
111
- var _a;
112
112
  return _tslib.__awaiter(this, void 0, void 0, function* () {
113
+ var _a;
113
114
  if (!address) {
114
115
  yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
115
116
  if ((_a = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _a === void 0 ? void 0 : _a.toString()) {
@@ -136,8 +137,8 @@ class SolProviderHelper {
136
137
  provider.removeAllListeners();
137
138
  }
138
139
  getConnectedAccounts() {
139
- var _a, _b;
140
140
  return _tslib.__awaiter(this, void 0, void 0, function* () {
141
+ var _a, _b;
141
142
  const provider = this.findProvider();
142
143
  if (!provider)
143
144
  return [];
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { getProvidersFromWindow, bufferToBase64 } from '@dynamic-labs/utils';
3
4
  import { ProviderLookup } from '@dynamic-labs/wallet-connector-core';
@@ -57,8 +58,8 @@ class SolProviderHelper {
57
58
  return this.findProvider() !== undefined;
58
59
  }
59
60
  getAddress() {
60
- var _a;
61
61
  return __awaiter(this, void 0, void 0, function* () {
62
+ var _a;
62
63
  const provider = this.findProvider();
63
64
  if (!provider) {
64
65
  return undefined;
@@ -104,8 +105,8 @@ class SolProviderHelper {
104
105
  });
105
106
  }
106
107
  handleAccountChange(walletConnector, web3Provider, address) {
107
- var _a;
108
108
  return __awaiter(this, void 0, void 0, function* () {
109
+ var _a;
109
110
  if (!address) {
110
111
  yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
111
112
  if ((_a = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _a === void 0 ? void 0 : _a.toString()) {
@@ -132,8 +133,8 @@ class SolProviderHelper {
132
133
  provider.removeAllListeners();
133
134
  }
134
135
  getConnectedAccounts() {
135
- var _a, _b;
136
136
  return __awaiter(this, void 0, void 0, function* () {
137
+ var _a, _b;
137
138
  const provider = this.findProvider();
138
139
  if (!provider)
139
140
  return [];
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -49,8 +50,8 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
49
50
  return new web3_js.Connection(rpcUrl, 'confirmed');
50
51
  }
51
52
  getPublicClient() {
52
- var _a, _b;
53
53
  return _tslib.__awaiter(this, void 0, void 0, function* () {
54
+ var _a, _b;
54
55
  if (this.solNetworks.length === 0)
55
56
  return;
56
57
  const configurations = {
@@ -152,10 +153,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
152
153
  this.verifiedCredentials = verifiedCredentials;
153
154
  }
154
155
  isLedgerAddress(address) {
155
- const ledgerWallets = this.verifiedCredentials
156
- .filter((v) => { var _a; return ((_a = v.walletProperties) === null || _a === void 0 ? void 0 : _a.hardwareWallet) === 'ledger'; })
157
- .map((v) => v.address);
158
- return ledgerWallets.includes(address);
156
+ return utils.isLedgerAddressViaVerifiedCredentials(address, this.verifiedCredentials);
159
157
  }
160
158
  }
161
159
 
@@ -1,7 +1,8 @@
1
+ 'use client'
1
2
  import { __awaiter } from '../_virtual/_tslib.js';
2
3
  import { PublicKey, Connection, Transaction, TransactionInstruction } from '@solana/web3.js';
3
4
  import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
4
- import { DynamicError, NotSupportedError } from '@dynamic-labs/utils';
5
+ import { DynamicError, NotSupportedError, isLedgerAddressViaVerifiedCredentials } from '@dynamic-labs/utils';
5
6
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
6
7
  import { extractNonce } from './utils/extractNonce.js';
7
8
 
@@ -45,8 +46,8 @@ class SolWalletConnector extends WalletConnectorBase {
45
46
  return new Connection(rpcUrl, 'confirmed');
46
47
  }
47
48
  getPublicClient() {
48
- var _a, _b;
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
+ var _a, _b;
50
51
  if (this.solNetworks.length === 0)
51
52
  return;
52
53
  const configurations = {
@@ -148,10 +149,7 @@ class SolWalletConnector extends WalletConnectorBase {
148
149
  this.verifiedCredentials = verifiedCredentials;
149
150
  }
150
151
  isLedgerAddress(address) {
151
- const ledgerWallets = this.verifiedCredentials
152
- .filter((v) => { var _a; return ((_a = v.walletProperties) === null || _a === void 0 ? void 0 : _a.hardwareWallet) === 'ledger'; })
153
- .map((v) => v.address);
154
- return ledgerWallets.includes(address);
152
+ return isLedgerAddressViaVerifiedCredentials(address, this.verifiedCredentials);
155
153
  }
156
154
  }
157
155
 
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const extractNonce = (messageToSign) => {
2
3
  const regex = messageToSign.match(/Nonce: (.*)/);
3
4
  if (regex && regex.length === 2) {
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const isBackpackSolanaSigner = (signer) => Boolean(signer) && signer.send !== undefined;
2
3
 
3
4
  export { isBackpackSolanaSigner };
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,3 +1,4 @@
1
+ 'use client'
1
2
  const isSignedMessage = (message) => Boolean(message) && message.signature !== undefined;
2
3
 
3
4
  export { isSignedMessage };