@dynamic-labs/solana 3.0.0-alpha.0 → 3.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 CHANGED
@@ -1,4 +1,142 @@
1
1
 
2
+ ## [3.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-06-24)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * clear expiresAt from local storage on logout ([#6110](https://github.com/dynamic-labs/DynamicAuth/issues/6110)) ([cbda893](https://github.com/dynamic-labs/DynamicAuth/commit/cbda893441154b6880a5419ce62a353b80f05e55))
8
+ * show SOL amount for complex transactions and better error display ([#6068](https://github.com/dynamic-labs/DynamicAuth/issues/6068)) ([454a3a0](https://github.com/dynamic-labs/DynamicAuth/commit/454a3a0a50805b3d63f44c2ef8c1dc766617eb2b))
9
+
10
+ ## [3.0.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-06-21)
11
+
12
+ ## [3.0.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-06-21)
13
+
14
+
15
+ ### ⚠ BREAKING CHANGES
16
+
17
+ * break out turnkey package into 3 separate packages (#6015)
18
+
19
+ ### Features
20
+
21
+ * add reinitialize hook ([#6098](https://github.com/dynamic-labs/DynamicAuth/issues/6098)) ([d978baa](https://github.com/dynamic-labs/DynamicAuth/commit/d978baa404d34064c36cc549229b1fcea1f20df0))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * always reconnect the wallet provider when calling getAddress ([#6097](https://github.com/dynamic-labs/DynamicAuth/issues/6097)) ([0f3d497](https://github.com/dynamic-labs/DynamicAuth/commit/0f3d497cedb38239fa9ada2bb25c6b4eaa72d7b1))
27
+ * break out turnkey package into 3 separate packages ([#6015](https://github.com/dynamic-labs/DynamicAuth/issues/6015)) ([a86fbef](https://github.com/dynamic-labs/DynamicAuth/commit/a86fbefe97558363b085e6f752af32d2943f91fa)), closes [#6017](https://github.com/dynamic-labs/DynamicAuth/issues/6017) [#6059](https://github.com/dynamic-labs/DynamicAuth/issues/6059)
28
+ * set latest blockhash on solana transactions if tx confirmation ui is disabled ([#6102](https://github.com/dynamic-labs/DynamicAuth/issues/6102)) ([b8035a3](https://github.com/dynamic-labs/DynamicAuth/commit/b8035a328e47409bf0416d3a01b2f17914488748))
29
+ * silently query unisat accounts ([#6101](https://github.com/dynamic-labs/DynamicAuth/issues/6101)) ([#6104](https://github.com/dynamic-labs/DynamicAuth/issues/6104)) ([643e704](https://github.com/dynamic-labs/DynamicAuth/commit/643e7048ff8610b31e6397e10b160ad456a45d11))
30
+ * stop querying magiceden solana accounts ([#6103](https://github.com/dynamic-labs/DynamicAuth/issues/6103)) ([#6108](https://github.com/dynamic-labs/DynamicAuth/issues/6108)) ([3cfdbc3](https://github.com/dynamic-labs/DynamicAuth/commit/3cfdbc3bc82bfe9bf53bf4236f7892a5440fcb86))
31
+ * trigger sign when linking an already linked unknown wallet ([#6105](https://github.com/dynamic-labs/DynamicAuth/issues/6105)) ([9e9c03b](https://github.com/dynamic-labs/DynamicAuth/commit/9e9c03bf615991c4f1183bf85c4d75c9a7773c85))
32
+
33
+ ## [3.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-06-19)
34
+
35
+
36
+ ### ⚠ BREAKING CHANGES
37
+
38
+ * add selectedTabIndex and helpers (#6040)
39
+
40
+ ### Features
41
+
42
+ * add selectedTabIndex and helpers ([#6040](https://github.com/dynamic-labs/DynamicAuth/issues/6040)) ([ae20b80](https://github.com/dynamic-labs/DynamicAuth/commit/ae20b8081376dce97b18fa69c81c9ab73c1ff317))
43
+ * add useRefreshUser to trigger a user state refresh ([#6079](https://github.com/dynamic-labs/DynamicAuth/issues/6079)) ([1236d35](https://github.com/dynamic-labs/DynamicAuth/commit/1236d35fe9fab44ed2114ad9f3c8c6dca7ec27be))
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * always return userWallets when available ([#6080](https://github.com/dynamic-labs/DynamicAuth/issues/6080)) ([#6083](https://github.com/dynamic-labs/DynamicAuth/issues/6083)) ([11992d2](https://github.com/dynamic-labs/DynamicAuth/commit/11992d2af5a401ba4ff1dc6904e2a9f8ef5904ca))
49
+ * less solana rpc calls and improve fee fetching ([#6019](https://github.com/dynamic-labs/DynamicAuth/issues/6019)) ([e2609db](https://github.com/dynamic-labs/DynamicAuth/commit/e2609db962c7708ff5b127cb23260a25bc5032e3))
50
+ * make account change idemopotent ([#6061](https://github.com/dynamic-labs/DynamicAuth/issues/6061)) ([8c87513](https://github.com/dynamic-labs/DynamicAuth/commit/8c8751390ea14888c4889679895e2f06d75717b9))
51
+ * only run multi wallet prompt when user profile or auth flow are open ([#6073](https://github.com/dynamic-labs/DynamicAuth/issues/6073)) ([d48ca10](https://github.com/dynamic-labs/DynamicAuth/commit/d48ca105359018457a78588fd8d9aa8a91583a02))
52
+ * recompute multiwallet state after merging accounts ([#6078](https://github.com/dynamic-labs/DynamicAuth/issues/6078)) ([e08a274](https://github.com/dynamic-labs/DynamicAuth/commit/e08a274c4d848f2a8360be7106cfbfa00b9a8f9b))
53
+ * stop querying okx for accounts while locked ([#6081](https://github.com/dynamic-labs/DynamicAuth/issues/6081)) ([#6084](https://github.com/dynamic-labs/DynamicAuth/issues/6084)) ([34365ac](https://github.com/dynamic-labs/DynamicAuth/commit/34365ac1981fe020b03e666c24535a247645d2ad))
54
+ * update copy for primary wallet not connected modal ([#6069](https://github.com/dynamic-labs/DynamicAuth/issues/6069)) ([4a3f43c](https://github.com/dynamic-labs/DynamicAuth/commit/4a3f43ce5585983f7fea0c5b97e812c0ade80e2c))
55
+
56
+ ## [3.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-06-18)
57
+
58
+
59
+ ### Features
60
+
61
+ * implement useExternalAuth hook to signin using external jwt auth ([#6039](https://github.com/dynamic-labs/DynamicAuth/issues/6039)) ([ba90908](https://github.com/dynamic-labs/DynamicAuth/commit/ba90908509ec21f708a4a0782a7f94861fc3b484))
62
+
63
+
64
+ ### Bug Fixes
65
+
66
+ * allow sign-in with different ME BTC wallet after initial connection ([a527b46](https://github.com/dynamic-labs/DynamicAuth/commit/a527b464f321b4fc27730f57c3812e996b5ed878))
67
+ * close sign modal when signing in with a wallet when embedded wallet is enabled ([#6013](https://github.com/dynamic-labs/DynamicAuth/issues/6013)) ([0f4f3c8](https://github.com/dynamic-labs/DynamicAuth/commit/0f4f3c83db162f7a1794a3549b60bbad6b03e2c0))
68
+ * custom network without a valid icon should still display its name in network picker ([#6018](https://github.com/dynamic-labs/DynamicAuth/issues/6018)) ([0b10df6](https://github.com/dynamic-labs/DynamicAuth/commit/0b10df68950bfc9b8492443158a6bb030dc1122c))
69
+ * e2e: remove page pause ([#6045](https://github.com/dynamic-labs/DynamicAuth/issues/6045)) ([55bba00](https://github.com/dynamic-labs/DynamicAuth/commit/55bba0034255055d6ae266b1296542f47ed48e2b))
70
+ * more fixes for connect starknet button ([#6046](https://github.com/dynamic-labs/DynamicAuth/issues/6046)) ([0fb570a](https://github.com/dynamic-labs/DynamicAuth/commit/0fb570a44e65f8dd6d4d2bf5edb2ee54985ec9d4))
71
+ * set verified credentials on embedded wallet creation ([#6044](https://github.com/dynamic-labs/DynamicAuth/issues/6044)) ([b52a96d](https://github.com/dynamic-labs/DynamicAuth/commit/b52a96d321e7efdb30dce9cdb3f6f176c24ceb81))
72
+
73
+ ## [3.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-06-14)
74
+
75
+
76
+ ### ⚠ BREAKING CHANGES
77
+
78
+ * remove viem dependency from non-evm packages (#5508)
79
+ * move rpc providers into their own packages (#5981)
80
+
81
+ ### Features
82
+
83
+ * add in-app browser navigation support for sats-connect ([#5988](https://github.com/dynamic-labs/DynamicAuth/issues/5988)) ([be27d2d](https://github.com/dynamic-labs/DynamicAuth/commit/be27d2d4030bbe2157e879497d8e6a00b4a3e404))
84
+ * move rpc providers into their own packages ([#5981](https://github.com/dynamic-labs/DynamicAuth/issues/5981)) ([d7a62d6](https://github.com/dynamic-labs/DynamicAuth/commit/d7a62d60e79dfa6d6651b0fa103e90b6f8a9ccf3))
85
+
86
+
87
+ ### Bug Fixes
88
+
89
+ * embedded solana wallets can send SPL tokens and estimate gas ([#5982](https://github.com/dynamic-labs/DynamicAuth/issues/5982)) ([36623eb](https://github.com/dynamic-labs/DynamicAuth/commit/36623eb99d1d1dfebfd8b6f3194eeff31e7de2bf))
90
+ * improve logic related to turnkey and emailVerifcation ([#5946](https://github.com/dynamic-labs/DynamicAuth/issues/5946)) ([dd0b2dc](https://github.com/dynamic-labs/DynamicAuth/commit/dd0b2dc6d93a8bbbcb6eef88732e62b747005bb3))
91
+ * show linked wallets with unavailable providers in user wallets list ([#5992](https://github.com/dynamic-labs/DynamicAuth/issues/5992)) ([996079c](https://github.com/dynamic-labs/DynamicAuth/commit/996079ced360651c7b1eb5273548e0548f6f9f3a))
92
+ * switch network modal not closing after switching to a supported network ([#5979](https://github.com/dynamic-labs/DynamicAuth/issues/5979)) ([f239952](https://github.com/dynamic-labs/DynamicAuth/commit/f2399523dd82bb28046992cac4582688b688bdc0))
93
+
94
+
95
+ * remove viem dependency from non-evm packages ([#5508](https://github.com/dynamic-labs/DynamicAuth/issues/5508)) ([0299dc3](https://github.com/dynamic-labs/DynamicAuth/commit/0299dc3cbb611182d763e9a89d1270c2e2f32df5))
96
+
97
+ ## [3.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-06-12)
98
+
99
+
100
+ ### Bug Fixes
101
+
102
+ * cache getGenesisHash call to prevent over calling ([#5966](https://github.com/dynamic-labs/DynamicAuth/issues/5966)) ([b4d542f](https://github.com/dynamic-labs/DynamicAuth/commit/b4d542f0a85f5ba8c5b8f02f287caee45b4b6feb))
103
+ * handle raw messages in embedded wallet sign message modal ([#5815](https://github.com/dynamic-labs/DynamicAuth/issues/5815)) ([9adc289](https://github.com/dynamic-labs/DynamicAuth/commit/9adc28993b57c1c7f03c4ce6d500288dcf60881e))
104
+
105
+ ## [3.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-06-11)
106
+
107
+
108
+ ### Bug Fixes
109
+
110
+ * only navigate to mfa backup codes when needed ([#5965](https://github.com/dynamic-labs/DynamicAuth/issues/5965)) ([edc462f](https://github.com/dynamic-labs/DynamicAuth/commit/edc462f20768885db1883a2c8d005e07044092d5))
111
+
112
+ ## [3.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-06-11)
113
+
114
+
115
+ ### Features
116
+
117
+ * add silent signing ([#5712](https://github.com/dynamic-labs/DynamicAuth/issues/5712)) ([17f06f2](https://github.com/dynamic-labs/DynamicAuth/commit/17f06f24d9f576b4d3d879e14de73dc6e9ab2118)), closes [#5807](https://github.com/dynamic-labs/DynamicAuth/issues/5807) [#5908](https://github.com/dynamic-labs/DynamicAuth/issues/5908) [#5932](https://github.com/dynamic-labs/DynamicAuth/issues/5932) [#5937](https://github.com/dynamic-labs/DynamicAuth/issues/5937) [#5949](https://github.com/dynamic-labs/DynamicAuth/issues/5949)
118
+
119
+
120
+ ### Bug Fixes
121
+
122
+ * ensure backup code acknowledgement can be shown async ([#5955](https://github.com/dynamic-labs/DynamicAuth/issues/5955)) ([6e4d053](https://github.com/dynamic-labs/DynamicAuth/commit/6e4d0536f4d5eafc93fc6986d3ad8dc66bccd143))
123
+ * ensure sign message will not show 2 times ([#5938](https://github.com/dynamic-labs/DynamicAuth/issues/5938)) ([8b5a16b](https://github.com/dynamic-labs/DynamicAuth/commit/8b5a16bab201ff0a74d6f5065d454ba62131a761))
124
+ * process undefined in browser context ([#5920](https://github.com/dynamic-labs/DynamicAuth/issues/5920)) ([02fed81](https://github.com/dynamic-labs/DynamicAuth/commit/02fed811c53f7d14c91aab47d0b69ea2697619a7))
125
+
126
+ ## [3.0.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-06-10)
127
+
128
+
129
+ ### Features
130
+
131
+ * hide wallets from wallet list that can't have multiple accounts linked ([#5892](https://github.com/dynamic-labs/DynamicAuth/issues/5892)) ([41f0114](https://github.com/dynamic-labs/DynamicAuth/commit/41f0114633dfdc3f0c27e1859da122e5c96e297d))
132
+ * update mfa backup code acknowledgement ([#5874](https://github.com/dynamic-labs/DynamicAuth/issues/5874)) ([4dea5e4](https://github.com/dynamic-labs/DynamicAuth/commit/4dea5e401c468d830f881bf5268055160a9cfa83))
133
+
134
+
135
+ ### Bug Fixes
136
+
137
+ * init coinbase provider adhoc ([#5907](https://github.com/dynamic-labs/DynamicAuth/issues/5907)) ([f778d97](https://github.com/dynamic-labs/DynamicAuth/commit/f778d974d5e70ac72abe70030cad2b76583e1581))
138
+ * versioned tx needs address lookup table ([#5909](https://github.com/dynamic-labs/DynamicAuth/issues/5909)) ([3daf0bc](https://github.com/dynamic-labs/DynamicAuth/commit/3daf0bc45c19c532a519031a813942df0e929107))
139
+
2
140
  ## [3.0.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.0-alpha.5...v3.0.0-alpha.0) (2024-06-10)
3
141
 
4
142
  ## [2.2.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.0-alpha.4...v2.2.0-alpha.5) (2024-06-08)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -27,20 +27,20 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@solana/web3.js": "1.92.1",
30
- "@dynamic-labs/sdk-api-core": "0.0.460",
30
+ "@dynamic-labs/sdk-api-core": "0.0.470",
31
31
  "@wallet-standard/app": "1.0.1",
32
32
  "@wallet-standard/base": "1.0.1",
33
33
  "@wallet-standard/features": "1.0.3",
34
34
  "@wallet-standard/experimental-features": "0.1.1",
35
35
  "bs58": "5.0.0",
36
36
  "tweetnacl": "1.0.3",
37
- "@dynamic-labs/rpc-provider-solana": "3.0.0-alpha.0",
38
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.0",
39
- "@dynamic-labs/turnkey": "3.0.0-alpha.0",
40
- "@dynamic-labs/types": "3.0.0-alpha.0",
41
- "@dynamic-labs/utils": "3.0.0-alpha.0",
42
- "@dynamic-labs/wallet-book": "3.0.0-alpha.0",
43
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.0",
37
+ "@dynamic-labs/embedded-wallet-solana": "3.0.0-alpha.10",
38
+ "@dynamic-labs/rpc-provider-solana": "3.0.0-alpha.10",
39
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.10",
40
+ "@dynamic-labs/types": "3.0.0-alpha.10",
41
+ "@dynamic-labs/utils": "3.0.0-alpha.10",
42
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.10",
43
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.10",
44
44
  "eventemitter3": "5.0.1"
45
45
  },
46
46
  "peerDependencies": {}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var _tslib = require('../_virtual/_tslib.cjs');
7
7
  var utils = require('@dynamic-labs/utils');
8
8
  var walletBook = require('@dynamic-labs/wallet-book');
9
- require('@dynamic-labs/turnkey');
9
+ require('@dynamic-labs/embedded-wallet-solana');
10
10
  require('./solWalletConnector.cjs');
11
11
  require('tweetnacl');
12
12
  require('bs58');
@@ -2,7 +2,7 @@
2
2
  import { __awaiter } from '../_virtual/_tslib.js';
3
3
  import { bufferToBase64 } from '@dynamic-labs/utils';
4
4
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
5
- import '@dynamic-labs/turnkey';
5
+ import '@dynamic-labs/embedded-wallet-solana';
6
6
  import './solWalletConnector.js';
7
7
  import 'tweetnacl';
8
8
  import 'bs58';
@@ -0,0 +1,8 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const SOLANA_GENESIS_HASH = 'genesis-hash';
7
+
8
+ exports.SOLANA_GENESIS_HASH = SOLANA_GENESIS_HASH;
@@ -0,0 +1 @@
1
+ export declare const SOLANA_GENESIS_HASH = "genesis-hash";
@@ -0,0 +1,4 @@
1
+ 'use client'
2
+ const SOLANA_GENESIS_HASH = 'genesis-hash';
3
+
4
+ export { SOLANA_GENESIS_HASH };
package/src/index.cjs CHANGED
@@ -3,10 +3,11 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var turnkey = require('@dynamic-labs/turnkey');
6
+ var embeddedWalletSolana = require('@dynamic-labs/embedded-wallet-solana');
7
7
  var Phantom = require('./Phantom.cjs');
8
8
  var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
9
9
  var UnknownInjected = require('./injected/UnknownInjected.cjs');
10
+ var FallbackSolanaConnector = require('./injected/FallbackSolanaConnector.cjs');
10
11
  var isSignedMessage = require('./utils/isSignedMessage.cjs');
11
12
  var isBackpackSolanaSigner = require('./utils/isBackpackSolanaSigner.cjs');
12
13
 
@@ -14,9 +15,10 @@ var isBackpackSolanaSigner = require('./utils/isBackpackSolanaSigner.cjs');
14
15
  const SolanaWalletConnectors = (props) => [
15
16
  ...fetchInjectedWalletConnectors.injectedWalletOverrides,
16
17
  ...fetchInjectedWalletConnectors.fetchInjectedWalletConnectors(props),
17
- ...turnkey.TurnkeySolanaWalletConnectors(props),
18
+ ...embeddedWalletSolana.TurnkeySolanaWalletConnectors(props),
18
19
  Phantom.Phantom,
19
20
  UnknownInjected.UnknownInjected,
21
+ FallbackSolanaConnector.FallbackSolanaConnector,
20
22
  ];
21
23
 
22
24
  exports.isSignedMessage = isSignedMessage.isSignedMessage;
package/src/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export declare const SolanaWalletConnectors: (props: any) => (import("dist/packa
3
3
  export { isSignedMessage } from './utils/isSignedMessage';
4
4
  export { isBackpackSolanaSigner } from './utils/isBackpackSolanaSigner';
5
5
  export type { ISolana, IBackpackSolanaSigner, ICoinbaseSolanaSigner, SignedMessage, ISolanaSigner, } from './types';
6
+ export type { IEmbeddedWalletSolanaSigner } from '@dynamic-labs/embedded-wallet-solana';
package/src/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  'use client'
2
- import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/turnkey';
2
+ import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/embedded-wallet-solana';
3
3
  import { Phantom } from './Phantom.js';
4
4
  import { injectedWalletOverrides, fetchInjectedWalletConnectors } from './injected/fetchInjectedWalletConnectors.js';
5
5
  import { UnknownInjected } from './injected/UnknownInjected.js';
6
+ import { FallbackSolanaConnector } from './injected/FallbackSolanaConnector.js';
6
7
  export { isSignedMessage } from './utils/isSignedMessage.js';
7
8
  export { isBackpackSolanaSigner } from './utils/isBackpackSolanaSigner.js';
8
9
 
@@ -13,6 +14,7 @@ const SolanaWalletConnectors = (props) => [
13
14
  ...TurnkeySolanaWalletConnectors(props),
14
15
  Phantom,
15
16
  UnknownInjected,
17
+ FallbackSolanaConnector,
16
18
  ];
17
19
 
18
20
  export { SolanaWalletConnectors };
@@ -0,0 +1,22 @@
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 InjectedWalletBase = require('./InjectedWalletBase.cjs');
8
+
9
+ class FallbackSolanaConnector extends InjectedWalletBase.InjectedWalletBase {
10
+ constructor(opts) {
11
+ super(opts);
12
+ this.name = 'Fallback Connector';
13
+ this.overrideKey = 'fallbackconnector';
14
+ this.isAvailable = false;
15
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
16
+ }
17
+ isInstalledOnBrowser() {
18
+ return false;
19
+ }
20
+ }
21
+
22
+ exports.FallbackSolanaConnector = FallbackSolanaConnector;
@@ -0,0 +1,9 @@
1
+ import { SolWalletConnectorOpts } from '../solWalletConnector';
2
+ import { InjectedWalletBase } from './InjectedWalletBase';
3
+ export declare class FallbackSolanaConnector extends InjectedWalletBase {
4
+ name: string;
5
+ overrideKey: string;
6
+ isAvailable: boolean;
7
+ constructor(opts: SolWalletConnectorOpts);
8
+ isInstalledOnBrowser(): boolean;
9
+ }
@@ -0,0 +1,18 @@
1
+ 'use client'
2
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
+ import { InjectedWalletBase } from './InjectedWalletBase.js';
4
+
5
+ class FallbackSolanaConnector extends InjectedWalletBase {
6
+ constructor(opts) {
7
+ super(opts);
8
+ this.name = 'Fallback Connector';
9
+ this.overrideKey = 'fallbackconnector';
10
+ this.isAvailable = false;
11
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
12
+ }
13
+ isInstalledOnBrowser() {
14
+ return false;
15
+ }
16
+ }
17
+
18
+ export { FallbackSolanaConnector };
@@ -1,2 +1,3 @@
1
1
  export * from './fetchInjectedWalletConnectors';
2
2
  export * from './UnknownInjected';
3
+ export * from './FallbackSolanaConnector';
@@ -80,9 +80,7 @@ class SolProviderHelper {
80
80
  if (!provider) {
81
81
  return undefined;
82
82
  }
83
- if (!provider.isConnected) {
84
- yield provider.connect();
85
- }
83
+ yield provider.connect();
86
84
  return (_a = provider.publicKey) === null || _a === void 0 ? void 0 : _a.toString();
87
85
  });
88
86
  }
@@ -110,9 +108,6 @@ class SolProviderHelper {
110
108
  const provider = this.findProvider();
111
109
  if (!provider)
112
110
  return undefined;
113
- if (!provider.isConnected) {
114
- yield provider.connect();
115
- }
116
111
  const encodedMessage = new TextEncoder().encode(messageToSign);
117
112
  const signedMessage = yield provider.signMessage(encodedMessage, 'utf8');
118
113
  if (!signedMessage)
@@ -76,9 +76,7 @@ class SolProviderHelper {
76
76
  if (!provider) {
77
77
  return undefined;
78
78
  }
79
- if (!provider.isConnected) {
80
- yield provider.connect();
81
- }
79
+ yield provider.connect();
82
80
  return (_a = provider.publicKey) === null || _a === void 0 ? void 0 : _a.toString();
83
81
  });
84
82
  }
@@ -106,9 +104,6 @@ class SolProviderHelper {
106
104
  const provider = this.findProvider();
107
105
  if (!provider)
108
106
  return undefined;
109
- if (!provider.isConnected) {
110
- yield provider.connect();
111
- }
112
107
  const encodedMessage = new TextEncoder().encode(messageToSign);
113
108
  const signedMessage = yield provider.signMessage(encodedMessage, 'utf8');
114
109
  if (!signedMessage)
@@ -9,6 +9,7 @@ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var utils = require('@dynamic-labs/utils');
10
10
  var walletBook = require('@dynamic-labs/wallet-book');
11
11
  var extractNonce = require('./utils/extractNonce.cjs');
12
+ var getGenesisHashLSKey = require('./utils/getGenesisHashLSKey.cjs');
12
13
 
13
14
  const MEMO_PROGRAM_ID = new web3_js.PublicKey('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr');
14
15
  class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
@@ -16,7 +17,6 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
16
17
  var _a;
17
18
  super(opts);
18
19
  this.isHardwareWalletEnabled = false;
19
- this._network = undefined;
20
20
  this.verifiedCredentials = [];
21
21
  this.supportedChains = ['SOL'];
22
22
  this.connectedChain = 'SOL';
@@ -26,11 +26,12 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
26
26
  }
27
27
  getNetwork() {
28
28
  return _tslib.__awaiter(this, void 0, void 0, function* () {
29
- if (this._network) {
30
- return this._network;
31
- }
32
29
  const provider = this.getWalletClient();
33
- let genesisHash = yield provider.getGenesisHash();
30
+ let genesisHash = localStorage.getItem(getGenesisHashLSKey.getGenesisHashLSKey(provider.rpcEndpoint));
31
+ if (!genesisHash) {
32
+ genesisHash = yield provider.getGenesisHash();
33
+ localStorage.setItem(getGenesisHashLSKey.getGenesisHashLSKey(provider.rpcEndpoint), genesisHash);
34
+ }
34
35
  genesisHash = genesisHash.substring(0, 32);
35
36
  // see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
36
37
  let network;
@@ -43,10 +44,14 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
43
44
  else {
44
45
  network = 'testnet';
45
46
  }
46
- this._network = network;
47
47
  return network;
48
48
  });
49
49
  }
50
+ endSession() {
51
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
52
+ localStorage.removeItem(getGenesisHashLSKey.getGenesisHashLSKey(this.getWalletClient().rpcEndpoint));
53
+ });
54
+ }
50
55
  getWalletClient() {
51
56
  var _a;
52
57
  const [network] = this.solNetworks;
@@ -58,7 +63,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
58
63
  }
59
64
  getPublicClient() {
60
65
  return _tslib.__awaiter(this, void 0, void 0, function* () {
61
- var _a, _b;
66
+ var _a;
62
67
  if (this.solNetworks.length === 0)
63
68
  return;
64
69
  const configurations = {
@@ -67,7 +72,10 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
67
72
  solana: this.solNetworks,
68
73
  starknet: undefined,
69
74
  };
70
- return (_b = (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.getSolanaRpcProviderByChainId(configurations, '101')) === null || _b === void 0 ? void 0 : _b.provider;
75
+ if (!this.chainRpcProviders)
76
+ return undefined;
77
+ const providers = this.chainRpcProviders.getProviders(configurations);
78
+ return (_a = this.chainRpcProviders.getSolanaProviderByChainId(providers, '101')) === null || _a === void 0 ? void 0 : _a.provider;
71
79
  });
72
80
  }
73
81
  getBalance() {
@@ -10,16 +10,15 @@ export type SolWalletConnectorOpts = {
10
10
  solNetworks: GenericNetwork[];
11
11
  walletBook: WalletBookSchema;
12
12
  };
13
- type SolanaNetwork = 'mainnet' | 'devnet' | 'testnet';
14
13
  export declare abstract class SolWalletConnector extends WalletConnectorBase implements IHardwareWalletConnector {
15
14
  isHardwareWalletEnabled: boolean;
16
- _network: SolanaNetwork | undefined;
17
15
  verifiedCredentials: JwtVerifiedCredential[];
18
16
  solNetworks: GenericNetwork[];
19
17
  supportedChains: Chain[];
20
18
  connectedChain: Chain;
21
19
  constructor(opts: SolWalletConnectorOpts);
22
20
  getNetwork(): Promise<string>;
21
+ endSession(): Promise<void>;
23
22
  getWalletClient(): Connection;
24
23
  getPublicClient(): Promise<Connection | undefined>;
25
24
  abstract getSigner(): Promise<ISolana | undefined>;
@@ -34,4 +33,3 @@ export declare abstract class SolWalletConnector extends WalletConnectorBase imp
34
33
  setVerifiedCredentials(verifiedCredentials: JwtVerifiedCredential[]): void;
35
34
  isLedgerAddress(address: string): boolean;
36
35
  }
37
- export {};
@@ -5,6 +5,7 @@ import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
5
5
  import { DynamicError, NotSupportedError, isLedgerAddressViaVerifiedCredentials } from '@dynamic-labs/utils';
6
6
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
7
7
  import { extractNonce } from './utils/extractNonce.js';
8
+ import { getGenesisHashLSKey } from './utils/getGenesisHashLSKey.js';
8
9
 
9
10
  const MEMO_PROGRAM_ID = new PublicKey('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr');
10
11
  class SolWalletConnector extends WalletConnectorBase {
@@ -12,7 +13,6 @@ class SolWalletConnector extends WalletConnectorBase {
12
13
  var _a;
13
14
  super(opts);
14
15
  this.isHardwareWalletEnabled = false;
15
- this._network = undefined;
16
16
  this.verifiedCredentials = [];
17
17
  this.supportedChains = ['SOL'];
18
18
  this.connectedChain = 'SOL';
@@ -22,11 +22,12 @@ class SolWalletConnector extends WalletConnectorBase {
22
22
  }
23
23
  getNetwork() {
24
24
  return __awaiter(this, void 0, void 0, function* () {
25
- if (this._network) {
26
- return this._network;
27
- }
28
25
  const provider = this.getWalletClient();
29
- let genesisHash = yield provider.getGenesisHash();
26
+ let genesisHash = localStorage.getItem(getGenesisHashLSKey(provider.rpcEndpoint));
27
+ if (!genesisHash) {
28
+ genesisHash = yield provider.getGenesisHash();
29
+ localStorage.setItem(getGenesisHashLSKey(provider.rpcEndpoint), genesisHash);
30
+ }
30
31
  genesisHash = genesisHash.substring(0, 32);
31
32
  // see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
32
33
  let network;
@@ -39,10 +40,14 @@ class SolWalletConnector extends WalletConnectorBase {
39
40
  else {
40
41
  network = 'testnet';
41
42
  }
42
- this._network = network;
43
43
  return network;
44
44
  });
45
45
  }
46
+ endSession() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ localStorage.removeItem(getGenesisHashLSKey(this.getWalletClient().rpcEndpoint));
49
+ });
50
+ }
46
51
  getWalletClient() {
47
52
  var _a;
48
53
  const [network] = this.solNetworks;
@@ -54,7 +59,7 @@ class SolWalletConnector extends WalletConnectorBase {
54
59
  }
55
60
  getPublicClient() {
56
61
  return __awaiter(this, void 0, void 0, function* () {
57
- var _a, _b;
62
+ var _a;
58
63
  if (this.solNetworks.length === 0)
59
64
  return;
60
65
  const configurations = {
@@ -63,7 +68,10 @@ class SolWalletConnector extends WalletConnectorBase {
63
68
  solana: this.solNetworks,
64
69
  starknet: undefined,
65
70
  };
66
- return (_b = (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.getSolanaRpcProviderByChainId(configurations, '101')) === null || _b === void 0 ? void 0 : _b.provider;
71
+ if (!this.chainRpcProviders)
72
+ return undefined;
73
+ const providers = this.chainRpcProviders.getProviders(configurations);
74
+ return (_a = this.chainRpcProviders.getSolanaProviderByChainId(providers, '101')) === null || _a === void 0 ? void 0 : _a.provider;
67
75
  });
68
76
  }
69
77
  getBalance() {
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var contants = require('../contants.cjs');
7
+
8
+ const getGenesisHashLSKey = (rpcEndpoint) => `${rpcEndpoint}_${contants.SOLANA_GENESIS_HASH}`;
9
+
10
+ exports.getGenesisHashLSKey = getGenesisHashLSKey;
@@ -0,0 +1 @@
1
+ export declare const getGenesisHashLSKey: (rpcEndpoint: string) => string;
@@ -0,0 +1,6 @@
1
+ 'use client'
2
+ import { SOLANA_GENESIS_HASH } from '../contants.js';
3
+
4
+ const getGenesisHashLSKey = (rpcEndpoint) => `${rpcEndpoint}_${SOLANA_GENESIS_HASH}`;
5
+
6
+ export { getGenesisHashLSKey };