@dynamic-labs/solana 2.0.0 → 2.0.2

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,25 @@
1
1
 
2
+ ### [2.0.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.1...v2.0.2) (2024-04-19)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * buffer polyfill for utils package ([#5404](https://github.com/dynamic-labs/DynamicAuth/issues/5404)) ([#5405](https://github.com/dynamic-labs/DynamicAuth/issues/5405)) ([679c197](https://github.com/dynamic-labs/DynamicAuth/commit/679c197a52969a0db614ed280d7b9a0bf172bf72))
8
+
9
+ ### [2.0.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0...v2.0.1) (2024-04-18)
10
+
11
+
12
+ ### Features
13
+
14
+ * add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([#5383](https://github.com/dynamic-labs/DynamicAuth/issues/5383)) ([d031d7e](https://github.com/dynamic-labs/DynamicAuth/commit/d031d7ee5705de5ec83ef328f03633d5f3524786))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * copy and ui fixes ([#5367](https://github.com/dynamic-labs/DynamicAuth/issues/5367)) ([e39ea97](https://github.com/dynamic-labs/DynamicAuth/commit/e39ea97d98de6b7087c24f2326a5fdc07ab9c8c3))
20
+ * bitcoin connector improvements
21
+ * solana package improvements ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([#5385](https://github.com/dynamic-labs/DynamicAuth/issues/5385)) ([9010bce](https://github.com/dynamic-labs/DynamicAuth/commit/9010bcebb4b0f2d293d517347187d38accbac0d3))
22
+
2
23
  ## [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)
3
24
 
4
25
  ## [2.0.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.30...v2.0.0-alpha.31) (2024-04-11)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
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",
29
+ "@solana/web3.js": "1.91.6",
30
30
  "@dynamic-labs/sdk-api-core": "0.0.418",
31
31
  "bs58": "5.0.0",
32
32
  "tweetnacl": "1.0.3",
33
- "@dynamic-labs/rpc-provider-solana": "2.0.0",
34
- "@dynamic-labs/rpc-providers": "2.0.0",
35
- "@dynamic-labs/turnkey": "2.0.0",
36
- "@dynamic-labs/types": "2.0.0",
37
- "@dynamic-labs/utils": "2.0.0",
38
- "@dynamic-labs/wallet-book": "2.0.0",
39
- "@dynamic-labs/wallet-connector-core": "2.0.0",
33
+ "@dynamic-labs/rpc-provider-solana": "2.0.2",
34
+ "@dynamic-labs/rpc-providers": "2.0.2",
35
+ "@dynamic-labs/turnkey": "2.0.2",
36
+ "@dynamic-labs/types": "2.0.2",
37
+ "@dynamic-labs/utils": "2.0.2",
38
+ "@dynamic-labs/wallet-book": "2.0.2",
39
+ "@dynamic-labs/wallet-connector-core": "2.0.2",
40
40
  "eventemitter3": "5.0.1"
41
41
  },
42
42
  "peerDependencies": {}
@@ -21,8 +21,8 @@ class CoinbaseSolana extends InjectedWalletBase.InjectedWalletBase {
21
21
  this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
22
22
  }
23
23
  getSigner() {
24
- var _a;
25
24
  return _tslib.__awaiter(this, void 0, void 0, function* () {
25
+ var _a;
26
26
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
27
27
  });
28
28
  }
@@ -17,8 +17,8 @@ class CoinbaseSolana extends InjectedWalletBase {
17
17
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
18
18
  }
19
19
  getSigner() {
20
- var _a;
21
20
  return __awaiter(this, void 0, void 0, function* () {
21
+ var _a;
22
22
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
23
23
  });
24
24
  }
package/src/Solflare.cjs CHANGED
@@ -15,8 +15,8 @@ class Solflare extends InjectedWalletBase.InjectedWalletBase {
15
15
  this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
16
16
  }
17
17
  getAddress() {
18
- var _a, _b, _c, _d, _e;
19
18
  return _tslib.__awaiter(this, void 0, void 0, function* () {
19
+ var _a, _b, _c, _d, _e;
20
20
  /**
21
21
  * It should redirect to in-app browser if on mobile and if not in the in-app browser,
22
22
  * this checks if it is not in the in-app browser by checking if the provider is not available.
@@ -58,8 +58,8 @@ class Solflare extends InjectedWalletBase.InjectedWalletBase {
58
58
  });
59
59
  }
60
60
  getConnectedAccounts() {
61
- var _a;
62
61
  return _tslib.__awaiter(this, void 0, void 0, function* () {
62
+ var _a;
63
63
  const provider = this.getProvider();
64
64
  if (!provider)
65
65
  return [];
package/src/Solflare.js CHANGED
@@ -11,8 +11,8 @@ class Solflare extends InjectedWalletBase {
11
11
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
12
12
  }
13
13
  getAddress() {
14
- var _a, _b, _c, _d, _e;
15
14
  return __awaiter(this, void 0, void 0, function* () {
15
+ var _a, _b, _c, _d, _e;
16
16
  /**
17
17
  * It should redirect to in-app browser if on mobile and if not in the in-app browser,
18
18
  * this checks if it is not in the in-app browser by checking if the provider is not available.
@@ -54,8 +54,8 @@ class Solflare extends InjectedWalletBase {
54
54
  });
55
55
  }
56
56
  getConnectedAccounts() {
57
- var _a;
58
57
  return __awaiter(this, void 0, void 0, function* () {
58
+ var _a;
59
59
  const provider = this.getProvider();
60
60
  if (!provider)
61
61
  return [];
@@ -15,8 +15,8 @@ class BackpackSol extends InjectedWalletBase.InjectedWalletBase {
15
15
  this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
16
16
  }
17
17
  getSigner() {
18
- var _a;
19
18
  return _tslib.__awaiter(this, void 0, void 0, function* () {
19
+ var _a;
20
20
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
21
21
  });
22
22
  }
@@ -11,8 +11,8 @@ class BackpackSol extends InjectedWalletBase {
11
11
  this.wallet = findWalletBookWallet(this.walletBook, this.key);
12
12
  }
13
13
  getSigner() {
14
- var _a;
15
14
  return __awaiter(this, void 0, void 0, function* () {
15
+ var _a;
16
16
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
17
17
  });
18
18
  }
@@ -31,14 +31,14 @@ class InjectedWalletBase extends solWalletConnector.SolWalletConnector {
31
31
  (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a._teardownEventListeners();
32
32
  }
33
33
  connect() {
34
- var _a;
35
34
  return _tslib.__awaiter(this, void 0, void 0, function* () {
35
+ var _a;
36
36
  yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect());
37
37
  });
38
38
  }
39
39
  getSigner() {
40
- var _a;
41
40
  return _tslib.__awaiter(this, void 0, void 0, function* () {
41
+ var _a;
42
42
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
43
43
  });
44
44
  }
@@ -47,16 +47,16 @@ class InjectedWalletBase extends solWalletConnector.SolWalletConnector {
47
47
  return Boolean((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.isInstalledHelper());
48
48
  }
49
49
  getAddress() {
50
- var _a;
51
50
  return _tslib.__awaiter(this, void 0, void 0, function* () {
51
+ var _a;
52
52
  if (!this.isInstalledOnBrowser())
53
53
  return;
54
54
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress();
55
55
  });
56
56
  }
57
57
  signMessage(messageToSign) {
58
- var _a, _b;
59
58
  return _tslib.__awaiter(this, void 0, void 0, function* () {
59
+ var _a, _b;
60
60
  const walletAddress = yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress());
61
61
  if (walletAddress && this.isLedgerAddress(walletAddress)) {
62
62
  throw new SignMessageNotSupportedError.SignMessageNotSupportedError(this.name);
@@ -65,8 +65,8 @@ class InjectedWalletBase extends solWalletConnector.SolWalletConnector {
65
65
  });
66
66
  }
67
67
  getConnectedAccounts() {
68
- var _a, _b;
69
68
  return _tslib.__awaiter(this, void 0, void 0, function* () {
69
+ var _a, _b;
70
70
  return (_b = (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getConnectedAccounts()) !== null && _b !== void 0 ? _b : [];
71
71
  });
72
72
  }
@@ -27,14 +27,14 @@ class InjectedWalletBase extends SolWalletConnector {
27
27
  (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a._teardownEventListeners();
28
28
  }
29
29
  connect() {
30
- var _a;
31
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ var _a;
32
32
  yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect());
33
33
  });
34
34
  }
35
35
  getSigner() {
36
- var _a;
37
36
  return __awaiter(this, void 0, void 0, function* () {
37
+ var _a;
38
38
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.connect();
39
39
  });
40
40
  }
@@ -43,16 +43,16 @@ class InjectedWalletBase extends SolWalletConnector {
43
43
  return Boolean((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.isInstalledHelper());
44
44
  }
45
45
  getAddress() {
46
- var _a;
47
46
  return __awaiter(this, void 0, void 0, function* () {
47
+ var _a;
48
48
  if (!this.isInstalledOnBrowser())
49
49
  return;
50
50
  return (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress();
51
51
  });
52
52
  }
53
53
  signMessage(messageToSign) {
54
- var _a, _b;
55
54
  return __awaiter(this, void 0, void 0, function* () {
55
+ var _a, _b;
56
56
  const walletAddress = yield ((_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getAddress());
57
57
  if (walletAddress && this.isLedgerAddress(walletAddress)) {
58
58
  throw new SignMessageNotSupportedError(this.name);
@@ -61,8 +61,8 @@ class InjectedWalletBase extends SolWalletConnector {
61
61
  });
62
62
  }
63
63
  getConnectedAccounts() {
64
- var _a, _b;
65
64
  return __awaiter(this, void 0, void 0, function* () {
65
+ var _a, _b;
66
66
  return (_b = (_a = this.getSolProviderHelper()) === null || _a === void 0 ? void 0 : _a.getConnectedAccounts()) !== null && _b !== void 0 ? _b : [];
67
67
  });
68
68
  }
@@ -35,8 +35,8 @@ class PhantomRedirect extends solWalletConnector.SolWalletConnector {
35
35
  });
36
36
  }
37
37
  connect() {
38
- var _a, _b;
39
38
  return _tslib.__awaiter(this, void 0, void 0, function* () {
39
+ var _a, _b;
40
40
  // Generate a new key pair
41
41
  const keyPair = nacl__default["default"].box.keyPair();
42
42
  storage.storage.encryptionPublicKey.set(keyPair.publicKey);
@@ -26,8 +26,8 @@ class PhantomRedirect extends SolWalletConnector {
26
26
  });
27
27
  }
28
28
  connect() {
29
- var _a, _b;
30
29
  return __awaiter(this, void 0, void 0, function* () {
30
+ var _a, _b;
31
31
  // Generate a new key pair
32
32
  const keyPair = nacl.box.keyPair();
33
33
  storage.encryptionPublicKey.set(keyPair.publicKey);
@@ -61,8 +61,8 @@ class SolProviderHelper {
61
61
  return this.findProvider() !== undefined;
62
62
  }
63
63
  getAddress() {
64
- var _a;
65
64
  return _tslib.__awaiter(this, void 0, void 0, function* () {
65
+ var _a;
66
66
  const provider = this.findProvider();
67
67
  if (!provider) {
68
68
  return undefined;
@@ -108,8 +108,8 @@ class SolProviderHelper {
108
108
  });
109
109
  }
110
110
  handleAccountChange(walletConnector, web3Provider, address) {
111
- var _a;
112
111
  return _tslib.__awaiter(this, void 0, void 0, function* () {
112
+ var _a;
113
113
  if (!address) {
114
114
  yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
115
115
  if ((_a = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _a === void 0 ? void 0 : _a.toString()) {
@@ -136,8 +136,8 @@ class SolProviderHelper {
136
136
  provider.removeAllListeners();
137
137
  }
138
138
  getConnectedAccounts() {
139
- var _a, _b;
140
139
  return _tslib.__awaiter(this, void 0, void 0, function* () {
140
+ var _a, _b;
141
141
  const provider = this.findProvider();
142
142
  if (!provider)
143
143
  return [];
@@ -57,8 +57,8 @@ class SolProviderHelper {
57
57
  return this.findProvider() !== undefined;
58
58
  }
59
59
  getAddress() {
60
- var _a;
61
60
  return __awaiter(this, void 0, void 0, function* () {
61
+ var _a;
62
62
  const provider = this.findProvider();
63
63
  if (!provider) {
64
64
  return undefined;
@@ -104,8 +104,8 @@ class SolProviderHelper {
104
104
  });
105
105
  }
106
106
  handleAccountChange(walletConnector, web3Provider, address) {
107
- var _a;
108
107
  return __awaiter(this, void 0, void 0, function* () {
108
+ var _a;
109
109
  if (!address) {
110
110
  yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
111
111
  if ((_a = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _a === void 0 ? void 0 : _a.toString()) {
@@ -132,8 +132,8 @@ class SolProviderHelper {
132
132
  provider.removeAllListeners();
133
133
  }
134
134
  getConnectedAccounts() {
135
- var _a, _b;
136
135
  return __awaiter(this, void 0, void 0, function* () {
136
+ var _a, _b;
137
137
  const provider = this.findProvider();
138
138
  if (!provider)
139
139
  return [];
@@ -49,8 +49,8 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
49
49
  return new web3_js.Connection(rpcUrl, 'confirmed');
50
50
  }
51
51
  getPublicClient() {
52
- var _a, _b;
53
52
  return _tslib.__awaiter(this, void 0, void 0, function* () {
53
+ var _a, _b;
54
54
  if (this.solNetworks.length === 0)
55
55
  return;
56
56
  const configurations = {
@@ -45,8 +45,8 @@ class SolWalletConnector extends WalletConnectorBase {
45
45
  return new Connection(rpcUrl, 'confirmed');
46
46
  }
47
47
  getPublicClient() {
48
- var _a, _b;
49
48
  return __awaiter(this, void 0, void 0, function* () {
49
+ var _a, _b;
50
50
  if (this.solNetworks.length === 0)
51
51
  return;
52
52
  const configurations = {